Skip to content
Snippets Groups Projects
Commit d356a72e authored by Demian Katz's avatar Demian Katz
Browse files

Merge branch 'release-4.1'

parents 4a8f6079 2462657d
No related merge requests found
......@@ -319,14 +319,13 @@ class Unicorn extends AbstractBase implements \VuFindHttp\HttpServiceAwareInterf
if (!empty($items)) {
// sort the items by shelving key in descending order, then ascending by
// copy number; use create_function to create anonymous comparison
// function for php 5.2 compatibility
$cmp = create_function(
'$a,$b',
'if ($a["shelving_key"] == $b["shelving_key"]) '
. 'return $a["number"] - $b["number"];'
. 'return $a["shelving_key"] < $b["shelving_key"] ? 1 : -1;'
);
// copy number
$cmp = function ($a, $b) {
if ($a['shelving_key'] == $b['shelving_key']) {
return $a['number'] - $b['number'];
}
return $a['shelving_key'] < $b['shelving_key'] ? 1 : -1;
};
usort($items, $cmp);
}
return $items;
......@@ -819,14 +818,12 @@ class Unicorn extends AbstractBase implements \VuFindHttp\HttpServiceAwareInterf
if (!empty($items)) {
// sort the items by due date
// use create_function to create anonymous comparison
// function for php 5.2 compatibility
$cmp = create_function(
'$a,$b',
'if ($a["duedate_raw"] == $b["duedate_raw"]) '
. 'return $a["id"] < $b["id"] ? -1 : 1;'
. 'return $a["duedate_raw"] < $b["duedate_raw"] ? -1 : 1;'
);
$cmp = function ($a, $b) {
if ($a['duedate_raw'] == $b['duedate_raw']) {
return $a['id'] < $b['id'] ? -1 : 1;
}
return $a['duedate_raw'] < $b['duedate_raw'] ? -1 : 1;
};
usort($items, $cmp);
}
......
......@@ -407,10 +407,10 @@ class EDS extends DefaultRecord
{
$linkedString = preg_replace_callback(
"/\b(https?):\/\/([-A-Z0-9+&@#\/%?=~_|!:,.;]*[-A-Z0-9+&@#\/%=~_|]*)\b/i",
create_function(
'$matches',
'return "<a href=\'".($matches[0])."\'>".($matches[0])."</a>";'
),
function ($matches) {
return "<a href='" . $matches[0] . "'>"
. htmlentities($matches[0]) . "</a>";
},
$string
);
return $linkedString;
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment