This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Editor configuration, see http://editorconfig.org | |
root = true | |
[*] | |
charset = utf-8 | |
indent_style = space | |
indent_size = 2 | |
insert_final_newline = true | |
trim_trailing_whitespace = true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"root": true, | |
"parserOptions": { | |
"ecmaVersion": 8, | |
"sourceType": "module", | |
"object-curly-newline": [ | |
"error", | |
"always" | |
] | |
}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"tabWidth": 2, | |
"semi": false, | |
"singleQuote": true, | |
"trailingComma": "es5", | |
"bracketSpacing": true, | |
"arrowParens": "always", | |
"printWidth": 120 | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Show hidden characters
{ | |
"extends": [ | |
"tslint:latest", | |
"tslint-react", | |
"tslint-eslint-rules", | |
"tslint-config-prettier" | |
], | |
"rules": { | |
"ordered-imports": false, | |
"no-submodule-imports": false, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function findFiles($directory, $extensions = array()) { | |
function glob_recursive($directory, &$directories = array()) { | |
foreach(glob($directory, GLOB_ONLYDIR | GLOB_NOSORT) as $folder) { | |
$directories[] = $folder; | |
glob_recursive("{$folder}/*", $directories); | |
} | |
} | |
glob_recursive($directory, $directories); | |
$files = array (); | |
foreach($directories as $directory) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
require 'DBConnector.php'; | |
class DBProcessor | |
{ | |
protected $textFieldTypes = ['text', 'blob', 'varchar', 'longtext', 'tinytext', 'text', 'mediumtext']; | |
public $replacement; | |
public $replacementWith; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if (count($_FILES)) { | |
foreach ($_FILES as $file) { | |
$tmp = explode('.', $file['name']); | |
$ext = end($tmp); | |
if ($this->inArrayI($ext, $this->img_exts)) { | |
// do smth | |
} | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function inArrayI($needle, $haystack) { | |
return in_array(strtolower($needle), array_map('strtolower', $haystack)); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
emailRegex = /^[A-Z0-9._%+-]+@[A-Z0-9.-]+.[A-Z]{2,4}$/igm; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function cleanInputData(){ | |
$sanitized = array(); | |
foreach($_POST as $cur){ | |
$str = trim($cur); | |
$str = mb_convert_encoding($str, 'UTF-8', 'UTF-8'); | |
$str = htmlentities($str, ENT_QUOTES, 'UTF-8'); | |
array_push($sanitize, $str); | |
} | |
return $sanitized; | |
} |
NewerOlder