MINOR Allowing array-based values in Diff->getHTMLChunks() by imploding on comma (AIR-39)

This commit is contained in:
Ingo Schommer 2011-08-29 09:34:07 +02:00
parent 40db114218
commit d6f4b24066

View File

@ -788,7 +788,16 @@ class Diff
// echo "<p>" . htmlentities($content) . "</p>";
return self::cleanHTML($content);
}
/**
* @param string|array If passed as an array, values will be concatenated with a comma.
*/
static function getHTMLChunks($content) {
if($content && !is_string($content) && !is_array($content) && !is_numeric($content)) {
throw new InvalidArgumentException('$content parameter needs to be a string or array');
}
if(is_array($content)) $content = implode(',', $content);
$content = str_replace(array("&nbsp;","<", ">"),array(" "," <", "> "),$content);
$candidateChunks = split("[\t\r\n ]+", $content);
while(list($i,$item) = each($candidateChunks)) {