/*
* 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;
}
}
}
}
}
Anotherpower.com Forum - PageTitleHere
Recent Posts
[Users Projects]
|
Going off-grid in Idaho
by Pete
|
May 10, 2022, 05:01:24 pm
|
[Renewable Energy Q&A]
|
Max winding temp
by Pete
|
May 07, 2022, 09:53:06 pm
|
[Product Reviews]
|
Mini Split
by lighthunter
|
April 09, 2022, 08:05:47 am
|
[Solar (heating or electric)]
|
PV hot water and space heat at a small cabin
by eidolon
|
March 31, 2022, 10:03:49 am
|
[Electric Vehicles]
|
E-Bike
by noneyabussiness
|
February 07, 2022, 03:14:53 am
|
[Users Projects]
|
y Philippines Retirement Solar Off Grid System
by Pete
|
January 12, 2022, 02:52:22 pm
|
[Users Projects]
|
Off grid water heating project
by lighthunter
|
January 11, 2022, 06:02:12 pm
|
[Automation, Controls, Inverters, MPPT, etc]
|
8010 based 5kw chinese sinewave mosfet inverter board
by sunnypower46
|
November 28, 2021, 07:46:01 pm
|
[Weather]
|
Been about a year
by David HK
|
November 15, 2021, 01:03:24 pm
|
[Product Reviews]
|
No brand/5500W inverter disaster porn
by solarnewbee
|
October 25, 2021, 10:43:08 pm
|
[Product Reviews]
|
Snaterm 5kw inverter
by solarnewbee
|
October 25, 2021, 10:14:30 pm
|
9 Guests, 1 User
noneyabussiness