diff -r b1530b6a06d2 -r d44492e34ab3 index.php --- a/index.php Mon Oct 29 22:38:03 2007 -0400 +++ b/index.php Mon Oct 29 23:54:48 2007 -0400 @@ -125,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 '

@@ -134,12 +138,12 @@
'; if($paths->wiki_mode) - echo 'Edit summary:

'; + echo $lang->get('editor_lbl_edit_summary') . '

'; echo '
- - - - + + + +
'; if ( getConfig('wiki_edit_notice') == '1' ) @@ -157,7 +161,7 @@
'; echo '
- + '; $template->footer(); @@ -199,7 +203,7 @@ break; case 'moreoptions': $template->header(); - echo ''; + echo ''; $template->footer(); break; case 'protect': @@ -208,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(); ?>
- Error: you must enter a reason for protecting this page.

'; ?> -

Reason for protecting the page:

+ ' . $lang->get('page_protect_err_need_reason') . '

'; ?> +

get('page_protect_lbl_reason'); ?>


- Protecion level to be applied: get('page_protect_lbl_level'); ?> get('page_protect_lbl_level_none'); break; case '1': - echo 'Full protection'; + echo $lang->get('page_protect_lbl_level_full'); break; case '2': - echo 'Semi-protection'; + echo $lang->get('page_protect_lbl_level_semi'); break; default: echo 'None; Warning: request validation will fail after clicking submit'; } ?>

-

+

footer(); @@ -242,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(); ?>
- Error: you must enter a new name for this page.

'; ?> -

Please enter a new name for this page:

+ ' . $lang->get('page_rename_err_need_name') . '

'; ?> +

get('page_rename_lbl'); ?>

-

+

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(); ?>
-

You are about to destroy all logged edits and actions on this page.

-

Unlike deleting or editing this page, this action is not reversible! You should only do this if you are desparate for - database space.

-

Do you really want to continue?

-

+ get('page_flushlogs_warning_stern'); ?> +

footer(); @@ -282,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(); ?>
-

Your vote counts.

-

If you think that this page is not relavent to the content on this site, or if it looks like this page was only created in - an attempt to spam the site, you can request that this page be deleted by an administrator.

-

After you vote, you should leave a comment explaining the reason for your vote, especially if you are the first person to - vote against this page.

-

So far, cpage['delvotes'] == 1 ) ? $paths->cpage['delvotes'] . ' person has' : $paths->cpage['delvotes'] . ' people have'; ?> voted to delete this page.

-

+ get('page_delvote_warning_stern'); + echo '

'; + switch($paths->cpage['delvotes']) + { + case 0: echo $lang->get('page_delvote_count_zero'); break; + case 1: echo $lang->get('page_delvote_count_one'); break; + default: echo $lang->get('page_delvote_count_plural', array('delvotes' => $paths->cpage['delvotes'])); break; + } + echo '

'; + ?> +

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(); ?>
-

This action will reset the number of votes against this page to zero. Are you sure you want to do this?

-

+

get('ajax_delvote_reset_confirm'); ?>

+

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; } @@ -338,19 +354,19 @@ $template->header(); ?>
-

You are about to destroy this page.

-

While the deletion of the page itself is completely reversible, it is impossible to recover any comments or category information on this page. If this is a file page, the file along with all older revisions of it will be permanently deleted. Also, any custom information that this page is tagged with, such as a custom name, protection status, or additional settings such as whether to allow comments, will be permanently lost.

-

Are you absolutely sure that you want to continue?
- You will not be asked again.

+ get('page_delete_warning_stern'); ?> $error

"; ?> -

Reason for deleting:

-

+

get('page_delete_lbl_reason'); ?>

+

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']); @@ -361,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 { @@ -375,17 +391,13 @@ echo '
'; echo ''; echo ''; - $level_txt = ( $level == 0 ) ? 'disabled' : ( ( $level == 1 ) ? 'enabled' : 'use the global setting' ); - $blurb = ( $level == 0 || ( $level == 2 && getConfig('wiki_mode') != '1' ) ) ? 'Because this will disable the wiki behavior on this page, several features, most - notably the ability for users to vote to have this page deleted, will be disabled as they are not relevant to non-wiki pages. In addition, users will not be able - to edit this page unless an ACL rule specifically permits them.' : 'Because this will enable the wiki behavior on this page, users will gain the ability to - freely edit this page unless an ACL rule specifically denies them. If your site is public and gets good traffic, you should be aware of the possiblity of vandalism, and you need to be ready to revert - malicious edits to this page.'; + $level_txt = ( $level == 0 ) ? 'page_wikimode_level_off' : ( ( $level == 1 ) ? 'page_wikimode_level_on' : 'page_wikimode_level_global' ); + $blurb = ( $level == 0 || ( $level == 2 && getConfig('wiki_mode') != '1' ) ) ? 'page_wikimode_blurb_disable' : 'page_wikimode_blurb_enable'; ?> -

You are changing wiki mode for this page.

-

Wiki features will be set to .

-

If you want to continue, please click the button below.

-

+

get('page_wikimode_heading'); ?>

+

get($level_txt) . ' ' . $lang->get($blurb); ?>

+

get('page_wikimode_warning'); ?>

+

'; $template->footer(); @@ -404,16 +416,16 @@ case 'detag': if ( $session->user_level < USER_LEVEL_ADMIN ) { - die_friendly('Access denied', '

You need to be an administrator to detag pages.

'); + die_friendly($lang->get('etc_access_denied_short'), '

' . $lang->get('etc_access_denied') . '

'); } if ( $paths->page_exists ) { - die_friendly('Invalid request', '

The detag action is only valid for pages that have been deleted in the past.

'); + die_friendly($lang->get('etc_invalid_request_short'), '

' . $lang->get('page_detag_err_page_exists') . '

'); } $q = $db->sql_query('DELETE FROM '.table_prefix.'tags WHERE page_id=\'' . $db->escape($paths->cpage['urlname_nons']) . '\' AND namespace=\'' . $paths->namespace . '\';'); if ( !$q ) $db->_die('Detag query, index.php:'.__LINE__); - die_friendly('Page detagged', '

All stale tags have been removed from this page.

'); + die_friendly($lang->get('page_detag_success_title'), '

' . $lang->get('page_detag_success_body') . '

'); break; case 'aclmanager': $data = ( isset($_POST['data']) ) ? $_POST['data'] : Array('mode' => 'listgroups');