Changeset:
        e406bf4124dd
        
https://sourceforge.net/p/mrbs/hg-code/ci/e406bf4124ddb6832c7481fcc8289b568183ecc6
Author:
        Campbell Morrison <[email protected]>
Date:
        Mon Nov 09 11:19:44 2015 +0000
Log message:

Added a check to make sure that custom field names don't contain spaces.  (See 
SF Support Requests #816)

diffstat:

 web/mrbs_sql.inc |  10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)

diffs (20 lines):

diff -r 1004daa79fd8 -r e406bf4124dd web/mrbs_sql.inc
--- a/web/mrbs_sql.inc  Mon Nov 09 10:43:55 2015 +0000
+++ b/web/mrbs_sql.inc  Mon Nov 09 11:19:44 2015 +0000
@@ -530,6 +530,16 @@
   foreach ($fields as $field)
   {
     $key = $field['name'];
+    
+    // Check to see whether custom field names obey the MRBS rules.   If we 
don't check
+    // other parts of the code will run without producing PHP or SQL errors 
but will give
+    // the wrong results.   A bit of a crude check, and in due course we 
probably ought to
+    // allow custom fields with spaces in them (or else have custom fields 
created by MRBS).
+    if (strpos($key, ' ') !== FALSE)
+    {
+      fatal_error(FALSE, "Custom field names cannot contain spaces.", FALSE);
+    }
+    
     // If the key doesn't exist in the $data array then the database will just 
use its
     // default value for the column.    If it does exist and is set to NULL 
then we'll
     // write NULL to the database (which may not necessarily be the default 
value).

------------------------------------------------------------------------------
Presto, an open source distributed SQL query engine for big data, initially
developed by Facebook, enables you to easily query your data on Hadoop in a 
more interactive manner. Teradata is also now providing full enterprise
support for Presto. Download a free open source copy now.
http://pubads.g.doubleclick.net/gampad/clk?id=250295911&iu=/4140
_______________________________________________
Mrbs-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mrbs-commits

Reply via email to