- $abs = url_absolue($lien[3], $base);
- if ($abs <> $lien[3])
- $texte = str_replace($lien[0], $lien[1].$abs.$lien[4], $texte);
+ foreach(array('href', 'src') as $attr) {
+ $href = extraire_attribut($lien[0], $attr);
+ if (strlen($href)>0) {
+ $abs = url_absolue($href, $base);
+ if ($href != $abs and !preg_match('/^#/',$href)) {
+ $texte_lien = inserer_attribut($lien[0], $attr, $abs);
+ $texte = str_replace($lien[0],$texte_lien,$texte);
+ }
+ }
+ }