com web/php: Fixing minor typo and output_buffering issue with site headers.: manual/vote-note.php
| From: | Sherif Ramadan | Date: | Thu, 13 Dec 2012 20:38:21 +0000 |
| Subject: | com web/php: Fixing minor typo and output_buffering issue with site headers.: manual/vote-note.php | ||
| Groups: | php.webmaster | ||
| Request: | Send a blank email to php-webmaster+get-15080@lists.php.net to get a copy of this message | ||
Commit: d2524744a9f3198a958913f893295d9f49f343c8
Author: Sherif Ramadan <googleguy@php.net> Thu, 13 Dec 2012 15:38:21 -0500
Parents: 689d00c8bda87e31a30b6684e9812f57687d6d19
Branches: master
Link: http://git.php.net/?p=web/php.git;a=commitdiff;h=d2524744a9f3198a958913f893295d9f49f343c8
Log:
Fixing minor typo and output_buffering issue with site headers.
Changed paths:
M manual/vote-note.php
Diff:
diff --git a/manual/vote-note.php b/manual/vote-note.php
index bb5af7a..8aa3acc 100644
--- a/manual/vote-note.php
+++ b/manual/vote-note.php
@@ -10,6 +10,7 @@ include $_SERVER['DOCUMENT_ROOT'] ..
'/manual/spam_challenge.php';
// Initialize global variables
$error = false;
$thankyou = false;
+$headerset = false;
$BACKpage = htmlspecialchars(isset($_REQUEST['page']) ? $_REQUEST['page'] :
'');
$BACKid = htmlspecialchars(isset($_REQUEST['id']) ? $_REQUEST['id'] :
'');
$link = "/{$BACKpage}#{$BACKid}";
@@ -100,12 +101,13 @@ if ($_SERVER['REQUEST_METHOD'] == 'POST') {
}
}
else {
- $error = "Invalid request.3";
+ $error = "Invalid request.";
}
}
else {
// Site header
site_header("Vote On User Notes");
+ $headerset = true;
if (!empty($_REQUEST['id']) && !empty($_REQUEST['page']) &&
($N = manual_notes_load($_REQUEST['page'])) &&
array_key_exists($_REQUEST['id'], $N) && !empty($_REQUEST['vote'])
&& ($_REQUEST['vote'] === 'up' || $_REQUEST['vote'] ===
'down')) {
?>
@@ -156,7 +158,10 @@ if ($error) {
</p>
</div>
EOL;
-if (!headers_sent()) site_header("Error - Voting");
+if (!$headerset) {
+ site_header("Error - Voting");
+ $headerset = true;
+}
?>
<div class="container" id="notes-dialog" style="width: 100%;
padding-bottom: 15px; margin: auto;">
<div style="width: 100%; margin: auto;"><h1>Voting</h1></div>
@@ -194,6 +199,7 @@ if (!headers_sent()) site_header("Error - Voting");
}
if ($thankyou) {
site_header("Thank you for voting!");
+ $headerset = true;
?>
<div class="container" id="notes-dialog" style="width: 100%; padding:
15px; margin: auto;">
<h1>Thanks for voting!</h1>