[geeklog-cvs] geeklog: Extend test functionality of MBYTE_checkEnabled

geeklog-cvs at lists.geeklog.net geeklog-cvs at lists.geeklog.net
Sat Jul 24 13:33:29 EDT 2010


changeset 7953:4ed17f1e1945
url:  http://project.geeklog.net/cgi-bin/hgwebdir.cgi/geeklog/rev/4ed17f1e1945
user: Dirk Haun <dirk at haun-online.de>
date: Sat Jul 24 19:07:05 2010 +0200
description:
Extend test functionality of MBYTE_checkEnabled

diffstat:

 system/lib-mbyte.php |  34 +++++++++++++++++++---------------
 1 files changed, 19 insertions(+), 15 deletions(-)

diffs (58 lines):

diff -r 9637d9932724 -r 4ed17f1e1945 system/lib-mbyte.php
--- a/system/lib-mbyte.php	Sat Jul 24 15:04:57 2010 +0200
+++ b/system/lib-mbyte.php	Sat Jul 24 19:07:05 2010 +0200
@@ -2,13 +2,13 @@
 
 /* Reminder: always indent with 4 spaces (no tabs). */
 // +---------------------------------------------------------------------------+
-// | Geeklog 1.6                                                               |
+// | Geeklog 1.7                                                               |
 // +---------------------------------------------------------------------------+
 // | lib-mbyte.php                                                             |
 // |                                                                           |
 // | function collection to handle mutli-byte related issues                   |
 // +---------------------------------------------------------------------------+
-// | Copyright (C) 2000-2009 by the following authors:                         |
+// | Copyright (C) 2000-2010 by the following authors:                         |
 // |                                                                           |
 // | Authors: Oliver Spiesshofer - oliver AT spiesshofer DOT com               |
 // +---------------------------------------------------------------------------+
@@ -93,21 +93,25 @@
     if (!isset($mb_enabled)) {
         $mb_enabled = false;
         if (strcasecmp($LANG_CHARSET, 'utf-8') == 0) {			
-			if($test == '') {
-			// Normal situation in live environment
-            	if (function_exists('mb_eregi_replace')) {
-                	$mb_enabled = mb_internal_encoding('UTF-8');
-				}
-				
-            } elseif($test == 'test') {
-				// Just for tests, true if we want function to exist
-				if($enabled) {
-					$mb_enabled = mb_internal_encoding('UTF-8');
-				}
-			}
+            if (empty($test)) {
+                // Normal situation in live environment
+                if (function_exists('mb_eregi_replace')) {
+                    $mb_enabled = mb_internal_encoding('UTF-8');
+                }
+            } elseif ($test == 'test') {
+                // Just for tests, true if we want function to exist
+                if ($enabled) {
+                    $mb_enabled = mb_internal_encoding('UTF-8');
+                }
+            } elseif ($test == 'test-reset') {
+                // Just for tests, allow resetting $mb_enabled
+                if (isset($mb_enabled)) {
+                    unset($mb_enabled);
+                }
+            }
         }
     }
-	
+
     return $mb_enabled;
 }	
 



More information about the geeklog-cvs mailing list