collapse collapse
* User Info
 
 
Welcome, Guest. Please login or register.
* Search

* Board Stats
  • stats Total Members: 989
  • stats Total Posts: 18363
  • stats Total Topics: 2500
  • stats Total Categories: 7
  • stats Total Boards: 35
  • stats Most Online: 1144

Author Topic: News module fix  (Read 1916 times)

0 Members and 1 Guest are viewing this topic.

Offline axl

  • BeBot Rookie
  • *
  • Posts: 11
  • Karma: +0/-0
News module fix
« on: April 21, 2006, 01:56:10 pm »
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: [Select]
--- 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

 

* Recent Posts
[AoC] special char for items module by bitnykk
[February 09, 2024, 09:41:18 pm]


0.8.x updates for AoC by bitnykk
[January 30, 2024, 11:16:08 pm]


0.8.x updates for AO by bitnykk
[January 30, 2024, 11:15:37 pm]


BeBot still alive & kicking ! by bitnykk
[December 17, 2023, 12:58:44 am]


Bebot and Rasberry by bitnykk
[November 29, 2023, 11:04:14 pm]

* Who's Online
  • Dot Guests: 678
  • Dot Hidden: 0
  • Dot Users: 0

There aren't any users online.
* Forum Staff
bitnykk admin bitnykk
Administrator
Khalem admin Khalem
Administrator
WeZoN gmod WeZoN
Global Moderator
SimplePortal 2.3.7 © 2008-2024, SimplePortal