PDA

View Full Version : Bug in latest WebPost2


felfert
22-12-2002, 18:43
Just found a bug:

When a channel or a channel topic contains single-quotes, the SQL query for updating the server details fails.

I solved it this way:

In db_inc.php:

function escapequote($var1) {
return(ereg_replace("'", "\\'", $var1));
}

In db_inc.php, function insertchannelinfo:

...
$channeldata5 = escapequote(addslashes(htmlspecialchars(trim($chan neldata[5])))); // name
$channeldata8 = escapequote(trim($channeldata[8])); // topic


-Fritze

PS:
Would be nice to have a mail-address from the developer for sending patches. This WebForum software sucks when one wants to send patches...

Gryphon
23-12-2002, 03:13
addslashes should be doing this already, I will expierement with this more, thanks.

I will have a new version out soon that will have a bug reporting section along with an admin panel.

Bigman
23-12-2002, 10:58
Is there anyway of running the script and the server on the same machine behind a router. I have managed to do it so it shows the external ip instead of the local one, although the channel listings will not show as it says the tcp query port is closed as its on one machine. If that makes sense lol.:confused:

Gryphon
23-12-2002, 19:10
The only way to do it without some code hacking is to use your external IP for your PostURL. If you are not getting channels displayed, this is a port issue. If you have trouble opening port 51234, try changing it to another port.

Gryphon
23-12-2002, 19:39
Originally posted by Gryphon
addslashes should be doing this already, I will expierement with this more, thanks.

Thanks Fritze, all it needs is addslashes for chandata8. Should be the only line that needs fixed. Fixed in next version.


$channeldata8 = addslashes(trim($channeldata[8])); // topic

Supermike
15-02-2003, 11:57
I know this is an old thread, sorry for the bump.

the port to be opened, is it udp, or tcp

im hoping it solves my probs, i cant get the server info to post. server and script on the same machine behind a software router (sygate)

felfert
15-02-2003, 12:24
Guess why it's called WebPost :)

It is a plain HTTP POST request, therefore it is TCP. The port number is usually 80 but can be specified in the URL so it is depending on your configuration.

For MySQL it is usually TCP/3306 but this also can be configured and for making the connection back to the teamspeak-server, the default port is TCP/51234.

-Fritz

Supermike
15-02-2003, 19:23
Thanks, i thought it was TCP, but i wanted to make sure, cause i already had it open. Still not sure why the port would matter if the script and the server were on the same box