Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

MINOR Allowing array-based values in Diff->getHTMLChunks() by implodi…

…ng on comma (AIR-39)
  • Loading branch information...
commit d6f4b2406601dbe393b01bfe44a5a3800dc5273f 1 parent 40db114
Ingo Schommer chillu authored
Showing with 9 additions and 0 deletions.
  1. +9 −0 core/Diff.php
9 core/Diff.php
View
@@ -788,7 +788,16 @@ static function compareHTML($from, $to) {
// 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)) {
Please sign in to comment.
Something went wrong with that request. Please try again.