Index: includes/EditPage.php
===================================================================
--- includes/EditPage.php (revision 20065)
+++ includes/EditPage.php (working copy)
@@ -205,10 +205,19 @@
if (is_null($nt) || !$nt->isEditable())
{
$formtype = '';
- $saveFailed = true;
- if ( is_null($nt) )
- {
- wfMessagePush('general', wfMsg('Article.Error.page-title-contains-illegal-chars'));
+ $saveFailed = true;
+ if (is_null($nt))
+ {
+ $titleLength = strlen($this->fulltitle);
+ if ($titleLength > 255)
+ {
+ // provided title is too long
+ wfMessagePush('general', wfMsg('Article.Error.title.length', abs(255 - $titleLength)));
+ }
+ else
+ {
+ wfMessagePush('general', wfMsg('Article.Error.page-title-contains-illegal-chars'));
+ }
}
else
{
@@ -494,8 +503,14 @@
// normal editing
if ($this->isNewPage())
{
+ $newTitle = !empty($this->title) ? $this->title : $displaytitle;
// insert the display title form field for new pages
- $formFields[] = '<div class="deki-new-page-title-border"><div class="deki-new-page-title"><input type="text" id="deki-new-page-title" name="new_page_title" value="'. htmlspecialchars($displaytitle) .'" /></div></div>';
+ $formFields[] =
+ '<div class="deki-new-page-title-border">'.
+ '<div class="deki-new-page-title">'.
+ '<input type="text" id="deki-new-page-title" name="new_page_title" value="'. htmlspecialchars($newTitle) .'" />'.
+ '</div>'.
+ '</div>';
}
}
else
Index: resources/resources.txt
===================================================================
--- resources/resources.txt (revision 20065)
+++ resources/resources.txt (working copy)
@@ -864,6 +864,7 @@
page-title-contains-illegal-chars=The title you are attempting to save contains illegal characters - please change your title.
page-title-is-empty=Page title can't be empty.
page-title-is-invalid=Page title ($1) is an invalid title - it contains illegal characters.
+ title.length=The title you are attempting to save is too long - please remove $1 characters.
save-failed-for=Save failed for $1
unknown-action-specified=The action specified by the URL is not\r\nrecognized by the server
| Images 0 | ||
|---|---|---|
| No images to display in the gallery. |
Copyright © 2011 MindTouch, Inc. Powered by