From: SourceForge.net <no...@so...> - 2009-11-15 12:34:59
|
Bugs item #2897990, was opened at 2009-11-15 13:34 Message generated for change (Tracker Item Submitted) made by bochoven You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=108956&aid=2897990&group_id=8956 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: User Group: 2.1.3 Status: Open Resolution: None Priority: 5 Private: No Submitted By: Arjen van Bochoven (bochoven) Assigned to: Nobody/Anonymous (nobody) Summary: uninitialized GLOBALS array breaks esp_setlocale() Initial Comment: On line 94 of php.ini.fixed, a call is made to esp_setlocale_ex() which in turn calls esp_setlocale() (both live in espi18n.inc). On line 110, 114 and 115 of espi18n.inc, esp_setlocale() accesses $ESPCONFIG as a global variable, which is not initialized yet. Initialization of $GLOBALS['ESPCONFIG'] happens at the end of php.ini.fixed, so after the part that references esp_setlocale(); As a quick fix I moved the initialization part above the esp_setlocale() calls. As a consequence, all references to the ESPCONFIG array that come after that have to be changed to $GLOBALS['ESPCONFIG'] here's my changed code for php.ini.fixed starting on line 91 till the end of the file: if (isset($GLOBALS)) { $GLOBALS['ESPCONFIG'] = $ESPCONFIG; } else { global $ESPCONFIG; } // Load I18N support require_once($GLOBALS['ESPCONFIG']['include_path'] . '/lib/espi18n' . $GLOBALS['ESPCONFIG']['extension']); if (isset($_REQUEST['lang'])) { esp_setlocale_ex($_REQUEST['lang']); $_SESSION['language']=$_REQUEST['lang']; } elseif (isset($lang)) { esp_setlocale_ex($lang); $_SESSION['language']=$lang; } elseif (isset($_SESSION['language'])) { esp_setlocale_ex($_SESSION['language']); } else { esp_setlocale_ex(); } // default thank you messages $GLOBALS['ESPCONFIG']['thank_head'] = _('Thank You For Completing This Survey.'); $GLOBALS['ESPCONFIG']['thank_body'] = _('Please do not use the back button on your browser to go back.'); if (!file_exists($GLOBALS['ESPCONFIG']['include_path']. '/funcs'. $GLOBALS['ESPCONFIG']['extension'])) { printf('<b>'. _('Unable to find the phpESP %s directory. Please check %s to ensure that all paths are set correctly.') . '</b>', 'include', 'phpESP.ini.php'); exit; } if (!file_exists($GLOBALS['ESPCONFIG']['css_path'])) { printf('<b>'. _('Unable to find the phpESP %s directory. Please check %s to ensure that all paths are set correctly.') . '</b>', 'css', 'phpESP.ini.php'); exit; } require_once($GLOBALS['ESPCONFIG']['include_path'].'/funcs'.$GLOBALS['ESPCONFIG']['extension']); ?> ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=108956&aid=2897990&group_id=8956 |