L* R*
HOME FORUM DOWNLOADS
Content
  Links
     Browse SVN
     SVN Commit log
     Documentation (Wiki)
  Developers
     Taskmanager
User
Welcome, Guest. Please login or register.
Did you miss your activation email?
December 01, 2008, 12:49:56 PM

Login with username, password and session length
Search



Advanced search
Support GoPHP5.org
BeBot - An Anarchy Online/Age Of Conan chat automaton > Forum > Development > Feedback and Suggestions > Topic: News module fix
Pages: [1]   Go Down
« previous next »
Print
Author Topic: News module fix  (Read 250 times)
0 Members and 1 Guest are viewing this topic.
axl
Freshman
*
Offline Offline

Posts: 11


News module fix
« on: April 21, 2006, 06:56:10 AM »

News is added into db without being slashed which can lead to either not actually inserting the news, or worse outcomes. Simple fix to addslashes(), stripslashes() when entering and quering db.

Code:
--- News.php    2006-04-21 14:55:28.519140000 +0300
+++ oldNews.php 2006-04-21 14:54:30.591519750 +0300
@@ -98,7 +98,7 @@
                foreach ($result as $val)
                {
                        $inside .= "<font color=CCInfoHeader>" . gmdate("dS M, H:i", $val[0]) . " GMT <font color=CCCCTextColor>" . $val[1] . "</font> wrote:\n";
-                       $inside .= "<font color=CCInfoText>" . stripslashes($val[2]) . "\n\n";
+                       $inside .= "<font color=CCInfoText>" . $val[2] . "\n\n";
                }
 
                return "News :: " . $this -> bot -> make_blob("click to view", $inside);
@@ -114,7 +114,7 @@
                if ($this -> bot -> guildbot || $this -> bot -> admin -> in_group($name, "raidleader"))
                {
                        $this -> bot -> db -> query("INSERT INTO news (id, name, news) VALUES (" . time() .
-                       ", '" . $name . "', '" . addslashes($msg) . "')");
+                       ", '" . $name . "', '" . $msg . "')");
                        return "News has been added.";
                }
                else
Logged
Pages: [1]   Go Up
Print
BeBot - An Anarchy Online/Age Of Conan chat automaton > Forum > Development > Feedback and Suggestions > Topic: News module fix
« previous next »
 
Jump to:  

Recent
[request] Raid timers
by Alreadythere
[Today at 11:42:32 AM]

Shared DB online list
by Temar
[Today at 01:55:47 AM]

relay colors
by Temar
[Today at 01:54:56 AM]

BeBot v0.6.0 released
by Alreadythere
[November 30, 2008, 05:32:00 PM]

Change to Bid.php
by Temar
[November 30, 2008, 11:41:44 AM]

OnlineOrg
by Jiheld
[November 29, 2008, 12:44:27 PM]

Silly Newbie Question.
by Temar
[November 29, 2008, 12:00:02 PM]

massive_pvp_time_table 1
by gerborg
[November 29, 2008, 06:55:35 AM]

Bot not see Guild Chat
by Delvar
[November 28, 2008, 08:30:34 AM]

Starting Bot
by Allisande
[November 28, 2008, 07:08:21 AM]
Stats
Members
Total Members: 1243
Latest: Whackoeng
Stats
Total Posts: 11143
Total Topics: 1505
Online Today: 21
Online Ever: 168
(July 01, 2007, 09:30:02 PM)
Users Online
Users: 3
Guests: 12
Total: 15
egrath
Temar

Powered by SMF 1.1.7 | SMF © 2006-2008, Simple Machines LLC
TinyPortal v0.9.8 © Bloc | NewDef design by Bloc
Page created in 0.377 seconds with 28 queries. (Pretty URLs adds 0.023s, 4q)
Loading...