[TYPO3-core] Patch: indexed_search and default language name

Dmitry Dulepov dima at spamcop.net
Sat Jan 7 23:05:49 CET 2006


Hi!

Sebastian Kurfuerst wrote:
>>+        $tsConfig = $GLOBALS['TSFE']->getPagesTSconfig();
>>+        if (is_array($tsConfig)) {
>>+            if (isset($tsConfig['mod.']['SHARED.']['defaultLanguage.']['title'])) {
>>+                $this->optValues['lang'][0] = $tsConfig['mod.']['SHARED.']['defaultLanguage.']['title'];
>>+            }
>>+        }
>>+
> 
> I am not sure if this might trigger an error in PHP 5 when the TSconfig
> is not set as we don't check if every sub-key exists. Does isset()
> handle that?
> If yes, and there are no problems with php5, +1

Firsts, TSConfig will always exist in general (getPagesTSconfig() ensures this).
Secondly, manual on php.net have an example for isset with non-existing key in
array. So it should work. To test it I installed PHP 5 and run the above quoted
code in a standalone file with error_reporting set to E_ALL. No errors, warnings
or notices. So this patch is safe for PHP 5.1.1 with "recommended" ini settings.

Dmitry.



More information about the TYPO3-team-core mailing list