r100262 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r100261‎ | r100262 | r100263 >
Date:19:34, 19 October 2011
Author:mah
Status:reverted (Comments)
Tags:
Comment:
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 (modified) (history)
  • /trunk/phase3/languages/messages/MessagesEn.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/parser/StripState.php
@@ -107,6 +107,9 @@
108108 if ( isset( $this->data[$this->tempType][$m[1]] ) ) {
109109 return $this->data[$this->tempType][$m[1]];
110110 } else {
 111+ if( preg_match( $this->regex, $m[0] ) ) {
 112+ return "<strong class='error'>".htmlspecialchars( wfMsg( "stripstate-error" ) )."</strong>";
 113+ }
111114 return $m[0];
112115 }
113116 }
Index: trunk/phase3/languages/messages/MessagesEn.php
@@ -4471,6 +4471,7 @@
44724472 # Core parser functions
44734473 'unknown_extension_tag' => 'Unknown extension tag "$1"',
44744474 'duplicate-defaultsort' => '\'\'\'Warning:\'\'\' Default sort key "$2" overrides earlier default sort key "$1".',
 4475+'stripstate-error' => 'unstripCallback called with strip markers still intact. Please fix your markup.',
44754476
44764477 # Special:Version
44774478 'version' => 'Version',

Follow-up revisions

RevisionCommit summaryAuthorDate
r100266Revert r100262 — wasn't the right place for it and other problems,...mah20:01, 19 October 2011

Comments

#Comment by Siebrand (talk | contribs)   19:50, 19 October 2011

Not sure if "unstripCallback" is intelligible, but I can get over that. Two issues:

  • Please add message documentation for the newly added messages. Thanks.
  • needs entry in maintance/language/messages.inc
#Comment by Siebrand (talk | contribs)   19:51, 19 October 2011

Oh, we also don't use a double space to separate sentences.

Status & tagging log