summaryrefslogtreecommitdiff
path: root/www/ajaxGetTitle.php
diff options
context:
space:
mode:
authorMark Pemberton <mpemberton5@gmail.com>2011-06-04 00:38:07 -0400
committerMark Pemberton <mpemberton5@gmail.com>2011-06-04 00:38:07 -0400
commitb628e63e015bc3b2eadc712feaa6c4d05cf75bbd (patch)
treeebdcec5c8133a3b6f86d06dc3f6fb3de46609f04 /www/ajaxGetTitle.php
parent84e603aa91a303a1419962ff3ff6086710a7b1a9 (diff)
parent4c8a53c5bc632302aaf8978e711eb53a03166db5 (diff)
downloadsemanticscuttle-b628e63e015bc3b2eadc712feaa6c4d05cf75bbd.tar.gz
semanticscuttle-b628e63e015bc3b2eadc712feaa6c4d05cf75bbd.tar.bz2
Merge branch 'master' into privatekey2
Conflicts: data/templates/default/bookmarks.tpl.php
Diffstat (limited to 'www/ajaxGetTitle.php')
-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")) {