Skip to content

SimpleXML objects being returned from Config.php, not strings #413

@ghost

Description

There is potential for confusion or error (largely created by me) in that this statement and other function returns from the Config class -

$bannerText = $this->GetLocalInfoXML()->page_banner;

When $bannerText is subsequently returned from the function, it actually returns a SimpleXMLElement object and not a string. Subsequent use of the returned object usually works in context, due to implicit casting to a string, but it can behave unexpectedly e.g. '==' comparison between two such returned values from different elements will fail even when the string values are the same.

It would be safer if all returns from Config.php were explicitly cast to strings or other type as and where appropriate.

Metadata

Metadata

Assignees

Labels

enhancementgood first issueIssues that require "minimal" knowledge of the codebasehackathonIssues that could be solved within a day

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions