diff options
author | Christian Schneider | 2020-04-21 15:58:21 +0200 |
---|---|---|
committer | Christian Schneider | 2020-04-21 15:58:21 +0200 |
commit | 9162e288d0b407ebf4823560c42968b4ab23ee91 (patch) | |
tree | 461311c3e693a84e5cc6ea53a1473afb65a9ba2f | |
parent | d97be87bf87c6c50bc565c2d09beca164802271c (diff) | |
download | itools-9162e288d0b407ebf4823560c42968b4ab23ee91.tar.gz itools-9162e288d0b407ebf4823560c42968b4ab23ee91.tar.bz2 itools-9162e288d0b407ebf4823560c42968b4ab23ee91.zip |
Warn about missing language overrides for subrequests, i.e. LU() instead of U(). Always on on twin/live and enabled with subreqcheck on devel
-rw-r--r-- | it_url.class | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/it_url.class b/it_url.class index 765a504..0ab4e34 100644 --- a/it_url.class +++ b/it_url.class @@ -162,6 +162,9 @@ function parse_http_header($header) static function _default_headers($url, $p) { + if ((!it::is_devel() || EDC('subreqcheck')) && $p['url'] && T_lang() != T_defaultlang() && it::match('search\.ch/', $p['url']) && !it::match('\blogin\.|banner\.html|/itjs/|/images/|\.(de|fr|en|it)(\.js|\.html|\.php|\.ics|\.pdf|\.json)|machines\.txt', $p['url'])) + it::error(['title' => "Subrequest without language override", 'body' => [ $p ]]); + $headers = [ 'Host' => $url->realhostname . $url->explicitport, 'User-Agent' => "Mozilla/5.0 (compatible; MSIE 9.0; ITools)", |