mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-02-03 23:00:14 -05:00
Fixed gh-count-down-html-characters helper to support null values
no issue The default null value for the sigup terms caused an error. This fixes that issue.
This commit is contained in:
parent
b149ed79ae
commit
c3c2427992
1 changed files with 5 additions and 0 deletions
|
@ -4,6 +4,11 @@ import {helper} from '@ember/component/helper';
|
|||
export default helper(function (params) {
|
||||
let [content, maxCharacters] = params;
|
||||
|
||||
if (!content) {
|
||||
// Protect against NULL content
|
||||
content = '';
|
||||
}
|
||||
|
||||
// Strip HTML-tags and characters from content so we have a reliable character count
|
||||
content = content.replace(/<[^>]*>?/gm, '');
|
||||
content = content.replace(/ /g, ' ');
|
||||
|
|
Loading…
Add table
Reference in a new issue