mirror of
https://github.com/typecho/typecho.git
synced 2025-02-19 20:28:58 +01:00
fix bug
This commit is contained in:
parent
23d52d44a1
commit
926ec3e117
@ -84,10 +84,10 @@ interface Adapter
|
||||
/**
|
||||
* 引号转义函数
|
||||
*
|
||||
* @param string $string 需要转义的字符串
|
||||
* @param mixed $string 需要转义的字符串
|
||||
* @return string
|
||||
*/
|
||||
public function quoteValue(string $string): string;
|
||||
public function quoteValue($string): string;
|
||||
|
||||
/**
|
||||
* 对象引号过滤
|
||||
|
@ -152,10 +152,10 @@ class Mysqli implements Adapter
|
||||
/**
|
||||
* 引号转义函数
|
||||
*
|
||||
* @param string $string 需要转义的字符串
|
||||
* @param mixed $string 需要转义的字符串
|
||||
* @return string
|
||||
*/
|
||||
public function quoteValue(string $string): string
|
||||
public function quoteValue($string): string
|
||||
{
|
||||
return '\'' . str_replace(['\'', '\\'], ['\'\'', '\\\\'], $string) . '\'';
|
||||
}
|
||||
|
@ -151,10 +151,10 @@ abstract class Pdo implements Adapter
|
||||
/**
|
||||
* 引号转义函数
|
||||
*
|
||||
* @param string $string 需要转义的字符串
|
||||
* @param mixed $string 需要转义的字符串
|
||||
* @return string
|
||||
*/
|
||||
public function quoteValue(string $string): string
|
||||
public function quoteValue($string): string
|
||||
{
|
||||
return $this->object->quote($string);
|
||||
}
|
||||
|
@ -70,10 +70,10 @@ class Mysql extends Pdo
|
||||
/**
|
||||
* 引号转义函数
|
||||
*
|
||||
* @param string $string 需要转义的字符串
|
||||
* @param mixed $string 需要转义的字符串
|
||||
* @return string
|
||||
*/
|
||||
public function quoteValue(string $string): string
|
||||
public function quoteValue($string): string
|
||||
{
|
||||
return '\'' . str_replace(['\'', '\\'], ['\'\'', '\\\\'], $string) . '\'';
|
||||
}
|
||||
|
@ -136,10 +136,10 @@ class Pgsql implements Adapter
|
||||
/**
|
||||
* 引号转义函数
|
||||
*
|
||||
* @param string $string 需要转义的字符串
|
||||
* @param mixed $string 需要转义的字符串
|
||||
* @return string
|
||||
*/
|
||||
public function quoteValue(string $string): string
|
||||
public function quoteValue($string): string
|
||||
{
|
||||
return '\'' . pg_escape_string($string) . '\'';
|
||||
}
|
||||
|
@ -132,10 +132,10 @@ class SQLite implements Adapter
|
||||
/**
|
||||
* 引号转义函数
|
||||
*
|
||||
* @param string $string 需要转义的字符串
|
||||
* @param mixed $string 需要转义的字符串
|
||||
* @return string
|
||||
*/
|
||||
public function quoteValue(string $string): string
|
||||
public function quoteValue($string): string
|
||||
{
|
||||
return '\'' . str_replace('\'', '\'\'', $string) . '\'';
|
||||
}
|
||||
|
@ -111,6 +111,8 @@ class Request
|
||||
*/
|
||||
public function get(string $key, $default = null, ?bool &$exists = true)
|
||||
{
|
||||
$exists = true;
|
||||
|
||||
switch (true) {
|
||||
case isset($this->params) && isset($this->params[$key]):
|
||||
$value = $this->params[$key];
|
||||
|
@ -101,10 +101,7 @@ class Request
|
||||
/**
|
||||
* 获取实际传递参数(magic)
|
||||
*
|
||||
* @access public
|
||||
*
|
||||
* @param string $key 指定参数
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
public function __get(string $key)
|
||||
@ -115,10 +112,7 @@ class Request
|
||||
/**
|
||||
* 判断参数是否存在
|
||||
*
|
||||
* @access public
|
||||
*
|
||||
* @param string $key 指定参数
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
public function __isset(string $key)
|
||||
|
Loading…
x
Reference in New Issue
Block a user