Ver Fonte

[Improve][rootfs][web_page]

2022.03.09 / Folus Wen

Actions:
1. Fix php ereg() function to is_numeric() for version upgrade to 7.3.28 issue

Files:
1. As follow commit history

Image version: D0.00.XX.XXXX.XX
Image checksum: XXXXXXXX

Hardware PWB P/N : XXXXXXX
Hardware Version : XXXXXXX
FolusWen há 3 anos atrás
pai
commit
75b56028b4

+ 3 - 3
EVSE/rootfs/var/www/set_backend_action.php

@@ -138,7 +138,7 @@
 					echo json_encode($jsone);
 					exit;
 			}
-			if(!ereg("[0-9]",$_REQUEST[$id])){
+			if(!is_numeric($_REQUEST[$id])){
 					$jsone['result'] = "Fail";
 					$jsone['message'] = "You have entered a wrong value on " . $id . ", it should be numeric";
 					echo json_encode($jsone);
@@ -156,7 +156,7 @@
 	}
 	function isNumeric($id,$value){
 		if($_REQUEST[$id] != ""){
-			if(!ereg("[0-9]",$_REQUEST[$id])){
+			if(!is_numeric($_REQUEST[$id])){
 					$jsone['result'] = "Fail";
 					$jsone['message'] = "You have entered a wrong value on " . $id . ", it should be numeric";
 					echo json_encode($jsone);
@@ -170,4 +170,4 @@
 			}
 		}
 	}
-?>
+?>

+ 2 - 2
EVSE/rootfs/var/www/set_charging_action.php

@@ -215,7 +215,7 @@
 					echo json_encode($jsone);
 					exit;
 			}
-			if(!ereg("[0-9]",$_POST[$id])){
+			if(!is_numeric($_POST[$id])){
 					$jsone['result'] = "Fail";
 					$jsone['message'] = "You have entered a wrong value on " . $id . ", it should be numeric";
 					echo json_encode($jsone);
@@ -235,4 +235,4 @@
 		}
 	}
 
-?>
+?>

+ 2 - 2
EVSE/rootfs/var/www/set_network_action.php

@@ -123,7 +123,7 @@
 					echo json_encode($jsone);
 					exit;
 			}
-			if(!ereg("[0-9]",$_REQUEST[$id])){
+			if(!is_numeric($_REQUEST[$id])){
 					$jsone['result'] = "Fail";
 					$jsone['message'] = "You have entered a wrong value on " . $id . ", it should be numeric";
 					echo json_encode($jsone);
@@ -151,4 +151,4 @@
 		}
 	}
 
-?>
+?>

+ 4 - 4
EVSE/rootfs/var/www/set_system_action.php

@@ -264,7 +264,7 @@
 						echo json_encode($jsone);
 						exit;
 				}
-				if(!ereg("[0-9]",$_POST[$id])){
+				if(!is_numeric($_POST[$id])){
 						$jsone['result'] = "Fail";
 						$jsone['message'] = "You have entered a wrong value on " . $id . ", it should be numeric";
 						echo json_encode($jsone);
@@ -280,7 +280,7 @@
 						echo json_encode($jsone);
 						exit;
 				}
-				if(!ereg("[0-1]",$_POST[$id])){
+				if(!is_numeric($_POST[$id])){
 						$jsone['result'] = "Fail";
 						$jsone['message'] = "You have entered a wrong value on " . $id . ", it should be 0 or 1";
 						echo json_encode($jsone);
@@ -296,7 +296,7 @@
 						// echo json_encode($jsone);
 						// exit;
 				// }
-				// if(!ereg("[0-9]",$_POST[$id]) & !ereg("[0-9]{2}",$_POST[$id])){
+				// if(!is_numeric($_POST[$id]) & !is_numeric($_POST[$id])){
 						// $jsone['result'] = "Fail";
 						// $jsone['message'] = "You have entered a wrong value on " . $id . ", it should be numeric";
 						// echo json_encode($jsone);
@@ -306,4 +306,4 @@
 		// }
 	}
 
-?>
+?>