Reedy has submitted this change and it was merged.
Change subject: follow-up I0065e259878; clean up return_to links
......................................................................
follow-up I0065e259878; clean up return_to links
bug: 42369
Change-Id: If1afafefca78dc2b83f5fb8494d3cd5f57bf9f88
---
M Collection.body.php
M Collection.i18n.php
M Collection.templates.php
3 files changed, 5 insertions(+), 10 deletions(-)
Approvals:
Reedy: Verified; Looks good to me, approved
diff --git a/Collection.body.php b/Collection.body.php
index 8c67526..2f1b4ab 100644
--- a/Collection.body.php
+++ b/Collection.body.php
@@ -1112,7 +1112,7 @@
}
$query = 'bookcmd=rendering'
- . '&return_to=' . $request->getVal( 'return_to', '' )
+ . '&return_to=' . urlencode( $request->getVal(
'return_to', '' ) )
. '&collection_id=' . urlencode(
$response['collection_id'] )
. '&writer=' . urlencode( $response['writer'] );
if ( $response['is_cached'] ) {
@@ -1134,7 +1134,7 @@
$this->setHeaders();
- $return_to = $request->getVal( 'return_to' );
+ $return_to = $request->getVal( 'return_to', '' );
$query = 'collection_id=' . urlencode(
$response['collection_id'] )
. '&writer=' . urlencode( $response['writer'] )
diff --git a/Collection.i18n.php b/Collection.i18n.php
index 4514f88..ede6fbf 100644
--- a/Collection.i18n.php
+++ b/Collection.i18n.php
@@ -131,7 +131,6 @@
<a href="$1">Force re-rendering.</a></li></ul>',
'coll-excluded-templates' => '* Templates in category
[[:Category:$1|$1]] have been excluded.',
'coll-blacklisted-templates' => '* Templates on blacklist [[:$1]]
have been excluded.',
- 'coll-return_to_collection' => '<p>Return to <a
href="$1">$2</a></p>',
'coll-book_title' => 'Order as a printed book',
'coll-book_text' => 'Get a printed book from our
print-on-demand partner.',
'coll-order_from_pp' => 'Preview with $1',
diff --git a/Collection.templates.php b/Collection.templates.php
index da29f33..d3a8dd8 100644
--- a/Collection.templates.php
+++ b/Collection.templates.php
@@ -389,13 +389,9 @@
if ( $t && $t->exists() ) {
echo wfMessage( 'coll-blacklisted-templates', $title_string
)->parseAsBlock();
}
-if ( $this->data['return_to'] ) {
- // We are doing this the hard way (i.e. via the HTML detour), to prevent
- // the parser from replacing [[:Special:Book]] with a selflink.
- $t = Title::newFromText( $this->data['return_to'] );
- if ( $t ) {
- echo wfMessage( 'coll-return_to_collection', $t->getFullURL(),
$this->data['return_to'] )->text();
- }
+$t = Title::newFromText( $this->data['return_to'] );
+if ( $t && $t->isKnown() ) {
+ echo wfMessage( 'coll-return_to', $t )->parseAsBlock();
}
if ( CollectionSession::isEnabled() ) {
--
To view, visit https://gerrit.wikimedia.org/r/34978
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: If1afafefca78dc2b83f5fb8494d3cd5f57bf9f88
Gerrit-PatchSet: 5
Gerrit-Project: mediawiki/extensions/Collection
Gerrit-Branch: master
Gerrit-Owner: Brian Wolff <[email protected]>
Gerrit-Reviewer: Adamw <[email protected]>
Gerrit-Reviewer: Brian Wolff <[email protected]>
Gerrit-Reviewer: Reedy <[email protected]>
Gerrit-Reviewer: schmir <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits