From: Brion Vibber Date: Mon, 16 Oct 2006 19:12:56 +0000 (+0000) Subject: * (bug 7599) Fix thumbnail purging, PHP notices on HTCP image page purge X-Git-Tag: 1.31.0-rc.0~55462 X-Git-Url: https://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/exercices/journal.php?a=commitdiff_plain;h=ad447f6bf43816f17bf5fd11022be8c8b5058266;p=lhc%2Fweb%2Fwiklou.git * (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 --- diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 851f7dbcf6..af00ff0cc9 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -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 == diff --git a/includes/Image.php b/includes/Image.php index 55e53e267a..337d09c5d6 100644 --- a/includes/Image.php +++ b/includes/Image.php @@ -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" ); } } diff --git a/includes/SquidUpdate.php b/includes/SquidUpdate.php index 3821cd51fb..25dd1cf9e5 100644 --- a/includes/SquidUpdate.php +++ b/includes/SquidUpdate.php @@ -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