r17054 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r17053‎ | r17054 | r17055 >
Date:19:12, 16 October 2006
Author:brion
Status:old
Tags:
Comment:
* (bug 7599) Fix thumbnail purging, PHP notices on HTCP image page purge

Somebody changed the parameters and return value of Image->thumbUrl()
and didn't update all uses. Silly of them!

Also add a paranoia check on urls in the list in SquidUpdate

And don't redefine the socket options constants when called a second time
Modified paths:
  • /trunk/phase3/RELEASE-NOTES (modified) (history)
  • /trunk/phase3/includes/Image.php (modified) (history)
  • /trunk/phase3/includes/SquidUpdate.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/Image.php
@@ -1361,7 +1361,8 @@
13621362 $urls = array();
13631363 foreach ( $files as $file ) {
13641364 if ( preg_match( '/^(\d+)px/', $file, $m ) ) {
1365 - $urls[] = $this->thumbUrl( $m[1], $this->fromSharedDirectory );
 1365+ list( $isScriptUrl, $url ) = $this->thumbUrl( $m[1] );
 1366+ $urls[] = $url;
13661367 @unlink( "$dir/$file" );
13671368 }
13681369 }
Index: trunk/phase3/includes/SquidUpdate.php
@@ -201,9 +201,11 @@
202202 $htcpOpCLR = 4; // HTCP CLR
203203
204204 // FIXME PHP doesn't support these socket constants (include/linux/in.h)
205 - define( "IPPROTO_IP", 0 );
206 - define( "IP_MULTICAST_LOOP", 34 );
207 - define( "IP_MULTICAST_TTL", 33 );
 205+ if( !defined( "IPPROTO_IP" ) ) {
 206+ define( "IPPROTO_IP", 0 );
 207+ define( "IP_MULTICAST_LOOP", 34 );
 208+ define( "IP_MULTICAST_TTL", 33 );
 209+ }
208210
209211 // pfsockopen doesn't work because we need set_sock_opt
210212 $conn = socket_create( AF_INET, SOCK_DGRAM, SOL_UDP );
@@ -215,6 +217,9 @@
216218 $wgHTCPMulticastTTL );
217219
218220 foreach ( $urlArr as $url ) {
 221+ if( !is_string( $url ) ) {
 222+ wfDebugDieBacktrace( 'Bad purge URL' );
 223+ }
219224 $url = SquidUpdate::expand( $url );
220225
221226 // Construct a minimal HTCP request diagram
Index: trunk/phase3/RELEASE-NOTES
@@ -51,6 +51,7 @@
5252 * Fix regression in autoconfirm permission check
5353 * (bug 3015) Add CSS ids to subcategory and page sections on category pages
5454 * (bug 7587) Fix erroneous id for specialpage tab, enabling informative popup
 55+* (bug 7599) Fix thumbnail purging, PHP notices on HTCP image page purge
5556
5657
5758 == Languages updated ==