Skip to content

Commit

Permalink
Merge pull request #11 from getshifter/remove_esc_chars
Browse files Browse the repository at this point in the history
add_filter to remove controle chars
  • Loading branch information
sawanoboly authored Jun 14, 2019
2 parents 3e968c5 + 0c6a8f8 commit b84b247
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 3 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"\"vendor/bin/phpcs\" --config-set installed_paths vendor/wp-coding-standards/wpcs"
],
"cs-fix": [
"phpcbf . -pw --ignore=vendor,node_modules --extensions=php --standard=WordPress"
"phpcbf . -pwv --ignore=vendor,node_modules --extensions=php --standard=WordPress || git diff"
],
"cs-lint": [
"phpcs . -p --ignore=vendor,node_modules --extensions=php --standard=WordPress"
Expand Down
27 changes: 25 additions & 2 deletions shifter.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
* Plugin Name: Shifter
* Plugin URI: https://github.com/getshifter/shifter-wp-mu
* Description: Helper functions for WordPress sites on Shifter.
* Version: 1.0.7
* Version: 1.0.8
* Author: DigitalCube
* Author URI: https://www.getshifter.io
* License: GPL-2.0+
Expand All @@ -34,7 +34,7 @@
* Start at version 1.0.0 and use SemVer - https://semver.org
* Rename this for your plugin and update it as you release new versions.
*/
define( 'SHIFTER_VERSION', '1.0.7' );
define( 'SHIFTER_VERSION', '1.0.8' );

/**
* The code that runs during plugin activation.
Expand Down Expand Up @@ -79,3 +79,26 @@ function run_shifter() {
}

run_shifter();


// Temp filters before core update.

/**
* Force remove controle characters from filename
*
* @link https://www.getshifter.io
* @since 1.0.8
*
* @package Shifter
* @subpackage Shifter/filters
* core_ticket: https://core.trac.wordpress.org/ticket/47539
*/

add_filter(
'sanitize_file_name',
function( $filename, $filename_raw ) {
return preg_replace( '/[\x00-\x1F]/', '', $filename );
},
10,
2
);

0 comments on commit b84b247

Please sign in to comment.