https://www.mediawiki.org/wiki/Special:Code/MediaWiki/102369
Revision: 102369 Author: jeroendedauw Date: 2011-11-08 02:46:56 +0000 (Tue, 08 Nov 2011) Log Message: ----------- strict string comparisons for empty strings Modified Paths: -------------- trunk/extensions/Maps/includes/Maps_Geocoders.php trunk/extensions/Maps/includes/Maps_LayerPage.php trunk/extensions/Maps/includes/Maps_Location.php trunk/extensions/Maps/includes/features/Maps_BasePointMap.php trunk/extensions/Maps/includes/geocoders/Maps_GeonamesGeocoder.php trunk/extensions/Maps/includes/geocoders/Maps_GeonamesOldGeocoder.php trunk/extensions/Maps/includes/manipulations/Maps_ParamGeoService.php trunk/extensions/Maps/includes/services/GoogleMaps/Maps_GoogleMaps.php trunk/extensions/Maps/includes/services/GoogleMaps/jquery.googlemap2.js trunk/extensions/Maps/includes/services/GoogleMaps3/jquery.googlemap.js trunk/extensions/Maps/includes/services/OpenLayers/jquery.openlayers.js trunk/extensions/Maps/includes/services/YahooMaps/jquery.yahoomaps.js Modified: trunk/extensions/Maps/includes/Maps_Geocoders.php =================================================================== --- trunk/extensions/Maps/includes/Maps_Geocoders.php 2011-11-08 02:46:03 UTC (rev 102368) +++ trunk/extensions/Maps/includes/Maps_Geocoders.php 2011-11-08 02:46:56 UTC (rev 102369) @@ -347,7 +347,7 @@ global $egMapsDefaultGeoService, $egMapsUserGeoOverrides; static $validatedDefault = false; - if ( $geocoderIdentifier == '' || !array_key_exists( $geocoderIdentifier, self::$registeredGeocoders ) ) { + if ( $geocoderIdentifier === '' || !array_key_exists( $geocoderIdentifier, self::$registeredGeocoders ) ) { if ( !$validatedDefault ) { if ( !array_key_exists( $egMapsDefaultGeoService, self::$registeredGeocoders ) ) { $egMapsDefaultGeoService = array_shift( array_keys( self::$registeredGeocoders ) ); Modified: trunk/extensions/Maps/includes/Maps_LayerPage.php =================================================================== --- trunk/extensions/Maps/includes/Maps_LayerPage.php 2011-11-08 02:46:03 UTC (rev 102368) +++ trunk/extensions/Maps/includes/Maps_LayerPage.php 2011-11-08 02:46:56 UTC (rev 102369) @@ -173,7 +173,7 @@ $valueTD = Html::element( 'td', - array( 'colspan' => $errorTD == '' && !$layer->isValid() ? 2 : 1 ), + array( 'colspan' => $errorTD === '' && !$layer->isValid() ? 2 : 1 ), $value ); Modified: trunk/extensions/Maps/includes/Maps_Location.php =================================================================== --- trunk/extensions/Maps/includes/Maps_Location.php 2011-11-08 02:46:03 UTC (rev 102368) +++ trunk/extensions/Maps/includes/Maps_Location.php 2011-11-08 02:46:56 UTC (rev 102369) @@ -317,7 +317,7 @@ * @return boolean */ public function hasIcon() { - return $this->icon != ''; + return $this->icon !== ''; } /** @@ -339,7 +339,7 @@ * @return boolean */ public function hasTitle() { - return $this->title != ''; + return $this->title !== ''; } /** @@ -361,7 +361,7 @@ * @return boolean */ public function hasText() { - return $this->text != ''; + return $this->text !== ''; } /** Modified: trunk/extensions/Maps/includes/features/Maps_BasePointMap.php =================================================================== --- trunk/extensions/Maps/includes/features/Maps_BasePointMap.php 2011-11-08 02:46:03 UTC (rev 102368) +++ trunk/extensions/Maps/includes/features/Maps_BasePointMap.php 2011-11-08 02:46:56 UTC (rev 102369) @@ -141,7 +141,7 @@ $jsonObj['title'] = $parserClone->parse( $jsonObj['title'], $parserClone->getTitle(), new ParserOptions() )->getText(); $jsonObj['text'] = $parserClone->parse( $jsonObj['text'], $parserClone->getTitle(), new ParserOptions() )->getText(); - $hasTitleAndtext = $jsonObj['title'] != '' && $jsonObj['text'] != ''; + $hasTitleAndtext = $jsonObj['title'] !== '' && $jsonObj['text'] !== ''; $jsonObj['text'] = ( $hasTitleAndtext ? '<b>' . $jsonObj['title'] . '</b><hr />' : $jsonObj['title'] ) . $jsonObj['text']; $jsonObj['title'] = strip_tags( $jsonObj['title'] ); Modified: trunk/extensions/Maps/includes/geocoders/Maps_GeonamesGeocoder.php =================================================================== --- trunk/extensions/Maps/includes/geocoders/Maps_GeonamesGeocoder.php 2011-11-08 02:46:03 UTC (rev 102368) +++ trunk/extensions/Maps/includes/geocoders/Maps_GeonamesGeocoder.php 2011-11-08 02:46:56 UTC (rev 102369) @@ -24,7 +24,7 @@ public static function register() { global $egMapsGeoNamesUser; - if ( $egMapsGeoNamesUser != '' ) { + if ( $egMapsGeoNamesUser !== '' ) { MapsGeocoders::registerGeocoder( 'geonames', __CLASS__ ); } Modified: trunk/extensions/Maps/includes/geocoders/Maps_GeonamesOldGeocoder.php =================================================================== --- trunk/extensions/Maps/includes/geocoders/Maps_GeonamesOldGeocoder.php 2011-11-08 02:46:03 UTC (rev 102368) +++ trunk/extensions/Maps/includes/geocoders/Maps_GeonamesOldGeocoder.php 2011-11-08 02:46:56 UTC (rev 102369) @@ -28,7 +28,7 @@ public static function register() { global $egMapsGeoNamesUser; - MapsGeocoders::registerGeocoder( $egMapsGeoNamesUser == '' ? 'geonames' : 'geonamesold', __CLASS__ ); + MapsGeocoders::registerGeocoder( $egMapsGeoNamesUser === '' ? 'geonames' : 'geonamesold', __CLASS__ ); return true; } Modified: trunk/extensions/Maps/includes/manipulations/Maps_ParamGeoService.php =================================================================== --- trunk/extensions/Maps/includes/manipulations/Maps_ParamGeoService.php 2011-11-08 02:46:03 UTC (rev 102368) +++ trunk/extensions/Maps/includes/manipulations/Maps_ParamGeoService.php 2011-11-08 02:46:56 UTC (rev 102369) @@ -54,7 +54,7 @@ $value = self::resolveOverrides( $value, $parameters[$this->mappingServiceParam]->getValue() ); } - if ( $value == '' || !array_key_exists( $value, MapsGeocoders::$registeredGeocoders ) ) { + if ( $value === '' || !array_key_exists( $value, MapsGeocoders::$registeredGeocoders ) ) { if ( !$validatedDefault ) { if ( !array_key_exists( $egMapsDefaultGeoService, MapsGeocoders::$registeredGeocoders ) ) { $egMapsDefaultGeoService = array_shift( array_keys( MapsGeocoders::$registeredGeocoders ) ); Modified: trunk/extensions/Maps/includes/services/GoogleMaps/Maps_GoogleMaps.php =================================================================== --- trunk/extensions/Maps/includes/services/GoogleMaps/Maps_GoogleMaps.php 2011-11-08 02:46:03 UTC (rev 102368) +++ trunk/extensions/Maps/includes/services/GoogleMaps/Maps_GoogleMaps.php 2011-11-08 02:46:56 UTC (rev 102369) @@ -251,7 +251,7 @@ public static function validateGoogleMapsKey() { global $egGoogleMapsKey, $wgGoogleMapsKey; - if ( isset( $wgGoogleMapsKey ) && trim( $egGoogleMapsKey ) == '' ) { + if ( isset( $wgGoogleMapsKey ) && $egGoogleMapsKey !== '' ) { $egGoogleMapsKey = $wgGoogleMapsKey; } } Modified: trunk/extensions/Maps/includes/services/GoogleMaps/jquery.googlemap2.js =================================================================== --- trunk/extensions/Maps/includes/services/GoogleMaps/jquery.googlemap2.js 2011-11-08 02:46:03 UTC (rev 102368) +++ trunk/extensions/Maps/includes/services/GoogleMaps/jquery.googlemap2.js 2011-11-08 02:46:56 UTC (rev 102369) @@ -149,7 +149,7 @@ function createGMarker( markerData ) { var marker; - if ( markerData.icon != '' ) { + if ( markerData.icon !== '' ) { var iconObj = new GIcon( G_DEFAULT_ICON ); iconObj.image = markerData.icon; @@ -176,7 +176,7 @@ marker = new GMarker( markerData.point ); } - if ( markerData.text != '' ) { + if ( markerData.text !== '' ) { GEvent.addListener(marker, 'click', function() { marker.openInfoWindowHtml( Modified: trunk/extensions/Maps/includes/services/GoogleMaps3/jquery.googlemap.js =================================================================== --- trunk/extensions/Maps/includes/services/GoogleMaps3/jquery.googlemap.js 2011-11-08 02:46:03 UTC (rev 102368) +++ trunk/extensions/Maps/includes/services/GoogleMaps3/jquery.googlemap.js 2011-11-08 02:46:56 UTC (rev 102369) @@ -31,7 +31,7 @@ title: markerData.title }; - if ( markerData.icon != '' ) { + if ( markerData.icon !== '' ) { markerOptions.icon = markerData.icon; } @@ -39,7 +39,7 @@ marker.openWindow = false; - if ( markerData.text != '' ) { + if ( markerData.text !== '' ) { marker.text = markerData.text; google.maps.event.addListener( marker, 'click', function() { if ( this.openWindow !== false ) { @@ -139,7 +139,7 @@ // If there are any non-Google KML/KMZ layers, load the geoxml library and use it to add these layers. if ( showEarth ) { this.removeEarthType(); - showEarth = mw.config.get( 'egGoogleJsApiKey' ) != ''; + showEarth = mw.config.get( 'egGoogleJsApiKey' ) !== ''; } var mapOptions = { Modified: trunk/extensions/Maps/includes/services/OpenLayers/jquery.openlayers.js =================================================================== --- trunk/extensions/Maps/includes/services/OpenLayers/jquery.openlayers.js 2011-11-08 02:46:03 UTC (rev 102368) +++ trunk/extensions/Maps/includes/services/OpenLayers/jquery.openlayers.js 2011-11-08 02:46:56 UTC (rev 102369) @@ -16,7 +16,7 @@ marker = new OpenLayers.Marker( markerData.lonlat ); } - if ( markerData.text != '' ) { + if ( markerData.text !== '' ) { // This is the handler for the mousedown event on the marker, and displays the popup. marker.events.register('mousedown', marker, function( evt ) { Modified: trunk/extensions/Maps/includes/services/YahooMaps/jquery.yahoomaps.js =================================================================== --- trunk/extensions/Maps/includes/services/YahooMaps/jquery.yahoomaps.js 2011-11-08 02:46:03 UTC (rev 102368) +++ trunk/extensions/Maps/includes/services/YahooMaps/jquery.yahoomaps.js 2011-11-08 02:46:56 UTC (rev 102369) @@ -98,7 +98,7 @@ function createYMarker(geoPoint, title, text, icon){ var newMarker; - if ( icon != '' ) { + if ( icon !== '' ) { // Determine size of icon and pass it in. var newimg = new Image(); newimg.src = icon; @@ -107,7 +107,7 @@ newMarker = new YMarker( geoPoint ); } - if ( text != '' ) { + if ( text !== '' ) { YEvent.Capture(newMarker, EventsList.MouseClick, function() { newMarker.openSmartWindow( text ); _______________________________________________ MediaWiki-CVS mailing list MediaWiki-CVS@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs