之前在做 code review 發現的一個問題,平常沒注意到很容易忽略!
^and$are the start and end of line anchors
1 2 | |
原因在於 ^ and $ 會根據每一行去判斷,因此像以下
1 2 3 | |
第二行會 pass,因此造成 injection 問題,改成以下
\Aand\Zare the start and end of string anchors
1
| |
就會判斷一整串
參考文件
之前在做 code review 發現的一個問題,平常沒注意到很容易忽略!
^and$are the start and end of line anchors
1 2 | |
原因在於 ^ and $ 會根據每一行去判斷,因此像以下
1 2 3 | |
第二行會 pass,因此造成 injection 問題,改成以下
\Aand\Zare the start and end of string anchors
1
| |
就會判斷一整串
參考文件