Skip to main content
PHP HTML Editor

Policy reference

A policy file is XML in richtexteditor/config. Three are included: guest.config (browse only), default.config (members: upload and create folders) and admin.config (everything). Your page chooses one per user; nothing in a browser request can change or widen it.

<rteconfig>
  <security name="AllowUpload">true</security>              <!-- global -->
  <category for="Gallery,Image">                             <!-- one or more categories -->
    <security name="Extensions">*.jpg,*.png</security>
    <storage id="default">
      <security name="StoragePath">~/uploads/images</security>
      <security name="StorageName">Images</security>
    </storage>
  </category>
</rteconfig>

A setting is looked up in the storage, then the category, then the global settings, then the default below. SetSecurity() overrides any of them from your page.

Settings

SettingDefaultMeaning
AllowUploadfalseUpload files.
AllowCopyFilefalseKept for old files; not used.
AllowMoveFilefalseKept for old files; not used.
AllowRenameFilefalseRename files.
AllowDeleteFilefalseDelete files.
AllowOverridefalseReplace a file of the same name. Without it, a new upload gets a numbered name.
AllowCreateFolderfalseCreate folders.
AllowCopyFolderfalseKept for old files; not used.
AllowMoveFolderfalseKept for old files; not used.
AllowRenameFolderfalseRename folders.
AllowDeleteFolderfalseDelete folders with their content.
MaxFileSize1024Largest upload, in KB.
MaxFolderSize102400Largest total size of a storage, in KB.
LargeImageModeresizeImages larger than MaxImageWidth x MaxImageHeight: resize scales them down, deny refuses them, allow keeps them.
MaxImageWidth0Pixels; 0 = no limit.
MaxImageHeight0Pixels; 0 = no limit.
MaxImagePixels40000000Largest image (width x height) that is decoded at all; protects the server's memory.
StripImageMetadatatrueSave JPEG, PNG and WebP again without EXIF, GPS, XMP or ICC data.
FilePattern^[a-zA-Z0-9\._\-\s\(\)\[\]\x{007F}-\x{FFFF}]+$Regular expression every file name must match. The previous version's \uXXXX form is understood.
FolderPattern^[a-zA-Z0-9\._\-\s\(\)\[\]\x{007F}-\x{FFFF}]+$Regular expression every folder name must match.
StoragePath~/uploadsFolder of a storage. ~/ is the web root; a path outside it also needs StorageUrl.
Extensions(none)Allowed file types of a category, as *.jpg,*.png. Server and active-content types are refused even if listed: php, php3, php4, php5, php7, php8, phtml, pht, phar, phps, inc, asp and more.
StorageName(category) filesThe name the gallery shows for the storage.
StorageUrl(from StoragePath)Public URL of a storage outside the web root.
TagBlackList, AttrBlackList, StyleBlackList(none)Tags, attributes and CSS properties removed by the server-side cleaning, on top of its own rules.

Categories

  • Gallery,Image: images inserted from the editor and listed in the gallery. Images are always checked by their content.
  • Document: files linked from the content (PDF, Office, text, zip).
  • Video: video and audio.