Skip to content

Commit

Permalink
Merge pull request #1 from dof-dss/info-library
Browse files Browse the repository at this point in the history
Adding edge case for new library URL
  • Loading branch information
soda736 authored May 15, 2023
2 parents df3ed39 + 5ba3397 commit a05f0bb
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/Utils.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,12 @@ public static function createApplicationId($name) {
* Machine safe site ID.
*/
public static function createSiteId($url) {
$url = strtolower(str_replace('-', '', $url));
if ($url === 'https://info.library.nics.gov.uk') {
$url = 'https://infolibrarynics.gov.uk';
}
else {
$url = strtolower(str_replace('-', '', $url));
}

// Strip http, www and domain to leave site name.
preg_match_all('/(http:\/\/)*(?:www\.)?([a-z0-9\-]+)(?:\.[a-z\.]+[\/]?).*/', $url, $matches, PREG_SET_ORDER, 0);
Expand Down

0 comments on commit a05f0bb

Please sign in to comment.