Commit 0ce07a2c authored by changi67's avatar changi67

[ENH] Zend Code Styling - quality.tiki.org

parent b638e4a0
......@@ -26,7 +26,7 @@ if ($mess_archiveAfter > 0) {
}
// Mark messages if the mark button was pressed
if (isset($_REQUEST["mark"]) && isset($_REQUEST["msg"])) {
foreach(array_keys($_REQUEST["msg"]) as $msg) {
foreach (array_keys($_REQUEST["msg"]) as $msg) {
$parts = explode('_', $_REQUEST['action']);
$messulib->flag_message($user, $msg, $parts[0], $parts[1]);
}
......@@ -34,7 +34,7 @@ if (isset($_REQUEST["mark"]) && isset($_REQUEST["msg"])) {
// Delete messages if the delete button was pressed
if (isset($_REQUEST["delete"]) && isset($_REQUEST["msg"])) {
check_ticket('messu-mailbox');
foreach(array_keys($_REQUEST["msg"]) as $msg) {
foreach (array_keys($_REQUEST["msg"]) as $msg) {
$messulib->delete_message($user, $msg);
}
}
......@@ -42,7 +42,7 @@ if (isset($_REQUEST["delete"]) && isset($_REQUEST["msg"])) {
if (isset($_REQUEST["archive"]) && isset($_REQUEST["msg"])) {
check_ticket('messu-mailbox');
$tmp = $messulib->count_messages($user, 'archive');
foreach(array_keys($_REQUEST["msg"]) as $msg) {
foreach (array_keys($_REQUEST["msg"]) as $msg) {
if (($prefs['messu_archive_size'] > 0) && ($tmp >= $prefs['messu_archive_size'])) {
$smarty->assign('msg', tra("Archive is full. Delete some messages from archive first."));
$smarty->display("error.tpl");
......@@ -57,7 +57,7 @@ if (isset($_REQUEST["download"])) {
check_ticket('messu-mailbox');
// if message ids are handed over, use them:
if (isset($_REQUEST["msg"])) {
foreach(array_keys($_REQUEST["msg"]) as $msg) {
foreach (array_keys($_REQUEST["msg"]) as $msg) {
$tmp = $messulib->get_message($user, $msg, 'messages');
$items[] = $tmp;
}
......
......@@ -15,7 +15,7 @@ $maxRecords = $messulib->get_user_preference($user, 'maxRecords', 20);
// Delete messages if the delete button was pressed
if (isset($_REQUEST["delete"]) && isset($_REQUEST["msg"])) {
check_ticket('messu-sent');
foreach(array_keys($_REQUEST["msg"]) as $msg) {
foreach (array_keys($_REQUEST["msg"]) as $msg) {
$messulib->delete_message($user, $msg, 'sent');
}
}
......@@ -23,7 +23,7 @@ if (isset($_REQUEST["delete"]) && isset($_REQUEST["msg"])) {
if (isset($_REQUEST["archive"]) && isset($_REQUEST["msg"])) {
check_ticket('messu-sent');
$tmp = $messulib->count_messages($user, 'archive');
foreach(array_keys($_REQUEST["msg"]) as $msg) {
foreach (array_keys($_REQUEST["msg"]) as $msg) {
if (($prefs['messu_archive_size'] > 0) && ($tmp >= $prefs['messu_archive_size'])) {
$smarty->assign('msg', tra("Archive is full. Delete some messages from archive first."));
$smarty->display("error.tpl");
......@@ -38,7 +38,7 @@ if (isset($_REQUEST["download"])) {
check_ticket('messu-sent');
// if message ids are handed over, use them:
if (isset($_REQUEST["msg"])) {
foreach(array_keys($_REQUEST["msg"]) as $msg) {
foreach (array_keys($_REQUEST["msg"]) as $msg) {
$tmp = $messulib->get_message($user, $msg, 'sent');
$items[] = $tmp;
}
......
......@@ -127,10 +127,10 @@ if (isset($_REQUEST["save"])) {
} elseif ($_REQUEST["quizId"]) {
$info = $quizlib->get_quiz($_REQUEST["quizId"]);
if (!isset($info["publishDate"])){
if (!isset($info["publishDate"])) {
$info["publishDate"] = $tikilib->now;
}
if (!isset($info["expireDate"])){
if (!isset($info["expireDate"])) {
$cur_time = explode(',', $tikilib->date_format('%Y,%m,%d,%H,%M,%S', $tikilib->now));
$info["expireDate"] = $tikilib->make_time($cur_time[3], $cur_time[4], $cur_time[5], $cur_time[1], $cur_time[2], $cur_time[0]+1);
}
......@@ -140,10 +140,10 @@ $smarty->assign('name', $info["name"]);
$smarty->assign('description', $info["description"]);
$smarty->assign('canRepeat', $info["canRepeat"]);
$smarty->assign('storeResults', $info["storeResults"]);
$smarty->assign('immediateFeedback',$info["immediateFeedback"]);
$smarty->assign('showAnswers',$info["showAnswers"]);
$smarty->assign('shuffleQuestions',$info["shuffleQuestions"]);
$smarty->assign('shuffleAnswers',$info["shuffleAnswers"]);
$smarty->assign('immediateFeedback', $info["immediateFeedback"]);
$smarty->assign('showAnswers', $info["showAnswers"]);
$smarty->assign('shuffleQuestions', $info["shuffleQuestions"]);
$smarty->assign('shuffleAnswers', $info["shuffleAnswers"]);
$smarty->assign('questionsPerPage', $info["questionsPerPage"]);
$smarty->assign('timeLimited', $info["timeLimited"]);
$smarty->assign('timeLimit', $info["timeLimit"]);
......
......@@ -148,11 +148,11 @@ if (isset($_REQUEST['app']) && isset($_REQUEST['msg'])) {
// Quickjumpt to other forums
if ($tiki_p_admin_forum == 'y' || $prefs['feature_forum_quickjump'] == 'y') {
$all_forums = $commentslib->list_forums(0, -1, 'name_asc', '');
Perms::bulk( array( 'type' => 'forum' ), 'object', $all_forums['data'], 'forumId' );
Perms::bulk(array( 'type' => 'forum' ), 'object', $all_forums['data'], 'forumId');
$temp_max = count($all_forums["data"]);
for ($i = 0; $i < $temp_max; $i++) {
$forumperms = Perms::get( array( 'type' => 'forum', 'object' => $all_forums['data'][$i]['forumId'] ) );
$forumperms = Perms::get(array( 'type' => 'forum', 'object' => $all_forums['data'][$i]['forumId'] ));
$all_forums["data"][$i]["can_read"] = $forumperms->forum_read ? 'y' : 'n';
}
......
......@@ -67,11 +67,11 @@ if (isset($_REQUEST['del']) && isset($_REQUEST['msg'])) {
// Quickjumpt to other forums
if ($tiki_p_admin_forum == 'y' || $prefs['feature_forum_quickjump'] == 'y') {
$all_forums = $commentslib->list_forums(0, -1, 'name_asc', '');
Perms::bulk( array( 'type' => 'forum' ), 'object', $all_forums['data'], 'forumId' );
Perms::bulk(array( 'type' => 'forum' ), 'object', $all_forums['data'], 'forumId');
$temp_max = count($all_forums["data"]);
for ($i = 0; $i < $temp_max; $i++) {
$forumperms = Perms::get( array( 'type' => 'forum', 'object' => $channels['data'][$i]['forumId'] ) );
$forumperms = Perms::get(array( 'type' => 'forum', 'object' => $channels['data'][$i]['forumId'] ));
$all_forums["data"][$i]["can_read"] = $forumperms->forum_read ? 'y' : 'n';
}
......
......@@ -51,7 +51,7 @@ if (!($info = $tikilib->get_page_info($page))) {
}
require_once 'lib/wiki/renderlib.php';
$pageRenderer = new WikiRenderer( $info, $user );
$pageRenderer = new WikiRenderer($info, $user);
$objectperms = $pageRenderer->applyPermissions();
if ($prefs['flaggedrev_approval'] == 'y' && isset($_REQUEST['latest']) && $objectperms->wiki_view_latest) {
......@@ -142,7 +142,7 @@ $smarty->assign('cached_page', 'n');
// Get ~pp~, ~np~ and <pre> out of the way. --rlpowell, 24 May 2004
$preparsed = array();
$noparsed = array();
$parserlib->parse_first( $info["data"], $preparsed, $noparsed );
$parserlib->parse_first($info["data"], $preparsed, $noparsed);
$pdata = $wikilib->get_parse($page, $canBeRefreshed);
......@@ -151,8 +151,8 @@ $pdata = str_replace('tiki-index.php', 'tiki-index_p.php', $pdata);
if (!isset($_REQUEST['pagenum']))
$_REQUEST['pagenum'] = 1;
if( isset( $_REQUEST['pagenum'] ) && $_REQUEST['pagenum'] > 0 ) {
$pageRenderer->setPageNumber( (int) $_REQUEST['pagenum'] );
if ( isset( $_REQUEST['pagenum'] ) && $_REQUEST['pagenum'] > 0 ) {
$pageRenderer->setPageNumber((int) $_REQUEST['pagenum']);
}
......
......@@ -62,7 +62,7 @@ if (!isset($_SESSION["breadCrumb"])) {
if (!in_array($page, $_SESSION["breadCrumb"])) {
if (count($_SESSION["breadCrumb"]) > $prefs['userbreadCrumb']) {
array_shift ($_SESSION["breadCrumb"]);
array_shift($_SESSION["breadCrumb"]);
}
array_push($_SESSION["breadCrumb"], $page);
......@@ -97,8 +97,8 @@ if ($tiki_p_admin_wiki == 'y') {
$smarty->assign('canundo', 'y');
}
if( isset( $_REQUEST['pagenum'] ) && $_REQUEST['pagenum'] > 0 ) {
$pageRenderer->setPageNumber( (int) $_REQUEST['pagenum'] );
if ( isset( $_REQUEST['pagenum'] ) && $_REQUEST['pagenum'] > 0 ) {
$pageRenderer->setPageNumber((int) $_REQUEST['pagenum']);
}
$pageRenderer->useRaw();
......@@ -124,7 +124,7 @@ if ( isset($_REQUEST['download']) && $_REQUEST['download'] !== 'n' ) {
// add &full to URL to output the whole html head and body
if (isset($_REQUEST['full']) && $_REQUEST['full'] != 'n') {
$smarty->assign('mid','tiki-show_page_raw.tpl');
$smarty->assign('mid', 'tiki-show_page_raw.tpl');
// use tiki_full to include include CSS and JavaScript
$smarty->display("tiki_full.tpl");
} else if (isset($_REQUEST['textonly']) && $_REQUEST['textonly'] != 'n') {
......
......@@ -6,7 +6,7 @@
// $Id$
//this script may only be included - so its better to die if called directly.
if (strpos($_SERVER["SCRIPT_NAME"],basename(__FILE__)) !== false) {
if (strpos($_SERVER["SCRIPT_NAME"], basename(__FILE__)) !== false) {
header("location: index.php");
exit;
}
......
......@@ -63,5 +63,5 @@ $smarty->assign('metrics_range_prefix', $converted_range['metrics_range_prefix']
$smarty->assign('range', $range);
$smarty->assign('tabs', $tabs);
$smarty->assign('metrics_range', $metrics_range);
$smarty->assign('mid','tiki-metrics.tpl');
$smarty->assign('mid', 'tiki-metrics.tpl');
$smarty->display("tiki.tpl");
......@@ -22,7 +22,7 @@ if (isset($_REQUEST['remove2'])) {
}
if (isset($_REQUEST['delete'])) {
$access->check_authenticity();
foreach(array_keys($_REQUEST["event"]) as $ev) {
foreach (array_keys($_REQUEST["event"]) as $ev) {
$minicallib->minical_remove_event($user, $ev);
}
}
......
......@@ -13,7 +13,7 @@ if (!$prefs['minical_reminders']) die;
//$refresh=$_REQUEST['refresh']*1000;
$refresh = 1000 * 60 * 1;
$evs = $minicallib->minical_get_events_to_remind($user, $prefs['minical_reminders']);
foreach($evs as $ev) {
foreach ($evs as $ev) {
$command = "<script type='text/javascript'>alert('event " . $ev['title'] . " will start at " . date("h:i", $ev['start']) . "');</script>";
print ($command);
$minicallib->minical_event_reminded($user, $ev['eventId']);
......
......@@ -76,7 +76,7 @@ if ($ed_offset > 0) {
$smarty->assign_by_ref('channels', $channels["data"]);
$smarty->assign('url', "tiki-newsletter_archives.php");
if (isset($_REQUEST['editionId'])) {
foreach($channels['data'] as $edition) {
foreach ($channels['data'] as $edition) {
if ($edition['editionId'] == $_REQUEST['editionId']) {
$edition["dataparsed"] = $tikilib->parse_data($edition["data"]);
$smarty->assign_by_ref('edition', $edition);
......
......@@ -21,7 +21,7 @@ if (!isset($_REQUEST["days"])) $_REQUEST["days"] = 7;
$statslib = TikiLib::lib('stats');
$data = $statslib->get_pv_chart_data($_REQUEST["days"]);
foreach($data['xdata'] as $key => $date) {
foreach ($data['xdata'] as $key => $date) {
$data['xdata'][$key] = strtotime($date) / 24 / 3600;
}
$graph->setData(array('x' => $data['xdata'], 'y0' => $data['ydata']));
......
......@@ -62,7 +62,7 @@ if (isset($_REQUEST["save"])) {
}
if (!empty($_REQUEST['checked']) && (!empty($_REQUEST['prefix']) || !empty($_REQUEST['postfix']))) {
check_ticket('received-pages');
foreach($_REQUEST['checked'] as $page) {
foreach ($_REQUEST['checked'] as $page) {
$newpage = empty($_REQUEST['postfix']) ? $_REQUEST['prefix'] . $page : $page . $_REQUEST['postfix'];
if ($tikilib->page_exists($newpage)) {
$errors[] = array('error' => 'Page already exists', 'param' => $page);
......
......@@ -127,7 +127,7 @@ if (!isset($_REQUEST["offset"])) {
}
if (isset($_REQUEST['searchLang'])) {
$searchLang = $_REQUEST['searchLang'];
} elseif($prefs['search_default_interface_language'] == 'y' && $prefs['feature_multilingual'] == 'y') {
} elseif ($prefs['search_default_interface_language'] == 'y' && $prefs['feature_multilingual'] == 'y') {
$searchLang = $prefs['language'];
} else {
$searchLang = '';
......
......@@ -17,7 +17,7 @@ if ($prefs['feature_banning'] == 'y') {
}
if ($prefs['layout_section'] == 'y') {
$section_elements = array('top_bar', 'bot_bar', 'left_column', 'right_column');
foreach($section_elements as $element) {
foreach ($section_elements as $element) {
if (isset($prefs[$section . '_' . $element])) {
$prefs['feature_' . $element] = $prefs[$section . '_' . $element];
}
......
......@@ -63,5 +63,5 @@ if (isset($_REQUEST["linkaccount"])) {
}
}
$smarty->assign('mid','tiki-socialnetworks_firstlogin.tpl');
$smarty->assign('mid', 'tiki-socialnetworks_firstlogin.tpl');
$smarty->display('tiki.tpl');
......@@ -32,7 +32,7 @@ if (isset($_REQUEST['assigcat'])) {
if (isset($_REQUEST["delete"])) {
if (isset($_REQUEST["categ"])) {
check_ticket('theme-control');
foreach(array_keys($_REQUEST["categ"]) as $cat) {
foreach (array_keys($_REQUEST["categ"]) as $cat) {
$tcontrollib->tc_remove_cat($cat);
}
}
......
......@@ -23,7 +23,7 @@ if (isset($_REQUEST['assign'])) {
}
if (isset($_REQUEST['delete'])) {
check_ticket('tc-sections');
foreach(array_keys($_REQUEST["sec"]) as $sec) {
foreach (array_keys($_REQUEST["sec"]) as $sec) {
$tcontrollib->tc_remove_section($sec);
}
}
......
......@@ -123,7 +123,7 @@ if (isset($_REQUEST["upload"])) {
if (!move_uploaded_file($file_tmp_name, $tmp_dest)) {
if ($tiki_p_admin == 'y') {
$smarty->assign('msg', tra('Errors detected').'. '.tra('Check that these paths exist and are writable by the web server').': '.$file_tmp_name.' '.$tmp_dest);
} else {
} else {
$smarty->assign('msg', tra('Errors detected'));
}
$smarty->assign('errortype', 'no_redirect_login');
......
......@@ -17,7 +17,7 @@ if ($prefs['feature_daily_report_watches'] != 'y') {
include_once ('lib/reportslib.php');
foreach($reportslib->getUsersForSendingReport() as $key => $user) {
foreach ($reportslib->getUsersForSendingReport() as $key => $user) {
$report_preferences = $reportslib->get_report_preferences_by_user($user);
$user_data = $userlib->get_user_info($user);
......
......@@ -16,7 +16,7 @@ $access->check_permission('tiki_p_usermenu');
if (!isset($_REQUEST["menuId"])) $_REQUEST["menuId"] = 0;
if (isset($_REQUEST["delete"]) && isset($_REQUEST["menu"])) {
check_ticket('user-menu');
foreach(array_keys($_REQUEST["menu"]) as $men) {
foreach (array_keys($_REQUEST["menu"]) as $men) {
$usermenulib->remove_usermenu($user, $men);
}
if (isset($_SESSION['usermenu'])) unset($_SESSION['usermenu']);
......
......@@ -78,7 +78,7 @@ if ($tiki_p_admin_forum != 'y' && $user) {
}
}
$access->check_permission( array('tiki_p_forum_read') );
$access->check_permission(array('tiki_p_forum_read'));
$commentslib->forum_add_hit($_REQUEST["forumId"]);
......@@ -107,7 +107,7 @@ if ($tiki_p_admin_forum == 'y') {
if (isset($_REQUEST['locksel_x'])) {
if (isset($_REQUEST['forumtopic'])) {
check_ticket('view-forum');
foreach(array_values($_REQUEST['forumtopic']) as $topic) {
foreach (array_values($_REQUEST['forumtopic']) as $topic) {
$commentslib->lock_comment($topic);
}
}
......@@ -116,7 +116,7 @@ if ($tiki_p_admin_forum == 'y') {
if (isset($_REQUEST['unlocksel_x'])) {
if (isset($_REQUEST['forumtopic'])) {
check_ticket('view-forum');
foreach(array_values($_REQUEST['forumtopic']) as $topic) {
foreach (array_values($_REQUEST['forumtopic']) as $topic) {
$commentslib->unlock_comment($topic);
}
}
......@@ -124,7 +124,7 @@ if ($tiki_p_admin_forum == 'y') {
if (isset($_REQUEST['movesel'])) {
if (isset($_REQUEST['forumtopic'])) {
foreach(array_values($_REQUEST['forumtopic']) as $topic) {
foreach (array_values($_REQUEST['forumtopic']) as $topic) {
check_ticket('view-forum');
// To move a topic you just have to change the object
$obj = 'forum:' . $_REQUEST['moveto'];
......@@ -138,7 +138,7 @@ if ($tiki_p_admin_forum == 'y') {
if (isset($_REQUEST['mergesel'])) {
if (isset($_REQUEST['forumtopic'])) {
foreach(array_values($_REQUEST['forumtopic']) as $topic) {
foreach (array_values($_REQUEST['forumtopic']) as $topic) {
check_ticket('view-forum');
// To move a topic you just have to change the object
if ($topic != $_REQUEST['mergetopic']) {
......@@ -237,7 +237,7 @@ if ($tiki_p_admin_forum == 'y' || $tiki_p_forum_vote == 'y') {
if (isset($_REQUEST["comments_vote"]) && isset($_REQUEST["comments_threadId"])) {
check_ticket('view-forum');
$comments_show = 'y';
if ( $tikilib->register_user_vote($user, 'comment' . $_REQUEST["comments_threadId"], $_REQUEST['comments_vote'], range( 1, 5 ) ) ) {
if ($tikilib->register_user_vote($user, 'comment' . $_REQUEST["comments_threadId"], $_REQUEST['comments_vote'], range( 1, 5 ))) {
$commentslib->vote_comment($_REQUEST["comments_threadId"], $user, $_REQUEST["comments_vote"]);
}
$_REQUEST["comments_threadId"] = 0;
......@@ -421,7 +421,7 @@ if ($prefs['feature_user_watches'] == 'y') {
if (count($watching_categories_temp) > 0) {
$smarty->assign('category_watched', 'y');
$watching_categories = array();
foreach($watching_categories_temp as $wct) {
foreach ($watching_categories_temp as $wct) {
$watching_categories[] = array(
"categId" => $wct,
"name" => $categlib->get_category_name($wct)
......
......@@ -41,14 +41,16 @@ require_once 'lib/cache/pagecache.php';
$pageCache = Tiki_PageCache::create()
->disableForRegistered()
->onlyForGet()
->requiresPreference( 'memcache_forum_output' )
->addArray( $_GET )
->addValue( 'role', 'forum-page-output' )
->addKeys( $_REQUEST, array( 'locale', 'forumId', 'comments_parentId' ) )
->checkMeta( 'forum-page-output-meta-time', array(
'forumId' => @$_REQUEST['forumId'],
'comments_parentId' => @$_REQUEST['comments_parentId']
) )
->requiresPreference('memcache_forum_output')
->addArray($_GET)
->addValue('role', 'forum-page-output')
->addKeys($_REQUEST, array( 'locale', 'forumId', 'comments_parentId' ))
->checkMeta(
'forum-page-output-meta-time', array(
'forumId' => @$_REQUEST['forumId'],
'comments_parentId' => @$_REQUEST['comments_parentId']
)
)
->applyCache();
if ($prefs['feature_categories'] == 'y') {
......@@ -102,7 +104,7 @@ if (isset($_REQUEST['lock'])) {
$commentslib->comment_add_hit($_REQUEST["comments_parentId"]);
$commentslib->mark_comment($user, $_REQUEST['forumId'], $_REQUEST["comments_parentId"]);
$tikilib->get_perm_object( $_REQUEST["forumId"], 'forum' );
$tikilib->get_perm_object($_REQUEST["forumId"], 'forum');
if ($user) {
if ($forum_info["moderator"] == $user) {
......@@ -124,7 +126,7 @@ if ($tiki_p_admin_forum == 'y') {
$smarty->assign('tiki_p_forum_post_topic', 'y');
}
$access->check_permission( array('tiki_p_forum_read') );
$access->check_permission(array('tiki_p_forum_read'));
$smarty->assign('topics_next_offset', $_REQUEST['topics_offset'] + 1);
$smarty->assign('topics_prev_offset', $_REQUEST['topics_offset'] - 1);
......@@ -150,7 +152,7 @@ if ($tiki_p_admin_forum == 'y') {
if (isset($_REQUEST['delsel'])) {
if (isset($_REQUEST['forumthread'])) {
check_ticket('view-forum');
foreach(array_values($_REQUEST['forumthread']) as $thread) {
foreach (array_values($_REQUEST['forumthread']) as $thread) {
$commentslib->remove_comment($thread);
$commentslib->register_remove_post($_REQUEST['forumId'], $_REQUEST['comments_parentId']);
}
......@@ -163,7 +165,7 @@ if ($tiki_p_admin_forum == 'y') {
if (isset($_REQUEST['movesel'])) {
if (isset($_REQUEST['forumthread'])) {
check_ticket('view-forum');
foreach(array_values($_REQUEST['forumthread']) as $thread) {
foreach (array_values($_REQUEST['forumthread']) as $thread) {
$commentslib->set_parent($thread, $_REQUEST['moveto']);
}
}
......@@ -253,7 +255,7 @@ if ($prefs['feature_user_watches'] == 'y') {
if (count($watching_categories_temp) > 0) {
$smarty->assign('category_watched', 'y');
$watching_categories = array();
foreach($watching_categories_temp as $wct) {
foreach ($watching_categories_temp as $wct) {
$watching_categories[] = array(
"categId" => $wct,
"name" => $categlib->get_category_name($wct)
......@@ -343,7 +345,7 @@ if (isset($_REQUEST['display'])) {
if ($_REQUEST['display'] == 'pdf') {
require_once 'lib/pdflib.php';
$generator = new PdfGenerator();
$pdf = $generator->getPdf( 'tiki-view_forum_thread.php', array('display' => 'print', 'comments_parentId' => $_REQUEST['comments_parentId'], 'forumId' => $_REQUEST['forumId']) );
$pdf = $generator->getPdf('tiki-view_forum_thread.php', array('display' => 'print', 'comments_parentId' => $_REQUEST['comments_parentId'], 'forumId' => $_REQUEST['forumId']));
header('Cache-Control: private, must-revalidate');
header('Pragma: private');
......
......@@ -8,7 +8,7 @@
require_once ('tiki-setup.php');
require_once ('lib/tikilib.php');
require_once ('lib/wiki/histlib.php');
require_once('lib/wiki/wikilib.php');
require_once ('lib/wiki/wikilib.php');
require_once ('lib/rss/rsslib.php');
$access->check_feature('feature_wiki');
......@@ -19,8 +19,8 @@ if ($prefs['feed_wiki'] != 'y') {
}
$res=$access->authorize_rss(array('tiki_p_view', 'tiki_p_wiki_view_ref'));
if($res) {
if($res['header'] == 'y') {
if ($res) {
if ($res['header'] == 'y') {
header('WWW-Authenticate: Basic realm="'.$tikidomain.'"');
header('HTTP/1.0 401 Unauthorized');
}
......@@ -74,7 +74,7 @@ if ($output["data"]=="EMPTY") {
// do a diff between both pages
require_once('lib/diff/difflib.php');
$diff = diff2($prev_page_p , $curr_page_p, "unidiff");
$diff = diff2($prev_page_p, $curr_page_p, "unidiff");
foreach ($diff as $part) {
......
......@@ -19,8 +19,8 @@ if ($prefs['feed_wiki'] != 'y') {
}
$res=$access->authorize_rss(array('tiki_p_view', 'tiki_p_wiki_view_ref'));
if($res) {
if($res['header'] == 'y') {
if ($res) {
if ($res['header'] == 'y') {
header('WWW-Authenticate: Basic realm="'.$tikidomain.'"');
header('HTTP/1.0 401 Unauthorized');
}
......
......@@ -6,5 +6,5 @@
// $Id$
// This redirects to the sites root to prevent directory browsing
header ("location: ../index.php");
header("location: ../index.php");
die;
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment