1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-19 05:12:41 +01:00

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
This commit is contained in:
Jason Ge 2011-12-22 09:49:46 -08:00
parent 99a9c082f9
commit 682fb6f519

View file

@ -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());