-
Notifications
You must be signed in to change notification settings - Fork 36
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
deleting a constant with concatenated function deletes much more #101
Comments
I’ve been following this thread and experiencing the same issue with the Issue Recap: define('USER_PATH', '/var/www/' . get_current_user()); the command ends up deleting additional lines, not just the Deeper Dive: Approach Tried:
if ('constant' === $type) {
$pattern = "/define\s*\(\s*['\"]{$name}['\"]\s*,/";
} else {
$pattern = '/^\\$' . $name . "\s*=\s*['\"][^'\"\;]*['\"]\s*;/";
}
// I iterated through each line to find and remove the exact match.
Suggested Next Steps: I’m very open to feedback and would love to collaborate on fixing this issue. |
I can also reproduce the issue. I tested with following feature test.
But here in my case, rather than deleting unrelated changes, command is not deleting anything. |
Bug Report
Describe the current, buggy behavior
Deleting a constant with concatenated function from
wp-config.php
withwp config delete
deletes more than just that constant.Describe how other contributors can replicate this bug
wp config delete USER_PATH
Describe what you would expect as the correct outcome
wp-config.php
with justUSER_PATH
constant definition removed.Let us know what environment you are running this on
The text was updated successfully, but these errors were encountered: