本文整理汇总了PHP中doStrip函数的典型用法代码示例。如果您正苦于以下问题:PHP doStrip函数的具体用法?PHP doStrip怎么用?PHP doStrip使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了doStrip函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: cs
function cs($thing)
{
if (isset($_COOKIE[$thing])) {
if (get_magic_quotes_gpc()) {
return doStrip($_COOKIE[$thing]);
} else {
return $_COOKIE[$thing];
}
}
return '';
}
示例2: stripPost
function stripPost()
{
if (isset($_POST)) {
if (get_magic_quotes_gpc() == 1) {
return doStrip($_POST);
} else {
return $_POST;
}
}
return '';
}
示例3: link_save
function link_save($vars)
{
global $txpcfg, $txpac;
$varray = gpsa($vars);
if ($txpac['textile_links']) {
include_once $txpcfg['txpath'] . '/lib/classTextile.php';
$textile = new Textile();
$varray['linkname'] = $textile->TextileThis($varray['linkname'], '', 1);
$varray['description'] = $textile->TextileThis($varray['description'], 1);
}
extract(doSlash($varray));
if (!$linksort) {
$linksort = $linkname;
}
$rs = safe_update("txp_link", "category = '{$category}',\n\t\t\turl = '" . trim($url) . "',\n\t\t\tlinkname = '{$linkname}',\n\t\t\tlinksort = '{$linksort}',\n\t\t\tdescription = '{$description}'", "id = '{$id}'");
if ($rs) {
link_edit(messenger('link', doStrip($linkname), 'saved'));
}
}
示例4: gs
function gs($name, $default = '')
{
if (isset($_GET[$thing])) {
if (MAGIC_QUOTES_GPC) {
return doStrip($_GET[$thing]);
} else {
return $_GET[$thing];
}
}
return $default;
}
示例5: parsePostedCSS
function parsePostedCSS()
{
$post = MAGIC_QUOTES_GPC ? doStrip($_POST) : $_POST;
foreach ($post as $a => $b) {
if (preg_match("/^\\d+\$/", $a)) {
$selector = $b;
}
if (preg_match("/^\\d+-\\d+(?:p|v)\$/", $a)) {
if (strstr($a, 'p')) {
$property = $b;
} else {
if (trim($property) && trim($selector)) {
$out[$selector][$property] = $b;
}
}
}
}
return isset($out) ? $out : array();
}
示例6: check_privs
/*
This is Textpattern
Copyright 2004 by Dean Allen
www.textpattern.com
All rights reserved
Use of this software indicates acceptance of the Textpattern license agreement
*/
//-------------------------------------------------------------
check_privs(1, 2);
$step = ps('step');
if ($step == 'save') {
$prefnames = safe_column("name", "txp_prefs", "prefs_id='1'");
$post = get_magic_quotes_gpc() ? doStrip($_POST) : $_POST;
$post = doSlash($post);
foreach ($prefnames as $prefname) {
if (isset($post[$prefname])) {
if ($prefname == 'lastmod') {
safe_update("txp_prefs", "val=now()", "name='lastmod'");
} else {
if ($prefname == 'siteurl') {
$post[$prefname] = str_replace("http://", '', $post[$prefname]);
}
safe_update("txp_prefs", "val = '" . $post[$prefname] . "'", "name = '{$prefname}' and prefs_id ='1'");
}
}
}
$message = gTxt('preferences_saved');
}
示例7: yab_shop_clean_input
function yab_shop_clean_input($input, $modus = 'output')
{
if (empty($input)) {
$cleaned = $input;
}
if (is_array($input)) {
foreach ($input as $key => $val) {
$cleaned[$key] = yab_shop_clean_input($val);
}
} else {
$cleaned = str_replace(array('=', '&', '"', '\'', '<', '>', ';', '\\'), '', $input);
if ($modus != 'output') {
$cleaned = doSlash($cleaned);
} else {
$cleaned = doStrip($cleaned);
}
}
return $cleaned;
}
示例8: link_save
function link_save()
{
global $txpcfg, $vars;
$varray = gpsa($vars);
extract(doSlash($varray));
if (!$linksort) {
$linksort = $linkname;
}
$id = assert_int($id);
$rs = safe_update("txp_link", "category = '{$category}',\n\t\t\turl = '" . trim($url) . "',\n\t\t\tlinkname = '{$linkname}',\n\t\t\tlinksort = '{$linksort}',\n\t\t\tdescription = '{$description}'", "id = {$id}");
if ($rs) {
update_lastmod();
$message = gTxt('link_updated', array('{name}' => doStrip($linkname)));
link_edit($message);
}
}
示例9: link_save
function link_save()
{
global $txpcfg, $prefs, $vars;
$varray = gpsa($vars);
if ($prefs['textile_links']) {
include_once txpath . '/lib/classTextile.php';
$textile = new Textile();
$varray['linkname'] = $textile->TextileThis($varray['linkname'], '', 1);
$varray['description'] = $textile->TextileThis($varray['description'], 1);
}
extract(doSlash($varray));
if (!$linksort) {
$linksort = $linkname;
}
$id = assert_int($id);
$rs = safe_update("txp_link", "category = '{$category}',\n\t\t\turl = '" . trim($url) . "',\n\t\t\tlinkname = '{$linkname}',\n\t\t\tlinksort = '{$linksort}',\n\t\t\tdescription = '{$description}'", "id = {$id}");
if ($rs) {
update_lastmod();
$message = gTxt('link_updated', array('{name}' => doStrip($linkname)));
link_edit($message);
}
}
示例10: cat_event_category_save
/**
* Saves a category from HTTP POST data.
*
* @param string $event Type of category
* @param string $table Affected database table
*/
function cat_event_category_save($event, $table_name)
{
extract(doSlash(array_map('assert_string', psa(array('id', 'name', 'description', 'old_name', 'parent', 'title')))));
$id = assert_int($id);
$rawname = $name;
$name = sanitizeForUrl($rawname);
// Make sure the name is valid.
if (!$name) {
$message = array(gTxt($event . '_category_invalid', array('{name}' => $rawname)), E_ERROR);
return cat_event_category_edit($event, $message);
}
// Don't allow rename to clobber an existing category.
$existing_id = safe_field("id", 'txp_category', "name = '{$name}' AND type = '{$event}'");
if ($existing_id and $existing_id != $id) {
$message = array(gTxt($event . '_category_already_exists', array('{name}' => $name)), E_ERROR);
return cat_event_category_edit($event, $message);
}
// TODO: validate parent?
$parent = $parent ? $parent : 'root';
$message = array(gTxt('category_save_failed'), E_ERROR);
if (safe_update('txp_category', "name = '{$name}', parent = '{$parent}', title = '{$title}', description = '{$description}'", "id = {$id}") && safe_update('txp_category', "parent = '{$name}'", "parent = '{$old_name}' AND type = '{$event}'")) {
rebuild_tree_full($event);
if ($event == 'article') {
if (safe_update('textpattern', "Category1 = '{$name}'", "Category1 = '{$old_name}'") && safe_update('textpattern', "Category2 = '{$name}'", "Category2 = '{$old_name}'")) {
$message = gTxt($event . '_category_updated', array('{name}' => doStrip($name)));
}
} else {
if (safe_update($table_name, "category = '{$name}'", "category = '{$old_name}'")) {
$message = gTxt($event . '_category_updated', array('{name}' => doStrip($name)));
}
}
}
cat_category_list($message);
}
示例11: cs
function cs($thing, $default = '')
{
if (isset($_COOKIE[$thing])) {
if (MAGIC_QUOTES_GPC) {
return doStrip($_COOKIE[$thing]);
} else {
return $_COOKIE[$thing];
}
}
return $default;
}
示例12: _permlinkurl
function _permlinkurl($article_array, $type = PERMLINKURL, $pl_index = NULL)
{
global $pretext, $prefs, $production_status;
if ($type == PAGELINKURL) {
return $this->toggle_custom_url_func('pagelinkurl', $article_array);
}
if (empty($article_array)) {
return;
}
if ($pl_index) {
$pl = $this->get_permlink($pl_index);
} else {
// Get the matched pretext replacement array.
$matched = count($this->matched_permlink) ? $this->matched_permlink : @array_shift(array_slice($this->partial_matches, -1));
if (!isset($pl) && $matched && array_key_exists('id', $matched)) {
// The permlink id is stored in the pretext replacement array, so we can find the permlink.
$pl = $this->get_permlink($matched['permlink_id']);
foreach ($pl['components'] as $pl_c) {
if (in_array($pl_c['type'], array('feed', 'page')) || !$this->check_permlink_conditions($pl, $article_array)) {
unset($pl);
break;
}
}
}
if (!isset($pl)) {
// We have no permlink id so grab the permlink with the highest precedence.
$permlinks = $this->get_all_permlinks(1, array('feed', 'page'));
foreach ($permlinks as $key => $pl) {
if (!$this->check_permlink_conditions($pl, $article_array)) {
unset($permlinks[$key]);
}
}
$pl = array_shift($permlinks);
}
}
$uri = '';
if (is_array($pl) && array_key_exists('components', $pl)) {
extract($article_array);
if (!isset($title)) {
$title = $Title;
}
if (empty($url_title)) {
$url_title = stripSpace($title);
}
if (empty($section)) {
$section = $Section;
}
if (empty($posted)) {
$posted = $Posted;
}
if (empty($authorid)) {
$authorid = @$AuthorID;
}
if (empty($category1)) {
$category1 = @$Category1;
}
if (empty($category2)) {
$category2 = @$Category2;
}
if (empty($thisid)) {
$thisid = $ID;
}
$pl_components = $pl['components'];
// Check to see if there is a title component.
$title = false;
foreach ($pl_components as $pl_c) {
if ($pl_c['type'] == 'title' || $pl_c['type'] == 'id') {
$title = true;
}
}
// If there isn't a title component then we need to append one to the end of the URI
if (!$title && $this->pref('automatically_append_title')) {
$pl_components[] = array('type' => 'title', 'prefix' => '', 'suffix' => '', 'regex' => '', 'text' => '');
}
$uri = rtrim(doStrip(@$pretext['subpath']), '/');
foreach ($pl_components as $pl_c) {
$uri .= '/';
$type = $pl_c['type'];
switch ($type) {
case 'category':
if (!@$pl_c['category']) {
$pl_c['category'] = 1;
}
$primary = 'category' . $pl_c['category'];
$secondary = 'category' . (3 - (int) $pl_c['category']);
$check_context = $this->pref('join_pretext_to_pagelinks') && $this->pref('check_pretext_category_context');
if (!$check_context || ${$primary} == $pretext['c']) {
$uri_c = ${$primary};
} else {
if (!$check_context || ${$secondary} == $pretext['c']) {
$uri_c = ${$secondary};
} else {
if ($this->pref('debug') && in_array($production_status, array('debug', 'testing'))) {
$uri_c = '--INVALID_CATEGORY--';
} else {
unset($uri);
break 2;
}
}
}
//.........这里部分代码省略.........
示例13: edit_post
function edit_post()
{
extract(doSlash(psa(array('name', 'old_name', 'title', 'type'))));
$id = $this->psi('id');
$parent = $this->ps('parent');
if (!$parent) {
$parent = tree_root_id('txp_category', "type='" . doSlash($type) . "'");
}
$name = sanitizeForUrl($name);
// make sure the name is valid
if (!$name) {
$this->_error(gTxt($type . '_category_invalid', array('{name}' => $name)));
return;
}
// don't allow rename to clobber an existing category
if (safe_field('id', 'txp_category', "name = '{$name}' and type = '{$type}' and id != {$id}")) {
$this->_error(gTxt($type . '_category_already_exists', array('{name}' => $name)));
return;
}
safe_update('txp_category', "name = '{$name}', parent = '{$parent}', title = '{$title}'", "id = {$id}");
tree_rebuild_full('txp_category', "type='{$type}'");
if ($type == 'article') {
safe_update('textpattern', "Category1 = '{$name}'", "Category1 = '{$old_name}'");
safe_update('textpattern', "Category2 = '{$name}'", "Category2 = '{$old_name}'");
} elseif ($type == 'link') {
safe_update('txp_link', "category = '{$name}'", "category = '{$old_name}'");
} elseif ($type == 'image') {
safe_update('txp_image', "category = '{$name}'", "category = '{$old_name}'");
} elseif ($type == 'file') {
safe_update('txp_file', "category = '{$name}'", "category = '{$old_name}'");
}
// show a success message and switch back to the list view
$this->_message(gTxt($type . '_category_updated', array('{name}' => doStrip($name))));
$this->_set_view('list');
}
示例14: link_save
function link_save()
{
global $txpcfg, $vars;
$varray = gpsa($vars);
extract(doSlash($varray));
if (!$linksort) {
$linksort = $linkname;
}
$id = assert_int($id);
$rs = safe_update("txp_link", "category = '{$category}',\n\t\t\turl = '" . trim($url) . "',\n\t\t\tlinkname = '{$linkname}',\n\t\t\tlinksort = '{$linksort}',\n\t\t\tdescription = '{$description}'", "id = {$id}");
if ($rs) {
link_edit(messenger('link', doStrip($linkname), 'saved'));
}
}
示例15: image_save
function image_save()
{
global $txp_user;
$varray = array_map('assert_string', gpsa(array('id', 'name', 'category', 'caption', 'alt')));
extract(doSlash($varray));
$id = $varray['id'] = assert_int($id);
$author = fetch('author', 'txp_image', 'id', $id);
if (!has_privs('image.edit') && !($author === $txp_user && has_privs('image.edit.own'))) {
image_list(gTxt('restricted_area'));
return;
}
$constraints = array('category' => new CategoryConstraint(gps('category'), array('type' => 'image')));
callback_event_ref('image_ui', 'validate_save', 0, $varray, $constraints);
$validator = new Validator($constraints);
if ($validator->validate() && safe_update("txp_image", "name = '{$name}',\n category = '{$category}',\n alt = '{$alt}',\n caption = '{$caption}'", "id = {$id}")) {
$message = gTxt('image_updated', array('{name}' => doStrip($name)));
update_lastmod();
} else {
$message = array(gTxt('image_save_failed'), E_ERROR);
}
image_list($message);
}