Merge branch '5.2' into 5.x

* 5.2:
  [Notifier] Fix tests
  [HttpFoundation] keep turning dots to underscores when using Request::create()
This commit is contained in:
Nicolas Grekas 2020-12-18 11:11:43 +01:00
commit 7013f23b08
3 changed files with 7 additions and 5 deletions

View File

@ -405,7 +405,7 @@ class Request
$queryString = '';
if (isset($components['query'])) {
$qs = HeaderUtils::parseQuery(html_entity_decode($components['query']));
parse_str(html_entity_decode($components['query']), $qs);
if ($query) {
$query = array_replace($qs, $query);

View File

@ -123,13 +123,14 @@ class RequestTest extends TestCase
$this->assertEquals('test.com', $request->getHttpHost());
$this->assertFalse($request->isSecure());
$request = Request::create('https://test.com/foo?bar=baz');
$this->assertEquals('https://test.com/foo?bar=baz', $request->getUri());
$request = Request::create('https://test.com/foo?foo.bar=baz');
$this->assertEquals('https://test.com/foo?foo.bar=baz', $request->getUri());
$this->assertEquals('/foo', $request->getPathInfo());
$this->assertEquals('bar=baz', $request->getQueryString());
$this->assertEquals('foo.bar=baz', $request->getQueryString());
$this->assertEquals(443, $request->getPort());
$this->assertEquals('test.com', $request->getHttpHost());
$this->assertTrue($request->isSecure());
$this->assertSame(['foo_bar' => 'baz'], $request->query->all());
$request = Request::create('test.com:90/foo');
$this->assertEquals('http://test.com:90/foo', $request->getUri());

View File

@ -79,11 +79,12 @@ final class TelegramTransport extends AbstractTransport
$options['chat_id'] = $message->getRecipientId() ?: $this->chatChannel;
}
$options['text'] = $message->getSubject();
if (!isset($options['parse_mode'])) {
$options['parse_mode'] = TelegramOptions::PARSE_MODE_MARKDOWN_V2;
}
$options['text'] = $message->getSubject();
$response = $this->client->request('POST', $endpoint, [
'json' => array_filter($options),
]);