ldc-groupe/content/plugins/sitepress-multilingual-cms/classes/utilities/class-wpml-encoding-validation.php
Vincent BRIDIER 134507db43 - Backup DEV
- Add DotEnv
- Fix Bato
- Etc..
2020-05-04 15:59:02 +02:00

15 lines
No EOL
333 B
PHP

<?php
class WPML_Encoding_Validation {
const MIN_CHAR_SIZE = 20;
/**
* @param $string
*
* @return int
*/
public function is_base64( $string ) {
return self::MIN_CHAR_SIZE < strlen( $string ) && preg_match_all( '#^([A-Za-z0-9+/]{4})*([A-Za-z0-9+/]{4}|[A-Za-z0-9+/]{3}=|[A-Za-z0-9+/]{2}==)$#', $string, $matches );
}
}