summaryrefslogtreecommitdiff
path: root/net/phpldapadmin/files/patch-lib_Visitor.php
diff options
context:
space:
mode:
Diffstat (limited to 'net/phpldapadmin/files/patch-lib_Visitor.php')
-rw-r--r--net/phpldapadmin/files/patch-lib_Visitor.php43
1 files changed, 43 insertions, 0 deletions
diff --git a/net/phpldapadmin/files/patch-lib_Visitor.php b/net/phpldapadmin/files/patch-lib_Visitor.php
new file mode 100644
index 000000000000..2ba2a552d833
--- /dev/null
+++ b/net/phpldapadmin/files/patch-lib_Visitor.php
@@ -0,0 +1,43 @@
+--- lib/Visitor.php.orig 2021-12-12 02:35:51 UTC
++++ lib/Visitor.php
+@@ -22,6 +22,15 @@ abstract class Visitor {
+ protected $server_id;
+
+ public function __call($method,$args) {
++ # This mapping array allows to map effective class names to
++ # function name suffixes.
++ # It has been introduced when class Attribute has been renamed
++ # to PLAAttribute to avoid a name clash with the built-in
++ # class of PHP 8.
++ # Entering a class name mapping here allows to rename the
++ # class without having to rename the methods too.
++ static $classmap = array('PLAAttribute' => 'Attribute');
++
+ if (DEBUG_ENABLED && (($fargs=func_get_args())||$fargs='NOARGS'))
+ debug_log('Entered (%%)',129,0,__FILE__,__LINE__,__METHOD__,$fargs);
+
+@@ -33,19 +42,14 @@ abstract class Visitor {
+ $fnct = array_shift($args);
+
+ $object = $args[0];
+- $class = get_class($object);
+
+- $call = "$method$fnct$class";
+-
+- array_push($methods,$call);
+-
+- while ($class && ! method_exists($this,$call)) {
++ for ($class = get_class($object); $class; $class = get_parent_class($class)) {
++ $call = isset($classmap[$class])? "$method$fnct$classmap[$class]": "$method$fnct$class";
++ array_push($methods,$call);
++ if (method_exists($this,$call))
++ break;
+ if (defined('DEBUGTMP') && DEBUGTMP)
+ printf('<font size=-2><i>Class (%s): Method doesnt exist (%s,%s)</i></font><br />',$class,get_class($this),$call);
+-
+- $class = get_parent_class($class);
+- $call = "$method$fnct$class";
+- array_push($methods,$call);
+ }
+
+ if (defined('DEBUGTMP') && DEBUGTMP)