aboutsummaryrefslogtreecommitdiff
path: root/src/admin/language.php
diff options
context:
space:
mode:
authorcassio <cassiopc@gmail.com>2015-08-08 21:11:58 +0000
committercassio <cassiopc@gmail.com>2015-08-08 21:11:58 +0000
commite80e0bbdb0b44f95caf6ee69456a05f1c4da65c3 (patch)
tree738656b816d38532b026af2cc66256517ebb415f /src/admin/language.php
parente911c708e2e5d087480564fcfcccd269bc93db58 (diff)
downloadboca-e80e0bbdb0b44f95caf6ee69456a05f1c4da65c3.tar.gz
boca-e80e0bbdb0b44f95caf6ee69456a05f1c4da65c3.zip
updates to allow submissions by command-line
Diffstat (limited to 'src/admin/language.php')
-rw-r--r--src/admin/language.php9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/admin/language.php b/src/admin/language.php
index b2a7481..94be1ae 100644
--- a/src/admin/language.php
+++ b/src/admin/language.php
@@ -15,7 +15,7 @@
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
////////////////////////////////////////////////////////////////////////////////
-// Last modified 05/aug/2012 by cassio@ime.usp.br
+// Last modified 08/aug/2015 by cassio@ime.usp.br
require('header.php');
if(($ct = DBContestInfo($_SESSION["usertable"]["contestnumber"])) == null)
@@ -29,13 +29,18 @@ if (isset($_GET["delete"]) && is_numeric($_GET["delete"])) {
if (isset($_POST["Submit3"]) && isset($_POST["langnumber"]) && is_numeric($_POST["langnumber"]) &&
isset($_POST["langname"]) && $_POST["langname"] != "") {
+ if(strpos(trim($_POST["langname"]),' ')!==false) {
+ $_POST["confirmation"]='';
+ MSGError('Language name cannot have spaces');
+ } else {
if ($_POST["confirmation"] == "confirm") {
$param = array();
$param['number'] = $_POST['langnumber'];
- $param['name'] = $_POST['langname'];
+ $param['name'] = trim($_POST['langname']);
$param['extension'] = $_POST['langextension'];
DBNewLanguage ($_SESSION["usertable"]["contestnumber"], $param);
}
+ }
ForceLoad("language.php");
}
?>