MDL-41672 Fix html2text processing of multiple occurrences of the same URL

This commit is contained in:
Alain Corbière
2013-10-09 15:44:18 +02:00
committed by David Mudrák
parent 1ee66b79a9
commit a182efb289
+5
View File
@@ -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) . ']';
}