Merge remote-tracking branch 'remotes/origin/fix/github#508__str_word_count__behavior'

This commit is contained in:
nikitasinelnikov
2019-03-21 19:09:32 +02:00
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -444,7 +444,7 @@ function um_submit_form_errors_hook_( $args ) {
}
if ( isset( $array['max_words'] ) && $array['max_words'] > 0 ) {
if ( str_word_count( $args[$key] ) > $array['max_words'] ) {
if ( str_word_count( $args[$key], 0, "éèàôù" ) > $array['max_words'] ) {
UM()->form()->add_error($key, sprintf(__('You are only allowed to enter a maximum of %s words','ultimate-member'), $array['max_words']) );
}
}
+1 -1
View File
@@ -620,7 +620,7 @@ function um_js_redirect( $url ) {
* @return string
*/
function um_get_snippet( $str, $wordCount = 10 ) {
if (str_word_count( $str ) > $wordCount) {
if (str_word_count( $str, 0, "éèàôù" ) > $wordCount) {
$str = implode(
'',
array_slice(