Browse files

Only follow 1 subpackage deeper.

  • Loading branch information...
1 parent 9ca79ba commit 658fcd063588081a1472ee6758525fc046c25173 @coreation coreation committed Jul 12, 2012
Showing with 6 additions and 1 deletion.
  1. +6 −1 controllers/RController.class.php
View
7 controllers/RController.class.php
@@ -97,9 +97,14 @@ function GET($matches) {
$linkObject = new StdClass();
$links = array();
+ /**
+ * We only want 1 level deeper, so we're gonna count the amount of /'s in the package
+ * and the amount of /'s in the packagestring
+ */
foreach($allPackages as $packagestring){
if(strpos($packagestring,$package) == 0
- && strpos($packagestring,$package) !== false && $package != $packagestring){
+ && strpos($packagestring,$package) !== false && $package != $packagestring
+ && substr_count($package, "/") +1 == substr_count($packagestring,"/")){
$foundPackage = TRUE;
$link = Config::$HOSTNAME . Config::$SUBDIR . $packagestring;

0 comments on commit 658fcd0

Please sign in to comment.