version 1.1.1.3, 2013/07/22 01:31:59
|
version 1.1.1.4, 2013/10/14 08:02:28
|
Line 2579 int phar_flush(phar_archive_data *phar, char *user_stu
|
Line 2579 int phar_flush(phar_archive_data *phar, char *user_stu
|
php_serialize_data_t metadata_hash; |
php_serialize_data_t metadata_hash; |
smart_str main_metadata_str = {0}; |
smart_str main_metadata_str = {0}; |
int free_user_stub, free_fp = 1, free_ufp = 1; |
int free_user_stub, free_fp = 1, free_ufp = 1; |
|
int manifest_hack = 0; |
|
|
if (phar->is_persistent) { |
if (phar->is_persistent) { |
if (error) { |
if (error) { |
Line 2930 int phar_flush(phar_archive_data *phar, char *user_stu
|
Line 2931 int phar_flush(phar_archive_data *phar, char *user_stu
|
|
|
manifest_len = offset + phar->alias_len + sizeof(manifest) + main_metadata_str.len; |
manifest_len = offset + phar->alias_len + sizeof(manifest) + main_metadata_str.len; |
phar_set_32(manifest, manifest_len); |
phar_set_32(manifest, manifest_len); |
|
/* Hack - see bug #65028, add padding byte to the end of the manifest */ |
|
if(manifest[0] == '\r' || manifest[0] == '\n') { |
|
manifest_len++; |
|
phar_set_32(manifest, manifest_len); |
|
manifest_hack = 1; |
|
} |
phar_set_32(manifest+4, new_manifest_count); |
phar_set_32(manifest+4, new_manifest_count); |
if (has_dirs) { |
if (has_dirs) { |
*(manifest + 8) = (unsigned char) (((PHAR_API_VERSION) >> 8) & 0xFF); |
*(manifest + 8) = (unsigned char) (((PHAR_API_VERSION) >> 8) & 0xFF); |
Line 3049 int phar_flush(phar_archive_data *phar, char *user_stu
|
Line 3056 int phar_flush(phar_archive_data *phar, char *user_stu
|
|
|
if (error) { |
if (error) { |
spprintf(error, 0, "unable to write temporary manifest of file \"%s\" to manifest of new phar \"%s\"", entry->filename, phar->fname); |
spprintf(error, 0, "unable to write temporary manifest of file \"%s\" to manifest of new phar \"%s\"", entry->filename, phar->fname); |
|
} |
|
|
|
return EOF; |
|
} |
|
} |
|
/* Hack - see bug #65028, add padding byte to the end of the manifest */ |
|
if(manifest_hack) { |
|
if(1 != php_stream_write(newfile, manifest, 1)) { |
|
if (closeoldfile) { |
|
php_stream_close(oldfile); |
|
} |
|
|
|
php_stream_close(newfile); |
|
|
|
if (error) { |
|
spprintf(error, 0, "unable to write manifest padding byte"); |
} |
} |
|
|
return EOF; |
return EOF; |