Commit ee2b968b by Carsten Brandt

fixed argument display in errorHandler

parent d3cb54bc
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
<?php if ($method !== null): ?> <?php if ($method !== null): ?>
<span class="call"> <span class="call">
<?php if ($file !== null) echo '&ndash;' ?> <?php if ($file !== null) echo '&ndash;' ?>
<?= $class !== null ? $handler->addTypeLinks("$class::$method(" . $handler->argumentsToString($args) . ")") : $handler->htmlEncode($method) . '(' . $handler->argumentsToString($args) . ')' ?> <?= ($class !== null ? $handler->addTypeLinks("$class::$method") : $handler->htmlEncode($method)) . '(' . $handler->argumentsToString($args) . ')' ?>
</span> </span>
<?php endif; ?> <?php endif; ?>
<span class="at"><?php if ($line !== null) echo 'at line'; ?></span> <span class="at"><?php if ($line !== null) echo 'at line'; ?></span>
......
...@@ -156,11 +156,10 @@ class ErrorHandler extends \yii\base\ErrorHandler ...@@ -156,11 +156,10 @@ class ErrorHandler extends \yii\base\ErrorHandler
*/ */
public function addTypeLinks($code) public function addTypeLinks($code)
{ {
if (preg_match('/(.*?)::([^(]+)\((.*)\)/', $code, $matches)) { if (preg_match('/(.*?)::([^(]+)/', $code, $matches)) {
$class = $matches[1]; $class = $matches[1];
$method = $matches[2]; $method = $matches[2];
$args = $matches[3]; $text = $this->htmlEncode($class) . '::' . $this->htmlEncode($method);
$text = $this->htmlEncode($class) . '::' . $this->htmlEncode($method) . '(' . $args . ')';
} else { } else {
$class = $code; $class = $code;
$text = $this->htmlEncode($class); $text = $this->htmlEncode($class);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment