HomePhabricator

linkeddata: Fix broken check in PageDataRequestHandler

Authored by thiemowmde on Mar 27 2019, 3:22 PM.

Description

linkeddata: Fix broken check in PageDataRequestHandler

First I noticed a weird check that assumes that explode() would return
an integer. But it returns an array of strings. There is obviously a
count() missing.

Then I started simplifying the code:

  • The count can only be 2 or 1, never anything else.
  • If it is one, the first element in the array contains the original string.
  • The empty string is already checked above and can never end down there.
  • Finally I made the remaining if ( … ) return true else return false a straight return ….

Change-Id: I289144e64f449ee0875009aaa22e10a5c0eb2734

Details

Committed
danielApr 1 2019, 11:26 AM
Parents
rMW2e7b7eed40ba: Merge "Don't return a result of a void function"
Branches
Unknown
Tags
Unknown
References
refs/changes/13/499513/7
ChangeId
I289144e64f449ee0875009aaa22e10a5c0eb2734