]> git.wh0rd.org - tt-rss.git/blobdiff - include/functions.php
fetch_file_contents: support retarded schema-less urls
[tt-rss.git] / include / functions.php
index a8fc9fbe511d10e1aa1ca15e966792c43a763465..769c27af9f13040c415c667df7ff351b7cc3d415 100644 (file)
@@ -64,6 +64,7 @@
        function get_translations() {
                $tr = array(
                                        "auto"  => "Detect automatically",
+                                       "ar_SA" => "العربيّة (Arabic)",
                                        "da_DA" => "Dansk",
                                        "ca_CA" => "Català",
                                        "cs_CZ" => "Česky",
                global $fetch_last_content_type;
                global $fetch_curl_used;
 
+               $url = ltrim($url, ' ');
                $url = str_replace(' ', '%20', $url);
 
+               if (strpos($url, "//") === 0)
+                       $url = 'http:' . $url;
+
                if (!defined('NO_CURL') && function_exists('curl_init')) {
 
                        $fetch_curl_used = true;
 
-                       if (ini_get("safe_mode") || ini_get("open_basedir")) {
+                       if (ini_get("safe_mode") || ini_get("open_basedir") || defined("FORCE_GETURL")) {
                                $new_url = geturl($url);
                                if (!$new_url) {
                                    // geturl has already populated $fetch_last_error
                                curl_setopt($ch, CURLOPT_POSTFIELDS, $post_query);
                        }
 
-                       if ((OPENSSL_VERSION_NUMBER >= 0x0090808f) && (OPENSSL_VERSION_NUMBER < 0x10000000)) {
-                               curl_setopt($ch, CURLOPT_SSLVERSION, 3);
-                       }
-
                        if ($login && $pass)
                                curl_setopt($ch, CURLOPT_USERPWD, "$login:$pass");
 
                        $url = key($feedUrls);
                }
 
-               /* libxml_use_internal_errors(true);
-               $doc = new DOMDocument();
-               $doc->loadXML($contents);
-               $error = libxml_get_last_error();
-               libxml_clear_errors();
-
-               if ($error) {
-                       $error_message = format_libxml_error($error);
-
-                       return array("code" => 6, "message" => $error_message);
-               } */
-
                if ($cat_id == "0" || !$cat_id) {
                        $cat_qpart = "NULL";
                } else {