From: Chad Horohoe Date: Fri, 21 Jan 2011 17:42:15 +0000 (+0000) Subject: (bug 26848) deleteArchivedFiles.php deletes db records, but not files X-Git-Tag: 1.31.0-rc.0~32449 X-Git-Url: http://git.cyclocoop.org/%27-%20%20.%20url_absolue%28find_in_path%28%27spip_style.css%27%29%29%20%20%20.%20url_absolue%28find_in_path%28%27prive/spip_style.css%27%29%29%20.%20%27?a=commitdiff_plain;h=3d556ca2b70fe7ecaa5711def68df862414660d7;p=lhc%2Fweb%2Fwiklou.git (bug 26848) deleteArchivedFiles.php deletes db records, but not files --- diff --git a/maintenance/deleteArchivedFiles.inc b/maintenance/deleteArchivedFiles.inc index e0ac225ea6..68394b4aad 100644 --- a/maintenance/deleteArchivedFiles.inc +++ b/maintenance/deleteArchivedFiles.inc @@ -45,9 +45,12 @@ class DeleteArchivedFilesImplementation { array( 'FOR UPDATE' ) ); if ( $path && file_exists( $path ) && !$inuse ) { - unlink( $path ); // delete - $count++; - $dbw->query( "DELETE FROM $tbl_arch WHERE fa_id = $id" ); + if( unlink( $path ) ) { // delete + $count++; + $dbw->query( "DELETE FROM $tbl_arch WHERE fa_id = $id" ); + } else { + $output->handleOutput( "Unable to remove file $path, skipping\n" ); + } } else { $output->handleOutput( "Notice - file '$key' not found in group '$group'\n" ); if ( $force ) {