https://www.mediawiki.org/wiki/Special:Code/MediaWiki/112856

Revision: 112856
Author:   krinkle
Date:     2012-03-02 00:18:09 +0000 (Fri, 02 Mar 2012)
Log Message:
-----------
[CategoryTree] Fix "bad json errors on options= {":" that are populating 
wmf error logs
* Only occurred on category trees produced by <categorytree>. The category 
trees dynamically created when expanding the [+] toggle in the subcategory list 
on a category page were not affected (since those don't have data-ct-options 
attributes and thus JS uses the default via mw.config.get( 
'wgCategoryTreePageCategoryOptions' ), which wasn't double escaped)
* escapeTagsOnly escapes & to &quot;
* Xml::openElement does normal attribute escaping, assuming unescaped input

Before:

<div class=" CategoryTreeTag" data-ct-mode="0" 
data-ct-options="{&amp;quot;mode&amp;quot;:0,&amp;quot;hideprefix&amp;quot;:20,&amp;quot;showcount&amp;quot;:false,&amp;quot;namespaces&amp;quot;:false}">

<div class="CategoryTreeTag" data-ct-mode="0" 
data-ct-options="{&quot;mode&quot;:0,&quot;hideprefix&quot;:20,&quot;showcount&quot;:false,&quot;namespaces&quot;:false}">

Modified Paths:
--------------
    trunk/extensions/CategoryTree/CategoryTreeFunctions.php

Modified: trunk/extensions/CategoryTree/CategoryTreeFunctions.php
===================================================================
--- trunk/extensions/CategoryTree/CategoryTreeFunctions.php     2012-03-02 
00:15:20 UTC (rev 112855)
+++ trunk/extensions/CategoryTree/CategoryTreeFunctions.php     2012-03-02 
00:18:09 UTC (rev 112856)
@@ -424,19 +424,19 @@
                }
 
                $attr['data-ct-mode'] = $this->mOptions['mode'];
-               $attr['data-ct-options'] = Xml::escapeTagsOnly( 
$this->getOptionsAsJsStructure() );
+               $attr['data-ct-options'] = $this->getOptionsAsJsStructure();
 
                $html = '';
-               $html .= Xml::openElement( 'div', $attr );
+               $html .= Html::openElement( 'div', $attr );
 
                if ( !$allowMissing && !$title->getArticleID() ) {
-                       $html .= Xml::openElement( 'span', array( 'class' => 
'CategoryTreeNotice' ) );
+                       $html .= Html::openElement( 'span', array( 'class' => 
'CategoryTreeNotice' ) );
                        if ( $parser ) {
                                $html .= $parser->recursiveTagParse( 
wfMsgNoTrans( 'categorytree-not-found', $category ) );
                        } else {
                                $html .= wfMsgExt( 'categorytree-not-found', 
'parseinline', htmlspecialchars( $category ) );
                        }
-                       $html .= Xml::closeElement( 'span' );
+                       $html .= Html::closeElement( 'span' );
                        }
                else {
                        if ( !$hideroot ) {


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

Reply via email to