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

PHP get_magic_quotes_gpc函数代码示例

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

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



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

示例1: pdf_create

function pdf_create($html, $filename = '', $stream = TRUE, $invoice_id, $type)
{
    require_once "dompdf/dompdf_config.inc.php";
    if (get_magic_quotes_gpc()) {
        $html = stripslashes($html);
    }
    $dompdf = new DOMPDF();
    $dompdf->load_html($html);
    $dompdf->set_paper("a4", "portrait");
    $dompdf->render();
    $timestamp = date('YmdGis') . $invoice_id;
    $filename = $timestamp . '.pdf';
    if ($stream) {
        $dompdf->stream($filename);
    } else {
        if ($type == 'invoice') {
            $CI =& get_instance();
            $CI->load->helper('file');
            write_file("invoice/" . $filename, $dompdf->output());
            return $filename;
        } else {
            if ($type == 'salary') {
                $CI =& get_instance();
                $CI->load->helper('file');
                write_file("salary_slip/" . $filename, $dompdf->output());
                return $filename;
            }
        }
    }
}
开发者ID:haseeb736,项目名称:test,代码行数:30,代码来源:dompdf_helper.php


示例2: clean

function clean($value)
{
    if (get_magic_quotes_gpc()) {
        $value = stripslashes($value);
    }
    return trim(mysql_real_escape_string($value));
}
开发者ID:b3b0y,项目名称:exam,代码行数:7,代码来源:check_login.php


示例3: PMA_gpc_extract

function PMA_gpc_extract($array, &$target, $sanitize = TRUE)
{
    if (!is_array($array)) {
        return FALSE;
    }
    $is_magic_quotes = get_magic_quotes_gpc();
    foreach ($array as $key => $value) {
        /**
         * 2005-02-22, rabus:
         *
         * This is just an ugly hotfix to avoid changing internal config
         * parameters.
         *
         * Currently, the following variable names are rejected when found in
         * $_GET or $_POST: cfg, GLOBALS, str* and _*
         */
        if ($sanitize && is_string($key) && ($key == 'cfg' || $key == 'GLOBALS' || substr($key, 0, 3) == 'str' || $key[0] == '_')) {
            continue;
        }
        if (is_array($value)) {
            // there could be a variable coming from a cookie of
            // another application, with the same name as this array
            unset($target[$key]);
            PMA_gpc_extract($value, $target[$key], FALSE);
        } else {
            if ($is_magic_quotes) {
                $target[$key] = stripslashes($value);
            } else {
                $target[$key] = $value;
            }
        }
    }
    return TRUE;
}
开发者ID:mike503,项目名称:phpmyadmin,代码行数:34,代码来源:grab_globals.lib.php


示例4: 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


示例5: 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


示例6: check_input

 public function check_input($value)
 {
     if (get_magic_quotes_gpc()) {
         $value = sqlite_escape_string($value);
     }
     return $value;
 }
开发者ID:shampeak,项目名称:ap.so,代码行数:7,代码来源:SQLite.php


示例7: mres

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


示例8: backslash

function backslash(&$arr, $escape)
{
    $magic_on = get_magic_quotes_gpc();
    if ($escape && !$magic_on) {
        foreach ($arr as $k => $v) {
            switch (gettype($v)) {
                case 'string':
                    $arr[$k] = addslashes($v);
                    break;
                case 'array':
                    backslash($arr[$k], true);
            }
        }
    }
    if (!$escape && $magic_on) {
        foreach ($arr as $k => $v) {
            switch (gettype($v)) {
                case 'string':
                    $arr[$k] = stripslashes($v);
                    break;
                case 'array':
                    backslash($arr[$k], false);
            }
        }
    }
}
开发者ID:BackupTheBerlios,项目名称:freechess-svn,代码行数:26,代码来源:challenge2.php


