Postfix comparison to check path

Establish a stringExtra value of a slash or nothing depending on wether
we are considering the root level or not
When comparing the folder against the selectedFile array value, postfix
both with a slash (could be any char though). This is to eliminate path
mismatches.
This commit is contained in:
Matt Pass
2013-01-13 13:46:59 +00:00
parent ca8e92e443
commit 3f1801ef2b

View File

@@ -129,7 +129,8 @@ if (startTab!=top.ICEcoder.selectedTab) {
}
$findPath = str_replace($base,"",$fullPath);
for ($i=0;$i<count($selectedFiles);$i++) {
if (strpos($findPath,str_replace("|","/",$selectedFiles[$i]))===0) {
$stringExtra = $selectedFiles[$i] != "|" ? "/" : "";
if (strpos($findPath.$stringExtra,str_replace("|","/",$selectedFiles[$i]).$stringExtra)===0) {
$foundInSelFile = true;
}
}