aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormensonge <mensonge@b3834d28-1941-0410-a4f8-b48e95affb8f>2008-12-03 11:11:08 +0000
committermensonge <mensonge@b3834d28-1941-0410-a4f8-b48e95affb8f>2008-12-03 11:11:08 +0000
commit9723a57f4ca309da030f6d2aaf6d1e3d3ca2136e (patch)
tree5c74d68c45e6163caddd27adfbb222d62d06eebc
parent61daf846313f9eddbc6098fdd32b07620480be7e (diff)
downloadsemanticscuttle-9723a57f4ca309da030f6d2aaf6d1e3d3ca2136e.tar.gz
semanticscuttle-9723a57f4ca309da030f6d2aaf6d1e3d3ca2136e.tar.bz2
Bug fix: correct get title function (missing ) )
git-svn-id: https://semanticscuttle.svn.sourceforge.net/svnroot/semanticscuttle/trunk@189 b3834d28-1941-0410-a4f8-b48e95affb8f
-rw-r--r--admin.php6
-rw-r--r--ajaxGetTitle.php2
-rw-r--r--functions.inc.php13
-rw-r--r--gsearch/context.php9
-rw-r--r--templates/userlist.tpl.php8
5 files changed, 33 insertions, 5 deletions
diff --git a/admin.php b/admin.php
index c548480..99841c8 100644
--- a/admin.php
+++ b/admin.php
@@ -45,6 +45,7 @@ if ( !$currentUser->isAdmin() ) {
}
@list($url, $action, $user) = isset($_SERVER['PATH_INFO']) ? explode('/', $_SERVER['PATH_INFO']) : NULL;
+
if ( $action
&& strpos($_SERVER['HTTP_REFERER'], ROOT.'admin.php') === 0 // Prevent CSRF attacks
@@ -61,7 +62,10 @@ if ( $action
$bookmarkservice->deleteBookmarksForUser($uId);
$tplVars['msg'] = sprintf(T_('%s and all his bookmarks and tags were deleted.'), $user);
- }
+ }
+ break;
+ case 'checkUrl' :
+ $tplVars['msg'] = checkUrl('http://fr3.php.net/manual/fr/function.get-headers.php')?"no pb": "ouille";
break;
default:
// DO NOTHING
diff --git a/ajaxGetTitle.php b/ajaxGetTitle.php
index 2bec47c..fc895db 100644
--- a/ajaxGetTitle.php
+++ b/ajaxGetTitle.php
@@ -43,7 +43,7 @@ function getTitle($url) {
$encoding = strtoupper($matches[1][0]);
// Convert to UTF-8 from the original encoding
- if (function_exists("mb_convert_encoding") {
+ if (function_exists("mb_convert_encoding")) {
$title = @mb_convert_encoding($title, 'UTF-8', $encoding);
}
diff --git a/functions.inc.php b/functions.inc.php
index 965b120..84f79c7 100644
--- a/functions.inc.php
+++ b/functions.inc.php
@@ -95,6 +95,19 @@ function shortenString($string, $maxSize=75) {
return $output;
}
+/* Check online if a url is a valid page (Not a 404 error for example) */
+function checkUrl($url) {
+ $h = @get_headers($url);
+
+ //look if the page doesn't return a void or 40X or 50X HTTP code error
+ if(is_array($h) && strpos($h[0], '40') === false && strpos($h[0], '50') === false) {
+ return true;
+ } else {
+ return false;
+ }
+}
+
+
function message_die($msg_code, $msg_text = '', $msg_title = '', $err_line = '', $err_file = '', $sql = '', $db = NULL) {
if(defined('HAS_DIED'))
die(T_('message_die() was called multiple times.'));
diff --git a/gsearch/context.php b/gsearch/context.php
index 1a65063..bed474d 100644
--- a/gsearch/context.php
+++ b/gsearch/context.php
@@ -1,4 +1,11 @@
-<?php require_once('../header.inc.php');?>
+<?php
+if($GLOBALS['enableGoogleCustomSearch']==false) {
+ echo "Google Custom Search disabled. You can enable it into the config.inc.php file.";
+ die;
+}
+
+require_once('../header.inc.php');
+?>
<!--?xml version="1.0" encoding="UTF-8" ?-->
<GoogleCustomizations>
diff --git a/templates/userlist.tpl.php b/templates/userlist.tpl.php
index 85c1998..fdccc62 100644
--- a/templates/userlist.tpl.php
+++ b/templates/userlist.tpl.php
@@ -23,8 +23,12 @@ foreach($users as $user) {
}
echo '</li>'."\n";
-}
-
+}
+?>
+<h3><?php echo T_('Check consistancy')?></h3>
+<a href="<?php echo createURL('admin','checkUrl/') ?>"> <?php echo T_('Check all urls') ?></a>
+
+<?php
$this->includeTemplate('sidebar.tpl');
$this->includeTemplate($GLOBALS['bottom_include']);