cvs: phpweb / submit-event.php

From: Date: Thu, 28 Sep 2006 16:41:51 +0000
Subject: cvs: phpweb / submit-event.php
Groups: php.mirrors 
Request: Send a blank email to php-mirrors+get-32855@lists.php.net to get a copy of this message
bjori Thu Sep 28 16:41:51 2006 UTC Modified files: /phpweb submit-event.php Log: Initialize variables correctly, bug#36582 http://cvs.php.net/viewvc.cgi/phpweb/submit-event.php?r1=1.29&r2=1.30&diff_format=u Index: phpweb/submit-event.php diff -u phpweb/submit-event.php:1.29 phpweb/submit-event.php:1.30 --- phpweb/submit-event.php:1.29 Thu Aug 21 10:10:45 2003 +++ phpweb/submit-event.php Thu Sep 28 16:41:51 2006 @@ -1,5 +1,5 @@ <?php -// $Id: submit-event.php,v 1.29 2003/08/21 10:10:45 goba Exp $ +// $Id: submit-event.php,v 1.30 2006/09/28 16:41:51 bjori Exp $ $_SERVER['BASE_PAGE'] = 'submit-event.php'; include_once $_SERVER['DOCUMENT_ROOT'] . '/include/prepend.inc'; include_once $_SERVER['DOCUMENT_ROOT'] . '/include/posttohost.inc'; @@ -12,15 +12,22 @@ // Avoid E_NOTICE errors on incoming vars if not set $vars = array( - 'type', 'sday', 'smonth', 'syear', 'eday', - 'emonth', 'eyear', 'recur', 'recur_day', 'country', - 'category', 'email', 'url', 'ldesc', 'sdesc' + 'sday', 'smonth', 'syear', 'eday', + 'emonth', 'eyear', 'recur', 'recur_day' ); foreach ($vars as $varname) { - if (!isset($_POST[$varname])) { - $_POST[$varname] = ''; + if (!isset($_POST[$varname]) || empty($_POST[$varname])) { + $_POST[$varname] = 0; } } +$vars = array( + 'type', 'country', 'category', 'email', 'url', 'ldesc', 'sdesc' +); +foreach($vars as $varname) { + if (!isset($_POST[$varname])) { + $_POST[$varname] = ""; + } +} // We need to process some form data if ($process) {

« previous php.mirrors (#32855) next »