summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Weiske <cweiske@cweiske.de>2011-05-23 18:16:50 +0200
committerChristian Weiske <cweiske@cweiske.de>2011-05-23 18:16:50 +0200
commit2e58d5cfa9f88cb005f69d04c8ff6ca8f14f9249 (patch)
tree08614fb2004dda85a47bade3f3812877724dc0ac
parent554a358539e2705d4394701778de9dffa8b6a815 (diff)
parent74c72b5cab5e097ee610feca7d57e25fba11d626 (diff)
downloadsemanticscuttle-2e58d5cfa9f88cb005f69d04c8ff6ca8f14f9249.tar.gz
semanticscuttle-2e58d5cfa9f88cb005f69d04c8ff6ca8f14f9249.tar.bz2
Merge branch 'master' into themes
-rw-r--r--www/ajaxGetTitle.php5
1 files changed, 4 insertions, 1 deletions
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>(.*)<\/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")) {