From: Stricted Date: Mon, 23 Feb 2015 10:40:30 +0000 (+0100) Subject: unify line endings X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=8e9fc9e0d8f8a6ff982e876ed116441a2f4253bb;p=GitHub%2FStricted%2FDomain-Control-Panel.git unify line endings --- diff --git a/lib/util/DNSSECUtil.class.php b/lib/util/DNSSECUtil.class.php index ef21f43..6953292 100644 --- a/lib/util/DNSSECUtil.class.php +++ b/lib/util/DNSSECUtil.class.php @@ -70,6 +70,9 @@ class DNSSECUtil { * @return boolean */ public static function validatePublicKey ($content) { + // unify newlines + $content = preg_replace("/(\r\n)|(\r)/", "\n", $content); + $pattern = "; This is a (key|zone)-signing key, keyid (?P[0-9]+), for (?P[\s\S]+)\.\n"; $pattern .= "; Created: (?P[0-9]+) \(([a-z0-9: ]+)\)\n"; $pattern .= "; Publish: (?P[0-9]+) \(([a-z0-9: ]+)\)\n"; @@ -102,6 +105,9 @@ class DNSSECUtil { * @return boolean */ public static function validatePrivateKey ($content) { + // unify newlines + $content = preg_replace("/(\r\n)|(\r)/", "\n", $content); + $pattern = "Private-key-format: v([0-9a-z.]+)\n"; $pattern .= "Algorithm: (?P[0-9]+) \(([0-9a-z\-]+)\)\n"; $pattern .= "Modulus: (?P[\s\S]+)\n"; diff --git a/lib/util/ParseZone.class.php b/lib/util/ParseZone.class.php index 2a85663..87abe86 100644 --- a/lib/util/ParseZone.class.php +++ b/lib/util/ParseZone.class.php @@ -50,6 +50,10 @@ class ParseZone { */ public function __construct ($file, $origin = "") { if (!empty($origin)) $this->origin = $origin; + + // unify newlines + $file = preg_replace("/(\r\n)|(\r)/", "\n", $file); + // unify all lines $file = preg_replace_callback('/(\([^()]*\))/', function ($matches) { $a = explode("\n", $matches[0]);