| @@ 684-704 (lines=21) @@ | ||
| 681 | $function = strtolower($tokens[$stackPtr]['content']); |
|
| 682 | $pattern = null; |
|
| 683 | ||
| 684 | if ($this->patternMatch === true) { |
|
| 685 | $count = 0; |
|
| 686 | $pattern = preg_replace( |
|
| 687 | $this->forbiddenFunctionNames, |
|
| 688 | $this->forbiddenFunctionNames, |
|
| 689 | $function, |
|
| 690 | 1, |
|
| 691 | $count |
|
| 692 | ); |
|
| 693 | ||
| 694 | if ($count === 0) { |
|
| 695 | return; |
|
| 696 | } |
|
| 697 | ||
| 698 | // Remove the pattern delimiters and modifier. |
|
| 699 | $pattern = substr($pattern, 1, -2); |
|
| 700 | } else { |
|
| 701 | if (in_array($function, $this->forbiddenFunctionNames) === false) { |
|
| 702 | return; |
|
| 703 | } |
|
| 704 | } |
|
| 705 | ||
| 706 | $this->addError($phpcsFile, $stackPtr, $function, $pattern); |
|
| 707 | ||
| @@ 1282-1302 (lines=21) @@ | ||
| 1279 | $function = strtolower($tokens[$stackPtr]['content']); |
|
| 1280 | $pattern = null; |
|
| 1281 | ||
| 1282 | if ($this->patternMatch === true) { |
|
| 1283 | $count = 0; |
|
| 1284 | $pattern = preg_replace( |
|
| 1285 | $this->forbiddenFunctionNames, |
|
| 1286 | $this->forbiddenFunctionNames, |
|
| 1287 | $function, |
|
| 1288 | 1, |
|
| 1289 | $count |
|
| 1290 | ); |
|
| 1291 | ||
| 1292 | if ($count === 0) { |
|
| 1293 | return; |
|
| 1294 | } |
|
| 1295 | ||
| 1296 | // Remove the pattern delimiters and modifier. |
|
| 1297 | $pattern = substr($pattern, 1, -2); |
|
| 1298 | } else { |
|
| 1299 | if (in_array($function, $this->forbiddenFunctionNames) === false) { |
|
| 1300 | return; |
|
| 1301 | } |
|
| 1302 | } |
|
| 1303 | ||
| 1304 | $this->addError($phpcsFile, $stackPtr, $tokens[$stackPtr]['content'], $pattern); |
|
| 1305 | ||