[ZendTo] IPv6 compliance

Sébastien Blaisot zendto at blaisot.org
Sun Aug 11 14:17:53 BST 2013


Hi All,

I just tried ZendTo today in an IPv6 environment and unfortunately 
zendto is not IPv6 compliant due to regexp on line 1149 of 
lib/NSSDropbox.php which looks for an IPv4 address.

attached is a quick and dirty patch to resolve the issue.
as a side effect, IPv4 validation is weaker

Feel free to provide a more complete IPv4+IPv6 validation regexp.

regards,

S. Blaisot

-------------- next part --------------
diff -Nur ZendTo-4.11-11.orig/lib/NSSDropbox.php ZendTo-4.11-11/lib/NSSDropbox.php
--- ZendTo-4.11-11.orig/lib/NSSDropbox.php	2013-05-17 16:47:44.000000000 +0200
+++ ZendTo-4.11-11/lib/NSSDropbox.php	2013-08-11 14:35:23.979033593 +0200
@@ -1146,7 +1146,7 @@
     if ( isset($_COOKIE[$this->_cookieName]) && ($cookieVal = $_COOKIE[$this->_cookieName]) ) {
       // Added (?:\:[0-9]+)? to support IIS7 adding port numbers! :-(
       // Thanks to dturvey at bhc.ltd.uk for this.
-      if ( preg_match('/^(.+)\,([0-9]+\.[0-9]+\.[0-9]+\.[0-9]+(?:\:[0-9]+)?),([0-9]+),([0-9]+),([A-Fa-f0-9]+)$/',$cookieVal,$cookiePieces) ) {
+      if ( preg_match('/^(.+)\,([0-9a-fA-F\:.]+(?:\:[0-9]+)?),([0-9]+),([0-9]+),([A-Fa-f0-9]+)$/',$cookieVal,$cookiePieces) ) {
         //  Coming from the same remote IP?
         if ( $cookiePieces[2] != $_SERVER['REMOTE_ADDR'] ) {
           return FALSE;


More information about the ZendTo mailing list