| @@ 205-218 (lines=14) @@ | ||
| 202 | * |
|
| 203 | * @return mixed |
|
| 204 | */ |
|
| 205 | public function validate_valid_ip_public(string $field, array $input, $param = null) |
|
| 206 | { |
|
| 207 | if (!isset($input[$field]) || empty($input[$field])) { |
|
| 208 | return; |
|
| 209 | } |
|
| 210 | if (!\Audit::instance()->ispublic($input[$field])) { |
|
| 211 | return array( |
|
| 212 | 'field' => $field, |
|
| 213 | 'value' => $input[$field], |
|
| 214 | 'rule' => __FUNCTION__, |
|
| 215 | 'param' => $param, |
|
| 216 | ); |
|
| 217 | } |
|
| 218 | } |
|
| 219 | ||
| 220 | /** |
|
| 221 | * Check whether the IP Address is NOT Public |
|
| @@ 231-244 (lines=14) @@ | ||
| 228 | * |
|
| 229 | * @return mixed |
|
| 230 | */ |
|
| 231 | public function validate_valid_ip_not_public(string $field, array $input, $param = null) |
|
| 232 | { |
|
| 233 | if (!isset($input[$field]) || empty($input[$field])) { |
|
| 234 | return; |
|
| 235 | } |
|
| 236 | if (\Audit::instance()->ispublic($input[$field])) { |
|
| 237 | return array( |
|
| 238 | 'field' => $field, |
|
| 239 | 'value' => $input[$field], |
|
| 240 | 'rule' => __FUNCTION__, |
|
| 241 | 'param' => $param, |
|
| 242 | ); |
|
| 243 | } |
|
| 244 | } |
|
| 245 | ||
| 246 | /** |
|
| 247 | * Check whether the IP Address is Reserved |
|
| @@ 257-270 (lines=14) @@ | ||
| 254 | * |
|
| 255 | * @return mixed |
|
| 256 | */ |
|
| 257 | public function validate_valid_ip_reserved(string $field, array $input, $param = null) |
|
| 258 | { |
|
| 259 | if (!isset($input[$field]) || empty($input[$field])) { |
|
| 260 | return; |
|
| 261 | } |
|
| 262 | if (!\Audit::instance()->isreserved($input[$field])) { |
|
| 263 | return array( |
|
| 264 | 'field' => $field, |
|
| 265 | 'value' => $input[$field], |
|
| 266 | 'rule' => __FUNCTION__, |
|
| 267 | 'param' => $param, |
|
| 268 | ); |
|
| 269 | } |
|
| 270 | } |
|
| 271 | ||
| 272 | /** |
|
| 273 | * Check whether the IP Address is Private or Reserved |
|
| @@ 283-296 (lines=14) @@ | ||
| 280 | * |
|
| 281 | * @return mixed |
|
| 282 | */ |
|
| 283 | public function validate_valid_ip_private(string $field, array $input, $param = null) |
|
| 284 | { |
|
| 285 | if (!isset($input[$field]) || empty($input[$field])) { |
|
| 286 | return; |
|
| 287 | } |
|
| 288 | if (!\Audit::instance()->isprivate($input[$field])) { |
|
| 289 | return array( |
|
| 290 | 'field' => $field, |
|
| 291 | 'value' => $input[$field], |
|
| 292 | 'rule' => __FUNCTION__, |
|
| 293 | 'param' => $param, |
|
| 294 | ); |
|
| 295 | } |
|
| 296 | } |
|
| 297 | ||
| 298 | ||
| 299 | } |
|