Project

General

Profile

« Previous | Next » 

Revision 7897

web/vegpath/util.php: partition(): Fixed bug where strpos() returns false rather than -1 on no match

View differences:

web/vegpath/util.php
35 35
function partition($str, $delim)
36 36
{
37 37
	$delim_idx = strpos($delim, $str);
38
	return $delim_idx >= 0 ? new Path(substr($str, 0, $delim_idx),
38
	return $delim_idx !== false ? new Path(substr($str, 0, $delim_idx),
39 39
		substr($str, $delim_idx+strlen($delim))) : new Path($str, "");
40 40
}
41 41

  

Also available in: Unified diff