From: Brion Vibber Date: Sat, 8 May 2004 04:41:54 +0000 (+0000) Subject: Suppress PHP warnings on failure to create thumbnail subdirectories. This should... X-Git-Tag: 1.3.0beta1~123 X-Git-Url: http://git.cyclocoop.org/%22.%24h.%22?a=commitdiff_plain;h=1571a7c4c37dc9074a006264c33bc6dd9c3adcdc;p=lhc%2Fweb%2Fwiklou.git Suppress PHP warnings on failure to create thumbnail subdirectories. This should be checked at file save time and a human-friendly error message listed instead --- diff --git a/includes/GlobalFunctions.php b/includes/GlobalFunctions.php index d78d263722..fd823d0b3a 100644 --- a/includes/GlobalFunctions.php +++ b/includes/GlobalFunctions.php @@ -430,12 +430,15 @@ function wfImageArchiveDir( $fname , $subdir="archive") $hash = md5( $fname ); $oldumask = umask(0); + + # Suppress warning messages here; if the file itself can't + # be written we'll worry about it then. $archive = "{$wgUploadDirectory}/{$subdir}"; - if ( ! is_dir( $archive ) ) { mkdir( $archive, 0777 ); } + if ( ! is_dir( $archive ) ) { @mkdir( $archive, 0777 ); } $archive .= "/" . $hash{0}; - if ( ! is_dir( $archive ) ) { mkdir( $archive, 0777 ); } + if ( ! is_dir( $archive ) ) { @mkdir( $archive, 0777 ); } $archive .= "/" . substr( $hash, 0, 2 ); - if ( ! is_dir( $archive ) ) { mkdir( $archive, 0777 ); } + if ( ! is_dir( $archive ) ) { @mkdir( $archive, 0777 ); } umask( $oldumask ); return $archive;