@@ -632,18 +632,14 @@ zend_result phar_get_entry_data(phar_entry_data **ret, char *fname, size_t fname
632
632
/**
633
633
* Create a new dummy file slot within a writeable phar for a newly created file
634
634
*/
635
- phar_entry_data * phar_get_or_create_entry_data (char * fname , size_t fname_len , const char * path , size_t path_len , const char * mode , char allow_dir , char * * error , int security ) /* {{{ */
635
+ static phar_entry_data * phar_get_or_create_entry_data_ex (char * fname , size_t fname_len , const char * path , size_t path_len , const char * mode , char allow_dir , char * * error , int security ) /* {{{ */
636
636
{
637
637
phar_archive_data * phar ;
638
638
phar_entry_info * entry , etemp ;
639
639
phar_entry_data * ret ;
640
640
const char * pcr_error ;
641
641
char is_dir ;
642
642
643
- #ifdef PHP_WIN32
644
- phar_unixify_path_separators (path , path_len );
645
- #endif
646
-
647
643
is_dir = (path_len && path [path_len - 1 ] == '/' ) ? 1 : 0 ;
648
644
649
645
if (FAILURE == phar_get_archive (& phar , fname , fname_len , NULL , 0 , error )) {
@@ -731,6 +727,18 @@ phar_entry_data *phar_get_or_create_entry_data(char *fname, size_t fname_len, co
731
727
}
732
728
/* }}} */
733
729
730
+ phar_entry_data * phar_get_or_create_entry_data (char * fname , size_t fname_len , const char * path , size_t path_len , const char * mode , char allow_dir , char * * error , int security )
731
+ {
732
+ #ifdef PHP_WIN32
733
+ char * path_dup = estrndup (path , path_len );
734
+ phar_unixify_path_separators (path_dup , path_len );
735
+ phar_entry_data * ret = phar_get_or_create_entry_data_ex (fname , fname_len , path_dup , path_len , mode , allow_dir , error , security );
736
+ efree (path_dup );
737
+ return ret ;
738
+ #endif
739
+ return phar_get_or_create_entry_data_ex (fname , fname_len , path , path_len , mode , allow_dir , error , security );
740
+ }
741
+
734
742
static inline void phar_set_pharfp (phar_archive_data * phar , php_stream * fp )
735
743
{
736
744
if (!phar -> is_persistent ) {
@@ -1245,16 +1253,12 @@ phar_entry_info *phar_get_entry_info(phar_archive_data *phar, const char *path,
1245
1253
* valid pre-existing empty directory entries
1246
1254
*/
1247
1255
// TODO: convert this to use zend_string too
1248
- phar_entry_info * phar_get_entry_info_dir (phar_archive_data * phar , const char * path , size_t path_len , char dir , char * * error , int security ) /* {{{ */
1256
+ static phar_entry_info * phar_get_entry_info_dir_ex (phar_archive_data * phar , const char * path , size_t path_len , char dir , char * * error , int security ) /* {{{ */
1249
1257
{
1250
1258
const char * pcr_error ;
1251
1259
phar_entry_info * entry ;
1252
1260
int is_dir ;
1253
1261
1254
- #ifdef PHP_WIN32
1255
- phar_unixify_path_separators (path , path_len );
1256
- #endif
1257
-
1258
1262
is_dir = (path_len && (path [path_len - 1 ] == '/' )) ? 1 : 0 ;
1259
1263
1260
1264
if (error ) {
@@ -1401,6 +1405,18 @@ phar_entry_info *phar_get_entry_info_dir(phar_archive_data *phar, const char *pa
1401
1405
}
1402
1406
/* }}} */
1403
1407
1408
+ phar_entry_info * phar_get_entry_info_dir (phar_archive_data * phar , const char * path , size_t path_len , char dir , char * * error , int security )
1409
+ {
1410
+ #ifdef PHP_WIN32
1411
+ char * path_dup = estrndup (path , path_len );
1412
+ phar_unixify_path_separators (path_dup , path_len );
1413
+ phar_entry_info * ret = phar_get_entry_info_dir_ex (phar , path_dup , path_len , dir , error , security );
1414
+ efree (path_dup );
1415
+ return ret ;
1416
+ #endif
1417
+ return phar_get_entry_info_dir_ex (phar , path , path_len , dir , error , security );
1418
+ }
1419
+
1404
1420
static const char hexChars [] = "0123456789ABCDEF" ;
1405
1421
1406
1422
static int phar_hex_str (const char * digest , size_t digest_len , char * * signature ) /* {{{ */
0 commit comments