Fix warning if the encoding retrieved from external headers is invalid
Also fixed the regex to support this failing header: charset="utf-8"\r\n"
This commit is contained in:
parent
d0ae1ba273
commit
1ea09a1b8b
3 changed files with 15 additions and 2 deletions
application/front/controller/admin
|
@ -69,7 +69,7 @@ class ManageShaareController extends ShaarliAdminController
|
|||
$retrieveDescription
|
||||
)
|
||||
);
|
||||
if (! empty($title) && strtolower($charset) !== 'utf-8') {
|
||||
if (! empty($title) && strtolower($charset) !== 'utf-8' && mb_check_encoding($charset)) {
|
||||
$title = mb_convert_encoding($title, 'utf-8', $charset);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue