diff marcus.php @ 1:caa68b502313 draft

Added the MARC DNS server (and small fixes in marcus and anoclaims)
author Ivo Smits <Ivo@UCIS.nl>
date Thu, 13 Nov 2014 17:22:12 +0100
parents 3ac7bd7495fd
children 5c8c4fa95803
line wrap: on
line diff
--- a/marcus.php	Sat Nov 08 22:22:42 2014 +0100
+++ b/marcus.php	Thu Nov 13 17:22:12 2014 +0100
@@ -262,9 +262,9 @@
 		case 'DOM':
 		case 'DOMAIN': return chr(4).strtolower(trim($argv[$argi++], '.'));
 		default:
-			if (preg_match('/^AS[0-9]{1-9}$/', $t)) return chr(3).marc_decode_int32be(substr($argv[$argi++], 2));
-			if (preg_match('_^[0-9]{1-3}\.[0-9]{1-3}\.[0-9]{1-3}\.[0-9]{1-3}/[0-9]{1-2}$_', $t)) return ipv4tolabel($t);
-			if (preg_match('_^(((?=.*(::))(?!.*\3.+\3))\3?|([\dA-F]{1,4}(\3|:\b|$)|\2))(?4){5}((?4){2}|(((2[0-4]|1\d|[1-9])?\d|25[0-5])\.?\b){4})\z/[0-9]{1-3}_i', $t)) return ipv6tolabel($t);
+			if (preg_match('/^AS[0-9]{1-9}$/', $t)) return chr(3).marc_decode_int32be(substr($t, 2));
+			if (preg_match('_^[0-9]{1-3}\.[0-9]{1-3}\.[0-9]{1-3}\.[0-9]{1-3}/[0-9]{1-2}$_', $t)) return ipnettolabel($t);
+			if (preg_match('_^(((?=.*(::))(?!.*\3.+\3))\3?|([\dA-F]{1,4}(\3|:\b|$)|\2))(?4){5}((?4){2}|(((2[0-4]|1\d|[1-9])?\d|25[0-5])\.?\b){4})\z/[0-9]{1-3}_i', $t)) return ipnettolabel($t);
 			if (preg_match('/^[a-f0-9]{64}$/i', $t)) return chr(0).hex2bin($t);
 			if (preg_match('/^[a-z0-9]+([\-\.]{1}[a-z0-9]+)*\.[a-z]{2,6}$/i', $t)) return chr(4).strtolower(trim($t, '.'));
 			throw new Exception('Could not detect label type for '.$t);