diff --git a/kernel/classes/ezcache.php b/kernel/classes/ezcache.php
index b20534c1419f5def6518fbdcaad43e1c5c7012ae..5d60f59d0a8bb05e3811373690a3c3a7da92466a 100644
--- a/kernel/classes/ezcache.php
+++ b/kernel/classes/ezcache.php
@@ -452,7 +452,7 @@ class eZCache
         $cacheItem['iterationMax']   = $iterationMax;
         $cacheItem['expiry']         = $expiry;
         $functionName = 'function';
-        if ( $purge )
+        if ( $purge && isset( $cacheItem['purge-function'] ) )
             $functionName = 'purge-function';
         if ( isset( $cacheItem[$functionName] ) )
         {
@@ -464,6 +464,12 @@ class eZCache
         }
         else
         {
+            if ( !isset( $cacheItem['path'] ) || strlen( $cacheItem['path'] ) < 1 )
+            {
+                eZDebug::writeError( "No path specified for cache item '$cacheItem[name]', can not clear cache.", __METHOD__ );
+                return;
+            }
+
             $cachePath = eZSys::cacheDirectory() . "/" . $cacheItem['path'];
 
             if ( isset( $cacheItem['is-clustered'] ) )
