Skip to content

Commit fcd17da

Browse files
committed
Fix some tests, break others
1 parent b6f76b3 commit fcd17da

File tree

6 files changed

+204
-79
lines changed

6 files changed

+204
-79
lines changed

ext/filter/tests/062.phpt

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -83,28 +83,28 @@ string(31) "http://www.example/img/test.png"
8383
string(27) "http://www.example/img/dir/"
8484
string(26) "http://www.example/img/dir"
8585
string(79) "http://www.thelongestdomainnameintheworldandthensomeandthensomemoreandmore.com/"
86-
string(81) "http://toolongtoolongtoolongtoolongtoolongtoolongtoolongtoolongtoolongtoolong.com"
87-
string(261) "http://eauBcFReEmjLcoZwI0RuONNnwU4H9r151juCaqTI5VeIP5jcYIqhx1lh5vV00l2rTs6y7hOp7rYw42QZiq6VIzjcYrRm8gFRMk9U9Wi1grL8Mr5kLVloYLthHgyA94QK3SaXCATklxgo6XvcbXIqAGG7U0KxTr8hJJU1p2ZQ2mXHmp4DhYP8N9SRuEKzaCPcSIcW7uj21jZqBigsLsNAXEzU8SPXZjmVQVtwQATPWeWyGW4GuJhjP4Q8o0.com"
86+
bool(false)
87+
bool(false)
8888
string(261) "http://kDTvHt1PPDgX5EiP2MwiXjcoWNOhhTuOVAUWJ3TmpBYCC9QoJV114LMYrV3Zl58.kDTvHt1PPDgX5EiP2MwiXjcoWNOhhTuOVAUWJ3TmpBYCC9QoJV114LMYrV3Zl58.kDTvHt1PPDgX5EiP2MwiXjcoWNOhhTuOVAUWJ3TmpBYCC9QoJV114LMYrV3Zl58.CQ1oT5Uq3jJt6Uhy3VH9u3Gi5YhfZCvZVKgLlaXNFhVKB1zJxvunR7SJa.com."
89-
string(83) "http://kDTvHt1PPDgX5EiP2MwiXjcoWNOhhTuOVAUWJ3TmpBYCC9QoJV114LMYrV3Zl58R.example.com"
89+
bool(false)
9090
string(48) "http://[2001:0db8:0000:85a3:0000:0000:ac1f:8001]"
9191
string(50) "http://[2001:db8:0:85a3:0:0:ac1f:8001]:123/me.html"
9292
string(36) "http://[2001:db8:0:85a3::ac1f:8001]/"
9393
string(12) "http://[::1]"
9494
string(31) "http://cont-ains.h-yph-en-s.com"
95-
string(12) "http://..com"
96-
string(16) "http://a.-bc.com"
97-
string(17) "http://ab.cd-.com"
98-
string(16) "http://-.abc.com"
99-
string(20) "http://abc.-.abc.com"
100-
string(30) "http://underscore_.example.com"
95+
bool(false)
96+
bool(false)
97+
bool(false)
98+
bool(false)
99+
bool(false)
100+
bool(false)
101101
bool(false)
102102
bool(false)
103103
string(18) "file:///tmp/test.c"
104104
string(26) "ftp://ftp.example.com/tmp/"
105105
bool(false)
106106
bool(false)
107-
string(7) "http://"
107+
bool(false)
108108
bool(false)
109109
bool(false)
110110
bool(false)
@@ -117,11 +117,11 @@ string(14) "file://foo/bar"
117117
bool(false)
118118
bool(false)
119119
bool(false)
120-
string(24) "http://example.com:65536"
121-
string(24) "http://example.com:65537"
120+
bool(false)
121+
bool(false)
122122
bool(false)
123123
string(10) "http://qwe"
124-
string(7) "http://"
124+
bool(false)
125125
bool(false)
126126
string(22) "http://www.example.com"
127127
bool(false)
@@ -136,23 +136,23 @@ string(31) "http://www.example/img/test.png"
136136
string(27) "http://www.example/img/dir/"
137137
string(26) "http://www.example/img/dir"
138138
string(79) "http://www.thelongestdomainnameintheworldandthensomeandthensomemoreandmore.com/"
139-
string(81) "http://toolongtoolongtoolongtoolongtoolongtoolongtoolongtoolongtoolongtoolong.com"
140-
string(261) "http://eauBcFReEmjLcoZwI0RuONNnwU4H9r151juCaqTI5VeIP5jcYIqhx1lh5vV00l2rTs6y7hOp7rYw42QZiq6VIzjcYrRm8gFRMk9U9Wi1grL8Mr5kLVloYLthHgyA94QK3SaXCATklxgo6XvcbXIqAGG7U0KxTr8hJJU1p2ZQ2mXHmp4DhYP8N9SRuEKzaCPcSIcW7uj21jZqBigsLsNAXEzU8SPXZjmVQVtwQATPWeWyGW4GuJhjP4Q8o0.com"
139+
bool(false)
140+
bool(false)
141141
string(261) "http://kDTvHt1PPDgX5EiP2MwiXjcoWNOhhTuOVAUWJ3TmpBYCC9QoJV114LMYrV3Zl58.kDTvHt1PPDgX5EiP2MwiXjcoWNOhhTuOVAUWJ3TmpBYCC9QoJV114LMYrV3Zl58.kDTvHt1PPDgX5EiP2MwiXjcoWNOhhTuOVAUWJ3TmpBYCC9QoJV114LMYrV3Zl58.CQ1oT5Uq3jJt6Uhy3VH9u3Gi5YhfZCvZVKgLlaXNFhVKB1zJxvunR7SJa.com."
142-
string(83) "http://kDTvHt1PPDgX5EiP2MwiXjcoWNOhhTuOVAUWJ3TmpBYCC9QoJV114LMYrV3Zl58R.example.com"
142+
bool(false)
143143
string(48) "http://[2001:0db8:0000:85a3:0000:0000:ac1f:8001]"
144144
string(50) "http://[2001:db8:0:85a3:0:0:ac1f:8001]:123/me.html"
145145
string(36) "http://[2001:db8:0:85a3::ac1f:8001]/"
146146
string(12) "http://[::1]"
147147
string(31) "http://cont-ains.h-yph-en-s.com"
148-
string(12) "http://..com"
149-
string(16) "http://a.-bc.com"
150-
string(17) "http://ab.cd-.com"
151-
string(16) "http://-.abc.com"
152-
string(20) "http://abc.-.abc.com"
153-
string(30) "http://underscore_.example.com"
154-
bool(false)
155-
string(17) "http:/www.example"
148+
bool(false)
149+
bool(false)
150+
bool(false)
151+
bool(false)
152+
bool(false)
153+
bool(false)
154+
bool(false)
155+
bool(false)
156156
string(18) "file:///tmp/test.c"
157157
string(26) "ftp://ftp.example.com/tmp/"
158158
bool(false)

