Menu

#1251 Patch to adapt control flow after trigger_error in Registry.php

XOOPS_2.6.x
open
nobody
None
1
2013-01-28
2013-01-28
Alain91
No
Index: registry.php
===================================================================
--- registry.php    (revision 556)
+++ registry.php    (working copy)
@@ -80,6 +80,7 @@
     {
         if (self::$_registry !== null) {
             trigger_error('Registry is already initialized');
+           return false;
         }

         self::setClassName(get_class($registry));
@@ -110,10 +111,12 @@
     {
         if (self::$_registry !== null) {
             trigger_error('Registry is already initialized');
+           return false;
         }

         if (!is_string($registryClassName)) {
             trigger_error("Argument is not a class name");
+           return false;
         }

         self::$_registryClassName = $registryClassName;
@@ -146,6 +149,7 @@

         if (!$instance->offsetExists($index)) {
             trigger_error("No entry is registered for key '$index'");
+           return false;
         }

         return $instance->offsetGet($index);

Discussion


Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.