purify.php 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  1. <?php
  2. use Webkul\Core\Purifier\Definitions\ExtendedHtml5Definition;
  3. return [
  4. /*
  5. |--------------------------------------------------------------------------
  6. | Default Config
  7. |--------------------------------------------------------------------------
  8. |
  9. | This option defines the default config that is 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,u,strong,i,em,s,del,a[href|title],ul,ol,li,p[style],br,span[style],img[width|height|alt|src],blockquote',
  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' => ExtendedHtml5Definition::class,
  62. /*
  63. |--------------------------------------------------------------------------
  64. | HTMLPurifier CSS definitions
  65. |--------------------------------------------------------------------------
  66. |
  67. | Here you may specify a class that augments the CSS definitions used by
  68. | HTMLPurifier. When specifying a custom class, make sure it implements
  69. | the interface:
  70. |
  71. | \Stevebauman\Purify\Definitions\CssDefinition
  72. |
  73. | Note that these definitions are applied to every Purifier instance.
  74. |
  75. | CSS should be extending $definition->info['css-attribute'] = values
  76. | See HTMLPurifier_CSSDefinition for further explanation
  77. |
  78. */
  79. 'css-definitions' => null,
  80. /*
  81. |--------------------------------------------------------------------------
  82. | Serializer
  83. |--------------------------------------------------------------------------
  84. |
  85. | The storage implementation where HTMLPurifier can store its serializer files.
  86. | If the filesystem cache is in use, the path must be writable through the
  87. | storage disk by the web server, otherwise an exception will be thrown.
  88. |
  89. */
  90. 'serializer' => [
  91. 'driver' => env('CACHE_STORE', env('CACHE_DRIVER', 'file')),
  92. 'cache' => \Stevebauman\Purify\Cache\CacheDefinitionCache::class,
  93. ],
  94. // 'serializer' => [
  95. // 'disk' => env('FILESYSTEM_DISK', 'local'),
  96. // 'path' => 'purify',
  97. // 'cache' => \Stevebauman\Purify\Cache\FilesystemDefinitionCache::class,
  98. // ],
  99. ];