r72965 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r72964‎ | r72965 | r72966 >
Date:11:58, 14 September 2010
Author:maxsem
Status:ok (Comments)
Tags:
Comment:
Follow-up r72941: don't use json_encode() directly
Modified paths:
  • /trunk/phase3/includes/ResourceLoader.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/ResourceLoader.php
@@ -149,7 +149,7 @@
150150 foreach ( self::$modules as $name => $module ) {
151151 // Support module loader scripts
152152 if ( ( $loader = $module->getLoaderScript() ) !== false ) {
153 - $deps = json_encode( $module->getDependencies() );
 153+ $deps = FormatJson::encode( $module->getDependencies() );
154154 $version = wfTimestamp( TS_ISO_8601, round( $module->getModifiedTime( $context ), -2 ) );
155155 $scripts .= "( function( name, version, dependencies ) { $loader } )( '$name', '$version', $deps );";
156156 }

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r72941Wrapped custom loaders in a function which provides name, version and statica...tparscal23:41, 13 September 2010

Comments

#Comment by Trevor Parscal (WMF) (talk | contribs)   23:42, 24 September 2010

Good catch - using grep I see dozens of uses of json_encode in various extensions, but we need to at least keep them out of core.

Status & tagging log