Skip to content

[2.3][Form] ServerParams.php : Related to Improve bytes conversion method #8254

Closed
@antoox

Description

@antoox

On a 32-bit system and Symfony 2.3:

Since Improve bytes conversion method was merged #7413, the getPostMaxSize function in Symfony\Component\Form\Extension\Validator\Util\ServerParams.php returns a bad int number (whether the iniMax number is greater than PHP_INT_MAX 2147483647).

The error comes from the line 36:

return intval($match[2], $bases[$match[1]]) << $shifts[$match[3]];

For instance '2G' gives:

return 2 << 30;  // -2147483648 

Indeed, the Shift left operator on PHP does a bitwise operation (and so returns an integer instead of a double : needed here )

It is really damaging since all Symfony2 forms use this verification when posting data.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions