Fixed bug #11815: Saving translation settings in EM: strcmp() throws warning with...
authorFrancois Suter <francois.suter@typo3.org>
Fri, 15 Jan 2010 09:06:20 +0000 (09:06 +0000)
committerFrancois Suter <francois.suter@typo3.org>
Fri, 15 Jan 2010 09:06:20 +0000 (09:06 +0000)
git-svn-id: https://svn.typo3.org/TYPO3v4/Core/trunk@6782 709f56b5-9817-0410-a4d7-c38de5d9e867

ChangeLog
t3lib/class.t3lib_befunc.php

index 30b397d..badf186 100755 (executable)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2010-01-15  Francois Suter  <francois@typo3.org>
+
+       * Fixed bug #11815: Saving translation settings in EM: strcmp() throws warning with PHP5.3 (Thanks to Steffen Gebert, Stefan Geith and Rupert Germann)
+
 2010-01-14  Dmitry Dulepov  <dmitry.dulepov+typo3svn@gmail.com>
 
        * Fixed bug #13146: Authentication Bypass in TYPO3 Core (OpenID)
index 0583010..d99177f 100644 (file)
@@ -2939,11 +2939,23 @@ final class t3lib_BEfunc {
                        }
                        if (is_array($MOD_MENU)) {
                                foreach ($MOD_MENU as $key=>$var) {
+
                                                // If a global var is set before entering here. eg if submitted, then it's substituting the current value the array.
-                                       if (is_array($CHANGED_SETTINGS) && isset($CHANGED_SETTINGS[$key]) && strcmp($settings[$key], $CHANGED_SETTINGS[$key])) {
-                                               $settings[$key] = (string)$CHANGED_SETTINGS[$key];
-                                               $changed = 1;
-                                       }
+                                       if (is_array($CHANGED_SETTINGS) && isset($CHANGED_SETTINGS[$key])) {
+                                               if (is_array($CHANGED_SETTINGS[$key])) {
+                                                       $serializedSettings = serialize($CHANGED_SETTINGS[$key]);
+                                                       if (strcmp($settings[$key], $serializedSettings)) {
+                                                               $settings[$key] = $serializedSettings;
+                                                               $changed = 1;
+                                                       }
+                                               } else {
+                                                       if (strcmp($settings[$key], $CHANGED_SETTINGS[$key]) ) {
+                                                               $settings[$key] = $CHANGED_SETTINGS[$key];
+                                                               $changed = 1;
+                                                       }
+                                               }
+                                       }
+
                                                // If the $var is an array, which denotes the existence of a menu, we check if the value is permitted
                                        if (is_array($var) && (!$dontValidateList || !t3lib_div::inList($dontValidateList, $key))) {
                                                        // If the setting is an array or not present in the menu-array, MOD_MENU, then the default value is inserted.