Skip to content

Commit

Permalink
DebugPanel - fixed to new tab link when POST request has no variabl…
Browse files Browse the repository at this point in the history
…es in query string
  • Loading branch information
SilverFire committed Apr 11, 2016
1 parent 314ac7c commit a131b13
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/DebugPanel.php
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,13 @@ public function getDetail()
'class' => 'hiart-link',
'data' => ['id' => $i],
]) . '<br/>';
$newTabLink = Html::a('to new tab', $apiUrl . preg_replace('/^[A-Z]+\s+/', '', $url) . '&' . $body, ['target' => '_blank']) . '<br/>';
$path = preg_replace('/^[A-Z]+\s+/', '', $url);
if (strpos($path, '?') !== false) {
$newTabUrl = $apiUrl . rtrim($path, '&') . '&' . $body;
} else {
$newTabUrl = $apiUrl . $path . '?' . $body;
}
$newTabLink = Html::a('to new tab', $newTabUrl, ['target' => '_blank']) . '<br/>';
$url_encoded = Html::encode((isset($apiUrl)) ? str_replace(' ', ' ' . $apiUrl, $url) : $url);
$body_encoded = Html::encode($body);
$rows[] = <<<HTML
Expand Down

0 comments on commit a131b13

Please sign in to comment.