Announcement

Collapse
No announcement yet.

How to hide SQL error from user

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • [Forum] How to hide SQL error from user

    Hi, everyone.

    When case sql error on my forums on 4.2.2 version, users can view raw sql query, for example:

    HTML Code:
    <?xml version="1.0" encoding="UTF-8"?>
    <errors>
    <error><![CDATA[<p>Database Error</p>]]></error>
    <error_html><![CDATA[<p>Ошибка базы данных в vBulletin 4.2.2</p>
    <p>Invalid SQL:
    
    SELECT MAX(dateline) AS lastpost, COUNT(*) AS total
    FROM vb_usernote AS usernote
    WHERE userid =;<p>
    <p>
    <strong>Ошибка MySQL</strong> : You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '' at line 3<br />
    <strong>Номер ошибки</strong> : 1064<br />
    <strong>Дата запроса</strong> : Wednesday, April 15th 2020 @ 12:02:14 PM<br />
    <strong>Дата ошибки</strong> : Wednesday, April 15th 2020 @ 12:02:14 PM<br />
    <strong>Скрипт</strong> : http://parapa.mail.ru/forums/activity.php<br />
    <strong>Реферер</strong> : <br />
    <strong>Имя класса</strong> : vB_Database_Slave_MySQLi<br />
    <strong>Версия MySQL</strong> : <br />
    </p>]]></error_html>
    </errors>
    ❓Please, help me. How can I hide these details?

  • #2
    Nobody knows about this problem?

    Comment


    • #3
      The query should only be included if the system can determine the user is an an Administrator.

      In your case, it might be worth it to upgrade to 4.2.5 and make sure that your PHP version is no higher than 7.1.33. Your error appears to be an issue with an unsupported PHP version.
      Translations provided by Google.

      Wayne Luke
      The Rabid Badger - a vBulletin Cloud demonstration site.
      vBulletin 5 API - Full / Mobile
      Vote for your favorite feature requests and the bugs you want to see fixed.

      Comment


      • #4
        Originally posted by Wayne Luke View Post
        The query should only be included if the system can determine the user is an an Administrator.

        In your case, it might be worth it to upgrade to 4.2.5 and make sure that your PHP version is no higher than 7.1.33. Your error appears to be an issue with an unsupported PHP version.
        I can't update version, but I want only hide sql query. I want to show only "Error has occur" for example, with no details.

        Comment


        • #5
          vBulletin 4.X should already do that for non-administrator users.

          You can edit the database_error_page.html file found in the /includes directory to remove the query. Remove $message from it. This will make resolving actual errors very difficult but it is the only way to change things.
          Last edited by Wayne Luke; Thu 16th Apr '20, 9:12am.
          Translations provided by Google.

          Wayne Luke
          The Rabid Badger - a vBulletin Cloud demonstration site.
          vBulletin 5 API - Full / Mobile
          Vote for your favorite feature requests and the bugs you want to see fixed.

          Comment

          widgetinstance 262 (Related Topics) skipped due to lack of content & hide_module_if_empty option.
          Working...
          X