MyBB Community Forums

Full Version: Disable Custom [IMG] Image Resolutions
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
How can I disable abuse of the code by forcing everyone to use the regular version?

I want to prevent these sorts of things:
[img=400x400]URL[/img]
Create your own custom MyCode to replace to simple img tags, use parse order -1.
(2017-08-21, 08:07 PM)OmarĀ G. Wrote: [ -> ]Create your own custom MyCode to replace to simple img tags, use parse order -1.

Can you elaborate on this and give an example? Thanks.
Simply create a custom MyCode (probably using the same regex MyBB uses by core) to replace [img=400x400]URL[/img] to [img]URL[/img] before the actual core parsed tags run.

That or, if you use Patches, just remove the line that parses this in the class_parser.php file.
(2017-08-21, 08:07 PM)Omar G. Wrote: [ -> ]Create your own custom MyCode to replace to simple img tags, use parse order -1.
MyBB won't let me set that parse order value. It won't accept anything below zero.
(2017-08-23, 07:00 PM)Omar G. Wrote: [ -> ]Simply create a custom MyCode (probably using the same regex MyBB uses by core) to replace [img=400x400]URL[/img] to [img]URL[/img] before the actual core parsed tags run.

That or, if you use Patches, just remove the line that parses this in the class_parser.php file.
Would you be kind to let us know what the code values would be? I'm barely even intermediate with MyBB. I've tried copying the regex exactly as it was coded from the file, but I don't know what value to replace it with. I tried using a basic IMG code, but that's what it literally showed up in posts.

Thanks.
Still need help with this.
It isn't working. I noticed that if I removed the options in Edit Options via usercp_options template to display images in posts, the normal bit of the code would work, but anyone trying a special dimension combination would get a URL in return. Is there a way I could then just have those kinds fall back to the normal code?

If a post is like this:
[img=800x600]URL[/img]
...then make it automatically like this:
[img]URL[/img]
Thanks to the support in advance.