| @@ 370-372 (lines=3) @@ | ||
| 367 | ||
| 368 | protected static function sanitize_item_ids( $item ) { |
|
| 369 | // lets not delete any options that don't start with jpsq_sync- |
|
| 370 | if ( ! is_string( $item ) || substr( $item, 0, 5 ) !== 'jpsq_' ) { |
|
| 371 | return null; |
|
| 372 | } |
|
| 373 | //Limit to A-Z,a-z,0-9,_,-,. |
|
| 374 | return preg_replace( '/[^A-Za-z0-9-_.]/', '', $item ); |
|
| 375 | } |
|
| @@ 123-125 (lines=3) @@ | ||
| 120 | */ |
|
| 121 | private function find_plugin_directory( $file, $directories_to_check ) { |
|
| 122 | // We're only able to find the absolute path for plugin/theme PHP files. |
|
| 123 | if ( ! is_string( $file ) || '.php' !== substr( $file, -4 ) ) { |
|
| 124 | return null; |
|
| 125 | } |
|
| 126 | ||
| 127 | $directories_to_check = self::normalize( $directories_to_check ); |
|
| 128 | foreach ( $directories_to_check as $check_dir ) { |
|