Skip to content

Commit

Permalink
Http status codes are hardcoded in filter
Browse files Browse the repository at this point in the history
Arbitrary http status codes are hardcoded in filter so it is impossible to search by status code not present in select.
  • Loading branch information
SDKiller committed Jun 24, 2014
1 parent cb87d7b commit 7e19f79
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion extensions/debug/views/default/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,15 @@
echo " <h1>Available Debug Data</h1>";
$timeFormatter = extension_loaded('intl') ? Yii::createObject(['class' => 'yii\i18n\Formatter']) : Yii::$app->formatter;

$codes = [];
foreach ($manifest as $tag => $vals) {
if (!empty($vals['statusCode'])) {
$codes[] = $vals['statusCode'];
}
}
$codes = array_unique($codes, SORT_NUMERIC);
$status_codes = (!empty($codes)) ? array_combine($codes, $codes) : true;

echo GridView::widget([
'dataProvider' => $dataProvider,
'filterModel' => $searchModel,
Expand Down Expand Up @@ -104,7 +113,7 @@
],
[
'attribute' => 'statusCode',
'filter' => [200 => 200, 404 => 404, 403 => 403, 500 => 500],
'filter' => $status_codes,
'label' => 'Status code'
],
],
Expand Down

0 comments on commit 7e19f79

Please sign in to comment.