Commit d5cdbcd6 authored by Dries's avatar Dries

- Bugfix: fixed username not being fetched with the title module. Fixes bug

  #1852.

  (Going to backport this to the DRUPAL-4-2-0 branch.)
parent 337b3c9d
......@@ -11,10 +11,12 @@ function title_page() {
$title = urldecode(arg(1));
$result = db_query("SELECT n.*, u.name, u.uid FROM {node} n LEFT JOIN {users} u ON n.uid = u.uid WHERE n.title = '%s' AND n.status = 1 ORDER BY created DESC", $title);
if (db_num_rows($result) == 0) {
// No node with exact title found, try substring.
$result = db_query("SELECT n.* FROM {node} n WHERE n.title LIKE '%". check_query($title). "%' AND n.status = 1 ORDER BY created DESC");
$result = db_query("SELECT n.*, u.name, u.uid FROM {node} n LEFT JOIN {users} u ON n.uid = u.uid WHERE n.title LIKE '%". check_query($title). "%' AND n.status = 1 ORDER BY created DESC");
}
if (db_num_rows($result) == 0 && module_exist("search")) {
// still no matches ... return a full text search
search_view($title);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment