http://www.mediawiki.org/wiki/Special:Code/MediaWiki/100262

Revision: 100262
Author:   mah
Date:     2011-10-19 19:34:56 +0000 (Wed, 19 Oct 2011)
Log Message:
-----------
Give a clear error message instead of un-intelligible UNIQ.*QINU
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.

Modified Paths:
--------------
    trunk/phase3/includes/parser/StripState.php
    trunk/phase3/languages/messages/MessagesEn.php

Modified: trunk/phase3/includes/parser/StripState.php
===================================================================
--- trunk/phase3/includes/parser/StripState.php 2011-10-19 19:31:55 UTC (rev 
100261)
+++ trunk/phase3/includes/parser/StripState.php 2011-10-19 19:34:56 UTC (rev 
100262)
@@ -107,6 +107,9 @@
                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];
                }
        }

Modified: trunk/phase3/languages/messages/MessagesEn.php
===================================================================
--- trunk/phase3/languages/messages/MessagesEn.php      2011-10-19 19:31:55 UTC 
(rev 100261)
+++ trunk/phase3/languages/messages/MessagesEn.php      2011-10-19 19:34:56 UTC 
(rev 100262)
@@ -4471,6 +4471,7 @@
 # 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',


_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs

Reply via email to