[ZendTo] Re: IPv6 compliance

Sébastien BLAISOT sebastien at blaisot.org
Sun Aug 11 13:38:54 BST 2013


Le 11/08/2013 14:22, Sébastien BLAISOT a écrit :
> 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

oups, looks like I sent you the wrong patch file (an old working one). 
Here is the correct patch.

regards,

S.B.
-------------- 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;
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 4255 bytes
Desc: Signature cryptographique S/MIME
Url : http://mailman.ecs.soton.ac.uk/pipermail/zendto/attachments/20130811/ce62a2b7/attachment.bin 


More information about the ZendTo mailing list