Current time: 03-22-2010, 08:32 AM Hello There, Guest! (LoginRegister)


 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[F] regex typo in function my_strlen()
08-07-2008, 12:06 AM
Post: #1
[F] regex typo in function my_strlen()
File /inc/functions.php, function my_strlen

PHP Code:
$string preg_replace("#&\#(0-9]+);#""-"$string); 

If this bug hasn't been noticed yet, maybe that line should just be removed... I dunno, you figure it out [Image: msn_tongue.gif]
Visit this user's website Find all posts by this user
08-07-2008, 12:10 AM (This post was last modified: 08-07-2008 12:11 AM by Dennis Tsang.)
Post: #2
RE: regex typo in function my_strlen()
What's the typo? From my understanding it replaces &xxx; with a dash, so that it is counted as one character. The string isn't passed by reference so it shouldn't affect the original string.

[Image: sig.php?mybb]
MyBB is on Facebook and Twitter
Hosting available, PM for details
Visit this user's website Find all posts by this user
08-07-2008, 12:13 AM
Post: #3
RE: regex typo in function my_strlen()
There's no opening bracket before "0-9"

#&\#(0-9]+);# <-- doesn't work
#&\#([0-9]+);# <-- works

Toungue
Visit this user's website Find all posts by this user
08-07-2008, 12:30 AM
Post: #4
[F] regex typo in function my_strlen()
Thank you for your bug report.

This bug has been fixed in our internal code repository. Please note that the problem will not be fixed here until these forums are updated.

[Image: sig.php?mybb]
MyBB is on Facebook and Twitter
Hosting available, PM for details
Visit this user's website Find all posts by this user


Forum Jump: