mirror of
https://github.com/maxpozdeev/mytinytodo.git
synced 2026-03-11 08:55:27 +00:00
- sometimes parse_url error workaround
This commit is contained in:
parent
0ef925c80a
commit
7bc64d66e6
1 changed files with 1 additions and 0 deletions
|
|
@ -145,6 +145,7 @@ function formatDate3($format, $ay, $am, $ad, $lang)
|
|||
|
||||
function url_dir($url)
|
||||
{
|
||||
if(false !== $p = strpos($url, '?')) $url = substr($url,0,$p); # to avoid parse errors on strange query strings
|
||||
$p = parse_url($url, PHP_URL_PATH);
|
||||
if($p == '') return '/';
|
||||
if(substr($p,-1) == '/') return $p;
|
||||
|
|
|
|||
Loading…
Reference in a new issue