summaryrefslogtreecommitdiff
path: root/lib/lib_rss.php
diff options
context:
space:
mode:
authorGravatar Alexandre Alapetite <alexandre@alapetite.fr> 2016-08-14 22:45:33 +0200
committerGravatar GitHub <noreply@github.com> 2016-08-14 22:45:33 +0200
commitc378e87b99b58829a704ea4f181108b86dd17e5f (patch)
treeec94b2b251d1fee86abb978d1b72be7a0f171dae /lib/lib_rss.php
parent52fea863c19d5469d3730853d18c5535e4ddf308 (diff)
parent2bf35b23f5548260a17ab24c08ac8c187c8ada24 (diff)
Merge pull request #1213 from Alkarex/drop-php-5.3.2
Remove code for PHP 5.3.2-
Diffstat (limited to 'lib/lib_rss.php')
-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 986dc1fb6..82ddced2c 100644
--- a/lib/lib_rss.php
+++ b/lib/lib_rss.php
@@ -17,35 +17,6 @@ if (!function_exists('json_encode')) {
defined('JSON_UNESCAPED_UNICODE') or define('JSON_UNESCAPED_UNICODE', 256); //PHP 5.3
-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.
*
@@ -105,9 +76,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;
@@ -381,12 +350,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;
}
@@ -418,7 +385,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,