...
- usages of $this->$property['prop'] (e.g. in kDBList)
- usage of references inside
foreach
- classes having method named the same as class name (the PHP4 constructor) are now deprecated
- usage of $HTTP_RAW_POST_DATA
Solution
The following BASH script can be used to detect some of potentially problematic places:
Code Block |
---|
|
#!/usr/bin/env bash
# Credits for regular expressions goes to Adam Harvey (@LGnome).
case "$1" in
indirect_references)
REGEXP='((((::)|(->))\$[a-zA-Z_][a-zA-Z0-9_]*)+\[[^\s]+\]\(\))|(->\$[a-zA-Z_][a-zA-Z0-9_]*\[)|(\$\$[a-zA-Z_][a-zA-Z0-9_]*\[)'
;;
engine_exceptions)
REGEXP='catch\s*\(\\?Exception\s'
;;
foreach)
REGEXP='foreach.*\sas\s+&'
;;
*)
echo $"Usage: $0 {indirect_references|engine_exceptions|foreach} {folder}"
exit 1
esac
if [ $# -eq 1 ]; then
FOLDER="."
else
FOLDER=$2
fi
find $FOLDER -type f -name "*.php" -not -path "*/vendor/*" -print0 | pv | xargs --null grep --color=always --line-number -E $REGEXP |
Related Articles
Jira Legacy |
---|
server | System Jira |
---|
serverId | 513b375f-8291-3313-9d9f-704c39b1f915 |
---|
key | INP-1436 |
---|
|
Jira Legacy |
---|
server | System Jira |
---|
serverId | 513b375f-8291-3313-9d9f-704c39b1f915 |
---|
key | INP-1641 |
---|
|