Changeset 30225 in spip-zone for _plugins_/captcha2


Ignore:
Timestamp:
Jul 25, 2009, 2:11:32 PM (10 years ago)
Author:
gilles.vincent@…
Message:

Le filtre qui teste les caracteres 'exotiques' doit eliminer ceux qui sont saisis sous la forme Ӓ

File:
1 edited

Legend:

Unmodified
Added
Removed
  • _plugins_/captcha2/captcha2_fonctions.php

    r24020 r30225  
    66  if (strlen($str)==0) return 0;
    77  $str = strip_tags($str); // on supprime les tags (ex. code) qui faussent le ratio
     8  // On supprime les caracteres accentues de type Ӓ
     9  $pattern = '/&#(\d+);/i';
     10  $replacement = '';
     11  $string = preg_replace($pattern, $replacement, $str);
    812  $c = 0;
    9   foreach (count_chars($str, 1) as $i => $val) {
     13  foreach (count_chars($string, 1) as $i => $val) {
    1014       if ($i<127)  $c += $val;
    1115  }
Note: See TracChangeset for help on using the changeset viewer.