Platform 2018.09.20
On production sites
This release adds new Liquid filters, fixes one filter and lets you send files in API calls.
Add keys to a hash
Use the new assign_to_hash_key filter to add a key and value to an existing hash. Start with '{}' | to_hash, then add keys one at a time, such as company | assign_to_hash_key: 'name', 'Dunder Mifflin'. Values can be lists as well as text.
Clean user input before you show it
Use the sanitize filter to clean user input before you render it. You can also pass a list of attributes that should be kept. For example, link | sanitize: whitelist_attributes keeps the target attribute on a link.
Read the user agent
The new useragent filter takes a user agent string and returns an object with the parsed details. For example, {{ context.headers.HTTP_USER_AGENT | useragent }}. Add the json filter to make the result easier to read. This came from a community request.
Send binary files in an API call
You can now send binary files in an API call. This helps when you connect to outside systems that need more data from your users, such as a photo.
Also in this release
- The
random_stringfilter now returns a string of the length you ask for. Before, it could return a longer one.