Skip to content
Permalink
Browse files

regexp: \z replaced with D modifier

  • Loading branch information...
dg committed Jul 11, 2019
1 parent 5f88514 commit 29af14dfdb83fb71d857b0ac3096e6d74c7e3691
Showing with 7 additions and 7 deletions.
  1. +2 −2 src/Tracy/BlueScreen/BlueScreen.php
  2. +3 −3 src/Tracy/Dumper/Dumper.php
  3. +2 −2 src/Tracy/Helpers.php
@@ -195,7 +195,7 @@ private function renderActions(\Throwable $ex): array
$actions[] = $ex->tracyAction;
}
if (preg_match('# ([\'"])(\w{3,}(?:\\\\\w{3,})+)\\1#i', $ex->getMessage(), $m)) {
if (preg_match('# ([\'"])(\w{3,}(?:\\\\\w{3,})+)\1#i', $ex->getMessage(), $m)) {
$class = $m[2];
if (
!class_exists($class) && !interface_exists($class) && !trait_exists($class)
@@ -208,7 +208,7 @@ private function renderActions(\Throwable $ex): array
}
}
if (preg_match('# ([\'"])((?:/|[a-z]:[/\\\\])\w[^\'"]+\.\w{2,5})\\1#i', $ex->getMessage(), $m)) {
if (preg_match('# ([\'"])((?:/|[a-z]:[/\\\\])\w[^\'"]+\.\w{2,5})\1#i', $ex->getMessage(), $m)) {
$file = $m[2];
$actions[] = [
'link' => Helpers::editorUri($file, 1, $label = is_file($file) ? 'open' : 'create'),
@@ -544,7 +544,7 @@ public static function encodeString(string $s, int $maxLength = null): string
*/
private function encodeKey($key)
{
return is_int($key) || preg_match('#^[!\#$%&()*+,./0-9:;<=>?@A-Z[\]^_`a-z{|}~-]{1,50}\z#', $key)
return is_int($key) || preg_match('#^[!\#$%&()*+,./0-9:;<=>?@A-Z[\]^_`a-z{|}~-]{1,50}$#D', $key)
? $key
: '"' . $this->encodeString($key, $this->maxLength) . '"';
}
@@ -607,9 +607,9 @@ private static function exportPhpIncompleteClass(\__PHP_Incomplete_Class $obj):
foreach ((array) $obj as $name => $value) {
if ($name === '__PHP_Incomplete_Class_Name') {
$info['className'] = $value;
} elseif (preg_match('#^\x0\*\x0(.+)\z#', $name, $m)) {
} elseif (preg_match('#^\x0\*\x0(.+)$#D', $name, $m)) {
$info['protected'][$m[1]] = $value;
} elseif (preg_match('#^\x0(.+)\x0(.+)\z#', $name, $m)) {
} elseif (preg_match('#^\x0(.+)\x0(.+)$#D', $name, $m)) {
$info['private'][$m[1] . '::$' . $m[2]] = $value;
} else {
$info['public'][$name] = $value;
@@ -291,7 +291,7 @@ public static function isHtmlMode(): bool
/** @internal */
public static function isAjax(): bool
{
return isset($_SERVER['HTTP_X_TRACY_AJAX']) && preg_match('#^\w{10,15}\z#', $_SERVER['HTTP_X_TRACY_AJAX']);
return isset($_SERVER['HTTP_X_TRACY_AJAX']) && preg_match('#^\w{10,15}$#D', $_SERVER['HTTP_X_TRACY_AJAX']);
}
@@ -309,7 +309,7 @@ public static function getNonce(): ?string
*/
private static function escapeArg(string $s): string
{
if (preg_match('#^[a-z0-9._=/:-]+\z#i', $s)) {
if (preg_match('#^[a-z0-9._=/:-]+$#Di', $s)) {
return $s;
}

0 comments on commit 29af14d

Please sign in to comment.
You can’t perform that action at this time.