Uploaded image for project: 'phpBB3'
  1. phpBB3
  2. PHPBB3-6415

Google Bot creates SQL Errors

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Resolution: Fixed
    • 3.0.RC7
    • 3.0.0
    • Viewing posts
    • None
    • PHP Environment:
      Database:

    Description

      -----------------
      SQL ERROR [ mysql4 ]

      You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near \'AND topic_moved_id = 0\n AND topic_last_post_time < \n AND topic_approved = \' at line 4 [1064]

      SQL

      SELECT topic_id, forum_id\n FROM phpbb_topics\n WHERE forum_id = \n AND topic_moved_id = 0\n AND topic_last_post_time < \n AND topic_approved = 1\n ORDER BY topic_last_post_time DESC\n LIMIT 1

      BACKTRACE

      FILE: includes/db/mysql.php
      LINE: 158
      CALL: dbal->sql_error()

      FILE: includes/db/mysql.php
      LINE: 205
      CALL: dbal_mysql->sql_query()

      FILE: includes/db/dbal.php
      LINE: 153
      CALL: dbal_mysql->_sql_query_limit()

      FILE: viewtopic.php
      LINE: 134
      CALL: dbal->sql_query_limit()
      ------------------------------------------
      The call error happens when someone calls view next or prev when $row['topic_last_post_time'] is empty...

      I added in front of that sql the following code that fixes it

      if (!$row['topic_last_post_time'])

      { $user->setup('viewtopic'); trigger_error(($view == 'next') ? 'NO_NEWER_TOPICS' : 'NO_OLDER_TOPICS'); }

      Attachments

        Activity

          People

            Kellanved Kellanved [X] (Inactive)
            dokster dokster
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: