HttpError: Cast Message to string
In theory PHP should use coerce objects with a __toString method to string when passing them to a method which has a string-typed argument, but with the native Exception class this doesn't seem to be working, so cast explicitly. Bug: T388171 Change-Id: I310b97164877445837babed2a4c47795f1c2c277 (cherry picked from commit a14ef848f758612ac9d4e8c881ecdbbccf3e1158)
This commit is contained in:
parent
c614979c07
commit
b4dc368f72
1 changed files with 1 additions and 1 deletions
|
|
@ -47,7 +47,7 @@ class HttpError extends MWException {
|
|||
* @param-taint $header tainted
|
||||
*/
|
||||
public function __construct( $httpCode, $content, $header = null ) {
|
||||
parent::__construct( $content );
|
||||
parent::__construct( (string)$content );
|
||||
$this->httpCode = (int)$httpCode;
|
||||
$this->header = $header;
|
||||
$this->content = $content;
|
||||
|
|
|
|||
Loading…
Reference in a new issue