Stop escaping notes, move to parser.

This commit is contained in:
James Cole
2020-10-13 17:48:50 +02:00
parent 96dbd633bf
commit 0d4f203fae
3 changed files with 8 additions and 29 deletions

View File

@@ -63,6 +63,7 @@ use Illuminate\Database\Query\Builder;
class Note extends Model
{
use SoftDeletes;
/**
* The attributes that should be casted to native types.
*
@@ -77,16 +78,6 @@ class Note extends Model
/** @var array Fields that can be filled */
protected $fillable = ['title', 'text', 'noteable_id', 'noteable_type'];
/**
* @param string|null $value
*
* @return string|null
*/
public function getTextAttribute(?string $value): ?string
{
return null === $value ? null : htmlspecialchars_decode($value, ENT_QUOTES);
}
/**
* @codeCoverageIgnore
*
@@ -96,14 +87,4 @@ class Note extends Model
{
return $this->morphTo();
}
/**
* @param $value
*
* @codeCoverageIgnore
*/
public function setTextAttribute(string $value): void
{
$this->attributes['text'] = e($value);
}
}
}