cvs: php-bugs-web / vote.php

From: Date: Sat, 07 Aug 2004 14:25:38 +0000
Subject: cvs: php-bugs-web / vote.php
Groups: php.mirrors 
Request: Send a blank email to php-mirrors+get-25722@lists.php.net to get a copy of this message
jacques Sat Aug 7 10:25:38 2004 EDT Modified files: /php-bugs-web vote.php Log: verify the bug id is real (no voting on unreported bugs! :) http://cvs.php.net/diff.php/php-bugs-web/vote.php?r1=1.11&r2=1.12&ty=u Index: php-bugs-web/vote.php diff -u php-bugs-web/vote.php:1.11 php-bugs-web/vote.php:1.12 --- php-bugs-web/vote.php:1.11 Sat Aug 7 05:29:39 2004 +++ php-bugs-web/vote.php Sat Aug 7 10:25:38 2004 @@ -21,11 +21,19 @@ or die("Unable to connect to SQL server."); @mysql_select_db("phpbugdb"); +$query = "SELECT id FROM bugdb WHERE id=" . $id . " LIMIT 1"; +$res = mysql_num_rows(mysql_query($query)); + +if (!$res) { + commonHeader("No such bug."); + echo "<h1 class=\"error\">No such bug #$id!</h1>"; + commonFooter(); + exit; +} + $ip = ip2long(get_real_ip()); // TODO: check if ip address has been banned. hopefully this will // never need to be implemented. - -// verify the bug id is real (no voting on unreported bugs! :) // add the vote $query = "INSERT INTO bugdb_votes (bug,ip,score,reproduced,tried,sameos,samever)"

« previous php.mirrors (#25722) next »