Add AJAX category management system. Includes suggestion system, dialogs for setting...
[lhc/web/wiklou.git] / includes / normal / Utf8Test.php
index 49d2f86..353d11b 100644 (file)
@@ -1,27 +1,28 @@
 <?php
 # Copyright (C) 2004 Brion Vibber <brion@pobox.com>
 # http://www.mediawiki.org/
-# 
+#
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or 
+# the Free Software Foundation; either version 2 of the License, or
 # (at your option) any later version.
-# 
+#
 # This program is distributed in the hope that it will be useful,
 # but WITHOUT ANY WARRANTY; without even the implied warranty of
 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 # GNU General Public License for more details.
-# 
+#
 # You should have received a copy of the GNU General Public License along
 # with this program; if not, write to the Free Software Foundation, Inc.,
-# 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
 # http://www.gnu.org/copyleft/gpl.html
 
 /**
  * Runs the UTF-8 decoder test at:
  * http://www.cl.cam.ac.uk/~mgk25/ucs/examples/UTF-8-test.txt
  *
- * @package MediaWiki
+ * @ingroup UtfNormal
+ * @access private
  */
 
 /** */
@@ -44,6 +45,7 @@ if( !$in ) {
 
 $columns = 0;
 while( false !== ( $line = fgets( $in ) ) ) {
+       $matches = array();
        if( preg_match( '/^(Here come the tests:\s*)\|$/', $line, $matches ) ) {
                $columns = strpos( $line, '|' );
                break;
@@ -67,7 +69,7 @@ $exceptions = array(
        # Tests that should mark invalid characters due to using long
        # sequences beyond what is now considered legal.
        '2.1.5', '2.1.6', '2.2.4', '2.2.5', '2.2.6', '2.3.5',
-       
+
        # Literal 0xffff, which is illegal
        '2.2.3' );
 
@@ -85,6 +87,7 @@ $failed = 0;
 $success = 0;
 $total = 0;
 while( false !== ( $line = fgets( $in ) ) ) {
+       $matches = array();
        if( preg_match( '/^(\d+)\s+(.*?)\s*\|/', $line, $matches ) ) {
                $section = $matches[1];
                print $line;
@@ -126,15 +129,15 @@ function testLine( $test, $line, &$total, &$success, &$failed ) {
        if( $len == 0 ) {
                $len = strlen( substr( $stripped, 0, strpos( $stripped, '|' ) ) );
        }
-       
+
        global $columns;
        $ok = $same ^ ($test >= 3 );
 
        global $exceptions;
        $ok ^= in_array( $test, $exceptions );
-       
+
        $ok &= ($columns == $len);
-       
+
        $total++;
        if( $ok ) {
                $success++;
@@ -146,5 +149,3 @@ function testLine( $test, $line, &$total, &$success, &$failed ) {
                print str_replace( "\n", "$len\n", $stripped );
        }
 }
-
-?>