Author: ts
Date: Tue Sep 25 06:32:04 2007
New Revision: 6258

Log:
- Make memory backend fail for destination match, too.
# Only failed for source path matches, using $failForRegexp.

Modified:
    trunk/Webdav/src/backend/memory.php

Modified: trunk/Webdav/src/backend/memory.php
==============================================================================
--- trunk/Webdav/src/backend/memory.php [iso-8859-1] (original)
+++ trunk/Webdav/src/backend/memory.php [iso-8859-1] Tue Sep 25 06:32:04 2007
@@ -439,6 +439,14 @@
                     $fromPath
                 ) );
             }
+            if ( $causeErrors && preg_match( $this->options->failForRegexp, 
$toPath ) )
+            {
+                // Completely abort with error
+                return array( ezcWebdavErrorResponse(
+                    ezcWebdavResponse::STATUS_412,
+                    $toPath
+                ) );
+            }
 
             // Perform copy operation
             if ( is_array( $this->content[$fromPath] ) )
@@ -504,6 +512,17 @@
                 // To actually perform the copy operation, modify the
                 // destination resource name
                 $newResourceName = preg_replace( '(^' . preg_quote( $fromPath 
) . ')', $toPath, $resource );
+                
+                // Check if this resource should cause an error
+                if ( $causeErrors && preg_match( 
$this->options->failForRegexp, $newResourceName ) )
+                {
+                    // Cause an error and skip resource
+                    $errors[] = new ezcWebdavErrorResponse(
+                        ezcWebdavResponse::STATUS_412,
+                        $newResourceName
+                    );
+                    continue;
+                }
                 
                 // Add collection to collection child recalculation array
                 if ( is_array( $this->content[$resource] ) )


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

Reply via email to