• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP stripslashes函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中stripslashes函数的典型用法代码示例。如果您正苦于以下问题:PHP stripslashes函数的具体用法?PHP stripslashes怎么用?PHP stripslashes使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了stripslashes函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: saveFile

 public function saveFile($data)
 {
     $post = (object) $data;
     self::setMapping();
     // recupera variáveis
     $fileData = $_FILES["filedata"];
     $fileName = $fileData["name"];
     $fileType = $fileData["type"];
     $tempName = $fileData["tmp_name"];
     $dataType = self::$mapping[$fileType];
     if (!is_uploaded_file($tempName)) {
         self::$response->success = false;
         self::$response->text = "O arquivo não foi enviado com sucesso. Erro de sistema: {$fileData['error']}.";
         return json_encode(self::$response);
     }
     if (!array_key_exists($fileType, self::$mapping)) {
         return '{"success":false,"records":0,"error":2,"root":[],"text":"Tipo de arquivo não mapeado para esta operação!"}';
     }
     // comprime arquivo temporário
     if ($dataType === true) {
         self::sizeFile();
         self::workSize($tempName);
     }
     $tempData = base64_encode(file_get_contents($tempName));
     // recupera extensão do arquivo
     $fileExtension = strtoupper(strrchr($fileName, "."));
     $fileExtension = str_replace(".", "", $fileExtension);
     $fileInfo = array("fileType" => $fileType, "fileExtension" => $fileExtension, "dataType" => $dataType, "fileName" => $fileName);
     $fileInfo = stripslashes(json_encode($fileInfo));
     $affectedRows = $this->exec("update {$post->tableName} set filedata = '{$tempData}', fileinfo = '{$fileInfo}' where id = {$post->id}");
     unlink($tempName);
     return $affectedRows;
 }
开发者ID:edilsonspalma,项目名称:AppAnest,代码行数:33,代码来源:TfileSerialize.php


示例2: validate

 function validate($data = null)
 {
     $this->errors = array();
     if (!empty($data)) {
         $data = empty($data[$this->model]) ? $data : $data[$this->model];
         foreach ($data as $dkey => $dval) {
             $this->data->{$dkey} = stripslashes($dval);
         }
         extract($data, EXTR_SKIP);
         if (empty($gallery_id)) {
             $this->errors['title'] = __('No gallery was specified', $this->plugin_name);
         }
         if (empty($slide_id)) {
             $this->errors['title'] = __('No slide was specified', $this->plugin_name);
         }
         if (empty($this->errors)) {
             if ($galleryslide = $this->find(array('gallery_id' => $gallery_id, 'slide_id' => $slide_id))) {
                 $this->data->id = $galleryslide->id;
             }
         }
     } else {
         $this->errors[] = __('No data was posted', $this->plugin_name);
     }
     return $this->errors;
 }
开发者ID:networksoft,项目名称:sharesystem.co,代码行数:25,代码来源:galleryslides.php


示例3: autoRun

 public function autoRun()
 {
     if (!eregi('redirecionar=', $_SERVER['QUERY_STRING']) && !$this->system->input['redirecionar']) {
         $this->redir = base64_encode('index.php?' . $_SERVER['QUERY_STRING']);
     } else {
         $this->redir = stripslashes($this->system->input['redirecionar']);
     }
     switch ($this->system->input['do']) {
         case 'nova':
             $this->doEdicao();
             break;
         case 'editar':
             $this->doEdicao();
             break;
         case 'buscar':
             $this->doListar();
             break;
         case 'listar':
             $this->doListar();
             break;
         case 'apagar':
             $this->doDeletar();
             break;
         default:
             $this->pagina404();
             break;
     }
 }
开发者ID:eltonsarmento,项目名称:CursosIAG,代码行数:28,代码来源:notificacoesadmin.php


示例4: inp

 function inp($data)
 {
     $data = trim($data);
     $data = stripslashes($data);
     $data = htmlspecialchars($data);
     return $data;
 }
开发者ID:BarFox,项目名称:gitDir,代码行数:7,代码来源:Accountinfo.php


