Regular expression bug with php 5.5 & PCRE 8.53

See all posts Reply

Regular expression bug with php 5.5 & PCRE 8.53 new!
by Diego, 7 years, 7 months ago
There seems to be a issue with the regex that is validating the mimetype in various locations.

The regex range [\.-\w] is supposed to be replaced with [\.\-\w] as it seems that PHP 5.5 & PCRE 8.53 no longer interpret the dash as a character but as a control sign inside the character class, throwing the following warning:

Warning: preg_match(): Compilation failed: invalid range in character class at offset 7 in php shell code on line 1

The dash should therefore be escaped in all the Regular Expressions.Reply
Re: Regular expression bug with php 5.5 & PCRE 8.53 new!
by colin, 7 years, 7 months ago
You are right, and it is in fact already fixed in the yet-to-be-released next version. You can download the dev version here.Reply
Re: Regular expression bug with php 5.5 & PCRE 8.53 new!
by LUCAS, 7 years, 1 month ago
OK for ver class.upload.php v0.33dev

Problem PHP 5.5 is cape "-" =>"\-"

OK PHP 5.5=>
preg_match("/^([\.\-\w]+)\/([\.\-\w]+)(.*)$/i", $this->file_src_mime)

ERROR EN PHP 5.5 <
preg_match("/^([\.-\w]+)\/([\.-\w]+)(.*)$/i", $this->file_src_mime)Reply