diff -r d8156d18ac58 -r 97ae8e9d5e29 index.php
--- a/index.php Thu Sep 27 15:55:37 2007 -0400
+++ b/index.php Sat Nov 03 07:43:35 2007 -0400
@@ -1,8 +1,8 @@
_die('The comment data could not be selected.');
$row = $db->fetchrow();
$db->free_result();
+ $row['subject'] = str_replace('\'', ''', $row['subject']);
echo '
';
break;
@@ -124,8 +125,12 @@
{
$text = $_POST['page_text'];
echo PageUtils::genPreview($_POST['page_text']);
+ $text = htmlspecialchars($text);
}
- else $text = RenderMan::getPage($paths->cpage['urlname_nons'], $paths->namespace, 0, false, false, false, false);
+ else
+ {
+ $text = RenderMan::getPage($paths->cpage['urlname_nons'], $paths->namespace, 0, false, false, false, false);
+ }
echo '
';
+ if ( getConfig('wiki_edit_notice') == '1' )
+ {
+ $notice = getConfig('wiki_edit_notice_text');
+ echo RenderMan::render($notice);
+ }
$template->footer();
break;
case 'viewsource':
@@ -151,7 +161,7 @@
';
echo '
-
+
';
$template->footer();
@@ -193,7 +203,7 @@
break;
case 'moreoptions':
$template->header();
- echo '';
+ echo '';
$template->footer();
break;
case 'protect':
@@ -202,32 +212,33 @@
{
if(!preg_match('#^([0-2]*){1}$#', $_POST['level'])) die_friendly('Error protecting page', 'Request validation failed
');
PageUtils::protect($paths->cpage['urlname_nons'], $paths->namespace, intval($_POST['level']), $_POST['reason']);
- die_friendly('Page protected', 'The protection setting has been applied. Return to the page.
');
+
+ die_friendly($lang->get('page_protect_lbl_success_title'), '' . $lang->get('page_protect_lbl_success_body', array( 'page_link' => makeUrl($paths->page) )) . '
');
}
$template->header();
?>
footer();
@@ -236,37 +247,37 @@
if(!empty($_POST['newname']))
{
$r = PageUtils::rename($paths->cpage['urlname_nons'], $paths->namespace, $_POST['newname']);
- die_friendly('Page renamed', ''.nl2br($r).' Return to the page.
');
+ die_friendly('Page renamed', ''.nl2br($r).' ' . $lang->get('etc_return_to_page') . '.
');
}
$template->header();
?>
footer();
break;
case 'flushlogs':
- if(!$session->get_permissions('clear_logs')) die_friendly('Access denied', 'Flushing the logs for a page requires administrative rights.
');
+ if(!$session->get_permissions('clear_logs'))
+ {
+ die_friendly($lang->get('etc_access_denied_short'), '' . $lang->get('etc_access_denied') . '
');
+ }
if(isset($_POST['_downthejohn']))
{
$template->header();
$result = PageUtils::flushlogs($paths->cpage['urlname_nons'], $paths->namespace);
- echo ''.$result.' Return to the page.
';
+ echo ''.$result.' ' . $lang->get('etc_return_to_page') . '.
';
$template->footer();
break;
}
$template->header();
?>
footer();
@@ -276,55 +287,66 @@
{
$template->header();
$result = PageUtils::delvote($paths->cpage['urlname_nons'], $paths->namespace);
- echo ''.$result.' Return to the page.
';
+ echo ''.$result.' ' . $lang->get('etc_return_to_page') . '.
';
$template->footer();
break;
}
$template->header();
?>
footer();
break;
case 'resetvotes':
- if(!$session->get_permissions('vote_reset')) die_friendly('Access denied', 'Resetting the deletion votes against this page requires admin rights.
');
+ if(!$session->get_permissions('vote_reset'))
+ {
+ die_friendly($lang->get('etc_access_denied_short'), '' . $lang->get('etc_access_denied') . '
');
+ }
if(isset($_POST['_youmaylivealittlelonger']))
{
$template->header();
$result = PageUtils::resetdelvotes($paths->cpage['urlname_nons'], $paths->namespace);
- echo ''.$result.' Return to the page.
';
+ echo ''.$result.' ' . $lang->get('etc_return_to_page') . '.
';
$template->footer();
break;
}
$template->header();
?>
footer();
break;
case 'deletepage':
- if(!$session->get_permissions('delete_page')) die_friendly('Access denied', 'Deleting pages requires admin rights.
');
+ if(!$session->get_permissions('delete_page'))
+ {
+ die_friendly($lang->get('etc_access_denied_short'), '' . $lang->get('etc_access_denied') . '
');
+ }
if(isset($_POST['_adiossucker']))
{
$reason = ( isset($_POST['reason']) ) ? $_POST['reason'] : false;
if ( empty($reason) )
- $error = 'Please enter a reason for deleting this page.';
+ $error = $lang->get('ajax_delete_prompt_reason');
else
{
$template->header();
$result = PageUtils::deletepage($paths->cpage['urlname_nons'], $paths->namespace, $reason);
- echo ''.$result.' Return to the page.
';
+ echo ''.$result.' ' . $lang->get('etc_return_to_page') . '.
';
$template->footer();
break;
}
@@ -332,19 +354,19 @@
$template->header();
?>
footer();
break;
case 'setwikimode':
- if(!$session->get_permissions('set_wiki_mode')) die_friendly('Access denied', 'Changing the wiki mode setting requires admin rights.
');
+ if(!$session->get_permissions('set_wiki_mode'))
+ {
+ die_friendly($lang->get('etc_access_denied_short'), '' . $lang->get('etc_access_denied') . '
');
+ }
if ( isset($_POST['finish']) )
{
$level = intval($_POST['level']);
@@ -355,7 +377,7 @@
$q = $db->sql_query('UPDATE '.table_prefix.'pages SET wiki_mode=' . $level . ' WHERE urlname=\'' . $db->escape($paths->cpage['urlname_nons']) . '\' AND namespace=\'' . $paths->namespace . '\';');
if ( !$q )
$db->_die();
- redirect(makeUrl($paths->page), htmlspecialchars($paths->cpage['name']), 'Wiki mode for this page has been set. Redirecting you to the page...', 2);
+ redirect(makeUrl($paths->page), htmlspecialchars($paths->cpage['name']), $lang->get('page_wikimode_success_redirect'), 2);
}
else
{
@@ -369,17 +391,13 @@
echo '