@@ -2453,42 +2453,48 @@ static int phar_flush_clean_deleted_apply(zval *zv) /* {{{ */
24532453
24542454#include "stub.h" /* Generated phar_get_stub() function from makestub.php script */
24552455
2456- zend_string * phar_create_default_stub (const char * index_php , const char * web_index , char * * error ) /* {{{ */
2456+ zend_string * phar_create_default_stub (const zend_string * php_index_str , const zend_string * web_index_str , char * * error ) /* {{{ */
24572457{
2458- size_t index_len , web_len ;
2458+ const char * php_index ;
2459+ const char * web_index ;
2460+ size_t php_len , web_len ;
24592461
24602462 if (error ) {
24612463 * error = NULL ;
24622464 }
24632465
2464- if (!index_php ) {
2465- index_php = "index.php" ;
2466- }
2467-
2468- if (!web_index ) {
2469- web_index = "index.php" ;
2470- }
2471-
2472- index_len = strlen (index_php );
2473- web_len = strlen (web_index );
2474-
2475- if (index_len > 400 ) {
2476- /* ridiculous size not allowed for index.php startup filename */
2477- if (error ) {
2478- spprintf (error , 0 , "Illegal filename passed in for stub creation, was %zd characters long, and only 400 or less is allowed" , index_len );
2466+ if (!php_index_str ) {
2467+ php_index = "index.php" ;
2468+ php_len = strlen ("index.php" );
2469+ } else {
2470+ php_index = ZSTR_VAL (php_index_str );
2471+ php_len = ZSTR_LEN (php_index_str );
2472+ if (php_len > 400 ) {
2473+ /* ridiculous size not allowed for index.php startup filename */
2474+ if (error ) {
2475+ spprintf (error , 0 , "Illegal filename passed in for stub creation, was %zd characters long, and only 400 or less is allowed" , php_len );
2476+ }
24792477 return NULL ;
24802478 }
24812479 }
24822480
2483- if (web_len > 400 ) {
2484- /* ridiculous size not allowed for index.php startup filename */
2485- if (error ) {
2486- spprintf (error , 0 , "Illegal web filename passed in for stub creation, was %zd characters long, and only 400 or less is allowed" , web_len );
2481+ if (!web_index_str ) {
2482+ web_index = "index.php" ;
2483+ web_len = strlen ("index.php" );
2484+ } else {
2485+ web_index = ZSTR_VAL (web_index_str );
2486+ web_len = ZSTR_LEN (web_index_str );
2487+
2488+ if (web_len > 400 ) {
2489+ /* ridiculous size not allowed for index.php startup filename */
2490+ if (error ) {
2491+ spprintf (error , 0 , "Illegal web filename passed in for stub creation, was %zd characters long, and only 400 or less is allowed" , web_len );
2492+ }
24872493 return NULL ;
24882494 }
24892495 }
24902496
2491- return phar_get_stub (index_php , web_index , index_len + 1 , web_len + 1 );
2497+ return phar_get_stub (php_index , web_index , php_len + 1 , web_len + 1 );
24922498}
24932499/* }}} */
24942500
0 commit comments