|
1
|
<?php |
|
2
|
|
|
3
|
namespace JFB_Components\Db; |
|
4
|
|
|
5
|
class Db_Tools { |
|
6
|
|
|
7
|
public static function sanitize_column( $name ): string { |
|
8
|
if ( ! is_string( $name ) ) { |
|
9
|
return ''; |
|
10
|
} |
|
11
|
|
|
12
|
$name = strtolower( $name ); |
|
13
|
|
|
14
|
return preg_replace( '/[^a-z0-9_\-\`\.]/', '', $name ); |
|
15
|
} |
|
16
|
|
|
17
|
} |
|
18
|
|