Revision: 1483
http://mrbs.svn.sourceforge.net/mrbs/?rev=1483&view=rev
Author: cimorrison
Date: 2010-09-30 13:16:21 +0000 (Thu, 30 Sep 2010)
Log Message:
-----------
Fixed bug which allowed rooms and areas to be created with no name.
Modified Paths:
--------------
mrbs/trunk/web/add.php
mrbs/trunk/web/lang.en
Modified: mrbs/trunk/web/add.php
===================================================================
--- mrbs/trunk/web/add.php 2010-09-30 13:04:21 UTC (rev 1482)
+++ mrbs/trunk/web/add.php 2010-09-30 13:16:21 UTC (rev 1483)
@@ -15,10 +15,15 @@
// This file is for adding new areas/rooms
+// First of all check that we've got an area or room name
+if (!isset($name) || ($name === ''))
+{
+ $error = "empty_name";
+}
+
// we need to do different things depending on if its a room
// or an area
-
-if ($type == "area")
+elseif ($type == "area")
{
// Truncate the name field to the maximum length as a precaution.
$name = substr($name, 0, $maxlength['area.area_name']);
@@ -49,7 +54,7 @@
sql_mutex_unlock("$tbl_area");
}
-if ($type == "room")
+elseif ($type == "room")
{
// Truncate the name and description fields to the maximum length as a
precaution.
$name = substr($name, 0, $maxlength['room.room_name']);
Modified: mrbs/trunk/web/lang.en
===================================================================
--- mrbs/trunk/web/lang.en 2010-09-30 13:04:21 UTC (rev 1482)
+++ mrbs/trunk/web/lang.en 2010-09-30 13:16:21 UTC (rev 1483)
@@ -289,6 +289,7 @@
$vocab["norooms"] = "No rooms have been defined.";
$vocab["administration"] = "Room Details";
$vocab["invalid_area_name"] = "This area name has already been used!";
+$vocab["empty_name"] = "You have not entered a name!";
// Used in edit_area_room.php
$vocab["editarea"] = "Edit Area";
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
------------------------------------------------------------------------------
Start uncovering the many advantages of virtual appliances
and start using them to simplify application deployment and
accelerate your shift to cloud computing.
http://p.sf.net/sfu/novell-sfdev2dev
_______________________________________________
Mrbs-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mrbs-commits