Skip to content

Commit 7dc0ba1

Browse files
authored
Merge pull request #21 from keiserjb/1.x-1.x
fix moderation
2 parents a56a8f4 + ab32326 commit 7dc0ba1

File tree

1 file changed

+6
-19
lines changed

1 file changed

+6
-19
lines changed

modules/openai_content/openai_content.module

Lines changed: 6 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -524,7 +524,7 @@ function openai_content_entity_analyze_content($form, &$form_state) {
524524

525525
foreach ($violated_categories as $category => $did_violate) {
526526
if ($did_violate) {
527-
$content['results']['#items'][] = Unicode::ucfirst($category);
527+
$content['results']['#items'][] = mb_ucfirst($category);
528528
}
529529
}
530530
}
@@ -553,21 +553,8 @@ function openai_content_entity_analyze_content($form, &$form_state) {
553553
return $form['openai_moderate']['response'];
554554
}
555555

556-
557-
558-
559-
560-
561-
562-
563-
564-
565-
566-
567-
568-
569-
570-
571-
572-
573-
556+
function mb_ucfirst($string, $encoding = 'UTF-8') {
557+
$firstChar = mb_substr($string, 0, 1, $encoding);
558+
$rest = mb_substr($string, 1, null, $encoding);
559+
return mb_strtoupper($firstChar, $encoding) . $rest;
560+
}

0 commit comments

Comments
 (0)