mirror of
https://github.com/kuaifan/dootask.git
synced 2026-02-24 01:50:46 +00:00
fix: 推送标题存在换行时不显示
This commit is contained in:
parent
779b32e8ad
commit
cc862741dc
@ -31,6 +31,16 @@ class UmengAlias extends AbstractModel
|
|||||||
{
|
{
|
||||||
protected $table = 'umeng_alias';
|
protected $table = 'umeng_alias';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 推送内容处理
|
||||||
|
* @param $string
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
private static function specialCharacters($string)
|
||||||
|
{
|
||||||
|
return str_replace(["\r\n", "\r", "\n"], '', $string);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取推送配置
|
* 获取推送配置
|
||||||
* @return array|false
|
* @return array|false
|
||||||
@ -73,9 +83,9 @@ class UmengAlias extends AbstractModel
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
//
|
//
|
||||||
$title = $array['title'] ?: ''; // 标题
|
$title = self::specialCharacters($array['title'] ?: ''); // 标题
|
||||||
$subtitle = $array['subtitle'] ?: ''; // 副标题(iOS)
|
$subtitle = self::specialCharacters($array['subtitle'] ?: ''); // 副标题(iOS)
|
||||||
$body = $array['body'] ?: ''; // 通知内容
|
$body = self::specialCharacters($array['body'] ?: ''); // 通知内容
|
||||||
$description = $array['description'] ?: 'no description'; // 描述
|
$description = $array['description'] ?: 'no description'; // 描述
|
||||||
$extra = is_array($array['extra']) ? $array['extra'] : []; // 额外参数
|
$extra = is_array($array['extra']) ? $array['extra'] : []; // 额外参数
|
||||||
$seconds = intval($array['seconds']) ?: 86400; // 有效时间(单位:秒)
|
$seconds = intval($array['seconds']) ?: 86400; // 有效时间(单位:秒)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user