This patch uses ctools to validate and process the css. The main advantage is the filtering of the css by using ctools plugins. It's quite a big change and requires a patch to context also which I am posting after this issue.

THis patch also creates some new helper functions and moves the save function out of the form submit into a css_injector_save() function. This makes is much easier for others to manipulate and save the rule.

CommentFileSizeAuthor
css_injector-ctools.patch4.66 KBindytechcook

Comments

indytechcook’s picture

Here is the context issue that I will keep updated if this patch is committed: #837836: css injector ctools integration

zroger’s picture

Let me add to indytechcook's explanation, because it took me a while to figure out the power of this patch. It really all comes down to this line towards the bottom of the patch:

  ctools_css_store($css_id, $rule['css_text'], TRUE);

ctools_css_store will disassemble the css, run it through some basic css validation, basically ensuring that the css properties and values that are being entered are from a sane list. Furthermore, we could actually do much more advanced filtering using the ctools css api, to provide a locked down filter for only certain properties and values.

kreynen’s picture

Issue summary: View changes
Status: Needs review » Fixed

I came across this while researching #1884432: Fatal Error when upgrading to latest version. 5 years later, the 2.x branch is now using CTools :(

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.