Permalink
Browse files

MDL-29406 fix greedy config settings cleanup

  • Loading branch information...
1 parent 3d2029f commit 84cae7bef8277e316263e77818b6a6f9f4816178 @skodak skodak committed with Sam Hemelryk Sep 17, 2011
Showing with 3 additions and 1 deletion.
  1. +3 −1 lib/moodlelib.php
View
@@ -1125,7 +1125,9 @@ function unset_config($name, $plugin=NULL) {
function unset_all_config_for_plugin($plugin) {
global $DB;
$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;
}

0 comments on commit 84cae7b

Please sign in to comment.