Some double quotes to single, use optional_param for $reply.

I 'm debugging some PHP5 notices which aren't just notices, they imply
there's a bug somewhere here? Or maybe an inconsistency in parameter types
of the variables being passed around...
This commit is contained in:
defacer
2005-04-26 20:39:08 +00:00
parent 544a4b8a4d
commit 16955dc619
+6 -4
View File
@@ -2,8 +2,10 @@
// Edit and save a new post to a discussion
require_once("../../config.php");
require_once("lib.php");
require_once('../../config.php');
require_once('lib.php');
$reply = optional_param('reply', 0, PARAM_INT);
if (isguest()) {
$wwwroot = $CFG->wwwroot.'/login/index.php';
@@ -15,7 +17,7 @@
if (! $forum = get_record('forum', 'id', $forum)) {
error('The forum number was incorrect');
}
} else if (isset($reply)) { // User is writing a new reply
} else if (!empty($reply)) { // User is writing a new reply
if (! $parent = forum_get_post_full($reply)) {
error('Parent post ID was incorrect');
}
@@ -233,7 +235,7 @@
forum_set_return();
} else if (isset($reply)) { // User is writing a new reply
} else if (!empty($reply)) { // User is writing a new reply
if (! $parent = forum_get_post_full($reply)) {
error("Parent post ID was incorrect");