X-Git-Url: http://git.cyclocoop.org/?p=lhc%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=8c1fa94723878e6c7a890fb46ff9d8dc47cbef4e;hb=ac3048660a3889c33f121bf5a567654e674e543a;hpb=db106e5fbbef82fe8d4a95b1124113c2149ee37d diff --git a/www/plugins-dist/textwheel/inc/ressource.php b/www/plugins-dist/textwheel/inc/ressource.php index 8c1fa947..d56dc5fb 100644 --- a/www/plugins-dist/textwheel/inc/ressource.php +++ b/www/plugins-dist/textwheel/inc/ressource.php @@ -6,29 +6,32 @@ * */ -define('_EXTRAIRE_RESSOURCES', ',' . '<"?(https?://|[\w -]+\.[\w -]+)[^<]*>'.',UimsS'); +define('_EXTRAIRE_RESSOURCES', ',' . '<"?(https?://|[^\s][\w -]+\.[\w -]+)[^<]*>'.',UimsS'); 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.">")); } } }