Give a clear error message instead of un-intelligible UNIQ.*QINU
authorMark A. Hershberger <mah@users.mediawiki.org>
Wed, 19 Oct 2011 19:34:56 +0000 (19:34 +0000)
committerMark A. Hershberger <mah@users.mediawiki.org>
Wed, 19 Oct 2011 19:34:56 +0000 (19:34 +0000)
markers.

Not sure the preg_match() is actually needed.  Or it may be
appropriate to use MARKER_SUFFIX for the match.

The error message may also need to be rewritten to be more
user-friendly, but I'm pretty sure *an* error message is friendlier
than UNIQ garbage.  And making them visible error messages makes them
easier to be found.

includes/parser/StripState.php
languages/messages/MessagesEn.php

index 357dc2c..aaeb8e9 100644 (file)
@@ -107,6 +107,9 @@ class StripState {
                if ( isset( $this->data[$this->tempType][$m[1]] ) ) {
                        return $this->data[$this->tempType][$m[1]];
                } else {
+                       if( preg_match( $this->regex, $m[0] ) ) {
+                               return "<strong class='error'>".htmlspecialchars( wfMsg( "stripstate-error" ) )."</strong>";
+                       }
                        return $m[0];
                }
        }
index a69dfac..c521b51 100644 (file)
@@ -4471,6 +4471,7 @@ You can also [[Special:EditWatchlist|use the standard editor]].',
 # Core parser functions
 'unknown_extension_tag' => 'Unknown extension tag "$1"',
 'duplicate-defaultsort' => '\'\'\'Warning:\'\'\' Default sort key "$2" overrides earlier default sort key "$1".',
+'stripstate-error'      => 'unstripCallback called with strip markers still intact.  Please fix your markup.',
 
 # Special:Version
 'version'                       => 'Version',