当前位置: 首页>>代码示例>>PHP>>正文


PHP PMA_STR_charIsEscaped函数代码示例

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


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

示例1: PMA_SQP_parse


//.........这里部分代码省略.........
             }
             // end switch
             $count2 = $pos < $count2 ? $len : $pos;
             $str = PMA_substr($sql, $count1, $count2 - $count1);
             PMA_SQP_arrayAdd($sql_array, 'comment_' . $type, $str, $arraysize);
             continue;
         }
         // end if
         // Checks for something inside quotation marks
         if (PMA_STR_strInStr($c, $quote_list)) {
             $startquotepos = $count2;
             $quotetype = $c;
             $count2++;
             $escaped = FALSE;
             $escaped_escaped = FALSE;
             $pos = $count2;
             $oldpos = 0;
             do {
                 $oldpos = $pos;
                 $pos = $GLOBALS['PMA_strpos'](' ' . $sql, $quotetype, $oldpos + 1) - 1;
                 // ($pos === FALSE)
                 if ($pos < 0) {
                     $debugstr = $GLOBALS['strSQPBugUnclosedQuote'] . ' @ ' . $startquotepos . "\n" . 'STR: ' . htmlspecialchars($quotetype);
                     PMA_SQP_throwError($debugstr, $sql);
                     return $sql;
                 }
                 // If the quote is the first character, it can't be
                 // escaped, so don't do the rest of the code
                 if ($pos == 0) {
                     break;
                 }
                 // Checks for MySQL escaping using a \
                 // And checks for ANSI escaping using the $quotetype character
                 if ($pos < $len && PMA_STR_charIsEscaped($sql, $pos)) {
                     $pos++;
                     continue;
                 } else {
                     if ($pos + 1 < $len && PMA_substr($sql, $pos, 1) == $quotetype && PMA_substr($sql, $pos + 1, 1) == $quotetype) {
                         $pos = $pos + 2;
                         continue;
                     } else {
                         break;
                     }
                 }
             } while ($len > $pos);
             // end do
             $count2 = $pos;
             $count2++;
             $type = 'quote_';
             switch ($quotetype) {
                 case '\'':
                     $type .= 'single';
                     break;
                 case '"':
                     $type .= 'double';
                     break;
                 case '`':
                     $type .= 'backtick';
                     break;
                 default:
                     break;
             }
             // end switch
             $data = PMA_substr($sql, $count1, $count2 - $count1);
             PMA_SQP_arrayAdd($sql_array, $type, $data, $arraysize);
             continue;
开发者ID:BackupTheBerlios,项目名称:vhcs-svn,代码行数:67,代码来源:sqlparser.lib.php

示例2: PMA_SQP_parse


//.........这里部分代码省略.........
                         *
                         * is treated like
                         *
                         * SELECT * FROM `table`
                         */
                        $pos_quote_separator = PMA_strpos(' ' . $sql, $GLOBALS['sql_delimiter'], $oldpos + 1) - 1;
                        if ($pos_quote_separator < 0) {
                            $len += 1;
                            $sql .= '`';
                            $sql_array['raw'] .= '`';
                            $pos = $len;
                        } else {
                            $len += 1;
                            $sql = PMA_substr($sql, 0, $pos_quote_separator) . '`' . PMA_substr($sql, $pos_quote_separator);
                            $sql_array['raw'] = $sql;
                            $pos = $pos_quote_separator;
                        }
                        if (class_exists('PMA_Message') && $GLOBALS['is_ajax_request'] != true) {
                            PMA_Message::notice(__('Automatically appended backtick to the end of query!'))->display();
                        }
                    } else {
                        $debugstr = __('Unclosed quote') . ' @ ' . $startquotepos . "\n" . 'STR: ' . htmlspecialchars($quotetype);
                        PMA_SQP_throwError($debugstr, $sql);
                        return $sql_array;
                    }
                }
                // If the quote is the first character, it can't be
                // escaped, so don't do the rest of the code
                if ($pos == 0) {
                    break;
                }
                // Checks for MySQL escaping using a \
                // And checks for ANSI escaping using the $quotetype character
                if ($pos < $len && PMA_STR_charIsEscaped($sql, $pos) && $c != '`') {
                    $pos++;
                    continue;
                } elseif ($pos + 1 < $len && PMA_substr($sql, $pos, 1) == $quotetype && PMA_substr($sql, $pos + 1, 1) == $quotetype) {
                    $pos = $pos + 2;
                    continue;
                } else {
                    break;
                }
            } while ($len > $pos);
            // end do
            $count2 = $pos;
            $count2++;
            $type = 'quote_';
            switch ($quotetype) {
                case '\'':
                    $type .= 'single';
                    $this_was_quote = true;
                    break;
                case '"':
                    $type .= 'double';
                    $this_was_quote = true;
                    break;
                case '`':
                    $type .= 'backtick';
                    $this_was_quote = true;
                    break;
                default:
                    break;
            }
            // end switch
            $data = PMA_substr($sql, $count1, $count2 - $count1);
            PMA_SQP_arrayAdd($sql_array, $type, $data, $arraysize);
开发者ID:nhodges,项目名称:phpmyadmin,代码行数:67,代码来源:sqlparser.lib.php


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