# HG changeset patch # User Dan # Date 1215623905 14400 # Node ID ffa5decbb30595ae700d4267da18f673f58d8d1d # Parent ec9385bb7243f7d65ff137a87dcb3fa0010979cb Fixed a few places where page metadata cache should have been purged (there may be a few more commits like this) diff -r ec9385bb7243 -r ffa5decbb305 includes/pageutils.php --- a/includes/pageutils.php Mon Jul 07 18:13:01 2008 -0400 +++ b/includes/pageutils.php Wed Jul 09 13:18:25 2008 -0400 @@ -1124,6 +1124,7 @@ { global $db, $session, $paths, $template, $plugins; // Common objects global $lang; + global $cache; $perms = $session->fetch_page_acl($page_id, $namespace); $x = trim($reason); if ( empty($x) ) @@ -1141,8 +1142,12 @@ if(!$e) $db->_die('The page text entry could not be deleted.'); $e = $db->sql_query('DELETE FROM ' . table_prefix.'pages WHERE urlname=\'' . $page_id . '\' AND namespace=\'' . $namespace . '\''); if(!$e) $db->_die('The page entry could not be deleted.'); - $e = $db->sql_query('DELETE FROM ' . table_prefix.'files WHERE page_id=\'' . $page_id . '\''); - if(!$e) $db->_die('The file entry could not be deleted.'); + if ( $namespace == 'File' ) + { + $e = $db->sql_query('DELETE FROM ' . table_prefix.'files WHERE page_id=\'' . $page_id . '\''); + if(!$e) $db->_die('The file entry could not be deleted.'); + } + $cache->purge('page_meta'); return $lang->get('ajax_delete_success'); } diff -r ec9385bb7243 -r ffa5decbb305 plugins/SpecialUpdownload.php --- a/plugins/SpecialUpdownload.php Mon Jul 07 18:13:01 2008 -0400 +++ b/plugins/SpecialUpdownload.php Wed Jul 09 13:18:25 2008 -0400 @@ -49,6 +49,7 @@ { global $db, $session, $paths, $template, $plugins; // Common objects global $lang; + global $cache; global $mime_types; if(getConfig('enable_uploads')!='1') { die_friendly($lang->get('etc_access_denied_short'), '
' . $lang->get('upload_err_disabled_site') . '
'); } if ( !$session->get_permissions('upload_files') ) @@ -148,6 +149,7 @@ { if(!$db->sql_query('INSERT INTO '.table_prefix.'logs(time_id,date_string,log_type,action,author,page_id,namespace,edit_summary) VALUES('.$utime.', \''.enano_date('d M Y h:i a').'\', \'page\', \'reupload\', \''.$session->username.'\', \''.$filename.'\', \''.'File'.'\', \''.$comments.'\');')) $db->_die('The page log could not be updated.'); } + $cache->purge('page_meta'); die_friendly($lang->get('upload_success_title'), '' . $lang->get('upload_success_body', array('file_link' => makeUrlNS('File', $filename))) . '
'); } else