Uh oh!
There was an error while loading. Please reload this page.
Warning to error promotion for set(raw)cookie() - #5819
Conversation
c1691bf to
987ca60CompareGirgias
commented
Jul 20, 2020
If there are no objections I'll merge this at the end of the week. |
There was a problem hiding this comment.
cc @kocsismate, but I don't think this format makes sense. $expires_or_options["path"] is not the parameter name.
There was a problem hiding this comment.
FWIW, I don't think we should try too hard to get the argument error formatting everywhere. If it's inconvenient from the implementation POV, don't do it. Here, it would be more elegant to keep checks inside php_setcookie.
There was a problem hiding this comment.
we used unserialize(): "max_depth" option must be of type int, %s given in a similar situation :)
There was a problem hiding this comment.
This RETURN_THROWS() doesn't make much sense, as it cannot be executed after the goto cleanup.
Uh oh!
There was an error while loading. Please reload this page.
399ee62 to
39d24b4Compare39d24b4 to
59e239cCompare59e239c to
6521060Compare| } | ||
| PHPAPI int php_setcookie(zend_string *name, zend_string *value, time_t expires, zend_string *path, zend_string *domain, int secure, int httponly, zend_string *samesite, int url_encode) | ||
| #define ILLEGAL_COOKIE_CHARACTER "\",\", \";\", \" \", \"\\t\", \"\\r\", \"\\n\", \"\\013\", and \"\\014\"" |
There was a problem hiding this comment.
| #defineILLEGAL_COOKIE_CHARACTER "\",\", \";\", \" \", \"\\t\", \"\\r\", \"\\n\", \"\\013\", and \"\\014\"" | |
| #defineILLEGAL_COOKIE_CHARACTER "\",\", \";\", \" \", \"\\t\", \"\\r\", \"\\n\", \"\\013\", or \"\\014\"" |
I think...
Uh oh!
There was an error while loading. Please reload this page.
| } | ||
| // To go above year 9999: 60 * 60 * 24 * 365 * 9999 | ||
| try { | ||
| setcookie('name', 'value', 315328464000); |
There was a problem hiding this comment.
| setcookie('name', 'value', 315328464000); | |
| setrawcookie('name', 'value', 315328464000); |
I've merged
setcookie()andsetrawcookie()into a common implementation at the same time