From 5f3115ba1c3c96a62b8b466b0c0aa11c58caf099 Mon Sep 17 00:00:00 2001
From: Jason Vines <jasonevines@gmail.com>
Date: Sat, 31 May 2014 18:08:44 -0400
Subject: [PATCH] Fix Boost's implementation of hook_expire_cache so it will
 work when Expire is configured to work with Varnish. Accounted for
 possibility of other domains being in URL.

---
 boost.module | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/boost.module b/boost.module
index a6b3db2..3d871ad 100644
--- a/boost.module
+++ b/boost.module
@@ -378,13 +378,21 @@ function boost_expire_cache($urls) {
   global $base_root;
 
   foreach ($urls as $url) {
+
+    // Checks to see if the URL has a host name.
+    // If it does not, add the base root.
+    $hostname = parse_url($url, PHP_URL_HOST);
+    if (empty($hostname)) {
+      $url = url($url, array('absolute' => TRUE, 'alias' => TRUE));
+    }
+
     // Check if the URL to be flushed matches our base URL
     // base_root: http://www.example.org
     // url: http://www.example.org/node/123
     if (strpos($url, $base_root) === 0) {
       $boost = boost_transform_url($url);
 
-      // We need the extention for the filename
+      // We need the extension for the filename
       $boost['header_info'] = boost_get_header_info();
       $boost['matched_header_info'] = boost_match_header_attributes($boost['header_info']);
 
-- 
1.9.1

