Solr
  1. Solr
  2. SOLR-1091

"phps" (serialized PHP) writer produces invalid output

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 1.3
    • Fix Version/s: 1.4
    • Component/s: search
    • Labels:
      None
    • Environment:

      Sun JRE 1.6.0 on Centos 5

      Description

      The serialized PHP output writer can outputs invalid string lengths for certain (unusual) input values. Specifically, I had a document containing the following 6 byte character sequence: \xED\xAF\x80\xED\xB1\xB8

      I was able to create a document in the index containing this value without issue; however, when fetching the document back out using the serialized PHP writer, it returns a string like the following:

      s:4:"􀁸";

      Note that the string length specified is 4, while the string is actually 6 bytes long.

      When using PHP's native serialize() function, it correctly sets the length to 6:

      1. php -r 'var_dump(serialize("\xED\xAF\x80\xED\xB1\xB8"));'
        string(13) "s:6:"􀁸";"

      The "wt=php" writer, which produces output to be parsed with eval(), doesn't have any trouble with this string.

      1. SOLR-1091.patch
        3 kB
        Yonik Seeley
      2. SOLR-1091.patch
        3 kB
        Yonik Seeley

        Activity

        No work has yet been logged on this issue.

          People

          • Assignee:
            Yonik Seeley
            Reporter:
            frank farmer
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development