X-Git-Url: https://jasonwoof.com/gitweb/?a=blobdiff_plain;f=http.php;h=76c6684e304edd78ac9966b7179f71d8f541f3ee;hb=c483b6d8ab1f6aa89c0b5b82d44cc76d29e99a62;hp=1abd50bc1757abe53f46ef77f95ba4734aa6770a;hpb=88edfcf26c7b4cdbd083dede0834de5cf6f16999;p=wfpl.git diff --git a/http.php b/http.php index 1abd50b..76c6684 100644 --- a/http.php +++ b/http.php @@ -1,19 +1,9 @@ . +# This program is in the public domain within the United States. Additionally, +# we waive copyright and related rights in the work worldwide through the CC0 +# 1.0 Universal public domain dedication, which can be found at +# http://creativecommons.org/publicdomain/zero/1.0/ # return our best guess at the url used to access this page, without the path or query string @@ -78,11 +68,14 @@ function redirect($url, $status = '302 Moved Temporarily', $message = '') { if(substr($url, 0, 1) == '/') { $url = this_url_sans_path() . $url; } else { - $url = ereg_replace('/[^/]*$', "/$url", this_url()); + $url = preg_replace('|/[^/]*$|', "/$url", this_url()); } } if(function_exists('session_save_messages')) { + if(function_exists('atexit_now')) { + atexit_now(); + } session_save_messages(); }