Fixed bug #11937: Do not show E_DEPRECATED messages on productive systems
[Packages/TYPO3.CMS.git] / t3lib / class.t3lib_arraybrowser.php
index 01f32be..cb6dbe9 100644 (file)
@@ -2,7 +2,7 @@
 /***************************************************************
 *  Copyright notice
 *
-*  (c) 1999-2005 Kasper Skaarhoj (kasperYYYY@typo3.com)
+*  (c) 1999-2009 Kasper Skaarhoj (kasperYYYY@typo3.com)
 *  All rights reserved
 *
 *  This script is part of the TYPO3 project. The TYPO3 project is
@@ -81,6 +81,7 @@ class t3lib_arrayBrowser      {
        var $searchKeys = array();              // After calling the getSearchKeys function this array is populated with the key-positions in the array which contains values matching the search.
        var $fixedLgd=1;                                // If set, the values are truncated with "..." appended if longer than a certain length.
        var $regexMode=0;                               // If set, search for string with regex, otherwise stristr()
+       var $searchKeysToo=FALSE;               // If set, array keys are subject to the search too.
        var $varName='';                                // Set var name here if you want links to the variable name.
 
        /**
@@ -136,7 +137,7 @@ class t3lib_arrayBrowser    {
                                        $theValue = $this->fixed_lgd($theValue,$lgdChars);
                                }
                                if ($this->searchKeys[$depth])  {
-                                       $HTML.='=<span style="color:red;">'.$this->wrapValue($theValue,$depth).'</font>';
+                                       $HTML.='=<span style="color:red;">'.$this->wrapValue($theValue,$depth).'</span>';
                                } else {
                                        $HTML.='='.$this->wrapValue($theValue,$depth);
                                }
@@ -202,9 +203,9 @@ class t3lib_arrayBrowser    {
                        $deeper = is_array($keyArr[$key]);
 
                        if ($this->regexMode)   {
-                               if (ereg($searchString,$keyArr[$key]))  {       $this->searchKeys[$depth]=1;    }
+                               if (preg_match('/'.$searchString.'/',$keyArr[$key]) || ($this->searchKeysToo && preg_match('/'.$searchString.'/',$key)))        {       $this->searchKeys[$depth]=1;    }
                        } else {
-                               if (stristr($keyArr[$key],$searchString)      {       $this->searchKeys[$depth]=1;    }
+                               if (stristr($keyArr[$key],$searchString) || ($this->searchKeysToo && stristr($key,$searchString)))      {       $this->searchKeys[$depth]=1;    }
                        }
 
                        if ($deeper)    {