mirror of
https://github.com/10h30/ultimatemember.git
synced 2026-07-15 04:37:00 +09:00
Merge remote-tracking branch 'remotes/origin/fix/github#508__str_word_count__behavior'
This commit is contained in:
@@ -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']) );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user