php8 compat (probably breaks php5 now)
authorAlan <alan@roojs.com>
Thu, 18 Jan 2024 08:21:25 +0000 (16:21 +0800)
committerAlan <alan@roojs.com>
Thu, 18 Jan 2024 08:21:25 +0000 (16:21 +0800)
RooPostTrait.php

index 9f6b9c9..3389036 100644 (file)
@@ -189,8 +189,13 @@ trait Pman_Core_RooPostTrait {
        // echo '<PRE>';print_r($affects);exit;
        // DB_Dataobject::debugLevel(1);
        
-        
-        $clean = create_function('$v', 'return (int)$v;');
+        if (function_exists('create_function')) {
+            $clean = create_function('$v', 'return (int)$v;');
+        } else {
+            $clean = function($v) {
+                return (int)$v;
+            };
+        }
         
         $bits = array_map($clean, explode(',', $req['_delete']));