#42622 closed defect (bug) (fixed)
Maintenance Mode / DB Repair
| Reported by: | munklefish | Owned by: | dd32 |
|---|---|---|---|
| Priority: | low | Milestone: | 5.1 |
| Component: | Administration | Version: | 2.9 |
| Severity: | normal | Keywords: | has-patch |
| Cc: | Focuses: |
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)
#2
@
9 years ago
- Keywords has-patch added
- Milestone Awaiting Review → 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.