@@ -555,12 +555,12 @@ static zend_string **make_subpats_table(uint32_t num_subpats, pcre_cache_entry *
555
555
556
556
/* {{{ static calculate_unit_length */
557
557
/* Calculates the byte length of the next character. Assumes valid UTF-8 for PCRE2_UTF. */
558
- static zend_always_inline size_t calculate_unit_length (pcre_cache_entry * pce , char * start )
558
+ static zend_always_inline size_t calculate_unit_length (pcre_cache_entry * pce , const char * start )
559
559
{
560
560
size_t unit_len ;
561
561
562
562
if (pce -> compile_options & PCRE2_UTF ) {
563
- char * end = start ;
563
+ cpnst char * end = start ;
564
564
565
565
/* skip continuation bytes */
566
566
while ((* ++ end & 0xC0 ) == 0x80 );
@@ -1570,7 +1570,7 @@ static zend_string *preg_do_repl_func(zend_fcall_info *fci, zend_fcall_info_cach
1570
1570
*/
1571
1571
PHPAPI zend_string * php_pcre_replace (zend_string * regex ,
1572
1572
zend_string * subject_str ,
1573
- char * subject , size_t subject_len ,
1573
+ const char * subject , size_t subject_len ,
1574
1574
zend_string * replace_str ,
1575
1575
size_t limit , size_t * replace_count )
1576
1576
{
@@ -1610,10 +1610,10 @@ PHPAPI zend_string *php_pcre_replace_impl(pcre_cache_entry *pce, zend_string *su
1610
1610
size_t last_end_offset ; /* Where the last search ended */
1611
1611
char * walkbuf , /* Location of current replacement in the result */
1612
1612
* walk , /* Used to walk the replacement string */
1613
- * match , /* The current match */
1614
- * piece , /* The current piece of subject */
1615
- * replace_end , /* End of replacement string */
1616
1613
walk_last ; /* Last walked character */
1614
+ const char * match , /* The current match */
1615
+ * piece , /* The current piece of subject */
1616
+ * replace_end ; /* End of replacement string */
1617
1617
size_t result_len ; /* Length of result */
1618
1618
zend_string * result ; /* Result of replacement */
1619
1619
pcre2_match_data * match_data ;
@@ -1849,7 +1849,7 @@ static zend_string *php_pcre_replace_func_impl(pcre_cache_entry *pce, zend_strin
1849
1849
size_t alloc_len ; /* Actual allocated length */
1850
1850
PCRE2_SIZE start_offset ; /* Where the new search starts */
1851
1851
size_t last_end_offset ; /* Where the last search ended */
1852
- char * match , /* The current match */
1852
+ const char * match , /* The current match */
1853
1853
* piece ; /* The current piece of subject */
1854
1854
size_t result_len ; /* Length of result */
1855
1855
zend_string * result ; /* Result of replacement */
0 commit comments