示例5: prepare

 protected function prepare()
 {
     include ABSPATH . 'wp-admin/includes/class-wp-upgrader.php';
     try {
         $this->api = $api = Sputnik::get_plugin($this->id);
     } catch (Exception $e) {
         status_header(500);
         $this->header();
         echo '<p>' . $e->getMessage() . '</p>';
         $this->footer();
         return;
     }
     if (!Sputnik::is_purchased($this->api->slug)) {
         wp_redirect(Sputnik_Admin::build_url(array('buy' => $this->id)));
         die;
     }
     if (!current_user_can('install_plugins')) {
         wp_die(__('You do not have sufficient permissions to install plugins for this site.', 'sputnik'));
     }
     check_admin_referer($this->nonce_prefix . $this->api->slug);
     include_once ABSPATH . 'wp-admin/includes/plugin-install.php';
     $title = sprintf($this->title_format, $this->api->name . ' ' . $this->api->version);
     $nonce = $this->nonce_prefix . $this->id;
     $url = 'update.php?action=install-plugin&plugin=' . $this->id;
     if (isset($_GET['from'])) {
         $url .= '&from=' . urlencode(stripslashes($_GET['from']));
     }
     $type = 'web';
     //Install plugin type, From Web or an Upload.
     if ($this->api->is_theme) {
         $this->upgrader = new Sputnik_ThemeUpgrader(new Sputnik_View_Install_Skin(compact('title', 'url', 'nonce', 'plugin', 'api')));
     } else {
         $this->upgrader = new Sputnik_Upgrader(new Sputnik_View_Install_Skin(compact('title', 'url', 'nonce', 'plugin', 'api')));
     }
 }
开发者ID:dreamteam111,项目名称:dreamteam,代码行数:35,代码来源:Install.php


示例6: PMA_transformation_getOptions

/**
 * Set of functions used with the relation and pdf feature
 */
function PMA_transformation_getOptions($string)
{
    $transform_options = array();
    /* Parse options */
    for ($nextToken = strtok($string, ','); $nextToken !== false; $nextToken = strtok(',')) {
        $trimmed = trim($nextToken);
        if ($trimmed[0] == '\'' && $trimmed[strlen($trimmed) - 1] == '\'') {
            $transform_options[] = substr($trimmed, 1, -1);
        } else {
            if ($trimmed[0] == '\'') {
                $trimmed = ltrim($nextToken);
                while ($nextToken !== false) {
                    $nextToken = strtok(',');
                    $trimmed .= $nextToken;
                    $rtrimmed = rtrim($trimmed);
                    if ($rtrimmed[strlen($rtrimmed) - 1] == '\'') {
                        break;
                    }
                }
                $transform_options[] = substr($rtrimmed, 1, -1);
            } else {
                $transform_options[] = $nextToken;
            }
        }
    }
    // strip possible slashes to behave like documentation says
    $result = array();
    foreach ($transform_options as $val) {
        $result[] = stripslashes($val);
    }
    return $result;
}
开发者ID:johangas,项目名称:moped,代码行数:35,代码来源:transformations.lib.php


示例7: stripStr

function stripStr($str)
{
    if (get_magic_quotes_gpc()) {
        $str = stripslashes($str);
    }
    return addslashes(htmlspecialchars($str, ENT_QUOTES, 'UTF-8'));
}
开发者ID:xujun10110,项目名称:BlueLotus_XSSReceiver,代码行数:7,代码来源:functions.php


示例8: contrexx_stripslashes

/**
 * Wrapper for stripslashes() that complies with gpc_magic_quotes
 * @param   string    $string
 * @return  string
 */
function contrexx_stripslashes($string)
{
    if (CONTREXX_ESCAPE_GPC) {
        return stripslashes($string);
    }
    return $string;
}
开发者ID:Niggu,项目名称:cloudrexx,代码行数:12,代码来源:validator.inc.php


示例9: sanitize

 private static function sanitize($value)
 {
     $value = trim($value);
     $value = stripslashes($value);
     $value = htmlspecialchars($value);
     return $value;
 }
开发者ID:mikeschap,项目名称:WithTheClothesOnYourBack,代码行数:7,代码来源:MapDatabase.class.php


