r44794 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r44793‎ | r44794 | r44795 >
Date:07:03, 19 December 2008
Author:tstarling
Status:ok
Tags:
Comment:
(bug 16471) Use random ID to avoid conflicts when cached HTML fragments are used.
Modified paths:
  • /trunk/extensions/ImageMap/ImageMap_body.php (modified) (history)

Diff [purge]

Index: trunk/extensions/ImageMap/ImageMap_body.php
@@ -257,7 +257,9 @@
258258
259259 if ( $realmap ) {
260260 # Construct the map
261 - $mapName = "ImageMap_" . ++self::$id;
 261+ # Add random number to avoid breaking cached HTML fragments that are
 262+ # later joined together on the one page (bug 16471)
 263+ $mapName = "ImageMap_" . ++self::$id . '_' . mt_rand( 0, 0x7fffffff );
262264 $mapHTML = "<map name=\"$mapName\">\n$mapHTML</map>\n";
263265
264266 # Alter the image tag

Status & tagging log