Commit: 41ddbc8f0568eb6be46c065897d5c7465d2cad82 Author: Sobak <[email protected]> Sat, 29 Nov 2014 07:14:15 +0100 Parents: fd9f82d0fb52153cee81727fb9ca47235235af2d Branches: master
Link: http://git.php.net/?p=web/bugs.git;a=commitdiff;h=41ddbc8f0568eb6be46c065897d5c7465d2cad82 Log: Fix bug #68405 (The PHP version dropdown doesn't show PHP versions after a form error) require_once caused a problem here, so file needs to be included earlier and reused by those two functions Bugs: https://bugs.php.net/68405 Changed paths: M include/functions.php M www/report.php Diff: diff --git a/include/functions.php b/include/functions.php index 1344497..7ed8ae3 100644 --- a/include/functions.php +++ b/include/functions.php @@ -690,12 +690,11 @@ function show_reason_types($current = '', $expanded = 0) */ function show_version_options($current, $default = '') { - global $ROOT_DIR; + global $ROOT_DIR, $versions; $use = 0; echo '<option value="">--Please Select--</option>' , "\n"; - require_once "{$ROOT_DIR}/include/php_versions.php"; foreach($versions as $v) { echo '<option'; if ($current == $v) { @@ -1275,7 +1274,7 @@ function is_valid_email($email, $phpnet_allowed = true) */ function incoming_details_are_valid($in, $initial = 0, $logged_in = false) { - global $bug, $dbh, $bug_types, $ROOT_DIR; + global $bug, $dbh, $bug_types, $versions; $errors = array(); if (!is_array($in)) { @@ -1295,8 +1294,6 @@ function incoming_details_are_valid($in, $initial = 0, $logged_in = false) $errors[] = 'Please select a valid PHP version. If your PHP version is too old, please upgrade first and see if the problem has not already been fixed.'; } - require_once "{$ROOT_DIR}/include/php_versions.php"; - if (empty($in['php_version']) || ($initial && !in_array($in['php_version'], $versions))) { $errors[] = 'Please select a valid PHP version.'; } diff --git a/www/report.php b/www/report.php index a36397a..80b13f5 100644 --- a/www/report.php +++ b/www/report.php @@ -19,6 +19,8 @@ bugs_authenticate($user, $pw, $logged_in, $user_flags); $is_trusted_developer = ($user_flags & BUGS_TRUSTED_DEV); $is_security_developer = ($user_flags & BUGS_SECURITY_DEV); +require "{$ROOT_DIR}/include/php_versions.php"; + // captcha is not necessary if the user is logged in if (!$logged_in) { require_once 'Text/CAPTCHA/Numeral.php'; -- PHP Webmaster List Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
