Oh no! Where's the JavaScript?
Your Web browser does not have JavaScript enabled or does not support JavaScript. Please enable JavaScript on your Web browser to properly view this Web site, or upgrade to a Web browser that does support JavaScript.
Not a member yet? Click here to register.
Forgot Password?

smiley parse issue in forum

Asked Modified Viewed 1,657 times
M
moozaad
M
  • Newbie, joined since
  • Contributed 5 posts on the community forums.
  • Started 2 threads in the forums
  • Started this discussions
asked
Newbie

Version 7.0.4
Searched: yes


Smiley was set as ;S (semi-colon, cap. ess) but parser was also accepting ' (an apostrophe) for that smilie.

I had a look at the preg but couldn't see the issue, changing the smiley code to ;;S fixed it.


other issues exist including;
smiley set as ppfft - shows the smiley for pfft
smiley set as pfftP - shows the smiley for pfft
etc
I guess the code is doing a looped preg and is checking them in database order. Maybe they should be ordered by strlen to lessen early hits? or allow user ordering.
0 replies

1 post

M
moozaad
M
  • Newbie, joined since
  • Contributed 5 posts on the community forums.
  • Started 2 threads in the forums
  • Started this discussions
answered
Newbie

to correct the second issue is as easy as changing line 385

From:
$result = dbquery("SELECT * FROM ".DB_SMILEYS);


To:
$result = dbquery("SELECT * FROM ".DB_SMILEYS." order by char_length(smiley_code) DESC");


It's adds about 10% on to the SQL exe time but that's nothing in the grand scheme of things.
0 replies

Labels

None yet

Statistics

  • Views 0 views
  • Posts 1 post
  • Votes 0 votes
  • Topic users 1 member

1 participant

M
M
  • Newbie, joined since
  • Contributed 5 posts on the community forums.
  • Started 2 threads in the forums
  • Started this discussions

Notifications

Track thread

You are not receiving notifications from this thread.

Related Questions

Not yet