Skip to content

Commit 7a0bcc5

Browse files
committed
ext/standard/mail.c: add const qualifiers
1 parent 320a049 commit 7a0bcc5

2 files changed

Lines changed: 9 additions & 9 deletions

File tree

ext/standard/mail.c

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ static php_mail_header_value_error_type php_mail_build_headers_check_field_value
113113
}
114114

115115

116-
static bool php_mail_build_headers_check_field_name(zend_string *key)
116+
static bool php_mail_build_headers_check_field_name(const zend_string *key)
117117
{
118118
size_t len = 0;
119119

@@ -128,9 +128,9 @@ static bool php_mail_build_headers_check_field_name(zend_string *key)
128128
}
129129

130130

131-
static void php_mail_build_headers_elems(smart_str *s, zend_string *key, zval *val);
131+
static void php_mail_build_headers_elems(smart_str *s, const zend_string *key, zval *val);
132132

133-
static void php_mail_build_headers_elem(smart_str *s, zend_string *key, zval *val)
133+
static void php_mail_build_headers_elem(smart_str *s, const zend_string *key, zval *val)
134134
{
135135
switch(Z_TYPE_P(val)) {
136136
case IS_STRING:
@@ -174,7 +174,7 @@ static void php_mail_build_headers_elem(smart_str *s, zend_string *key, zval *va
174174
}
175175

176176

177-
static void php_mail_build_headers_elems(smart_str *s, zend_string *key, zval *val)
177+
static void php_mail_build_headers_elems(smart_str *s, const zend_string *key, zval *val)
178178
{
179179
zend_string *tmp_key;
180180
zval *tmp_val;
@@ -208,7 +208,7 @@ do { \
208208
} \
209209
} while(0)
210210

211-
PHPAPI zend_string *php_mail_build_headers(HashTable *headers)
211+
PHPAPI zend_string *php_mail_build_headers(const HashTable *headers)
212212
{
213213
zend_ulong idx;
214214
zend_string *key;
@@ -392,7 +392,7 @@ static void php_mail_log_to_syslog(char *message) {
392392
}
393393

394394

395-
static void php_mail_log_to_file(char *filename, char *message, size_t message_size) {
395+
static void php_mail_log_to_file(const char *filename, const char *message, size_t message_size) {
396396
/* Write 'message' to the given file. */
397397
uint32_t flags = REPORT_ERRORS | STREAM_DISABLE_OPEN_BASEDIR;
398398
php_stream *stream = php_stream_open_wrapper(filename, "a", flags, NULL);
@@ -446,7 +446,7 @@ PHPAPI bool php_mail(const char *to, const char *subject, const char *message, c
446446
FILE *sendmail;
447447
char *sendmail_path = INI_STR("sendmail_path");
448448
char *sendmail_cmd = NULL;
449-
char *mail_log = INI_STR("mail.log");
449+
const char *mail_log = INI_STR("mail.log");
450450
const char *hdr = headers;
451451
char *ahdr = NULL;
452452
#if PHP_SIGCHILD
@@ -495,7 +495,7 @@ PHPAPI bool php_mail(const char *to, const char *subject, const char *message, c
495495
MAIL_RET(false);
496496
}
497497

498-
char *line_sep;
498+
const char *line_sep;
499499
zend_string *cr_lf_mode = PG(mail_cr_lf_mode);
500500

501501
if (cr_lf_mode && !zend_string_equals_literal(cr_lf_mode, "crlf")) {

ext/standard/php_mail.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919

2020
PHP_MINFO_FUNCTION(mail);
2121

22-
PHPAPI zend_string *php_mail_build_headers(HashTable *headers);
22+
PHPAPI zend_string *php_mail_build_headers(const HashTable *headers);
2323
PHPAPI extern bool php_mail(const char *to, const char *subject, const char *message, const char *headers, const char *extra_cmd);
2424

2525
#endif /* PHP_MAIL_H */

0 commit comments

Comments
 (0)