php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #59317 SolrInputDocument::setBoost not working with German locale
Submitted: 2010-07-21 07:34 UTC Modified: 2014-02-13 20:28 UTC
From: luetjen at huberverlag dot de Assigned: omars (profile)
Status: Wont fix Package: solr (PECL)
PHP Version: 5.2.5 OS: Debian Linux
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: luetjen at huberverlag dot de
New email:
PHP Version: OS:

 

 [2010-07-21 07:34 UTC] luetjen at huberverlag dot de
Description:
------------
It seems that the float to string conversion is not working correctly for SolrInputDocument::setBoost() when the PHP locale contains the rule, that the delimiter is something else than a dot. The value will be written with the formatting defined by the locale in the XML file, which leads to a 500 error on Solr server side.



Reproduce code:
---------------
// With German PHP locale
setlocale(LC_ALL, 'de_DE');
echo (string) 1.5; // will output 1,5

// and
$doc = new SolrInputDocument();
$doc->setBoost(2.5);
...

results in the following XML:
  <doc boost="2,5">
    <field name="id">177683</field>


and Solr responds:

HTTP/1.1 500 Internal Server Error
Server: Apache-Coyote/1.1
...
HTTP Status 500 - For input string: &quot;2,5&quot;



Expected result:
----------------
<doc boost="2.5">

Actual result:
--------------
<doc boost="2,5">

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2010-07-21 23:03 UTC] iekpo@php.net
Thanks for reporting this.

This will be taken care of in the next release.
 [2014-02-13 18:31 UTC] omars@php.net
-Assigned To: iekpo +Assigned To: omars
 [2014-02-13 20:28 UTC] omars@php.net
-Status: Assigned +Status: Wont fix
 [2014-02-13 20:28 UTC] omars@php.net
PHP 5.2.5 became obsolete, and 5.3 is reaching EOL.

The issue does not persist for versions 5.3+
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Apr 25 08:01:28 2024 UTC