This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "FusionForge".
The branch, Branch_5_1 has been updated
via 3004b6903bb4f5ccbdd054be466b0ca50e833250 (commit)
via 4c39665a5e8281bb4932931eb9a1d2b1372087cf (commit)
via dad37574492789add570afbc0b6166e0be0bdf86 (commit)
from 46457e98aba26896b26e30d734ba720984074091 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 3004b6903bb4f5ccbdd054be466b0ca50e833250
Author: Thorsten Glaser <[email protected]>
Date: Mon Jun 16 15:52:58 2014 +0200
exit_not_logged_in (but not exit_missing_param!) to temporary redirect
[#685]
diff --git a/src/common/include/exit.php b/src/common/include/exit.php
index 9e2b3a7..6053b02 100644
--- a/src/common/include/exit.php
+++ b/src/common/include/exit.php
@@ -57,7 +57,8 @@ function exit_permission_denied($reason_descr='',$toptab='') {
*/
function exit_not_logged_in() {
//instead of a simple error page, now take them to the login page
- session_redirect
("/account/login.php?triggered=1&return_to=".urlencode(getStringFromServer('REQUEST_URI')));
+ session_redirect("/account/login.php?triggered=1&return_to=" .
+ urlencode(getStringFromServer('REQUEST_URI')), false);
}
/**
commit 4c39665a5e8281bb4932931eb9a1d2b1372087cf
Author: Thorsten Glaser <[email protected]>
Date: Mon Jun 16 15:50:41 2014 +0200
RFC 2616¹ says redirections SHOULD contain a hypertext note, not plaintext
① Yes, I know of http://heise.de/-2217866 but this was quicker to look up…
diff --git a/src/common/include/session.php b/src/common/include/session.php
index 1be58be..163daa4 100644
--- a/src/common/include/session.php
+++ b/src/common/include/session.php
@@ -383,7 +383,14 @@ function session_redirect_uri($loc, $permanent=true) {
else
sysdebug_off("Status: 303 See Other", true, 303);
header("Location: ${loc}", true);
- echo "\nPlease go to ${loc} instead!\n";
+ header("Content-type: text/html");
+ echo '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"' .
+ ' "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">' . "\n" .
+ '<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"><head>' .
+ "\n <title>Redirection</title>\n</head><body>\n" .
+ "<p>Please go to " . html_e('a', array(
+ 'href' => $loc,
+ ), util_html_encode($loc)) . " instead!</p>\n</body></html>\n";
exit;
}
commit dad37574492789add570afbc0b6166e0be0bdf86
Author: Thorsten Glaser <[email protected]>
Date: Mon Jun 16 15:46:29 2014 +0200
implement the ability to use non-permanent redirects [#685]
diff --git a/src/common/include/session.php b/src/common/include/session.php
index bf951bb..1be58be 100644
--- a/src/common/include/session.php
+++ b/src/common/include/session.php
@@ -377,8 +377,11 @@ function session_cookie($name, $value, $domain='',
$expiration=0) {
* @param string Absolute URI
* @return never returns
*/
-function session_redirect_uri($loc) {
- sysdebug_off("Status: 301 Moved Permanently", true, 301);
+function session_redirect_uri($loc, $permanent=true) {
+ if ($permanent)
+ sysdebug_off("Status: 301 Moved Permanently", true, 301);
+ else
+ sysdebug_off("Status: 303 See Other", true, 303);
header("Location: ${loc}", true);
echo "\nPlease go to ${loc} instead!\n";
exit;
@@ -390,8 +393,8 @@ function session_redirect_uri($loc) {
* @param string Absolute path within the site
* @return never returns
*/
-function session_redirect($loc) {
- session_redirect_uri(util_make_url($loc));
+function session_redirect($loc, $permanent=true) {
+ session_redirect_uri(util_make_url($loc), $permanent);
}
/**
-----------------------------------------------------------------------
Summary of changes:
src/common/include/exit.php | 3 ++-
src/common/include/session.php | 20 +++++++++++++++-----
2 files changed, 17 insertions(+), 6 deletions(-)
hooks/post-receive
--
FusionForge
_______________________________________________
Fusionforge-commits mailing list
[email protected]
http://lists.fusionforge.org/cgi-bin/mailman/listinfo/fusionforge-commits