Index: wikitools.pages.inc =================================================================== --- wikitools.pages.inc (revision 1) +++ wikitools.pages.inc (working copy) @@ -54,8 +54,10 @@ // Don't do anything if no node types are active or no page name is available $node_types = wikitools_node_types(); if (count($node_types) && $page_name) { - // Try to find the current page with this name. - $result = db_query("SELECT nid, type FROM {node} WHERE LOWER(title) = LOWER('%s')", $page_name); + // Try to find the current page with this name, limit the query by node types + $params = $node_types; + $params[] = $page_name; + $result = db_query("SELECT nid, type FROM {node} WHERE type IN (". db_placeholders($node_types, 'varchar'). ") AND LOWER(title) = LOWER('%s')", $params); $found_nodes = array(); while ($node = db_fetch_object($result)) { if (wikitools_type_affected($node->type)) {