# This patch file was generated by NetBeans IDE
# It uses platform neutral UTF-8 encoding and \n newlines.
--- <html>nodewords.module (<b>2013-01-03 08:14:47</b>)</html>
+++ <html><b>Current File</b></html>
@@ -1313,10 +1313,27 @@
     return array('type' => NODEWORDS_TYPE_FORUM, 'id' => 0);
   }
 
+  $current_path = _nodewords_path_humanize($_SERVER['QUERY_STRING']);
+  $path = $current_path;
+
   // Check all of the custom page paths.
-  foreach (_nodewords_get_pages_paths() as $pid => $path) {
+  foreach (_nodewords_get_pages_paths() as $pid => $path_expr) {
     // The path is a system path.
-    if (drupal_match_path($_GET['q'], $path)) {
+    
+    
+      $regexp = '/^('. 
+            preg_replace(array('/(\r\n?|\n)/', '/\\\\\*/', '/(^|\|)\\\\<front\\\\>($|\|)/'), 
+                         array('|', '.*', '\1'. preg_quote(variable_get('site_frontpage', 'node'), '/') .'\2'), 
+                         preg_quote($path_expr, '/')) .
+            ')$/';
+
+    // Compare with the Drupal path and the query.
+    $page_match = preg_match($regexp, $path);
+    if ($path != $_GET['q'] && $path != $current_path) {
+      $page_match = $page_match || preg_match($regexp, $_GET['q']);
+    }
+    
+    if ($page_match > 0) {
       return array('type' => NODEWORDS_TYPE_PAGE, 'id' => $pid);
     }
 
@@ -1579,7 +1596,7 @@
         break;
 
       case NODEWORDS_TYPE_PAGE:
-        $path = $_GET['q'];
+        $path = _nodewords_path_humanize($_SERVER['QUERY_STRING']);
         break;
 
       case NODEWORDS_TYPE_TERM:
@@ -1646,3 +1663,13 @@
 
   $tags[$tag_name] = $content['value'];
 }
+
+
+/*
+ * Translate path from QUERY_STRING to path seen in addressbar
+ */
+function _nodewords_path_humanize($path) {
+  $path = str_replace('q=', '', $path);
+  $path = preg_replace('/&/', '?', $path, 1);
+  return $path;
+}
\ No newline at end of file
