Skip to content

Commit

Permalink
CHN: Moved the UTF-8 conversion up to add the converted result to the…
Browse files Browse the repository at this point in the history
… cache (FreePBX#284)
  • Loading branch information
chriszuercher authored and tm1000 committed Mar 30, 2017
1 parent bdb608f commit 0211598
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions Superfecta.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,14 @@ public function execute($scheme='ALL', $request, $debug=0, $keepGoing=false) {
$callerid = preg_replace("/[\";']/", "", $callerid);
//limit caller id to the first 60 char
$callerid = substr($callerid, 0, 60);

// Display issues on phones and CDR with special characters
// convert CNAM to UTF-8 to fix
if (function_exists('mb_convert_encoding')) {
$this->out("Converting result to UTF-8");
$callerid = mb_convert_encoding($callerid, "UTF-8");
}

//send off
$superfecta->send_results($callerid);
}
Expand All @@ -209,13 +217,6 @@ public function execute($scheme='ALL', $request, $debug=0, $keepGoing=false) {
$callerid = $spam_text . " " . $superfecta->get_Prefix() . $callerid;
}

// Display issues on phones and CDR with special characters
// convert CNAM to UTF-8 to fix
if ($found && function_exists('mb_convert_encoding')) {
$this->out("Converting result to UTF-8");
$callerid = mb_convert_encoding($callerid, "UTF-8");
}

//Set Spam Destination
$spam_dest = (!empty($options['scheme_settings']['spam_interceptor']) && ($options['scheme_settings']['spam_interceptor'] == 'Y')) ? $options['scheme_settings']['spam_destination'] : '';
$this->spamCount = $this->spamCount + (int)$superfecta->get_SpamCount();
Expand Down

0 comments on commit 0211598

Please sign in to comment.