summaryrefslogtreecommitdiff
path: root/ext/xmlreader/php_xmlreader.c
diff options
context:
space:
mode:
authorSara Golemon <pollita@php.net>2014-05-15 14:00:15 -0700
committerSara Golemon <pollita@php.net>2014-07-06 09:40:35 -0700
commit2d9885c8cbbc2199bac4801eaef7c18c76f28033 (patch)
treee31275badbb90e4d4c9f679d8c77159e62e16387 /ext/xmlreader/php_xmlreader.c
parent5b925824edf3edc951fc41608d5cbd07a0baab08 (diff)
downloadphp-git-2d9885c8cbbc2199bac4801eaef7c18c76f28033.tar.gz
Fix handling of session user module custom handlers.
According to the documentation, returning TRUE from user based session handlers should indicate success, while returning FALSE should indicate failure. The existing logic relied on casting the return value to an integer and returning that from the function. However, the internal handlers use SUCCESS/FAILURE where SUCCESS == 0, and FAILURE == -1, so the following behavior map occurs: return false; => return 0; => return SUCCESS return true; => return 1; => return <undefined> Since the session API checks against FAILURE, both boolean responses wind up appearing like "not FAILURE". This diff reasserts boolean responses to behave as documented and introduces some special handling for integer responses of 0 and -1 so that code can be written for older and newer versions of PHP.
Diffstat (limited to 'ext/xmlreader/php_xmlreader.c')
0 files changed, 0 insertions, 0 deletions