示例10: metaform

 public function metaform()
 {
     $value = $this->getValue();
     $data = $this->getData();
     $attributes = $this->getAttr();
     $form = array();
     $options = array();
     if (isset($data['options'])) {
         if (!is_admin()) {
             $new_options = array();
             foreach ($data['options'] as $key => $option) {
                 $tmp = $option['value'];
                 $option['value'] = $option['types-value'];
                 $option['types-value'] = $tmp;
                 $new_options[$key] = $option;
                 unset($tmp);
             }
             $data['options'] = $new_options;
         }
         foreach ($data['options'] as $key => $option) {
             $one_option_data = array('#value' => $option['value'], '#title' => stripslashes($option['title']));
             /**
              * add default value if needed
              * issue: frontend, multiforms CRED
              */
             //                if (array_key_exists('types-value', $option)) {
             //                    $one_option_data['#types-value'] = $option['types-value'];
             //                }
             $options[] = $one_option_data;
         }
     }
     /**
      * for user fields we reset title and description to avoid double
      * display
      */
     $title = $this->getTitle();
     if (empty($title)) {
         $title = $this->getTitle(true);
     }
     $options = apply_filters('wpt_field_options', $options, $title, 'select');
     /**
      * default_value
      */
     if (!empty($value) || $value == '0') {
         $data['default_value'] = $value;
     }
     $is_multiselect = array_key_exists('multiple', $attributes) && 'multiple' == $attributes['multiple'];
     $default_value = isset($data['default_value']) ? $data['default_value'] : null;
     //Fix https://icanlocalize.basecamphq.com/projects/7393061-toolset/todo_items/189219391/comments
     if ($is_multiselect) {
         $default_value = new RecursiveIteratorIterator(new RecursiveArrayIterator($default_value));
         $default_value = iterator_to_array($default_value, false);
     }
     //##############################################################################################
     /**
      * metaform
      */
     $form[] = array('#type' => 'select', '#title' => $this->getTitle(), '#description' => $this->getDescription(), '#name' => $this->getName(), '#options' => $options, '#default_value' => $default_value, '#multiple' => $is_multiselect, '#validate' => $this->getValidationData(), '#class' => 'form-inline', '#repetitive' => $this->isRepetitive());
     return $form;
 }
开发者ID:zoran180,项目名称:wp_szf,代码行数:60,代码来源:class.select.php


示例11: load_settings

function load_settings()
{
    global $system__options_general, $system__options_defaults;
    $query = "SELECT * FROM " . table('options') . "\n    WHERE option_type='general' OR option_type='default'";
    $result = or_query($query);
    while ($line = pdo_fetch_assoc($result)) {
        $settings[$line['option_name']] = stripslashes($line['option_value']);
    }
    foreach ($system__options_general as $option) {
        if (isset($option['type']) && ($option['type'] == 'line' || $option['type'] == 'comment')) {
        } else {
            if (!isset($settings[$option['option_name']])) {
                $settings[$option['option_name']] = $option['default_value'];
            }
        }
    }
    foreach ($system__options_defaults as $option) {
        if (isset($option['type']) && ($option['type'] == 'line' || $option['type'] == 'comment')) {
        } else {
            if (!isset($settings[$option['option_name']])) {
                $settings[$option['option_name']] = $option['default_value'];
            }
        }
    }
    return $settings;
}
开发者ID:danorama,项目名称:orsee,代码行数:26,代码来源:options.php


示例12: strips

 public static function strips($data)
 {
     foreach ($data as $i => $v) {
         $data[$i] = stripslashes($v);
     }
     return $data;
 }
开发者ID:Brunoalves3,项目名称:bruno,代码行数:7,代码来源:Validation.php


示例13: mres

function mres($input)
{
    if (get_magic_quotes_gpc()) {
        $input = stripslashes($input);
    }
    return mysql_real_escape_string($input);
}
开发者ID:sophanith1,项目名称:Testing,代码行数:7,代码来源:helper.php


示例14: sendMessage

 function sendMessage($form, $to, $subject, $body, $avatar = false, $allow_html = true)
 {
     if ($allow_html) {
         $this->header = $subject;
         $this->m_text = $body;
     } else {
         $this->header = stripslashes(htmlspecialchars($subject));
         $this->m_text = stripslashes(htmlspecialchars($body));
     }
     $this->send_date = date("Y-m-d H:i:s");
     $this->author_id = $form;
     $this->recipient_id = $to;
     if (!$avatar) {
         $user = new UserModel();
         $user->load($from);
         $this->avatar_id = $user->getUserAvatar($user->id);
         $this->avatar_id = $this->avatar_id['id'];
     } else {
         $this->avatar_id = $avatar;
     }
     $this->is_read = 0;
     $this->is_deleted = 0;
     $messageId = $this->save();
     return $messageId;
 }
开发者ID:amanai,项目名称:next24,代码行数:25,代码来源:MessagesModel.php


示例15: replace_input

function replace_input($input)
{
    $output = stripslashes($input);
    $output = filter_var($output, FILTER_SANITIZE_SPECIAL_CHARS);
    $output = trim($output, "/");
    return $output;
}
开发者ID:kelsh,项目名称:classic,代码行数:7,代码来源:include.php


