Skip to content

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
  • Loading branch information
taufik-nurrohman committed Mar 19, 2021
1 parent b0d2af9 commit c825d9f
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 33 deletions.
2 changes: 1 addition & 1 deletion engine/f.php
Original file line number Diff line number Diff line change
Expand Up @@ -1332,6 +1332,6 @@ function z($value, $short = true) {
}
return ($short ? '[' : 'array(') . \implode(',', $out) . ($short ? ']' : ')');
}
return \var_export($a, true);
return \var_export($value, true);
}
}
35 changes: 4 additions & 31 deletions engine/kernel/guard.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,37 +7,10 @@ public static function abort(string $alert, $exit = true) {
debug_print_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS);
$trace = explode("\n", n(ob_get_clean()), 2);
array_shift($trace);
$trace = trim(str_replace(ROOT, '.', implode("\n", $trace)), "\n");
echo <<<HTML
<details style="
margin: 0;
padding: 0;
background: #f00;
font: normal normal 100%/1.5 sans-serif;
color: #fff;
selection: none;
">
<summary style="
margin: 0;
padding: .5em 1rem;
display: block;
cursor: pointer;
">$alert</summary>
<pre style="
margin: 0;
padding: 0;
background: #000;
font: normal normal 100%/1.25 monospace;
white-space: pre;
overflow: auto;
"><code style="
margin: 0;
padding: .5em 1rem;
display: block;
font: inherit;
">$trace</code></pre>
</details>
HTML;
$trace = trim(strtr(implode("\n", $trace), [
ROOT => '.'
]), "\n");
echo '<details style="margin:0;padding:0;background:#f00;font:normal normal 100%/1.5 sans-serif;color:#fff;selection:none;"><summary style="margin:0;padding:.5em 1rem;display:block;cursor:pointer;">' . $alert . '</summary><pre style="margin:0;padding:0;background:#000;font:normal normal 100%/1.25 monospace;white-space:pre;overflow:auto;"><code style="margin:0;padding:.5em 1rem;display:block;font:inherit;">' . $trace . '</code></pre></details>';
$exit && exit;
}

Expand Down
2 changes: 1 addition & 1 deletion engine/plug/to.php
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@
};
foreach ($q($value, "") as $k => $v) {
// `['a' => false, 'b' => 'false', 'c' => null, 'd' => 'null']` → `b=false&d=null`
if (!isset($v) || false === $v) {
if (null === $v || false === $v) {
continue;
}
// `['a' => true, 'b' => 'true', 'c' => ""]` → `a&b=true&c=`
Expand Down

0 comments on commit c825d9f

Please sign in to comment.