"---<br />" string is now removed correctly from the end of customization data text

This commit is contained in:
Quentin Montant
2013-11-20 13:30:47 +01:00
parent 1508a8a5d7
commit 0410378bd3
3 changed files with 18 additions and 5 deletions
+15 -1
View File
@@ -2739,6 +2739,20 @@ exit;
}
return $fileAttachment;
}
/**
* Delete a substring from another one starting from the right
* @param string $str
* @param string $str_search
* @return string
*/
public static function rtrimString($str, $str_search)
{
$length_str = strlen($str_search);
if (strlen($str) >= $length_str && substr($str, -$length_str) == $str_search)
$str = substr($str, 0, -$length_str);
return $str;
}
}
/**
@@ -2765,4 +2779,4 @@ function cmpPriceDesc($a, $b)
elseif ((float)$a['price_tmp'] > (float)$b['price_tmp'])
return -1;
return 0;
}
}