Skip to content

Commit

Permalink
Replace invalid octal escape sequences in RegEx
Browse files Browse the repository at this point in the history
  • Loading branch information
myabc committed Jan 24, 2025
1 parent 8896c1d commit 53736bf
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ export class GitActionsService {
return str
.replace(/&/g, 'and ') // & becomes and
.replace(/ +/g, '-') // Spaces become dashes
.replace(/[\000-\039]/g, '') // ASCII control characters are out
.replace(/\177/g, '') // DEL is out
.replace(/[\x00-\x1F]/g, '') // ASCII control characters are out
.replace(/\x7F/g, '') // DEL is out
.replace(/[#\\\/\?\*\~\^\:\{\}@\.\[\]'"]/g, '') // Some other characters with special rules are out
.replace(/^[-]+/g, '') // Dashes at the start are removed
.replace(/[-]+$/g, '') // Dashes at the end are removed
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ export class GitActionsService {
return str
.replace(/&/g, 'and ') // & becomes and
.replace(/ +/g, '-') // Spaces become dashes
.replace(/[\000-\039]/g, '') // ASCII control characters are out
.replace(/\177/g, '') // DEL is out
.replace(/[\x00-\x1F]/g, '') // ASCII control characters are out
.replace(/\x7F/g, '') // DEL is out
.replace(/[#\\\/\?\*\~\^\:\{\}@\.\[\]'"]/g, '') // Some other characters with special rules are out
.replace(/^[-]+/g, '') // Dashes at the start are removed
.replace(/[-]+$/g, '') // Dashes at the end are removed
Expand Down

0 comments on commit 53736bf

Please sign in to comment.