From 6f9d6cbcf936ee89268cd0c165cbeae70f513818 Mon Sep 17 00:00:00 2001 From: Siebrand Mazeland Date: Mon, 15 Jun 2009 12:32:59 +0000 Subject: [PATCH] Fix double escaping issues. Related to r51559 and friends. --- includes/EditPage.php | 2 +- includes/ImagePage.php | 2 +- includes/LogEventsList.php | 4 ++-- includes/OutputPage.php | 2 +- includes/PageHistory.php | 2 +- includes/SkinTemplate.php | 9 +++++++-- includes/specials/SpecialAllpages.php | 4 ++-- includes/specials/SpecialConfirmemail.php | 2 +- includes/specials/SpecialContributions.php | 4 ++-- includes/specials/SpecialDeletedContributions.php | 12 ++++++------ includes/specials/SpecialProtectedpages.php | 2 +- includes/specials/SpecialRevisiondelete.php | 10 +++++++--- includes/specials/SpecialUnusedtemplates.php | 2 +- includes/specials/SpecialUpload.php | 2 +- includes/specials/SpecialWatchlist.php | 2 +- includes/specials/SpecialWhatlinkshere.php | 2 +- 16 files changed, 36 insertions(+), 27 deletions(-) diff --git a/includes/EditPage.php b/includes/EditPage.php index 0df1da6a62..020af5e26f 100644 --- a/includes/EditPage.php +++ b/includes/EditPage.php @@ -1875,7 +1875,7 @@ END $loginTitle, wfMsgHtml( 'loginreqlink' ), array(), - array( 'returnto' => $wgTitle->getPrefixedUrl() ), + array( 'returnto' => $wgTitle->getPrefixedText() ), array( 'known', 'noclasses' ) ); diff --git a/includes/ImagePage.php b/includes/ImagePage.php index 60d7b3b63e..3d815c66c2 100644 --- a/includes/ImagePage.php +++ b/includes/ImagePage.php @@ -921,7 +921,7 @@ class ImageHistoryList { $wgLang->timeAndDate( $timestamp, true ), array(), array( - 'target' => $wgTitle->getPrefixedUrl(), + 'target' => $wgTitle->getPrefixedText(), 'file' => $img, 'token' => $wgUser->editToken( $img ) ), diff --git a/includes/LogEventsList.php b/includes/LogEventsList.php index e89e427255..c1dbe43607 100644 --- a/includes/LogEventsList.php +++ b/includes/LogEventsList.php @@ -367,7 +367,7 @@ class LogEventsList { $this->message['revdel-restore'], array(), array( - 'target' => $title->getPrefixedUrl(), + 'target' => $title->getPrefixedText(), 'type' => $key, 'ids' => $query ), @@ -389,7 +389,7 @@ class LogEventsList { $this->message['revdel-restore'], array(), array( - 'target' => $title->getPrefixedUrl(), + 'target' => $title->getPrefixedText(), 'type' => 'logging', 'ids' => $query ), diff --git a/includes/OutputPage.php b/includes/OutputPage.php index d390eaa87e..623411bbec 100644 --- a/includes/OutputPage.php +++ b/includes/OutputPage.php @@ -1258,7 +1258,7 @@ class OutputPage { $loginTitle, wfMsgHtml( 'loginreqlink' ), array(), - array( 'returnto' => $this->getTitle()->getPrefixedUrl() ), + array( 'returnto' => $this->getTitle()->getPrefixedText() ), array( 'known', 'noclasses' ) ); $this->addHTML( wfMsgWikiHtml( 'loginreqpagetext', $loginLink ) ); diff --git a/includes/PageHistory.php b/includes/PageHistory.php index 47bd5bb0fd..279f97b43a 100644 --- a/includes/PageHistory.php +++ b/includes/PageHistory.php @@ -94,7 +94,7 @@ class PageHistory { $logPage, wfMsgHtml( 'viewpagelogs' ), array(), - array( 'page' => $this->mTitle->getPrefixedUrl() ), + array( 'page' => $this->mTitle->getPrefixedText() ), array( 'known', 'noclasses' ) ); $wgOut->setSubtitle( $logLink ); diff --git a/includes/SkinTemplate.php b/includes/SkinTemplate.php index 8100611782..0604c87d7f 100644 --- a/includes/SkinTemplate.php +++ b/includes/SkinTemplate.php @@ -938,8 +938,13 @@ class SkinTemplate extends Skin { if( $id ) { $logPage = SpecialPage::getTitleFor( 'Log' ); - $nav_urls['log'] = array( 'href' => $logPage->getLocalUrl( 'user=' - . $this->mTitle->getPartialUrl() ) ); + $nav_urls['log'] = array( + 'href' => $logPage->getLocalUrl( + array( + 'user' => $this->mTitle->getText() + ) + ) + ); } else { $nav_urls['log'] = false; } diff --git a/includes/specials/SpecialAllpages.php b/includes/specials/SpecialAllpages.php index b3d2d51677..1868935ffd 100644 --- a/includes/specials/SpecialAllpages.php +++ b/includes/specials/SpecialAllpages.php @@ -384,7 +384,7 @@ class SpecialAllpages extends IncludableSpecialPage { # Do we put a previous link ? if( isset( $prevTitle ) && $pt = $prevTitle->getText() ) { - $query = array( 'from' => $prevTitle->getPartialUrl() ); + $query = array( 'from' => $prevTitle->getText() ); if( $namespace ) $query['namespace'] = $namespace; @@ -401,7 +401,7 @@ class SpecialAllpages extends IncludableSpecialPage { if( $n == $this->maxPerPage && $s = $res->fetchObject() ) { # $s is the first link of the next chunk $t = Title::MakeTitle($namespace, $s->page_title); - $query = array( 'from' => $t->getPartialUrl() ); + $query = array( 'from' => $t->getText() ); if( $namespace ) $query['namespace'] = $namespace; diff --git a/includes/specials/SpecialConfirmemail.php b/includes/specials/SpecialConfirmemail.php index 7090ee49be..dd3cece203 100644 --- a/includes/specials/SpecialConfirmemail.php +++ b/includes/specials/SpecialConfirmemail.php @@ -39,7 +39,7 @@ class EmailConfirmation extends UnlistedSpecialPage { $title, wfMsgHtml( 'loginreqlink' ), array(), - array( 'returnto' => $this->getTitle()->getPrefixedUrl() ) + array( 'returnto' => $this->getTitle()->getPrefixedText() ) ); $wgOut->addHTML( wfMsgWikiHtml( 'confirmemail_needlogin', $llink ) ); } diff --git a/includes/specials/SpecialContributions.php b/includes/specials/SpecialContributions.php index 63ae3c8141..a61a9ea6f2 100644 --- a/includes/specials/SpecialContributions.php +++ b/includes/specials/SpecialContributions.php @@ -168,7 +168,7 @@ class SpecialContributions extends SpecialPage { array(), array( 'type' => 'block', - 'page' => $nt->getPrefixedUrl() + 'page' => $nt->getPrefixedText() ) ); } @@ -177,7 +177,7 @@ class SpecialContributions extends SpecialPage { SpecialPage::getTitleFor( 'Log' ), wfMsg( 'sp-contributions-logs' ), array(), - array( 'user' => $nt->getPartialUrl() ) + array( 'user' => $nt->getText() ) ); # Add link to deleted user contributions for priviledged users diff --git a/includes/specials/SpecialDeletedContributions.php b/includes/specials/SpecialDeletedContributions.php index 7f25681db7..1fe7947d50 100644 --- a/includes/specials/SpecialDeletedContributions.php +++ b/includes/specials/SpecialDeletedContributions.php @@ -132,7 +132,7 @@ class DeletedContribsPager extends IndexPager { array(), array( 'type' => 'delete', - 'page' => $page->getPrefixedUrl() + 'page' => $page->getPrefixedText() ) ); @@ -146,7 +146,7 @@ class DeletedContribsPager extends IndexPager { htmlspecialchars( $page->getPrefixedText() ), array(), array( - 'target' => $page->getPrefixedUrl(), + 'target' => $page->getPrefixedText(), 'timestamp' => $rev->getTimestamp() ) ); @@ -156,7 +156,7 @@ class DeletedContribsPager extends IndexPager { $this->messages['diff'], array(), array( - 'target' => $page->getPrefixedUrl(), + 'target' => $page->getPrefixedText(), 'timestamp' => $rev->getTimestamp(), 'diff' => 'prev' ) @@ -173,7 +173,7 @@ class DeletedContribsPager extends IndexPager { $d, array(), array( - 'target' => $page->getPrefixedUrl(), + 'target' => $page->getPrefixedText(), 'timestamp' => $rev->getTimestamp() ) ); @@ -347,7 +347,7 @@ class DeletedContributionsPage extends SpecialPage { array(), array( 'type' => 'block', - 'page' => $nt->getPrefixedUrl() + 'page' => $nt->getPrefixedText() ) ); } @@ -356,7 +356,7 @@ class DeletedContributionsPage extends SpecialPage { SpecialPage::getTitleFor( 'Log' ), wfMsgHtml( 'sp-contributions-logs' ), array(), - array( 'user' => $nt->getPartialUrl() ) + array( 'user' => $nt->getText() ) ); # Link to undeleted contributions $tools[] = $sk->linkKnown( diff --git a/includes/specials/SpecialProtectedpages.php b/includes/specials/SpecialProtectedpages.php index 01b895fccf..46602f6b04 100644 --- a/includes/specials/SpecialProtectedpages.php +++ b/includes/specials/SpecialProtectedpages.php @@ -109,7 +109,7 @@ class ProtectedPagesForm { array(), array( 'type' => 'protect', - 'page' => $title->getPrefixedUrl() + 'page' => $title->getPrefixedText() ) ) . ')'; } diff --git a/includes/specials/SpecialRevisiondelete.php b/includes/specials/SpecialRevisiondelete.php index f8697a2f32..cc4c8a4f76 100644 --- a/includes/specials/SpecialRevisiondelete.php +++ b/includes/specials/SpecialRevisiondelete.php @@ -190,7 +190,7 @@ class SpecialRevisionDelete extends UnlistedSpecialPage { $logtitle, wfMsgHtml( 'viewpagelogs' ), array(), - array( 'page' => $this->targetObj->getPrefixedUrl() ) + array( 'page' => $this->targetObj->getPrefixedText() ) ); # Give a link to the page history $links[] = $this->skin->linkKnown( @@ -1582,8 +1582,12 @@ class RevDel_LogItem extends RevDel_Item { $title = Title::makeTitle( $this->row->log_namespace, $this->row->log_title ); $logtitle = SpecialPage::getTitleFor( 'Log' ); - $loglink = $this->special->skin->link( $logtitle, wfMsgHtml( 'log' ), array(), - array( 'page' => $title->getPrefixedUrl() ) ); + $loglink = $this->special->skin->link( + $logtitle, + wfMsgHtml( 'log' ), + array(), + array( 'page' => $title->getPrefixedText() ) + ); // Action text if( !$this->canView() ) { $action = '' . wfMsgHtml('rev-deleted-event') . ''; diff --git a/includes/specials/SpecialUnusedtemplates.php b/includes/specials/SpecialUnusedtemplates.php index 5aaf36358e..6ddbab3289 100644 --- a/includes/specials/SpecialUnusedtemplates.php +++ b/includes/specials/SpecialUnusedtemplates.php @@ -43,7 +43,7 @@ class UnusedtemplatesPage extends QueryPage { SpecialPage::getTitleFor( 'Whatlinkshere' ), wfMsgHtml( 'unusedtemplateswlh' ), array(), - array( 'target' => $title->getPrefixedUrl() ) + array( 'target' => $title->getPrefixedText() ) ); return wfSpecialList( $pageLink, $wlhLink ); } diff --git a/includes/specials/SpecialUpload.php b/includes/specials/SpecialUpload.php index 6afc06e2ae..bb4bae10ff 100644 --- a/includes/specials/SpecialUpload.php +++ b/includes/specials/SpecialUpload.php @@ -727,7 +727,7 @@ class UploadForm { array(), array( 'type' => 'delete', - 'page' => $file->getTitle()->getPrefixedUrl() + 'page' => $file->getTitle()->getPrefixedText() ) ); $warning .= '
  • ' . wfMsgWikiHtml( 'filewasdeleted', $llink ) . '
  • '; diff --git a/includes/specials/SpecialWatchlist.php b/includes/specials/SpecialWatchlist.php index 885c81450b..8703d1b2ad 100644 --- a/includes/specials/SpecialWatchlist.php +++ b/includes/specials/SpecialWatchlist.php @@ -25,7 +25,7 @@ function wfSpecialWatchlist( $par ) { SpecialPage::getTitleFor( 'Userlogin' ), wfMsgHtml( 'loginreqlink' ), array(), - array( 'returnto' => $specialTitle->getPrefixedUrl() ) + array( 'returnto' => $specialTitle->getPrefixedText() ) ); $wgOut->addHTML( wfMsgWikiHtml( 'watchlistanontext', $llink ) ); return; diff --git a/includes/specials/SpecialWhatlinkshere.php b/includes/specials/SpecialWhatlinkshere.php index 5e21c736ce..255e76bd49 100644 --- a/includes/specials/SpecialWhatlinkshere.php +++ b/includes/specials/SpecialWhatlinkshere.php @@ -310,7 +310,7 @@ class SpecialWhatLinksHere extends SpecialPage { $title, $text, array(), - array( 'target' => $targetText ) + array( 'target' => $target->getPrefixedText() ) ); } -- 2.20.1