Skip to content

Commit

Permalink
Merge pull request #21 from keiserjb/1.x-1.x
Browse files Browse the repository at this point in the history
fix moderation
  • Loading branch information
keiserjb authored Nov 26, 2024
2 parents a56a8f4 + ab32326 commit 7dc0ba1
Showing 1 changed file with 6 additions and 19 deletions.
25 changes: 6 additions & 19 deletions modules/openai_content/openai_content.module
Original file line number Diff line number Diff line change
Expand Up @@ -524,7 +524,7 @@ function openai_content_entity_analyze_content($form, &$form_state) {

foreach ($violated_categories as $category => $did_violate) {
if ($did_violate) {
$content['results']['#items'][] = Unicode::ucfirst($category);
$content['results']['#items'][] = mb_ucfirst($category);
}
}
}
Expand Down Expand Up @@ -553,21 +553,8 @@ function openai_content_entity_analyze_content($form, &$form_state) {
return $form['openai_moderate']['response'];
}



















function mb_ucfirst($string, $encoding = 'UTF-8') {
$firstChar = mb_substr($string, 0, 1, $encoding);
$rest = mb_substr($string, 1, null, $encoding);
return mb_strtoupper($firstChar, $encoding) . $rest;
}

0 comments on commit 7dc0ba1

Please sign in to comment.