示例9: set_configuration

 function set_configuration($meeting)
 {
     global $strOmegaPathWriteFailed, $strOmegaNoPath;
     //if(@is_dir($_POST['path'])){
     // test local path for writing
     $fp = fopen($_POST['path'] . "/test.txt", 'w');
     if (!$fp) {
         $GLOBALS['ERROR'] = $strOmegaPathWriteFailed;
     } else {
         fclose($fp);
         unlink($_POST['path'] . "/test.txt");
     }
     mysql_query("LOCK TABLES zeitmessung WRITE");
     $res = mysql_query("SELECT * FROM zeitmessung WHERE xMeeting = {$meeting}");
     if (mysql_errno() > 0) {
         AA_printErrorMsg(mysql_errno() . ": " . mysql_error());
     } else {
         if (!get_magic_quotes_gpc()) {
             $_POST['path'] = addslashes($_POST['path']);
             $_POST['ftppath'] = addslashes($_POST['ftppath']);
             $_POST['sponsor'] = addslashes($_POST['sponsor']);
         }
         if (mysql_num_rows($res) == 0) {
             mysql_query("\r\n\t\t\t\t\t\tINSERT INTO zeitmessung\r\n\t\t\t\t\t\tSET\tOMEGA_Verbindung = '" . $_POST['connection'] . "'\r\n\t\t\t\t\t\t\t, OMEGA_Pfad = '" . $_POST['path'] . "'\r\n\t\t\t\t\t\t\t, OMEGA_Server = '" . $_POST['host'] . "'\r\n\t\t\t\t\t\t\t, OMEGA_Benutzer = '" . $_POST['user'] . "'\r\n\t\t\t\t\t\t\t, OMEGA_Passwort = '" . $_POST['pass'] . "'\r\n\t\t\t\t\t\t\t, OMEGA_Ftppfad = '" . $_POST['ftppath'] . "'\r\n\t\t\t\t\t\t\t, OMEGA_Sponsor = '" . $_POST['sponsor'] . "'\r\n\t\t\t\t\t\t\t, xMeeting = {$meeting}\r\n\t\t\t\t\t\t");
         } else {
             mysql_query("\r\n\t\t\t\t\t\tUPDATE zeitmessung\r\n\t\t\t\t\t\tSET\tOMEGA_Verbindung = '" . $_POST['connection'] . "'\r\n\t\t\t\t\t\t\t, OMEGA_Pfad = '" . $_POST['path'] . "'\r\n\t\t\t\t\t\t\t, OMEGA_Server = '" . $_POST['host'] . "'\r\n\t\t\t\t\t\t\t, OMEGA_Benutzer = '" . $_POST['user'] . "'\r\n\t\t\t\t\t\t\t, OMEGA_Passwort = '" . $_POST['pass'] . "'\r\n\t\t\t\t\t\t\t, OMEGA_Ftppfad = '" . $_POST['ftppath'] . "'\r\n\t\t\t\t\t\t\t, OMEGA_Sponsor = '" . $_POST['sponsor'] . "'\r\n\t\t\t\t\t\tWHERE\txMeeting = {$meeting}\r\n\t\t\t\t\t\t");
         }
     }
     mysql_query("UNLOCK TABLES");
     /*} else {
     			$GLOBALS['ERROR'] = $strOmegaNoPath;
     		}*/
 }
开发者ID:laiello,项目名称:athletica,代码行数:33,代码来源:cl_omega.lib.php


示例10: __construct

 /**
  * Override the default Symphony constructor to initialise the Log, Config
  * and Database objects for installation/update. This allows us to use the
  * normal accessors.
  */
 protected function __construct()
 {
     if (get_magic_quotes_gpc()) {
         General::cleanArray($_SERVER);
         General::cleanArray($_COOKIE);
         General::cleanArray($_GET);
         General::cleanArray($_POST);
     }
     // Include the default Config for installation.
     include INSTALL . '/includes/config_default.php';
     $this->initialiseConfiguration($settings);
     // Initialize date/time
     define_safe('__SYM_DATE_FORMAT__', self::Configuration()->get('date_format', 'region'));
     define_safe('__SYM_TIME_FORMAT__', self::Configuration()->get('time_format', 'region'));
     define_safe('__SYM_DATETIME_FORMAT__', __SYM_DATE_FORMAT__ . self::Configuration()->get('datetime_separator', 'region') . __SYM_TIME_FORMAT__);
     DateTimeObj::setSettings(self::Configuration()->get('region'));
     // Initialize language
     $this->initialiseLang();
     // Initialize logs
     $this->initialiseLog(INSTALL_LOGS . '/install');
     // Initialize database
     $this->initialiseDatabase();
     // Initialize error handlers
     GenericExceptionHandler::initialise(Symphony::Log());
     GenericErrorHandler::initialise(Symphony::Log());
 }
开发者ID:hananils,项目名称:pompodium,代码行数:31,代码来源:class.installer.php


