X-Git-Url: http://git.cyclocoop.org/?p=ptitvelo%2Fweb%2Fwww.git;a=blobdiff_plain;f=www%2Fplugins-dist%2Ftextwheel%2Finc%2Fressource.php;fp=www%2Fplugins-dist%2Ftextwheel%2Finc%2Fressource.php;h=d56dc5fbb00e35911cbda2b9de54a4dc01c15796;hp=28bffa76d4e54fb623dd10da2a6c00b102d5c142;hb=5be150361b3c836d9206941ba43f862df11466db;hpb=bca3db9e1ab94e469b01f7e994a5e095de5f88c4 diff --git a/www/plugins-dist/textwheel/inc/ressource.php b/www/plugins-dist/textwheel/inc/ressource.php index 28bffa7..d56dc5f 100644 --- a/www/plugins-dist/textwheel/inc/ressource.php +++ b/www/plugins-dist/textwheel/inc/ressource.php @@ -10,25 +10,28 @@ define('_EXTRAIRE_RESSOURCES', ',' . '<"?(https?://|[^\s][\w -]+\.[\w -]+)[^<]*> function traiter_ressources($r) { + $html = null; if ($ressource = charger_fonction('ressource', 'inc', true)) { $html = $ressource($r[0]); - } else { + } + + if (is_null($html)) { include_spip('inc/lien'); $url = explode(' ', trim($r[0], '<>')); $url = $url[0]; # if (preg_match(',^https?://,i', $url)) - $html = propre("<[->".$url."]>"); + $html = PtoBR(propre("<[->".$url."]>")); # else if (false !== strpos($url, '/')) - $html = propre("<[->".$url."]>"); + $html = PtoBR(propre("<[->".$url."]>")); # else { preg_match(',\.([^.]+)$,', $url, $regs); if (file_exists($f = _DIR_IMG.$regs[1].'/'.$url)) { - $html = propre("<[".$url."->".$f."]>"); + $html = PtoBR(propre("<[".$url."->".$f."]>")); } else { - $html = propre("<".$url.">"); + $html = PtoBR(propre("<".$url.">")); } } }