Comments (3)
Best fix is probably to move to using PHP's native IPv4 validation. We use it for IPv6, but don't use it for older IPv4 addresses.
396 case "ipv4":
397 $expression = "/^(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)(?:[.](?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)){3}$/";
398 break;
399
400 case "ipv4_cidr":
401 $expression = "/^(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)(?:[.](?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)){3}[\/]*[1-9]*$/";
402 break;
403
404 case "ipv6":
405 if (filter_var($_POST[$valuename], FILTER_VALIDATE_IP, FILTER_FLAG_IPV6))
406 {
407 return $_POST[$valuename];
408 }
409 else
410 {
411 // there has been an error - flag the hourmins field as being incorrect input
412 $_SESSION["error"]["message"][] = "Provided address is not a valid IPv6 address";
413 $_SESSION["error"]["". $valuename . "-error"] = 1;
414 $_SESSION["error"][$valuename] = 0;
415
416 return "error";
417 }
418 break;
419
420 case "ipv6_cidr":
421 list($network, $cidr) = split("/", $_POST[$valuename]);
422
423 if (filter_var($network, FILTER_VALIDATE_IP, FILTER_FLAG_IPV6))
424 {
425 return "$network/$cidr";
426 }
427 else
428 {
429 // there has been an error - flag the hourmins field as being incorrect input
430 $_SESSION["error"]["message"][] = "Provided address is not a valid IPv6 address";
431 $_SESSION["error"]["". $valuename . "-error"] = 1;
432 $_SESSION["error"][$valuename] = 0;
433
434 return "error";
435 }
436 break;
PR welcome.
from namedmanager.
Best fix is probably to move to using PHP's native IPv4 validation. We use it for IPv6, but don't use it for older IPv4 addresses.
396 case "ipv4": 397 $expression = "/^(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)(?:[.](?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)){3}$/"; 398 break; 399 400 case "ipv4_cidr": 401 $expression = "/^(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)(?:[.](?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)){3}[\/]*[1-9]*$/"; 402 break; 403 404 case "ipv6": 405 if (filter_var($_POST[$valuename], FILTER_VALIDATE_IP, FILTER_FLAG_IPV6)) 406 { 407 return $_POST[$valuename]; 408 } 409 else 410 { 411 // there has been an error - flag the hourmins field as being incorrect input 412 $_SESSION["error"]["message"][] = "Provided address is not a valid IPv6 address"; 413 $_SESSION["error"]["". $valuename . "-error"] = 1; 414 $_SESSION["error"][$valuename] = 0; 415 416 return "error"; 417 } 418 break; 419 420 case "ipv6_cidr": 421 list($network, $cidr) = split("/", $_POST[$valuename]); 422 423 if (filter_var($network, FILTER_VALIDATE_IP, FILTER_FLAG_IPV6)) 424 { 425 return "$network/$cidr"; 426 } 427 else 428 { 429 // there has been an error - flag the hourmins field as being incorrect input 430 $_SESSION["error"]["message"][] = "Provided address is not a valid IPv6 address"; 431 $_SESSION["error"]["". $valuename . "-error"] = 1; 432 $_SESSION["error"][$valuename] = 0; 433 434 return "error"; 435 } 436 break;
PR welcome.
v1.9.0 not working for /10,/20,/30...
from namedmanager.
Hi,
The ipv4_cidr regex for /10 subnet seems invalids. Here a regex that seems to be working :
http://www.regexpal.com/93987
It's working for me
from namedmanager.
Related Issues (20)
- Project abandoned? HOT 2
- Dose the SOAP interface allow ACME2 clients? HOT 1
- NAPTR record support HOT 1
- Failed to load external entity "https://xxxx/api/namedmanager.wsdl"
- version_20171107_install.sql sets SCHEMA_VERSION 20150416
- Domain rename leaves junk NS records behind HOT 1
- use namedmanager can't create the same name zone, default origin get domain_name
- DNSSEC Support with inline-signing and auto-dnssec
- Support for CAA Record
- Allow txt update for letsencrypt dns verification
- Where is the code for bind operation?
- Hostname Case Folding is Wrong According to the RFC
- Spaces in Passwords Not Allowed HOT 2
- namedmanager1.9.0 have bugs?
- lowercase record content in zone files
- Namedmanager v1.9.0 - Adding own NS records fails HOT 1
- add CNAME syntax error HOT 3
- failed to load external entity "http://xxx.xxx.xxx.xxx/namedexample/api/namedmanager.wsdl"
- Error: Unknown failure whilst attempting to authenticate with the API - Internal Server Error,why?
- don't support multiples strings | SPF
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from namedmanager.