Skip to content

Commit

Permalink
MDL-41672 Fix html2text processing of multiple occurrences of the sam…
Browse files Browse the repository at this point in the history
…e URL
  • Loading branch information
acorbier authored and mudrd8mz committed Oct 9, 2013
1 parent 3bd0276 commit 0c01831
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lib/html2text.php
Expand Up @@ -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) . ']';
}
Expand Down

0 comments on commit 0c01831

Please sign in to comment.