(bug 2099) Deleted files can now be archived and undeleted, if you set up an appropri...
[lhc/web/wiklou.git] / includes / Title.php
index de971d5..c377798 100644 (file)
@@ -1256,6 +1256,10 @@ class Title {
                        $dbr =& wfGetDB( DB_SLAVE );
                        $n = $dbr->selectField( 'archive', 'COUNT(*)', array( 'ar_namespace' => $this->getNamespace(),
                                'ar_title' => $this->getDBkey() ), $fname );
+                       if( $this->getNamespace() == NS_IMAGE ) {
+                               $n += $dbr->selectField( 'filearchive', 'COUNT(*)',
+                                       array( 'fa_name' => $this->getDBkey() ), $fname );
+                       }
                }
                return (int)$n;
        }