Discussion:
Small bug in phraser_champs
Renato Formato
19 years ago
Permalink
The condition (strpos($suite[0], "[0-9]") === false)
seems to me to be always true.

Should be (strpos($suite, "[0-9]") === false) or it is dead code.


function phraser_champs($texte,$ligne,$result) {
while (preg_match("/".NOM_DE_CHAMP."/", $texte, $match)) {
$p = strpos($texte, $match[0]);
$suite = substr($texte,$p+strlen($match[0]));
-> if ($match[5] || (strpos($suite[0], "[0-9]") === false)) {
.....
} else {
// faux champ
.....
}

Ciao
Renato
Déesse A.
19 years ago
Permalink
Post by Renato Formato
The condition (strpos($suite[0], "[0-9]") === false)
seems to me to be always true.
you are right.
Post by Renato Formato
Should be (strpos($suite, "[0-9]") === false) or it is dead code.
not sure. I have to think about it.

Thanks anyway.
Post by Renato Formato
function phraser_champs($texte,$ligne,$result) {
while (preg_match("/".NOM_DE_CHAMP."/", $texte, $match)) {
$p = strpos($texte, $match[0]);
$suite = substr($texte,$p+strlen($match[0]));
-> if ($match[5] || (strpos($suite[0], "[0-9]") === false)) {
.....
} else {
// faux champ
.....
}
Ciao
Renato
_______________________________________________
liste: http://listes.rezo.net/mailman/listinfo/spip-dev
doc: http://www.spip.net/
dev: http://trac.rezo.net/trac/spip/
irc://irc.freenode.net/spip
Déesse A.

Loading...