Modification de l'expression regulière pour la recherche de balise siren

This commit is contained in:
Michael RICOIS 2010-04-19 07:07:03 +00:00
parent c21393fe7b
commit ee38139a59

View File

@ -1,8 +1,8 @@
<?php
function commentaires_siren($content){
$pattern = '@<siren>([0-9]{3}) ([0-9]{3}) ([0-9]{3})</siren>@si';
$replace = '<a href=/?page=identite&siret=$1$2$3>$1 $2 $3</a>';
$pattern = '/(.*?)<siren>([0-9]{3}) ([0-9]{3}) ([0-9]{3})<\/siren>(.*?)/i';
$replace = '$1<a href=/?page=identite&siret=$2$3$4>$2 $3 $4</a>$5';
$output = preg_replace($pattern, $replace, $content);
return $output;
}
@ -10,8 +10,6 @@ function commentaires_siren($content){
function commentaires_liste($content){
$pattern = '/(.*?)<li([\=|\+|-]?)>(.*)/i';
if(preg_match($pattern, $content, $matches)){
FB::log($content, 'content');
FB::log($matches[2], 'li');
switch($matches[2]){
case '+':
$class = 'plus';