Overview

Namespaces

  • None
  • Xmf
    • Database
    • Module
      • Helper
    • Template
  • Xoops
    • Auth
    • Core
      • Cache
      • Database
        • Logging
        • Schema
      • Exception
      • Handler
        • Scheme
      • Kernel
        • Dtype
        • Handlers
        • Model
      • Lists
      • Locale
        • Punic
      • Service
        • Contract
      • Session
      • Text
        • Sanitizer
          • Extensions
      • Theme
        • Plugins
    • Form
    • Html
    • Locale
    • Module
      • Helper
      • Plugin

Classes

  • ArtObject
  • ArtObjectHandler
  • Avatars
  • AvatarsAvatar
  • AvatarsAvatar_userForm
  • AvatarsAvatarForm
  • AvatarsAvatarHandler
  • AvatarsLocale
  • AvatarsLocaleEn_US
  • AvatarsPreload
  • AvatarsProvider
  • AvatarsUserlink
  • AvatarsUserlinkHandler
  • AwesomeButton
  • BannerRender
  • Banners
  • BannersBanner
  • BannersBannerclient
  • BannersBannerclientForm
  • BannersBannerclientHandler
  • BannersBannerForm
  • BannersBannerHandler
  • BannersPreload
  • BloggerApi
  • CodexMenusPlugin
  • CodexSearchPlugin
  • CodexSystemPlugin
  • CodexUserconfigsPlugin
  • Comments
  • CommentsComment
  • CommentsCommentForm
  • CommentsCommentHandler
  • CommentsCommentRenderer
  • CommentsPreload
  • CommentsSystemPlugin
  • CommentsUserconfigsPlugin
  • Cookie
  • CountryFlagProvider
  • Criteria
  • CriteriaCompo
  • CriteriaElement
  • DebugbarLogger
  • DebugbarPreload
  • DebugbarUserconfigsPlugin
  • DefaultThemeLocale
  • DefaultThemeLocaleEn_US
  • FormDhtmlTextArea
  • FormTextArea
  • GravatarsPreload
  • GravatarsProvider
  • htmLawed
  • HtmlToPdfProvider
  • imageLib
  • Images
  • ImagesCategory
  • ImagesCategory_imagemanagerForm
  • ImagesCategoryForm
  • ImagesCategoryHandler
  • ImagesCategoryselectForm
  • ImagesImage
  • ImagesImage_Body
  • ImagesImage_imagemanagerForm
  • ImagesImagebody
  • ImagesImagebodyHandler
  • ImagesImageForm
  • ImagesImageHandler
  • ImagesPreload
  • JUpload
  • LegacyLogger
  • LoggerPreload
  • LoggerUserconfigsPlugin
  • Maintenance
  • MaintenanceMaintenanceForm
  • Menus
  • MenusBuilder
  • MenusConstantDecorator
  • MenusDecorator
  • MenusDecoratorAbstract
  • MenusDefaultDecorator
  • MenusDynamicDecorator
  • MenusMenu
  • MenusMenuHandler
  • MenusMenus
  • MenusMenus_menuForm
  • MenusMenus_menusForm
  • MenusMenusHandler
  • MenusPreload
  • MenusSmartyDecorator
  • MetaWeblogApi
  • MonologLogger
  • MonologPreload
  • MonologUserconfigsPlugin
  • MovableTypeApi
  • MyTextSanitizer
  • MyTextSanitizerExtended
  • Notifications
  • NotificationsNotification
  • NotificationsNotificationHandler
  • NotificationsPreload
  • NotificationsSystemPlugin
  • Page
  • PageCommentsPlugin
  • PageGroupPermHandler
  • PageLocale
  • PageLocaleEn_US
  • PageNotificationsPlugin
  • PagePage_content
  • PagePage_contentForm
  • PagePage_contentHandler
  • PagePage_rating
  • PagePage_ratingHandler
  • PagePage_related
  • PagePage_related_link
  • PagePage_related_linkHandler
  • PagePage_relatedForm
  • PagePage_relatedHandler
  • PagePreload
  • PageSearchPlugin
  • PageSystemPlugin
  • PdfPreload
  • PmMessage
  • PmMessageHandler
  • PmPreload
  • ProfileCategory
  • ProfileCategoryForm
  • ProfileCategoryHandler
  • ProfileCorePreload
  • ProfileField
  • ProfileFieldForm
  • ProfileFieldHandler
  • ProfileMenusPlugin
  • ProfileProfile
  • ProfileProfileHandler
  • ProfileRegstep
  • ProfileRegstepForm
  • ProfileRegstepHandler
  • ProfileVisibility
  • ProfileVisibilityHandler
  • Protector
  • protector_bruteforce_overrun_message
  • protector_crawler_overrun_message
  • protector_f5attack_overrun_message
  • protector_postcommon_post_deny_by_httpbl
  • protector_postcommon_post_deny_by_rbl
  • protector_postcommon_post_htmlpurify4everyone
  • protector_postcommon_post_htmlpurify4guest
  • protector_postcommon_post_need_multibyte
  • protector_postcommon_post_register_moratorium
  • protector_postcommon_register_insert_js_check
  • protector_precommon_badip_errorlog
  • protector_precommon_badip_message
  • protector_precommon_badip_redirection
  • protector_precommon_bwlimit_errorlog
  • protector_precommon_bwlimit_message
  • protector_prepurge_exit_message
  • protector_spamcheck_overrun_message
  • ProtectorCenterForm
  • ProtectorCorePreload
  • ProtectorFilterAbstract
  • ProtectorFilterHandler
  • ProtectorMySQLDatabase
  • Publisher
  • PublisherBlockForm
  • PublisherCategory
  • PublisherCategoryForm
  • PublisherCategoryHandler
  • PublisherCommentsPlugin
  • PublisherFile
  • PublisherFileForm
  • PublisherFileHandler
  • PublisherFormDateTime
  • PublisherGroupPermHandler
  • PublisherItem
  • PublisherItemForm
  • PublisherItemHandler
  • PublisherMenusPlugin
  • PublisherMetagen
  • PublisherMimetype
  • PublisherMimetypeHandler
  • PublisherNotificationsPlugin
  • PublisherPermissionHandler
  • PublisherPreload
  • PublisherRating
  • PublisherRatingHandler
  • PublisherSearchPlugin
  • PublisherSystemPlugin
  • PublisherUtils
  • QrcodePreload
  • QrcodeProvider
  • ReCaptchaResponse
  • RpcArrayHandler
  • RpcBase64Handler
  • RpcBooleanHandler
  • RpcDateTimeHandler
  • RpcDoubleHandler
  • RpcIntHandler
  • RpcMemberHandler
  • RpcMethodNameHandler
  • RpcNameHandler
  • RpcStringHandler
  • RpcStructHandler
  • RpcValueHandler
  • RssAuthorHandler
  • RssCategoryHandler
  • RssChannelHandler
  • RssCommentsHandler
  • RssCopyrightHandler
  • RssDescriptionHandler
  • RssDocsHandler
  • RssGeneratorHandler
  • RssGuidHandler
  • RssHeightHandler
  • RssImageHandler
  • RssItemHandler
  • RssLanguageHandler
  • RssLastBuildDateHandler
  • RssLinkHandler
  • RssManagingEditorHandler
  • RssNameHandler
  • RssPubDateHandler
  • RssSourceHandler
  • RssTextInputHandler
  • RssTitleHandler
  • RssTtlHandler
  • RssUrlHandler
  • RssWebMasterHandler
  • RssWidthHandler
  • SaxParser
  • Search
  • SearchPreload
  • SearchSearchForm
  • Smarty_Resource_Admin
  • Smarty_Resource_Block
  • Smarty_Resource_Db
  • Smarty_Resource_Module
  • Smilies
  • SmiliesPreload
  • SmiliesProvider
  • SmiliesSmiley
  • SmiliesSmileyHandler
  • SmiliesSmiliesForm
  • Snoopy
  • SqlUtility
  • System
  • SystemBlockForm
  • SystemBreadcrumb
  • SystemExtension
  • SystemGroupForm
  • SystemLocale
  • SystemLocaleEn_US
  • SystemMenuHandler
  • SystemModule
  • SystemPreferencesForm
  • SystemPreload
  • SystemUserForm
  • tar
  • ThemeSetAuthorHandler
  • ThemeSetDateCreatedHandler
  • ThemeSetDescriptionHandler
  • ThemeSetEmailHandler
  • ThemeSetFileTypeHandler
  • ThemeSetGeneratorHandler
  • ThemeSetImageHandler
  • ThemeSetLinkHandler
  • ThemeSetModuleHandler
  • ThemeSetNameHandler
  • ThemeSetTagHandler
  • ThemeSetTemplateHandler
  • Thumbs
  • ThumbsPreload
  • ThumbsProvider
  • TinyMCE
  • Userconfigs
  • UserconfigsConfigHandler
  • UserconfigsConfigsForm
  • UserconfigsItem
  • UserconfigsItemHandler
  • UserconfigsMenusPlugin
  • UserconfigsModulesForm
  • UserconfigsOption
  • UserconfigsOptionHandler
  • UserconfigsPreload
  • UserconfigsSystemPlugin
  • UserrankPreload
  • UserRankProvider
  • UserrankRank
  • UserrankRankHandler
  • UserrankRanksForm
  • Xcaptcha
  • XcaptchaCaptchaForm
  • XcaptchaImage
  • XcaptchaImageForm
  • XcaptchaRecaptcha
  • XcaptchaRecaptchaForm
  • XcaptchaText
  • XcaptchaTextForm
  • Xlanguage
  • XlanguageLanguage
  • XlanguageLanguageForm
  • XlanguagePreload
  • XlanguageTinymceForm
  • XlanguageXlanguageHandler
  • Xmf\Database\TableLoad
  • Xmf\Database\Tables
  • Xmf\Debug
  • Xmf\FilterInput
  • Xmf\Highlighter
  • Xmf\Language
  • Xmf\Loader
  • Xmf\Metagen
  • Xmf\Module\Admin
  • Xmf\Module\Cache
  • Xmf\Module\Helper
  • Xmf\Module\Helper\AbstractHelper
  • Xmf\Module\Helper\GenericHelper
  • Xmf\Module\Permission
  • Xmf\Module\Session
  • Xmf\Request
  • Xmf\Template\AbstractTemplate
  • Xmf\Template\Breadcrumb
  • Xmf\Template\Buttonbox
  • Xmf\Template\Feed
  • Xmf\Template\PrintContent
  • Xmf\Utilities
  • Xmf\Yaml
  • XmfPreload
  • XmlTagHandler
  • Xoops
  • Xoops\Auth\Ads
  • Xoops\Auth\AuthAbstract
  • Xoops\Auth\Factory
  • Xoops\Auth\Ldap
  • Xoops\Auth\Provisioning
  • Xoops\Auth\Xoops
  • Xoops\Cache
  • Xoops\Core\Assets
  • Xoops\Core\Cache\Access
  • Xoops\Core\Cache\CacheManager
  • Xoops\Core\Cache\DriverList
  • Xoops\Core\Cache\Legacy
  • Xoops\Core\ComposerUtility
  • Xoops\Core\Database\Connection
  • Xoops\Core\Database\Factory
  • Xoops\Core\Database\Logging\XoopsDebugStack
  • Xoops\Core\Database\QueryBuilder
  • Xoops\Core\Database\Schema\ExportVisitor
  • Xoops\Core\Database\Schema\ImportSchema
  • Xoops\Core\Database\Schema\PrefixStripper
  • Xoops\Core\Database\Schema\RemovePrefixes
  • Xoops\Core\Events
  • Xoops\Core\FilterInput
  • Xoops\Core\FixedGroups
  • Xoops\Core\Handler\Factory
  • Xoops\Core\Handler\FactorySpec
  • Xoops\Core\Handler\Scheme\FQN
  • Xoops\Core\Handler\Scheme\Kernel
  • Xoops\Core\Handler\Scheme\LegacyModule
  • Xoops\Core\HttpRequest
  • Xoops\Core\Kernel\Criteria
  • Xoops\Core\Kernel\CriteriaCompo
  • Xoops\Core\Kernel\CriteriaElement
  • Xoops\Core\Kernel\Dtype
  • Xoops\Core\Kernel\Dtype\DtypeAbstract
  • Xoops\Core\Kernel\Dtype\DtypeArray
  • Xoops\Core\Kernel\Dtype\DtypeDateTime
  • Xoops\Core\Kernel\Dtype\DtypeDecimal
  • Xoops\Core\Kernel\Dtype\DtypeEmail
  • Xoops\Core\Kernel\Dtype\DtypeEnumeration
  • Xoops\Core\Kernel\Dtype\DtypeFloat
  • Xoops\Core\Kernel\Dtype\DtypeInt
  • Xoops\Core\Kernel\Dtype\DtypeJson
  • Xoops\Core\Kernel\Dtype\DtypeMoney
  • Xoops\Core\Kernel\Dtype\DtypeOther
  • Xoops\Core\Kernel\Dtype\DtypeSimpleTime
  • Xoops\Core\Kernel\Dtype\DtypeSource
  • Xoops\Core\Kernel\Dtype\DtypeTextArea
  • Xoops\Core\Kernel\Dtype\DtypeTextBox
  • Xoops\Core\Kernel\Dtype\DtypeTimeZone
  • Xoops\Core\Kernel\Dtype\DtypeUrl
  • Xoops\Core\Kernel\Handlers\XoopsBlock
  • Xoops\Core\Kernel\Handlers\XoopsBlockHandler
  • Xoops\Core\Kernel\Handlers\XoopsBlockModuleLink
  • Xoops\Core\Kernel\Handlers\XoopsBlockModuleLinkHandler
  • Xoops\Core\Kernel\Handlers\XoopsConfigHandler
  • Xoops\Core\Kernel\Handlers\XoopsConfigItem
  • Xoops\Core\Kernel\Handlers\XoopsConfigItemHandler
  • Xoops\Core\Kernel\Handlers\XoopsConfigOption
  • Xoops\Core\Kernel\Handlers\XoopsConfigOptionHandler
  • Xoops\Core\Kernel\Handlers\XoopsGroup
  • Xoops\Core\Kernel\Handlers\XoopsGroupHandler
  • Xoops\Core\Kernel\Handlers\XoopsGroupPerm
  • Xoops\Core\Kernel\Handlers\XoopsGroupPermHandler
  • Xoops\Core\Kernel\Handlers\XoopsMemberHandler
  • Xoops\Core\Kernel\Handlers\XoopsMembership
  • Xoops\Core\Kernel\Handlers\XoopsMembershipHandler
  • Xoops\Core\Kernel\Handlers\XoopsModule
  • Xoops\Core\Kernel\Handlers\XoopsModuleHandler
  • Xoops\Core\Kernel\Handlers\XoopsOnline
  • Xoops\Core\Kernel\Handlers\XoopsOnlineHandler
  • Xoops\Core\Kernel\Handlers\XoopsPrivateMessage
  • Xoops\Core\Kernel\Handlers\XoopsPrivateMessageHandler
  • Xoops\Core\Kernel\Handlers\XoopsTplFile
  • Xoops\Core\Kernel\Handlers\XoopsTplFileHandler
  • Xoops\Core\Kernel\Handlers\XoopsTplSet
  • Xoops\Core\Kernel\Handlers\XoopsTplSetHandler
  • Xoops\Core\Kernel\Handlers\XoopsUser
  • Xoops\Core\Kernel\Handlers\XoopsUserHandler
  • Xoops\Core\Kernel\Model\Joint
  • Xoops\Core\Kernel\Model\Read
  • Xoops\Core\Kernel\Model\Stats
  • Xoops\Core\Kernel\Model\Sync
  • Xoops\Core\Kernel\Model\Write
  • Xoops\Core\Kernel\XoopsModelAbstract
  • Xoops\Core\Kernel\XoopsModelFactory
  • Xoops\Core\Kernel\XoopsObject
  • Xoops\Core\Kernel\XoopsObjectHandler
  • Xoops\Core\Kernel\XoopsPersistableObjectHandler
  • Xoops\Core\Lists\Country
  • Xoops\Core\Lists\Directory
  • Xoops\Core\Lists\Editor
  • Xoops\Core\Lists\File
  • Xoops\Core\Lists\HtmlFile
  • Xoops\Core\Lists\ImageFile
  • Xoops\Core\Lists\ListAbstract
  • Xoops\Core\Lists\Locale
  • Xoops\Core\Lists\Module
  • Xoops\Core\Lists\Month
  • Xoops\Core\Lists\SubjectIcon
  • Xoops\Core\Lists\SubSet
  • Xoops\Core\Lists\Theme
  • Xoops\Core\Lists\Time
  • Xoops\Core\Lists\TimeZone
  • Xoops\Core\Locale\LegacyCodes
  • Xoops\Core\Locale\Punic\Calendar
  • Xoops\Core\Locale\Time
  • Xoops\Core\Logger
  • Xoops\Core\MediaUploader
  • Xoops\Core\MimeTypes
  • Xoops\Core\PreloadItem
  • Xoops\Core\Psr0ClassLoader
  • Xoops\Core\Psr4ClassLoader
  • Xoops\Core\Random
  • Xoops\Core\Registry
  • Xoops\Core\Request
  • Xoops\Core\Security
  • Xoops\Core\Service\AbstractContract
  • Xoops\Core\Service\Manager
  • Xoops\Core\Service\NullProvider
  • Xoops\Core\Service\Provider
  • Xoops\Core\Service\Response
  • Xoops\Core\Session\Fingerprint
  • Xoops\Core\Session\Handler
  • Xoops\Core\Session\Manager
  • Xoops\Core\Session\RememberMe
  • Xoops\Core\Session\SessionUser
  • Xoops\Core\Text\Sanitizer
  • Xoops\Core\Text\Sanitizer\Configuration
  • Xoops\Core\Text\Sanitizer\ConfigurationAbstract
  • Xoops\Core\Text\Sanitizer\DefaultConfiguration
  • Xoops\Core\Text\Sanitizer\ExtensionAbstract
  • Xoops\Core\Text\Sanitizer\Extensions\Censor
  • Xoops\Core\Text\Sanitizer\Extensions\Clickable
  • Xoops\Core\Text\Sanitizer\Extensions\Embed
  • Xoops\Core\Text\Sanitizer\Extensions\Flash
  • Xoops\Core\Text\Sanitizer\Extensions\Iframe
  • Xoops\Core\Text\Sanitizer\Extensions\Image
  • Xoops\Core\Text\Sanitizer\Extensions\Mms
  • Xoops\Core\Text\Sanitizer\Extensions\Mp3
  • Xoops\Core\Text\Sanitizer\Extensions\Quote
  • Xoops\Core\Text\Sanitizer\Extensions\Rtsp
  • Xoops\Core\Text\Sanitizer\Extensions\SoundCloud
  • Xoops\Core\Text\Sanitizer\Extensions\SyntaxHighlight
  • Xoops\Core\Text\Sanitizer\Extensions\TextFilter
  • Xoops\Core\Text\Sanitizer\Extensions\UnorderedList
  • Xoops\Core\Text\Sanitizer\Extensions\Wiki
  • Xoops\Core\Text\Sanitizer\Extensions\Wmp
  • Xoops\Core\Text\Sanitizer\Extensions\XoopsCode
  • Xoops\Core\Text\Sanitizer\Extensions\Xss
  • Xoops\Core\Text\Sanitizer\Extensions\YouTube
  • Xoops\Core\Text\Sanitizer\FilterAbstract
  • Xoops\Core\Text\Sanitizer\NullExtension
  • Xoops\Core\Text\Sanitizer\NullFilter
  • Xoops\Core\Text\Sanitizer\SanitizerComponent
  • Xoops\Core\Text\Sanitizer\SanitizerConfigurable
  • Xoops\Core\Text\ShortCodes
  • Xoops\Core\Theme\AdminFactory
  • Xoops\Core\Theme\Factory
  • Xoops\Core\Theme\NullTheme
  • Xoops\Core\Theme\PluginAbstract
  • Xoops\Core\Theme\Plugins\Blocks
  • Xoops\Core\Theme\XoopsTheme
  • Xoops\Core\XoopsTpl
  • Xoops\Core\Yaml
  • Xoops\Form\BlockForm
  • Xoops\Form\Button
  • Xoops\Form\ButtonTray
  • Xoops\Form\Captcha
  • Xoops\Form\Checkbox
  • Xoops\Form\ColorPicker
  • Xoops\Form\DateSelect
  • Xoops\Form\DateTime
  • Xoops\Form\DhtmlTextArea
  • Xoops\Form\Editor
  • Xoops\Form\Element
  • Xoops\Form\ElementFactory
  • Xoops\Form\ElementTray
  • Xoops\Form\File
  • Xoops\Form\Form
  • Xoops\Form\GroupCheckbox
  • Xoops\Form\GroupFormCheckbox
  • Xoops\Form\GroupPermissionForm
  • Xoops\Form\Hidden
  • Xoops\Form\Label
  • Xoops\Form\Mail
  • Xoops\Form\OptionElement
  • Xoops\Form\Password
  • Xoops\Form\Radio
  • Xoops\Form\RadioYesNo
  • Xoops\Form\Raw
  • Xoops\Form\Select
  • Xoops\Form\SelectCountry
  • Xoops\Form\SelectEditor
  • Xoops\Form\SelectGroup
  • Xoops\Form\SelectLanguage
  • Xoops\Form\SelectLocale
  • Xoops\Form\SelectMatchOption
  • Xoops\Form\SelectTheme
  • Xoops\Form\SelectTimeZone
  • Xoops\Form\SelectUser
  • Xoops\Form\SimpleForm
  • Xoops\Form\Tab
  • Xoops\Form\TableForm
  • Xoops\Form\TabTray
  • Xoops\Form\Text
  • Xoops\Form\TextArea
  • Xoops\Form\ThemeForm
  • Xoops\Form\Token
  • Xoops\Form\Url
  • Xoops\Html\Attributes
  • Xoops\Html\Img
  • Xoops\Locale
  • Xoops\Locale\AbstractLocale
  • Xoops\Module\Admin
  • Xoops\Module\Helper
  • Xoops\Module\Helper\Dummy
  • Xoops\Module\Helper\HelperAbstract
  • Xoops\Module\Plugin
  • Xoops\Module\Plugin\ConfigCollector
  • Xoops\Module\Plugin\PluginAbstract
  • Xoops\Utils
  • Xoops_Locale_Mailer_Abstract
  • XoopsAdminThemeFactory
  • XoopsApi
  • XoopsArt
  • XoopsBaseConfig
  • XoopsBlock
  • XoopsBlockHandler
  • XoopsBlockmodulelink
  • XoopsBlockmodulelinkHandler
  • XoopsCache
  • XoopsCaptcha
  • XoopsCaptchaImage
  • XoopsCaptchaImageHandler
  • XoopsCaptchaMethod
  • XoopsCaptchaRecaptcha
  • XoopsCaptchaText
  • XoopsConfigHandler
  • XoopsConfigItem
  • XoopsConfigItemHandler
  • XoopsConfigOption
  • XoopsConfigOptionHandler
  • XoopsDatabase
  • XoopsDatabaseFactory
  • XoopsDatabaseManager
  • XoopsDownloader
  • XoopsEditor
  • XoopsEditorHandler
  • XoopsFile
  • XoopsFileHandler
  • XoopsFilterInput
  • XoopsFolderHandler
  • XoopsForm
  • XoopsFormButton
  • XoopsFormButtonTray
  • XoopsFormCaptcha
  • XoopsFormCheckBox
  • XoopsFormColorPicker
  • XoopsFormDateTime
  • XoopsFormDhtmlTextArea
  • XoopsFormEditor
  • XoopsFormElement
  • XoopsFormElementTray
  • XoopsFormFile
  • XoopsFormHidden
  • XoopsFormHiddenToken
  • XoopsFormLabel
  • XoopsFormPassword
  • XoopsFormRadio
  • XoopsFormRadioYN
  • XoopsFormSelect
  • XoopsFormSelectCheckGroup
  • XoopsFormSelectCountry
  • XoopsFormSelectEditor
  • XoopsFormSelectGroup
  • XoopsFormSelectLang
  • XoopsFormSelectMatchOption
  • XoopsFormSelectTheme
  • XoopsFormSelectTimezone
  • XoopsFormSelectUser
  • XoopsFormText
  • XoopsFormTextArea
  • XoopsFormTextDateSelect
  • XoopsFormTinymce
  • XoopsFormTinymce4
  • XoopsGroup
  • XoopsGroupHandler
  • XoopsGroupPerm
  • XoopsGroupPermForm
  • XoopsGroupPermHandler
  • XoopsGTicket
  • XoopsGuiDefault
  • XoopsInstallWizard
  • XoopsLists
  • XoopsLoad
  • XoopsLocal
  • XoopsLocale
  • XoopsLocaleEn_US
  • XoopsLogger
  • XoopsMailer
  • XoopsMailerLocal
  • XoopsMailerLocale
  • XoopsMediaUploader
  • XoopsMemberHandler
  • XoopsMembership
  • XoopsMembershipHandler
  • XoopsModule
  • XoopsModuleHandler
  • XoopsMultiMailer
  • XoopsMySQLDatabase
  • XoopsMySQLDatabaseProxy
  • XoopsMySQLDatabaseSafe
  • XoopsObject
  • XoopsObjectHandler
  • XoopsObjectTree
  • XoopsOnline
  • XoopsOnlineHandler
  • XoopsPageNav
  • XoopsPathController
  • XoopsPersistableObjectHandler
  • XoopsPreload
  • XoopsPreloadItem
  • XoopsPrivmessage
  • XoopsPrivmessageHandler
  • XoopsRequest
  • XoopsSecurity
  • XoopsSimpleForm
  • XoopsTableForm
  • XoopsTarDownloader
  • XoopsTheme
  • XoopsThemeBlocksPlugin
  • XoopsThemeFactory
  • XoopsThemeForm
  • XoopsThemePlugin
  • XoopsThemeSetParser
  • XoopsTpl
  • XoopsTplfile
  • XoopsTplfileHandler
  • XoopsTplset
  • XoopsTplsetHandler
  • XoopsUser
  • XoopsUserHandler
  • XoopsUserUtility
  • XoopsUtility
  • XoopsXmlRpcApi
  • XoopsXmlRpcArray
  • XoopsXmlRpcBase64
  • XoopsXmlRpcBoolean
  • XoopsXmlRpcDatetime
  • XoopsXmlRpcDocument
  • XoopsXmlRpcDouble
  • XoopsXmlRpcFault
  • XoopsXmlRpcInt
  • XoopsXmlRpcParser
  • XoopsXmlRpcRequest
  • XoopsXmlRpcResponse
  • XoopsXmlRpcString
  • XoopsXmlRpcStruct
  • XoopsXmlRpcTag
  • XoopsXmlRss2Parser
  • XoopsZipDownloader
  • zipfile

