Mattflaschen has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/170785

Change subject: Expand anchors to full URL on server rendering
......................................................................

Expand anchors to full URL on server rendering

This fixes bug 72490 and any similar issues where we're doing:

[$1 text of link]

but $1 is not a fully qualified URL.

There is a bug (bug 66746) to provide i18n support so it can be done
without creating an external link (which the above does), but this
fixes the broken user experience in the meantime.

Bug: 72490
Change-Id: I615a1178be61ea911855e92a131dea980ef27554
---
M includes/View.php
1 file changed, 8 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Flow 
refs/changes/85/170785/1

diff --git a/includes/View.php b/includes/View.php
index b002862..e5e62a6 100644
--- a/includes/View.php
+++ b/includes/View.php
@@ -152,7 +152,15 @@
 
                array_walk_recursive( $apiResponse, function( &$value ) {
                        if ( $value instanceof Anchor ) {
+                               $anchor = $value;
                                $value = $value->toArray();
+
+                               // TODO: We're looking into another approach 
for this
+                               // using a parser function, so the URL doesn't 
have to be
+                               // fully qualified.
+                               // See 
https://bugzilla.wikimedia.org/show_bug.cgi?id=66746
+                               $value['url'] = $anchor->getFullURL();
+
                        } elseif ( $value instanceof Message ) {
                                $value = $value->text();
                        }

-- 
To view, visit https://gerrit.wikimedia.org/r/170785
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I615a1178be61ea911855e92a131dea980ef27554
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Flow
Gerrit-Branch: master
Gerrit-Owner: Mattflaschen <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to