# HG changeset patch
# User Dan
# Date 1195858764 18000
# Node ID 7846d45bd2509a3a02a59a98390458d8f12857bc
# Parent 0f039028f7a521a99579a4ea1e3d35f9d75a2296
Changed all urlname/page_id columns to varchar(255) because 63 characters just isn't long enough
diff -r 0f039028f7a5 -r 7846d45bd250 includes/pageprocess.php
--- a/includes/pageprocess.php Thu Nov 22 02:10:12 2007 -0500
+++ b/includes/pageprocess.php Fri Nov 23 17:59:24 2007 -0500
@@ -617,6 +617,7 @@
global $db, $session, $paths, $template, $plugins; // Common objects
global $email;
+ $page_urlname = dirtify_page_id($this->page_id);
if ( $this->page_id == $paths->cpage['urlname_nons'] && $this->namespace == $paths->namespace )
{
$page_name = ( isset($paths->cpage['name']) ) ? $paths->cpage['name'] : $this->page_id;
@@ -626,7 +627,7 @@
$page_name = ( isset($paths->pages[$this->page_id]) ) ? $paths->pages[$this->page_id]['name'] : $this->page_id;
}
- $target_username = strtr($page_name,
+ $target_username = strtr($page_urlname,
Array(
'_' => ' ',
'<' => '<',
diff -r 0f039028f7a5 -r 7846d45bd250 includes/pageutils.php
--- a/includes/pageutils.php Thu Nov 22 02:10:12 2007 -0500
+++ b/includes/pageutils.php Fri Nov 23 17:59:24 2007 -0500
@@ -623,8 +623,8 @@
{
$rc = '';
}
- echo '
nslist['User'] . $r['author']) )
+ echo ' | nslist['User'] . sanitize_page_id($r['author'])) )
{
echo 'class="wikilink-nonexistent"';
}
@@ -672,8 +672,8 @@
echo ' | ' . $r['date_string'] . ' | ';
// User
- echo 'nslist['User'] . $r['author'])) echo 'class="wikilink-nonexistent"';
+ echo ' | nslist['User'] . sanitize_page_id($r['author']))) echo 'class="wikilink-nonexistent"';
echo '>' . $r['author'] . ' | ';
@@ -1020,7 +1020,7 @@
// Determine the name, and whether to link to the user page or not
$name = '';
- if($row['user_id'] > 0) $name .= '';
+ if($row['user_id'] > 0) $name .= '';
$name .= $row['name'];
if($row['user_id'] > 0) $name .= '';
$strings['NAME'] = $name; unset($name);
diff -r 0f039028f7a5 -r 7846d45bd250 index.php
--- a/index.php Thu Nov 22 02:10:12 2007 -0500
+++ b/index.php Fri Nov 23 17:59:24 2007 -0500
@@ -54,7 +54,7 @@
switch($_GET['do'])
{
default:
- die_friendly('Invalid action', 'The action "'.$_GET['do'].'" is not defined. Return to viewing this page\'s text.
');
+ die_friendly('Invalid action', 'The action "'.htmlspecialchars($_GET['do']).'" is not defined. Return to viewing this page\'s text.
');
break;
case 'view':
// echo PageUtils::getpage($paths->page, true, ( (isset($_GET['oldid'])) ? $_GET['oldid'] : false ));
@@ -117,10 +117,18 @@
$template->footer();
break;
case 'edit':
- if(isset($_POST['_cancel'])) { header('Location: '.makeUrl($paths->page)); echo 'Redirecting...If you haven\'t been redirected yet, click here.'; break; }
- if(isset($_POST['_save'])) {
+ if(isset($_POST['_cancel']))
+ {
+ redirect(makeUrl($paths->page), '', '', 0);
+ break;
+ }
+ if(isset($_POST['_save']))
+ {
$e = PageUtils::savepage($paths->cpage['urlname_nons'], $paths->namespace, $_POST['page_text'], $_POST['edit_summary'], isset($_POST['minor']));
- header('Location: '.makeUrl($paths->page)); echo 'Redirecting...If you haven\'t been redirected yet, click here.'; break;
+ if ( $e == 'good' )
+ {
+ redirect(makeUrl($paths->page), 'Changes saved', 'Your changes to this page have been saved. Redirecting...', 3);
+ }
}
$template->header();
if(isset($_POST['_preview']))
diff -r 0f039028f7a5 -r 7846d45bd250 plugins/SpecialPageFuncs.php
--- a/plugins/SpecialPageFuncs.php Thu Nov 22 02:10:12 2007 -0500
+++ b/plugins/SpecialPageFuncs.php Fri Nov 23 17:59:24 2007 -0500
@@ -172,6 +172,7 @@
exit;
}
$template->header();
+ /*
if ( !$session->get_permissions('create_page') )
{
echo 'Wiki mode is disabled, only admins can create pages.';
@@ -181,6 +182,7 @@
exit;
}
+ */
echo RenderMan::render('Using the form below you can create a page.');
?>