cvs: phpweb /include langchooser.inc prepend.inc

From: Date: Sun, 24 Feb 2008 22:16:44 +0000
Subject: cvs: phpweb /include langchooser.inc prepend.inc
Groups: php.webmaster 
Request: Send a blank email to php-webmaster+get-1157@lists.php.net to get a copy of this message
bjori Sun Feb 24 22:16:44 2008 UTC Modified files: /phpweb/include prepend.inc langchooser.inc Log: Add support for PHP 5.3 and 6 *sigh* http://cvs.php.net/viewvc.cgi/phpweb/include/prepend.inc?r1=1.38&r2=1.39&diff_format=u Index: phpweb/include/prepend.inc diff -u phpweb/include/prepend.inc:1.38 phpweb/include/prepend.inc:1.39 --- phpweb/include/prepend.inc:1.38 Fri Mar 2 14:53:46 2007 +++ phpweb/include/prepend.inc Sun Feb 24 22:16:44 2008 @@ -1,6 +1,6 @@ <?php // -*- C++ -*- -// $Id: prepend.inc,v 1.38 2007/03/02 14:53:46 bjori Exp $ +// $Id: prepend.inc,v 1.39 2008/02/24 22:16:44 bjori Exp $ // See http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.9 // for cache control header descriptions (used in many places on the site). @@ -24,9 +24,14 @@ myphpnet_load(); // Put the magic quotes setting to $MQ -$MQ = (boolean) get_magic_quotes_gpc(); -// Turn off runtime magic quoting -set_magic_quotes_runtime(0); +if (function_exists("get_magic_quotes_gpc")) { + $MQ = (boolean) @get_magic_quotes_gpc(); + + // Turn off runtime magic quoting + @set_magic_quotes_runtime(0); +} else { + $MQ = false; +} // Check for APC support $APC = function_exists('apc_store'); http://cvs.php.net/viewvc.cgi/phpweb/include/langchooser.inc?r1=1.34&r2=1.35&diff_format=u Index: phpweb/include/langchooser.inc diff -u phpweb/include/langchooser.inc:1.34 phpweb/include/langchooser.inc:1.35 --- phpweb/include/langchooser.inc:1.34 Sat May 12 15:43:49 2007 +++ phpweb/include/langchooser.inc Sun Feb 24 22:16:44 2008 @@ -1,6 +1,6 @@ <?php // -*- C++ -*- -// $Id: langchooser.inc,v 1.34 2007/05/12 15:43:49 bjori Exp $ +// $Id: langchooser.inc,v 1.35 2008/02/24 22:16:44 bjori Exp $ /* @@ -174,10 +174,10 @@ // Add a language to the possible languages' list function language_add($langcode, &$langs) { - global $LANGUAGES, $INACTIVE_ONLINE_LANGUAGES; + global $LANGUAGES, $INACTIVE_ONLINE_LANGUAGES, $MQ; // Make language code lowercase, html encode special chars and remove slashes - $langcode = strtolower(htmlspecialchars(get_magic_quotes_gpc() ? stripslashes($langcode) : $langcode)); + $langcode = strtolower(htmlspecialchars($MQ ? stripslashes($langcode) : $langcode)); // The Brazilian Portuguese code needs special attention if ($langcode == 'pt_br') { $langcode = 'pt_BR'; }

« previous php.webmaster (#1157) next »