/*
* Patch for filter_var()
*/
if(!function_exists('filter_var')){
define('FILTER_VALIDATE_IP', 'ip');
define('FILTER_FLAG_IPV4', 'ipv4');
define('FILTER_FLAG_IPV6', 'ipv6');
define('FILTER_VALIDATE_EMAIL', 'email');
define('FILTER_FLAG_EMAIL_UNICODE', 'unicode');
function filter_var($variable, $filter, $option = false){
if($filter == 'ip'){
if($option == 'ipv4'){
if(preg_match("/(\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})/", $variable, $matches)){
$variable = $matches[1];
return $variable;
}
}
if($option == 'ipv6'){
if(preg_match("/\s*(([:.]{0,7}[0-9a-fA-F]{0,4}){1,8})\s*/", $variable, $matches)){
$variable = $matches[1];
return $variable;
}
}
}
if($filter == 'email'){
if($option == 'unicode' || $option == false){
if(preg_match("/\s*(\S*@\S*\.\S*)\s*/", $variable, $matches)){
$variable = $matches[1];
return $variable;
}
}
}
}
}
Poradniki
Poradniki
- Gotowe, aktualne i pisane pod starsze wydania gry, poradniki dotyczące Lineage'a 2
|
|
|
0 Odpowiedzi
3496 Wyświetleń
|
Marzec 20, 2011, 04:07:41 pm
wysłana przez Lamalana
|
|
|
|
0 Odpowiedzi
5108 Wyświetleń
|
Marzec 19, 2011, 07:57:12 pm
wysłana przez tevin
|
|
|
|
0 Odpowiedzi
5165 Wyświetleń
|
Marzec 19, 2011, 09:41:16 pm
wysłana przez tevin
|
|
|
|
5 Odpowiedzi
6101 Wyświetleń
|
Luty 03, 2009, 12:37:51 pm
wysłana przez iDevex
|