Change comment:
[lhc/web/wiklou.git] / includes / Cookie.php
index 7984d63..a6eb79a 100644 (file)
@@ -40,14 +40,15 @@ class Cookie {
 
        /**
         * Sets a cookie.  Used before a request to set up any individual
-        * cookies.      Used internally after a request to parse the
+        * cookies. Used internally after a request to parse the
         * Set-Cookie headers.
         *
         * @param $value String: the value of the cookie
         * @param $attr Array: possible key/values:
-        *              expires  A date string
-        *              path     The path this cookie is used on
-        *              domain   Domain this cookie is used on
+        *        expires A date string
+        *        path    The path this cookie is used on
+        *        domain  Domain this cookie is used on
+        * @throws MWException
         */
        public function set( $value, $attr ) {
                $this->value = $value;
@@ -112,7 +113,7 @@ class Cookie {
                }
 
                // Don't allow cookies for "co.uk" or "gov.uk", etc, but allow "supermarket.uk"
-               if ( strrpos( $domain, "." ) - strlen( $domain )  == -3 ) {
+               if ( strrpos( $domain, "." ) - strlen( $domain ) == -3 ) {
                        if ( ( count( $dc ) == 2 && strlen( $dc[0] ) <= 2 )
                                || ( count( $dc ) == 3 && strlen( $dc[0] ) == "" && strlen( $dc[1] ) <= 2 ) ) {
                                return false;
@@ -164,8 +165,8 @@ class Cookie {
        protected function canServeDomain( $domain ) {
                if ( $domain == $this->domain
                        || ( strlen( $domain ) > strlen( $this->domain )
-                                && substr( $this->domain, 0, 1 ) == '.'
-                                && substr_compare( $domain, $this->domain, -strlen( $this->domain ),
+                               && substr( $this->domain, 0, 1 ) == '.'
+                               && substr_compare( $domain, $this->domain, -strlen( $this->domain ),
                                                                        strlen( $this->domain ), true ) == 0 ) ) {
                        return true;
                }
@@ -193,7 +194,7 @@ class CookieJar {
        private $cookie = array();
 
        /**
-        * Set a cookie in the cookie jar.      Make sure only one cookie per-name exists.
+        * Set a cookie in the cookie jar. Make sure only one cookie per-name exists.
         * @see Cookie::set()
         */
        public function setCookie ( $name, $value, $attr ) {