Skip to content

Instantly share code, notes, and snippets.

@Tyrael
Created May 7, 2012 23:11
Show Gist options
  • Save Tyrael/2631293 to your computer and use it in GitHub Desktop.
Save Tyrael/2631293 to your computer and use it in GitHub Desktop.
bugsweb better fix for the original problem
diff --git a/www/bug.php b/www/bug.php
index 1b3474c..fe24674 100644
--- a/www/bug.php
+++ b/www/bug.php
@@ -158,8 +158,9 @@ if (!empty($_POST['in'])) {
if ($user_flags & BUGS_DEV_USER) {
$block_user = isset($_POST['in']['block_user_comment']) ? 'Y' : 'N';
}
- if ($is_security_developer) {
- $is_private = isset($_POST['in']['private']) ? 'Y': 'N';
+ // security devs can change the private flag, if the field is set 'N' will make it private, everything else 'Y'. fail secure
+ if ($is_security_developer && isset($_POST['in']['private'])) {
+ $is_private = $_POST['in']['private'] == 'N' ? 'N': 'Y';
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment