* (bug 7599) Fix thumbnail purging, PHP notices on HTCP image page purge
authorBrion Vibber <brion@users.mediawiki.org>
Mon, 16 Oct 2006 19:12:56 +0000 (19:12 +0000)
committerBrion Vibber <brion@users.mediawiki.org>
Mon, 16 Oct 2006 19:12:56 +0000 (19:12 +0000)
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

RELEASE-NOTES
includes/Image.php
includes/SquidUpdate.php

index 851f7db..af00ff0 100644 (file)
@@ -51,6 +51,7 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN
 * Fix regression in autoconfirm permission check
 * (bug 3015) Add CSS ids to subcategory and page sections on category pages
 * (bug 7587) Fix erroneous id for specialpage tab, enabling informative popup
+* (bug 7599) Fix thumbnail purging, PHP notices on HTCP image page purge
 
 
 == Languages updated ==
index 55e53e2..337d09c 100644 (file)
@@ -1361,7 +1361,8 @@ class Image
                $urls = array();
                foreach ( $files as $file ) {
                        if ( preg_match( '/^(\d+)px/', $file, $m ) ) {
-                               $urls[] = $this->thumbUrl( $m[1], $this->fromSharedDirectory );
+                               list( $isScriptUrl, $url ) = $this->thumbUrl( $m[1] );
+                               $urls[] = $url;
                                @unlink( "$dir/$file" );
                        }
                }
index 3821cd5..25dd1cf 100644 (file)
@@ -201,9 +201,11 @@ class SquidUpdate {
                $htcpOpCLR = 4;                 // HTCP CLR
 
                // FIXME PHP doesn't support these socket constants (include/linux/in.h)
-               define( "IPPROTO_IP", 0 );
-               define( "IP_MULTICAST_LOOP", 34 );
-               define( "IP_MULTICAST_TTL", 33 );
+               if( !defined( "IPPROTO_IP" ) ) {
+                       define( "IPPROTO_IP", 0 );
+                       define( "IP_MULTICAST_LOOP", 34 );
+                       define( "IP_MULTICAST_TTL", 33 );
+               }
 
                // pfsockopen doesn't work because we need set_sock_opt
                $conn = socket_create( AF_INET, SOCK_DGRAM, SOL_UDP );
@@ -215,6 +217,9 @@ class SquidUpdate {
                                        $wgHTCPMulticastTTL );
 
                        foreach ( $urlArr as $url ) {
+                               if( !is_string( $url ) ) {
+                                       wfDebugDieBacktrace( 'Bad purge URL' );
+                               }
                                $url = SquidUpdate::expand( $url );
                                
                                // Construct a minimal HTCP request diagram