diff options
author | Urban Müller | 2019-04-04 14:46:07 +0200 |
---|---|---|
committer | Urban Müller | 2019-04-04 14:46:07 +0200 |
commit | 6a24a37e8e203ff0f7700fea0a3792dd387dc401 (patch) | |
tree | a1fe3c76d78e12724b7ce938becfc4069666b4ab | |
parent | af3fa671c551d25fcf29762e8e46fe4173b0514e (diff) | |
download | itools-6a24a37e8e203ff0f7700fea0a3792dd387dc401.tar.gz itools-6a24a37e8e203ff0f7700fea0a3792dd387dc401.tar.bz2 itools-6a24a37e8e203ff0f7700fea0a3792dd387dc401.zip |
warn if oversized urls are generated
-rw-r--r-- | it_html.class | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/it_html.class b/it_html.class index 390e8ae..65d1eaa 100644 --- a/it_html.class +++ b/it_html.class @@ -548,7 +548,11 @@ static function U(/* ... */) $u['query'] = it_url::params($u['params'] + $params); } - return $schemepart . $u['path'] . ($u['query'] ? "?" . $u['query'] : "") . ($u['fragment'] ? "#" . $u['fragment'] : ""); + $url = $schemepart . $u['path'] . ($u['query'] ? "?" . $u['query'] : "") . ($u['fragment'] ? "#" . $u['fragment'] : ""); + if (strlen($url) >= 2000) + it::error(['title' => 'url too long', 'body' => $url]); + + return $url; } |