Please forgive the length of this message, I'm trying to be comprehensive and I can't find the specfic cause of the error.
Please bear with me.
Now ... within each of these code blocks, the text input into the edit box is identicle (it's been cut and pasted).
However, if you look at the last line of the long PHP block, you'll see the eval line is missing the last escaping \ .
If you look at the isolated eval line within the PHP block, it is not missing this slash.
The text within the edit box is exactly the same, yet vB is eliminating the slash (at the least) from the long code block. Does anyone have an explanation?
Please bear with me.
PHP Code:
// #################################### Change Vote ##########################################
if ($action=="changevote")
{
// other permissions?
$permissions=getpermissions($forumid);
if (!$permissions[canview] or !$permissions[canvote]) {
show_nopermission();
}
$pollid=verifyid("poll",$pollid);
$pollinfo=$DB_site->query_first("SELECT * FROM poll WHERE pollid='$pollid'");
$voteinfo=$DB_site->query_first("SELECT * FROM pollvote WHERE userid='$bbuserinfo[userid]' AND pollid='$pollid'");
$threadinfo=$DB_site->query_first("SELECT * FROM thread WHERE pollid='$pollid' AND open<>10");
$threadcache[$threadinfo[threadid]]=$threadinfo;
//check if poll is closed
if (!$pollinfo[active] or !$threadinfo[open] or ($pollinfo[dateline]+($pollinfo[timeout]*86400)<time() and $pollinfo[timeout]!=0)){ //poll closed
eval("standarderror(\"".gettemplate("error_pollclosed")."\");");
exit;
}
//check if a user has already voted - abuse management
if (!$uservoteinfo=$DB_site->query_first("SELECT userid FROM pollvote WHERE userid=$bbuserinfo[userid] AND pollid='$pollid'"))
{
//the user has not voted yet
eval("standarderror(\"".gettemplate("error_userhasnotvoted")."\");");
exit;
}
//Error checking complete, lets get the options
$timenow = time();
$DB_site->query("DELETE FROM pollvote WHERE pollid='$pollid' AND userid='$bbuserinfo[userid]' LIMIT 1");
$splitvotes=explode("|||",$pollinfo[votes]);
$splitvotes[$voteinfo[voteoption]-1]--;
$counter=0;
while ($counter<$pollinfo[numberoptions]) {
$votesstring.="|||".intval($splitvotes[$counter]);
$counter++;
}
if (substr($votesstring,0,3)=="|||") {
$votesstring=substr($votesstring,3);
}
$DB_site->query("UPDATE poll SET votes='".addslashes($votesstring)."' WHERE pollid='$pollid'");
//make last reply date == last vote date
if ($updatelastpost){ //option selected in CP
$DB_site->query("UPDATE thread SET lastpost=$timenow WHERE threadid=$threadinfo[threadid]");
}
// redirect
eval("standardredirect(\"".gettemplate("redirect_pollchange")."\",\"showthread.php?s=$session[sessionhash]&threadid=$threadinfo[threadid]\");");
}
PHP Code:
// redirect
eval("standardredirect(\"".gettemplate("redirect_pollchange")."\",\"showthread.php?s=$session[sessionhash]&threadid=$threadinfo[threadid]\");");
}
However, if you look at the last line of the long PHP block, you'll see the eval line is missing the last escaping \ .
If you look at the isolated eval line within the PHP block, it is not missing this slash.
The text within the edit box is exactly the same, yet vB is eliminating the slash (at the least) from the long code block. Does anyone have an explanation?
Comment