示例16: fetchMethodForm

 function fetchMethodForm($uid, $step, $update = false)
 {
     global $task;
     switch ($step) {
         case 2:
             $lists = array();
             $lists['action'] = _taskLink($task, $uid, array('step' => $step + 1), false);
             return HTML_DMUploadMethod::linkFileForm($lists);
             break;
         case 3:
             $url = stripslashes(JRequest::getString('url', 'http://'));
             $err = DMUploadMethod::linkFileProcess($uid, $step, $url);
             if ($err['_error']) {
                 _returnTo($task, $err['_errmsg'], '', array("method" => 'link', "step" => $step - 1, "localfile" => '', "url" => DOCMAN_Utils::safeEncodeURL($url)));
             }
             $uploaded = DOCMAN_Utils::safeEncodeURL(_DM_DOCUMENT_LINK . $url);
             $catid = $update ? 0 : $uid;
             $docid = $update ? $uid : 0;
             $session = JFactory::getSession();
             $session->set('docman.dmfilename', _DM_DOCUMENT_LINK);
             $session->set('docman.document_url', $url);
             return fetchEditDocumentForm($docid, $uploaded, $catid);
             break;
         default:
             break;
     }
     return true;
 }
开发者ID:janssit,项目名称:www.ondernemenddiest.be,代码行数:28,代码来源:upload.link.php


示例17: mysql_fix_string

function mysql_fix_string($conn, $string)
{
    if (get_magic_quotes_gpc()) {
        $string = stripslashes($string);
    }
    return $conn->real_escape_string($string);
}
开发者ID:Truelj,项目名称:Start_web,代码行数:7,代码来源:preventInjectionAttacks.php


示例18: call_order

 function call_order($lng, $para, $filename = 'order', $outHTML = null)
 {
     $para = $this->fun->array_getvalue($para);
     $lngpack = $lng ? $lng : $this->CON['is_lancode'];
     $lng = $lng == 'big5' ? $this->CON['is_lancode'] : $lng;
     include admin_ROOT . 'datacache/' . $lng . '_pack.php';
     $cartid = $this->fun->eccode($this->fun->accept('ecisp_order_list', 'C'), 'DECODE', db_pscode);
     $cartid = stripslashes(htmlspecialchars_decode($cartid));
     $uncartid = !empty($cartid) ? unserialize($cartid) : null;
     $total = $this->fun->eccode($this->fun->accept('ecisp_order_productmoney', 'C'), 'DECODE', db_pscode);
     $total = empty($total) ? 0 : $total;
     $buylink = $this->get_link('order', array(), $lngpack);
     $this->pagetemplate->assign('lngpack', $LANPACK);
     $this->pagetemplate->assign('buylink', $buylink);
     $this->pagetemplate->assign('ordertotal', number_format($total, 2));
     $this->pagetemplate->assign('total', $total);
     $this->pagetemplate->assign('uncartid', count($uncartid));
     $this->pagetemplate->assign('cartid', $cartid);
     if (!empty($outHTML)) {
         $output = $this->pagetemplate->fetch(null, null, $outHTML);
     } else {
         $output = $this->pagetemplate->fetch($lng . '/lib/' . $filename);
     }
     return $output;
 }
开发者ID:qiuai,项目名称:esp_cms,代码行数:25,代码来源:lib_order.php


示例19: Net_DNS_RR_TXT

 function Net_DNS_RR_TXT(&$rro, $data, $offset = '')
 {
     $this->name = $rro->name;
     $this->type = $rro->type;
     $this->class = $rro->class;
     $this->ttl = $rro->ttl;
     $this->rdlength = $rro->rdlength;
     $this->rdata = $rro->rdata;
     if ($offset) {
         if ($this->rdlength > 0) {
             $maxoffset = $this->rdlength + $offset;
             while ($maxoffset > $offset) {
                 list($text, $offset) = Net_DNS_Packet::label_extract($data, $offset);
                 $this->text[] = $text;
             }
         }
     } else {
         $data = str_replace('\\\\', chr(1) . chr(1), $data);
         /* disguise escaped backslash */
         $data = str_replace('\\"', chr(2) . chr(2), $data);
         /* disguise \" */
         ereg('("[^"]*"|[^ \\t]*)[ \\t]*$', $data, $regs);
         $regs[1] = str_replace(chr(2) . chr(2), '\\"', $regs[1]);
         $regs[1] = str_replace(chr(1) . chr(1), '\\\\', $regs[1]);
         $regs[1] = stripslashes($regs[1]);
         $this->text = $regs[1];
     }
 }
开发者ID:ookwudili,项目名称:chisimba,代码行数:28,代码来源:TXT.php


示例20: sanitizeString

function sanitizeString($_db, $str)
{
    $str = strip_tags($str);
    $str = htmlentities($str);
    $str = stripslashes($str);
    return mysqli_real_escape_string($_db, $str);
}
开发者ID:NickGamarra,项目名称:GameChangers,代码行数:7,代码来源:functions.php



注:本文中的stripslashes函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP stripslashesRecursive函数代码示例发布时间:2022-05-23
下一篇:
PHP stripslash函数代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap