本文整理汇总了PHP中strip_slashes函数的典型用法代码示例。如果您正苦于以下问题:PHP strip_slashes函数的具体用法?PHP strip_slashes怎么用?PHP strip_slashes使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了strip_slashes函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: do_update
function do_update()
{
$Q[] = "ALTER TABLE `exp_search` CHANGE `query` `query` MEDIUMTEXT NULL DEFAULT NULL";
$Q[] = "ALTER TABLE `exp_search` CHANGE `custom_fields` `custom_fields` MEDIUMTEXT NULL DEFAULT NULL";
$Q[] = "ALTER TABLE `exp_templates` ADD `last_author_id` INT(10) UNSIGNED NOT NULL AFTER `edit_date`";
$Q[] = "ALTER TABLE `exp_revision_tracker` ADD `item_author_id` INT(10) UNSIGNED NOT NULL AFTER `item_date`";
$query = ee()->db->query('SHOW FIELDS FROM exp_weblog_data');
foreach ($query->result_array() as $row) {
if (strncmp($row['Field'], 'field_ft', 8) == 0) {
$Q[] = "ALTER TABLE `exp_weblog_data` CHANGE `{$row['Field']}` `{$row['Field']}` TINYTEXT NULL";
}
}
// run our queries
foreach ($Q as $sql) {
ee()->db->query($sql);
}
ee()->load->helper('string');
// We need to add a new template preference, so we'll fetch the existing site template prefs
$query = ee()->db->query("SELECT site_id, site_template_preferences FROM exp_sites");
foreach ($query->result_array() as $row) {
$prefs = strip_slashes(unserialize($row['site_template_preferences']));
// Add our new pref to the array
$prefs['strict_urls'] = $prefs['site_404'] == FALSE ? 'n' : 'y';
// Update the DB
ee()->db->query(ee()->db->update_string('exp_sites', array('site_template_preferences' => serialize($prefs)), "site_id = '" . $row['site_id'] . "'"));
}
return TRUE;
}
示例2: strip_slashes
/**
* Strip Slashes
*
* Removes slashes contained in a string or in an array
*
* @param mixed string or array
* @return mixed string or array
*/
function strip_slashes($str)
{
if (!is_array($str)) {
return stripslashes($str);
}
foreach ($str as $key => $val) {
$str[$key] = strip_slashes($val);
}
return $str;
}
示例3: strip_slashes
/**
* Strip Slashes
*
* Removes slashes contained in a string or in an array
*
* @access public
* @param mixed string or array
* @return mixed string or array
*/
public static function strip_slashes($str)
{
if (is_array($str)) {
foreach ($str as $key => $val) {
$str[$key] = strip_slashes($val);
}
} else {
$str = stripslashes($str);
}
return $str;
}
示例4: set_var
function set_var(&$result, $var, $type, $multibyte = false)
{
settype($var, $type);
$result = $var;
if ($type == 'string') {
$result = strip_slashes(trim(htmlspecialchars(str_replace(array("\r\n", "\r", '\\xFF'), array("\n", "\n", ' '), $result))));
if ($multibyte) {
$result = preg_replace('#&(\\#[0-9]+;)#', '&\\1', $result);
}
}
return $result;
}
示例5: get_settings
function get_settings($all_sites = FALSE)
{
$get_settings = $this->EE->db->query("SELECT settings \n\t\t\tFROM exp_extensions \n\t\t\tWHERE class = '" . $this->extension . "' \n\t\t\tLIMIT 1");
$this->EE->load->helper('string');
if ($get_settings->num_rows() > 0 && $get_settings->row('settings') != '') {
$settings = strip_slashes(unserialize($get_settings->row('settings')));
$settings = $all_sites == FALSE && isset($settings[$this->EE->config->item('site_id')]) ? $settings[$this->EE->config->item('site_id')] : $settings;
} else {
$settings = array();
}
return $settings;
}
示例6: _unserialize
function _unserialize($data)
{
$data = @unserialize(strip_slashes($data));
if (is_array($data)) {
foreach ($data as $key => $val) {
if (is_string($val)) {
$data[$key] = str_replace('{{slash}}', '\\', $val);
}
}
return $data;
}
return is_string($data) ? str_replace('{{slash}}', '\\', $data) : $data;
}
示例7: escape_html
function escape_html($val)
{
if ($val == "") {
return "";
}
if (is_array($val)) {
return array_map('escape_html', $val);
}
$val = str_replace(" ", " ", strip_slashes($val));
/*
if ( isset($this->vars['strip_space_chr']) AND $this->vars['strip_space_chr'] )
{
$val = str_replace( chr(0xCA), "", $val ); //Remove sneaky spaces
}
*/
$val = str_replace("&", "&", $val);
$val = str_replace("<!--", "<!--", $val);
$val = str_replace("-->", "-->", $val);
$val = preg_replace("/<script/i", "<script", $val);
$val = str_replace(">", ">", $val);
$val = str_replace("<", "<", $val);
$val = str_replace('"', """, $val);
$val = str_replace("\n", "<br />", $val);
// Convert literal newlines
$val = str_replace("\$", "$", $val);
$val = str_replace("\r", "", $val);
// Remove literal carriage returns
$val = str_replace("!", "!", $val);
$val = str_replace("'", "'", $val);
// IMPORTANT: It helps to increase sql query safety.
// Ensure unicode chars are OK
$val = preg_replace("/&#([0-9]+);/s", "&#\\1;", $val);
//-----------------------------------------
// Try and fix up HTML entities with missing ;
//-----------------------------------------
$val = preg_replace("/&#(\\d+?)([^\\d;])/i", "&#\\1;\\2", $val);
/*
if ( $this->allow_unicode )
{
$val = preg_replace("/&#([0-9]+);/s", "&#\\1;", $val );
//-----------------------------------------
// Try and fix up HTML entities with missing ;
//-----------------------------------------
$val = preg_replace( "/&#(\d+?)([^\d;])/i", "&#\\1;\\2", $val );
}
*/
return $val;
}
示例8: __construct
/**
* Class constructor
*
* @access public
* @author Erik Reagan <erik@focuslabllc.com>
* @return void
*/
public function __construct()
{
$this->_EE =& get_instance();
$this->_debug = ($this->_EE->session->userdata['group_id'] == '1' OR $this->_EE->config->item('dh:dev_mode')) ? TRUE : FALSE ;
// load our model for access in all methods
$this->_EE->load->model('deployment_hooks_model','Deployment_hooks_model');
// Get our add-on's settings
$settings = $this->_EE->Deployment_hooks_model->get_settings();
if ($settings->num_rows() > 0 && $settings->row('settings') != '')
{
// Load the string helper to strip slashes on array items
$this->_EE->load->helper('string');
$this->_settings = strip_slashes(unserialize($settings->row('settings')));
}
// There's a chance this class will be loaded upon a deployment ACT request
// So we don't want to process any of this juicy goodness if that's the case
if ( ! $this->_EE->input->get('ACT'))
{
// Load our config settings
$this->_EE->load->config('deployment_hooks');
// Setup our module's URL base for quicker link building between module pages
// Defined in our config file located in deployment_hooks/config/deployment_hooks.php
$this->_url_base = $this->_EE->config->item('dh:mod_url_base');
// Setup our module's navigation elements
// Menu is defined in our config file
$this->_EE->cp->set_right_nav($this->_EE->config->item('dh:mod_menu'));
// Move this out to a view? Some other approach?
// ordered and unordered lists look kinda crappy in tables
// but we want them to look nice for our Log page/view
$this->_EE->cp->add_to_head('
<style type="text/css" media="screen">
table ol { list-style: numeric; margin: 5px 5px 5px 30px; }
table ol li { padding: 3px 0; }
</style>
');
}
// End if ( ! $this->_EE->input->get('ACT'))
}
示例9: universal_call
/**
* The Universal Caller (Added in EE 1.6)
*
* Originally, using call(), objects could not be called by reference in PHP 4
* and thus could not be directly modified. I found a clever way around that restriction
* by always having the second argument gotten by reference. The problem (and the reason
* there is a call() hook above) is that not all extension hooks have a second argument
* and the PHP developers in their infinite wisdom decided that only variables could be passed
* by reference. So, call() does a little magic to make sure there is always a second
* argument and universal_call() handles all of the object and reference handling
* when needed. -Paul
*
* @access public
* @param string Name of the extension hook
* @param mixed
* @return mixed
*/
function universal_call($which, &$parameter_one)
{
// Reset Our Variables
$this->end_script = FALSE;
$this->last_call = FALSE;
// HACK: Hooks called by non-CI enabled Bridge modules, need to have the last_call reset
// This might be temporary once I switch everything over to Bridge with CI's functionality.
if (isset($GLOBALS['EXT']) && is_object($GLOBALS['EXT'])) {
$GLOBALS['EXT']->last_call = FALSE;
}
// Anything to Do Here?
if (!isset($this->extensions[$which])) {
return;
}
if ($this->EE->config->item('allow_extensions') != 'y') {
return;
}
if ($this->in_progress == $which) {
return;
}
$this->in_progress = $which;
// Retrieve arguments for function
if (is_object($parameter_one) && is_php('5.0.0') == TRUE) {
$php4_object = FALSE;
$args = array_slice(func_get_args(), 1);
} else {
$php4_object = TRUE;
$args = array_slice(func_get_args(), 1);
}
if (is_php('5.3')) {
foreach ($args as $k => $v) {
$args[$k] =& $args[$k];
}
}
// Go through all the calls for this hook
foreach ($this->extensions[$which] as $priority => $calls) {
foreach ($calls as $class => $metadata) {
// Determine Path of Extension
$class_name = ucfirst($class);
$name = $this->EE->security->sanitize_filename(strtolower($class));
$path = PATH_EXT . 'ext.' . $name . EXT;
$third_party = FALSE;
if (!file_exists($path)) {
if (substr($class, -4) == '_ext') {
$name = $this->EE->security->sanitize_filename(strtolower(substr($class, 0, -4)));
// remove '_ext' suffix
} elseif (substr($class, -10) == '_extension') {
$name = $this->EE->security->sanitize_filename(strtolower(substr($class, 0, -10)));
// remove '_extension' suffix
}
// Third Party?
$path = PATH_THIRD . $name . '/ext.' . $name . EXT;
if (!file_exists($path)) {
$error = 'Unable to load the following extension file:<br /><br />' . 'ext.' . $name . EXT;
return $this->EE->output->fatal_error($error);
}
$third_party = TRUE;
// HACK: Not for EE 1.x, please.
// $this->EE->load->add_package_path(PATH_THIRD.$name.'/');
}
// Include File
if (!class_exists($class_name)) {
require $path;
}
// A Bit of Meta
$method = $metadata['0'];
// Unserializing and serializing is relatively slow, so we
// cache the settings just in case multiple hooks are calling the
// same extension multiple times during a single page load.
// Thus, speeding it all up a bit.
if (isset($this->s_cache[$class_name])) {
$settings = $this->s_cache[$class_name];
} else {
// Load the string helper
$this->EE->load->helper('string');
$settings = $metadata['1'] == '' ? '' : strip_slashes(unserialize($metadata['1']));
$this->s_cache[$class_name] = $settings;
}
$version = $metadata['2'];
// Call the class(s)
// Each method could easily have its own settings,
// so we have to send the settings each time
$this->OBJ[$class_name] = new $class_name($settings);
//.........这里部分代码省略.........
示例10: getExtensionSettings
private function getExtensionSettings($name)
{
if (ee()->config->item('allow_extensions') != 'y') {
show_error(lang('unauthorized_access'));
}
$addon = ee()->security->sanitize_filename(strtolower($name));
$extension = $this->getExtension($addon);
if (empty($extension) || $extension['installed'] === FALSE) {
show_error(lang('requested_module_not_installed') . NBS . $addon);
}
ee()->lang->loadfile(strtolower($addon));
$extension_model = ee('Model')->get('Extension')->filter('enabled', 'y')->filter('class', $extension['class'])->first();
$current = strip_slashes($extension_model->settings);
$class_name = $extension['class'];
$OBJ = new $class_name();
if (method_exists($OBJ, 'settings_form') === TRUE) {
return $OBJ->settings_form($current);
}
$vars = array('base_url' => ee('CP/URL')->make('addons/settings/' . $name . '/save'), 'cp_page_title' => $extension['name'] . ' ' . lang('configuration'), 'save_btn_text' => 'btn_save_settings', 'save_btn_text_working' => 'btn_saving', 'sections' => array(array()));
$settings = array();
foreach ($OBJ->settings() as $key => $options) {
$element = array('title' => $key, 'desc' => '', 'fields' => array());
if (isset($current[$key])) {
$value = $current[$key];
} elseif (is_array($options)) {
$value = $options[2];
} elseif (is_string($options)) {
$value = $options;
} else {
$value = '';
}
$sub = '';
$choices = array();
$selected = '';
if (isset($subtext[$key])) {
foreach ($subtext[$key] as $txt) {
$sub .= lang($txt);
}
}
$element['desc'] = $sub;
if (!is_array($options)) {
$element['fields'][$key] = array('type' => 'text', 'value' => str_replace("\\'", "'", $value));
$vars['sections'][0][] = $element;
continue;
}
switch ($options[0]) {
case 's':
// Select fields
foreach ($options[1] as $k => $v) {
$choices[$k] = lang($v);
}
$element['fields'][$key] = array('type' => 'select', 'value' => $value, 'choices' => $choices);
break;
case 'r':
// Radio buttons
foreach ($options[1] as $k => $v) {
$choices[$k] = lang($v);
}
$element['fields'][$key] = array('type' => 'radio', 'value' => $value, 'choices' => $choices);
break;
case 'ms':
case 'c':
// Multi-select & Checkboxes
foreach ($options[1] as $k => $v) {
$choices[$k] = lang($v);
}
$element['fields'][$key] = array('type' => 'checkbox', 'value' => $value, 'choices' => $choices);
break;
case 't':
// Textareas
$element['fields'][$key] = array('type' => 'textarea', 'value' => str_replace("\\'", "'", $value), 'kill_pipes' => $options['1']['kill_pipes']);
break;
case 'i':
// Input fields
$element['fields'][$key] = array('type' => 'text', 'value' => str_replace("\\'", "'", $value));
break;
}
$vars['sections'][0][] = $element;
}
return ee('View')->make('_shared/form')->render($vars);
}
示例11: getRankingResults
private function getRankingResults($results, &$res_data_array, $data_count = '')
{
foreach ($results as $item) {
$item->tit = strip_slashes($item->title);
//remove slashes from term title like "That\'s My Ticket"
$res_data_array[$item->title]['total_results' . $data_count] = $item->total_results;
if (!isset($res_data_array[$item->title]['brand_results' . $data_count]) || isset($res_data_array[$item->title]['brand_results' . $data_count]) && $item->brand_results > $res_data_array[$item->title]['brand_results' . $data_count]) {
$res_data_array[$item->title]['brand_results' . $data_count] = $item->brand_results;
}
if (!isset($res_data_array[$item->title]['number_in_results' . $data_count])) {
$res_data_array[$item->title]['number_in_results' . $data_count] = array();
}
if (!isset($res_data_array[$item->title]['on_first_page' . $data_count]) || !empty($res_data_array[$item->title]['on_first_page' . $data_count]) && $item->on_first_page > $res_data_array[$item->title]['on_first_page' . $data_count]) {
$res_data_array[$item->title]['on_first_page' . $data_count] = $item->on_first_page;
}
$res_data_array[$item->title]['number_in_results' . $data_count][$item->number_in_results] = array('num' => $item->number_in_results, 'url' => $item->url);
}
foreach ($res_data_array as &$dt) {
if (empty($dt['on_first_page' . $data_count])) {
$dt['on_first_page' . $data_count] = '0/16';
}
if (!empty($dt['number_in_results' . $data_count])) {
$dt['number_in_results' . $data_count] = $this->ranking_model->sortRankingNumbers($dt['number_in_results' . $data_count]);
} else {
$dt['tmp_number_in_results' . $data_count] = array();
}
}
}
示例12: update_extension_hooks
/**
* Install/Update Our Extension for Module
*
* Tells ExpressionEngine what extension hooks
* we wish to use for this module. If an extension
* is part of a module, then it is the module's class
* name with the '_extension' (1.x) or '_ext' 2.x
* suffix added on to it.
*
* @access public
* @return null
*/
public function update_extension_hooks()
{
if (!is_array($this->hooks) or count($this->hooks) == 0) {
return TRUE;
}
//fix EE 1.x extension names
ee()->db->update('exp_extensions', array('class' => $this->extension_name, 'enabled' => 'y'), array('class' => $this->class_name . '_extension'));
// --------------------------------------------
// Determine Existing Methods
// --------------------------------------------
$exists = array();
if ($this->settings == '') {
ee()->db->select('settings');
}
$query = ee()->db->select('method')->where('class', $this->extension_name)->get('extensions');
foreach ($query->result_array() as $row) {
$exists[] = $row['method'];
if ($this->settings == '' and !empty($row['settings'])) {
ee()->load->helper('string');
$this->settings = strip_slashes(unserialize($row['settings']));
}
}
// --------------------------------------------
// Extension Table Defaults
// --------------------------------------------
$this->extension_defaults = array('class' => $this->extension_name, 'settings' => '', 'priority' => 10, 'version' => $this->version, 'enabled' => 'y');
// --------------------------------------------
// Find Missing and Insert
// --------------------------------------------
$current_methods = array();
foreach ($this->hooks as $data) {
// Default exp_extension fields, overwrite with any from array
$data = array_merge($this->extension_defaults, $data);
$current_methods[] = $data['method'];
if (!in_array($data['method'], $exists)) {
// Every so often, EE can accidentally send empty
// $settings argument to the constructor, so
// our new hooks will not have any settings,
// so we have to fix that here.
if ($data['settings'] == '' or $data['settings'] == 's:0:"";') {
$data['settings'] = serialize($this->settings);
}
ee()->db->insert('extensions', $data);
} else {
unset($data['settings']);
ee()->db->update('extensions', $data, array('class' => $data['class'], 'method' => $data['method']));
}
}
// --------------------------------------------
// Remove Old Hooks
// --------------------------------------------
$old_hooks = array_diff($exists, $current_methods);
if (!empty($old_hooks)) {
ee()->db->where_in('method', $old_hooks)->where('class', $this->extension_name)->delete('extensions');
}
}
示例13: universal_call
/**
* The Universal Caller (Added in EE 1.6)
*
* Originally, using call(), objects could not be called by reference in PHP 4
* and thus could not be directly modified. I found a clever way around that restriction
* by always having the second argument gotten by reference. The problem (and the reason
* there is a call() hook above) is that not all extension hooks have a second argument
* and the PHP developers in their infinite wisdom decided that only variables could be passed
* by reference. So, call() does a little magic to make sure there is always a second
* argument and universal_call() handles all of the object and reference handling
* when needed. -Paul
*
* @access public
* @param string Name of the extension hook
* @param mixed
* @return mixed
*/
function universal_call($which, &$parameter_one)
{
// Reset Our Variables
$this->end_script = FALSE;
$this->last_call = FALSE;
$php5_args = array();
// Anything to Do Here?
if (!isset($this->extensions[$which])) {
return;
}
if (ee()->config->item('allow_extensions') != 'y') {
return;
}
if ($this->in_progress == $which) {
return;
}
$this->in_progress = $which;
ee()->load->library('addons');
ee()->addons->is_package('');
// Retrieve arguments for function
if (is_object($parameter_one) && is_php('5.0.0') == TRUE) {
$php4_object = FALSE;
$args = array_slice(func_get_args(), 1);
} else {
$php4_object = TRUE;
$args = array_slice(func_get_args(), 1);
}
if (is_php('5')) {
foreach ($args as $k => $v) {
$php5_args[$k] =& $args[$k];
}
}
// Give arguments by reference
foreach ($args as $k => $v) {
$args[$k] =& $args[$k];
}
// Go through all the calls for this hook
foreach ($this->extensions[$which] as $priority => $calls) {
foreach ($calls as $class => $metadata) {
// Determine Path of Extension
$class_name = ucfirst($class);
$name = ee()->security->sanitize_filename(strtolower(substr($class, 0, -4)));
// remove '_ext' suffix
$path = ee()->addons->_packages[$name]['extension']['path'];
$extension_path = reduce_double_slashes($path . '/ext.' . $name . '.php');
if (file_exists($extension_path)) {
ee()->load->add_package_path($path, FALSE);
} else {
$error = 'Unable to load the following extension file:<br /><br />' . 'ext.' . $name . '.php';
return ee()->output->fatal_error($error);
}
// Include File
if (!class_exists($class_name)) {
require $extension_path;
}
// A Bit of Meta
$method = $metadata['0'];
// Unserializing and serializing is relatively slow, so we
// cache the settings just in case multiple hooks are calling the
// same extension multiple times during a single page load.
// Thus, speeding it all up a bit.
if (isset($this->s_cache[$class_name])) {
$settings = $this->s_cache[$class_name];
} else {
$settings = $metadata['1'] == '' ? '' : strip_slashes(unserialize($metadata['1']));
$this->s_cache[$class_name] = $settings;
}
$version = $metadata['2'];
// Call the class(s)
// Each method could easily have its own settings,
// so we have to send the settings each time
$this->OBJ[$class_name] = new $class_name($settings);
// Update Extension First?
if (version_compare($this->OBJ[$class_name]->version, $this->version_numbers[$class_name], '>') && method_exists($this->OBJ[$class_name], 'update_extension') === TRUE) {
$update = call_user_func_array(array(&$this->OBJ[$class_name], 'update_extension'), array($this->version_numbers[$class_name]));
$this->version_numbers[$class_name] = $this->OBJ[$class_name]->version;
// reset master
}
// Call Method and Store Returned Data
// We put this in a class variable so that any extensions
// called after this one can retrieve the returned data from
// previous methods and view/maniuplate that returned data
// opposed to any original arguments the hook sent. In theory...
//.........这里部分代码省略.........
示例14: save
function save()
{
$this->EE->load->helper('string');
// get serialized site preferences and member preferences and template preferences
/* orig
$query = $DB->query("SELECT site_system_preferences, site_member_preferences, site_template_preferences
FROM exp_sites WHERE site_id = '" . $this->EE->config->item('site_id') . "'");
*/
$this->EE->db->select('site_system_preferences, site_member_preferences, site_template_preferences');
$this->EE->db->from('exp_sites');
$this->EE->db->where('site_id', $this->EE->config->item('site_id'));
$query = $this->EE->db->get();
if ($query->num_rows() > 0) {
$system_prefs = strip_slashes(unserialize(base64_decode($query->row('site_system_preferences'))));
$member_prefs = strip_slashes(unserialize(base64_decode($query->row('site_member_preferences'))));
$template_prefs = strip_slashes(unserialize(base64_decode($query->row('site_template_preferences'))));
}
$updates = array();
$changed = FALSE;
foreach ($_POST as $meganame => $value) {
// handle submissions from non-serialized tables
if (strpos($meganame, "::") !== FALSE) {
list($table, $id, $name) = explode("::", $meganame);
$table = $this->EE->security->xss_clean($table);
$id = $this->EE->security->xss_clean($id);
$name = $this->EE->security->xss_clean($name);
$value = $this->EE->security->xss_clean($value);
if ($table == "exp_channels") {
$updates[] = "UPDATE `{$table}` SET `{$name}` = " . $this->EE->db->escape($value) . " WHERE channel_id = " . $this->EE->db->escape($id) . " AND site_id = " . $this->EE->config->item('site_id');
}
if ($table == "exp_upload_prefs") {
$updates[] = "UPDATE `{$table}` SET `{$name}` = " . $this->EE->db->escape($value) . " WHERE id = " . $this->EE->db->escape($id) . " AND site_id = " . $this->EE->config->item('site_id');
}
if ($table == "exp_forum_boards") {
$updates[] = "UPDATE `{$table}` SET `{$name}` = " . $this->EE->db->escape($value) . " WHERE board_id = " . $this->EE->db->escape($id) . " AND board_site_id = " . $this->EE->config->item('site_id');
}
} elseif (in_array($meganame, $this->from_system_prefs)) {
$system_prefs[$meganame] = $value;
$changed = TRUE;
} elseif (in_array($meganame, $this->from_member_prefs)) {
$member_prefs[$meganame] = $value;
$changed = TRUE;
} elseif (in_array($meganame, $this->from_template_prefs)) {
$template_prefs[$meganame] = $value;
$changed = TRUE;
}
}
if ($changed) {
$system_prefs = base64_encode(serialize($this->EE->security->xss_clean($system_prefs)));
$member_prefs = base64_encode(serialize($this->EE->security->xss_clean($member_prefs)));
$template_prefs = base64_encode(serialize($this->EE->security->xss_clean($template_prefs)));
// just in case we want to echo some debug output -- easier to read than base64
//$system_prefs = serialize($this->EE->security->xss_clean($system_prefs));
//$member_prefs = serialize($this->EE->security->xss_clean($member_prefs));
//$template_prefs = serialize($this->EE->security->xss_clean($template_prefs));
$updates[] = "UPDATE exp_sites set \n\t\t\t\tsite_system_preferences = '{$system_prefs}', \n\t\t\t\tsite_member_preferences = '{$member_prefs}',\n\t\t\t\tsite_template_preferences = '{$template_prefs}'\n\t\t\t\tWHERE site_id = " . $this->EE->config->item('site_id');
}
//print_r($updates);
foreach ($updates as $sql) {
$this->EE->db->query($sql);
}
return $this->index($this->EE->lang->line('settings_saved'));
}
示例15: htmlspecialchars
$bbcode_tpl = htmlspecialchars($row['bbcode_tpl']);
break;
case 'modify':
$sql = 'SELECT bbcode_id
FROM ' . BBCODES_TABLE . '
WHERE bbcode_id = ' . $bbcode_id;
$result = $_CLASS['core_db']->sql_query($sql);
if (!($row = $_CLASS['core_db']->sql_fetchrow($result))) {
trigger_error('BBCODE_NOT_EXIST');
}
$_CLASS['core_db']->sql_freeresult($result);
// No break here
// No break here
case 'create':
$bbcode_match = htmlspecialchars(strip_slashes($_POST['bbcode_match']));
$bbcode_tpl = strip_slashes($_POST['bbcode_tpl']);
break;
}
// Do major work
switch ($mode) {
case 'edit':
case 'add':
adm_page_header($_CLASS['core_user']->lang['BBCODES']);
?>
<h1><?php
echo $_CLASS['core_user']->lang['BBCODES'];
?>
</h1>
<p><?php