Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
explicitly require PHP version 5.3.0 or newer
string_insert_hrefs: return to use of anonymous function
  • Loading branch information
adoom42 committed Apr 21, 2014
1 parent 7deb33d commit b0e8711
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 9 deletions.
1 change: 1 addition & 0 deletions ChangeLog
Expand Up @@ -2,6 +2,7 @@
update: SNMP support for Cisco 2960X-24PS-L, 2960X-24PD-L
update: syncdomain.php now provides some new CLI options and better lockfile handling
update: new {$client_x.x.x.x} auto tag containing client's IP
update: explicitly require PHP version 5.3.0 or newer
0.20.8
bugfix: syntax error in functions.php when using PHP prior to 5.3.0 (#1195)
bugfix: properly format comment text for locations and racks
Expand Down
4 changes: 4 additions & 0 deletions README
Expand Up @@ -119,6 +119,10 @@ and initialize the application.
* *
*******************************************************

*** Upgrading to 0.21.0 ***

The minimum (oldest) supported release of PHP is 5.3.

*** Upgrading to 0.20.7 ***

From now on the minimum (oldest) release of PHP that can run RackTables is
Expand Down
2 changes: 1 addition & 1 deletion wwwroot/inc/dictionary.php
Expand Up @@ -73,7 +73,7 @@ function platform_is_ok ()
{
$nerrs = 0;
echo "<table border=1 cellpadding=5>\n";
$nerrs += platform_generic_test (version_compare (PHP_VERSION, '5.2.10', '>='), 'PHP version >= 5.2.10');
$nerrs += platform_generic_test (version_compare (PHP_VERSION, '5.3.0', '>='), 'PHP version >= 5.3.0');
$nerrs += platform_generic_test (class_exists ('PDO'), 'PDO extension');
$nerrs += platform_generic_test (in_array ('pdo_mysql', get_loaded_extensions()), 'PDO-MySQL extension');
$nerrs += platform_function_test ('preg_match', 'PCRE extension');
Expand Down
14 changes: 6 additions & 8 deletions wwwroot/inc/functions.php
Expand Up @@ -1077,13 +1077,6 @@ function getRSUforRow ($rowData)
($counter['T'] + $counter['W'] + $counter['U'] + $counter['F']);
}

function string_insert_hrefs_callback ($m)
{
$t_url_href = 'href="' . rtrim($m[1], '.') . '"';
$s_url_replace = "<a ${t_url_href}>$m[1]</a> [<a ${t_url_href} target=\"_blank\">^</a>]";
return $s_url_replace;
}

# Detect URLs and email addresses in the string and replace them with href anchors
# (adopted from MantisBT, core/string_api.php:string_insert_hrefs).
function string_insert_hrefs ($p_string)
Expand Down Expand Up @@ -1129,7 +1122,12 @@ function string_insert_hrefs ($p_string)
$p_string = preg_replace_callback
(
$s_url_regex,
'string_insert_hrefs_callback',
function ($m)
{
$t_url_href = 'href="' . rtrim($m[1], '.') . '"';
$s_url_replace = "<a ${t_url_href}>$m[1]</a> [<a ${t_url_href} target=\"_blank\">^</a>]";
return $s_url_replace;
},
$p_string
);

Expand Down
5 changes: 5 additions & 0 deletions wwwroot/inc/upgrade.php
Expand Up @@ -218,6 +218,11 @@
installation. If desired so, you could eliminate the case-duplicating rows
and re-apply the failed query.
ENDOFTEXT
,

'0.21.0' => <<<ENDOFTEXT
The minimum (oldest) supported release of PHP is 5.3.
ENDOFTEXT
,
);

Expand Down

0 comments on commit b0e8711

Please sign in to comment.