From e670e5c985d46ff62cbad7827d073734aefb4a38 Mon Sep 17 00:00:00 2001 From: Lukas Kahwe Smith Date: Thu, 18 Jul 2013 13:35:26 +0200 Subject: [PATCH] there are cases where a node name might be an integer --- src/PHPCR/Util/PathHelper.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/PHPCR/Util/PathHelper.php b/src/PHPCR/Util/PathHelper.php index 4defb79..9710733 100644 --- a/src/PHPCR/Util/PathHelper.php +++ b/src/PHPCR/Util/PathHelper.php @@ -62,7 +62,7 @@ private function __construct() */ public static function assertValidAbsolutePath($path, $destination = false, $throw = true) { - if (! is_string($path) + if ((!is_string($path) && !is_numeric($path)) || strlen($path) == 0 || '/' !== $path[0] || strlen($path) > 1 && '/' === $path[strlen($path) - 1] @@ -134,7 +134,7 @@ public static function assertValidLocalName($name, $throw = true) */ public static function normalizePath($path, $destination = false, $throw = true) { - if (!is_string($path)) { + if (!is_string($path) && !is_numeric($path)) { return self::error('Expected string but got ' . gettype($path), $throw); } if (strlen($path) === 0) { @@ -199,7 +199,7 @@ public static function normalizePath($path, $destination = false, $throw = true) */ public static function absolutizePath($path, $context, $destination = false, $throw = true) { - if (!is_string($path)) { + if (!is_string($path) && !is_numeric($path)) { return self::error('Expected string path but got ' . gettype($path), $throw); } if (!is_string($context)) {