diff options
| author | 2016-08-20 12:22:56 +0200 | |
|---|---|---|
| committer | 2016-08-20 12:22:56 +0200 | |
| commit | 2af3abc89e56af75c38caf5e8071b3cd09bedba8 (patch) | |
| tree | dc7e1cb7a31c039ec451d7788ae9d73bc336a6ee /lib | |
| parent | e315192c4b3df89dddb1ac37c6c7a01531d7952f (diff) | |
| parent | f9359cd406bafdbb1ffaa8bad8a5810a02efc820 (diff) | |
Merge branch 'FreshRSS/dev' into PostgreSQL
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/lib_rss.php | 45 |
1 files changed, 7 insertions, 38 deletions
diff --git a/lib/lib_rss.php b/lib/lib_rss.php index b5ba78889..82ddced2c 100644 --- a/lib/lib_rss.php +++ b/lib/lib_rss.php @@ -15,34 +15,7 @@ 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; - } -} +defined('JSON_UNESCAPED_UNICODE') or define('JSON_UNESCAPED_UNICODE', 256); //PHP 5.3 /** * Build a directory path by concatenating a list of directory names. @@ -103,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; @@ -379,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; } @@ -416,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, |
