Skip to content

SolrUtils::escapeQueryChars returns null if an empty string is passed in #83

@datadestroyd

Description

@datadestroyd

The following code:

<?php

var_dump(SolrUtils::escapeQueryChars(""));

Resulted in this output:

NULL

But I expected this output instead:

string(0) ""

The documentation states that the function will return the escaped string or false on failure. I don't think escaping an empty string should result in failure, but even if this was intended, the result should be false, not null.

Additionally, I would be like to know under what circumstances escaping even can fail. Maybe the documentation could give an example?

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions