* (bug 6934) Allow separated inclusions, links, redirects on whatlinkshere
* Add a footer (emailuser-footer) to the bottom of messages sent with
Special:EmailUser
+* Cache image redirects
=== Bug fixes in 1.13 ===
* (bug 13684) Links in Special:ListGroupRights should be in content language
* (bug 13690) Fix PHP notice on accessing some URLs
* Hide (undo) link if user isn't able to edit page
+* Invalidate cache of pages that includes images via redirects on upload
=== API changes in 1.13 ===
public function isContentPage() {
return MWNamespace::isContent( $this->getNamespace() );
}
-
+
+ public function getRedirectsHere() {
+ $redirs = array();
+ $dbr = wfGetDB( DB_SLAVE );
+ $result = $dbr->query( "SELECT page_title, page_namespace FROM page JOIN redirect ON page_id = rd_from WHERE rd_title = "
+ . $dbr->addQuotes( $this->getDBKey() ) . " AND rd_namespace = " . $this->getNamespace(), __METHOD__ );
+ while( $row = $dbr->fetchObject( $result ) ) {
+ $redirs[] = self::newFromRow( $row );
+ }
+ return $redirs;
+ }
}
# Invalidate cache for all pages using this file
$update = new HTMLCacheUpdate( $this->getTitle(), 'imagelinks' );
$update->doUpdate();
+ # Invalidate cache for all pages that redirects on this page
+ $redirs = $this->getTitle()->getRedirectsHere();
+ foreach( $redirs as $redir ) {
+ $update = new HTMLCacheUpdate( $redir, 'imagelinks' );
+ $update->doUpdate();
+ }
return true;
}