Revision: 1108
          http://mrbs.svn.sourceforge.net/mrbs/?rev=1108&view=rev
Author:   cimorrison
Date:     2009-05-13 15:55:16 +0000 (Wed, 13 May 2009)

Log Message:
-----------
Added a maxlength attribute to the name input on the edit_entry form to stop 
users typing in more characters than the database will accept (and later 
finding that the name has been silently truncated).

Modified Paths:
--------------
    mrbs/trunk/tables.my.sql
    mrbs/trunk/tables.pg.73and_above.sql
    mrbs/trunk/tables.pg.sql
    mrbs/trunk/web/config.inc.php
    mrbs/trunk/web/edit_entry.php

Modified: mrbs/trunk/tables.my.sql
===================================================================
--- mrbs/trunk/tables.my.sql    2009-05-13 10:14:13 UTC (rev 1107)
+++ mrbs/trunk/tables.my.sql    2009-05-13 15:55:16 UTC (rev 1108)
@@ -4,10 +4,13 @@
 # $Id$
 #
 # Notes:
-# If you have decided to change the prefix of your tables from 'mrbs_'
+# (1) If you have decided to change the prefix of your tables from 'mrbs_'
 # to something else then you must edit each 'CREATE TABLE' line
 # below.
-#
+# (2) If you change some of the varchar lengths here, then you should check
+# to see whether a corresponding length has been defined in the config file.
+# An example is ENTRY_NAME_LENGTH which is defined in the config file and
+# used for setting a maxlength attribute in the edit_entry form.
 
 CREATE TABLE mrbs_area
 (

Modified: mrbs/trunk/tables.pg.73and_above.sql
===================================================================
--- mrbs/trunk/tables.pg.73and_above.sql        2009-05-13 10:14:13 UTC (rev 
1107)
+++ mrbs/trunk/tables.pg.73and_above.sql        2009-05-13 15:55:16 UTC (rev 
1108)
@@ -21,6 +21,11 @@
 -- If you have decided to change the prefix of your tables from 'mrbs_'
 -- to something else then you must edit each 'CREATE TABLE' and 'create index'
 -- line below.
+--
+-- If you change some of the varchar lengths here, then you should check
+-- to see whether a corresponding length has been defined in the config file.
+-- An example is ENTRY_NAME_LENGTH which is defined in the config file and
+-- used for setting a maxlength attribute in the edit_entry form.
 
 
 CREATE TABLE mrbs_area

Modified: mrbs/trunk/tables.pg.sql
===================================================================
--- mrbs/trunk/tables.pg.sql    2009-05-13 10:14:13 UTC (rev 1107)
+++ mrbs/trunk/tables.pg.sql    2009-05-13 15:55:16 UTC (rev 1108)
@@ -10,6 +10,11 @@
 -- If you have decided to change the prefix of your tables from 'mrbs_'
 -- to something else then you must edit each 'CREATE TABLE' and 'create index'
 -- line below.
+--
+-- If you change some of the varchar lengths here, then you should check
+-- to see whether a corresponding length has been defined in the config file.
+-- An example is ENTRY_NAME_LENGTH which is defined in the config file and
+-- used for setting a maxlength attribute in the edit_entry form.
 
 CREATE TABLE mrbs_area
 (

Modified: mrbs/trunk/web/config.inc.php
===================================================================
--- mrbs/trunk/web/config.inc.php       2009-05-13 10:14:13 UTC (rev 1107)
+++ mrbs/trunk/web/config.inc.php       2009-05-13 15:55:16 UTC (rev 1108)
@@ -40,7 +40,12 @@
 // Uncomment this to NOT use PHP persistent (pooled) database connections:
 // $db_nopersist = 1;
 
+// Field lengths in the database tables
+// NOTE:  these must be kept in step with the database.   If you change the 
field
+// lengths in the database then you should change the values here, and vice 
versa.
+define("ENTRY_NAME_LENGTH", 80);    // characters   (name field in entry table)
 
+
 /*********************************
  * Site identification information
  *********************************/

Modified: mrbs/trunk/web/edit_entry.php
===================================================================
--- mrbs/trunk/web/edit_entry.php       2009-05-13 10:14:13 UTC (rev 1107)
+++ mrbs/trunk/web/edit_entry.php       2009-05-13 15:55:16 UTC (rev 1108)
@@ -452,7 +452,9 @@
 
     <div id="div_name">
       <label for="name"><?php echo get_vocab("namebooker")?>:</label>
-      <input id="name" name="name" value="<?php echo htmlspecialchars($name) 
?>">
+      <?php
+      echo "<input id=\"name\" name=\"name\" maxlength=\"" . ENTRY_NAME_LENGTH 
. "\" value=\"" . htmlspecialchars($name) . "\">\n";
+      ?>
     </div>
 
     <div id="div_description">


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

------------------------------------------------------------------------------
The NEW KODAK i700 Series Scanners deliver under ANY circumstances! Your
production scanning environment may not be a perfect world - but thanks to
Kodak, there's a perfect scanner to get the job done! With the NEW KODAK i700
Series Scanner you'll get full speed at 300 dpi even with all image 
processing features enabled. http://p.sf.net/sfu/kodak-com
_______________________________________________
Mrbs-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mrbs-commits

Reply via email to