Reading $_POST['var'] from empty $_POST sets $_POST['var'] = null #320

Closed
ambientium opened this Issue Apr 11, 2011 · 1 comment

Comments

Projects
None yet
2 participants
@ambientium

Unfortunatelly, this is not simply reproducible. But I face this problem in some complex code. Calling Formatter::getText($_POST['name']) on an empty $_POST caused existence of $_POST['name'] with empty (null) value. Code of Formatter::getText is below (one line method).

    $form .= Form::getItem($label, 'name', 'text', array(
        'id'                => 'signupProjectName',
        'value'             => Formatter::getText($_POST['name']),
        'errorMessage'      => $errors['name'],
        'insideInput'       => '<span id="signupDomain">.' . $projectHint . '</span>',
        'obligate'          => true,
        'hint'              => (false == $disableHint ? Graphics::getHintBox(Portal::$text['webnode.com']['__signup-text1__'], Portal::$text['webnode.com']['__signup-subtitle1__']) : ''),
        'nospacer'          => true,
        'showInlineError'   => true,
        'maxlength'         => $CFG['portal']['projectMaxLength'],

        'wrapperStyle'      => (isset($errors['captcha']) ? 'display: none;' : null), 
    ));

class Formatter
{
........
public static function getText($binaryText)
{
return htmlspecialchars($binaryText,ENT_COMPAT,'utf-8');
}
.......
}

@ptarjan

This comment has been minimized.

Show comment Hide comment
@ptarjan

ptarjan May 13, 2013

Contributor

We're closing out all bugs older than 2 months. http://www.hiphop-php.com/wp/?p=575

If this is still an issue, please re-open it, and in order of goodness:

  1. Give detailed repro steps
  2. Write a test case in hphp/tests/quick (run it with hphp/tests/run) and send the pull request
  3. Fix it in a pull request
Contributor

ptarjan commented May 13, 2013

We're closing out all bugs older than 2 months. http://www.hiphop-php.com/wp/?p=575

If this is still an issue, please re-open it, and in order of goodness:

  1. Give detailed repro steps
  2. Write a test case in hphp/tests/quick (run it with hphp/tests/run) and send the pull request
  3. Fix it in a pull request

@ptarjan ptarjan closed this May 13, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment