Index: trunk/phase3/includes/filerepo/FileRepo.php |
— | — | @@ -621,7 +621,7 @@ |
622 | 622 | */ |
623 | 623 | public function getDisplayName() { |
624 | 624 | // We don't name our own repo, return nothing |
625 | | - if ( $this->name == 'local' ) { |
| 625 | + if ( $this->isLocal() ) { |
626 | 626 | return null; |
627 | 627 | } |
628 | 628 | // 'shared-repo-name-wikimediacommons' is used when $wgUseInstantCommons = true |
— | — | @@ -633,6 +633,16 @@ |
634 | 634 | } |
635 | 635 | |
636 | 636 | /** |
| 637 | + * Returns true if this the local file repository. |
| 638 | + * |
| 639 | + * @return bool |
| 640 | + */ |
| 641 | + function isLocal() { |
| 642 | + return $this->getName() == 'local'; |
| 643 | + } |
| 644 | + |
| 645 | + |
| 646 | + /** |
637 | 647 | * Get a key on the primary cache for this repository. |
638 | 648 | * Returns false if the repository's cache is not accessible at this site. |
639 | 649 | * The parameters are the parts of the key, as for wfMemcKey(). |
Index: trunk/phase3/includes/filerepo/File.php |
— | — | @@ -911,7 +911,8 @@ |
912 | 912 | * @return bool |
913 | 913 | */ |
914 | 914 | function isLocal() { |
915 | | - return $this->getRepoName() == 'local'; |
| 915 | + $repo = $this->getRepo(); |
| 916 | + return $repo && $repo->isLocal(); |
916 | 917 | } |
917 | 918 | |
918 | 919 | /** |