diff --git a/include/functions.inc b/include/functions.inc
index 9b3e05498995ac19d0b2019ca7c796c5b6e1ebfe..15df054ccbb5e41d94779cb75eae6378024a3243 100644 (file)
--- a/include/functions.inc
+++ b/include/functions.inc
@@ -2534,7 +2534,7 @@ function get_languages($languages_in_own_language = FALSE,$strip_region_tag = FA
"fr_FR" => "French",
"it_IT" => "Italian",
"es_ES" => "Spanish",
- "en_EN" => "English",
+ "en_US" => "English",
"nl_NL" => "Dutch",
"pl_PL" => "Polish",
"sv_SE" => "Swedish",
@@ -2547,11 +2547,10 @@ function get_languages($languages_in_own_language = FALSE,$strip_region_tag = FA
foreach($tmp as $key => $name){
$lang = $key.".UTF-8";
setlocale(LC_ALL, $lang);
-
if($strip_region_tag){
- $ret[preg_replace("/^([^_]*).*$/","\\1",$key)] = _($name);
+ $ret[preg_replace("/^([^_]*).*$/","\\1",$key)] = _($name)." (".$name.")";
}else{
- $ret[$key] = _($name);
+ $ret[$key] = _($name)." (".$name.")";
}
}
setlocale(LC_ALL, $old_lang);
@@ -2567,5 +2566,37 @@ function get_languages($languages_in_own_language = FALSE,$strip_region_tag = FA
return($ret);
}
+
+/* Check if $ip1 and $ip2 represents a valid IP range
+ * returns TRUE in case of a valid range, FALSE in case of an error.
+ */
+function is_ip_range($ip1,$ip2)
+{
+ if(!is_ip($ip1) || !is_ip($ip2)){
+ return(FALSE);
+ }else{
+ $ar1 = split("\.",$ip1);
+ $var1 = $ar1[0] * (16777216) + $ar1[1] * (65536) + $ar1[2] * (256) + $ar1[3];
+
+ $ar2 = split("\.",$ip2);
+ $var2 = $ar2[0] * (16777216) + $ar2[1] * (65536) + $ar2[2] * (256) + $ar2[3];
+ return($var1 < $var2);
+ }
+}
+
+/* Returns contents of the given POST variable and check magic quotes settings */
+function get_post($name)
+{
+ if(!isset($_POST[$name])){
+ trigger_error("Requested POST value (".$name.") does not exists, you should add a check to prevent this message.");
+ return(FALSE);
+ }
+ if(get_magic_quotes_gpc()){
+ return(stripcslashes($_POST[$name]));
+ }else{
+ return($_POST[$name]);
+ }
+}
+
// vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler:
?>