@@ -1248,7 +1248,7 @@ static inline void last_modified(void)
12481248 }
12491249
12501250#define LAST_MODIFIED "Last-Modified: "
1251- memcpy (buf , LAST_MODIFIED , sizeof (LAST_MODIFIED ) - 1 );
1251+ memcpy (buf , ZEND_STRL (LAST_MODIFIED ));
12521252 strcpy_gmt (buf + sizeof (LAST_MODIFIED ) - 1 , & sb .st_mtime );
12531253 ADD_HEADER (buf );
12541254 }
@@ -1263,7 +1263,7 @@ CACHE_LIMITER_FUNC(public)
12631263
12641264 gettimeofday (& tv , NULL );
12651265 now = tv .tv_sec + PS (cache_expire ) * 60 ;
1266- memcpy (buf , EXPIRES , sizeof (EXPIRES ) - 1 );
1266+ memcpy (buf , ZEND_STRL (EXPIRES ));
12671267 strcpy_gmt (buf + sizeof (EXPIRES ) - 1 , & now );
12681268 ADD_HEADER (buf );
12691269
@@ -1394,7 +1394,7 @@ static zend_result php_session_send_cookie(void)
13941394 /* URL encode id because it might be user supplied */
13951395 e_id = php_url_encode (ZSTR_VAL (PS (id )), ZSTR_LEN (PS (id )));
13961396
1397- smart_str_appendl (& ncookie , "Set-Cookie: " , sizeof ( "Set-Cookie: " ) - 1 );
1397+ smart_str_appends (& ncookie , "Set-Cookie: " );
13981398 smart_str_appendl (& ncookie , PS (session_name ), strlen (PS (session_name )));
13991399 smart_str_appendc (& ncookie , '=' );
14001400 smart_str_append (& ncookie , e_id );
@@ -1409,7 +1409,7 @@ static zend_result php_session_send_cookie(void)
14091409 t = tv .tv_sec + PS (cookie_lifetime );
14101410
14111411 if (t > 0 ) {
1412- date_fmt = php_format_date ("D, d M Y H:i:s \\G\\M\\T" , sizeof ("D, d M Y H:i:s \\G\\M\\T" )- 1 , t , 0 );
1412+ date_fmt = php_format_date (ZEND_STRL ("D, d M Y H:i:s \\G\\M\\T" ), t , false );
14131413 smart_str_appends (& ncookie , COOKIE_EXPIRES );
14141414 smart_str_append (& ncookie , date_fmt );
14151415 zend_string_release_ex (date_fmt , 0 );
@@ -1515,8 +1515,8 @@ PHPAPI zend_result php_session_reset_id(void)
15151515
15161516 /* If the SID constant exists, destroy it. */
15171517 /* We must not delete any items in EG(zend_constants) */
1518- /* zend_hash_str_del(EG(zend_constants), "sid", sizeof ("sid") - 1 ); */
1519- sid = zend_get_constant_str ("SID" , sizeof ("SID" ) - 1 );
1518+ /* zend_hash_str_del(EG(zend_constants), ZEND_STRL ("sid")); */
1519+ sid = zend_get_constant_str (ZEND_STRL ("SID" ));
15201520
15211521 if (PS (define_sid )) {
15221522 smart_str var = {0 };
@@ -1546,7 +1546,7 @@ PHPAPI zend_result php_session_reset_id(void)
15461546 if (APPLY_TRANS_SID ) {
15471547 apply_trans_sid = 1 ;
15481548 if (PS (use_cookies ) &&
1549- (data = zend_hash_str_find (& EG (symbol_table ), "_COOKIE" , sizeof ("_COOKIE" ) - 1 ))) {
1549+ (data = zend_hash_str_find (& EG (symbol_table ), ZEND_STRL ("_COOKIE" )))) {
15501550 ZVAL_DEREF (data );
15511551 if (Z_TYPE_P (data ) == IS_ARRAY &&
15521552 (ppid = zend_hash_str_find (Z_ARRVAL_P (data ), PS (session_name ), strlen (PS (session_name ))))) {
@@ -1580,15 +1580,15 @@ PHPAPI zend_result php_session_start(void)
15801580 break ;
15811581
15821582 case php_session_disabled :
1583- value = zend_ini_string ("session.save_handler" , sizeof ("session.save_handler" ) - 1 , 0 );
1583+ value = zend_ini_string (ZEND_STRL ("session.save_handler" ), false );
15841584 if (!PS (mod ) && value ) {
15851585 PS (mod ) = _php_find_ps_module (value );
15861586 if (!PS (mod )) {
15871587 php_error_docref (NULL , E_WARNING , "Cannot find session save handler \"%s\" - session startup failed" , value );
15881588 return FAILURE ;
15891589 }
15901590 }
1591- value = zend_ini_string ("session.serialize_handler" , sizeof ("session.serialize_handler" ) - 1 , 0 );
1591+ value = zend_ini_string (ZEND_STRL ("session.serialize_handler" ), false );
15921592 if (!PS (serializer ) && value ) {
15931593 PS (serializer ) = _php_find_ps_serializer (value );
15941594 if (!PS (serializer )) {
@@ -1617,7 +1617,7 @@ PHPAPI zend_result php_session_start(void)
16171617 */
16181618
16191619 if (!PS (id )) {
1620- if (PS (use_cookies ) && (data = zend_hash_str_find (& EG (symbol_table ), "_COOKIE" , sizeof ("_COOKIE" ) - 1 ))) {
1620+ if (PS (use_cookies ) && (data = zend_hash_str_find (& EG (symbol_table ), ZEND_STRL ("_COOKIE" )))) {
16211621 ZVAL_DEREF (data );
16221622 if (Z_TYPE_P (data ) == IS_ARRAY && (ppid = zend_hash_str_find (Z_ARRVAL_P (data ), PS (session_name ), lensess ))) {
16231623 ppid2sid (ppid );
@@ -1627,13 +1627,13 @@ PHPAPI zend_result php_session_start(void)
16271627 }
16281628 /* Initialize session ID from non cookie values */
16291629 if (!PS (use_only_cookies )) {
1630- if (!PS (id ) && (data = zend_hash_str_find (& EG (symbol_table ), "_GET" , sizeof ("_GET" ) - 1 ))) {
1630+ if (!PS (id ) && (data = zend_hash_str_find (& EG (symbol_table ), ZEND_STRL ("_GET" )))) {
16311631 ZVAL_DEREF (data );
16321632 if (Z_TYPE_P (data ) == IS_ARRAY && (ppid = zend_hash_str_find (Z_ARRVAL_P (data ), PS (session_name ), lensess ))) {
16331633 ppid2sid (ppid );
16341634 }
16351635 }
1636- if (!PS (id ) && (data = zend_hash_str_find (& EG (symbol_table ), "_POST" , sizeof ("_POST" ) - 1 ))) {
1636+ if (!PS (id ) && (data = zend_hash_str_find (& EG (symbol_table ), ZEND_STRL ("_POST" )))) {
16371637 ZVAL_DEREF (data );
16381638 if (Z_TYPE_P (data ) == IS_ARRAY && (ppid = zend_hash_str_find (Z_ARRVAL_P (data ), PS (session_name ), lensess ))) {
16391639 ppid2sid (ppid );
@@ -1643,7 +1643,7 @@ PHPAPI zend_result php_session_start(void)
16431643 * an external site which invalidates the previously found id. */
16441644 if (PS (id ) && PS (extern_referer_chk )[0 ] != '\0' &&
16451645 !Z_ISUNDEF (PG (http_globals )[TRACK_VARS_SERVER ]) &&
1646- (data = zend_hash_str_find (Z_ARRVAL (PG (http_globals )[TRACK_VARS_SERVER ]), "HTTP_REFERER" , sizeof ("HTTP_REFERER" ) - 1 )) &&
1646+ (data = zend_hash_str_find (Z_ARRVAL (PG (http_globals )[TRACK_VARS_SERVER ]), ZEND_STRL ("HTTP_REFERER" ))) &&
16471647 Z_TYPE_P (data ) == IS_STRING &&
16481648 Z_STRLEN_P (data ) != 0 &&
16491649 strstr (Z_STRVAL_P (data ), PS (extern_referer_chk )) == NULL
@@ -2794,7 +2794,7 @@ static zend_result php_rinit_session(bool auto_start)
27942794 {
27952795 char * value ;
27962796
2797- value = zend_ini_string ("session.save_handler" , sizeof ("session.save_handler" ) - 1 , 0 );
2797+ value = zend_ini_string (ZEND_STRL ("session.save_handler" ), false );
27982798 if (value ) {
27992799 PS (mod ) = _php_find_ps_module (value );
28002800 }
@@ -2803,7 +2803,7 @@ static zend_result php_rinit_session(bool auto_start)
28032803 if (PS (serializer ) == NULL ) {
28042804 char * value ;
28052805
2806- value = zend_ini_string ("session.serialize_handler" , sizeof ("session.serialize_handler" ) - 1 , 0 );
2806+ value = zend_ini_string (ZEND_STRL ("session.serialize_handler" ), false );
28072807 if (value ) {
28082808 PS (serializer ) = _php_find_ps_serializer (value );
28092809 }
@@ -2907,7 +2907,7 @@ static PHP_GINIT_FUNCTION(ps)
29072907
29082908static PHP_MINIT_FUNCTION (session )
29092909{
2910- zend_register_auto_global (zend_string_init_interned ("_SESSION" , sizeof ("_SESSION" ) - 1 , 1 ), 0 , NULL );
2910+ zend_register_auto_global (zend_string_init_interned (ZEND_STRL ("_SESSION" ), true ), false , NULL );
29112911
29122912 my_module_number = module_number ;
29132913 PS (module_number ) = module_number ;
@@ -3058,7 +3058,7 @@ static bool php_check_cancel_upload(php_session_rfc1867_progress *progress)
30583058 if (Z_TYPE_P (progress_ary ) != IS_ARRAY ) {
30593059 return 0 ;
30603060 }
3061- if ((cancel_upload = zend_hash_str_find (Z_ARRVAL_P (progress_ary ), "cancel_upload" , sizeof ("cancel_upload" ) - 1 )) == NULL ) {
3061+ if ((cancel_upload = zend_hash_str_find (Z_ARRVAL_P (progress_ary ), ZEND_STRL ("cancel_upload" ))) == NULL ) {
30623062 return 0 ;
30633063 }
30643064 return Z_TYPE_P (cancel_upload ) == IS_TRUE ;
@@ -3189,13 +3189,13 @@ static zend_result php_session_rfc1867_callback(unsigned int event, void *event_
31893189 array_init (& progress -> data );
31903190 array_init (& progress -> files );
31913191
3192- add_assoc_long_ex (& progress -> data , "start_time" , sizeof ("start_time" ) - 1 , (zend_long )sapi_get_request_time ());
3193- add_assoc_long_ex (& progress -> data , "content_length" , sizeof ("content_length" ) - 1 , progress -> content_length );
3194- add_assoc_long_ex (& progress -> data , "bytes_processed" , sizeof ("bytes_processed" ) - 1 , data -> post_bytes_processed );
3195- add_assoc_bool_ex (& progress -> data , "done" , sizeof ("done" ) - 1 , 0 );
3196- add_assoc_zval_ex (& progress -> data , "files" , sizeof ("files" ) - 1 , & progress -> files );
3192+ add_assoc_long_ex (& progress -> data , ZEND_STRL ("start_time" ), (zend_long )sapi_get_request_time ());
3193+ add_assoc_long_ex (& progress -> data , ZEND_STRL ("content_length" ), progress -> content_length );
3194+ add_assoc_long_ex (& progress -> data , ZEND_STRL ("bytes_processed" ), data -> post_bytes_processed );
3195+ add_assoc_bool_ex (& progress -> data , ZEND_STRL ("done" ), false );
3196+ add_assoc_zval_ex (& progress -> data , ZEND_STRL ("files" ), & progress -> files );
31973197
3198- progress -> post_bytes_processed = zend_hash_str_find (Z_ARRVAL (progress -> data ), "bytes_processed" , sizeof ("bytes_processed" ) - 1 );
3198+ progress -> post_bytes_processed = zend_hash_str_find (Z_ARRVAL (progress -> data ), ZEND_STRL ("bytes_processed" ));
31993199
32003200 php_rinit_session (0 );
32013201 PS (id ) = zend_string_copy (Z_STR (progress -> sid ));
@@ -3210,18 +3210,18 @@ static zend_result php_session_rfc1867_callback(unsigned int event, void *event_
32103210 array_init (& progress -> current_file );
32113211
32123212 /* Each uploaded file has its own array. Trying to make it close to $_FILES entries. */
3213- add_assoc_string_ex (& progress -> current_file , "field_name" , sizeof ("field_name" ) - 1 , data -> name );
3214- add_assoc_string_ex (& progress -> current_file , "name" , sizeof ("name" ) - 1 , * data -> filename );
3215- add_assoc_null_ex (& progress -> current_file , "tmp_name" , sizeof ("tmp_name" ) - 1 );
3216- add_assoc_long_ex (& progress -> current_file , "error" , sizeof ("error" ) - 1 , 0 );
3213+ add_assoc_string_ex (& progress -> current_file , ZEND_STRL ("field_name" ), data -> name );
3214+ add_assoc_string_ex (& progress -> current_file , ZEND_STRL ("name" ), * data -> filename );
3215+ add_assoc_null_ex (& progress -> current_file , ZEND_STRL ("tmp_name" ));
3216+ add_assoc_long_ex (& progress -> current_file , ZEND_STRL ("error" ), 0 );
32173217
3218- add_assoc_bool_ex (& progress -> current_file , "done" , sizeof ("done" ) - 1 , 0 );
3219- add_assoc_long_ex (& progress -> current_file , "start_time" , sizeof ("start_time" ) - 1 , (zend_long )time (NULL ));
3220- add_assoc_long_ex (& progress -> current_file , "bytes_processed" , sizeof ("bytes_processed" ) - 1 , 0 );
3218+ add_assoc_bool_ex (& progress -> current_file , ZEND_STRL ("done" ), 0 );
3219+ add_assoc_long_ex (& progress -> current_file , ZEND_STRL ("start_time" ), (zend_long )time (NULL ));
3220+ add_assoc_long_ex (& progress -> current_file , ZEND_STRL ("bytes_processed" ), 0 );
32213221
32223222 add_next_index_zval (& progress -> files , & progress -> current_file );
32233223
3224- progress -> current_file_bytes_processed = zend_hash_str_find (Z_ARRVAL (progress -> current_file ), "bytes_processed" , sizeof ("bytes_processed" ) - 1 );
3224+ progress -> current_file_bytes_processed = zend_hash_str_find (Z_ARRVAL (progress -> current_file ), ZEND_STRL ("bytes_processed" ));
32253225
32263226 Z_LVAL_P (progress -> current_file_bytes_processed ) = data -> post_bytes_processed ;
32273227 php_session_rfc1867_update (progress , 0 );
@@ -3248,11 +3248,11 @@ static zend_result php_session_rfc1867_callback(unsigned int event, void *event_
32483248 }
32493249
32503250 if (data -> temp_filename ) {
3251- add_assoc_string_ex (& progress -> current_file , "tmp_name" , sizeof ("tmp_name" ) - 1 , data -> temp_filename );
3251+ add_assoc_string_ex (& progress -> current_file , ZEND_STRL ("tmp_name" ), data -> temp_filename );
32523252 }
32533253
3254- add_assoc_long_ex (& progress -> current_file , "error" , sizeof ("error" ) - 1 , data -> cancel_upload );
3255- add_assoc_bool_ex (& progress -> current_file , "done" , sizeof ("done" ) - 1 , 1 );
3254+ add_assoc_long_ex (& progress -> current_file , ZEND_STRL ("error" ), data -> cancel_upload );
3255+ add_assoc_bool_ex (& progress -> current_file , ZEND_STRL ("done" ), 1 );
32563256
32573257 Z_LVAL_P (progress -> post_bytes_processed ) = data -> post_bytes_processed ;
32583258
@@ -3268,7 +3268,7 @@ static zend_result php_session_rfc1867_callback(unsigned int event, void *event_
32683268 } else {
32693269 if (!Z_ISUNDEF (progress -> data )) {
32703270 SEPARATE_ARRAY (& progress -> data );
3271- add_assoc_bool_ex (& progress -> data , "done" , sizeof ("done" ) - 1 , 1 );
3271+ add_assoc_bool_ex (& progress -> data , ZEND_STRL ("done" ), 1 );
32723272 Z_LVAL_P (progress -> post_bytes_processed ) = data -> post_bytes_processed ;
32733273 php_session_rfc1867_update (progress , 1 );
32743274 }
0 commit comments