X-Git-Url: http://git.cyclocoop.org/?a=blobdiff_plain;ds=sidebyside;f=www%2Fplugins-dist%2Ftextwheel%2Finc%2Fressource.php;h=d56dc5fbb00e35911cbda2b9de54a4dc01c15796;hb=122c920eb07e3f665789f8734965b576e6c25515;hp=8c1fa94723878e6c7a890fb46ff9d8dc47cbef4e;hpb=226942065cd4f604eb464addf45a065c9e5bc916;p=lhc%2Fweb%2Fwww.git 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.">")); } } }