Permalink
Browse files

MDL-41672 Fix html2text processing of multiple occurrences of the sam…

…e URL
  • Loading branch information...
1 parent 1ee66b7 commit a182efb2893d6a56b321c7bf02e4260897876af8 @acorbier acorbier committed with mudrd8mz Oct 9, 2013
Showing with 5 additions and 0 deletions.
  1. +5 −0 lib/html2text.php
View
5 lib/html2text.php
@@ -580,9 +580,14 @@ function _build_link_list( $link, $display )
}
if (($index = array_search($url, $this->_link_list)) === false) {
+ // Add the link to the list.
$this->_link_list[] = $url;
$index = count($this->_link_list);
}
+ else {
+ // Use the index of the existing link in the list (we enumerate from 1, not from 0).
+ $index++;
+ }
return $display . ' [' . ($index) . ']';
}

0 comments on commit a182efb

Please sign in to comment.