--- embedaddon/php/ext/phar/phar_object.c 2012/02/21 23:47:59 1.1 +++ embedaddon/php/ext/phar/phar_object.c 2012/05/29 12:34:41 1.1.1.2 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: phar_object.c,v 1.1 2012/02/21 23:47:59 misho Exp $ */ +/* $Id: phar_object.c,v 1.1.1.2 2012/05/29 12:34:41 misho Exp $ */ #include "phar_internal.h" #include "func_interceptors.h" @@ -257,7 +257,8 @@ static void phar_mung_server_vars(char *fname, char *e static int phar_file_action(phar_archive_data *phar, phar_entry_info *info, char *mime_type, int code, char *entry, int entry_len, char *arch, char *basename, char *ru, int ru_len TSRMLS_DC) /* {{{ */ { - char *name = NULL, buf[8192], *cwd; + char *name = NULL, buf[8192]; + const char *cwd; zend_syntax_highlighter_ini syntax_highlighter_ini; sapi_header_line ctr = {0}; size_t got; @@ -427,7 +428,7 @@ static void phar_do_403(char *entry, int entry_len TSR sapi_header_line ctr = {0}; ctr.response_code = 403; - ctr.line_len = sizeof("HTTP/1.0 403 Access Denied"); + ctr.line_len = sizeof("HTTP/1.0 403 Access Denied")-1; ctr.line = "HTTP/1.0 403 Access Denied"; sapi_header_op(SAPI_HEADER_REPLACE, &ctr TSRMLS_CC); sapi_send_headers(TSRMLS_C); @@ -452,7 +453,7 @@ static void phar_do_404(phar_archive_data *phar, char } ctr.response_code = 404; - ctr.line_len = sizeof("HTTP/1.0 404 Not Found")+1; + ctr.line_len = sizeof("HTTP/1.0 404 Not Found")-1; ctr.line = "HTTP/1.0 404 Not Found"; sapi_header_op(SAPI_HEADER_REPLACE, &ctr TSRMLS_CC); sapi_send_headers(TSRMLS_C); @@ -540,7 +541,7 @@ PHP_METHOD(Phar, running) return; } - fname = zend_get_executed_filename(TSRMLS_C); + fname = (char*)zend_get_executed_filename(TSRMLS_C); fname_len = strlen(fname); if (fname_len > 7 && !memcmp(fname, "phar://", 7) && SUCCESS == phar_split_fname(fname, fname_len, &arch, &arch_len, &entry, &entry_len, 2, 0 TSRMLS_CC)) { @@ -574,7 +575,7 @@ PHP_METHOD(Phar, mount) return; } - fname = zend_get_executed_filename(TSRMLS_C); + fname = (char*)zend_get_executed_filename(TSRMLS_C); fname_len = strlen(fname); #ifdef PHP_WIN32 @@ -658,7 +659,8 @@ PHP_METHOD(Phar, webPhar) zval *mimeoverride = NULL, *rewrite = NULL; char *alias = NULL, *error, *index_php = NULL, *f404 = NULL, *ru = NULL; int alias_len = 0, ret, f404_len = 0, free_pathinfo = 0, ru_len = 0; - char *fname, *basename, *path_info, *mime_type = NULL, *entry, *pt; + char *fname, *path_info, *mime_type = NULL, *entry, *pt; + const char *basename; int fname_len, entry_len, code, index_php_len = 0, not_cgi; phar_archive_data *phar = NULL; phar_entry_info *info = NULL; @@ -668,7 +670,7 @@ PHP_METHOD(Phar, webPhar) } phar_request_initialize(TSRMLS_C); - fname = zend_get_executed_filename(TSRMLS_C); + fname = (char*)zend_get_executed_filename(TSRMLS_C); fname_len = strlen(fname); if (phar_open_executed_filename(alias, alias_len, &error TSRMLS_CC) != SUCCESS) { @@ -891,7 +893,7 @@ PHP_METHOD(Phar, webPhar) char *tmp = NULL, sa = '\0'; sapi_header_line ctr = {0}; ctr.response_code = 301; - ctr.line_len = sizeof("HTTP/1.1 301 Moved Permanently")+1; + ctr.line_len = sizeof("HTTP/1.1 301 Moved Permanently")-1; ctr.line = "HTTP/1.1 301 Moved Permanently"; sapi_header_op(SAPI_HEADER_REPLACE, &ctr TSRMLS_CC); @@ -934,7 +936,7 @@ PHP_METHOD(Phar, webPhar) } if (mimeoverride && zend_hash_num_elements(Z_ARRVAL_P(mimeoverride))) { - char *ext = zend_memrchr(entry, '.', entry_len); + const char *ext = zend_memrchr(entry, '.', entry_len); zval **val; if (ext) { @@ -1480,7 +1482,7 @@ PHP_METHOD(Phar, unlinkArchive) return; } - zname = zend_get_executed_filename(TSRMLS_C); + zname = (char*)zend_get_executed_filename(TSRMLS_C); zname_len = strlen(zname); if (zname_len > 7 && !memcmp(zname, "phar://", 7) && SUCCESS == phar_split_fname(zname, zname_len, &arch, &arch_len, &entry, &entry_len, 2, 0 TSRMLS_CC)) { @@ -2201,7 +2203,8 @@ static int phar_copy_file_contents(phar_entry_info *en static zval *phar_rename_archive(phar_archive_data *phar, char *ext, zend_bool compress TSRMLS_DC) /* {{{ */ { - char *oldname = NULL, *oldpath = NULL; + const char *oldname = NULL; + char *oldpath = NULL; char *basename = NULL, *basepath = NULL; char *newname = NULL, *newpath = NULL; zval *ret, arg1; @@ -4296,7 +4299,8 @@ static int phar_extract_file(zend_bool overwrite, phar php_stream_statbuf ssb; int len; php_stream *fp; - char *fullpath, *slash; + char *fullpath; + const char *slash; mode_t mode; if (entry->is_mounted) {