From fc2e6ea172747c201ba0529f157d1ce26727747d Mon Sep 17 00:00:00 2001 From: Zach Copley Date: Thu, 4 Aug 2011 12:06:57 -0700 Subject: [PATCH 1/2] Fix syntax err --- scripts/createsim.php | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/scripts/createsim.php b/scripts/createsim.php index 4912d2a61b..64ad907cb0 100644 --- a/scripts/createsim.php +++ b/scripts/createsim.php @@ -221,7 +221,7 @@ function newJoin($u, $g) function testNoticeContent() { global $words; - + if (is_null($words)) { return "test notice content"; } @@ -235,11 +235,11 @@ function testNoticeContent() } $text = implode(' ', $parts); - + if (mb_strlen($text) > 80) { $text = substr($text, 0, 77) . "..."; } - + return $text; } @@ -311,7 +311,7 @@ function main($usercount, $groupcount, $noticeavg, $subsavg, $joinsavg, $tagmax) } } -$defaultWordfile = '/usr/share/dict/words'; +$defaultWordsfile = '/usr/share/dict/words'; $usercount = (have_option('u', 'users')) ? get_option_value('u', 'users') : 100; $groupcount = (have_option('g', 'groups')) ? get_option_value('g', 'groups') : 20; @@ -321,14 +321,14 @@ $joinsavg = (have_option('j', 'joins')) ? get_option_value('j', 'joins') : 5; $tagmax = (have_option('t', 'tags')) ? get_option_value('t', 'tags') : 10000; $userprefix = (have_option('x', 'prefix')) ? get_option_value('x', 'prefix') : 'testuser'; $groupprefix = (have_option('z', 'groupprefix')) ? get_option_value('z', 'groupprefix') : 'testgroup'; -$wordsfile = (have_option('w', 'words')) ? get_option_value('w', 'words') : $defaultWordfile; +$wordsfile = (have_option('w', 'words')) ? get_option_value('w', 'words') : $defaultWordsfile; if (is_readable($wordsfile)) { $words = file($wordsfile); } else { - if ($wordsfile != $defaultWordfile) { + if ($wordsfile != $defaultWordsfile) { // user specified words file couldn't be read - throw new Exception("Couldn't read words file: {$wordfile}."); + throw new Exception("Couldn't read words file: {$wordsfile}."); } $words = null; } From 0502e1d737af1586a7a280be005e55d85c71175a Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Fri, 5 Aug 2011 10:42:18 -0400 Subject: [PATCH 2/2] Properly structure X-XSS-Protection header --- lib/htmloutputter.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/htmloutputter.php b/lib/htmloutputter.php index e358b2be5d..9a43ef069e 100644 --- a/lib/htmloutputter.php +++ b/lib/htmloutputter.php @@ -111,7 +111,7 @@ class HTMLOutputter extends XMLOutputter // Output anti-framing headers to prevent clickjacking (respected by newer // browsers). if (common_config('javascript', 'bustframes')) { - header('X-XSS-Protection 1; mode=block'); // detect XSS Reflection attacks + header('X-XSS-Protection: 1; mode=block'); // detect XSS Reflection attacks header('X-Frame-Options: SAMEORIGIN'); // no rendering if origin mismatch }