mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Echo
synced 2024-09-24 02:39:33 +00:00
Merge "Echo API returns absolute URLs in notification links"
This commit is contained in:
commit
92d0d4c533
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue