Fix undefined constant in Database class
authorMatthias Schmidt <gravatronics@live.com>
Fri, 12 Oct 2018 17:36:52 +0000 (19:36 +0200)
committerMatthias Schmidt <gravatronics@live.com>
Fri, 12 Oct 2018 17:36:52 +0000 (19:36 +0200)
It cannot be guaranteed that this constant always exists (for example after emptying caches).

See #2729

wcfsetup/install/files/lib/system/database/Database.class.php

index d9c7af4d392c74aaa17079eb2f5a99957164a748..003720add280b1d297df9733f7f8fad7d753a5d5 100644 (file)
@@ -247,7 +247,7 @@ abstract class Database {
                        //       useful. Thus the code to retrieve the request information
                        //       must be absolutely lightweight.
                        $requestInformation = '';
-                       if (ENABLE_PRODUCTION_DEBUG_MODE && isset($_SERVER['REQUEST_URI'])) {
+                       if (defined('ENABLE_PRODUCTION_DEBUG_MODE') && ENABLE_PRODUCTION_DEBUG_MODE && isset($_SERVER['REQUEST_URI'])) {
                                $requestInformation = substr($_SERVER['REQUEST_URI'], 0, 90);
                                if (isset($_REQUEST['className']) && isset($_REQUEST['actionName'])) {
                                        $requestInformation .= ' ('.$_REQUEST['className'].':'.$_REQUEST['actionName'].')';