示例11: unSlash

 /**
  * Méthode qui supprime les antislashs
  *
  * @param	content				variable ou tableau 
  * @return	array ou string		tableau ou variable avec les antislashs supprimés
  **/
 public static function unSlash($content)
 {
     if (get_magic_quotes_gpc() == 1) {
         if (is_array($content)) {
             # On traite un tableau
             foreach ($content as $k => $v) {
                 # On parcourt le tableau
                 if (is_array($v)) {
                     foreach ($v as $key => $val) {
                         $new_content[$k][$key] = stripslashes($val);
                     }
                 } else {
                     $new_content[$k] = stripslashes($v);
                 }
             }
         } else {
             # On traite une chaine
             $new_content = stripslashes($content);
         }
         # On retourne le tableau modifie
         return $new_content;
     } else {
         return $content;
     }
 }
开发者ID:Bivi,项目名称:pluxml_bvi,代码行数:31,代码来源:class.plx.utils.php


示例12: __construct

 public function __construct()
 {
     if (!get_magic_quotes_gpc()) {
         $_POST = new_addslashes($_POST);
         $_GET = new_addslashes($_GET);
         $_REQUEST = new_addslashes($_REQUEST);
         $_COOKIE = new_addslashes($_COOKIE);
     }
     $this->route_config = pc_base::load_config('route', SITE_URL) ? pc_base::load_config('route', SITE_URL) : pc_base::load_config('route', 'default');
     if (isset($this->route_config['data']['POST']) && is_array($this->route_config['data']['POST'])) {
         foreach ($this->route_config['data']['POST'] as $_key => $_value) {
             if (!isset($_POST[$_key])) {
                 $_POST[$_key] = $_value;
             }
         }
     }
     if (isset($this->route_config['data']['GET']) && is_array($this->route_config['data']['GET'])) {
         foreach ($this->route_config['data']['GET'] as $_key => $_value) {
             if (!isset($_GET[$_key])) {
                 $_GET[$_key] = $_value;
             }
         }
     }
     if (isset($_GET['page'])) {
         $_GET['page'] = max(intval($_GET['page']), 1);
     }
     return true;
 }
开发者ID:zhouzhouxs,项目名称:Progect,代码行数:28,代码来源:param.class.php


示例13: init

 static function init()
 {
     $version_file = APP_PATH . '/../version';
     if (file_exists($version_file)) {
         self::$version = trim(@file_get_contents($version_file));
     }
     $config_file = APP_PATH . '/config/config.php';
     if (!file_exists($config_file)) {
         throw new Exception("No config file");
     }
     $config = (include $config_file);
     self::$config = $config;
     self::$env = $config['env'];
     #self::$context = new stdClass();
     self::$context = new Context();
     Logger::init($config['logger']);
     if (isset($config['db'])) {
         Db::init($config['db']);
     }
     if (get_magic_quotes_gpc()) {
         foreach ($_GET as $k => $v) {
             $_GET[$k] = Text::stripslashes($v);
         }
         foreach ($_POST as $k => $v) {
             $_POST[$k] = Text::stripslashes($v);
         }
         foreach ($_COOKIE as $k => $v) {
             $_COOKIE[$k] = Text::stripslashes($v);
         }
     }
     $_REQUEST = $_GET + $_POST + $_COOKIE;
 }
开发者ID:GoodCloudGary,项目名称:iphp,代码行数:32,代码来源:App.php


示例14: setEscape

 /**
  * Anti-Mysql-Injection method, escapes a string.
  *
  * @param string $text_to_escape
  */
 public static function setEscape($text_to_escape)
 {
     if (!get_magic_quotes_gpc()) {
         $text_to_escape = mysql_real_escape_string($text_to_escape);
     }
     return $text_to_escape;
 }
开发者ID:nuthankumarns,项目名称:vts-source---services,代码行数:12,代码来源:class_registration.php


示例15: __construct

 function __construct()
 {
     $this->open_connection();
     $this->magic_quotes_active = get_magic_quotes_gpc();
     $this->real_escape_string_exists = function_exists("mysql_real_escape_string");
     // i.e. PHP >= v4.3.0
 }
开发者ID:philipos,项目名称:Fishki-2010,代码行数:7,代码来源:database.php


示例16: SafeStripSlashes

 function SafeStripSlashes($text)
 {
     if (get_magic_quotes_gpc()) {
         return stripslashes($text);
     }
     return $text;
 }
开发者ID:katbailey,项目名称:katbaileynet,代码行数:7,代码来源:demo.mp3header.php


