php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #72033 Real Time Get requests fails if it wasn't the first request
Submitted: 2016-04-15 16:26 UTC Modified: 2016-04-15 16:26 UTC
From: omars@php.net Assigned: omars (profile)
Status: Closed Package: solr (PECL)
PHP Version: Irrelevant OS: *
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: omars@php.net
New email:
PHP Version: OS:

 

 [2016-04-15 16:26 UTC] omars@php.net
Description:
------------
SolrClient::getById/SolrClient::getByIds does not clear the request body before sending the request, causes invalid URL with tainted previously sent request

Test script:
---------------
require_once "bootstrap.inc";

$options = array
(
    'hostname' => SOLR_SERVER_HOSTNAME,
    'login'    => SOLR_SERVER_USERNAME,
    'password' => SOLR_SERVER_PASSWORD,
    'port'     => SOLR_SERVER_PORT,
    'path'     => SOLR_SERVER_PATH
);

$client = new SolrClient($options);

$doc = new SolrInputDocument();

$doc->addField('id', 'some_id');
$doc->addField('field1', 'val1');

$client->addDocument($doc);

$client->commit();

$response = $client->getById('some_id');

var_dump(isset($response->getArrayResponse()['doc'])).PHP_EOL;
var_dump($response->getResponse()->doc->id) . PHP_EOL;

Expected result:
----------------
bool(true)
string(7) "some_id"

Actual result:
--------------
Fatal Error: Uncaught SolrClientException: Solr HTTP Error 3: 'URL using bad/illegal format or missing URL'

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2016-04-15 16:26 UTC] omars@php.net
-Assigned To: +Assigned To: omars
 [2016-04-16 17:58 UTC] omars@php.net
Automatic comment on behalf of omars
Revision: http://git.php.net/?p=pecl/search_engine/solr.git;a=commit;h=b0dc4ace022960887e2328081b1d744547f9ea13
Log: Fix Bug #72033 Real Time Get requests failure
 [2016-04-16 17:58 UTC] omars@php.net
-Status: Assigned +Status: Closed
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Mar 29 04:01:29 2024 UTC