+ // TRANS: Client error. Do not translate the quoted "application/[type]" strings.
+ $this->clientError(_m('Salmon requires "application/magic-envelope+xml". For Diaspora we also accept "application/x-www-form-urlencoded" with an "xml" parameter.', 415));
}
try {
- $envxml = file_get_contents('php://input');
+ if (empty($envxml)) {
+ throw new ClientException('No magic envelope supplied in POST.');
+ }
$magic_env = new MagicEnvelope($envxml); // parse incoming XML as a MagicEnvelope
$entry = $magic_env->getPayload(); // Not cryptographically verified yet!
$this->activity = new Activity($entry->documentElement);