Skip to content

Instantly share code, notes, and snippets.

@sumyapp
Created March 16, 2018 02:45
Show Gist options
  • Save sumyapp/ba82406b94715b018a4c502db9928964 to your computer and use it in GitHub Desktop.
Save sumyapp/ba82406b94715b018a4c502db9928964 to your computer and use it in GitHub Desktop.
Goodcheck Config exmaple for PHP
rules:
- id: com.example.mysql
pattern: mysql_*
message: |
Do not use mysql_* functions.
Please use PDO or Framework's ORM.
MySQL Functions (PDO_MYSQL)
http://php.net/manual/en/ref.pdo-mysql.php
glob:
- "**/*.php"
- id: com.example.crypt
pattern: crypt
message: |
Do not use crypt.
Please use password_hash.
Reference: https://secure.php.net/manual/function.password-hash.php
glob:
- "**/*.php"
pass:
- $password = crypt('secret text', generate_salt());
fail:
- $password = password_hash('secret text', PASSWORD_DEFAULT);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment