Skip to content

Commit

Permalink
HttpClient: fix urlencode() bugs, add json dependency.
Browse files Browse the repository at this point in the history
  • Loading branch information
dim-s committed May 10, 2018
1 parent 345c439 commit 47b081e
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 11 deletions.
4 changes: 2 additions & 2 deletions exts/jphp-httpclient-ext/api-docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
---

## jphp-httpclient-ext
> version 1.0.0, created by JPPM.
> version 1.0.1, created by JPPM.
Http Client library.

### Install
```
jppm add jphp-httpclient-ext@1.0.0
jppm add jphp-httpclient-ext@1.0.1
```

### API
Expand Down
4 changes: 2 additions & 2 deletions exts/jphp-httpclient-ext/api-docs/README.ru.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
---

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

### Установка
```
jppm add jphp-httpclient-ext@1.0.0
jppm add jphp-httpclient-ext@1.0.1
```

### АПИ
Expand Down
5 changes: 4 additions & 1 deletion exts/jphp-httpclient-ext/package.php.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@

name: jphp-httpclient-ext
version: 1.0.0
version: 1.0.1
description: Http Client library.

plugins: [Doc, Hub]

deps:
jphp-json-ext: '>=1.0.0'

sources:
- src-php

Expand Down
10 changes: 5 additions & 5 deletions exts/jphp-httpclient-ext/src-php/httpclient/HttpClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -601,9 +601,9 @@ protected function formatUrlencode(array $data, $prefix = '')
$str[] = $this->formatUrlencode($value, $prefix ? "{$prefix}[$code]" : $code);
} else {
if ($prefix) {
$str[] = "{$prefix}[$code]=" . urlencode($value);
$str[] = "{$prefix}[$code]=" . URL::encode($value);
} else {
$str[] = "$code=" . urlencode($value);
$str[] = "$code=" . URL::encode($value);
}
}
}
Expand All @@ -627,7 +627,7 @@ protected function formatMultipart(array $data, $prefix = '')
$out->write($this->_boundary);
$out->write(self::CRLF);

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

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

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

$out->write("Content-Type: ");
Expand Down
2 changes: 1 addition & 1 deletion packager/buildSrc/AppPlugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ function build(Event $event)
$name = fs::relativize($filename, $classPath);
$file = "$buildDir/app/$name";

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

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

0 comments on commit 47b081e

Please sign in to comment.