Skip to content

Commit

Permalink
Single-digit catalogue number returns title search
Browse files Browse the repository at this point in the history
  • Loading branch information
Open Opus committed Apr 26, 2020
1 parent 2ceabea commit 944481d
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions html/dyn/work/detail.phtml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
{
preg_match_all (CATALOGUE_REGEX, $works[0]["title"], $matches);

if (sizeof ($matches[0]) && strlen(trim(end($matches[8]))) > 1)
if (sizeof ($matches[0]))
{
$works[0]["searchmode"] = "catalogue";
$works[0]["catalogue"] = trim(end($matches[2]));
Expand All @@ -44,13 +44,14 @@
}
}

$works[0]["searchterms"] = [$search];
}
elseif (sizeof ($matches[0]))
{
$works[0]["searchmode"] = "title";
$works[0]["searchterms"] = [worksimplifier ($works[0]["title"]). " ". trim(end($matches[2])). " ". trim(end($matches[8]))];
$number = false;
if (strlen(trim(end($matches[8]))) > 1)
{
$works[0]["searchterms"] = [$search];
}
else
{
$works[0]["searchterms"] = [worksimplifier ($works[0]["title"]). " {$works[0]["catalogue"]} {$works[0]["catalogue_number"]}"];
}
}
else
{
Expand Down

0 comments on commit 944481d

Please sign in to comment.