svn: /web/php-bugs/trunk/ include/functions.php www/bug.php

From: Date: Sun, 10 Jul 2011 21:12:49 +0000
Subject: svn: /web/php-bugs/trunk/ include/functions.php www/bug.php
Groups: php.webmaster 
Request: Send a blank email to php-webmaster+get-11524@lists.php.net to get a copy of this message
felipe Sun, 10 Jul 2011 21:12:49 +0000 Revision: http://svn.php.net/viewvc?view=revision&revision=313121 Log: - Fix warnings Changed paths: U web/php-bugs/trunk/include/functions.php U web/php-bugs/trunk/www/bug.php Modified: web/php-bugs/trunk/include/functions.php =================================================================== --- web/php-bugs/trunk/include/functions.php 2011-07-10 20:20:09 UTC (rev 313120) +++ web/php-bugs/trunk/include/functions.php 2011-07-10 21:12:49 UTC (rev 313121) @@ -1233,7 +1233,7 @@ $errors[] = 'Please select an appropriate package.'; } - if (!array_key_exists($in['bug_type'], $bug_types)) { + if (empty($in['bug_type']) || !array_key_exists($in['bug_type'], $bug_types)) { $errors[] = 'Please select a valid bug type.'; } Modified: web/php-bugs/trunk/www/bug.php =================================================================== --- web/php-bugs/trunk/www/bug.php 2011-07-10 20:20:09 UTC (rev 313120) +++ web/php-bugs/trunk/www/bug.php 2011-07-10 21:12:49 UTC (rev 313121) @@ -398,61 +398,65 @@ } // Require comment for open bugs only - if ($_POST['in']['status'] == 'Bogus' && - !in_array($bug['status'], array ('Bogus', 'Closed', 'Duplicate', 'No feedback', 'Wont fix')) && - strlen(trim($ncomment)) == 0 - ) { - $errors[] = "You must provide a comment when marking a bug 'Bogus'"; - } elseif (($_POST['in']['status'] == 'To be documented' && $bug['status'] != $_POST['in']['status']) || - (!empty($_POST['in']['resolve']) && $RESOLVE_REASONS[$_POST['in']['resolve']]['status'] == 'To be documented') - ) { - // Require explanation - if (strlen(trim($ncomment)) == 0) { - $errors[] = "You must provide a comment to help in the feature/issue documentation"; - } else if ($bug['status'] != 'To be documented' && $bug['assign'] == $_POST['in']['assign']) { - // Reset the assigned value when changing the status to 'To be documented', - // as more probably the developer (which was marked as assigned) won't document - // the fix. - $_POST['in']['assign'] = ''; - } - $_POST['in']['status'] = 'To be documented'; - } elseif (!empty($_POST['in']['resolve'])) { - if (!$trytoforce && isset($RESOLVE_REASONS[$_POST['in']['resolve']]) && - $RESOLVE_REASONS[$_POST['in']['resolve']]['status'] == $bug['status']) - { - $errors[] = 'The bug is already marked "'.$bug['status'].'". (Submit again to ignore this.)'; - } elseif (!$errors) { - if ($_POST['in']['status'] == $bug['status']) { - $_POST['in']['status'] = $RESOLVE_REASONS[$_POST['in']['resolve']]['status']; + if (empty($_POST['in']['status'])) { + $errors[] = "You must provide a status"; + } else { + if ($_POST['in']['status'] == 'Bogus' && + !in_array($bug['status'], array ('Bogus', 'Closed', 'Duplicate', 'No feedback', 'Wont fix')) && + strlen(trim($ncomment)) == 0 + ) { + $errors[] = "You must provide a comment when marking a bug 'Bogus'"; + } elseif (($_POST['in']['status'] == 'To be documented' && $bug['status'] != $_POST['in']['status']) || + (!empty($_POST['in']['resolve']) && $RESOLVE_REASONS[$_POST['in']['resolve']]['status'] == 'To be documented') + ) { + // Require explanation + if (strlen(trim($ncomment)) == 0) { + $errors[] = "You must provide a comment to help in the feature/issue documentation"; + } else if ($bug['status'] != 'To be documented' && $bug['assign'] == $_POST['in']['assign']) { + // Reset the assigned value when changing the status to 'To be documented', + // as more probably the developer (which was marked as assigned) won't document + // the fix. + $_POST['in']['assign'] = ''; } - if ($_POST['in']['status'] == 'Closed' && $bug['status'] == 'To be documented') { - $reason = $FIX_VARIATIONS['fixed']['Documentation problem']; - } elseif (isset($FIX_VARIATIONS) && isset($FIX_VARIATIONS[$_POST['in']['resolve']][$bug['package_name']])) { - $reason = $FIX_VARIATIONS[$_POST['in']['resolve']][$bug['package_name']]; - } else { - $reason = isset($RESOLVE_REASONS[$_POST['in']['resolve']]) ? $RESOLVE_REASONS[$_POST['in']['resolve']]['message'] : ''; - } + $_POST['in']['status'] = 'To be documented'; + } elseif (!empty($_POST['in']['resolve'])) { + if (!$trytoforce && isset($RESOLVE_REASONS[$_POST['in']['resolve']]) && + $RESOLVE_REASONS[$_POST['in']['resolve']]['status'] == $bug['status']) + { + $errors[] = 'The bug is already marked "'.$bug['status'].'". (Submit again to ignore this.)'; + } elseif (!$errors) { + if ($_POST['in']['status'] == $bug['status']) { + $_POST['in']['status'] = $RESOLVE_REASONS[$_POST['in']['resolve']]['status']; + } + if ($_POST['in']['status'] == 'Closed' && $bug['status'] == 'To be documented') { + $reason = $FIX_VARIATIONS['fixed']['Documentation problem']; + } elseif (isset($FIX_VARIATIONS) && isset($FIX_VARIATIONS[$_POST['in']['resolve']][$bug['package_name']])) { + $reason = $FIX_VARIATIONS[$_POST['in']['resolve']][$bug['package_name']]; + } else { + $reason = isset($RESOLVE_REASONS[$_POST['in']['resolve']]) ? $RESOLVE_REASONS[$_POST['in']['resolve']]['message'] : ''; + } - // do a replacement on @svn@ to the likely location of SVN for this package - if ($_POST['in']['resolve'] == 'trysvn') { - switch ($bug['package_name']) { - case 'Documentation' : - case 'Web Site' : - case 'Bug System' : - case 'PEPr' : - $errors[] = 'Cannot use "try svn" with ' . $bug['package_name']; - break; - case 'PEAR' : - $reason = str_replace('@svn@', 'pear-core', $reason); - $ncomment = "$reason\n\n$ncomment"; - break; - default : - $reason = str_replace('@svn@', $bug['package_name'], $reason); - $ncomment = "$reason\n\n$ncomment"; - break; + // do a replacement on @svn@ to the likely location of SVN for this package + if ($_POST['in']['resolve'] == 'trysvn') { + switch ($bug['package_name']) { + case 'Documentation' : + case 'Web Site' : + case 'Bug System' : + case 'PEPr' : + $errors[] = 'Cannot use "try svn" with ' . $bug['package_name']; + break; + case 'PEAR' : + $reason = str_replace('@svn@', 'pear-core', $reason); + $ncomment = "$reason\n\n$ncomment"; + break; + default : + $reason = str_replace('@svn@', $bug['package_name'], $reason); + $ncomment = "$reason\n\n$ncomment"; + break; + } + } else { + $ncomment = "$reason\n\n$ncomment"; } - } else { - $ncomment = "$reason\n\n$ncomment"; } } }

« previous php.webmaster (#11524) next »