aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/helpers
diff options
context:
space:
mode:
Diffstat (limited to 'server/helpers')
-rw-r--r--server/helpers/core-utils.ts19
1 files changed, 0 insertions, 19 deletions
diff --git a/server/helpers/core-utils.ts b/server/helpers/core-utils.ts
index 0bd84ffaa..b93868c12 100644
--- a/server/helpers/core-utils.ts
+++ b/server/helpers/core-utils.ts
@@ -154,24 +154,6 @@ function root () {
154 return rootPath 154 return rootPath
155} 155}
156 156
157// Thanks: https://stackoverflow.com/a/12034334
158function escapeHTML (stringParam) {
159 if (!stringParam) return ''
160
161 const entityMap = {
162 '&': '&',
163 '<': '&lt;',
164 '>': '&gt;',
165 '"': '&quot;',
166 '\'': '&#39;',
167 '/': '&#x2F;',
168 '`': '&#x60;',
169 '=': '&#x3D;'
170 }
171
172 return String(stringParam).replace(/[&<>"'`=/]/g, s => entityMap[s])
173}
174
175function pageToStartAndCount (page: number, itemsPerPage: number) { 157function pageToStartAndCount (page: number, itemsPerPage: number) {
176 const start = (page - 1) * itemsPerPage 158 const start = (page - 1) * itemsPerPage
177 159
@@ -278,7 +260,6 @@ export {
278 260
279 objectConverter, 261 objectConverter,
280 root, 262 root,
281 escapeHTML,
282 pageToStartAndCount, 263 pageToStartAndCount,
283 sanitizeUrl, 264 sanitizeUrl,
284 sanitizeHost, 265 sanitizeHost,