本文整理汇总了PHP中OSC\OM\HTML::sanitize方法的典型用法代码示例。如果您正苦于以下问题:PHP HTML::sanitize方法的具体用法?PHP HTML::sanitize怎么用?PHP HTML::sanitize使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类OSC\OM\HTML
的用法示例。
在下文中一共展示了HTML::sanitize方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: substr
function __construct($module, $user_id = null, $user_name = null)
{
global $PHP_SELF;
$this->lang = Registry::get('Language');
$module = HTML::sanitize(str_replace(' ', '', $module));
if (defined('MODULE_ACTION_RECORDER_INSTALLED') && tep_not_null(MODULE_ACTION_RECORDER_INSTALLED)) {
if (tep_not_null($module) && in_array($module . '.' . substr($PHP_SELF, strrpos($PHP_SELF, '.') + 1), explode(';', MODULE_ACTION_RECORDER_INSTALLED))) {
if (!class_exists($module)) {
if (is_file('includes/modules/action_recorder/' . $module . '.' . substr($PHP_SELF, strrpos($PHP_SELF, '.') + 1))) {
$this->lang->loadDefinitions('modules/action_recorder/' . $module);
include 'includes/modules/action_recorder/' . $module . '.' . substr($PHP_SELF, strrpos($PHP_SELF, '.') + 1);
} else {
return false;
}
}
} else {
return false;
}
} else {
return false;
}
$this->_module = $module;
if (!empty($user_id) && is_numeric($user_id)) {
$this->_user_id = $user_id;
}
if (!empty($user_name)) {
$this->_user_name = $user_name;
}
$GLOBALS[$this->_module] = new $module();
$GLOBALS[$this->_module]->setIdentifier();
}
示例2: execute
function execute()
{
global $login_customer_id, $messageStack, $oscTemplate;
$OSCOM_Db = Registry::get('Db');
$error = false;
if (isset($_GET['action']) && $_GET['action'] == 'process' && isset($_POST['formid']) && $_POST['formid'] == $_SESSION['sessiontoken']) {
$email_address = HTML::sanitize($_POST['email_address']);
$password = HTML::sanitize($_POST['password']);
// Check if email exists
$Qcustomer = $OSCOM_Db->get('customers', ['customers_id', 'customers_password'], ['customers_email_address' => $email_address], null, 1);
if ($Qcustomer->fetch() === false) {
$error = true;
} else {
// Check that password is good
if (!tep_validate_password($password, $Qcustomer->value('customers_password'))) {
$error = true;
} else {
// set $login_customer_id globally and perform post login code in catalog/login.php
$login_customer_id = $Qcustomer->valueInt('customers_id');
// migrate old hashed password to new phpass password
if (tep_password_type($Qcustomer->value('customers_password')) != 'phpass') {
$OSCOM_Db->save('customers', ['customers_password' => tep_encrypt_password($password)], ['customers_id' => $login_customer_id]);
}
}
}
}
if ($error == true) {
$messageStack->add('login', MODULE_CONTENT_LOGIN_TEXT_LOGIN_ERROR);
}
ob_start();
include DIR_WS_MODULES . 'content/' . $this->group . '/templates/login_form.php';
$template = ob_get_clean();
$oscTemplate->addContent($template, $this->group);
}
示例3: execute
function execute()
{
global $login_customer_id, $messageStack, $oscTemplate;
$OSCOM_Db = Registry::get('Db');
$error = false;
if (isset($_GET['action']) && $_GET['action'] == 'process' && isset($_POST['formid']) && $_POST['formid'] == $_SESSION['sessiontoken']) {
$email_address = HTML::sanitize($_POST['email_address']);
$password = HTML::sanitize($_POST['password']);
// Check if email exists
$Qcustomer = $OSCOM_Db->get('customers', ['customers_id', 'customers_password'], ['customers_email_address' => $email_address], null, 1);
if ($Qcustomer->fetch() === false) {
$error = true;
} else {
// Check that password is good
if (!Hash::verify($password, $Qcustomer->value('customers_password'))) {
$error = true;
} else {
// set $login_customer_id globally and perform post login code in catalog/login.php
$login_customer_id = $Qcustomer->valueInt('customers_id');
// migrate old hashed password to new php password_hash
if (Hash::needsRehash($Qcustomer->value('customers_password'))) {
$OSCOM_Db->save('customers', ['customers_password' => Hash::encrypt($password)], ['customers_id' => $login_customer_id]);
}
}
}
}
if ($error == true) {
$messageStack->add('login', OSCOM::getDef('module_content_login_text_login_error'));
}
ob_start();
include 'includes/modules/content/' . $this->group . '/templates/login_form.php';
$template = ob_get_clean();
$oscTemplate->addContent($template, $this->group);
}
示例4: link
public static function link($page, $parameters = null, $connection = 'NONSSL', $add_session_id = true, $search_engine_safe = true)
{
global $request_type;
$page = HTML::sanitize($page);
if (!in_array($connection, ['NONSSL', 'SSL', 'AUTO'])) {
$connection = 'NONSSL';
}
if (!is_bool($add_session_id)) {
$add_session_id = true;
}
if (!is_bool($search_engine_safe)) {
$search_engine_safe = true;
}
if ($connection == 'AUTO') {
$connection = $request_type == 'SSL' ? 'SSL' : 'NONSSL';
}
if ($connection == 'SSL' && ENABLE_SSL !== true) {
$connection = 'NONSSL';
}
if ($connection == 'NONSSL') {
$link = HTTP_SERVER . DIR_WS_HTTP_CATALOG;
} else {
$link = HTTPS_SERVER . DIR_WS_HTTPS_CATALOG;
}
$link .= $page;
if (!empty($parameters)) {
$link .= '?' . HTML::sanitize($parameters);
$separator = '&';
} else {
$separator = '?';
}
while (substr($link, -1) == '&' || substr($link, -1) == '?') {
$link = substr($link, 0, -1);
}
// Add the session ID when moving from different HTTP and HTTPS servers, or when SID is defined
if ($add_session_id == true && session_status() === PHP_SESSION_ACTIVE && SESSION_FORCE_COOKIE_USE == 'False') {
if (defined('SID') && !empty(SID)) {
$_sid = SID;
} elseif ($request_type == 'NONSSL' && $connection == 'SSL' || $request_type == 'SSL' && $connection == 'NONSSL') {
if (HTTP_COOKIE_DOMAIN != HTTPS_COOKIE_DOMAIN) {
$_sid = session_name() . '=' . session_id();
}
}
}
if (isset($_sid)) {
$link .= $separator . HTML::sanitize($_sid);
}
while (strpos($link, '&&') !== false) {
$link = str_replace('&&', '&', $link);
}
if (SEARCH_ENGINE_FRIENDLY_URLS == 'true' && $search_engine_safe == true) {
$link = str_replace(['?', '&', '='], '/', $link);
}
return $link;
}
示例5: runActions
public function runActions()
{
$furious_pete = [];
if (count($_GET) > $this->site->actions_index) {
$furious_pete = array_keys(array_slice($_GET, $this->site->actions_index, null, true));
}
foreach ($furious_pete as $action) {
$action = HTML::sanitize(basename($action));
$this->actions_run[] = $action;
// get namespace from class name
$class = (new \ReflectionClass($this))->getNamespaceName() . '\\Actions\\' . implode('\\', $this->actions_run);
if (!in_array($action, $this->ignored_actions) && $this->actionExists($class)) {
$action = new $class($this);
$action->execute();
if ($action->isRPC()) {
$this->is_rpc = true;
}
} else {
array_pop($this->actions_run);
break;
}
}
}
示例6: switch
switch ($action) {
case 'insert':
$tax_class_title = HTML::sanitize($_POST['tax_class_title']);
$tax_class_description = HTML::sanitize($_POST['tax_class_description']);
$OSCOM_Db->save('tax_class', ['tax_class_title' => $tax_class_title, 'tax_class_description' => $tax_class_description, 'date_added' => 'now()']);
OSCOM::redirect(FILENAME_TAX_CLASSES);
break;
case 'save':
$tax_class_id = HTML::sanitize($_GET['tID']);
$tax_class_title = HTML::sanitize($_POST['tax_class_title']);
$tax_class_description = HTML::sanitize($_POST['tax_class_description']);
$OSCOM_Db->save('tax_class', ['tax_class_title' => $tax_class_title, 'tax_class_description' => $tax_class_description, 'last_modified' => 'now()'], ['tax_class_id' => (int) $tax_class_id]);
OSCOM::redirect(FILENAME_TAX_CLASSES, 'page=' . $_GET['page'] . '&tID=' . $tax_class_id);
break;
case 'deleteconfirm':
$tax_class_id = HTML::sanitize($_GET['tID']);
$OSCOM_Db->delete('tax_class', ['tax_class_id' => (int) $tax_class_id]);
OSCOM::redirect(FILENAME_TAX_CLASSES, 'page=' . $_GET['page']);
break;
}
}
require $oscTemplate->getFile('template_top.php');
?>
<table border="0" width="100%" cellspacing="0" cellpadding="2">
<tr>
<td><table border="0" width="100%" cellspacing="0" cellpadding="0">
<tr>
<td class="pageHeading"><?php
echo OSCOM::getDef('heading_title');
?>
示例7: isset
$appModuleType = 'Payment';
break;
case 'shipping':
$appModuleType = 'Shipping';
break;
case 'order_total':
$appModuleType = 'OrderTotal';
break;
}
$action = isset($_GET['action']) ? $_GET['action'] : '';
if (tep_not_null($action)) {
switch ($action) {
case 'save':
foreach ($_POST['configuration'] as $key => $value) {
$key = HTML::sanitize($key);
$value = HTML::sanitize($value);
$OSCOM_Db->save('configuration', ['configuration_value' => $value], ['configuration_key' => $key]);
}
OSCOM::redirect(FILENAME_MODULES, 'set=' . $set . '&module=' . $_GET['module']);
break;
case 'install':
case 'remove':
if (strpos($_GET['module'], '\\') !== false) {
$class = Apps::getModuleClass($_GET['module'], $appModuleType);
if (class_exists($class)) {
$file_extension = '';
$module = new $class();
$class = $_GET['module'];
}
} else {
$file_extension = substr($PHP_SELF, strrpos($PHP_SELF, '.'));
示例8: array
if (isset($_POST['default']) && $_POST['default'] == 'on') {
$OSCOM_Db->save('configuration', ['configuration_value' => $code], ['configuration_key' => 'DEFAULT_CURRENCY']);
}
OSCOM::redirect(FILENAME_CURRENCIES, 'page=' . $_GET['page'] . '&cID=' . $currency_id);
break;
case 'deleteconfirm':
$currencies_id = HTML::sanitize($_GET['cID']);
$Qcurrency = $OSCOM_Db->get('currencies', 'currencies_id', ['code' => DEFAULT_CURRENCY]);
if ($Qcurrency->valueInt('currencies_id') === (int) $currencies_id) {
$OSCOM_Db->save('configuration', ['configuration_value' => ''], ['configuration_key' => 'DEFAULT_CURRENCY']);
}
$OSCOM_Db->delete('currencies', ['currencies_id' => (int) $currencies_id]);
OSCOM::redirect(FILENAME_CURRENCIES, 'page=' . $_GET['page']);
break;
case 'delete':
$currencies_id = HTML::sanitize($_GET['cID']);
$Qcurrency = $OSCOM_Db->get('currencies', 'code', ['currencies_id' => (int) $currencies_id]);
$remove_currency = true;
if ($Qcurrency->value('code') == DEFAULT_CURRENCY) {
$remove_currency = false;
$OSCOM_MessageStack->add(OSCOM::getDef('error_remove_default_currency'), 'error');
}
break;
}
}
$currency_select = array('USD' => array('title' => 'U.S. Dollar', 'code' => 'USD', 'symbol_left' => '$', 'symbol_right' => '', 'decimal_point' => '.', 'thousands_point' => ',', 'decimal_places' => '2'), 'EUR' => array('title' => 'Euro', 'code' => 'EUR', 'symbol_left' => '', 'symbol_right' => '€', 'decimal_point' => '.', 'thousands_point' => ',', 'decimal_places' => '2'), 'JPY' => array('title' => 'Japanese Yen', 'code' => 'JPY', 'symbol_left' => '¥', 'symbol_right' => '', 'decimal_point' => '.', 'thousands_point' => ',', 'decimal_places' => '2'), 'GBP' => array('title' => 'Pounds Sterling', 'code' => 'GBP', 'symbol_left' => '£', 'symbol_right' => '', 'decimal_point' => '.', 'thousands_point' => ',', 'decimal_places' => '2'), 'CHF' => array('title' => 'Swiss Franc', 'code' => 'CHF', 'symbol_left' => '', 'symbol_right' => 'CHF', 'decimal_point' => ',', 'thousands_point' => '.', 'decimal_places' => '2'), 'AUD' => array('title' => 'Australian Dollar', 'code' => 'AUD', 'symbol_left' => '$', 'symbol_right' => '', 'decimal_point' => '.', 'thousands_point' => ',', 'decimal_places' => '2'), 'CAD' => array('title' => 'Canadian Dollar', 'code' => 'CAD', 'symbol_left' => '$', 'symbol_right' => '', 'decimal_point' => '.', 'thousands_point' => ',', 'decimal_places' => '2'), 'SEK' => array('title' => 'Swedish Krona', 'code' => 'SEK', 'symbol_left' => '', 'symbol_right' => 'kr', 'decimal_point' => ',', 'thousands_point' => '.', 'decimal_places' => '2'), 'HKD' => array('title' => 'Hong Kong Dollar', 'code' => 'HKD', 'symbol_left' => '$', 'symbol_right' => '', 'decimal_point' => '.', 'thousands_point' => ',', 'decimal_places' => '2'), 'NOK' => array('title' => 'Norwegian Krone', 'code' => 'NOK', 'symbol_left' => 'kr', 'symbol_right' => '', 'decimal_point' => ',', 'thousands_point' => '.', 'decimal_places' => '2'), 'NZD' => array('title' => 'New Zealand Dollar', 'code' => 'NZD', 'symbol_left' => '$', 'symbol_right' => '', 'decimal_point' => '.', 'thousands_point' => ',', 'decimal_places' => '2'), 'MXN' => array('title' => 'Mexican Peso', 'code' => 'MXN', 'symbol_left' => '$', 'symbol_right' => '', 'decimal_point' => '.', 'thousands_point' => ',', 'decimal_places' => '2'), 'SGD' => array('title' => 'Singapore Dollar', 'code' => 'SGD', 'symbol_left' => '$', 'symbol_right' => '', 'decimal_point' => '.', 'thousands_point' => ',', 'decimal_places' => '2'), 'BRL' => array('title' => 'Brazilian Real', 'code' => 'BRL', 'symbol_left' => 'R$', 'symbol_right' => '', 'decimal_point' => ',', 'thousands_point' => '.', 'decimal_places' => '2'), 'CNY' => array('title' => 'Chinese RMB', 'code' => 'CNY', 'symbol_left' => '¥', 'symbol_right' => '', 'decimal_point' => '.', 'thousands_point' => ',', 'decimal_places' => '2'), 'CZK' => array('title' => 'Czech Koruna', 'code' => 'CZK', 'symbol_left' => '', 'symbol_right' => 'Kč', 'decimal_point' => ',', 'thousands_point' => '.', 'decimal_places' => '2'), 'DKK' => array('title' => 'Danish Krone', 'code' => 'DKK', 'symbol_left' => '', 'symbol_right' => 'kr', 'decimal_point' => ',', 'thousands_point' => '.', 'decimal_places' => '2'), 'HUF' => array('title' => 'Hungarian Forint', 'code' => 'HUF', 'symbol_left' => '', 'symbol_right' => 'Ft', 'decimal_point' => '.', 'thousands_point' => ',', 'decimal_places' => '2'), 'ILS' => array('title' => 'Israeli New Shekel', 'code' => 'ILS', 'symbol_left' => '₪', 'symbol_right' => '', 'decimal_point' => '.', 'thousands_point' => ',', 'decimal_places' => '2'), 'INR' => array('title' => 'Indian Rupee', 'code' => 'INR', 'symbol_left' => 'Rs.', 'symbol_right' => '', 'decimal_point' => '.', 'thousands_point' => ',', 'decimal_places' => '2'), 'MYR' => array('title' => 'Malaysian Ringgit', 'code' => 'MYR', 'symbol_left' => 'RM', 'symbol_right' => '', 'decimal_point' => '.', 'thousands_point' => ',', 'decimal_places' => '2'), 'PHP' => array('title' => 'Philippine Peso', 'code' => 'PHP', 'symbol_left' => 'Php', 'symbol_right' => '', 'decimal_point' => '.', 'thousands_point' => ',', 'decimal_places' => '2'), 'PLN' => array('title' => 'Polish Zloty', 'code' => 'PLN', 'symbol_left' => '', 'symbol_right' => 'zł', 'decimal_point' => ',', 'thousands_point' => '.', 'decimal_places' => '2'), 'THB' => array('title' => 'Thai Baht', 'code' => 'THB', 'symbol_left' => '', 'symbol_right' => '฿', 'decimal_point' => '.', 'thousands_point' => ',', 'decimal_places' => '2'), 'TWD' => array('title' => 'Taiwan New Dollar', 'code' => 'TWD', 'symbol_left' => 'NT$', 'symbol_right' => '', 'decimal_point' => '.', 'thousands_point' => ',', 'decimal_places' => '2'));
$currency_select_array = array(array('id' => '', 'text' => OSCOM::getDef('text_info_common_currencies')));
foreach ($currency_select as $cs) {
if (!isset($currencies->currencies[$cs['code']])) {
$currency_select_array[] = array('id' => $cs['code'], 'text' => '[' . $cs['code'] . '] ' . $cs['title']);
}
示例9:
if (isset($_POST['zone_id'])) {
$zone_id = HTML::sanitize($_POST['zone_id']);
} else {
$zone_id = false;
}
}
$country = HTML::sanitize($_POST['country']);
$telephone = HTML::sanitize($_POST['telephone']);
$fax = HTML::sanitize($_POST['fax']);
if (isset($_POST['newsletter'])) {
$newsletter = HTML::sanitize($_POST['newsletter']);
} else {
$newsletter = false;
}
$password = HTML::sanitize($_POST['password']);
$confirmation = HTML::sanitize($_POST['confirmation']);
$error = false;
if (ACCOUNT_GENDER == 'true') {
if ($gender != 'm' && $gender != 'f') {
$error = true;
$messageStack->add('create_account', ENTRY_GENDER_ERROR);
}
}
if (strlen($firstname) < ENTRY_FIRST_NAME_MIN_LENGTH) {
$error = true;
$messageStack->add('create_account', ENTRY_FIRST_NAME_ERROR);
}
if (strlen($lastname) < ENTRY_LAST_NAME_MIN_LENGTH) {
$error = true;
$messageStack->add('create_account', ENTRY_LAST_NAME_ERROR);
}
示例10: get
require 'includes/application_top.php';
if (!isset($_SESSION['customer_id'])) {
OSCOM::redirect('login.php', '', 'SSL');
}
if (MODULE_CONTENT_ACCOUNT_SET_PASSWORD_ALLOW_PASSWORD != 'True') {
OSCOM::redirect('account.php', '', 'SSL');
}
$Qcustomer = $OSCOM_Db - get('customers', 'customers_password', ['customers_id' => $_SESSION['customer_id']]);
if (!empty($Qcustomer->value('customers_password'))) {
OSCOM::redirect('account.php', '', 'SSL');
}
// needs to be included earlier to set the success message in the messageStack
require DIR_WS_LANGUAGES . $_SESSION['language'] . '/modules/content/account/cm_account_set_password.php';
if (isset($_POST['action']) && $_POST['action'] == 'process' && isset($_POST['formid']) && $_POST['formid'] == $_SESSION['sessiontoken']) {
$password_new = HTML::sanitize($_POST['password_new']);
$password_confirmation = HTML::sanitize($_POST['password_confirmation']);
$error = false;
if (strlen($password_new) < ENTRY_PASSWORD_MIN_LENGTH) {
$error = true;
$messageStack->add('account_password', ENTRY_PASSWORD_NEW_ERROR);
} elseif ($password_new != $password_confirmation) {
$error = true;
$messageStack->add('account_password', ENTRY_PASSWORD_NEW_ERROR_NOT_MATCHING);
}
if ($error == false) {
$OSCOM_Db->save('customers', ['customers_password' => tep_encrypt_password($password_new)], ['customers_id' => $_SESSION['customer_id']]);
$OSCOM_Db->save('customers_info', ['customers_info_date_account_last_modified' => 'now()'], ['customers_info_id' => $_SESSION['customer_id']]);
$messageStack->add_session('account', MODULE_CONTENT_ACCOUNT_SET_PASSWORD_SUCCESS_PASSWORD_SET, 'success');
OSCOM::redirect('account.php', '', 'SSL');
}
}
示例11: currencies
<?php
/**
* osCommerce Online Merchant
*
* @copyright (c) 2016 osCommerce; https://www.oscommerce.com
* @license MIT; https://www.oscommerce.com/license/mit.txt
*/
use OSC\OM\HTML;
use OSC\OM\OSCOM;
require 'includes/application_top.php';
require 'includes/classes/currencies.php';
$currencies = new currencies();
$oID = HTML::sanitize($_GET['oID']);
include 'includes/classes/order.php';
$order = new order($oID);
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html <?php
echo OSCOM::getDef('html_params');
?>
>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=<?php
echo OSCOM::getDef('charset');
?>
">
<title><?php
echo OSCOM::getDef('title', ['store_name' => STORE_NAME]);
?>
</title>
示例12: resetZoneSelected
case 'insert_zone':
$geo_zone_name = HTML::sanitize($_POST['geo_zone_name']);
$geo_zone_description = HTML::sanitize($_POST['geo_zone_description']);
$OSCOM_Db->save('geo_zones', ['geo_zone_name' => $geo_zone_name, 'geo_zone_description' => $geo_zone_description, 'date_added' => 'now()']);
$new_zone_id = $OSCOM_Db->lastInsertId();
OSCOM::redirect(FILENAME_GEO_ZONES, 'zpage=' . $_GET['zpage'] . '&zID=' . $new_zone_id);
break;
case 'save_zone':
$zID = HTML::sanitize($_GET['zID']);
$geo_zone_name = HTML::sanitize($_POST['geo_zone_name']);
$geo_zone_description = HTML::sanitize($_POST['geo_zone_description']);
$OSCOM_Db->save('geo_zones', ['geo_zone_name' => $geo_zone_name, 'geo_zone_description' => $geo_zone_description, 'last_modified' => 'now()'], ['geo_zone_id' => (int) $zID]);
OSCOM::redirect(FILENAME_GEO_ZONES, 'zpage=' . $_GET['zpage'] . '&zID=' . $_GET['zID']);
break;
case 'deleteconfirm_zone':
$zID = HTML::sanitize($_GET['zID']);
$OSCOM_Db->delete('geo_zones', ['geo_zone_id' => (int) $zID]);
$OSCOM_Db->delete('zones_to_geo_zones', ['geo_zone_id' => (int) $zID]);
OSCOM::redirect(FILENAME_GEO_ZONES, 'zpage=' . $_GET['zpage']);
break;
}
}
require $oscTemplate->getFile('template_top.php');
if (isset($_GET['zID']) && ($saction == 'edit' || $saction == 'new')) {
?>
<script type="text/javascript"><!--
function resetZoneSelected(theForm) {
if (theForm.state.value != '') {
theForm.zone_id.selectedIndex = '0';
if (theForm.zone_id.options.length > 0) {
theForm.state.value = '<?php
示例13:
$countries_iso_code_3 = HTML::sanitize($_POST['countries_iso_code_3']);
$address_format_id = HTML::sanitize($_POST['address_format_id']);
$OSCOM_Db->save('countries', ['countries_name' => $countries_name, 'countries_iso_code_2' => $countries_iso_code_2, 'countries_iso_code_3' => $countries_iso_code_3, 'address_format_id' => (int) $address_format_id]);
OSCOM::redirect(FILENAME_COUNTRIES);
break;
case 'save':
$countries_id = HTML::sanitize($_GET['cID']);
$countries_name = HTML::sanitize($_POST['countries_name']);
$countries_iso_code_2 = HTML::sanitize($_POST['countries_iso_code_2']);
$countries_iso_code_3 = HTML::sanitize($_POST['countries_iso_code_3']);
$address_format_id = HTML::sanitize($_POST['address_format_id']);
$OSCOM_Db->save('countries', ['countries_name' => $countries_name, 'countries_iso_code_2' => $countries_iso_code_2, 'countries_iso_code_3' => $countries_iso_code_3, 'address_format_id' => (int) $address_format_id], ['countries_id' => (int) $countries_id]);
OSCOM::redirect(FILENAME_COUNTRIES, 'page=' . $_GET['page'] . '&cID=' . $countries_id);
break;
case 'deleteconfirm':
$countries_id = HTML::sanitize($_GET['cID']);
$OSCOM_Db->delete('countries', ['countries_id' => (int) $countries_id]);
OSCOM::redirect(FILENAME_COUNTRIES, 'page=' . $_GET['page']);
break;
}
}
require $oscTemplate->getFile('template_top.php');
?>
<table border="0" width="100%" cellspacing="0" cellpadding="2">
<tr>
<td><table border="0" width="100%" cellspacing="0" cellpadding="0">
<tr>
<td class="pageHeading"><?php
echo OSCOM::getDef('heading_title');
?>
示例14: prepareInput
public static function prepareInput($string)
{
if (is_string($string)) {
return HTML::sanitize($string);
} elseif (is_array($string)) {
foreach ($string as $k => $v) {
$string[$k] = static::prepareInput($v);
}
return $string;
} else {
return $string;
}
}
示例15: now
*/
use OSC\OM\HTML;
use OSC\OM\HTTP;
use OSC\OM\OSCOM;
require 'includes/application_top.php';
switch ($_GET['action']) {
case 'banner':
$Qbanner = $OSCOM_Db->get('banners', 'banners_url', ['banners_id' => $_GET['goto']]);
if ($Qbanner->fetch() !== false) {
tep_update_banner_click_count($_GET['goto']);
HTTP::redirect($Qbanner->value('banners_url'));
}
break;
case 'url':
if (isset($_GET['goto']) && tep_not_null($_GET['goto'])) {
$Qcheck = $OSCOM_Db->get('products_description', 'products_url', ['products_url' => HTML::sanitize($_GET['goto'])], null, 1);
if ($Qcheck->fetch() !== false) {
HTTP::redirect('http://' . $Qcheck->value('products_url'));
}
}
break;
case 'manufacturer':
if (isset($_GET['manufacturers_id']) && is_numeric($_GET['manufacturers_id'])) {
$Qmanufacturer = $OSCOM_Db->get('manufacturers_info', 'manufacturers_url', ['manufacturers_id' => $_GET['manufacturers_id'], 'languages_id' => $OSCOM_Language->getId()]);
if ($Qmanufacturer->fetch() !== false) {
// url exists in selected language
if (!empty($Qmanufacturer->value('manufacturers_url'))) {
$Qupdate = $OSCOM_Db->prepare('update :table_manufacturers_info set url_clicked = url_clicked+1, date_last_click = now() where manufacturers_id = :manufacturers_id and languages_id = :languages_id');
$Qupdate->bindInt(':manufacturers_id', $_GET['manufacturers_id']);
$Qupdate->bindInt(':languages_id', $OSCOM_Language->getId());
$Qupdate->execute();