PDA

View Full Version : I found the edit post bug!!!



WebStyles
Fri 12th May '00, 2:29pm
Actually, Aaron (werehere) and I found it together. :)

Line 95 of editpost.php reads as follows in the stock version:

if (($getperms[canedit]==0 or $getperms[candelete]==0) and $getperms[canadminedit]==0) {

We don't have deleting of posts enabled, that's why it was such a problem on our board (and not a problem on this board). We changed this line to read:

if ($getperms[canedit]==0 and $getperms[canadminedit]==0) {

And it works flawlessly now... And people are not allowed to delete their posts, since that check is later in the script. Basically, the first code checks to see if either editing or deleting is disabled (if the person isn't an admin or mod of that forum) and gives the no_permission error. I would caution everyone to get John's ok before adding this to your board, but it's running on were-here.com (http://www.were-here.com/forums/index.php) and everything looks to work exactly as planned. :)

Parker Clack
Fri 12th May '00, 3:38pm
Just what I wanted. I hope John incorporates this into the next release version.

Parker

werehere
Fri 12th May '00, 3:50pm
Yeah it seems to work flawlessly:)

Menno
Fri 12th May '00, 4:43pm
cool, one big, bad bug out of the way :)
good one, guys

John
Sun 14th May '00, 8:50am
Woohoo!

Thanks soooo much Webstyles! I had been looking at login and cookie things, but never thought to look at that. At last - it has been found.

Just confirming that code that was posted:



if ($getperms[canedit]==0 and $getperms[candelete]==0 and $getperms[canadminedit]==0) {


For line 95 in editpost.php

Cheers,

John


[Edited by John on 05-15-2000 at 12:52 AM]

WebStyles
Sun 14th May '00, 8:56am
No problem John! :)

The current code on line 95 of editpost.php (if ($getperms[canedit]==0 and $getperms[candelete]==0 and $getperms[canadminedit]==0) {) should be replaced with:


if ($getperms[canedit]==0 and $getperms[canadminedit]==0) {

:)