示例17: param_proc

 /**
  * 변수 유무 체크 처리
  *
  * @param string $vars 변수명
  * @param string $message 에러메시지
  * @param string $code 반환코드
  * @param string $type Y일경우 변수값이 없으면 에러, N일 경우 필수가 아님
  * @return string $clean_input 보안처리된 변수값 반환
  */
 private function param_proc($vars, $message = '', $code, $type = 'Y')
 {
     if ($type == 'Y') {
         if (@$this->_request[$vars] == '') {
             $this->response($message, $code);
             exit;
         } else {
             //변수에 대한 보안처리
             if (get_magic_quotes_gpc()) {
                 $data = trim(stripslashes($this->_request[$vars]));
             } else {
                 $data = $this->_request[$vars];
             }
             $data = strip_tags($data);
             $clean_input = trim($data);
             return $clean_input;
         }
     } else {
         if ($type == 'N') {
             //변수에 대한 보안처리
             if (get_magic_quotes_gpc()) {
                 $data = trim(stripslashes(@$this->_request[$vars]));
             } else {
                 $data = @$this->_request[$vars];
             }
             $data = strip_tags($data);
             $clean_input = trim($data);
             return $clean_input;
         }
     }
 }
开发者ID:nemoluv,项目名称:pushwing,代码行数:40,代码来源:api.php


示例18: validate

 /**
  * Validates a IPN message
  * 
  * @return boolean
  */
 public function validate()
 {
     if (isset($this->isIpnVerified)) {
         return $this->isIpnVerified;
     } else {
         $request = self::IPN_CMD;
         if (function_exists('get_magic_quotes_gpc') && get_magic_quotes_gpc() == 1) {
             $get_magic_quotes_exists = true;
         } else {
             $get_magic_quotes_exists = false;
         }
         foreach ($this->ipnData as $key => $value) {
             if ($get_magic_quotes_exists) {
                 $value = urlencode(stripslashes($value));
             } else {
                 $value = urlencode($value);
             }
             $request .= "&{$key}={$value}";
         }
         $httpConfig = new PPHttpConfig(PPConfigManager::getInstance()->get('service.EndPoint.IPN'));
         $httpConfig->addCurlOption(CURLOPT_FORBID_REUSE, 1);
         $httpConfig->addCurlOption(CURLOPT_HTTPHEADER, array('Connection: Close'));
         $connection = PPConnectionManager::getInstance()->getConnection($httpConfig);
         $response = $connection->execute($request);
         if ($response == 'VERIFIED') {
             $this->isIpnVerified = true;
             return true;
         }
         $this->isIpnVerified = false;
         return false;
         // value is 'INVALID'
     }
 }
开发者ID:rrehbeindoi,项目名称:merchant-sdk-php,代码行数:38,代码来源:PPIPNMessage.php


示例19: undecorate

 static function undecorate($str)
 {
     if (!get_magic_quotes_gpc()) {
         $str = stripslashes($str);
     }
     return $str;
 }
开发者ID:a-i-ko93,项目名称:ipl-foodblog,代码行数:7,代码来源:EzTran.php


示例20: add_ics_feed_frontend

 /**
  * Send an e-mail to the admin and another to the user if form passes
  * validation.
  */
 public function add_ics_feed_frontend()
 {
     global $wpdb, $ai1ec_settings;
     $table_name = $wpdb->prefix . 'ai1ec_event_feeds';
     $check = $this->validate_form();
     $check['nonce'] = wp_nonce_field('ai1ec_submit_ics_form', AI1EC_POST_TYPE, true, false);
     if (true === $check['success']) {
         // Strip slashes if ridiculous PHP setting magic_quotes_gpc is enabled.
         if (get_magic_quotes_gpc()) {
             foreach ($_POST as &$param) {
                 $param = stripslashes($param);
             }
         }
         // Send admin e-mail.
         $admin_email = get_option('admin_email');
         $admin_mail_subject = $this->parse_mail($ai1ec_settings->admin_mail_subject);
         $admin_mail_body = $this->parse_mail($ai1ec_settings->admin_mail_body);
         wp_mail($admin_email, $admin_mail_subject, $admin_mail_body);
         // Send user e-mail.
         $user_email = $_POST['ai1ec_submitter_email'];
         $user_mail_subject = $this->parse_mail($ai1ec_settings->user_mail_subject);
         $user_mail_body = $this->parse_mail($ai1ec_settings->user_mail_body);
         wp_mail($user_email, $user_mail_subject, $user_mail_body);
     }
     echo json_encode($check);
     exit;
 }
开发者ID:Blueprint-Marketing,项目名称:interoccupy.net,代码行数:31,代码来源:Ai1ecIcsConnectorPlugin.php



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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