mirror of
https://github.com/moodle/moodle.git
synced 2025-08-08 02:16:41 +02:00
MDL-29406 fix greedy config settings cleanup
This commit is contained in:
parent
9cfaebbd0e
commit
a419316622
1 changed files with 3 additions and 1 deletions
|
@ -1308,7 +1308,9 @@ function unset_config($name, $plugin=NULL) {
|
||||||
function unset_all_config_for_plugin($plugin) {
|
function unset_all_config_for_plugin($plugin) {
|
||||||
global $DB;
|
global $DB;
|
||||||
$DB->delete_records('config_plugins', array('plugin' => $plugin));
|
$DB->delete_records('config_plugins', array('plugin' => $plugin));
|
||||||
$DB->delete_records_select('config', 'name LIKE ?', array($plugin . '_%'));
|
$like = $DB->sql_like('name', '?', true, true, false, '|');
|
||||||
|
$params = array($DB->sql_like_escape($plugin.'_', '|') . '%');
|
||||||
|
$DB->delete_records_select('config', $like, $params);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue