plugins/SpecialUserFuncs.php
changeset 987 b13a42ebaefb
parent 969 0506adb8eb6c
child 989 79d558a94798
equal deleted inserted replaced
986:aa6f26d96577 987:b13a42ebaefb
  1362   if ( !$hash || !preg_match('#^([0-9a-f]*){32,40}$#i', $hash) )
  1362   if ( !$hash || !preg_match('#^([0-9a-f]*){32,40}$#i', $hash) )
  1363   {
  1363   {
  1364     $paths->main_page();
  1364     $paths->main_page();
  1365   }
  1365   }
  1366 
  1366 
  1367   $session->make_captcha(7, $hash);  
  1367   $session->make_captcha(7, $hash);
  1368   $code = $session->generate_captcha_code();
  1368   $code = $session->generate_captcha_code();
       
  1369   // Avoid letting our captchas end up on failblog.org
       
  1370   // BTW, the last one was a real-life encounter: http://files.ha.xx0r.info/murder.png
       
  1371   foreach ( array('shit', 'cock', 'fuck', 'nazi', 'cunt', 'pussy', 'penis', 'piss', 'tits', 'murder') as $word )
       
  1372   {
       
  1373     if ( stristr($code, $word) )
       
  1374     {
       
  1375       // but don't put too much effort into this (will only correct this once)
       
  1376       $code = $session->generate_captcha_code();
       
  1377       break;
       
  1378     }
       
  1379   }
  1369   $q = $db->sql_query('UPDATE ' . table_prefix . "captcha SET code = '$code' WHERE session_id = '$hash';");
  1380   $q = $db->sql_query('UPDATE ' . table_prefix . "captcha SET code = '$code' WHERE session_id = '$hash';");
  1370   if ( !$q )
  1381   if ( !$q )
  1371     $db->_die();
  1382     $db->_die();
  1372   
  1383   
  1373   require ( ENANO_ROOT.'/includes/captcha.php' );
  1384   require ( ENANO_ROOT.'/includes/captcha.php' );