Bug #21123 » 15440.diff
t3lib/class.t3lib_div.php (working copy) | ||
---|---|---|
* @param string Reference string which must be found as the "first part" of the full string
|
||
* @return boolean True if $partStr was found to be equal to the first part of $str
|
||
*/
|
||
public static function isFirstPartOfStr($str,$partStr) {
|
||
public static function isFirstPartOfStr($str, $partStr) {
|
||
// ensure variables are strings
|
||
$str = (string) $str;
|
||
$partStr = (string) $partStr;
|
||
// Returns true, if the first part of a $str equals $partStr and $partStr is not ''
|
||
$psLen = strlen($partStr);
|
||
if ($psLen) {
|
||
return substr($str,0,$psLen)==(string)$partStr;
|
||
} else return false;
|
||
$partLength = strlen($partStr);
|
||
if ($partLength) {
|
||
return substr($str, 0, $partLength) === $partStr;
|
||
} else {
|
||
return FALSE;
|
||
}
|
||
}
|
||
/**
|