mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-08-11 12:20:22 +00:00
Autodetect binary files for FTP filesystems. Fixes #7568 props DD32.
git-svn-id: https://develop.svn.wordpress.org/trunk@8990 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -166,6 +166,20 @@ class WP_Filesystem_Base {
|
||||
$newmode .= $mode[6] + $mode[7] + $mode[8];
|
||||
return $newmode;
|
||||
}
|
||||
|
||||
/**
|
||||
* Determines if the string provided contains binary characters.
|
||||
*
|
||||
* @since 2.7
|
||||
* @package WordPress
|
||||
* @subpackage WP_Filesystem
|
||||
*
|
||||
* @param string $text String to test against
|
||||
*
|
||||
*/
|
||||
function is_binary( $text ) {
|
||||
return (bool) preg_match('|[^\x20-\x7E]|', $text); //chr(32)..chr(127)
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
Reference in New Issue
Block a user