aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorGravatar Alexandre Alapetite <alexandre@alapetite.fr> 2016-08-14 19:55:27 +0200
committerGravatar Alexandre Alapetite <alexandre@alapetite.fr> 2016-08-14 19:55:27 +0200
commitdd7d5855e3aedfca2ca216049afd3a1aaa23733b (patch)
tree8b80c7f67d0290f666f3a5c6f70b025d283d46a1 /lib
parent722c0cb8b255e700282e080fde4aec241e7ccfa3 (diff)
Remove code for PHP 5.3.2-
Diffstat (limited to 'lib')
-rw-r--r--lib/lib_rss.php45
1 files changed, 6 insertions, 39 deletions
diff --git a/lib/lib_rss.php b/lib/lib_rss.php
index b5ba78889..cf56ae9b2 100644
--- a/lib/lib_rss.php
+++ b/lib/lib_rss.php
@@ -15,35 +15,6 @@ if (!function_exists('json_encode')) {
}
}
-if (!function_exists('array_replace_recursive')) { //PHP 5.2
- function arr_recurse($array, $array1) {
- foreach ($array1 as $key => $value) {
- if (!isset($array[$key]) || (isset($array[$key]) && !is_array($array[$key]))) {
- $array[$key] = array(); //create new key in $array, if it is empty or not an array
- }
- if (is_array($value)) {
- $value = arr_recurse($array[$key], $value); // overwrite the value in the base array
- }
- $array[$key] = $value;
- }
- return $array;
- }
- function array_replace_recursive($array, $array1) { //http://php.net/manual/function.array-replace-recursive.php#92574
- // handle the arguments, merge one by one
- $args = func_get_args();
- $array = $args[0];
- if (!is_array($array)) {
- return $array;
- }
- for ($i = 1; $i < count($args); $i++) {
- if (is_array($args[$i])) {
- $array = arr_recurse($array, $args[$i]);
- }
- }
- return $array;
- }
-}
-
/**
* Build a directory path by concatenating a list of directory names.
*
@@ -103,9 +74,7 @@ function checkUrl($url) {
$url = 'http://' . $url;
}
$url = idn_to_puny($url); //PHP bug #53474 IDN
- if (filter_var($url, FILTER_VALIDATE_URL) ||
- (version_compare(PHP_VERSION, '5.3.3', '<') && (strpos($url, '-') > 0) && //PHP bug #51192
- ($url === filter_var($url, FILTER_SANITIZE_URL)))) {
+ if (filter_var($url, FILTER_VALIDATE_URL)) {
return $url;
} else {
return false;
@@ -379,12 +348,10 @@ function httpAuthUser() {
}
function cryptAvailable() {
- if (version_compare(PHP_VERSION, '5.3.3', '>=')) {
- try {
- $hash = '$2y$04$usesomesillystringfore7hnbRJHxXVLeakoG8K30oukPsA.ztMG';
- return $hash === @crypt('password', $hash);
- } catch (Exception $e) {
- }
+ try {
+ $hash = '$2y$04$usesomesillystringfore7hnbRJHxXVLeakoG8K30oukPsA.ztMG';
+ return $hash === @crypt('password', $hash);
+ } catch (Exception $e) {
}
return false;
}
@@ -416,7 +383,7 @@ function check_install_php() {
$pdo_mysql = extension_loaded('pdo_mysql');
$pdo_sqlite = extension_loaded('pdo_sqlite');
return array(
- 'php' => version_compare(PHP_VERSION, '5.2.1') >= 0,
+ 'php' => version_compare(PHP_VERSION, '5.3.3') >= 0,
'minz' => file_exists(LIB_PATH . '/Minz'),
'curl' => extension_loaded('curl'),
'pdo' => $pdo_mysql || $pdo_sqlite,