summaryrefslogtreecommitdiff
path: root/modules/title.module
diff options
context:
space:
mode:
authorKjartan Mannes <kjartan@2.no-reply.drupal.org>2004-02-21 23:52:11 +0000
committerKjartan Mannes <kjartan@2.no-reply.drupal.org>2004-02-21 23:52:11 +0000
commit18160f02e8bf9da9088ef54ee17472d1ad1afbc4 (patch)
tree11746682d0034563187d3290fe38bffd82c68a45 /modules/title.module
parent2d7d796d9b256b221b8ca5aa10ae39c622db8ec4 (diff)
downloadbrdo-18160f02e8bf9da9088ef54ee17472d1ad1afbc4.tar.gz
brdo-18160f02e8bf9da9088ef54ee17472d1ad1afbc4.tar.bz2
- Sanatize title before doing LIKE matches.
Diffstat (limited to 'modules/title.module')
-rw-r--r--modules/title.module1
1 files changed, 1 insertions, 0 deletions
diff --git a/modules/title.module b/modules/title.module
index e23031aa4..fd02de0c7 100644
--- a/modules/title.module
+++ b/modules/title.module
@@ -26,6 +26,7 @@ function title_page() {
$title = urldecode(arg(1));
$result = db_query("SELECT n.*, u.name, u.uid FROM {node} n INNER JOIN {users} u ON n.uid = u.uid WHERE n.title = '%s' AND n.status = 1 ORDER BY n.created DESC", $title);
+ $title = trim(str_replace(array('_', '%', '*'), ' ', $title));
if (db_num_rows($result) == 0) {
// No node with exact title found, try substring.
$result = db_query("SELECT n.*, u.name, u.uid FROM {node} n INNER JOIN {users} u ON n.uid = u.uid WHERE n.title LIKE '%%%s%%' AND n.status = 1 ORDER BY n.created DESC", $title);