Update of /cvsroot/php-blog/serendipity/include
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15691/include
Modified Files:
functions_smarty.inc.php lang.inc.php
Log Message:
* Force 'display_errors' to true if production variable is set to FALSE
* Set production variable to FALSE in all alpha|beta|cvs versions for easier debugging from people of the forums
* Fix mbstring functions, mb_strtoupper is only available since PHP 4.3.0. :(
* Only set smarty debugging vars if production variable is set to 'debug' manually.
Index: functions_smarty.inc.php
===================================================================
RCS file: /cvsroot/php-blog/serendipity/include/functions_smarty.inc.php,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -d -r1.9 -r1.10
--- functions_smarty.inc.php 1 Dec 2004 11:00:55 -0000 1.9
+++ functions_smarty.inc.php 10 Dec 2004 16:47:29 -0000 1.10
@@ -111,7 +111,7 @@
@define('SMARTY_DIR', S9Y_INCLUDE_PATH . 'bundled-libs/Smarty/libs/');
require_once SMARTY_DIR . 'Smarty.class.php';
$serendipity['smarty'] = new Smarty;
- if (!$serendipity['production']) {
+ if ($serendipity['production'] === 'debug') {
$serendipity['smarty']->force_compile = true;
$serendipity['smarty']->debugging = true;
}
Index: lang.inc.php
===================================================================
RCS file: /cvsroot/php-blog/serendipity/include/lang.inc.php,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- lang.inc.php 2 Dec 2004 20:57:44 -0000 1.5
+++ lang.inc.php 10 Dec 2004 16:47:29 -0000 1.6
@@ -37,8 +37,12 @@
static $mbstring = null;
if (is_null($mbstring)) {
- $mbstring = (extension_loaded('mbstring') ? true : false);
- if ($mbstring) {
+ $mbstring = (extension_loaded('mbstring') ? 1 : 0);
+ if ($mbstring === 1) {
+ if (function_exists('mb_strtoupper')) {
+ $mbstring = 2;
+ }
+
mb_internal_encoding(LANG_CHARSET);
}
}
@@ -50,12 +54,20 @@
switch($func) {
case 'ucfirst':
// there's no mb_ucfirst, so emulate it
- if ($mbstring) {
+ if ($mbstring === 2) {
return mb_strtoupper(mb_substr($args[1], 0, 1)) . mb_strtolower(mb_substr($args[1], 1));
} else {
return ucfirst($args[1]);
}
+ case 'strtolower':
+ case 'strtoupper':
+ if ($mbstring === 2) {
+ return call_user_func_array('mb_' . $func, $args);
+ } else {
+ return call_user_func_array($func, $args);
+ }
+
default:
if ($mbstring) {
return call_user_func_array('mb_' . $func, $args);
|