diff options
author | Kjartan Mannes <kjartan@2.no-reply.drupal.org> | 2004-02-21 23:52:11 +0000 |
---|---|---|
committer | Kjartan Mannes <kjartan@2.no-reply.drupal.org> | 2004-02-21 23:52:11 +0000 |
commit | 18160f02e8bf9da9088ef54ee17472d1ad1afbc4 (patch) | |
tree | 11746682d0034563187d3290fe38bffd82c68a45 /modules | |
parent | 2d7d796d9b256b221b8ca5aa10ae39c622db8ec4 (diff) | |
download | brdo-18160f02e8bf9da9088ef54ee17472d1ad1afbc4.tar.gz brdo-18160f02e8bf9da9088ef54ee17472d1ad1afbc4.tar.bz2 |
- Sanatize title before doing LIKE matches.
Diffstat (limited to 'modules')
-rw-r--r-- | modules/title.module | 1 |
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); |