Page MenuHomePhabricator

If a not valid JSON string is passed to action=flow in the params parameter, it throws an internal error
Closed, ResolvedPublic

Description

#0 /srv/mediawiki/includes/WebRequest.php(1493): FauxRequest->construct(NULL, true)
#1 /srv/mediawiki/extensions/Flow/includes/api/ApiFlow.php(27): DerivativeRequest->
construct(Object(WebRequest), NULL, true)
#2 /srv/mediawiki/includes/api/ApiMain.php(834): ApiFlow->execute()
#3 /srv/mediawiki/includes/api/ApiMain.php(380): ApiMain->executeAction()
#4 /srv/mediawiki/includes/api/ApiMain.php(351): ApiMain->executeActionWithErrorHandling()
#5 /srv/mediawiki/api.php(73): ApiMain->execute()
#6 {main}

From ApiFlow.php:26-27

		$requestParams = json_decode( $params['params'], true );
		$request = new DerivativeRequest( $this->getContext()->getRequest(), $requestParams, true );

This is because json_decode returns NULL and DerivativeRequest doesn't want that.


Version: unspecified
Severity: normal

Details

Reference
bz55861

Event Timeline

bzimport raised the priority of this task from to Needs Triage.Nov 22 2014, 2:14 AM
bzimport set Reference to bz55861.
bzimport added a subscriber: Unknown Object (MLST).

The WMF core features team tracks this bug on Mingle card https://mingle.corp.wikimedia.org/projects/flow/cards/338, but people from the community are welcome to contribute here and in Gerrit.

Change 91551 had a related patch set uploaded by Werdna:
(bug 55861) Better error message for invalid params parameter.

https://gerrit.wikimedia.org/r/91551

Change 91551 merged by jenkins-bot:
(bug 55861) Better error message for invalid params parameter.

https://gerrit.wikimedia.org/r/91551