strcspn bug: http://bugs.php.net/bug.php?id=39032
authorTim Starling <tstarling@users.mediawiki.org>
Wed, 4 Oct 2006 08:43:09 +0000 (08:43 +0000)
committerTim Starling <tstarling@users.mediawiki.org>
Wed, 4 Oct 2006 08:43:09 +0000 (08:43 +0000)
includes/Parser.php

index 31ec709..2502136 100644 (file)
@@ -2561,9 +2561,14 @@ class Parser
                                        $found = 'pipe';
                                } elseif ( $text[$i] == $currentClosing ) {
                                        $found = 'close';
-                               } else {
+                               } elseif ( isset( $callbacks[$text[$i]] ) ) {
                                        $found = 'open';
                                        $rule = $callbacks[$text[$i]];
+                               } else {
+                                       # Some versions of PHP have a strcspn which stops on null characters
+                                       # Ignore and continue
+                                       ++$i;
+                                       continue;
                                }
                        } else {
                                # All done