Merge "Expand MWException tests"
[lhc/web/wiklou.git] / includes / objectcache / MemcachedClient.php
index e5f60b5..79c5187 100644 (file)
@@ -729,7 +729,7 @@ class MWMemcached {
         * @access  private
         */
        function _connect_sock( &$sock, $host ) {
-               list( $ip, $port ) = explode( ':', $host );
+               list( $ip, $port ) = preg_split('/:(?=\d)/' , $host );
                $sock = false;
                $timeout = $this->_connect_timeout;
                $errno = $errstr = null;
@@ -1026,9 +1026,9 @@ class MWMemcached {
 
                $len = strlen( $val );
 
-               if ( $this->_have_zlib && $this->_compress_enable &&
-                       $this->_compress_threshold && $len >= $this->_compress_threshold )
-               {
+               if ( $this->_have_zlib && $this->_compress_enable
+                       && $this->_compress_threshold && $len >= $this->_compress_threshold
+               {
                        $c_val = gzcompress( $val, 9 );
                        $c_len = strlen( $c_val );