From: Christian Weiske Date: Mon, 23 May 2011 16:16:41 +0000 (+0200) Subject: check if the charset parameter really exists X-Git-Tag: v0.98.0~34^2~25 X-Git-Url: https://gitweb.fluxo.info/?a=commitdiff_plain;h=74c72b5cab5e097ee610feca7d57e25fba11d626;p=semanticscuttle.git check if the charset parameter really exists --- diff --git a/www/ajaxGetTitle.php b/www/ajaxGetTitle.php index b4f44ca..8e5d92c 100644 --- a/www/ajaxGetTitle.php +++ b/www/ajaxGetTitle.php @@ -38,9 +38,12 @@ function getTitle($url) { preg_match_all('/(.*)<\/title>/si', $html, $matches); $title = $matches[1][0]; + $encoding = 'utf-8'; // Get encoding from charset attribute preg_match_all('/<meta.*charset=([^;"]*)">/i', $html, $matches); - $encoding = strtoupper($matches[1][0]); + if (isset($matches[1][0])) { + $encoding = strtoupper($matches[1][0]); + } // Convert to UTF-8 from the original encoding if (function_exists("mb_convert_encoding")) {