Skip to content

Commit

Permalink
feat: bash esc char add: ], #, ~, ., ,
Browse files Browse the repository at this point in the history
  • Loading branch information
kocoten1992 committed May 28, 2022
1 parent d286067 commit 2c6f817
Showing 1 changed file with 22 additions and 7 deletions.
29 changes: 22 additions & 7 deletions src/BashCharEscape.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,9 @@ protected static function getReplacements(array $configs): array
// left square bracket
"[" => "$lbs$quote$hbs"."["."$lbs$quote",

// right square bracket
"]" => "$lbs$quote$hbs"."]"."$lbs$quote",

// left curly bracket
"{" => "$lbs$quote$hbs"."{"."$lbs$quote",

Expand All @@ -79,31 +82,43 @@ protected static function getReplacements(array $configs): array
">" => "$lbs$quote$hbs".">"."$lbs$quote",

// vertical line
"|" => "$lbs$quote$hbs|$lbs$quote",
"|" => "$lbs$quote$hbs"."|"."$lbs$quote",

// space
" " => "$lbs$quote$hbs $lbs$quote",
" " => "$lbs$quote$hbs"." "."$lbs$quote",

// semicolon
";" => "$lbs$quote$hbs;$lbs$quote",
";" => "$lbs$quote$hbs".";"."$lbs$quote",

// question mark
"?" => "$lbs$quote$hbs"."?"."$lbs$quote",

// ampersand (and)
"&" => "$lbs$quote$hbs&$lbs$quote",
"&" => "$lbs$quote$hbs"."&"."$lbs$quote",

// minus
"-" => "$lbs$quote$hbs-$lbs$quote",
"-" => "$lbs$quote$hbs"."-"."$lbs$quote",

// dollar sign
"$" => "$lbs$quote$hbs$$lbs$quote",

// exclamation mark, bang
"!" => "$lbs$quote$hbs!$lbs$quote",
"!" => "$lbs$quote$hbs"."!"."$lbs$quote",

// caret, circumflex
"^" => "$lbs$quote$hbs^$lbs$quote",
"^" => "$lbs$quote$hbs"."^"."$lbs$quote",

// number sign
"#" => "$lbs$quote$hbs"."#"."$lbs$quote",

// tilde
"~" => "$lbs$quote$hbs"."~"."$lbs$quote",

// dot
"." => "$lbs$quote$hbs"."."."$lbs$quote",

// comma
"," => "$lbs$quote$hbs".","."$lbs$quote",

// \x0A
"\x0A" => "$lbs$quote$hbs\x0A$lbs$quote",
Expand Down

0 comments on commit 2c6f817

Please sign in to comment.