Project

General

Profile

Bug #23104 » 15002_v3.diff

Administrator Admin, 2010-07-05 23:40

View differences:

t3lib/class.t3lib_div.php (working copy)
*
* @param string Full string to check
* @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
* @return boolean TRUE if $partStr is equal to the first part of $str. FALSE if $partStr is not equal to the first part of $str or if $partStr is an empty string.
*/
public static function isFirstPartOfStr($str,$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;
public static function isFirstPartOfStr($str, $partStr) {
if ($partStr === '') return FALSE;
return (strpos($str, $partStr, 0) === 0);
}
/**
(7-7/10)