Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Admin checks: Simplify code to generate verbosity links

  • Loading branch information...
commit 527d9faf95884c7d260eeaaf27aa926c0ea5c194 1 parent cca6942
@dregad dregad authored
Showing with 9 additions and 2 deletions.
  1. +9 −2 admin/check/index.php
View
11 admin/check/index.php
@@ -60,8 +60,15 @@
$g_show_all = gpc_get_bool( 'show_all', false );
$g_show_errors = gpc_get_bool( 'show_errors', false );
-$t_show_all_mode_link = '<a href="index.php?show_all=' . ($g_show_all ? '0' : '1') . '&amp;show_errors=' . ($g_show_errors ? '1' : '0') . '">' . ($g_show_all ? 'Hide passed tests' : 'Show passed tests') . '</a>';
-$t_show_errors_mode_link = '<a href="index.php?show_all=' . ($g_show_all ? '1' : '0') . '&amp;show_errors=' . ($g_show_errors ? '0' : '1') . '">' . ($g_show_errors ? 'Hide verbose error messages' : 'Show verbose error messages') . '</a>';
+$t_url = basename( __FILE__ ) . '?' . http_build_query(
+ array(
+ 'show_all' => (int)!$g_show_all,
+ 'show_errors' => (int)!$g_show_errors,
+ )
+);
+$t_link = '<a href="%s">%s %s</a>';
+$t_show_all_mode_link = sprintf( $t_link, $t_url, ($g_show_all ? 'Hide' : 'Show'), 'passed tests' );
+$t_show_errors_mode_link = sprintf( $t_link, $t_url, ($g_show_errors ? 'Hide' : 'Show'), 'verbose error messages' );
http_content_headers();
Please sign in to comment.
Something went wrong with that request. Please try again.