Skip to content
This repository has been archived by the owner on Oct 15, 2024. It is now read-only.

Commit

Permalink
[Improved] Added a fallback if iconv is not installed for UTF-8 con…
Browse files Browse the repository at this point in the history
…version
  • Loading branch information
Andrew Welch committed Jul 19, 2016
1 parent 83d7200 commit 3e59840
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 2 deletions.
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,11 @@ Some things to do, and ideas for potential features:

## Changelog

### 1.1.25 -- 2016.07.20

* [Improved] Added a fallback if `iconv` is not installed for UTF-8 conversion
* [Improved] Updated the README.md

### 1.1.24 -- 2016.07.18

* [Added] You can now specify image transforms for your SEO Image, Twitter Image, and Facebook Image for Site Meta, Template Meta, and Entry Metas
Expand Down
2 changes: 1 addition & 1 deletion SeomaticPlugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public function getReleaseFeedUrl()

public function getVersion()
{
return '1.1.24';
return '1.1.25';
}

public function getSchemaVersion()
Expand Down
9 changes: 9 additions & 0 deletions releases.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,13 @@
[
{
"version": "1.1.25",
"downloadUrl": "https://github.com/nystudio107/seomatic/archive/master.zip",
"date": "2016-07-20T11:00:00-11:00",
"notes": [
"[Improved] Added a fallback if `iconv` is not installed for UTF-8 conversion",
"[Improved] Updated the README.md"
]
},
{
"version": "1.1.24",
"downloadUrl": "https://github.com/nystudio107/seomatic/archive/master.zip",
Expand Down
9 changes: 8 additions & 1 deletion services/SeomaticService.php
Original file line number Diff line number Diff line change
Expand Up @@ -2736,7 +2736,14 @@ private function _cleanupText($text = null)
{
/* -- convert to UTF-8 */

$text = iconv(mb_detect_encoding($text, mb_detect_order(), true), "UTF-8//IGNORE", $text);
if (function_exists('iconv'))
{
$text = iconv(mb_detect_encoding($text, mb_detect_order(), true), "UTF-8//IGNORE", $text);
}
else {
ini_set('mbstring.substitute_character', "none");
$text = mb_convert_encoding($text, 'UTF-8', 'UTF-8');
}

/* -- strip HTML tags */

Expand Down

0 comments on commit 3e59840

Please sign in to comment.