# HG changeset patch # User Dan # Date 1193716488 14400 # Node ID d44492e34ab3c505d39f888467427083d6ae3ef7 # Parent b1530b6a06d2f6ae613d69aec6fec0238ec0c67a Failsafe page maintenance applets in index.php localized 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 '
'; if ( getConfig('wiki_edit_notice') == '1' ) @@ -157,7 +161,7 @@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(); @@ -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(); ?> 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(); @@ -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(); ?> 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; } @@ -338,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']); @@ -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 '