diff --git a/sites/all/modules/contrib/filecache/filecache.inc b/sites/all/modules/contrib/filecache/filecache.inc
index 018aad1..a3d3334 100644
--- a/sites/all/modules/contrib/filecache/filecache.inc
+++ b/sites/all/modules/contrib/filecache/filecache.inc
@@ -53,7 +53,16 @@ class DrupalFileCache implements DrupalCacheInterface {
   function encode_cid($cid) {
     // Use urlencode() but ':' is used so often in Drupal's cid that
     // it's turned back into unencoded character
-    return str_replace('%3A', ':', urlencode($cid));
+    
+    // see drupal.org/node/1153796
+    // Don't do this for Windows.  The ':' character is invalid for a
+    // Windows file name.
+    if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') {
+      return urlencode($cid);
+    }
+    else {
+      return str_replace('%3A', ':', urlencode($cid));
+    }  
   }
 
   function decode_cid($filename) {
