diff --git a/admin-bar-partial.php b/admin-bar-partial.php index 0018a0c..c1b7bc3 100644 --- a/admin-bar-partial.php +++ b/admin-bar-partial.php @@ -4,8 +4,8 @@ diff --git a/blog_log.php b/blog_log.php index 50d1a2c..c1ef330 100644 --- a/blog_log.php +++ b/blog_log.php @@ -4,7 +4,7 @@ $invalid = false; $logged_in = $_COOKIE["checkin"] ?? null; if ( $logged_in && $logged_in == "waiting for expiry" ) { - header("Location: /admin.php"); + header("Location: admin.php"); die(); } $user = $_POST["user"] ?? null; @@ -17,7 +17,7 @@ error_log( BLOG_HASH ); if ( $secret == BLOG_HASH ) { setcookie("checkin", "waiting for expiry", time()+60*60*24*30, "/", "", false, true); - header("Location: /admin.php"); + header("Location: admin.php"); die(); } else { $invalid = true; @@ -35,7 +35,7 @@ PHP; $success = file_put_contents( PW_FILE, sprintf( $template, $secret ) ); if ( !$success ) die( "Internal server error" ); setcookie("checkin", "waiting for expiry", time()+60*60*24*30, "/", "", false, true); - header("Location: /admin.php"); + header("Location: admin.php"); die(); } } diff --git a/delete_data.php b/delete_data.php index 4c24f17..97d83cf 100644 --- a/delete_data.php +++ b/delete_data.php @@ -5,13 +5,13 @@ $kind = $_GET["k"] ?? null; // Err if all parts didnt arrive if ( !file || !$kind ) { - header("Location: /admin.php?success=0"); + header("Location: admin.php?success=0"); die(); } // Err if not a valid prefix if ( $kind !== "media" && $kind !== "posts" ) { - header("Location: /admin.php?success=0"); + header("Location: admin.php?success=0"); die(); } @@ -20,16 +20,16 @@ $path = realpath( $kind . "/" . $file ); // Err if file does not exist if ( !file_exists($path) ) { error_log( "File does not exist: " . $path ); - header("Location: /admin.php?success=0"); + header("Location: admin.php?success=0"); die(); } if ( is_writable( $path ) ) { $success = unlink( $path ) ? "6" : "0"; - header("Location: /admin.php?success=" . $success); + header("Location: admin.php?success=" . $success); die(); } else { error_log( "File not writable: " . $path ); - header("Location: /admin.php?success=0"); + header("Location: admin.php?success=0"); die(); } diff --git a/edit.php b/edit.php index 02ff763..5520b97 100644 --- a/edit.php +++ b/edit.php @@ -10,10 +10,10 @@ if ( $update && $f ) { $success = file_put_contents( $f, $update ); if ( $success ) { - header("Location: /admin.php?success=2"); + header("Location: admin.php?success=2"); die(); } else { - header("Location: /admin.php?success=0"); + header("Location: admin.php?success=0"); die(); } } @@ -31,11 +31,11 @@ } $update = file_get_contents( $f ); if ( !$update ) { - header("Location: /admin.php?success=0"); + header("Location: admin.php?success=0"); die(); } } else { - header("Location: /admin.php?success=0"); + header("Location: admin.php?success=0"); die(); } ?> diff --git a/logcheck.php b/logcheck.php index 7c5197e..ef4ef81 100644 --- a/logcheck.php +++ b/logcheck.php @@ -7,6 +7,6 @@ if ( __FILE__ == $_SERVER['SCRIPT_FILENAME'] ) { $logged_in = $_COOKIE["checkin"] ?? null; if ( !$logged_in || $logged_in != "waiting for expiry" ) { - header("Location: /blog_log.php"); + header("Location: blog_log.php"); die(); } diff --git a/logout.php b/logout.php index c2fdcb1..34a7bf0 100644 --- a/logout.php +++ b/logout.php @@ -3,6 +3,6 @@ if ( $logged_in && $logged_in == "waiting for expiry" ) { setcookie("checkin", "", time() - 3600); } - header("Location: /blog_log.php"); + header("Location: blog_log.php"); die(); diff --git a/new-post.php b/new-post.php index eb97420..73f1f4c 100644 --- a/new-post.php +++ b/new-post.php @@ -2,7 +2,7 @@ // Bounce if not logged in $logged_in = $_COOKIE["checkin"] ?? null; if ( !$logged_in || $logged_in != "waiting for expiry" ) { - header("Location: /blog_log.php"); + header("Location: blog_log.php"); die(); } @@ -12,7 +12,7 @@ // Bounce if requirements are not met for the post if ( !$title || !$body || $title == "" || $body == "" ) { - header("Location: /blog_log.php?success=0"); + header("Location: blog_log.php?success=0"); die(); } @@ -20,9 +20,9 @@ $success = file_put_contents( "./posts/" . $ts . "_" . urlencode( $title ) . ".md", $body ); if ( $success ) { // Yay! Redirect to admin - header("Location: /admin.php?success=1"); + header("Location: admin.php?success=1"); die(); } else { - header("Location: /admin.php?success=0"); + header("Location: admin.php?success=0"); die(); } diff --git a/site_actions.php b/site_actions.php index 6bc167a..d8cc4de 100644 --- a/site_actions.php +++ b/site_actions.php @@ -5,7 +5,7 @@ if ( !is_null( $simplecss ) ) { $file_data = file_get_contents( "config.php" ); if ( !$file_data ) { - header("Location: /admin.php?success=0"); + header("Location: admin.php?success=0"); die(); } $re = '/(const\s+SIMPLE_CSS\s+=\s+)(true|false)(\s*;)/m'; @@ -13,14 +13,14 @@ $result = preg_replace($re, $subst, $file_data); $success = file_put_contents( "config.php", $result ); if ( $success ) { - header("Location: /admin.php?success=2"); + header("Location: admin.php?success=2"); die(); } else { - header("Location: /admin.php?success=0"); + header("Location: admin.php?success=0"); die(); } } - header("Location: /admin.php"); + header("Location: admin.php"); die();