- sql_query($query);
- $query = "INSERT INTO %s (oid, ocontextid, ovalue) VALUES (%d, %d, '%s');";
- $query = sprintf($query, sql_table('plugin_option'), (integer) $oid, (integer) $contextid, sql_real_escape_string($value));
- sql_query($query);
- }
- }
- // clear option value cache if the plugin object is already loaded
- if ( is_object($info) )
- {
- $plugin=& $manager->pidLoaded($info->opid);
- if ( $plugin )
- {
- $plugin->clearOptionValueCache();
+ DB::execute($query);
+ $query = "INSERT INTO %s (oid, ocontextid, ovalue) VALUES (%d, %d, %s);";
+ $query = sprintf($query, sql_table('plugin_option'), (integer) $oid, (integer) $contextid, DB::quoteValue($value));
+ DB::execute($query);
+
+ // clear option value cache if the plugin object is already loaded
+ $plugin=& $manager->pidLoaded($result['opid']);
+ if ( $plugin )
+ {
+ $plugin->clearOptionValueCache();
+ }
+
+ continue;