diff --git a/src/Utility.php b/src/Utility.php index 0df89b9..0361af0 100644 --- a/src/Utility.php +++ b/src/Utility.php @@ -365,8 +365,7 @@ class Utility { * might be NULL. If $separate_last is TRUE it's the exact other way round. */ public static function splitPropertyPath($property_path, $separate_last = TRUE, $separator = ':') { - $is_default_separator = $separator != IndexInterface::DATASOURCE_ID_SEPARATOR; - $function = $separate_last && $is_default_separator ? 'strrpos' : 'strpos'; + $function = $separate_last ? 'strrpos' : 'strpos'; $pos = $function($property_path, $separator); if ($pos !== FALSE) { return array( @@ -742,7 +741,10 @@ class Utility { * element 0 will be NULL. */ public static function splitCombinedId($combined_id) { - return explode(IndexInterface::DATASOURCE_ID_SEPARATOR, $combined_id, 2); + if (strpos($combined_id, IndexInterface::DATASOURCE_ID_SEPARATOR) !== FALSE) { + return explode(IndexInterface::DATASOURCE_ID_SEPARATOR, $combined_id, 2); + } + return array(NULL, $combined_id); } }