CAPTCHAS cachondos, avui, follo a gmail

Quina va ser la meva sorpresa l'altre dia, al crear una conta nova de gmail, al veure aquest CAPTCHA.


Impressionant !


Process search string before sending to a match against

It's Sant Jordi and I want to go home NOW!

but this peace of code will be helpful, how to process a standard search string to do a typical and search for each word.


if (stripos($text, '"')===false)
{// normal search, there are no "
$text=str_replace('+', '', $text);
$text=str_replace('-', '', $text);
$text=str_replace('*', '', $text);
$text=str_replace('\'', '', $text);
$text=str_replace('"', '', $text);
$text=str_replace('>', '', $text);
$text=str_replace('<', '', $text);

$arr=explode(" ", $text);
foreach ($arr as $elem)
$text.='+'.$elem.'* ';

Simply use $search as the input (obviously sanitized) and take $text as output, if there are some double quotes, we simply do nothing assuming an exact match query.

It's not perfect, but works for my actual project.

I don't have more time, happy Sant Jordi to all !