diff --git a/Nette/Application/UI/Presenter.php b/Nette/Application/UI/Presenter.php index 62be921043..193882f451 100644 --- a/Nette/Application/UI/Presenter.php +++ b/Nette/Application/UI/Presenter.php @@ -1346,7 +1346,8 @@ public function getApplication() /** - * @return Nette\Http\Session + * @param string + * @return Nette\Http\Session|Nette\Http\SessionSection */ public function getSession($namespace = NULL) { diff --git a/Nette/Database/Helpers.php b/Nette/Database/Helpers.php index 526b8f4ca3..89a4e46683 100644 --- a/Nette/Database/Helpers.php +++ b/Nette/Database/Helpers.php @@ -80,7 +80,7 @@ public static function dumpResult(Statement $statement) public static function dumpSql($sql) { static $keywords1 = 'SELECT|(?:ON\s+DUPLICATE\s+KEY)?UPDATE|INSERT(?:\s+INTO)?|REPLACE(?:\s+INTO)?|DELETE|CALL|UNION|FROM|WHERE|HAVING|GROUP\s+BY|ORDER\s+BY|LIMIT|OFFSET|SET|VALUES|LEFT\s+JOIN|INNER\s+JOIN|TRUNCATE'; - static $keywords2 = 'ALL|DISTINCT|DISTINCTROW|IGNORE|AS|USING|ON|AND|OR|IN|IS|NOT|NULL|LIKE|RLIKE|REGEXP|TRUE|FALSE'; + static $keywords2 = 'ALL|DISTINCT|DISTINCTROW|IGNORE|AS|USING|ON|AND|OR|IN|IS|NOT|NULL|[RI]?LIKE|REGEXP|TRUE|FALSE'; // insert new lines $sql = " $sql "; diff --git a/Nette/Database/Table/Selection.php b/Nette/Database/Table/Selection.php index 2cf47a9cd5..7950708f37 100644 --- a/Nette/Database/Table/Selection.php +++ b/Nette/Database/Table/Selection.php @@ -561,7 +561,7 @@ public function accessColumn($key, $selectColumn = TRUE) if ($key === NULL) { $this->accessedColumns = FALSE; - $currentKey = key($this->data); + $currentKey = key((array) $this->data); } elseif ($this->accessedColumns !== FALSE) { $this->accessedColumns[$key] = $selectColumn; } diff --git a/Nette/Database/Table/SqlBuilder.php b/Nette/Database/Table/SqlBuilder.php index 3c8ac20a1e..63cbb64da6 100644 --- a/Nette/Database/Table/SqlBuilder.php +++ b/Nette/Database/Table/SqlBuilder.php @@ -153,7 +153,7 @@ public function addWhere($condition, $parameters = array()) $replace = NULL; $placeholderNum = 0; foreach ($args as $arg) { - preg_match('#(?:.*?\?.*?){' . $placeholderNum . '}(((?:&|\||^|~|\+|-|\*|/|%|\(|,|<|>|=|(?<=\W|^)(?:REGEXP|ALL|AND|ANY|BETWEEN|EXISTS|IN|R?LIKE|OR|NOT|SOME))\s*)?(?:\(\?\)|\?))#s', $condition, $match, PREG_OFFSET_CAPTURE); + preg_match('#(?:.*?\?.*?){' . $placeholderNum . '}(((?:&|\||^|~|\+|-|\*|/|%|\(|,|<|>|=|(?<=\W|^)(?:REGEXP|ALL|AND|ANY|BETWEEN|EXISTS|IN|[IR]?LIKE|OR|NOT|SOME|INTERVAL))\s*)?(?:\(\?\)|\?))#s', $condition, $match, PREG_OFFSET_CAPTURE); $hasOperator = ($match[1][0] === '?' && $match[1][1] === 0) ? TRUE : !empty($match[2][0]); if ($arg === NULL) { diff --git a/Nette/Diagnostics/Debugger.php b/Nette/Diagnostics/Debugger.php index 89a64c4b0d..f58cdeda82 100644 --- a/Nette/Diagnostics/Debugger.php +++ b/Nette/Diagnostics/Debugger.php @@ -501,7 +501,7 @@ public static function _errorHandler($severity, $message, $file, $line, $context ); $message = 'PHP ' . (isset($types[$severity]) ? $types[$severity] : 'Unknown error') . ": $message"; - $count = & self::$errorPanel->data["$message|$file|$line"]; + $count = & self::$errorPanel->data["$file|$line|$message"]; if ($count++) { // repeated error return NULL; diff --git a/Nette/Diagnostics/templates/bar.errors.panel.phtml b/Nette/Diagnostics/templates/bar.errors.panel.phtml index c522695908..156eb02691 100644 --- a/Nette/Diagnostics/templates/bar.errors.panel.phtml +++ b/Nette/Diagnostics/templates/bar.errors.panel.phtml @@ -16,7 +16,7 @@ use Nette;
| diff --git a/Nette/Diagnostics/templates/bar.errors.tab.phtml b/Nette/Diagnostics/templates/bar.errors.tab.phtml index 4eb5b15f77..8d7740b78c 100644 --- a/Nette/Diagnostics/templates/bar.errors.tab.phtml +++ b/Nette/Diagnostics/templates/bar.errors.tab.phtml @@ -12,4 +12,4 @@ namespace Nette\Diagnostics; use Nette; ?> |