Correctly match with separator

Signed-off-by: Madhura Jayaratne <madhura.cj@gmail.com>
This commit is contained in:
Madhura Jayaratne 2014-11-10 16:21:07 +05:30
parent 2d8fa546e1
commit 19e146ee4b

View File

@ -443,7 +443,11 @@ class Node
if ($handle !== false) {
while ($arr = $GLOBALS['dbi']->fetchArray($handle)) {
foreach ($prefixes as $prefix) {
if (strpos($arr[0], $prefix) === 0) {
$starts_with = strpos(
$arr[0] . $dbSeparator,
$prefix . $dbSeparator
) === 0;
if ($starts_with) {
$retval[] = $arr[0];
break;
}