# HG changeset patch # User Matti Hamalainen # Date 1315843220 -10800 # Node ID 687bdd74dfac04192e7c2fe7ceec18c1721b7c91 # Parent b4fdb3300faa092a3ab1a99418952682a281b934 urllog: Check if TLS support is enabled when checking if we can fetch title information via HTTP or SSL/HTTP. diff -r b4fdb3300faa -r 687bdd74dfac urllog.tcl --- a/urllog.tcl Mon Sep 12 18:57:52 2011 +0300 +++ b/urllog.tcl Mon Sep 12 19:00:20 2011 +0300 @@ -363,6 +363,7 @@ global urllog_tlds urllog_check urlmsg_nosuchhost urlmsg_ioerror global urlmsg_timeout urlmsg_errorgettingdoc urllog_httprep global urllog_shorturl_prefix urllog_shorturl urllog_encoding + global http_tls_support ### Try to determine the URL protocol component (if it is missing) set u_checktld 1 @@ -372,7 +373,8 @@ set urlStr "ftp://$urlStr" } - if {[regexp "(ftp|http|https)://(\[0-9\]{1,3})\\.(\[0-9\]{1,3})\\.(\[0-9\]{1,3})\\.(\[0-9\]{1,3})" $urlStr u_match u_prefix ni1 ni2 ni3 ni4]} { + ### Handle URLs that have an IPv4-address + if {[regexp "(\[a-z\]+)://(\[0-9\]{1,3})\\.(\[0-9\]{1,3})\\.(\[0-9\]{1,3})\\.(\[0-9\]{1,3})" $urlStr u_match u_proto ni1 ni2 ni3 ni4]} { # Check if the IP is on local network if {$ni1 == 127 || $ni1 == 10 || ($ni1 == 192 && $ni2 == 168) || $ni1 == 0} { urllog_log "URL pointing to local or invalid network, ignored ($urlStr)." @@ -388,6 +390,11 @@ return 0 } + ### Get URL protocol component + set u_proto "" + if {[regexp "(\[a-z\]+)://" $urlStr u_match u_proto]} { + } + ### Check the PORT (if the ":" is there) set u_record [split $urlStr "/"] set u_hostname [lindex $u_record 2] @@ -441,7 +448,7 @@ } ### Do we perform additional optional checks? - if {$urllog_check == 0 || [string range $urlStr 0 3] != "http"} { + if {$urllog_check == 0 || ($http_tls_support == 0 && $u_proto == "https") || $u_proto != "http"} { # No optional checks, just add the URL, if it does not exist already urllog_addurl $urlStr $urlNick $urlHost $urlChan "" return 1