]> git.wh0rd.org - tt-rss.git/commitdiff
Merge branch 'subscribe-idn-feed' into 'master'
authorAndrew Dolgov <cthulhoo@gmail.com>
Mon, 16 Jan 2017 08:36:00 +0000 (11:36 +0300)
committerAndrew Dolgov <cthulhoo@gmail.com>
Mon, 16 Jan 2017 08:36:00 +0000 (11:36 +0300)
Subscribe to feed with Internationalized Domain Name

Currently you cannot subscribe to feeds on hosts with internationalized domain names (IDNA) within tt-rss. You need to manually convert them to punycode to subscribe to them.

This patch adds code to detect IDNA and convert them to punycode in fix_url() if possible on the system. This requires PHP IDN functions (e.g. on Debian Jessie this needs php5-intl to be installed), so a notice is added to the installer sanity check.

See merge request !37

1  2 
install/index.php

diff --combined install/index.php
index 16314edf651a25aa27e555e3bcf1ea1a6aec3320,d9e370ea59b4b81fa36780fc073e12da66e4cca5..7da311ffb832c2bbf65d6406529ed395d3b86e12
  
                $finished = false;
  
 -              if (function_exists("mcrypt_decrypt")) {
 -                      $crypt_key = make_password(24);
 -              } else {
 -                      $crypt_key = "";
 -              }
 -
                foreach ($data as $line) {
                        if (preg_match("/define\('DB_TYPE'/", $line)) {
                                $rv .= "\tdefine('DB_TYPE', '$DB_TYPE');\n";
                                $rv .= "\tdefine('DB_PORT', '$DB_PORT');\n";
                        } else if (preg_match("/define\('SELF_URL_PATH'/", $line)) {
                                $rv .= "\tdefine('SELF_URL_PATH', '$SELF_URL_PATH');\n";
 -                      } else if (preg_match("/define\('FEED_CRYPT_KEY'/", $line)) {
 -                              $rv .= "\tdefine('FEED_CRYPT_KEY', '$crypt_key');\n";
                        } else if (!$finished) {
                                $rv .= "$line\n";
                        }
                        array_push($notices, "CURL and open_basedir combination breaks support for HTTP redirects. See the FAQ for more information.");
                }
  
+               if (!function_exists("idn_to_ascii")) {
+                       array_push($notices, "PHP support for Internationalization Functions is required to handle Internationalized Domain Names.");
+               }
                if (count($notices) > 0) {
                        print_notice("Configuration check succeeded with minor problems:");