r86554 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r86553‎ | r86554 | r86555 >
Date:21:50, 20 April 2011
Author:jeroendedauw
Status:deferred
Tags:
Comment:
Use of FormatJson::encode instead of josn_encode
Modified paths:
  • /trunk/extensions/Maps/includes/Maps_Mapper.php (modified) (history)
  • /trunk/extensions/Maps/includes/features/Maps_BaseMap.php (modified) (history)
  • /trunk/extensions/Maps/includes/features/Maps_BasePointMap.php (modified) (history)
  • /trunk/extensions/Maps/includes/services/GoogleMaps/Maps_GoogleMaps.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Maps/includes/services/GoogleMaps/Maps_GoogleMaps.php
@@ -214,9 +214,9 @@
215215 $dependencies[] = Html::linkedScript( "http://maps.google.com/maps?file=api&v=2&key=$egGoogleMapsKey&hl=$langCode" );
216216
217217 $dependencies[] = Html::inlineScript(
218 - 'var googleMapsKey = '. json_encode( $egGoogleMapsKey ) . ';' .
219 - 'var googleMapsKeys = '. json_encode( $egGoogleMapsKeys ) . ';' .
220 - 'var googleLangCode = '. json_encode( $langCode ) . ';'
 218+ 'var googleMapsKey = '. FormatJson::encode( $egGoogleMapsKey ) . ';' .
 219+ 'var googleMapsKeys = '. FormatJson::encode( $egGoogleMapsKeys ) . ';' .
 220+ 'var googleLangCode = '. FormatJson::encode( $langCode ) . ';'
221221 );
222222
223223 return $dependencies;
Index: trunk/extensions/Maps/includes/Maps_Mapper.php
@@ -172,7 +172,7 @@
173173 if ( !$baseInit ) {
174174 $baseInit = true;
175175 global $egMapsScriptPath;
176 - $json .= 'var egMapsScriptPath =' . json_encode( $egMapsScriptPath ) . ';';
 176+ $json .= 'var egMapsScriptPath =' . FormatJson::encode( $egMapsScriptPath ) . ';';
177177 $json .= 'var maps={};';
178178 }
179179
Index: trunk/extensions/Maps/includes/features/Maps_BasePointMap.php
@@ -93,7 +93,7 @@
9494
9595 return Html::inlineScript(
9696 MapsMapper::getBaseMapJSON( $this->service->getName() )
97 - . "maps.{$this->service->getName()}.{$mapName}=" . json_encode( $object ) . ';'
 97+ . "maps.{$this->service->getName()}.{$mapName}=" . FormatJson::encode( $object ) . ';'
9898 );
9999 }
100100
Index: trunk/extensions/Maps/includes/features/Maps_BaseMap.php
@@ -117,7 +117,7 @@
118118
119119 return Html::inlineScript(
120120 MapsMapper::getBaseMapJSON( $this->service->getName() )
121 - . "maps.{$this->service->getName()}.{$mapName}=" . json_encode( $object ) . ';'
 121+ . "maps.{$this->service->getName()}.{$mapName}=" . FormatJson::encode( $object ) . ';'
122122 );
123123 }
124124

Status & tagging log