com web/bugs: More elegant way to add custom versions: include/functions.php include/php_versions.php
| From: | sobak@php.net | Date: | Fri, 27 Jun 2014 13:48:10 +0000 |
| Subject: | com web/bugs: More elegant way to add custom versions: include/functions.php include/php_versions.php | ||
| Groups: | php.webmaster | ||
| Request: | Send a blank email to php-webmaster+get-19367@lists.php.net to get a copy of this message | ||
Commit: 257b4fca67322116d2d3af773e531a86f8e7d908
Author: Sobak <msobaczewski@gmail.com> Fri, 27 Jun 2014 15:48:10 +0200
Parents: 8a32bb505a43947787932ebe14500bd74b4db973
Branches: master
Link: http://git.php.net/?p=web/bugs.git;a=commitdiff;h=257b4fca67322116d2d3af773e531a86f8e7d908
Log:
More elegant way to add custom versions
Changed paths:
M include/functions.php
M include/php_versions.php
Diff:
diff --git a/include/functions.php b/include/functions.php
index 8c18f09..554c725 100644
--- a/include/functions.php
+++ b/include/functions.php
@@ -708,8 +708,6 @@ function show_version_options($current, $default = '')
if (!$use && $current) {
echo '<option selected="selected">' , htmlspecialchars($current) ,
"</option>\n";
}
- echo '<option>str_size_and_int64 branch</option>', "\n";
- echo '<option>Irrelevant</option>', "\n";
echo '<option value="earlier">Earlier? Upgrade first!</option>',
"\n";
}
@@ -1310,9 +1308,6 @@ function incoming_details_are_valid($in, $initial = 0, $logged_in = false)
require_once "{$ROOT_DIR}/include/php_versions.php";
- // Workaround for side report from bug #67513
- $versions = array_merge($versions, ['str_size_and_int64 branch',
'Irrelevant']);
-
if (empty($in['php_version']) || ($initial &&
!in_array($in['php_version'], $versions))) {
$errors[] = 'Please select a valid PHP version.';
}
diff --git a/include/php_versions.php b/include/php_versions.php
index 8d53eb9..4ee66c3 100644
--- a/include/php_versions.php
+++ b/include/php_versions.php
@@ -9,6 +9,12 @@
- between a minor version we order by the micro if available: first the qa releases:
alpha/beta/rc, then the stable, then the Git versions(snaps, Git)
*/
+ // Custom versions appended to the list
+ $custom_versions = array(
+ 'str_size_and_int64 branch',
+ 'Irrelevant'
+ );
+
if (!$versions = apc_fetch('bugs.versions')) {
$versions = buildVersions();
if ($versions) {
@@ -16,6 +22,8 @@
}
}
+ $versions = array_merge($versions, $custom_versions);
+
function buildVersions() {
$dev_versions = json_decode(file_get_contents('http://qa.php.net/api.php?type=qa-releases&format=json&only=dev_versions'));