Subject contains UTF-8 codes sometimes
This commit is contained in:
parent
403dde0d35
commit
ba7f9c1c99
@ -16,7 +16,8 @@ class Echomail extends Model implements Packet
|
|||||||
protected $collection = FALSE;
|
protected $collection = FALSE;
|
||||||
|
|
||||||
private const cast_utf8 = [
|
private const cast_utf8 = [
|
||||||
'msg'
|
'subject',
|
||||||
|
'msg',
|
||||||
];
|
];
|
||||||
|
|
||||||
protected $dates = ['datetime'];
|
protected $dates = ['datetime'];
|
||||||
|
@ -9,13 +9,18 @@ use Jenssegers\Mongodb\Eloquent\SoftDeletes;
|
|||||||
|
|
||||||
use App\Classes\FTN\Message;
|
use App\Classes\FTN\Message;
|
||||||
use App\Interfaces\Packet;
|
use App\Interfaces\Packet;
|
||||||
use App\Traits\UseMongo;
|
use App\Traits\{EncodeUTF8,UseMongo};
|
||||||
|
|
||||||
final class Netmail extends Model implements Packet
|
final class Netmail extends Model implements Packet
|
||||||
{
|
{
|
||||||
private const LOGKEY = 'MN-';
|
private const LOGKEY = 'MN-';
|
||||||
|
|
||||||
use SoftDeletes,UseMongo;
|
use SoftDeletes,UseMongo,EncodeUTF8;
|
||||||
|
|
||||||
|
private const cast_utf8 = [
|
||||||
|
'subject',
|
||||||
|
'msg',
|
||||||
|
];
|
||||||
|
|
||||||
protected $dates = ['datetime','sent_at'];
|
protected $dates = ['datetime','sent_at'];
|
||||||
|
|
||||||
|
@ -30,4 +30,14 @@ trait UseMongo
|
|||||||
{
|
{
|
||||||
$this->attributes['msg'] = utf8_encode($value);
|
$this->attributes['msg'] = utf8_encode($value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function getSubjectAttribute($value): string
|
||||||
|
{
|
||||||
|
return utf8_decode($value);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function setSubjectAttribute($value): void
|
||||||
|
{
|
||||||
|
$this->attributes['subject'] = utf8_encode($value);
|
||||||
|
}
|
||||||
}
|
}
|
@ -97,7 +97,7 @@
|
|||||||
|
|
||||||
<div class="row pb-2">
|
<div class="row pb-2">
|
||||||
<div class="col-8">
|
<div class="col-8">
|
||||||
SUBJECT: <strong class="highlight">{{ $msg->subject }}</strong>
|
SUBJECT: <strong class="highlight">{!! \App\Classes\FTN\Message::tr($msg->subject) !!}</strong>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user