#42622 closed defect (bug) (fixed)
Maintenance Mode / DB Repair
Reported by: |
|
Owned by: |
|
---|---|---|---|
Milestone: | 5.1 | Priority: | low |
Severity: | normal | Version: | 2.9 |
Component: | Administration | Keywords: | has-patch |
Focuses: | Cc: |
Description
Adding
define('WP_ALLOW_REPAIR', true);
to WP-config.php enable the database optimisation/repair mode as expected. However, setting the value to false is also interpreted as if it were true.
eg:
define('WP_ALLOW_REPAIR', false);
I suspect that the properly formated presence of this constant will be interpreted as if it were true regardless of the actual content, although I have not tested this.
Attachments (1)
Change History (7)
#1
@
7 years ago
- Component changed from General to Administration
- Priority changed from normal to low
- Version changed from 4.9 to 2.9
#2
@
7 years ago
- Keywords has-patch added
- Milestone changed from Awaiting Review to 5.0
Thanks for the patch @tiagohillebrandt!
For future contributions - please note that our ticketing system doesn't trigger email notifications when attachments are added, adding a comment mentioning you've uploaded a patch (and setting the has-patch keyword) allows us to review them as they come in. Including details of how it's tested and what edge-cases you've taken into account also greatly helps.
Looking at 42622.patch, it can be simplified to the following:
if ( ! defined( 'WP_ALLOW_REPAIR' ) || ! WP_ALLOW_REPAIR ) {
Hey @munklefish and welcome to Trac.
This is mostly intentional, we base the script being available based upon the constant being defined, not what the value of it is.
#11717 is kind-of a duplicate, I'm going to leave this ticket open though, as requiring it be non-falsey makes sense to me - however, it's worth noting it's been this way for 8+ years deliberately.