CRM-21006 - Escape all title and alt attributes
authorSean Madsen <sean@seanmadsen.com>
Wed, 20 Sep 2017 00:07:02 +0000 (18:07 -0600)
committerSeamus Lee <seamuslee001@gmail.com>
Wed, 20 Sep 2017 01:12:26 +0000 (11:12 +1000)
commitf03ef825825b5ae35c2a4cf276bb24d7eb289ba6
tree054ad9a024c80c93b307380f0a6341ea670acf32
parent9e63fff037a8331c27d57fcdfb6c75d4874018e1
CRM-21006 - Escape all title and alt attributes

This commit opportunistically adds HTML output encoding to all Smarty
variables any time they appear within an HTML `title` or `alt`
attribute. Why? Because this helps us prevent XSS and is very very
unlikely to cause any unwanted side effects.

Code locations found by searching the `templates` directory for:

(title|alt)=(['"])((?!\2).)*\{\$((?!(\|(escape|crmDate))|\}).)+\}((?!\2).)*\2
17 files changed:
templates/CRM/Activity/Form/ActivityLinks.tpl
templates/CRM/Admin/Page/Admin.tpl
templates/CRM/Admin/Page/ConfigTaskList.tpl
templates/CRM/Contact/Form/Edit/Tagtree.tpl
templates/CRM/Contact/Page/Inline/Actions.tpl
templates/CRM/Contact/Page/View/Summary.tpl
templates/CRM/Contribute/Form/Contribution/PremiumBlock.tpl
templates/CRM/Dashlet/Page/Blog.tpl
templates/CRM/Event/Page/DashBoard.tpl
templates/CRM/Friend/Form.tpl
templates/CRM/Report/Form/Contact/Detail.tpl
templates/CRM/Report/Form/Fields.tpl
templates/CRM/Report/Form/Layout/Overlay.tpl
templates/CRM/Report/Form/Layout/Table.tpl
templates/CRM/Report/Page/InstanceList.tpl
templates/CRM/Tag/Form/Tagtree.tpl
templates/CRM/common/TabHeader.tpl