diff options
author | Starla Insigna <starla4444@gmail.com> | 2010-12-11 14:05:05 -0500 |
---|---|---|
committer | Starla Insigna <starla4444@gmail.com> | 2010-12-11 14:05:05 -0500 |
commit | 74db7a24d9c2230b104979f4e4981c57ff73de71 (patch) | |
tree | 3059bb0a955a662cd9e04208eb6276071cea4c8a /rss.php | |
parent | 9efe4feaf5e19e51a18a229a6db36c5508e9faea (diff) | |
download | fourisland-74db7a24d9c2230b104979f4e4981c57ff73de71.tar.gz fourisland-74db7a24d9c2230b104979f4e4981c57ff73de71.tar.bz2 fourisland-74db7a24d9c2230b104979f4e4981c57ff73de71.zip |
Made Four Island 2 a little more sane
I spent the last few hours sanitizing the database and fixing huge bugs in the code. Among the changes made were: - "Theoretically related posts" have been removed due to the lack of FULLTEXT index support in InnoDB tables - Removed tons of stripslashes() calls that were used to remove slashes from records before I realized (while doing all of this work) that magic_quotes_gpc was on for some reason. I mean, like, come on! - Replaced all non-library uses of htmlentities() with htmlspecialchars(), which basically does the same thing except it doesn't mangle Unicode. - Completely eradicated polls. Note that this does mean that all database backups prior to December 11th 2010 are now incompatible with Four Island.
Diffstat (limited to 'rss.php')
-rwxr-xr-x | rss.php | 34 |
1 files changed, 3 insertions, 31 deletions
diff --git a/rss.php b/rss.php index 2a72d8a..fddd631 100755 --- a/rss.php +++ b/rss.php | |||
@@ -59,9 +59,6 @@ if (isset($_GET['mode'])) | |||
59 | case 'quotes': | 59 | case 'quotes': |
60 | ?> Quotes<?php | 60 | ?> Quotes<?php |
61 | break; | 61 | break; |
62 | case 'poll': | ||
63 | ?> Polls<?php | ||
64 | break; | ||
65 | case 'comments': | 62 | case 'comments': |
66 | ?> Comments<?php | 63 | ?> Comments<?php |
67 | break; | 64 | break; |
@@ -95,9 +92,6 @@ if (isset($_GET['mode'])) | |||
95 | case 'quotes': | 92 | case 'quotes': |
96 | ?>An archive of all Four Island quotes<?php | 93 | ?>An archive of all Four Island quotes<?php |
97 | break; | 94 | break; |
98 | case 'poll': | ||
99 | ?>An archive of all of the Four Island POTWs<?php | ||
100 | break; | ||
101 | case 'comments': | 95 | case 'comments': |
102 | ?>An archive of all of the comments people have left on Four Island<?php | 96 | ?>An archive of all of the comments people have left on Four Island<?php |
103 | break; | 97 | break; |
@@ -149,18 +143,6 @@ if (!isset($_GET['mode']) || ($_GET['mode'] == 'quotes')) | |||
149 | } | 143 | } |
150 | } | 144 | } |
151 | 145 | ||
152 | if ($_GET['mode'] == 'poll') | ||
153 | { | ||
154 | $getpolls = "SELECT * FROM polloftheweek"; | ||
155 | $getpolls2 = mysql_query($getpolls); | ||
156 | while (($items[$i] = mysql_fetch_array($getpolls2)) && ($i < ($si+10))) | ||
157 | { | ||
158 | $items[$i]['sortDate'] = strtotime($items[$i]['week']); | ||
159 | $items[$i]['itemType'] = 'poll'; | ||
160 | $i++; | ||
161 | } | ||
162 | } | ||
163 | |||
164 | if (!isset($_GET['mode']) || ($_GET['mode'] == 'comments')) | 146 | if (!isset($_GET['mode']) || ($_GET['mode'] == 'comments')) |
165 | { | 147 | { |
166 | $getcomments = "SELECT * FROM comments ORDER BY id DESC LIMIT 0,10"; | 148 | $getcomments = "SELECT * FROM comments ORDER BY id DESC LIMIT 0,10"; |
@@ -204,14 +186,6 @@ if (!isset($_GET['mode']) || ($_GET['mode'] == 'comments')) | |||
204 | $items[$i]['title'] = '"' . $getpost3['title'] . '"'; | 186 | $items[$i]['title'] = '"' . $getpost3['title'] . '"'; |
205 | $items[$i]['url'] = 'blog/' . $getpost3['slug'] . '/'; | 187 | $items[$i]['url'] = 'blog/' . $getpost3['slug'] . '/'; |
206 | break; | 188 | break; |
207 | case 'polloftheweek': | ||
208 | $getpoll = "SELECT * FROM polloftheweek WHERE id = " . $comID; | ||
209 | $getpoll2 = mysql_query($getpoll); | ||
210 | $getpoll3 = mysql_fetch_array($getpoll2); | ||
211 | |||
212 | $items[$i]['title'] = '"' . $getpoll3['question'] . '"'; | ||
213 | $items[$i]['url'] = 'poll/' . $getpoll3['id'] . '.php'; | ||
214 | break; | ||
215 | case 'quote': | 189 | case 'quote': |
216 | $getquote = "SELECT * FROM rash_quotes WHERE id = " . $comID; | 190 | $getquote = "SELECT * FROM rash_quotes WHERE id = " . $comID; |
217 | $getquote2 = mysql_query($getquote); | 191 | $getquote2 = mysql_query($getquote); |
@@ -253,7 +227,7 @@ foreach ($items as $key => $value) | |||
253 | 227 | ||
254 | <link>http://fourisland.com/blog/<?php echo($value['slug']); ?>/</link> | 228 | <link>http://fourisland.com/blog/<?php echo($value['slug']); ?>/</link> |
255 | 229 | ||
256 | <description><?php echo(stripslashes(htmlentities(parseText($value['text'])))); ?></description> | 230 | <description><?php echo(htmlspecialchars(parseText($value['text']))); ?></description> |
257 | 231 | ||
258 | <pubDate><?php echo(date('D, d M Y H:i:s O',$value['sortDate'])); ?></pubDate> | 232 | <pubDate><?php echo(date('D, d M Y H:i:s O',$value['sortDate'])); ?></pubDate> |
259 | </item> | 233 | </item> |
@@ -266,14 +240,12 @@ foreach ($items as $key => $value) | |||
266 | 240 | ||
267 | <link>http://fourisland.com/quotes/<?php echo(urlencode($value['id'])); ?>.php</link> | 241 | <link>http://fourisland.com/quotes/<?php echo(urlencode($value['id'])); ?>.php</link> |
268 | 242 | ||
269 | <description><?php echo(htmlentities(nl2br($value['quote']))); ?></description> | 243 | <description><?php echo(htmlspecialchars(nl2br($value['quote']))); ?></description> |
270 | 244 | ||
271 | <pubDate><?php echo(date('D, d M Y H:i:s O',$value['sortDate'])); ?></pubDate> | 245 | <pubDate><?php echo(date('D, d M Y H:i:s O',$value['sortDate'])); ?></pubDate> |
272 | </item> | 246 | </item> |
273 | <?php | 247 | <?php |
274 | break; | 248 | break; |
275 | case 'poll': | ||
276 | break; | ||
277 | case 'comment': | 249 | case 'comment': |
278 | ?> | 250 | ?> |
279 | <item> | 251 | <item> |
@@ -281,7 +253,7 @@ foreach ($items as $key => $value) | |||
281 | 253 | ||
282 | <link>http://fourisland.com/<?php echo($value['url']); ?>#comment-<?php echo($value['id']); ?></link> | 254 | <link>http://fourisland.com/<?php echo($value['url']); ?>#comment-<?php echo($value['id']); ?></link> |
283 | 255 | ||
284 | <description><?php echo(stripslashes(htmlentities(parseText($value['comment'])))); ?></description> | 256 | <description><?php echo(htmlspecialchars(parseText($value['comment']))); ?></description> |
285 | 257 | ||
286 | <pubDate><?php echo(date('D, d M Y H:i:s O',$value['sortDate'])); ?></pubDate> | 258 | <pubDate><?php echo(date('D, d M Y H:i:s O',$value['sortDate'])); ?></pubDate> |
287 | </item> | 259 | </item> |