ext/openssl/xp_ssl.c

Lines changed: 25 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2620,17 +2620,38 @@ static zend_long php_openssl_get_crypto_method(
26202620
}
26212621
/* }}} */
26222622

2623+
static uri_handler_t *ssl_get_uri_handler(php_stream_context *context)
2624+
{
2625+
if (context == NULL) {
2626+
return php_uri_get_handler(NULL);
2627+
}
2628+
2629+
zval *uri_handler_name = php_stream_context_get_option(context, "ssl", "uri_parser_class");
2630+
if (uri_handler_name == NULL) {
2631+
return php_uri_get_handler(NULL);
2632+
}
2633+
2634+
if (Z_TYPE_P(uri_handler_name) != IS_STRING) {
2635+
return NULL;
2636+
}
2637+
2638+
return php_uri_get_handler(Z_STR_P(uri_handler_name));
2639+
}
2640+
26232641
static char *php_openssl_get_url_name(const char *resourcename,
2624-
size_t resourcenamelen, int is_persistent) /* {{{ */
2642+
size_t resourcenamelen, int is_persistent, php_stream_context *context) /* {{{ */
26252643
{
26262644
if (!resourcename) {
26272645
return NULL;
26282646
}
26292647

2630-
uri_handler_t *uri_handler = php_uri_get_handler(NULL);
2648+
uri_handler_t *uri_handler = ssl_get_uri_handler(context);
2649+
if (uri_handler == NULL) {
2650+
return NULL;
2651+
}
26312652

26322653
zend_string *resource = zend_string_init(resourcename, resourcenamelen, false);
2633-
uri_internal_t *internal_uri = php_uri_parse(uri_handler, resource, NULL);
2654+
uri_internal_t *internal_uri = php_uri_parse(uri_handler, resource, true);
26342655
if (internal_uri == NULL) {
26352656
zend_string_release(resource);
26362657
return NULL;
@@ -2759,7 +2780,7 @@ php_stream *php_openssl_ssl_socket_factory(const char *proto, size_t protolen,
27592780
#endif
27602781
}
27612782

2762-
sslsock->url_name = php_openssl_get_url_name(resourcename, resourcenamelen, !!persistent_id);
2783+
sslsock->url_name = php_openssl_get_url_name(resourcename, resourcenamelen, !!persistent_id, context);
27632784

27642785
return stream;
27652786
}

ext/reflection/tests/ReflectionExtension_getDependencies_variation2.phpt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ var_dump($standard->getDependencies());
99
?>
1010
--EXPECTF--
1111
array(1) {
12+
["uri"]=>
13+
%s(8) "Required"
1214
["session"]=>
1315
%s(8) "Optional"
1416
}

0 commit comments

Comments
 (0)