Skip to content

Commit 47b081e

Browse files
committed
HttpClient: fix urlencode() bugs, add json dependency.
1 parent 345c439 commit 47b081e

File tree

5 files changed

+14
-11
lines changed

5 files changed

+14
-11
lines changed

exts/jphp-httpclient-ext/api-docs/README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,13 @@
33
---
44

55
## jphp-httpclient-ext
6-
> version 1.0.0, created by JPPM.
6+
> version 1.0.1, created by JPPM.
77
88
Http Client library.
99

1010
### Install
1111
```
12-
12+
1313
```
1414

1515
### API

exts/jphp-httpclient-ext/api-docs/README.ru.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,13 @@
33
---
44

55
## jphp-httpclient-ext
6-
> версия 1.0.0, создано с помощью JPPM.
6+
> версия 1.0.1, создано с помощью JPPM.
77
88
Http Client library.
99

1010
### Установка
1111
```
12-
12+
1313
```
1414

1515
### АПИ

exts/jphp-httpclient-ext/package.php.yml

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
11

22
name: jphp-httpclient-ext
3-
version: 1.0.0
3+
version: 1.0.1
44
description: Http Client library.
55

66
plugins: [Doc, Hub]
77

8+
deps:
9+
jphp-json-ext: '>=1.0.0'
10+
811
sources:
912
- src-php
1013

exts/jphp-httpclient-ext/src-php/httpclient/HttpClient.php

+5-5
Original file line numberDiff line numberDiff line change
@@ -601,9 +601,9 @@ protected function formatUrlencode(array $data, $prefix = '')
601601
$str[] = $this->formatUrlencode($value, $prefix ? "{$prefix}[$code]" : $code);
602602
} else {
603603
if ($prefix) {
604-
$str[] = "{$prefix}[$code]=" . urlencode($value);
604+
$str[] = "{$prefix}[$code]=" . URL::encode($value);
605605
} else {
606-
$str[] = "$code=" . urlencode($value);
606+
$str[] = "$code=" . URL::encode($value);
607607
}
608608
}
609609
}
@@ -627,7 +627,7 @@ protected function formatMultipart(array $data, $prefix = '')
627627
$out->write($this->_boundary);
628628
$out->write(self::CRLF);
629629

630-
$name = urlencode($name);
630+
$name = URL::encode($name);
631631
$out->write("Content-Disposition: form-data; name=\"$name\"");
632632
$out->write(self::CRLF);
633633

@@ -646,9 +646,9 @@ protected function formatMultipart(array $data, $prefix = '')
646646
$out->write($this->_boundary);
647647
$out->write(self::CRLF);
648648

649-
$name = urlencode($name);
649+
$name = URL::encode($name);
650650
$out->write("Content-Disposition: form-data; name=\"$name\"; filename=\"");
651-
$out->write(urlencode(fs::name($stream->getPath())) . "\"");
651+
$out->write(URL::encode(fs::name($stream->getPath())) . "\"");
652652
$out->write(self::CRLF);
653653

654654
$out->write("Content-Type: ");

packager/buildSrc/AppPlugin.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ function build(Event $event)
9393
$name = fs::relativize($filename, $classPath);
9494
$file = "$buildDir/app/$name";
9595

96-
Console::log("--> add file: {$classPath}{$name}");
96+
Console::log("--> add file: {$classPath}/{$name}");
9797

9898
if (str::startsWith($name, "META-INF/services/")) {
9999
$metaInfServices[$name] = flow((array) $metaInfServices[$name], str::lines(fs::get($filename)))->toArray();

0 commit comments

Comments
 (0)