diff --git a/module/VuFind/src/VuFind/ILS/Driver/Unicorn.php b/module/VuFind/src/VuFind/ILS/Driver/Unicorn.php
index 8f76f26b52306c30857ab4faf6958fff4d17eadf..b51e8ea1cc2115f2c41b2255b51b19e75bd68329 100644
--- a/module/VuFind/src/VuFind/ILS/Driver/Unicorn.php
+++ b/module/VuFind/src/VuFind/ILS/Driver/Unicorn.php
@@ -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);
         }
 
diff --git a/module/VuFind/src/VuFind/RecordDriver/EDS.php b/module/VuFind/src/VuFind/RecordDriver/EDS.php
index 4de14e3ebcb7fdd27a9e7c3bd24be78f5971b2b4..bd3b2e9a7b0369cbca5e99fda48dd44d66151f6c 100644
--- a/module/VuFind/src/VuFind/RecordDriver/EDS.php
+++ b/module/VuFind/src/VuFind/RecordDriver/EDS.php
@@ -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;