MDL-41672 Fix html2text processing of multiple occurrences of the same URL
This commit is contained in:
committed by
David Mudrák
parent
1ee66b79a9
commit
a182efb289
@@ -580,9 +580,14 @@ class html2text
|
||||
}
|
||||
|
||||
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) . ']';
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user