PDA

View Full Version : Solution for class_wysiwygparser.php on line 458 error



Fli
11-16-2014, 08:09 PM
vBulletin can return an error after one go into Advanced Post editor:


Warning: preg_match() [function.preg-match]: Compilation failed: invalid range in character class at offset 23 in [path]/includes/class_wysiwygparser.php on line 458

Also the page elements are mismatched.


The solution is to backup and then edit file /includes/class_wysiwygparser.php in some editor where one can see line numbers and find line 458

If dont have editor with line numbers try to find in that file:


"if (preg_match('#attachment.php\?attachmentid=(\d+)#s i', $img_url, $matches) AND preg_match('#class=(\'|"|)([a-z0-9_-\s]+)?\s*previewthumb\s*([a-z0-9_-\s]+)?(\\1)#si', $fullurl))"


and replace by:


if (preg_match('#attachment.php\?attachmentid=(\d+)#s i', $img_url, $matches) AND preg_match('#class=(\'|"|)([a-z0-9-_\s]+)?\s*previewthumb\s*([a-z0-9-_\s]+)?(\\1)#si', $fullurl))


its about moving "_" character 2 times on that line 458:


OLD:
a-z0-9_-\s


NEW:
a-z0-9-_\s