r74626 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r74625‎ | r74626 | r74627 >
Date:14:25, 11 October 2010
Author:platonides
Status:deferred
Tags:
Comment:
Remove the base64 pass.
Modified paths:
  • /trunk/extensions/ArticleComments/ArticleComments.php (modified) (history)

Diff [purge]

Index: trunk/extensions/ArticleComments/ArticleComments.php
@@ -22,6 +22,8 @@
2323 * <comments />
2424 * Note: Typically this would be placed at the end of the article text.
2525 * Version Notes:
 26+ * version 0.5.1:
 27+ * Removed the base64 pass
2628 * version 0.5:
2729 * Updated to work with MediaWiki 1.16+
2830 * version 0.4.3:
@@ -81,7 +83,7 @@
8284 'author' => 'Jim R. Wilson - wilson.jim.r <at> gmail.com',
8385 'url' => 'http://jimbojw.com/wiki/index.php?title=ArticleComments',
8486 'descriptionmsg' => 'article-comments-desc',
85 - 'version' => '0.5'
 87+ 'version' => '0.5.1'
8688 );
8789
8890 # Add Extension Functions
@@ -91,7 +93,6 @@
9294 # Attach Hooks
9395 $wgHooks['ParserFirstCallInit'][] = 'wfArticleCommentsParserSetup';
9496 $wgHooks['SkinAfterContent'][] = 'wfArticleCommentsAfterContent';
95 -$wgHooks['ParserAfterTidy'][] = 'wfProcessEncodedContent';
9697 $wgHooks['ArticleCommentsSpamCheck'][] = 'defaultArticleCommentSpamCheck';
9798
9899 /**
@@ -126,11 +127,7 @@
127128
128129 function wfArticleCommentsParserHook( $text, $params = array(), $parser ) {
129130 # Generate a comment form for display
130 - $commentForm = wfArticleCommentForm( $parser->mTitle, $params );
131 -
132 - # Hide content from the Parser using base64 to avoid mangling.
133 - # Note: Content will be decoded after Tidy has finished its processing of the page.
134 - return '<pre>@ENCODED@' . base64_encode( $commentForm ) . '@ENCODED@</pre>';
 131+ return wfArticleCommentForm( $parser->mTitle, $params );
135132 }
136133
137134 /**
@@ -269,22 +266,6 @@
270267 }
271268
272269 /**
273 - * Processes HTML comments with encoded content.
274 - * Usage: $wgHooks['OutputPageBeforeHTML'][] = 'wfProcessEncodedContent';
275 - * @param OutputPage $out Handle to an OutputPage object presumably $wgOut (passed by reference).
276 - * @param String $text Article/Output text (passed by reference)
277 - * @return Boolean Always tru to give other hooking methods a chance to run.
278 - */
279 -function wfProcessEncodedContent( $out, $text ) {
280 - $text = preg_replace(
281 - '/<pre>\n@ENCODED@([0-9a-zA-Z\\+\\/]+=*)@ENCODED@\n<\\/pre>/e',
282 - 'base64_decode("$1")',
283 - $text
284 - );
285 - return true;
286 -}
287 -
288 -/**
289270 * Special page for comment processing.
290271 */
291272 function specialProcessComment() {

Follow-up revisions

RevisionCommit summaryAuthorDate
r74629Fix the javascript after r74626....platonides15:32, 11 October 2010

Status & tagging log