r82602 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r82601‎ | r82602 | r82603 >
Date:14:57, 22 February 2011
Author:thomasv
Status:reverted (Comments)
Tags:
Comment:
add css classes
Modified paths:
  • /trunk/extensions/ProofreadPage/ProofreadPage_body.php (modified) (history)

Diff [purge]

Index: trunk/extensions/ProofreadPage/ProofreadPage_body.php
@@ -944,7 +944,8 @@
945945 }
946946
947947 // wrap the output in a div, to prevent the parser from inserting pararaphs
948 - $out = "<div>\n$out\n</div>";
 948+ $classes = array_key_exists( 'css', $attributes ) ? "class=\"" . Xml::escapeJsString( $attributes['css'] ) . "\"": '';
 949+ $out = "<div $classes>\n$out\n</div>";
949950 $out = $parser->recursiveTagParse( $out );
950951 return $out;
951952 }

Follow-up revisions

RevisionCommit summaryAuthorDate
r86295revert r82602, because it would cause unintened changesthomasv09:01, 18 April 2011

Comments

#Comment by Nikerabbit (talk | contribs)   17:34, 22 February 2011

Xml::escapeJsString looks wrong in this context. I would do.

$params = array();
if ( isset( $attributes['css'] ) ) $params['class'] = $attributes['css'];
$out = Html::rawElement( 'div', $out, $params );

Also the comment above has typo paragraphs.

Status & tagging log