Merge "Echo API returns absolute URLs in notification links"

This commit is contained in:
jenkins-bot 2016-02-23 18:02:40 +00:00 committed by Gerrit Code Review
commit 92d0d4c533

View file

@ -12,6 +12,15 @@ class EchoModelFormatter extends EchoEventFormatter {
protected function formatModel( EchoEventPresentationModel $model ) {
$data = $model->jsonSerialize();
$data['iconUrl'] = EchoNotificationFormatter::getIconUrl( $model->getIconType(), $this->language->getDir() );
if ( isset( $data['links']['primary']['url'] ) ) {
$data['links']['primary']['url'] = wfExpandUrl( $data['links']['primary']['url'] );
}
foreach ( $data['links']['secondary'] as &$link ) {
$link['url'] = wfExpandUrl( $link['url'] );
}
return $data;
}
}