summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIlia Alshanetsky <iliaa@php.net>2005-11-29 23:10:15 +0000
committerIlia Alshanetsky <iliaa@php.net>2005-11-29 23:10:15 +0000
commitea80259eb322b39c2217fce561bb8c7289d6c851 (patch)
tree999745716651ceb300883606f423bfe706552a72
parent49f673979bcf62e76c4c8445bca90a86c88dc138 (diff)
downloadphp-git-ea80259eb322b39c2217fce561bb8c7289d6c851.tar.gz
Fixed ZTS build
-rw-r--r--ext/date/php_date.c12
-rw-r--r--ext/date/php_date.h1
2 files changed, 9 insertions, 4 deletions
diff --git a/ext/date/php_date.c b/ext/date/php_date.c
index d4e7d29965..80b0ca7aa6 100644
--- a/ext/date/php_date.c
+++ b/ext/date/php_date.c
@@ -33,6 +33,7 @@
function_entry date_functions[] = {
PHP_FE(strtotime, NULL)
PHP_FE(date, NULL)
+ PHP_FE(idate, NULL)
PHP_FE(gmdate, NULL)
PHP_FE(mktime, NULL)
PHP_FE(gmmktime, NULL)
@@ -686,9 +687,6 @@ PHPAPI int php_idate(char format, time_t ts, int localtime)
case 'Z': retval = (int) (!localtime ? offset->offset : 0); break;
case 'U': retval = (int) t->sse; break;
- default:
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unrecognized date format token.");
- break;
}
if (!localtime) {
@@ -723,6 +721,7 @@ PHP_FUNCTION(idate)
char *format;
int format_len;
time_t ts;
+ int ret;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|l", &format, &format_len, &ts) == FAILURE) {
RETURN_FALSE;
@@ -737,7 +736,12 @@ PHP_FUNCTION(idate)
ts = time(NULL);
}
- RETURN_LONG(php_idate(format[0], ts, 0));
+ ret = php_idate(format[0], ts, 0);
+ if (ret == -1) {
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unrecognized date format token.");
+ RETURN_FALSE;
+ }
+ RETURN_LONG(ret);
}
/* }}} */
diff --git a/ext/date/php_date.h b/ext/date/php_date.h
index 4fb8d4c9dc..5dc13dbc6c 100644
--- a/ext/date/php_date.h
+++ b/ext/date/php_date.h
@@ -28,6 +28,7 @@ extern zend_module_entry date_module_entry;
#define phpext_date_ptr &date_module_entry
PHP_FUNCTION(date);
+PHP_FUNCTION(idate);
PHP_FUNCTION(gmdate);
PHP_FUNCTION(strtotime);