From 2756e3f85818346a478725b6dd94a966e0d92c07 Mon Sep 17 00:00:00 2001 From: mensonge Date: Sat, 10 May 2008 08:59:41 +0000 Subject: [PATCH] Bug fixes: correct minor bugs appearing with 'notice' level in PHP git-svn-id: https://semanticscuttle.svn.sourceforge.net/svnroot/semanticscuttle/trunk@122 b3834d28-1941-0410-a4f8-b48e95affb8f --- api/httpauth.inc.php | 1 - bookmarks.php | 4 ++-- header.inc.php | 2 ++ includes/php-gettext/streams.php | 3 ++- login.php | 4 +++- password.php | 2 +- populartags.php | 2 +- register.php | 2 +- search.inc.php | 13 ++++++++++--- services/bookmark2tagservice.php | 9 ++++++--- services/bookmarkservice.php | 5 ++++- services/tag2tagservice.php | 2 +- services/userservice.php | 2 +- tag2tagadd.php | 4 +++- templates/bookmarks.tpl.php | 13 +++++++++---- templates/sidebar.block.linked.php | 9 ++++++++- templates/sidebar.block.menu.php | 7 ++++++- templates/sidebar.block.recent.php | 3 +++ templates/sidebar.linkedtags.inc.php | 4 +++- templates/toolbar.inc.php | 2 +- templates/top.inc.php | 10 ++++++---- 21 files changed, 73 insertions(+), 30 deletions(-) diff --git a/api/httpauth.inc.php b/api/httpauth.inc.php index f693d35..d0198fd 100644 --- a/api/httpauth.inc.php +++ b/api/httpauth.inc.php @@ -13,7 +13,6 @@ function authenticate() { } if(!$userservice->isLoggedOn()) { - /* Maybe we have caught authentication data in $_SERVER['REMOTE_USER'] ( Inspired by http://www.yetanothercommunitysystem.com/article-321-regle-comment-utiliser-l-authentification-http-en-php-chez-ovh ) */ if((!isset($_SERVER['PHP_AUTH_USER']) || !isset($_SERVER['PHP_AUTH_PW'])) diff --git a/bookmarks.php b/bookmarks.php index a97fb05..eca291d 100644 --- a/bookmarks.php +++ b/bookmarks.php @@ -209,12 +209,12 @@ if ($templatename == 'editbookmark.tpl') { $tplVars['start'] = $start; $tplVars['bookmarkCount'] = $start + 1; - $bookmarks =& $bookmarkservice->getBookmarks($start, $perpage, $userid, $cat, $terms, getSortOrder()); + $bookmarks =& $bookmarkservice->getBookmarks($start, $perpage, $userid, $cat, null, getSortOrder()); $tplVars['total'] = $bookmarks['total']; $tplVars['bookmarks'] =& $bookmarks['bookmarks']; $tplVars['cat_url'] = createURL('bookmarks', '%s/%s'); $tplVars['nav_url'] = createURL('bookmarks', '%s/%s%s'); - if ($user == $currentUsername) { + if ($userservice->isLoggedOn() && $user == $currentUsername) { $title = T_('My Bookmarks') . filter($catTitle); } else { $title = filter($pagetitle); diff --git a/header.inc.php b/header.inc.php index 9d147b0..820b5f9 100644 --- a/header.inc.php +++ b/header.inc.php @@ -3,6 +3,7 @@ ini_set('display_errors', '1'); ini_set('mysql.trace_mode', '0'); error_reporting(E_ALL ^ E_NOTICE); +//error_reporting(E_ALL); define('DEBUG', true); session_start(); @@ -30,4 +31,5 @@ if (!isset($root)) { } $root = 'http://'. $_SERVER['HTTP_HOST'] . $root; } + ?> diff --git a/includes/php-gettext/streams.php b/includes/php-gettext/streams.php index d57aac6..4237de1 100644 --- a/includes/php-gettext/streams.php +++ b/includes/php-gettext/streams.php @@ -108,6 +108,7 @@ class FileReader { // PHP 5.1.1 does not read more than 8192 bytes in one fread() // the discussions at PHP Bugs suggest it's the intended behaviour + $data = ''; while ($bytes > 0) { $chunk = fread($this->_fd, $bytes); $data .= $chunk; @@ -163,4 +164,4 @@ class CachedFileReader extends StringReader { } -?> \ No newline at end of file +?> diff --git a/login.php b/login.php index 4d212a9..f09996e 100644 --- a/login.php +++ b/login.php @@ -25,10 +25,12 @@ $templateservice =& ServiceFactory::getServiceInstance('TemplateService'); $tplVars = array(); +$keeppass = isset($_POST['keeppass'])&&($_POST['keeppass']=='yes')?true:false; + $login = false; if (isset($_POST['submitted']) && isset($_POST['username']) && isset($_POST['password'])) { $posteduser = trim(utf8_strtolower($_POST['username'])); - $login = $userservice->login($posteduser, $_POST['password'], ($_POST['keeppass'] == "yes")); + $login = $userservice->login($posteduser, $_POST['password'], $keeppass); if ($login) { if ($_POST['query']) header('Location: '. createURL('bookmarks', $posteduser .'?'. $_POST['query'])); diff --git a/password.php b/password.php index b7daa70..1763fd2 100644 --- a/password.php +++ b/password.php @@ -24,7 +24,7 @@ $templateservice =& ServiceFactory::getServiceInstance('TemplateService'); $tplVars = array(); // IF SUBMITTED -if ($_POST['submitted']) { +if (isset($_POST['submitted'])) { // NO USERNAME if (!$_POST['username']) { diff --git a/populartags.php b/populartags.php index a51ff68..1b99ca2 100644 --- a/populartags.php +++ b/populartags.php @@ -66,7 +66,7 @@ if (isset($user) && $user != '') { $userid = NULL; } -$tags = $b2tservice->getPopularTags($userid, 150, $logged_on_userid); +$tags = $b2tservice->getPopularTags($userid, 150); $tplVars['tags'] =& $b2tservice->tagCloud($tags, 5, 90, 225, getSortOrder('alphabet_asc')); $tplVars['user'] = $user; diff --git a/register.php b/register.php index 9cd6f39..e60a686 100644 --- a/register.php +++ b/register.php @@ -25,7 +25,7 @@ $templateservice =& ServiceFactory::getServiceInstance('TemplateService'); $tplVars = array(); -if ($_POST['submitted']) { +if (isset($_POST['submitted'])) { $posteduser = trim(utf8_strtolower($_POST['username'])); // Check if form is incomplete diff --git a/search.inc.php b/search.inc.php index 3900535..832a70c 100644 --- a/search.inc.php +++ b/search.inc.php @@ -1,3 +1,10 @@ + + +