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: Bug & Fix for Items.php Module: Can't submit items with Hyphens in the name  (Read 1533 times)

0 Members and 1 Guest are viewing this topic.

Offline durroch

  • BeBot User
  • **
  • Posts: 43
  • Karma: +0/-0
Greetings,

I noticed that the pref_match_all was not correctly picking up items with hyphens (or dashes "-") in their name and submitting them to the master database.  To correct this problem goto modules/Items.php and on line 170, change it from:
Code: [Select]
if (preg_match_all("/(<a style=\"text-decoration:none\" href=\"itemref:\/\/([0-9]*)\/([0-9]*)\/([0-9]*)\/([0-9a-f]*\:[0-9a-f]*\:[0-9a-f]*:[0-9a-f]*)\/([0-9a-f]*\:[0-9a-f]*\:[0-9a-f]*:[0-9a-f]*)\"><font color=#([0-9a-f]*)>\[([a-zA-Z0-9_'&\s]*)\]<\/font><\/a>)/i",$msg,$matches,PREG_SET_ORDER))to
Code: [Select]
if (preg_match_all("/(<a style=\"text-decoration:none\" href=\"itemref:\/\/([0-9]*)\/([0-9]*)\/([0-9]*)\/([0-9a-f]*\:[0-9a-f]*\:[0-9a-f]*:[0-9a-f]*)\/([0-9a-f]*\:[0-9a-f]*\:[0-9a-f]*:[0-9a-f]*)\"><font color=#([0-9a-f]*)>\[([\-a-zA-Z0-9_'&\s]*)\]<\/font><\/a>)/i",$msg,$matches,PREG_SET_ORDER))

Just adding two characters "\-" is all :).  I did that, restarted the bot and showed it some items with "-" in it's name like "[Mocking Iron-ring Armguards]" and I got "Congratulations!! You are the world's first to discover [Mocking Iron-ring Armguards]!"

Offline Organizer

  • BeBot Apprentice
  • ***
  • Posts: 135
  • Karma: +0/-0
This has not been fixed on the SVN yet as far as I can figure out if it actually should be :) leaving that to the experts...

Offline Noer

  • BeBot Apprentice
  • ***
  • Posts: 107
  • Karma: +0/-0
This has been fixed in SVN yes.

Offline Organizer

  • BeBot Apprentice
  • ***
  • Posts: 135
  • Karma: +0/-0
strange, must have be me forgetting something as I pushed r20 yesterday and still had to do this fix... thanks for feedback!

 

* 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: 529
  • 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