Author: kn
Date: Thu Oct  4 09:17:52 2007
New Revision: 6350

Log:
- Fixed parsing of contenttype properties.
  # Made charset really optional

Modified:
    trunk/Webdav/src/transports/property_handler.php

Modified: trunk/Webdav/src/transports/property_handler.php
==============================================================================
--- trunk/Webdav/src/transports/property_handler.php [iso-8859-1] (original)
+++ trunk/Webdav/src/transports/property_handler.php [iso-8859-1] Thu Oct  4 
09:17:52 2007
@@ -27,7 +27,7 @@
      *
      * Example: 'text/html; charset=UTF-8'
      */
-    const GETCONTENTTYPE_REGEX = 
'(^(?P<mime>\w+/\w+)\s*;\s*charset\s*=\s*(?P<charset>.+)\s*$)i';
+    const GETCONTENTTYPE_REGEX = 
'(^(?P<mime>\w+/\w+)\s*(?:;\s*charset\s*=\s*(?P<charset>.+)\s*)?$)i';
 
     /**
      * Creates a new property handler.
@@ -171,7 +171,11 @@
                   && preg_match( self::GETCONTENTTYPE_REGEX, 
$domElement->nodeValue, $matches ) > 0 )
                 {
                     $property->mime    = $matches['mime'];
-                    $property->charset = $matches['charset'];
+
+                    if ( isset( $matches['charset'] ) )
+                    {
+                        $property->charset = $matches['charset'];
+                    }
                 }
                 break;
             case 'getetag':


-- 
svn-components mailing list
[email protected]
http://lists.ez.no/mailman/listinfo/svn-components

Reply via email to