Skip to content

Commit

Permalink
- Helpers: updated helpers
Browse files Browse the repository at this point in the history
  • Loading branch information
regorxxx committed Jul 21, 2023
1 parent 3dd75ba commit 37b0165
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion helpers/helpers_xxx_file.js
Original file line number Diff line number Diff line change
Expand Up @@ -535,7 +535,7 @@ function sanitize(value) {
function sanitizePath(value) { // Sanitize illegal chars but skip drive
if (!value || !value.length) {return '';}
const disk = (value.match(/^\w:\\/g) || [''])[0];
return disk + (disk && disk.length ? value.replace(disk, '') : value).replace(/[\/]/g, '\\').replace(/[|]/g, '-').replace(/\*/g, 'x').replace(/"/g, '\'\'').replace(/[<>]/g, '_').replace(/[\?:]/g, '').replace(/(?! )\s/g, '');
return disk + (disk && disk.length ? value.replace(disk, '') : value).replace(/[\/]/g, '\\').replace(/[|-]/g, '-').replace(/\*/g, 'x').replace(/"/g, '\'\'').replace(/[<>]/g, '_').replace(/[\?:]/g, '').replace(/(?! )\s/g, '');
}

function UUID() {
Expand Down
4 changes: 2 additions & 2 deletions helpers/helpers_xxx_tags.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
'use strict';
//05/06/23
//21/07/23

include('helpers_xxx.js');

Expand Down Expand Up @@ -240,7 +240,7 @@ function checkSort(queryOrSort) {
// Must check query too to be sure it's a valid query!
function stripSort(query) {
let queryNoSort = query;
if (query.match(/ *SORT.*$/)) {
if (query.match(/ *SORT .*$/)) {
if (query.match(/ *SORT BY .*$/)) {queryNoSort = query.split(/( *SORT BY ).*$/)[0];}
else if (query.match(/ *SORT DESCENDING BY .*$/)) {queryNoSort = query.split(/( *SORT DESCENDING BY ).*$/)[0];}
else if (query.match(/ *SORT ASCENDING BY .*$/)) {queryNoSort = query.split(/( *SORT ASCENDING BY ).*$/)[0];}
Expand Down

0 comments on commit 37b0165

Please sign in to comment.