You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

86 lines
3.4 KiB

1 month ago
  1. <?php
  2. use Stevebauman\Purify\Definitions\Html5Definition;
  3. return [
  4. /*
  5. |--------------------------------------------------------------------------
  6. | Default Config
  7. |--------------------------------------------------------------------------
  8. |
  9. | This option defines the default config that are provided to HTMLPurifier.
  10. |
  11. */
  12. 'default' => 'default',
  13. /*
  14. |--------------------------------------------------------------------------
  15. | Config sets
  16. |--------------------------------------------------------------------------
  17. |
  18. | Here you may configure various sets of configuration for differentiated use of HTMLPurifier.
  19. | A specific set of configuration can be applied by calling the "config($name)" method on
  20. | a Purify instance. Feel free to add/remove/customize these attributes as you wish.
  21. |
  22. | Documentation: http://htmlpurifier.org/live/configdoc/plain.html
  23. |
  24. | Core.Encoding The encoding to convert input to.
  25. | HTML.Doctype Doctype to use during filtering.
  26. | HTML.Allowed The allowed HTML Elements with their allowed attributes.
  27. | HTML.ForbiddenElements The forbidden HTML elements. Elements that are listed in this
  28. | string will be removed, however their content will remain.
  29. | CSS.AllowedProperties The Allowed CSS properties.
  30. | AutoFormat.AutoParagraph Newlines are converted in to paragraphs whenever possible.
  31. | AutoFormat.RemoveEmpty Remove empty elements that contribute no semantic information to the document.
  32. |
  33. */
  34. 'configs' => [
  35. 'default' => [
  36. 'Core.Encoding' => 'utf-8',
  37. 'HTML.Doctype' => 'HTML 4.01 Transitional',
  38. 'HTML.Allowed' => 'h1,h2,h3,h4,h5,h6,b,strong,i,em,s,del,a[href|title],ul,ol,li,p[style],br,span,img[width|height|alt|src]',
  39. 'HTML.ForbiddenElements' => '',
  40. 'CSS.AllowedProperties' => 'font,font-size,font-weight,font-style,font-family,text-decoration,padding-left,color,background-color,text-align',
  41. 'AutoFormat.AutoParagraph' => false,
  42. 'AutoFormat.RemoveEmpty' => false,
  43. ],
  44. ],
  45. /*
  46. |--------------------------------------------------------------------------
  47. | HTMLPurifier definitions
  48. |--------------------------------------------------------------------------
  49. |
  50. | Here you may specify a class that augments the HTML definitions used by
  51. | HTMLPurifier. Additional HTML5 definitions are provided out of the box.
  52. | When specifying a custom class, make sure it implements the interface:
  53. |
  54. | \Stevebauman\Purify\Definitions\Definition
  55. |
  56. | Note that these definitions are applied to every Purifier instance.
  57. |
  58. | Documentation: http://htmlpurifier.org/docs/enduser-customize.html
  59. |
  60. */
  61. 'definitions' => Html5Definition::class,
  62. /*
  63. |--------------------------------------------------------------------------
  64. | Serializer location
  65. |--------------------------------------------------------------------------
  66. |
  67. | The location where HTMLPurifier can store its temporary serializer files.
  68. | The filepath should be accessible and writable by the web server.
  69. | A good place for this is in the framework's own storage path.
  70. |
  71. */
  72. 'serializer' => storage_path('app/purify'),
  73. ];