From 682fb6f519a7991d4d5cd1979c0ffe49f2cb3879 Mon Sep 17 00:00:00 2001 From: Jason Ge Date: Thu, 22 Dec 2011 09:49:46 -0800 Subject: [PATCH] Fix issue when a path is '/' in a package Summary: when a path is '/' in defining a package, D1251 is generating an extra '//'. Test Plan: veryfied adding path '/', '/src' and '/src/' all worked. Reviewers: nh, epriestley Reviewed By: epriestley CC: aran, epriestley Differential Revision: https://secure.phabricator.com/D1266 --- .../owners/storage/package/PhabricatorOwnersPackage.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/applications/owners/storage/package/PhabricatorOwnersPackage.php b/src/applications/owners/storage/package/PhabricatorOwnersPackage.php index 7066cb54ca..b4ada00bef 100644 --- a/src/applications/owners/storage/package/PhabricatorOwnersPackage.php +++ b/src/applications/owners/storage/package/PhabricatorOwnersPackage.php @@ -211,7 +211,9 @@ class PhabricatorOwnersPackage extends PhabricatorOwnersDAO { if ($is_directory && substr($path, -1) != '/') { $path .= '/'; } - $path = '/'.$path; + if (substr($path, 0, 1) != '/') { + $path = '/'.$path; + } if (empty($cur_paths[$repository_phid][$path]) && $valid) { $obj = new PhabricatorOwnersPath(); $obj->setPackageID($this->getID());