Interfaces

  • CommentsPluginInterface
  • MenusDecoratorInterface
  • MenusPluginInterface
  • NotificationsPluginInterface
  • SearchPluginInterface
  • SystemPluginInterface
  • UserconfigsPluginInterface
  • Xoops\Core\AttributeInterface
  • Xoops\Core\Handler\Scheme\SchemeInterface
  • Xoops\Core\Service\Contract\AvatarInterface
  • Xoops\Core\Service\Contract\CountryflagInterface
  • Xoops\Core\Service\Contract\EmojiInterface
  • Xoops\Core\Service\Contract\HtmlToPdfInterface
  • Xoops\Core\Service\Contract\QrcodeInterface
  • Xoops\Core\Service\Contract\ThumbnailInterface
  • Xoops\Core\Service\Contract\UserRankInterface
  • Xoops\Core\Session\FingerprintInterface
  • Xoops\Form\ContainerInterface

Exceptions

  • Xoops\Core\Exception\InvalidHandlerSpecException
  • Xoops\Core\Exception\NoHandlerException

Functions

  • _changeMimeValue
  • _clearAddSessionVars
  • _clearEditSessionVars
  • _ee
  • _recaptcha_aes_encrypt
  • _recaptcha_aes_pad
  • _recaptcha_http_post
  • _recaptcha_mailhide_email_parts
  • _recaptcha_mailhide_urlbase64
  • _recaptcha_qsencode
  • _tt
  • add
  • addCriteria
  • admin_refcheck
  • b_comments_edit
  • b_comments_show
  • b_notification_show
  • b_search_show
  • b_system_info_edit
  • b_system_info_show
  • b_system_login_show
  • b_system_main_edit
  • b_system_main_show
  • b_system_newmembers_edit
  • b_system_newmembers_show
  • b_system_online_show
  • b_system_themes_edit
  • b_system_themes_show
  • b_system_topposters_edit
  • b_system_topposters_show
  • b_system_user_show
  • b_system_waiting_show
  • b_xlanguage_select_edit
  • b_xlanguage_select_show
  • banners_blocks_edit
  • banners_blocks_show
  • base_url
  • buildRssFeedCache
  • buildTable
  • check_files_extensions_on_path
  • check_files_extensions_on_phar
  • checkEmail
  • clearAddSession
  • clearEditSession
  • config_loading
  • create_folder
  • create_img
  • create_img_gd
  • createConfigform
  • createDir
  • createThemeform
  • dateSort
  • debugger
  • delete
  • deleteDir
  • duplicate_file
  • edit
  • endsWith
  • exception_handler
  • extensionSort
  • file_put_contents
  • filenameSort
  • filescount
  • fix_dirname
  • fix_filename
  • fix_get_params
  • fix_path
  • fix_strtolower
  • fix_strtoupper
  • foldersize
  • formatTimestamp
  • formatURL
  • genPathCheckHtml
  • get_file_by_url
  • get_writeoks_from_protector
  • getBrightness
  • getDbConnection
  • getDbConnectionParams
  • getDirList
  • handle_uploaded_files
  • http_response_code
  • image_check_memory_usage
  • install_acceptUser
  • install_finalize
  • installHtmlSpecialCharacters
  • is_function_callable
  • is_really_writable
  • load_functions
  • load_object
  • load_objectHandler
  • loadModuleAdminMenu
  • makeSize
  • manage
  • menus_block_edit
  • menus_block_show
  • menus_mainmenu_show
  • mod_clearCacheFile
  • mod_clearConfg
  • mod_clearConfig
  • mod_clearFile
  • mod_clearSmartyCache
  • mod_constant
  • mod_createCacheFile
  • mod_createCacheFile_byGroup
  • mod_createFile
  • mod_DB_prefix
  • mod_fetchConfg
  • mod_fetchConfig
  • mod_generateCacheId
  • mod_generateCacheId_byGroup
  • mod_getDirname
  • mod_getMysqlVersion
  • mod_isModuleAction
  • mod_loadCacheFile
  • mod_loadCacheFile_byGroup
  • mod_loadConfg
  • mod_loadConfig
  • mod_loadFile
  • mod_loadFunctions
  • mod_loadRenderer
  • mod_message
  • modify_chmod
  • new_thumbnails_creation
  • normalizeColor
  • page_blocks_edit
  • page_blocks_show
  • profile_getRegisterForm
  • profile_getUserForm
  • profile_install_addCategory
  • profile_install_addField
  • profile_install_addStep
  • profile_install_initializeProfiles
  • profile_install_setPermissions
  • protector_ip_cmp
  • protector_postcheck
  • protector_precheck
  • publisher_category_items_sel_edit
  • publisher_category_items_sel_show
  • publisher_cloneFileFolder
  • publisher_createLogo
  • publisher_date_to_date_edit
  • publisher_date_to_date_show
  • publisher_displayCategory
  • publisher_editCat
  • publisher_editFile
  • publisher_editItem
  • publisher_items_columns_edit
  • publisher_items_columns_show
  • publisher_items_menu_edit
  • publisher_items_menu_show
  • publisher_items_new_edit
  • publisher_items_new_show
  • publisher_items_random_item_show
  • publisher_items_recent_edit
  • publisher_items_recent_show
  • publisher_items_spot_edit
  • publisher_items_spot_show
  • publisher_latest_files_edit
  • publisher_latest_files_show
  • publisher_latest_news_edit
  • publisher_latest_news_show
  • publisher_mk_chkbox
  • publisher_mk_select
  • publisher_pagewrap_upload
  • publisher_search
  • publisher_search_show
  • publisher_tag_iteminfo
  • publisher_tag_synchronization
  • rcopy
  • recaptcha_check_answer
  • recaptcha_get_html
  • recaptcha_get_signup_url
  • recaptcha_mailhide_html
  • recaptcha_mailhide_url
  • redirect_header
  • rename_file
  • rename_folder
  • rrename
  • rrename_after_cleaner
  • search
  • sizeSort
  • smarty_block_assets
  • smarty_block_noshortcodes
  • smarty_compiler_xoAdminIcons
  • smarty_compiler_xoAdminNav
  • smarty_compiler_xoAppUrl
  • smarty_compiler_xoImgUrl
  • smarty_compiler_xoModuleIcons16
  • smarty_compiler_xoModuleIcons32
  • smarty_compiler_xoModuleIconsBookmarks
  • smarty_function_addBaseScript
  • smarty_function_addBaseStylesheet
  • smarty_function_securityToken
  • smarty_function_thumbnail
  • smarty_function_translate
  • smarty_function_translateTheme
  • smarty_function_xoblock
  • smarty_function_xoInboxCount
  • smarty_function_xoMemberInfo
  • smarty_function_xoops_link
  • smarty_function_xoPageNav
  • smarty_modifier_datetime
  • smarty_modifier_debug_print_var
  • smarty_outputfilter_shortcodes
  • synchronize
  • system_AdminIcons
  • system_adminVersion
  • system_cleanVars
  • system_loadLanguage
  • system_loadTemplate
  • updateMimeValue
  • userTimeToServerTime
  • xhtmlspecialchars
  • xlanguage_convert_encoding
  • xlanguage_convert_item
  • xlanguage_copyfile
  • xlanguage_detectLang
  • xlanguage_encoding
  • xlanguage_lang_detect
  • xlanguage_mkdirs
  • xlanguage_ml
  • xlanguage_ml_escape_bracket
  • xlanguage_select_show
  • xoBoolField
  • xoDiag
  • xoDiagBoolSetting
  • xoDiagIfWritable
  • xoFormField
  • xoops_comment_count
  • xoops_comment_delete
  • xoops_confirm
  • xoops_convert_encoding
  • xoops_cp_footer
  • xoops_cp_header
  • xoops_error
  • xoops_footer
  • xoops_getActiveModules
  • xoops_getbanner
  • xoops_getBaseDomain
  • xoops_getConfigOption
  • xoops_getcss
  • xoops_getenv
  • xoops_getHandler
  • xoops_getMailer
  • xoops_getModuleHandler
  • xoops_getModuleOption
  • xoops_getOption
  • xoops_getrank
  • xoops_getUrlDomain
  • xoops_getUserTimestamp
  • xoops_groupperm_deletebymoditem
  • xoops_header
  • xoops_isActiveModule
  • xoops_load
  • xoops_loadLanguage
  • xoops_makepass
  • xoops_message
  • xoops_module_install_avatars
  • xoops_module_install_banners
  • xoops_module_install_comments
  • xoops_module_install_debugbar
  • xoops_module_install_notifications
  • xoops_module_install_page
  • xoops_module_install_pm
  • xoops_module_install_profile
  • xoops_module_install_publisher
  • xoops_module_install_smilies
  • xoops_module_install_system
  • xoops_module_install_userrank
  • xoops_module_install_xlanguage
  • xoops_module_pre_uninstall_comments
  • xoops_module_pre_uninstall_notifications
  • xoops_module_update_comments
  • xoops_module_update_debugbar
  • xoops_module_update_notifications
  • xoops_module_update_pm
  • xoops_module_update_profile
  • xoops_module_update_publisher
  • xoops_module_update_search
  • xoops_module_update_system
  • xoops_module_update_xlanguage
  • xoops_notification_deletebyitem
  • xoops_notification_deletebymodule
  • xoops_notification_deletebyuser
  • xoops_result
  • xoops_setActiveModules
  • xoops_setConfigOption
  • xoops_substr
  • xoops_template_clear_module_cache
  • xoops_template_touch
  • xoops_trim
  • xoops_utf8_encode
  • xoopseditor_get_rootpath
  • xoPassField
  • xoPhpVersion
  • Overview
  • Namespace
  • Class
  • Tree
  1: <?php
  2: 
  3: /*
  4: htmLawed 1.1.20, 9 June 2015
  5: OOP code, 9 June 2015
  6: Copyright Santosh Patnaik
  7: Dual LGPL v3 and GPL v2+ license
  8: A PHP Labware internal utility; www.bioinformatics.org/phplabware/internal_utilities/htmLawed
  9: 
 10: See htmLawed_README.txt/htm
 11: */
 12: 
 13: class htmLawed{
 14: // begin class
 15: public static function hl($t, $C=1, $S=array()){
 16: $C = is_array($C) ? $C : array();
 17: if(!empty($C['valid_xhtml'])){
 18:  $C['elements'] = empty($C['elements']) ? '*-center-dir-font-isindex-menu-s-strike-u' : $C['elements'];
 19:  $C['make_tag_strict'] = isset($C['make_tag_strict']) ? $C['make_tag_strict'] : 2;
 20:  $C['xml:lang'] = isset($C['xml:lang']) ? $C['xml:lang'] : 2;
 21: }
 22: // config eles
 23: $e = array('a'=>1, 'abbr'=>1, 'acronym'=>1, 'address'=>1, 'applet'=>1, 'area'=>1, 'b'=>1, 'bdo'=>1, 'big'=>1, 'blockquote'=>1, 'br'=>1, 'button'=>1, 'caption'=>1, 'center'=>1, 'cite'=>1, 'code'=>1, 'col'=>1, 'colgroup'=>1, 'dd'=>1, 'del'=>1, 'dfn'=>1, 'dir'=>1, 'div'=>1, 'dl'=>1, 'dt'=>1, 'em'=>1, 'embed'=>1, 'fieldset'=>1, 'font'=>1, 'form'=>1, 'h1'=>1, 'h2'=>1, 'h3'=>1, 'h4'=>1, 'h5'=>1, 'h6'=>1, 'hr'=>1, 'i'=>1, 'iframe'=>1, 'img'=>1, 'input'=>1, 'ins'=>1, 'isindex'=>1, 'kbd'=>1, 'label'=>1, 'legend'=>1, 'li'=>1, 'map'=>1, 'menu'=>1, 'noscript'=>1, 'object'=>1, 'ol'=>1, 'optgroup'=>1, 'option'=>1, 'p'=>1, 'param'=>1, 'pre'=>1, 'q'=>1, 'rb'=>1, 'rbc'=>1, 'rp'=>1, 'rt'=>1, 'rtc'=>1, 'ruby'=>1, 's'=>1, 'samp'=>1, 'script'=>1, 'select'=>1, 'small'=>1, 'span'=>1, 'strike'=>1, 'strong'=>1, 'sub'=>1, 'sup'=>1, 'table'=>1, 'tbody'=>1, 'td'=>1, 'textarea'=>1, 'tfoot'=>1, 'th'=>1, 'thead'=>1, 'tr'=>1, 'tt'=>1, 'u'=>1, 'ul'=>1, 'var'=>1); // 86/deprecated+embed+ruby
 24: if(!empty($C['safe'])){
 25:  unset($e['applet'], $e['embed'], $e['iframe'], $e['object'], $e['script']);
 26: }
 27: $x = !empty($C['elements']) ? str_replace(array("\n", "\r", "\t", ' '), '', $C['elements']) : '*';
 28: if($x == '-*'){$e = array();}
 29: elseif(strpos($x, '*') === false){$e = array_flip(explode(',', $x));}
 30: else{
 31:  if(isset($x[1])){
 32:   preg_match_all('`(?:^|-|\+)[^\-+]+?(?=-|\+|$)`', $x, $m, PREG_SET_ORDER);
 33:   for($i=count($m); --$i>=0;){$m[$i] = $m[$i][0];}
 34:   foreach($m as $v){
 35:    if($v[0] == '+'){$e[substr($v, 1)] = 1;}
 36:    if($v[0] == '-' && isset($e[($v = substr($v, 1))]) && !in_array('+'. $v, $m)){unset($e[$v]);}
 37:   }
 38:  }
 39: }
 40: $C['elements'] =& $e;
 41: // config attrs
 42: $x = !empty($C['deny_attribute']) ? str_replace(array("\n", "\r", "\t", ' '), '', $C['deny_attribute']) : '';
 43: $x = array_flip((isset($x[0]) && $x[0] == '*') ? explode('-', $x) : explode(',', $x. (!empty($C['safe']) ? ',on*' : '')));
 44: if(isset($x['on*'])){
 45:  unset($x['on*']);
 46:  $x += array('onblur'=>1, 'onchange'=>1, 'onclick'=>1, 'ondblclick'=>1, 'onfocus'=>1, 'onkeydown'=>1, 'onkeypress'=>1, 'onkeyup'=>1, 'onmousedown'=>1, 'onmousemove'=>1, 'onmouseout'=>1, 'onmouseover'=>1, 'onmouseup'=>1, 'onreset'=>1, 'onselect'=>1, 'onsubmit'=>1);
 47: }
 48: $C['deny_attribute'] = $x;
 49: // config URL
 50: $x = (isset($C['schemes'][2]) && strpos($C['schemes'], ':')) ? strtolower($C['schemes']) : 'href: aim, feed, file, ftp, gopher, http, https, irc, mailto, news, nntp, sftp, ssh, telnet; *:file, http, https';
 51: $C['schemes'] = array();
 52: foreach(explode(';', str_replace(array(' ', "\t", "\r", "\n"), '', $x)) as $v){
 53:  $x = $x2 = null; list($x, $x2) = explode(':', $v, 2);
 54:  if($x2){$C['schemes'][$x] = array_flip(explode(',', $x2));}
 55: }
 56: if(!isset($C['schemes']['*'])){$C['schemes']['*'] = array('file'=>1, 'http'=>1, 'https'=>1,);}
 57: if(!empty($C['safe']) && empty($C['schemes']['style'])){$C['schemes']['style'] = array('!'=>1);}
 58: $C['abs_url'] = isset($C['abs_url']) ? $C['abs_url'] : 0;
 59: if(!isset($C['base_url']) or !preg_match('`^[a-zA-Z\d.+\-]+://[^/]+/(.+?/)?$`', $C['base_url'])){
 60:  $C['base_url'] = $C['abs_url'] = 0;
 61: }
 62: // config rest
 63: $C['and_mark'] = empty($C['and_mark']) ? 0 : 1;
 64: $C['anti_link_spam'] = (isset($C['anti_link_spam']) && is_array($C['anti_link_spam']) && count($C['anti_link_spam']) == 2 && (empty($C['anti_link_spam'][0]) or htmLawed::hl_regex($C['anti_link_spam'][0])) && (empty($C['anti_link_spam'][1]) or htmLawed::hl_regex($C['anti_link_spam'][1]))) ? $C['anti_link_spam'] : 0;
 65: $C['anti_mail_spam'] = isset($C['anti_mail_spam']) ? $C['anti_mail_spam'] : 0;
 66: $C['balance'] = isset($C['balance']) ? (bool)$C['balance'] : 1;
 67: $C['cdata'] = isset($C['cdata']) ? $C['cdata'] : (empty($C['safe']) ? 3 : 0);
 68: $C['clean_ms_char'] = empty($C['clean_ms_char']) ? 0 : $C['clean_ms_char'];
 69: $C['comment'] = isset($C['comment']) ? $C['comment'] : (empty($C['safe']) ? 3 : 0);
 70: $C['css_expression'] = empty($C['css_expression']) ? 0 : 1;
 71: $C['direct_list_nest'] = empty($C['direct_list_nest']) ? 0 : 1;
 72: $C['hexdec_entity'] = isset($C['hexdec_entity']) ? $C['hexdec_entity'] : 1;
 73: $C['hook'] = (!empty($C['hook']) && function_exists($C['hook'])) ? $C['hook'] : 0;
 74: $C['hook_tag'] = (!empty($C['hook_tag']) && function_exists($C['hook_tag'])) ? $C['hook_tag'] : 0;
 75: $C['keep_bad'] = isset($C['keep_bad']) ? $C['keep_bad'] : 6;
 76: $C['lc_std_val'] = isset($C['lc_std_val']) ? (bool)$C['lc_std_val'] : 1;
 77: $C['make_tag_strict'] = isset($C['make_tag_strict']) ? $C['make_tag_strict'] : 1;
 78: $C['named_entity'] = isset($C['named_entity']) ? (bool)$C['named_entity'] : 1;
 79: $C['no_deprecated_attr'] = isset($C['no_deprecated_attr']) ? $C['no_deprecated_attr'] : 1;
 80: $C['parent'] = isset($C['parent'][0]) ? strtolower($C['parent']) : 'body';
 81: $C['show_setting'] = !empty($C['show_setting']) ? $C['show_setting'] : 0;
 82: $C['style_pass'] = empty($C['style_pass']) ? 0 : 1;
 83: $C['tidy'] = empty($C['tidy']) ? 0 : $C['tidy'];
 84: $C['unique_ids'] = isset($C['unique_ids']) ? $C['unique_ids'] : 1;
 85: $C['xml:lang'] = isset($C['xml:lang']) ? $C['xml:lang'] : 0;
 86: 
 87: if(isset($GLOBALS['C'])){$reC = $GLOBALS['C'];}
 88: $GLOBALS['C'] = $C;
 89: $S = is_array($S) ? $S : htmLawed::hl_spec($S);
 90: if(isset($GLOBALS['S'])){$reS = $GLOBALS['S'];}
 91: $GLOBALS['S'] = $S;
 92: 
 93: $t = preg_replace('`[\x00-\x08\x0b-\x0c\x0e-\x1f]`', '', $t);
 94: if($C['clean_ms_char']){
 95:  $x = array("\x7f"=>'', "\x80"=>'&#8364;', "\x81"=>'', "\x83"=>'&#402;', "\x85"=>'&#8230;', "\x86"=>'&#8224;', "\x87"=>'&#8225;', "\x88"=>'&#710;', "\x89"=>'&#8240;', "\x8a"=>'&#352;', "\x8b"=>'&#8249;', "\x8c"=>'&#338;', "\x8d"=>'', "\x8e"=>'&#381;', "\x8f"=>'', "\x90"=>'', "\x95"=>'&#8226;', "\x96"=>'&#8211;', "\x97"=>'&#8212;', "\x98"=>'&#732;', "\x99"=>'&#8482;', "\x9a"=>'&#353;', "\x9b"=>'&#8250;', "\x9c"=>'&#339;', "\x9d"=>'', "\x9e"=>'&#382;', "\x9f"=>'&#376;');
 96:  $x = $x + ($C['clean_ms_char'] == 1 ? array("\x82"=>'&#8218;', "\x84"=>'&#8222;', "\x91"=>'&#8216;', "\x92"=>'&#8217;', "\x93"=>'&#8220;', "\x94"=>'&#8221;') : array("\x82"=>'\'', "\x84"=>'"', "\x91"=>'\'', "\x92"=>'\'', "\x93"=>'"', "\x94"=>'"'));
 97:  $t = strtr($t, $x);
 98: }
 99: if($C['cdata'] or $C['comment']){$t = preg_replace_callback('`<!(?:(?:--.*?--)|(?:\[CDATA\[.*?\]\]))>`sm', 'htmLawed::hl_cmtcd', $t);}
100: $t = preg_replace_callback('`&amp;([A-Za-z][A-Za-z0-9]{1,30}|#(?:[0-9]{1,8}|[Xx][0-9A-Fa-f]{1,7}));`', 'htmLawed::hl_ent', str_replace('&', '&amp;', $t));
101: if($C['unique_ids'] && !isset($GLOBALS['hl_Ids'])){$GLOBALS['hl_Ids'] = array();}
102: if($C['hook']){$t = $C['hook']($t, $C, $S);}
103: if($C['show_setting'] && preg_match('`^[a-z][a-z0-9_]*$`i', $C['show_setting'])){
104:  $GLOBALS[$C['show_setting']] = array('config'=>$C, 'spec'=>$S, 'time'=>microtime());
105: }
106: // main
107: $t = preg_replace_callback('`<(?:(?:\s|$)|(?:[^>]*(?:>|$)))|>`m', 'htmLawed::hl_tag', $t);
108: $t = $C['balance'] ? htmLawed::hl_bal($t, $C['keep_bad'], $C['parent']) : $t;
109: $t = (($C['cdata'] or $C['comment']) && strpos($t, "\x01") !== false) ? str_replace(array("\x01", "\x02", "\x03", "\x04", "\x05"), array('', '', '&', '<', '>'), $t) : $t;
110: $t = $C['tidy'] ? htmLawed::hl_tidy($t, $C['tidy'], $C['parent']) : $t;
111: unset($C, $e);
112: if(isset($reC)){$GLOBALS['C'] = $reC;}
113: if(isset($reS)){$GLOBALS['S'] = $reS;}
114: return $t;
115: // eof
116: }
117: 
118: public static function hl_attrval($t, $p){
119: // check attr val against $S
120: $o = 1; $l = strlen($t);
121: foreach($p as $k=>$v){
122:  switch($k){
123:   case 'maxlen':if($l > $v){$o = 0;}
124:   break; case 'minlen': if($l < $v){$o = 0;}
125:   break; case 'maxval': if((float)($t) > $v){$o = 0;}
126:   break; case 'minval': if((float)($t) < $v){$o = 0;}
127:   break; case 'match': if(!preg_match($v, $t)){$o = 0;}
128:   break; case 'nomatch': if(preg_match($v, $t)){$o = 0;}
129:   break; case 'oneof':
130:    $m = 0;
131:    foreach(explode('|', $v) as $n){if($t == $n){$m = 1; break;}}
132:    $o = $m;
133:   break; case 'noneof':
134:    $m = 1;
135:    foreach(explode('|', $v) as $n){if($t == $n){$m = 0; break;}}
136:    $o = $m;
137:   break; default:
138:   break;
139:  }
140:  if(!$o){break;}
141: }
142: return ($o ? $t : (isset($p['default']) ? $p['default'] : 0));
143: // eof
144: }
145: 
146: public static function hl_bal($t, $do=1, $in='div'){
147: // balance tags
148: // by content
149: $cB = array('blockquote'=>1, 'form'=>1, 'map'=>1, 'noscript'=>1); // Block
150: $cE = array('area'=>1, 'br'=>1, 'col'=>1, 'embed'=>1, 'hr'=>1, 'img'=>1, 'input'=>1, 'isindex'=>1, 'param'=>1); // Empty
151: $cF = array('button'=>1, 'del'=>1, 'div'=>1, 'dd'=>1, 'fieldset'=>1, 'iframe'=>1, 'ins'=>1, 'li'=>1, 'noscript'=>1, 'object'=>1, 'td'=>1, 'th'=>1); // Flow; later context-wise dynamic move of ins & del to $cI
152: $cI = array('a'=>1, 'abbr'=>1, 'acronym'=>1, 'address'=>1, 'b'=>1, 'bdo'=>1, 'big'=>1, 'caption'=>1, 'cite'=>1, 'code'=>1, 'dfn'=>1, 'dt'=>1, 'em'=>1, 'font'=>1, 'h1'=>1, 'h2'=>1, 'h3'=>1, 'h4'=>1, 'h5'=>1, 'h6'=>1, 'i'=>1, 'kbd'=>1, 'label'=>1, 'legend'=>1, 'p'=>1, 'pre'=>1, 'q'=>1, 'rb'=>1, 'rt'=>1, 's'=>1, 'samp'=>1, 'small'=>1, 'span'=>1, 'strike'=>1, 'strong'=>1, 'sub'=>1, 'sup'=>1, 'tt'=>1, 'u'=>1, 'var'=>1); // Inline
153: $cN = array('a'=>array('a'=>1), 'button'=>array('a'=>1, 'button'=>1, 'fieldset'=>1, 'form'=>1, 'iframe'=>1, 'input'=>1, 'label'=>1, 'select'=>1, 'textarea'=>1), 'fieldset'=>array('fieldset'=>1), 'form'=>array('form'=>1), 'label'=>array('label'=>1), 'noscript'=>array('script'=>1), 'pre'=>array('big'=>1, 'font'=>1, 'img'=>1, 'object'=>1, 'script'=>1, 'small'=>1, 'sub'=>1, 'sup'=>1), 'rb'=>array('ruby'=>1), 'rt'=>array('ruby'=>1)); // Illegal
154: $cN2 = array_keys($cN);
155: $cR = array('blockquote'=>1, 'dir'=>1, 'dl'=>1, 'form'=>1, 'map'=>1, 'menu'=>1, 'noscript'=>1, 'ol'=>1, 'optgroup'=>1, 'rbc'=>1, 'rtc'=>1, 'ruby'=>1, 'select'=>1, 'table'=>1, 'tbody'=>1, 'tfoot'=>1, 'thead'=>1, 'tr'=>1, 'ul'=>1);
156: $cS = array('colgroup'=>array('col'=>1), 'dir'=>array('li'=>1), 'dl'=>array('dd'=>1, 'dt'=>1), 'menu'=>array('li'=>1), 'ol'=>array('li'=>1), 'optgroup'=>array('option'=>1), 'option'=>array('#pcdata'=>1), 'rbc'=>array('rb'=>1), 'rp'=>array('#pcdata'=>1), 'rtc'=>array('rt'=>1), 'ruby'=>array('rb'=>1, 'rbc'=>1, 'rp'=>1, 'rt'=>1, 'rtc'=>1), 'select'=>array('optgroup'=>1, 'option'=>1), 'script'=>array('#pcdata'=>1), 'table'=>array('caption'=>1, 'col'=>1, 'colgroup'=>1, 'tfoot'=>1, 'tbody'=>1, 'tr'=>1, 'thead'=>1), 'tbody'=>array('tr'=>1), 'tfoot'=>array('tr'=>1), 'textarea'=>array('#pcdata'=>1), 'thead'=>array('tr'=>1), 'tr'=>array('td'=>1, 'th'=>1), 'ul'=>array('li'=>1)); // Specific - immediate parent-child
157: if($GLOBALS['C']['direct_list_nest']){$cS['ol'] = $cS['ul'] += array('ol'=>1, 'ul'=>1);}
158: $cO = array('address'=>array('p'=>1), 'applet'=>array('param'=>1), 'blockquote'=>array('script'=>1), 'fieldset'=>array('legend'=>1, '#pcdata'=>1), 'form'=>array('script'=>1), 'map'=>array('area'=>1), 'object'=>array('param'=>1, 'embed'=>1)); // Other
159: $cT = array('colgroup'=>1, 'dd'=>1, 'dt'=>1, 'li'=>1, 'option'=>1, 'p'=>1, 'td'=>1, 'tfoot'=>1, 'th'=>1, 'thead'=>1, 'tr'=>1); // Omitable closing
160: // block/inline type; ins & del both type; #pcdata: text
161: $eB = array('address'=>1, 'blockquote'=>1, 'center'=>1, 'del'=>1, 'dir'=>1, 'dl'=>1, 'div'=>1, 'fieldset'=>1, 'form'=>1, 'ins'=>1, 'h1'=>1, 'h2'=>1, 'h3'=>1, 'h4'=>1, 'h5'=>1, 'h6'=>1, 'hr'=>1, 'isindex'=>1, 'menu'=>1, 'noscript'=>1, 'ol'=>1, 'p'=>1, 'pre'=>1, 'table'=>1, 'ul'=>1);
162: $eI = array('#pcdata'=>1, 'a'=>1, 'abbr'=>1, 'acronym'=>1, 'applet'=>1, 'b'=>1, 'bdo'=>1, 'big'=>1, 'br'=>1, 'button'=>1, 'cite'=>1, 'code'=>1, 'del'=>1, 'dfn'=>1, 'em'=>1, 'embed'=>1, 'font'=>1, 'i'=>1, 'iframe'=>1, 'img'=>1, 'input'=>1, 'ins'=>1, 'kbd'=>1, 'label'=>1, 'map'=>1, 'object'=>1, 'q'=>1, 'ruby'=>1, 's'=>1, 'samp'=>1, 'select'=>1, 'script'=>1, 'small'=>1, 'span'=>1, 'strike'=>1, 'strong'=>1, 'sub'=>1, 'sup'=>1, 'textarea'=>1, 'tt'=>1, 'u'=>1, 'var'=>1);
163: $eN = array('a'=>1, 'big'=>1, 'button'=>1, 'fieldset'=>1, 'font'=>1, 'form'=>1, 'iframe'=>1, 'img'=>1, 'input'=>1, 'label'=>1, 'object'=>1, 'ruby'=>1, 'script'=>1, 'select'=>1, 'small'=>1, 'sub'=>1, 'sup'=>1, 'textarea'=>1); // Exclude from specific ele; $cN values
164: $eO = array('area'=>1, 'caption'=>1, 'col'=>1, 'colgroup'=>1, 'dd'=>1, 'dt'=>1, 'legend'=>1, 'li'=>1, 'optgroup'=>1, 'option'=>1, 'param'=>1, 'rb'=>1, 'rbc'=>1, 'rp'=>1, 'rt'=>1, 'rtc'=>1, 'script'=>1, 'tbody'=>1, 'td'=>1, 'tfoot'=>1, 'thead'=>1, 'th'=>1, 'tr'=>1); // Missing in $eB & $eI
165: $eF = $eB + $eI;
166: 
167: // $in sets allowed child
168: $in = ((isset($eF[$in]) && $in != '#pcdata') or isset($eO[$in])) ? $in : 'div';
169: if(isset($cE[$in])){
170:  return (!$do ? '' : str_replace(array('<', '>'), array('&lt;', '&gt;'), $t));
171: }
172: if(isset($cS[$in])){$inOk = $cS[$in];}
173: elseif(isset($cI[$in])){$inOk = $eI; $cI['del'] = 1; $cI['ins'] = 1;}
174: elseif(isset($cF[$in])){$inOk = $eF; unset($cI['del'], $cI['ins']);}
175: elseif(isset($cB[$in])){$inOk = $eB; unset($cI['del'], $cI['ins']);}
176: if(isset($cO[$in])){$inOk = $inOk + $cO[$in];}
177: if(isset($cN[$in])){$inOk = array_diff_assoc($inOk, $cN[$in]);}
178: 
179: $t = explode('<', $t);
180: $ok = $q = array(); // $q seq list of open non-empty ele
181: ob_start();
182: 
183: for($i=-1, $ci=count($t); ++$i<$ci;){
184:  // allowed $ok in parent $p
185:  if($ql = count($q)){
186:   $p = array_pop($q);
187:   $q[] = $p;
188:   if(isset($cS[$p])){$ok = $cS[$p];}
189:   elseif(isset($cI[$p])){$ok = $eI; $cI['del'] = 1; $cI['ins'] = 1;}
190:   elseif(isset($cF[$p])){$ok = $eF; unset($cI['del'], $cI['ins']);}
191:   elseif(isset($cB[$p])){$ok = $eB; unset($cI['del'], $cI['ins']);}
192:   if(isset($cO[$p])){$ok = $ok + $cO[$p];}
193:   if(isset($cN[$p])){$ok = array_diff_assoc($ok, $cN[$p]);}
194:  }else{$ok = $inOk; unset($cI['del'], $cI['ins']);}
195:  // bad tags, & ele content
196:  if(isset($e) && ($do == 1 or (isset($ok['#pcdata']) && ($do == 3 or $do == 5)))){
197:   echo '&lt;', $s, $e, $a, '&gt;';
198:  }
199:  if(isset($x[0])){
200:   if(strlen(trim($x)) && (($ql && isset($cB[$p])) or (isset($cB[$in]) && !$ql))){
201:    echo '<div>', $x, '</div>';
202:   }
203:   elseif($do < 3 or isset($ok['#pcdata'])){echo $x;}
204:   elseif(strpos($x, "\x02\x04")){
205:    foreach(preg_split('`(\x01\x02[^\x01\x02]+\x02\x01)`', $x, -1, PREG_SPLIT_DELIM_CAPTURE | PREG_SPLIT_NO_EMPTY) as $v){
206:     echo (substr($v, 0, 2) == "\x01\x02" ? $v : ($do > 4 ? preg_replace('`\S`', '', $v) : ''));
207:    }
208:   }elseif($do > 4){echo preg_replace('`\S`', '', $x);}
209:  }
210:  // get markup
211:  if(!preg_match('`^(/?)([a-z1-6]+)([^>]*)>(.*)`sm', $t[$i], $r)){$x = $t[$i]; continue;}
212:  $s = null; $e = null; $a = null; $x = null; list($all, $s, $e, $a, $x) = $r;
213:  // close tag
214:  if($s){
215:   if(isset($cE[$e]) or !in_array($e, $q)){continue;} // Empty/unopen
216:   if($p == $e){array_pop($q); echo '</', $e, '>'; unset($e); continue;} // Last open
217:   $add = ''; // Nesting - close open tags that need to be
218:   for($j=-1, $cj=count($q); ++$j<$cj;){
219:    if(($d = array_pop($q)) == $e){break;}
220:    else{$add .= "</{$d}>";}
221:   }
222:   echo $add, '</', $e, '>'; unset($e); continue;
223:  }
224:  // open tag
225:  // $cB ele needs $eB ele as child
226:  if(isset($cB[$e]) && strlen(trim($x))){
227:   $t[$i] = "{$e}{$a}>";
228:   array_splice($t, $i+1, 0, 'div>'. $x); unset($e, $x); ++$ci; --$i; continue;
229:  }
230:  if((($ql && isset($cB[$p])) or (isset($cB[$in]) && !$ql)) && !isset($eB[$e]) && !isset($ok[$e])){
231:   array_splice($t, $i, 0, 'div>'); unset($e, $x); ++$ci; --$i; continue;
232:  }
233:  // if no open ele, $in = parent; mostly immediate parent-child relation should hold
234:  if(!$ql or !isset($eN[$e]) or !array_intersect($q, $cN2)){
235:   if(!isset($ok[$e])){
236:    if($ql && isset($cT[$p])){echo '</', array_pop($q), '>'; unset($e, $x); --$i;}
237:    continue;
238:   }
239:   if(!isset($cE[$e])){$q[] = $e;}
240:   echo '<', $e, $a, '>'; unset($e); continue;
241:  }
242:  // specific parent-child
243:  if(isset($cS[$p][$e])){
244:   if(!isset($cE[$e])){$q[] = $e;}
245:   echo '<', $e, $a, '>'; unset($e); continue;
246:  }
247:  // nesting
248:  $add = '';
249:  $q2 = array();
250:  for($k=-1, $kc=count($q); ++$k<$kc;){
251:   $d = $q[$k];
252:   $ok2 = array();
253:   if(isset($cS[$d])){$q2[] = $d; continue;}
254:   $ok2 = isset($cI[$d]) ? $eI : $eF;
255:   if(isset($cO[$d])){$ok2 = $ok2 + $cO[$d];}
256:   if(isset($cN[$d])){$ok2 = array_diff_assoc($ok2, $cN[$d]);}
257:   if(!isset($ok2[$e])){
258:    if(!$k && !isset($inOk[$e])){continue 2;}
259:    $add = "</{$d}>";
260:    for(;++$k<$kc;){$add = "</{$q[$k]}>{$add}";}
261:    break;
262:   }
263:   else{$q2[] = $d;}
264:  }
265:  $q = $q2;
266:  if(!isset($cE[$e])){$q[] = $e;}
267:  echo $add, '<', $e, $a, '>'; unset($e); continue;
268: }
269: 
270: // end
271: if($ql = count($q)){
272:  $p = array_pop($q);
273:  $q[] = $p;
274:  if(isset($cS[$p])){$ok = $cS[$p];}
275:  elseif(isset($cI[$p])){$ok = $eI; $cI['del'] = 1; $cI['ins'] = 1;}
276:  elseif(isset($cF[$p])){$ok = $eF; unset($cI['del'], $cI['ins']);}
277:  elseif(isset($cB[$p])){$ok = $eB; unset($cI['del'], $cI['ins']);}
278:  if(isset($cO[$p])){$ok = $ok + $cO[$p];}
279:  if(isset($cN[$p])){$ok = array_diff_assoc($ok, $cN[$p]);}
280: }else{$ok = $inOk; unset($cI['del'], $cI['ins']);}
281: if(isset($e) && ($do == 1 or (isset($ok['#pcdata']) && ($do == 3 or $do == 5)))){
282:  echo '&lt;', $s, $e, $a, '&gt;';
283: }
284: if(isset($x[0])){
285:  if(strlen(trim($x)) && (($ql && isset($cB[$p])) or (isset($cB[$in]) && !$ql))){
286:   echo '<div>', $x, '</div>';
287:  }
288:  elseif($do < 3 or isset($ok['#pcdata'])){echo $x;}
289:  elseif(strpos($x, "\x02\x04")){
290:   foreach(preg_split('`(\x01\x02[^\x01\x02]+\x02\x01)`', $x, -1, PREG_SPLIT_DELIM_CAPTURE | PREG_SPLIT_NO_EMPTY) as $v){
291:    echo (substr($v, 0, 2) == "\x01\x02" ? $v : ($do > 4 ? preg_replace('`\S`', '', $v) : ''));
292:   }
293:  }elseif($do > 4){echo preg_replace('`\S`', '', $x);}
294: }
295: while(!empty($q) && ($e = array_pop($q))){echo '</', $e, '>';}
296: $o = ob_get_contents();
297: ob_end_clean();
298: return $o;
299: // eof
300: }
301: 
302: public static function hl_cmtcd($t){
303: // comment/CDATA sec handler
304: $t = $t[0];
305: global $C;
306: if(!($v = $C[$n = $t[3] == '-' ? 'comment' : 'cdata'])){return $t;}
307: if($v == 1){return '';}
308: if($n == 'comment'){
309:  if(substr(($t = preg_replace('`--+`', '-', substr($t, 4, -3))), -1) != ' '){$t .= ' ';}
310: }
311: else{$t = substr($t, 1, -1);}
312: $t = $v == 2 ? str_replace(array('&', '<', '>'), array('&amp;', '&lt;', '&gt;'), $t) : $t;
313: return str_replace(array('&', '<', '>'), array("\x03", "\x04", "\x05"), ($n == 'comment' ? "\x01\x02\x04!--$t--\x05\x02\x01" : "\x01\x01\x04$t\x05\x01\x01"));
314: // eof
315: }
316: 
317: public static function hl_ent($t){
318: // entitity handler
319: global $C;
320: $t = $t[1];
321: static $U = array('quot'=>1,'amp'=>1,'lt'=>1,'gt'=>1);
322: static $N = array('fnof'=>'402', 'Alpha'=>'913', 'Beta'=>'914', 'Gamma'=>'915', 'Delta'=>'916', 'Epsilon'=>'917', 'Zeta'=>'918', 'Eta'=>'919', 'Theta'=>'920', 'Iota'=>'921', 'Kappa'=>'922', 'Lambda'=>'923', 'Mu'=>'924', 'Nu'=>'925', 'Xi'=>'926', 'Omicron'=>'927', 'Pi'=>'928', 'Rho'=>'929', 'Sigma'=>'931', 'Tau'=>'932', 'Upsilon'=>'933', 'Phi'=>'934', 'Chi'=>'935', 'Psi'=>'936', 'Omega'=>'937', 'alpha'=>'945', 'beta'=>'946', 'gamma'=>'947', 'delta'=>'948', 'epsilon'=>'949', 'zeta'=>'950', 'eta'=>'951', 'theta'=>'952', 'iota'=>'953', 'kappa'=>'954', 'lambda'=>'955', 'mu'=>'956', 'nu'=>'957', 'xi'=>'958', 'omicron'=>'959', 'pi'=>'960', 'rho'=>'961', 'sigmaf'=>'962', 'sigma'=>'963', 'tau'=>'964', 'upsilon'=>'965', 'phi'=>'966', 'chi'=>'967', 'psi'=>'968', 'omega'=>'969', 'thetasym'=>'977', 'upsih'=>'978', 'piv'=>'982', 'bull'=>'8226', 'hellip'=>'8230', 'prime'=>'8242', 'Prime'=>'8243', 'oline'=>'8254', 'frasl'=>'8260', 'weierp'=>'8472', 'image'=>'8465', 'real'=>'8476', 'trade'=>'8482', 'alefsym'=>'8501', 'larr'=>'8592', 'uarr'=>'8593', 'rarr'=>'8594', 'darr'=>'8595', 'harr'=>'8596', 'crarr'=>'8629', 'lArr'=>'8656', 'uArr'=>'8657', 'rArr'=>'8658', 'dArr'=>'8659', 'hArr'=>'8660', 'forall'=>'8704', 'part'=>'8706', 'exist'=>'8707', 'empty'=>'8709', 'nabla'=>'8711', 'isin'=>'8712', 'notin'=>'8713', 'ni'=>'8715', 'prod'=>'8719', 'sum'=>'8721', 'minus'=>'8722', 'lowast'=>'8727', 'radic'=>'8730', 'prop'=>'8733', 'infin'=>'8734', 'ang'=>'8736', 'and'=>'8743', 'or'=>'8744', 'cap'=>'8745', 'cup'=>'8746', 'int'=>'8747', 'there4'=>'8756', 'sim'=>'8764', 'cong'=>'8773', 'asymp'=>'8776', 'ne'=>'8800', 'equiv'=>'8801', 'le'=>'8804', 'ge'=>'8805', 'sub'=>'8834', 'sup'=>'8835', 'nsub'=>'8836', 'sube'=>'8838', 'supe'=>'8839', 'oplus'=>'8853', 'otimes'=>'8855', 'perp'=>'8869', 'sdot'=>'8901', 'lceil'=>'8968', 'rceil'=>'8969', 'lfloor'=>'8970', 'rfloor'=>'8971', 'lang'=>'9001', 'rang'=>'9002', 'loz'=>'9674', 'spades'=>'9824', 'clubs'=>'9827', 'hearts'=>'9829', 'diams'=>'9830', 'apos'=>'39',  'OElig'=>'338', 'oelig'=>'339', 'Scaron'=>'352', 'scaron'=>'353', 'Yuml'=>'376', 'circ'=>'710', 'tilde'=>'732', 'ensp'=>'8194', 'emsp'=>'8195', 'thinsp'=>'8201', 'zwnj'=>'8204', 'zwj'=>'8205', 'lrm'=>'8206', 'rlm'=>'8207', 'ndash'=>'8211', 'mdash'=>'8212', 'lsquo'=>'8216', 'rsquo'=>'8217', 'sbquo'=>'8218', 'ldquo'=>'8220', 'rdquo'=>'8221', 'bdquo'=>'8222', 'dagger'=>'8224', 'Dagger'=>'8225', 'permil'=>'8240', 'lsaquo'=>'8249', 'rsaquo'=>'8250', 'euro'=>'8364', 'nbsp'=>'160', 'iexcl'=>'161', 'cent'=>'162', 'pound'=>'163', 'curren'=>'164', 'yen'=>'165', 'brvbar'=>'166', 'sect'=>'167', 'uml'=>'168', 'copy'=>'169', 'ordf'=>'170', 'laquo'=>'171', 'not'=>'172', 'shy'=>'173', 'reg'=>'174', 'macr'=>'175', 'deg'=>'176', 'plusmn'=>'177', 'sup2'=>'178', 'sup3'=>'179', 'acute'=>'180', 'micro'=>'181', 'para'=>'182', 'middot'=>'183', 'cedil'=>'184', 'sup1'=>'185', 'ordm'=>'186', 'raquo'=>'187', 'frac14'=>'188', 'frac12'=>'189', 'frac34'=>'190', 'iquest'=>'191', 'Agrave'=>'192', 'Aacute'=>'193', 'Acirc'=>'194', 'Atilde'=>'195', 'Auml'=>'196', 'Aring'=>'197', 'AElig'=>'198', 'Ccedil'=>'199', 'Egrave'=>'200', 'Eacute'=>'201', 'Ecirc'=>'202', 'Euml'=>'203', 'Igrave'=>'204', 'Iacute'=>'205', 'Icirc'=>'206', 'Iuml'=>'207', 'ETH'=>'208', 'Ntilde'=>'209', 'Ograve'=>'210', 'Oacute'=>'211', 'Ocirc'=>'212', 'Otilde'=>'213', 'Ouml'=>'214', 'times'=>'215', 'Oslash'=>'216', 'Ugrave'=>'217', 'Uacute'=>'218', 'Ucirc'=>'219', 'Uuml'=>'220', 'Yacute'=>'221', 'THORN'=>'222', 'szlig'=>'223', 'agrave'=>'224', 'aacute'=>'225', 'acirc'=>'226', 'atilde'=>'227', 'auml'=>'228', 'aring'=>'229', 'aelig'=>'230', 'ccedil'=>'231', 'egrave'=>'232', 'eacute'=>'233', 'ecirc'=>'234', 'euml'=>'235', 'igrave'=>'236', 'iacute'=>'237', 'icirc'=>'238', 'iuml'=>'239', 'eth'=>'240', 'ntilde'=>'241', 'ograve'=>'242', 'oacute'=>'243', 'ocirc'=>'244', 'otilde'=>'245', 'ouml'=>'246', 'divide'=>'247', 'oslash'=>'248', 'ugrave'=>'249', 'uacute'=>'250', 'ucirc'=>'251', 'uuml'=>'252', 'yacute'=>'253', 'thorn'=>'254', 'yuml'=>'255');
323: if($t[0] != '#'){
324:  return ($C['and_mark'] ? "\x06" : '&'). (isset($U[$t]) ? $t : (isset($N[$t]) ? (!$C['named_entity'] ? '#'. ($C['hexdec_entity'] > 1 ? 'x'. dechex($N[$t]) : $N[$t]) : $t) : 'amp;'. $t)). ';';
325: }
326: if(($n = ctype_digit($t = substr($t, 1)) ? intval($t) : hexdec(substr($t, 1))) < 9 or ($n > 13 && $n < 32) or $n == 11 or $n == 12 or ($n > 126 && $n < 160 && $n != 133) or ($n > 55295 && ($n < 57344 or ($n > 64975 && $n < 64992) or $n == 65534 or $n == 65535 or $n > 1114111))){
327:  return ($C['and_mark'] ? "\x06" : '&'). "amp;#{$t};";
328: }
329: return ($C['and_mark'] ? "\x06" : '&'). '#'. (((ctype_digit($t) && $C['hexdec_entity'] < 2) or !$C['hexdec_entity']) ? $n : 'x'. dechex($n)). ';';
330: // eof
331: }
332: 
333: public static function hl_prot($p, $c=null){
334: // check URL scheme
335: global $C;
336: $b = $a = '';
337: if($c == null){$c = 'style'; $b = $p[1]; $a = $p[3]; $p = trim($p[2]);}
338: $c = isset($C['schemes'][$c]) ? $C['schemes'][$c] : $C['schemes']['*'];
339: static $d = 'denied:';
340: if(isset($c['!']) && substr($p, 0, 7) != $d){$p = "$d$p";}
341: if(isset($c['*']) or !strcspn($p, '#?;') or (substr($p, 0, 7) == $d)){return "{$b}{$p}{$a}";} // All ok, frag, query, param
342: if(preg_match('`^([^:?[@!$()*,=/\'\]]+?)(:|&#(58|x3a);|%3a|\\\\0{0,4}3a).`i', $p, $m) && !isset($c[strtolower($m[1])])){ // Denied prot
343:  return "{$b}{$d}{$p}{$a}";
344: }
345: if($C['abs_url']){
346:  if($C['abs_url'] == -1 && strpos($p, $C['base_url']) === 0){ // Make url rel
347:   $p = substr($p, strlen($C['base_url']));
348:  }elseif(empty($m[1])){ // Make URL abs
349:   if(substr($p, 0, 2) == '//'){$p = substr($C['base_url'], 0, strpos($C['base_url'], ':')+1). $p;}
350:   elseif($p[0] == '/'){$p = preg_replace('`(^.+?://[^/]+)(.*)`', '$1', $C['base_url']). $p;}
351:   elseif(strcspn($p, './')){$p = $C['base_url']. $p;}
352:   else{
353:    preg_match('`^([a-zA-Z\d\-+.]+://[^/]+)(.*)`', $C['base_url'], $m);
354:    $p = preg_replace('`(?<=/)\./`', '', $m[2]. $p);
355:    while(preg_match('`(?<=/)([^/]{3,}|[^/.]+?|\.[^/.]|[^/.]\.)/\.\./`', $p)){
356:     $p = preg_replace('`(?<=/)([^/]{3,}|[^/.]+?|\.[^/.]|[^/.]\.)/\.\./`', '', $p);
357:    }
358:    $p = $m[1]. $p;
359:   }
360:  }
361: }
362: return "{$b}{$p}{$a}";
363: // eof
364: }
365: 
366: public static function hl_regex($p){
367: // ?regex
368: if(empty($p)){return 0;}
369: if($t = ini_get('track_errors')){$o = isset($php_errormsg) ? $php_errormsg : null;}
370: else{ini_set('track_errors', 1);}
371: unset($php_errormsg);
372: if(($d = ini_get('display_errors'))){ini_set('display_errors', 0);}
373: preg_match($p, '');
374: if($d){ini_set('display_errors', 1);}
375: $r = isset($php_errormsg) ? 0 : 1;
376: if($t){$php_errormsg = isset($o) ? $o : null;}
377: else{ini_set('track_errors', 0);}
378: return $r;
379: // eof
380: }
381: 
382: public static function hl_spec($t){
383: // final $spec
384: $s = array();
385: $t = str_replace(array("\t", "\r", "\n", ' '), '', preg_replace_callback('/"(?>(`.|[^"])*)"/sm', create_function('$m', 'return substr(str_replace(array(";", "|", "~", " ", ",", "/", "(", ")", \'`"\'), array("\x01", "\x02", "\x03", "\x04", "\x05", "\x06", "\x07", "\x08", "\""), $m[0]), 1, -1);'), trim($t))); 
386: for($i = count(($t = explode(';', $t))); --$i>=0;){
387:  $w = $t[$i];
388:  if(empty($w) or ($e = strpos($w, '=')) === false or !strlen(($a =  substr($w, $e+1)))){continue;}
389:  $y = $n = array();
390:  foreach(explode(',', $a) as $v){
391:   if(!preg_match('`^([a-z:\-\*]+)(?:\((.*?)\))?`i', $v, $m)){continue;}
392:   if(($x = strtolower($m[1])) == '-*'){$n['*'] = 1; continue;}
393:   if($x[0] == '-'){$n[substr($x, 1)] = 1; continue;}
394:   if(!isset($m[2])){$y[$x] = 1; continue;}
395:   foreach(explode('/', $m[2]) as $m){
396:    if(empty($m) or ($p = strpos($m, '=')) == 0 or $p < 5){$y[$x] = 1; continue;}
397:    $y[$x][strtolower(substr($m, 0, $p))] = str_replace(array("\x01", "\x02", "\x03", "\x04", "\x05", "\x06", "\x07", "\x08"), array(";", "|", "~", " ", ",", "/", "(", ")"), substr($m, $p+1));
398:   }
399:   if(isset($y[$x]['match']) && !htmLawed::hl_regex($y[$x]['match'])){unset($y[$x]['match']);}
400:   if(isset($y[$x]['nomatch']) && !htmLawed::hl_regex($y[$x]['nomatch'])){unset($y[$x]['nomatch']);}
401:  }
402:  if(!count($y) && !count($n)){continue;}
403:  foreach(explode(',', substr($w, 0, $e)) as $v){
404:   if(!strlen(($v = strtolower($v)))){continue;}
405:   if(count($y)){$s[$v] = $y;}
406:   if(count($n)){$s[$v]['n'] = $n;}
407:  }
408: }
409: return $s;
410: // eof
411: }
412: 
413: public static function hl_tag($t){
414: // tag/attribute handler
415: global $C;
416: $t = $t[0];
417: // invalid < >
418: if($t == '< '){return '&lt; ';}
419: if($t == '>'){return '&gt;';}
420: if(!preg_match('`^<(/?)([a-zA-Z][a-zA-Z1-6]*)([^>]*?)\s?>$`m', $t, $m)){
421:  return str_replace(array('<', '>'), array('&lt;', '&gt;'), $t);
422: }elseif(!isset($C['elements'][($e = strtolower($m[2]))])){
423:  return (($C['keep_bad']%2) ? str_replace(array('<', '>'), array('&lt;', '&gt;'), $t) : '');
424: }
425: // attr string
426: $a = str_replace(array("\n", "\r", "\t"), ' ', trim($m[3]));
427: // tag transform
428: static $eD = array('applet'=>1, 'center'=>1, 'dir'=>1, 'embed'=>1, 'font'=>1, 'isindex'=>1, 'menu'=>1, 's'=>1, 'strike'=>1, 'u'=>1); // Deprecated
429: if($C['make_tag_strict'] && isset($eD[$e])){
430:  $trt = htmLawed::hl_tag2($e, $a, $C['make_tag_strict']);
431:  if(!$e){return (($C['keep_bad']%2) ? str_replace(array('<', '>'), array('&lt;', '&gt;'), $t) : '');}
432: }
433: // close tag
434: static $eE = array('area'=>1, 'br'=>1, 'col'=>1, 'embed'=>1, 'hr'=>1, 'img'=>1, 'input'=>1, 'isindex'=>1, 'param'=>1); // Empty ele
435: if(!empty($m[1])){
436:  return (!isset($eE[$e]) ? (empty($C['hook_tag']) ? "</$e>" : $C['hook_tag']($e)) : (($C['keep_bad'])%2 ? str_replace(array('<', '>'), array('&lt;', '&gt;'), $t) : ''));
437: }
438: 
439: // open tag & attr
440: static $aN = array('abbr'=>array('td'=>1, 'th'=>1), 'accept-charset'=>array('form'=>1), 'accept'=>array('form'=>1, 'input'=>1), 'accesskey'=>array('a'=>1, 'area'=>1, 'button'=>1, 'input'=>1, 'label'=>1, 'legend'=>1, 'textarea'=>1), 'action'=>array('form'=>1), 'align'=>array('caption'=>1, 'embed'=>1, 'applet'=>1, 'iframe'=>1, 'img'=>1, 'input'=>1, 'object'=>1, 'legend'=>1, 'table'=>1, 'hr'=>1, 'div'=>1, 'h1'=>1, 'h2'=>1, 'h3'=>1, 'h4'=>1, 'h5'=>1, 'h6'=>1, 'p'=>1, 'col'=>1, 'colgroup'=>1, 'tbody'=>1, 'td'=>1, 'tfoot'=>1, 'th'=>1, 'thead'=>1, 'tr'=>1), 'allowfullscreen'=>array('iframe'=>1), 'alt'=>array('applet'=>1, 'area'=>1, 'img'=>1, 'input'=>1), 'archive'=>array('applet'=>1, 'object'=>1), 'axis'=>array('td'=>1, 'th'=>1), 'bgcolor'=>array('embed'=>1, 'table'=>1, 'tr'=>1, 'td'=>1, 'th'=>1), 'border'=>array('table'=>1, 'img'=>1, 'object'=>1), 'bordercolor'=>array('table'=>1, 'td'=>1, 'tr'=>1), 'cellpadding'=>array('table'=>1), 'cellspacing'=>array('table'=>1), 'char'=>array('col'=>1, 'colgroup'=>1, 'tbody'=>1, 'td'=>1, 'tfoot'=>1, 'th'=>1, 'thead'=>1, 'tr'=>1), 'charoff'=>array('col'=>1, 'colgroup'=>1, 'tbody'=>1, 'td'=>1, 'tfoot'=>1, 'th'=>1, 'thead'=>1, 'tr'=>1), 'charset'=>array('a'=>1, 'script'=>1), 'checked'=>array('input'=>1), 'cite'=>array('blockquote'=>1, 'q'=>1, 'del'=>1, 'ins'=>1), 'classid'=>array('object'=>1), 'clear'=>array('br'=>1), 'code'=>array('applet'=>1), 'codebase'=>array('object'=>1, 'applet'=>1), 'codetype'=>array('object'=>1), 'color'=>array('font'=>1), 'cols'=>array('textarea'=>1), 'colspan'=>array('td'=>1, 'th'=>1), 'compact'=>array('dir'=>1, 'dl'=>1, 'menu'=>1, 'ol'=>1, 'ul'=>1), 'coords'=>array('area'=>1, 'a'=>1), 'data'=>array('object'=>1), 'datetime'=>array('del'=>1, 'ins'=>1), 'declare'=>array('object'=>1), 'defer'=>array('script'=>1), 'dir'=>array('bdo'=>1), 'disabled'=>array('button'=>1, 'input'=>1, 'optgroup'=>1, 'option'=>1, 'select'=>1, 'textarea'=>1), 'enctype'=>array('form'=>1), 'face'=>array('font'=>1), 'for'=>array('label'=>1), 'frame'=>array('table'=>1), 'frameborder'=>array('iframe'=>1), 'headers'=>array('td'=>1, 'th'=>1), 'height'=>array('embed'=>1, 'iframe'=>1, 'td'=>1, 'th'=>1, 'img'=>1, 'object'=>1, 'applet'=>1), 'href'=>array('a'=>1, 'area'=>1), 'hreflang'=>array('a'=>1), 'hspace'=>array('applet'=>1, 'img'=>1, 'object'=>1), 'ismap'=>array('img'=>1, 'input'=>1), 'label'=>array('option'=>1, 'optgroup'=>1), 'language'=>array('script'=>1), 'longdesc'=>array('img'=>1, 'iframe'=>1), 'marginheight'=>array('iframe'=>1), 'marginwidth'=>array('iframe'=>1), 'maxlength'=>array('input'=>1), 'method'=>array('form'=>1), 'model'=>array('embed'=>1), 'multiple'=>array('select'=>1), 'name'=>array('button'=>1, 'embed'=>1, 'textarea'=>1, 'applet'=>1, 'select'=>1, 'form'=>1, 'iframe'=>1, 'img'=>1, 'a'=>1, 'input'=>1, 'object'=>1, 'map'=>1, 'param'=>1), 'nohref'=>array('area'=>1), 'noshade'=>array('hr'=>1), 'nowrap'=>array('td'=>1, 'th'=>1), 'object'=>array('applet'=>1), 'onblur'=>array('a'=>1, 'area'=>1, 'button'=>1, 'input'=>1, 'label'=>1, 'select'=>1, 'textarea'=>1), 'onchange'=>array('input'=>1, 'select'=>1, 'textarea'=>1), 'onfocus'=>array('a'=>1, 'area'=>1, 'button'=>1, 'input'=>1, 'label'=>1, 'select'=>1, 'textarea'=>1), 'onreset'=>array('form'=>1), 'onselect'=>array('input'=>1, 'textarea'=>1), 'onsubmit'=>array('form'=>1), 'pluginspage'=>array('embed'=>1), 'pluginurl'=>array('embed'=>1), 'prompt'=>array('isindex'=>1), 'readonly'=>array('textarea'=>1, 'input'=>1), 'rel'=>array('a'=>1), 'rev'=>array('a'=>1), 'rows'=>array('textarea'=>1), 'rowspan'=>array('td'=>1, 'th'=>1), 'rules'=>array('table'=>1), 'scope'=>array('td'=>1, 'th'=>1), 'scrolling'=>array('iframe'=>1), 'selected'=>array('option'=>1), 'shape'=>array('area'=>1, 'a'=>1), 'size'=>array('hr'=>1, 'font'=>1, 'input'=>1, 'select'=>1), 'span'=>array('col'=>1, 'colgroup'=>1), 'src'=>array('embed'=>1, 'script'=>1, 'input'=>1, 'iframe'=>1, 'img'=>1), 'standby'=>array('object'=>1), 'start'=>array('ol'=>1), 'summary'=>array('table'=>1), 'tabindex'=>array('a'=>1, 'area'=>1, 'button'=>1, 'input'=>1, 'object'=>1, 'select'=>1, 'textarea'=>1), 'target'=>array('a'=>1, 'area'=>1, 'form'=>1), 'type'=>array('a'=>1, 'embed'=>1, 'object'=>1, 'param'=>1, 'script'=>1, 'input'=>1, 'li'=>1, 'ol'=>1, 'ul'=>1, 'button'=>1), 'usemap'=>array('img'=>1, 'input'=>1, 'object'=>1), 'valign'=>array('col'=>1, 'colgroup'=>1, 'tbody'=>1, 'td'=>1, 'tfoot'=>1, 'th'=>1, 'thead'=>1, 'tr'=>1), 'value'=>array('input'=>1, 'option'=>1, 'param'=>1, 'button'=>1, 'li'=>1), 'valuetype'=>array('param'=>1), 'vspace'=>array('applet'=>1, 'img'=>1, 'object'=>1), 'width'=>array('embed'=>1, 'hr'=>1, 'iframe'=>1, 'img'=>1, 'object'=>1, 'table'=>1, 'td'=>1, 'th'=>1, 'applet'=>1, 'col'=>1, 'colgroup'=>1, 'pre'=>1), 'wmode'=>array('embed'=>1), 'xml:space'=>array('pre'=>1, 'script'=>1, 'style'=>1)); // Ele-specific
441: static $aNE = array('checked'=>1, 'compact'=>1, 'declare'=>1, 'defer'=>1, 'disabled'=>1, 'ismap'=>1, 'multiple'=>1, 'nohref'=>1, 'noresize'=>1, 'noshade'=>1, 'nowrap'=>1, 'readonly'=>1, 'selected'=>1); // Empty
442: static $aNP = array('action'=>1, 'cite'=>1, 'classid'=>1, 'codebase'=>1, 'data'=>1, 'href'=>1, 'longdesc'=>1, 'model'=>1, 'pluginspage'=>1, 'pluginurl'=>1, 'usemap'=>1); // Need scheme check; excludes style, on* & src
443: static $aNU = array('class'=>array('param'=>1, 'script'=>1), 'dir'=>array('applet'=>1, 'bdo'=>1, 'br'=>1, 'iframe'=>1, 'param'=>1, 'script'=>1), 'id'=>array('script'=>1), 'lang'=>array('applet'=>1, 'br'=>1, 'iframe'=>1, 'param'=>1, 'script'=>1), 'xml:lang'=>array('applet'=>1, 'br'=>1, 'iframe'=>1, 'param'=>1, 'script'=>1), 'onclick'=>array('applet'=>1, 'bdo'=>1, 'br'=>1, 'font'=>1, 'iframe'=>1, 'isindex'=>1, 'param'=>1, 'script'=>1), 'ondblclick'=>array('applet'=>1, 'bdo'=>1, 'br'=>1, 'font'=>1, 'iframe'=>1, 'isindex'=>1, 'param'=>1, 'script'=>1), 'onkeydown'=>array('applet'=>1, 'bdo'=>1, 'br'=>1, 'font'=>1, 'iframe'=>1, 'isindex'=>1, 'param'=>1, 'script'=>1), 'onkeypress'=>array('applet'=>1, 'bdo'=>1, 'br'=>1, 'font'=>1, 'iframe'=>1, 'isindex'=>1, 'param'=>1, 'script'=>1), 'onkeyup'=>array('applet'=>1, 'bdo'=>1, 'br'=>1, 'font'=>1, 'iframe'=>1, 'isindex'=>1, 'param'=>1, 'script'=>1), 'onmousedown'=>array('applet'=>1, 'bdo'=>1, 'br'=>1, 'font'=>1, 'iframe'=>1, 'isindex'=>1, 'param'=>1, 'script'=>1), 'onmousemove'=>array('applet'=>1, 'bdo'=>1, 'br'=>1, 'font'=>1, 'iframe'=>1, 'isindex'=>1, 'param'=>1, 'script'=>1), 'onmouseout'=>array('applet'=>1, 'bdo'=>1, 'br'=>1, 'font'=>1, 'iframe'=>1, 'isindex'=>1, 'param'=>1, 'script'=>1), 'onmouseover'=>array('applet'=>1, 'bdo'=>1, 'br'=>1, 'font'=>1, 'iframe'=>1, 'isindex'=>1, 'param'=>1, 'script'=>1), 'onmouseup'=>array('applet'=>1, 'bdo'=>1, 'br'=>1, 'font'=>1, 'iframe'=>1, 'isindex'=>1, 'param'=>1, 'script'=>1), 'style'=>array('param'=>1, 'script'=>1), 'title'=>array('param'=>1, 'script'=>1)); // Univ & exceptions
444: 
445: if($C['lc_std_val']){
446:  // predef attr vals for $eAL & $aNE ele
447:  static $aNL = array('all'=>1, 'baseline'=>1, 'bottom'=>1, 'button'=>1, 'center'=>1, 'char'=>1, 'checkbox'=>1, 'circle'=>1, 'col'=>1, 'colgroup'=>1, 'cols'=>1, 'data'=>1, 'default'=>1, 'file'=>1, 'get'=>1, 'groups'=>1, 'hidden'=>1, 'image'=>1, 'justify'=>1, 'left'=>1, 'ltr'=>1, 'middle'=>1, 'none'=>1, 'object'=>1, 'password'=>1, 'poly'=>1, 'post'=>1, 'preserve'=>1, 'radio'=>1, 'rect'=>1, 'ref'=>1, 'reset'=>1, 'right'=>1, 'row'=>1, 'rowgroup'=>1, 'rows'=>1, 'rtl'=>1, 'submit'=>1, 'text'=>1, 'top'=>1);
448:  static $eAL = array('a'=>1, 'area'=>1, 'bdo'=>1, 'button'=>1, 'col'=>1, 'form'=>1, 'img'=>1, 'input'=>1, 'object'=>1, 'optgroup'=>1, 'option'=>1, 'param'=>1, 'script'=>1, 'select'=>1, 'table'=>1, 'td'=>1, 'tfoot'=>1, 'th'=>1, 'thead'=>1, 'tr'=>1, 'xml:space'=>1);
449:  $lcase = isset($eAL[$e]) ? 1 : 0;
450: }
451: 
452: $depTr = 0;
453: if($C['no_deprecated_attr']){
454:  // dep attr:applicable ele
455:  static $aND = array('align'=>array('caption'=>1, 'div'=>1, 'h1'=>1, 'h2'=>1, 'h3'=>1, 'h4'=>1, 'h5'=>1, 'h6'=>1, 'hr'=>1, 'img'=>1, 'input'=>1, 'legend'=>1, 'object'=>1, 'p'=>1, 'table'=>1), 'bgcolor'=>array('table'=>1, 'td'=>1, 'th'=>1, 'tr'=>1), 'border'=>array('img'=>1, 'object'=>1), 'bordercolor'=>array('table'=>1, 'td'=>1, 'tr'=>1), 'clear'=>array('br'=>1), 'compact'=>array('dl'=>1, 'ol'=>1, 'ul'=>1), 'height'=>array('td'=>1, 'th'=>1), 'hspace'=>array('img'=>1, 'object'=>1), 'language'=>array('script'=>1), 'name'=>array('a'=>1, 'form'=>1, 'iframe'=>1, 'img'=>1, 'map'=>1), 'noshade'=>array('hr'=>1), 'nowrap'=>array('td'=>1, 'th'=>1), 'size'=>array('hr'=>1), 'start'=>array('ol'=>1), 'type'=>array('li'=>1, 'ol'=>1, 'ul'=>1), 'value'=>array('li'=>1), 'vspace'=>array('img'=>1, 'object'=>1), 'width'=>array('hr'=>1, 'pre'=>1, 'td'=>1, 'th'=>1));
456:  static $eAD = array('a'=>1, 'br'=>1, 'caption'=>1, 'div'=>1, 'dl'=>1, 'form'=>1, 'h1'=>1, 'h2'=>1, 'h3'=>1, 'h4'=>1, 'h5'=>1, 'h6'=>1, 'hr'=>1, 'iframe'=>1, 'img'=>1, 'input'=>1, 'legend'=>1, 'li'=>1, 'map'=>1, 'object'=>1, 'ol'=>1, 'p'=>1, 'pre'=>1, 'script'=>1, 'table'=>1, 'td'=>1, 'th'=>1, 'tr'=>1, 'ul'=>1);
457:  $depTr = isset($eAD[$e]) ? 1 : 0;
458: }
459: 
460: // attr name-vals
461: if(strpos($a, "\x01") !== false){$a = preg_replace('`\x01[^\x01]*\x01`', '', $a);} // No comment/CDATA sec
462: $mode = 0; $a = trim($a, ' /'); $aA = array();
463: while(strlen($a)){
464:  $w = 0;
465:  switch($mode){
466:   case 0: // Name
467:    if(preg_match('`^[a-zA-Z][\-a-zA-Z:]+`', $a, $m)){
468:     $nm = strtolower($m[0]);
469:     $w = $mode = 1; $a = ltrim(substr_replace($a, '', 0, strlen($m[0])));
470:    }
471:   break; case 1:
472:    if($a[0] == '='){ // =
473:     $w = 1; $mode = 2; $a = ltrim($a, '= ');
474:    }else{ // No val
475:     $w = 1; $mode = 0; $a = ltrim($a);
476:     $aA[$nm] = '';
477:    }
478:   break; case 2: // Val
479:    if(preg_match('`^((?:"[^"]*")|(?:\'[^\']*\')|(?:\s*[^\s"\']+))(.*)`', $a, $m)){
480:     $a = ltrim($m[2]); $m = $m[1]; $w = 1; $mode = 0;
481:     $aA[$nm] = trim(str_replace('<', '&lt;', ($m[0] == '"' or $m[0] == '\'') ? substr($m, 1, -1) : $m));
482:    }
483:   break;
484:  }
485:  if($w == 0){ // Parse errs, deal with space, " & '
486:   $a = preg_replace('`^(?:"[^"]*("|$)|\'[^\']*(\'|$)|\S)*\s*`', '', $a);
487:   $mode = 0;
488:  }
489: }
490: if($mode == 1){$aA[$nm] = '';}
491: 
492: // clean attrs
493: global $S;
494: $rl = isset($S[$e]) ? $S[$e] : array();
495: $a = array(); $nfr = 0;
496: foreach($aA as $k=>$v){
497:  if(((isset($C['deny_attribute']['*']) ? isset($C['deny_attribute'][$k]) : !isset($C['deny_attribute'][$k])) && (isset($aN[$k][$e]) or (isset($aNU[$k]) && !isset($aNU[$k][$e]))) && !isset($rl['n'][$k]) && !isset($rl['n']['*'])) or isset($rl[$k])){
498:   if(isset($aNE[$k])){$v = $k;}
499:   elseif(!empty($lcase) && (($e != 'button' or $e != 'input') or $k == 'type')){ // Rather loose but ?not cause issues
500:    $v = (isset($aNL[($v2 = strtolower($v))])) ? $v2 : $v;
501:   }
502:   if($k == 'style' && !$C['style_pass']){
503:    if(false !== strpos($v, '&#')){
504:     static $sC = array('&#x20;'=>' ', '&#32;'=>' ', '&#x45;'=>'e', '&#69;'=>'e', '&#x65;'=>'e', '&#101;'=>'e', '&#x58;'=>'x', '&#88;'=>'x', '&#x78;'=>'x', '&#120;'=>'x', '&#x50;'=>'p', '&#80;'=>'p', '&#x70;'=>'p', '&#112;'=>'p', '&#x53;'=>'s', '&#83;'=>'s', '&#x73;'=>'s', '&#115;'=>'s', '&#x49;'=>'i', '&#73;'=>'i', '&#x69;'=>'i', '&#105;'=>'i', '&#x4f;'=>'o', '&#79;'=>'o', '&#x6f;'=>'o', '&#111;'=>'o', '&#x4e;'=>'n', '&#78;'=>'n', '&#x6e;'=>'n', '&#110;'=>'n', '&#x55;'=>'u', '&#85;'=>'u', '&#x75;'=>'u', '&#117;'=>'u', '&#x52;'=>'r', '&#82;'=>'r', '&#x72;'=>'r', '&#114;'=>'r', '&#x4c;'=>'l', '&#76;'=>'l', '&#x6c;'=>'l', '&#108;'=>'l', '&#x28;'=>'(', '&#40;'=>'(', '&#x29;'=>')', '&#41;'=>')', '&#x20;'=>':', '&#32;'=>':', '&#x22;'=>'"', '&#34;'=>'"', '&#x27;'=>"'", '&#39;'=>"'", '&#x2f;'=>'/', '&#47;'=>'/', '&#x2a;'=>'*', '&#42;'=>'*', '&#x5c;'=>'\\', '&#92;'=>'\\');
505:     $v = strtr($v, $sC);
506:    }
507:    $v = preg_replace_callback('`(url(?:\()(?: )*(?:\'|"|&(?:quot|apos);)?)(.+?)((?:\'|"|&(?:quot|apos);)?(?: )*(?:\)))`iS', 'htmLawed::hl_prot', $v);
508:    $v = !$C['css_expression'] ? preg_replace('`expression`i', ' ', preg_replace('`\\\\\S|(/|(%2f))(\*|(%2a))`i', ' ', $v)) : $v;
509:   }elseif(isset($aNP[$k]) or strpos($k, 'src') !== false or $k[0] == 'o'){
510:    $v = str_replace("­", ' ', (strpos($v, '&') !== false ? str_replace(array('&#xad;', '&#173;', '&shy;'), ' ', $v) : $v)); # double-quoted char is soft-hyphen; appears here as "­" or hyphen or something else depending on viewing software
511:    $v = htmLawed::hl_prot($v, $k);
512:    if($k == 'href'){ // X-spam
513:     if($C['anti_mail_spam'] && strpos($v, 'mailto:') === 0){
514:      $v = str_replace('@', htmlspecialchars($C['anti_mail_spam']), $v);
515:     }elseif($C['anti_link_spam']){
516:      $r1 = $C['anti_link_spam'][1];
517:      if(!empty($r1) && preg_match($r1, $v)){continue;}
518:      $r0 = $C['anti_link_spam'][0];
519:      if(!empty($r0) && preg_match($r0, $v)){
520:       if(isset($a['rel'])){
521:        if(!preg_match('`\bnofollow\b`i', $a['rel'])){$a['rel'] .= ' nofollow';}
522:       }elseif(isset($aA['rel'])){
523:        if(!preg_match('`\bnofollow\b`i', $aA['rel'])){$nfr = 1;}
524:       }else{$a['rel'] = 'nofollow';}
525:      }
526:     }
527:    }
528:   }
529:   if(isset($rl[$k]) && is_array($rl[$k]) && ($v = htmLawed::hl_attrval($v, $rl[$k])) === 0){continue;}
530:   $a[$k] = str_replace('"', '&quot;', $v);
531:  }
532: }
533: if($nfr){$a['rel'] = isset($a['rel']) ? $a['rel']. ' nofollow' : 'nofollow';}
534: 
535: // rqd attr
536: static $eAR = array('area'=>array('alt'=>'area'), 'bdo'=>array('dir'=>'ltr'), 'form'=>array('action'=>''), 'img'=>array('src'=>'', 'alt'=>'image'), 'map'=>array('name'=>''), 'optgroup'=>array('label'=>''), 'param'=>array('name'=>''), 'script'=>array('type'=>'text/javascript'), 'textarea'=>array('rows'=>'10', 'cols'=>'50'));
537: if(isset($eAR[$e])){
538:  foreach($eAR[$e] as $k=>$v){
539:   if(!isset($a[$k])){$a[$k] = isset($v[0]) ? $v : $k;}
540:  }
541: }
542: 
543: // depr attrs
544: if($depTr){
545:  $c = array();
546:  foreach($a as $k=>$v){
547:   if($k == 'style' or !isset($aND[$k][$e])){continue;}
548:   if($k == 'align'){
549:    unset($a['align']);
550:    if($e == 'img' && ($v == 'left' or $v == 'right')){$c[] = 'float: '. $v;}
551:    elseif(($e == 'div' or $e == 'table') && $v == 'center'){$c[] = 'margin: auto';}
552:    else{$c[] = 'text-align: '. $v;}
553:   }elseif($k == 'bgcolor'){
554:    unset($a['bgcolor']);
555:    $c[] = 'background-color: '. $v;
556:   }elseif($k == 'border'){
557:    unset($a['border']); $c[] = "border: {$v}px";
558:   }elseif($k == 'bordercolor'){
559:    unset($a['bordercolor']); $c[] = 'border-color: '. $v;
560:   }elseif($k == 'clear'){
561:    unset($a['clear']); $c[] = 'clear: '. ($v != 'all' ? $v : 'both');
562:   }elseif($k == 'compact'){
563:    unset($a['compact']); $c[] = 'font-size: 85%';
564:   }elseif($k == 'height' or $k == 'width'){
565:    unset($a[$k]); $c[] = $k. ': '. ($v[0] != '*' ? $v. (ctype_digit($v) ? 'px' : '') : 'auto');
566:   }elseif($k == 'hspace'){
567:    unset($a['hspace']); $c[] = "margin-left: {$v}px; margin-right: {$v}px";
568:   }elseif($k == 'language' && !isset($a['type'])){
569:    unset($a['language']);
570:    $a['type'] = 'text/'. strtolower($v);
571:   }elseif($k == 'name'){
572:    if($C['no_deprecated_attr'] == 2 or ($e != 'a' && $e != 'map')){unset($a['name']);}
573:    if(!isset($a['id']) && preg_match('`[a-zA-Z][a-zA-Z\d.:_\-]*`', $v)){$a['id'] = $v;}
574:   }elseif($k == 'noshade'){
575:    unset($a['noshade']); $c[] = 'border-style: none; border: 0; background-color: gray; color: gray';
576:   }elseif($k == 'nowrap'){
577:    unset($a['nowrap']); $c[] = 'white-space: nowrap';
578:   }elseif($k == 'size'){
579:    unset($a['size']); $c[] = 'size: '. $v. 'px';
580:   }elseif($k == 'start' or $k == 'value'){
581:    unset($a[$k]);
582:   }elseif($k == 'type'){
583:    unset($a['type']);
584:    static $ol_type = array('i'=>'lower-roman', 'I'=>'upper-roman', 'a'=>'lower-latin', 'A'=>'upper-latin', '1'=>'decimal');
585:    $c[] = 'list-style-type: '. (isset($ol_type[$v]) ? $ol_type[$v] : 'decimal');
586:   }elseif($k == 'vspace'){
587:    unset($a['vspace']); $c[] = "margin-top: {$v}px; margin-bottom: {$v}px";
588:   }
589:  }
590:  if(count($c)){
591:   $c = implode('; ', $c);
592:   $a['style'] = isset($a['style']) ? rtrim($a['style'], ' ;'). '; '. $c. ';': $c. ';';
593:  }
594: }
595: // unique ID
596: if($C['unique_ids'] && isset($a['id'])){
597:  if(!preg_match('`^[A-Za-z][A-Za-z0-9_\-.:]*$`', ($id = $a['id'])) or (isset($GLOBALS['hl_Ids'][$id]) && $C['unique_ids'] == 1)){unset($a['id']);
598:  }else{
599:   while(isset($GLOBALS['hl_Ids'][$id])){$id = $C['unique_ids']. $id;}
600:   $GLOBALS['hl_Ids'][($a['id'] = $id)] = 1;
601:  }
602: }
603: // xml:lang
604: if($C['xml:lang'] && isset($a['lang'])){
605:  $a['xml:lang'] = isset($a['xml:lang']) ? $a['xml:lang'] : $a['lang'];
606:  if($C['xml:lang'] == 2){unset($a['lang']);}
607: }
608: // for transformed tag
609: if(!empty($trt)){
610:  $a['style'] = isset($a['style']) ? rtrim($a['style'], ' ;'). '; '. $trt : $trt;
611: }
612: // return with empty ele /
613: if(empty($C['hook_tag'])){
614:  $aA = '';
615:  foreach($a as $k=>$v){$aA .= " {$k}=\"{$v}\"";}
616:  return "<{$e}{$aA}". (isset($eE[$e]) ? ' /' : ''). '>';
617: }
618: else{return $C['hook_tag']($e, $a);}
619: // eof
620: }
621: 
622: public static function hl_tag2(&$e, &$a, $t=1){
623: // transform tag
624: if($e == 'center'){$e = 'div'; return 'text-align: center;';}
625: if($e == 'dir' or $e == 'menu'){$e = 'ul'; return '';}
626: if($e == 's' or $e == 'strike'){$e = 'span'; return 'text-decoration: line-through;';}
627: if($e == 'u'){$e = 'span'; return 'text-decoration: underline;';}
628: static $fs = array('0'=>'xx-small', '1'=>'xx-small', '2'=>'small', '3'=>'medium', '4'=>'large', '5'=>'x-large', '6'=>'xx-large', '7'=>'300%', '-1'=>'smaller', '-2'=>'60%', '+1'=>'larger', '+2'=>'150%', '+3'=>'200%', '+4'=>'300%');
629: if($e == 'font'){
630:  $a2 = '';
631:  if(preg_match('`face\s*=\s*(\'|")([^=]+?)\\1`i', $a, $m) or preg_match('`face\s*=(\s*)(\S+)`i', $a, $m)){
632:   $a2 .= ' font-family: '. str_replace('"', '\'', trim($m[2])). ';';
633:  }
634:  if(preg_match('`color\s*=\s*(\'|")?(.+?)(\\1|\s|$)`i', $a, $m)){
635:   $a2 .= ' color: '. str_replace('"', '\'', trim($m[2])). ';';
636:  }
637:  if(preg_match('`size\s*=\s*(\'|")?(.+?)(\\1|\s|$)`i', $a, $m) && isset($fs[($m = trim($m[2]))])){
638:   $a2 .= ' font-size: '. str_replace('"', '\'', $fs[$m]). ';';
639:  }
640:  $e = 'span'; return ltrim($a2);
641: }
642: if($t == 2){$e = 0; return 0;}
643: return '';
644: // eof
645: }
646: 
647: public static function hl_tidy($t, $w, $p){
648: // Tidy/compact HTM
649: if(strpos(' pre,script,textarea', "$p,")){return $t;}
650: $t = preg_replace('`\s+`', ' ', preg_replace_callback(array('`(<(!\[CDATA\[))(.+?)(\]\]>)`sm', '`(<(!--))(.+?)(-->)`sm', '`(<(pre|script|textarea)[^>]*?>)(.+?)(</\2>)`sm'), create_function('$m', 'return $m[1]. str_replace(array("<", ">", "\n", "\r", "\t", " "), array("\x01", "\x02", "\x03", "\x04", "\x05", "\x07"), $m[3]). $m[4];'), $t));
651: if(($w = strtolower($w)) == -1){
652:  return str_replace(array("\x01", "\x02", "\x03", "\x04", "\x05", "\x07"), array('<', '>', "\n", "\r", "\t", ' '), $t);
653: }
654: $s = strpos(" $w", 't') ? "\t" : ' ';
655: $s = preg_match('`\d`', $w, $m) ? str_repeat($s, $m[0]) : str_repeat($s, ($s == "\t" ? 1 : 2));
656: $N = preg_match('`[ts]([1-9])`', $w, $m) ? $m[1] : 0;
657: $a = array('br'=>1);
658: $b = array('button'=>1, 'input'=>1, 'option'=>1, 'param'=>1);
659: $c = array('caption'=>1, 'dd'=>1, 'dt'=>1, 'h1'=>1, 'h2'=>1, 'h3'=>1, 'h4'=>1, 'h5'=>1, 'h6'=>1, 'isindex'=>1, 'label'=>1, 'legend'=>1, 'li'=>1, 'object'=>1, 'p'=>1, 'pre'=>1, 'td'=>1, 'textarea'=>1, 'th'=>1);
660: $d = array('address'=>1, 'blockquote'=>1, 'center'=>1, 'colgroup'=>1, 'dir'=>1, 'div'=>1, 'dl'=>1, 'fieldset'=>1, 'form'=>1, 'hr'=>1, 'iframe'=>1, 'map'=>1, 'menu'=>1, 'noscript'=>1, 'ol'=>1, 'optgroup'=>1, 'rbc'=>1, 'rtc'=>1, 'ruby'=>1, 'script'=>1, 'select'=>1, 'table'=>1, 'tbody'=>1, 'tfoot'=>1, 'thead'=>1, 'tr'=>1, 'ul'=>1);
661: $T = explode('<', $t);
662: $X = 1;
663: while($X){
664:  $n = $N;
665:  $t = $T;
666:  ob_start();
667:  if(isset($d[$p])){echo str_repeat($s, ++$n);}
668:  echo ltrim(array_shift($t));
669:  for($i=-1, $j=count($t); ++$i<$j;){
670:   $r = ''; list($e, $r) = explode('>', $t[$i]);
671:   $x = $e[0] == '/' ? 0 : (substr($e, -1) == '/' ? 1 : ($e[0] != '!' ? 2 : -1));
672:   $y = !$x ? ltrim($e, '/') : ($x > 0 ? substr($e, 0, strcspn($e, ' ')) : 0);
673:   $e = "<$e>"; 
674:   if(isset($d[$y])){
675:    if(!$x){
676:     if($n){echo "\n", str_repeat($s, --$n), "$e\n", str_repeat($s, $n);}
677:     else{++$N; ob_end_clean(); continue 2;}
678:    }
679:    else{echo "\n", str_repeat($s, $n), "$e\n", str_repeat($s, ($x != 1 ? ++$n : $n));}
680:    echo $r; continue;
681:   }
682:   $f = "\n". str_repeat($s, $n);
683:   if(isset($c[$y])){
684:    if(!$x){echo $e, $f, $r;}
685:    else{echo $f, $e, $r;}
686:   }elseif(isset($b[$y])){echo $f, $e, $r;
687:   }elseif(isset($a[$y])){echo $e, $f, $r;
688:   }elseif(!$y){echo $f, $e, $f, $r;
689:   }else{echo $e, $r;}
690:  }
691:  $X = 0;
692: }
693: $t = str_replace(array("\n ", " \n"), "\n", preg_replace('`[\n]\s*?[\n]+`', "\n", ob_get_contents()));
694: ob_end_clean();
695: if(($l = strpos(" $w", 'r') ? (strpos(" $w", 'n') ? "\r\n" : "\r") : 0)){
696:  $t = str_replace("\n", $l, $t);
697: }
698: return str_replace(array("\x01", "\x02", "\x03", "\x04", "\x05", "\x07"), array('<', '>', "\n", "\r", "\t", ' '), $t);
699: // eof
700: }
701: 
702: public static function hl_version(){
703: // rel
704: return '1.1.20';
705: // eof
706: }
707: 
708: public static function kses($t, $h, $p=array('http', 'https', 'ftp', 'news', 'nntp', 'telnet', 'gopher', 'mailto')){
709: // kses compat
710: foreach($h as $k=>$v){
711:  $h[$k]['n']['*'] = 1;
712: }
713: $C['cdata'] = $C['comment'] = $C['make_tag_strict'] = $C['no_deprecated_attr'] = $C['unique_ids'] = 0;
714: $C['keep_bad'] = 1;
715: $C['elements'] = count($h) ? strtolower(implode(',', array_keys($h))) : '-*';
716: $C['hook'] = 'htmLawed::kses_hook';
717: $C['schemes'] = '*:'. implode(',', $p);
718: return htmLawed::hl($t, $C, $h);
719: // eof
720: }
721: 
722: public static function kses_hook($t, &$C, &$S){
723: // kses compat
724: return $t;
725: // eof
726: }
727: // end class
728: }
729: 
API documentation generated by ApiGen