20after4 has uploaded a new change for review.

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

Change subject: Don't make urls ending with double slash.
......................................................................

Don't make urls ending with double slash.

Diffusion is very picky about it's urls.

Change-Id: If9de7563804df06582e917bdfaff8b32400baf39
---
M GerritProjectController.php
1 file changed, 7 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/phabricator/extensions 
refs/changes/33/260033/1

diff --git a/GerritProjectController.php b/GerritProjectController.php
index bf6d5c9..2dc27f3 100644
--- a/GerritProjectController.php
+++ b/GerritProjectController.php
@@ -1327,9 +1327,13 @@
             $branch = str_replace('HEAD', '');
             // double encode any forward slashes in ref.
             $branch = str_replace('/', '%252F', $branch);
-
-            return id(new AphrontRedirectResponse())
-                ->setURI("/diffusion/$CALLSIGN/browse/$branch/");
+            if (strlen($branch)==0){
+                  return id(new AphrontRedirectResponse())
+                        ->setURI("/diffusion/$CALLSIGN/browse/");
+            } else {
+                  return id(new AphrontRedirectResponse())
+                        ->setURI("/diffusion/$CALLSIGN/browse/$branch/");
+            }
         }
         if ($data['action'] == 'browse') {
             if (!isset($data['branch']) || !isset($data['file'])) {

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: If9de7563804df06582e917bdfaff8b32400baf39
Gerrit-PatchSet: 1
Gerrit-Project: phabricator/extensions
Gerrit-Branch: master
Gerrit-Owner: 20after4 <[email protected]>

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

Reply via email to