TheOnlineThomas's avatar

Laravel theme development option by 3rd party

Hi,

Imagine I want to create a webstie for e-commerce where users can develop theme for their own store. Now I have few concerns.

  • How to prevent execute php commands through the theme?
  • How to allow theme developers to use only variables provided to them?

I am blur with this concept. Any kinds of support will be highly appreciated.

Thanks is advance.

0 likes
8 replies
TheOnlineThomas's avatar

@sinnbeck

Thank you for your reply.

How about implementing in blade with Laravel. Does it has any difficulties to implement?

Sinnbeck's avatar

Yes you would have to find a way to blacklist unwanted code like @php. Twig is built for this out of the box

Sinnbeck's avatar

Another solution I have seen in action is to simply have a ckeditor page for each part of the page. I worked for a company that did this. Then in each editor you would insert a variable which embedded that part into the page (a product card on a products page etc)

1 like
TheOnlineThomas's avatar

It's interesting. @sinnbeck

I am not sure, but I feel Twig might not able to prevent all kinds of command execution in the template. So to make it more secure, is there any other attempt, that we should take?

Please or to participate in this conversation.