Replies: 3 comments 3 replies
-
Idea: Rather than expecting the code to know exactly what kind of content it's dealing with, can we have the content type come along with the content? For example, the gettext translation tools support flags (we currently use the
Questions...
|
Beta Was this translation helpful? Give feedback.
-
If we have translations tagged. Than on PHP side when getting translation, it could just add html comment at the beginning Certainly agree with Jonas that by default we want to fully escape html (smarty btw has that option). And html content always sanitise. Very rare exception really can be if we have options to inject some html to theme header or something similar from admin interface. With actual content that might be more difficult to tell whether it might contain html as its not coming via one php function as translation. Do we actually have information anywhere in code/db to know which fields are html content? |
Beta Was this translation helpful? Give feedback.
-
Some details for consideration from Laravel: Laravel has a |
Beta Was this translation helpful? Give feedback.
-
Historically PKP software has had a fairly consistent escaping strategy. The emphasis is on safety at the time of preservation (rather than input filtering); typically there are three types of content for which filtering/escaping must be considered:
<>&
are expected to be HTML-encoded if they come from source text. Example: submission abstracts.<>&
literals should be translated to HTML equivalents (<
et al) if content of this type is to be presented in an HTML-capable context. Example: author given names.However, there are several problems with this approach:
Time to review strategies and set down some new patterns!
Beta Was this translation helpful? Give feedback.
All reactions