Umherirrender has uploaded a new change for review. https://gerrit.wikimedia.org/r/142578
Change subject: Replace deprecated Title::escapeFullURL calls ...................................................................... Replace deprecated Title::escapeFullURL calls Change-Id: I22eac37c9dc5fc06113c59199696302f0eaca3a2 --- M Category.php M Forum.php M Reply.php M Thread.php M WikiForumClass.php M WikiForumGui.php 6 files changed, 37 insertions(+), 37 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/WikiForum refs/changes/78/142578/1 diff --git a/Category.php b/Category.php index d77959a..7ff0e8f 100644 --- a/Category.php +++ b/Category.php @@ -120,7 +120,7 @@ * @return string */ function getURL() { - return SpecialPage::getTitleFor( 'WikiForum' )->escapeFullURL( array( 'category' => $this->getId() ) ); + return htmlspecialchars( SpecialPage::getTitleFor( 'WikiForum' )->getFullURL( array( 'category' => $this->getId() ) ); } /** @@ -141,7 +141,7 @@ global $wgExtensionAssetsPath; $icon = '<img src="' . $wgExtensionAssetsPath . '/WikiForum/icons/folder_add.png" title="' . wfMessage( 'wikiforum-add-forum' )->text() . '" /> '; - return $icon . '<a href="' . SpecialPage::getTitleFor( 'WikiForum' )->escapeFullURL( array( 'wfaction' => 'addforum', 'category' => $this->getId() ) ) . '">' . + return $icon . '<a href="' . htmlspecialchars( SpecialPage::getTitleFor( 'WikiForum' )->getFullURL( array( 'wfaction' => 'addforum', 'category' => $this->getId() ) ) ) . '">' . wfMessage( 'wikiforum-add-forum' )->text() . '</a>'; } @@ -162,17 +162,17 @@ // For grep: wikiforum-edit-forum, wikiforum-edit-category, // wikiforum-delete-forum, wikiforum-delete-category $icon = '<img src="' . $wgExtensionAssetsPath . '/WikiForum/icons/database_edit.png" title="' . wfMessage( 'wikiforum-edit-category' )->text() . '" />'; - $link = ' <a href="' . $specialPage->escapeFullURL( array( 'wfaction' => 'editcategory', 'category' => $this->getId() ) ) . '">' . $icon . '</a>'; + $link = ' <a href="' . htmlspecialchars( $specialPage->getFullURL( array( 'wfaction' => 'editcategory', 'category' => $this->getId() ) ) ) . '">' . $icon . '</a>'; $icon = '<img src="' . $wgExtensionAssetsPath . '/WikiForum/icons/database_delete.png" title="' . wfMessage( 'wikiforum-delete-category' )->text() . '" />'; - $link .= ' <a href="' . $specialPage->escapeFullURL( array( 'wfaction' => 'deletecategory', 'category' => $this->getId() ) ) . '">' . $icon . '</a>'; + $link .= ' <a href="' . htmlspecialchars( $specialPage->getFullURL( array( 'wfaction' => 'deletecategory', 'category' => $this->getId() ) ) ) . '">' . $icon . '</a>'; if ( $sort ) { $icon = '<img src="' . $wgExtensionAssetsPath . '/WikiForum/icons/arrow_up.png" title="' . wfMessage( 'wikiforum-sort-up' )->text() . '" />'; - $link .= ' <a href="' . $specialPage->escapeFullURL( array( 'wfaction' => 'categoryup', 'category' => $this->getId() ) ) . '">' . $icon . '</a>'; + $link .= ' <a href="' . htmlspecialchars( $specialPage->getFullURL( array( 'wfaction' => 'categoryup', 'category' => $this->getId() ) ) ) . '">' . $icon . '</a>'; $icon = '<img src="' . $wgExtensionAssetsPath . '/WikiForum/icons/arrow_down.png" title="' . wfMessage( 'wikiforum-sort-down' )->text() . '" />'; - $link .= ' <a href="' . $specialPage->escapeFullURL( array( 'wfaction' => 'categorydown', 'category' => $this->getId() ) ) . '">' . $icon . '</a>'; + $link .= ' <a href="' . htmlspecialchars( $specialPage->getFullURL( array( 'wfaction' => 'categorydown', 'category' => $this->getId() ) ) ) . '">' . $icon . '</a>'; } } @@ -458,7 +458,7 @@ $titlePlaceholder = str_replace( '"', '"', $titlePlaceholder ); $titleValue = str_replace( '"', '"', $titleValue ); $specialPage = SpecialPage::getTitleFor( 'WikiForum' ); - $url = $specialPage->escapeFullURL( $params ); + $url = htmlspecialchars( $specialPage->getFullURL( $params ) ); return WikiForumGui::showTopLevelForm( $url, '', $formTitle, $titlePlaceholder, $titleValue ); } diff --git a/Forum.php b/Forum.php index 1a63b5c..afd32fd 100644 --- a/Forum.php +++ b/Forum.php @@ -215,7 +215,7 @@ function getURL() { $page = SpecialPage::getTitleFor( 'WikiForum' ); - return $page->escapeFullURL( array( 'forum' => $this->getId() ) ); + return htmlspecialchars( $page->getFullURL( array( 'forum' => $this->getId() ) ) ); } /** @@ -274,17 +274,17 @@ $specialPage = SpecialPage::getTitleFor( 'WikiForum' ); $icon = '<img src="' . $wgExtensionAssetsPath . '/WikiForum/icons/folder_edit.png" title="' . wfMessage( 'wikiforum-edit-forum' )->text() . '" />'; - $link = ' <a href="' . $specialPage->escapeFullURL( array( 'wfaction' => 'editforum', 'forum' => $this->getId() ) ) . '">' . $icon . '</a>'; + $link = ' <a href="' . htmlspecialchars( $specialPage->getFullURL( array( 'wfaction' => 'editforum', 'forum' => $this->getId() ) ) ) . '">' . $icon . '</a>'; $icon = '<img src="' . $wgExtensionAssetsPath . '/WikiForum/icons/folder_delete.png" title="' . wfMessage( 'wikiforum-delete-forum' )->text() . '" />'; - $link .= ' <a href="' . $specialPage->escapeFullURL( array( 'wfaction' => 'deleteforum', 'forum' => $this->getId() ) ) . '">' . $icon . '</a>'; + $link .= ' <a href="' . htmlspecialchars( $specialPage->getFullURL( array( 'wfaction' => 'deleteforum', 'forum' => $this->getId() ) ) ) . '">' . $icon . '</a>'; if ( $sort ) { $icon = '<img src="' . $wgExtensionAssetsPath . '/WikiForum/icons/arrow_up.png" title="' . wfMessage( 'wikiforum-sort-up' )->text() . '" />'; - $link .= ' <a href="' . $specialPage->escapeFullURL( array( 'wfaction' => 'forumup', 'forum' => $this->getId() ) ) . '">' . $icon . '</a>'; + $link .= ' <a href="' . htmlspecialchars( $specialPage->getFullURL( array( 'wfaction' => 'forumup', 'forum' => $this->getId() ) ) ) . '">' . $icon . '</a>'; $icon = '<img src="' . $wgExtensionAssetsPath . '/WikiForum/icons/arrow_down.png" title="' . wfMessage( 'wikiforum-sort-down' )->text() . '" />'; - $link .= ' <a href="' . $specialPage->escapeFullURL( array( 'wfaction' => 'forumdown', 'forum' => $this->getId() ) ) . '">' . $icon . '</a>'; + $link .= ' <a href="' . htmlspecialchars( $specialPage->getFullURL( array( 'wfaction' => 'forumdown', 'forum' => $this->getId() ) ) ) . '">' . $icon . '</a>'; } } @@ -400,7 +400,7 @@ $write_thread = ''; } else { $icon = '<img src="' . $wgExtensionAssetsPath . '/WikiForum/icons/note_add.png" title="' . wfMessage( 'wikiforum-write-thread' )->text() . '" /> '; - $write_thread = $icon . '<a href="' . $specialPage->escapeFullURL( array( 'wfaction' => 'addthread', 'forum' => $this->getId() ) ) . '">' . + $write_thread = $icon . '<a href="' . htmlspecialchars( $specialPage->getFullURL( array( 'wfaction' => 'addthread', 'forum' => $this->getId() ) ) ) . '">' . wfMessage( 'wikiforum-write-thread' ) . '</a>'; } @@ -413,21 +413,21 @@ // @see http://bugzilla.shoutwiki.com/show_bug.cgi?id=174 $output .= WikiForumGui::showMainHeader( $this->getName() . ' <a href="' . - $specialPage->escapeFullURL( array( 'st' => 'thread', 'sd' => 'up', 'forum' => $this->getId() ) ) . '">' . $up . + htmlspecialchars( $specialPage->getFullURL( array( 'st' => 'thread', 'sd' => 'up', 'forum' => $this->getId() ) ) ) . '">' . $up . '</a><a href="' . - $specialPage->escapeFullURL( array( 'st' => 'thread', 'sd' => 'down', 'forum' => $this->getId() ) ) . '">' . $down . '</a>', + htmlspecialchars( $specialPage->getFullURL( array( 'st' => 'thread', 'sd' => 'down', 'forum' => $this->getId() ) ) ) . '">' . $down . '</a>', wfMessage( 'wikiforum-replies' )->text() . ' <br /><a href="' . - $specialPage->escapeFullURL( array( 'st' => 'answers', 'sd' => 'up', 'forum' => $this->getId() ) ) . '">' . $up . - '</a><a href="' . $specialPage->escapeFullURL( array( 'st' => 'answers', 'sd' => 'down', 'forum' => $this->getId() ) ) . '">' . $down . '</a>', + htmlspecialchars( $specialPage->getFullURL( array( 'st' => 'answers', 'sd' => 'up', 'forum' => $this->getId() ) ) ) . '">' . $up . + '</a><a href="' . htmlspecialchars( $specialPage->getFullURL( array( 'st' => 'answers', 'sd' => 'down', 'forum' => $this->getId() ) ) ) . '">' . $down . '</a>', wfMessage( 'wikiforum-views' )->text() . ' <br /><a href="' . - $specialPage->escapeFullURL( array( 'st' => 'calls', 'sd' => 'up', 'forum' => $this->getId() ) ) . '">' . $up . '</a><a href="' . - $specialPage->escapeFullURL( array( 'st' => 'calls', 'sd' => 'down', 'forum' => $this->getId() ) ) . '">' . $down . '</a>', + htmlspecialchars( $specialPage->getFullURL( array( 'st' => 'calls', 'sd' => 'up', 'forum' => $this->getId() ) ) ) . '">' . $up . '</a><a href="' . + htmlspecialchars( $specialPage->getFullURL( array( 'st' => 'calls', 'sd' => 'down', 'forum' => $this->getId() ) ) ) . '">' . $down . '</a>', wfMessage( 'wikiforum-latest-reply' )->text() . ' <br /><a href="' . - $specialPage->escapeFullURL( array( 'st' => 'last', 'sd' => 'up', 'forum' => $this->getId() ) ) . '">' . $up . - '</a><a href="' . $specialPage->escapeFullURL( array( 'st' => 'last', 'sd' => 'up', 'forum' => $this->getId() ) ) . '">' . $down . '</a>' + htmlspecialchars( $specialPage->getFullURL( array( 'st' => 'last', 'sd' => 'up', 'forum' => $this->getId() ) ) ) . '">' . $up . + '</a><a href="' . htmlspecialchars( $specialPage->getFullURL( array( 'st' => 'last', 'sd' => 'up', 'forum' => $this->getId() ) ) ) . '">' . $down . '</a>' ); // sorting @@ -647,7 +647,7 @@ $titlePlaceholder = str_replace( '"', '"', $titlePlaceholder ); $titleValue = str_replace( '"', '"', $titleValue ); $specialPage = SpecialPage::getTitleFor( 'WikiForum' ); - $url = $specialPage->escapeFullURL( $params ); + $url = htmlspecialchars( $specialPage->getFullURL( $params ) ); $check = ''; if ( $announcement ) { diff --git a/Reply.php b/Reply.php index 7170d34..7b91157 100644 --- a/Reply.php +++ b/Reply.php @@ -295,7 +295,7 @@ $user = $this->getUser(); $specialPage = SpecialPage::getTitleFor( 'WikiForum' ); - $editButtons = '<a href="' . $specialPage->escapeFullURL( array( 'thread' => $thread->getId(), 'quotereply' => $this->getId() ) ) . '#writereply">'; + $editButtons = '<a href="' . htmlspecialchars( $specialPage->getFullURL( array( 'thread' => $thread->getId(), 'quotereply' => $this->getId() ) ) ) . '#writereply">'; $editButtons .= '<img src="' . $wgExtensionAssetsPath . '/WikiForum/icons/comments_add.png" title="' . wfMessage( 'wikiforum-quote' )->text() . '" />'; if ( @@ -306,9 +306,9 @@ || $user->isAllowed( 'wikiforum-moderator' ) ) { - $editButtons .= ' <a href="' . $specialPage->escapeFullURL( array( 'wfaction' => 'editreply', 'reply' => $this->getId() ) ) . '#writereply">'; + $editButtons .= ' <a href="' . htmlspecialchars( $specialPage->getFullURL( array( 'wfaction' => 'editreply', 'reply' => $this->getId() ) ) ) . '#writereply">'; $editButtons .= '<img src="' . $wgExtensionAssetsPath . '/WikiForum/icons/comment_edit.png" title="' . wfMessage( 'wikiforum-edit-reply' )->text() . '" />'; - $editButtons .= '</a> <a href="' . $specialPage->escapeFullURL( array( 'wfaction' => 'deletereply', 'reply' => $this->getId() ) ) . '">'; + $editButtons .= '</a> <a href="' . htmlspecialchars( $specialPage->getFullURL( array( 'wfaction' => 'deletereply', 'reply' => $this->getId() ) ) ) . '">'; $editButtons .= '<img src="' . $wgExtensionAssetsPath . '/WikiForum/icons/comment_delete.png" title="' . wfMessage( 'wikiforum-delete-reply' )->text() . '" />'; } diff --git a/Thread.php b/Thread.php index f7169d8..5e9a8cf 100644 --- a/Thread.php +++ b/Thread.php @@ -149,7 +149,7 @@ $fragment = 'reply_' . $reply; } - return SpecialPage::getTitleFor( 'WikiForum', $this->getName(), $fragment )->escapeFullURL(); + return htmlspecialchars( SpecialPage::getTitleFor( 'WikiForum', $this->getName(), $fragment )->getFullURL() ); } /** @@ -567,11 +567,11 @@ if ( $this->getUser()->isAllowed( 'wikiforum-admin' ) ) { if ( $this->isSticky() ) { $icon = '<img src="' . $wgExtensionAssetsPath . '/WikiForum/icons/tag_blue_delete.png" title="' . wfMessage( 'wikiforum-remove-sticky' )->text() . '" /> '; - $menuLink = $icon . '<a href="' . $specialPage->escapeFullURL( array( 'wfaction' => 'removesticky', 'thread' => $this->getId() ) ) . '">' . + $menuLink = $icon . '<a href="' . htmlspecialchars( $specialPage->getFullURL( array( 'wfaction' => 'removesticky', 'thread' => $this->getId() ) ) ) . '">' . wfMessage( 'wikiforum-remove-sticky' )->text() . '</a> '; } else { $icon = '<img src="' . $wgExtensionAssetsPath . '/WikiForum/icons/tag_blue_add.png" title="' . wfMessage( 'wikiforum-make-sticky' )->text() . '" /> '; - $menuLink = $icon . '<a href="' . $specialPage->escapeFullURL( array( 'wfaction' => 'makesticky', 'thread' => $this->getId() ) ) . '">' . + $menuLink = $icon . '<a href="' . htmlspecialchars( $specialPage->getFullURL( array( 'wfaction' => 'makesticky', 'thread' => $this->getId() ) ) ) . '">' . wfMessage( 'wikiforum-make-sticky' )->text() . '</a> '; } } @@ -723,7 +723,7 @@ $specialPage = SpecialPage::getTitleFor( 'WikiForum' ); - $editButtons .= '<a href="' . $specialPage->escapeFullURL( array( 'thread' => $this->getId(), 'quotethread' => $this->getId() ) ) . '#writereply">'; + $editButtons .= '<a href="' . htmlspecialchars( $specialPage->getFullURL( array( 'thread' => $this->getId(), 'quotethread' => $this->getId() ) ) ) . '#writereply">'; $editButtons .= '<img src="' . $wgExtensionAssetsPath . '/WikiForum/icons/comments_add.png" title="' . wfMessage( 'wikiforum-quote' )->text() . '" />'; $editButtons .= '</a>'; @@ -733,20 +733,20 @@ $user->getId() == $this->getPostedById() || $user->isAllowed( 'wikiforum-moderator' ) ) { - $editButtons .= ' <a href="' . $specialPage->escapeFullURL( array( 'wfaction' => 'editthread', 'thread' => $this->getId() ) ) . '">'; + $editButtons .= ' <a href="' . htmlspecialchars( $specialPage->getFullURL( array( 'wfaction' => 'editthread', 'thread' => $this->getId() ) ) ) . '">'; $editButtons .= '<img src="' . $wgExtensionAssetsPath . '/WikiForum/icons/note_edit.png" title="' . wfMessage( 'wikiforum-edit-thread' )->text() . '" />'; - $editButtons .= '</a> <a href="' . $specialPage->escapeFullURL( array( 'wfaction' => 'deletethread', 'thread' => $this->getId() ) ) . '">'; + $editButtons .= '</a> <a href="' . htmlspecialchars( $specialPage->getFullURL( array( 'wfaction' => 'deletethread', 'thread' => $this->getId() ) ) ) . '">'; $editButtons .= '<img src="' . $wgExtensionAssetsPath . '/WikiForum/icons/note_delete.png" title="' . wfMessage( 'wikiforum-delete-thread' )->text() . '" />'; $editButtons .= '</a> '; // Only moderators can lock and reopen threads if ( $user->isAllowed( 'wikiforum-moderator' ) ) { if ( !$this->isClosed() ) { - $editButtons .= ' <a href="' . $specialPage->escapeFullURL( array( 'wfaction' => 'closethread', 'thread' => $this->getId() ) ) . '">'; + $editButtons .= ' <a href="' . htmlspecialchars( $specialPage->getFullURL( array( 'wfaction' => 'closethread', 'thread' => $this->getId() ) ) ) . '">'; $editButtons .= '<img src="' . $wgExtensionAssetsPath . '/WikiForum/icons/lock_add.png" title="' . wfMessage( 'wikiforum-close-thread' )->text() . '" />'; $editButtons .= '</a>'; } else { - $editButtons .= ' <a href="' . $specialPage->escapeFullURL( array( 'wfaction' => 'reopenthread', 'thread' => $this->getId() ) ) . '">'; + $editButtons .= ' <a href="' . htmlspecialchars( $specialPage->getFullURL( array( 'wfaction' => 'reopenthread', 'thread' => $this->getId() ) ) ) . '">'; $editButtons .= '<img src="' . $wgExtensionAssetsPath . '/WikiForum/icons/lock_open.png" title="' . wfMessage( 'wikiforum-reopen-thread' )->text() . '" />'; $editButtons .= '</a>'; } diff --git a/WikiForumClass.php b/WikiForumClass.php index d92f4af..15d4d3d 100644 --- a/WikiForumClass.php +++ b/WikiForumClass.php @@ -62,7 +62,7 @@ // Forum admins are allowed to add new categories if ( $wgUser->isAllowed( 'wikiforum-admin' ) ) { $icon = '<img src="' . $wgExtensionAssetsPath . '/WikiForum/icons/database_add.png" title="' . wfMessage( 'wikiforum-add-category' )->text() . '" /> '; - $menuLink = $icon . '<a href="' . SpecialPage::getTitleFor( 'WikiForum' )->escapeFullURL( array( 'wfaction' => 'addcategory' ) ) . '">' . + $menuLink = $icon . '<a href="' . htmlspecialchars( SpecialPage::getTitleFor( 'WikiForum' )->getFullURL( array( 'wfaction' => 'addcategory' ) ) ) . '">' . wfMessage( 'wikiforum-add-category' )->text() . '</a>'; $output .= WikiForumGui::showHeaderRow( '', $menuLink ); } diff --git a/WikiForumGui.php b/WikiForumGui.php index e67e6cb..6c01732 100644 --- a/WikiForumGui.php +++ b/WikiForumGui.php @@ -34,7 +34,7 @@ static function showSearchbox() { global $wgExtensionAssetsPath; - $url = SpecialPage::getTitleFor( 'WikiForum' )->escapeFullURL( array( 'wfaction' => 'search' ) ); + $url = htmlspecialchars( SpecialPage::getTitleFor( 'WikiForum' )->getFullURL( array( 'wfaction' => 'search' ) ) ); $icon = '<img src="' . $wgExtensionAssetsPath . '/WikiForum/icons/zoom.png" id="mw-wikiforum-searchbox-picture" title="' . wfMessage( 'search' )->text() . '" />'; @@ -95,7 +95,7 @@ } if ( $i != $page + 1 ) { - $output .= '<a href="' . $specialPage->escapeFullURL( $urlParams ) . '">' . $pageNumber . '</a>'; + $output .= '<a href="' . htmlspecialchars( $specialPage->getFullURL( $urlParams ) ) . '">' . $pageNumber . '</a>'; } else { $output .= '[' . $pageNumber . ']'; } @@ -235,7 +235,7 @@ if ( $wgWikiForumAllowAnonymous || $wgUser->isLoggedIn() ) { $wgOut->addModules( 'mediawiki.action.edit' ); // Required for the edit buttons to display - $output = '<form name="frmMain" method="post" action="' . SpecialPage::getTitleFor( 'WikiForum' )->escapeFullURL( $params ) . '" id="writereply"> + $output = '<form name="frmMain" method="post" action="' . htmlspecialchars( SpecialPage::getTitleFor( 'WikiForum' )->getFullURL( $params ) ) . '" id="writereply"> <table class="mw-wikiforum-frame" cellspacing="10">' . $input . ' <tr> <td>' . EditPage::getEditToolbar() . '</td> -- To view, visit https://gerrit.wikimedia.org/r/142578 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I22eac37c9dc5fc06113c59199696302f0eaca3a2 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/WikiForum Gerrit-Branch: master Gerrit-Owner: Umherirrender <umherirrender_de...@web.de> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits