From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 3ADA6139694 for ; Sat, 25 Mar 2017 17:27:51 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 54BB021C028; Sat, 25 Mar 2017 17:27:47 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 9ECE521C028 for ; Sat, 25 Mar 2017 17:27:46 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 54A9734163C for ; Sat, 25 Mar 2017 17:27:44 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id A7CFB73C4 for ; Sat, 25 Mar 2017 17:27:42 +0000 (UTC) From: "Anthony G. Basile" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Anthony G. Basile" Message-ID: <1490462811.e3ad53d7999e6002933959f97e3d5bee89009a83.blueness@gentoo> Subject: [gentoo-commits] proj/blogs-gentoo:master commit in: , ... X-VCS-Repository: proj/blogs-gentoo X-VCS-Files: plugins/wordpress-mobile-pack/admin/class-admin-init.php plugins/wordpress-mobile-pack/admin/js/UI.Modules/Theming/WMP_EDIT_THEME.js plugins/wordpress-mobile-pack/admin/js/UI.Modules/Theming/WMP_EDIT_THEME.min.js plugins/wordpress-mobile-pack/admin/pages/theme-settings.php plugins/wordpress-mobile-pack/admin/sass/config.rb plugins/wordpress-mobile-pack/admin/sass/core/_buttons.scss plugins/wordpress-mobile-pack/admin/sass/core/_core.scss plugins/wordpress-mobile-pack/admin/sass/core/_fonts.scss plugins/wordpress-mobile-pack/admin/sass/core/_forms.scss plugins/wordpress-mobile-pack/admin/sass/core/_ie.scss plugins/wordpress-mobile-pack/admin/sass/core/_variables.scss plugins/wordpress-mobile-pack/admin/sass/fonts/WP Dashboard.json plugins/wordpress-mobile-pack/admin/sass/fonts/acorde-regular.eot plugins/wordpress-mobile-pack/admin/sass/fonts/acorde-regular.otf plugins/wordpress-mobile-pack/admin/sass/fonts/acorde-regular.svg plugins/wordpress-mobile-pack/admin/sass/fonts/ acorde-regular.ttf plugins/wordpress-mobile-pack/admin/sass/fonts/acorde-regular.woff plugins/wordpress-mobile-pack/admin/sass/fonts/acorde-semibold.eot plugins/wordpress-mobile-pack/admin/sass/fonts/acorde-semibold.otf plugins/wordpress-mobile-pack/admin/sass/fonts/acorde-semibold.svg plugins/wordpress-mobile-pack/admin/sass/fonts/acorde-semibold.ttf plugins/wordpress-mobile-pack/admin/sass/fonts/acorde-semibold.woff plugins/wordpress-mobile-pack/admin/sass/fonts/ol-round-gothic-light.eot plugins/wordpress-mobile-pack/admin/sass/fonts/ol-round-gothic-light.otf plugins/wordpress-mobile-pack/admin/sass/fonts/ol-round-gothic-light.svg plugins/wordpress-mobile-pack/admin/sass/fonts/ol-round-gothic-light.ttf plugins/wordpress-mobile-pack/admin/sass/fonts/ol-round-gothic-light.woff plugins/wordpress-mobile-pack/admin/sass/fonts/open-sans-regular.eot plugins/wordpress-mobile-pack/admin/sass/fonts/open-sans-regular.otf plugins/wordpress-mobile-pack/admin/sass/fonts/open-sans-regular.svg pl ugins/wordpress-mobile-pack/admin/sass/fonts/open-sans-regular.ttf plugins/wordpress-mobile-pack/admin/sass/fonts/open-sans-regular.woff plugins/wordpress-mobile-pack/admin/sass/fonts/opensans-italic.eot plugins/wordpress-mobile-pack/admin/sass/fonts/opensans-italic.svg plugins/wordpress-mobile-pack/admin/sass/fonts/opensans-italic.ttf plugins/wordpress-mobile-pack/admin/sass/fonts/opensans-italic.woff plugins/wordpress-mobile-pack/admin/sass/fonts/opensans-semibold.eot plugins/wordpress-mobile-pack/admin/sass/fonts/opensans-semibold.svg plugins/wordpress-mobile-pack/admin/sass/fonts/opensans-semibold.ttf plugins/wordpress-mobile-pack/admin/sass/fonts/opensans-semibold.woff plugins/wordpress-mobile-pack/admin/sass/fonts/wp-font.eot plugins/wordpress-mobile-pack/admin/sass/fonts/wp-font.svg plugins/wordpress-mobile-pack/admin/sass/fonts/wp-font.ttf plugins/wordpress-mobile-pack/admin/sass/fonts/wp-font.woff plugins/wordpress-mobile-pack/admin/sass/general.scss plugins/wordpress-mobil e-pack/admin/sass/mixins/_display.scss plugins/wordpress-mobile-pack/admin/sass/mixins/_icon.scss plugins/wordpress-mobile-pack/admin/sass/mixins/_mixins.scss plugins/wordpress-mobile-pack/admin/sass/modules/_content.scss plugins/wordpress-mobile-pack/admin/sass/modules/_look-and-feel.scss plugins/wordpress-mobile-pack/admin/sass/modules/_perfect-scrollbar.scss plugins/wordpress-mobile-pack/admin/sass/modules/_settings.scss plugins/wordpress-mobile-pack/admin/sass/modules/_themes.scss plugins/wordpress-mobile-pack/admin/sass/modules/_whats-new.scss plugins/wordpress-mobile-pack/core/config.php plugins/wordpress-mobile-pack/export/class-export.php plugins/wordpress-mobile-pack/export/content.php plugins/wordpress-mobile-pack/frontend/class-application.php plugins/wordpress-mobile-pack/frontend/themes/app1/template.php plugins/wordpress-mobile-pack/inc/class-wmp-formatter.php plugins/wordpress-mobile-pack/inc/class-wmp-themes-config.php plugins/wordpress-mobile-pack/libs/htmlpurifier- 4.6.0/library/HTMLPurifier.auto.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier.autoload.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier.composer.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier.func.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier.includes.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier.kses.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier.path.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier.safe-includes.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/Arborize.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/AttrCollections.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/AttrDef.php plu gins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/AttrDef/CSS.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/AttrDef/CSS/AlphaValue.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/AttrDef/CSS/Background.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/AttrDef/CSS/BackgroundPosition.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/AttrDef/CSS/Border.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/AttrDef/CSS/Color.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/AttrDef/CSS/Composite.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/AttrDef/CSS/DenyElementDecorator.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/AttrDef/CSS/Filter.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/AttrDef/CSS/Fo nt.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/AttrDef/CSS/FontFamily.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/AttrDef/CSS/Ident.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/AttrDef/CSS/ImportantDecorator.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/AttrDef/CSS/Length.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/AttrDef/CSS/ListStyle.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/AttrDef/CSS/Multiple.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/AttrDef/CSS/Number.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/AttrDef/CSS/Percentage.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/AttrDef/CSS/TextDecoration.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/A ttrDef/CSS/URI.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/AttrDef/Clone.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/AttrDef/Enum.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/AttrDef/HTML/Bool.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/AttrDef/HTML/Class.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/AttrDef/HTML/Color.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/AttrDef/HTML/FrameTarget.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/AttrDef/HTML/ID.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/AttrDef/HTML/Length.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/AttrDef/HTML/LinkTypes.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/AttrDef/HTML/MultiLength. php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/AttrDef/HTML/Nmtokens.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/AttrDef/HTML/Pixels.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/AttrDef/Integer.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/AttrDef/Lang.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/AttrDef/Switch.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/AttrDef/Text.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/AttrDef/URI.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/AttrDef/URI/Email.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/AttrDef/URI/Email/SimpleCheck.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/AttrDef/URI/Host.php plugins/wordpress-mobile-pa ck/libs/htmlpurifier-4.6.0/library/HTMLPurifier/AttrDef/URI/IPv4.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/AttrDef/URI/IPv6.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/AttrTransform.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/AttrTransform/Background.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/AttrTransform/BdoDir.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/AttrTransform/BgColor.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/AttrTransform/BoolToCSS.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/AttrTransform/Border.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/AttrTransform/EnumToCSS.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/AttrTransform/ImgRequired.php plugins/wordpress-mobil e-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/AttrTransform/ImgSpace.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/AttrTransform/Input.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/AttrTransform/Lang.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/AttrTransform/Length.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/AttrTransform/Name.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/AttrTransform/NameSync.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/AttrTransform/Nofollow.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/AttrTransform/SafeEmbed.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/AttrTransform/SafeObject.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/AttrTransform/SafeParam.php plugins/w ordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/AttrTransform/ScriptRequired.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/AttrTransform/TargetBlank.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/AttrTransform/Textarea.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/AttrTypes.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/AttrValidator.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/Bootstrap.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/CSSDefinition.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/ChildDef.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/ChildDef/Chameleon.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/ChildDef/Custom.php plugins/wordpress-mobile-pack/libs/htmlpurifie r-4.6.0/library/HTMLPurifier/ChildDef/Empty.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/ChildDef/List.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/ChildDef/Optional.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/ChildDef/Required.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/ChildDef/StrictBlockquote.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/ChildDef/Table.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/Config.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/Builder/ConfigSchema.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/Builder/Xml.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPu rifier/ConfigSchema/Exception.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/Interchange.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/Interchange/Directive.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/Interchange/Id.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/InterchangeBuilder.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/Validator.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/ValidatorAtom.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema.ser plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/Attr.AllowedClasses.txt plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/Attr.A llowedFrameTargets.txt plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/Attr.AllowedRel.txt plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/Attr.AllowedRev.txt plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/Attr.ClassUseCDATA.txt plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/Attr.DefaultImageAlt.txt plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/Attr.DefaultInvalidImage.txt plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/Attr.DefaultInvalidImageAlt.txt plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/Attr.DefaultTextDir.txt plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/Attr.EnableID.txt plugins/wordpress-mobil e-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/Attr.ForbiddenClasses.txt plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/Attr.IDBlacklist.txt plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/Attr.IDBlacklistRegexp.txt plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/Attr.IDPrefix.txt plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/Attr.IDPrefixLocal.txt plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/AutoFormat.AutoParagraph.txt plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/AutoFormat.Custom.txt plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/AutoFormat.DisplayLinkURI.txt plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HT MLPurifier/ConfigSchema/schema/AutoFormat.Linkify.txt plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/AutoFormat.PurifierLinkify.DocURL.txt plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/AutoFormat.PurifierLinkify.txt plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/AutoFormat.RemoveEmpty.RemoveNbsp.Exceptions.txt plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/AutoFormat.RemoveEmpty.RemoveNbsp.txt plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/AutoFormat.RemoveEmpty.txt plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/AutoFormat.RemoveSpansWithoutAttributes.txt plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/CSS.AllowImportant.txt plugins/wordpress-mobile-pac k/libs/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/CSS.AllowTricky.txt plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/CSS.AllowedFonts.txt plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/CSS.AllowedProperties.txt plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/CSS.DefinitionRev.txt plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/CSS.ForbiddenProperties.txt plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/CSS.MaxImgLength.txt plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/CSS.Proprietary.txt plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/CSS.Trusted.txt plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/sch ema/Cache.DefinitionImpl.txt plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/Cache.SerializerPath.txt plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/Cache.SerializerPermissions.txt plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/Core.AggressivelyFixLt.txt plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/Core.AllowHostnameUnderscore.txt plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/Core.CollectErrors.txt plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/Core.ColorKeywords.txt plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/Core.ConvertDocumentToFragment.txt plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/Core.Direc tLexLineNumberSyncInterval.txt plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/Core.DisableExcludes.txt plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/Core.EnableIDNA.txt plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/Core.Encoding.txt plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/Core.EscapeInvalidChildren.txt plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/Core.EscapeInvalidTags.txt plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/Core.EscapeNonASCIICharacters.txt plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/Core.HiddenElements.txt plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/Core.Language.txt plugins/w ordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/Core.LexerImpl.txt plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/Core.MaintainLineNumbers.txt plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/Core.NormalizeNewlines.txt plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/Core.RemoveInvalidImg.txt plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/Core.RemoveProcessingInstructions.txt plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/Core.RemoveScriptContents.txt plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/Filter.Custom.txt plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/Filter.ExtractStyleBlocks.Escaping.txt plugins/wordpress-mo bile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/Filter.ExtractStyleBlocks.Scope.txt plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/Filter.ExtractStyleBlocks.TidyImpl.txt plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/Filter.ExtractStyleBlocks.txt plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/Filter.Iframe.txt plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/Filter.YouTube.txt plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/HTML.Allowed.txt plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/HTML.AllowedAttributes.txt plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/HTML.AllowedComments.txt plugins/wordpress-mobile-pack/libs/htmlpurifie r-4.6.0/library/HTMLPurifier/ConfigSchema/schema/HTML.AllowedCommentsRegexp.txt plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/HTML.AllowedElements.txt plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/HTML.AllowedModules.txt plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/HTML.Attr.Name.UseCDATA.txt plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/HTML.BlockWrapper.txt plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/HTML.CoreModules.txt plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/HTML.CustomDoctype.txt plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/HTML.DefinitionID.txt plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema /schema/HTML.DefinitionRev.txt plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/HTML.Doctype.txt plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/HTML.FlashAllowFullScreen.txt plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/HTML.ForbiddenAttributes.txt plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/HTML.ForbiddenElements.txt plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/HTML.MaxImgLength.txt plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/HTML.Nofollow.txt plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/HTML.Parent.txt plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/HTML.Proprietary.txt plugins/wordpress-mobile-p ack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/HTML.SafeEmbed.txt plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/HTML.SafeIframe.txt plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/HTML.SafeObject.txt plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/HTML.SafeScripting.txt plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/HTML.Strict.txt plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/HTML.TargetBlank.txt plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/HTML.TidyAdd.txt plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/HTML.TidyLevel.txt plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/HTML.TidyRemo ve.txt plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/HTML.Trusted.txt plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/HTML.XHTML.txt plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/Output.CommentScriptContents.txt plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/Output.FixInnerHTML.txt plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/Output.FlashCompat.txt plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/Output.Newline.txt plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/Output.SortAttr.txt plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/Output.TidyFormat.txt plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/lib rary/HTMLPurifier/ConfigSchema/schema/Test.ForceNoIconv.txt plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/URI.AllowedSchemes.txt plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/URI.Base.txt plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/URI.DefaultScheme.txt plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/URI.DefinitionID.txt plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/URI.DefinitionRev.txt plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/URI.Disable.txt plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/URI.DisableExternal.txt plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/URI.DisableExternalResources.txt plu gins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/URI.DisableResources.txt plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/URI.Host.txt plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/URI.HostBlacklist.txt plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/URI.MakeAbsolute.txt plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/URI.Munge.txt plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/URI.MungeResources.txt plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/URI.MungeSecretKey.txt plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/URI.OverrideAllowedSchemes.txt plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPu rifier/ConfigSchema/schema/URI.SafeIframeRegexp.txt plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/info.ini plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/ContentSets.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/Context.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/Definition.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/DefinitionCache.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/DefinitionCache/Decorator.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/DefinitionCache/Decorator/Cleanup.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/DefinitionCache/Decorator/Memory.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/DefinitionCache/Decorator/Template.php.in plugins/wordpress-mobile-pack/l ibs/htmlpurifier-4.6.0/library/HTMLPurifier/DefinitionCache/Null.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/DefinitionCache/Serializer.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/DefinitionCache/Serializer/README plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/DefinitionCacheFactory.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/Doctype.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/DoctypeRegistry.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/ElementDef.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/Encoder.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/EntityLookup.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/EntityLookup/entities.ser plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/libra ry/HTMLPurifier/EntityParser.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/ErrorCollector.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/ErrorStruct.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/Exception.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/Filter.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/Filter/ExtractStyleBlocks.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/Filter/YouTube.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/Generator.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/HTMLDefinition.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/HTMLModule.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/HTMLModule/Bdo.php plugins/wordpress-mobile-pack/libs/htm lpurifier-4.6.0/library/HTMLPurifier/HTMLModule/CommonAttributes.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/HTMLModule/Edit.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/HTMLModule/Forms.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/HTMLModule/Hypertext.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/HTMLModule/Iframe.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/HTMLModule/Image.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/HTMLModule/Legacy.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/HTMLModule/List.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/HTMLModule/Name.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/HTMLModule/Nofollow.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/libr ary/HTMLPurifier/HTMLModule/NonXMLCommonAttributes.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/HTMLModule/Object.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/HTMLModule/Presentation.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/HTMLModule/Proprietary.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/HTMLModule/Ruby.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/HTMLModule/SafeEmbed.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/HTMLModule/SafeObject.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/HTMLModule/SafeScripting.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/HTMLModule/Scripting.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/HTMLModule/StyleAttribute.php plugins/wordpress-mobile-pack/libs/ htmlpurifier-4.6.0/library/HTMLPurifier/HTMLModule/Tables.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/HTMLModule/Target.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/HTMLModule/TargetBlank.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/HTMLModule/Text.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/HTMLModule/Tidy.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/HTMLModule/Tidy/Name.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/HTMLModule/Tidy/Proprietary.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/HTMLModule/Tidy/Strict.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/HTMLModule/Tidy/Transitional.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/HTMLModule/Tidy/XHTML.php plugins/wordpress-mobile-pac k/libs/htmlpurifier-4.6.0/library/HTMLPurifier/HTMLModule/Tidy/XHTMLAndHTML4.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/HTMLModule/XMLCommonAttributes.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/HTMLModuleManager.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/IDAccumulator.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/Injector.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/Injector/AutoParagraph.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/Injector/DisplayLinkURI.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/Injector/Linkify.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/Injector/PurifierLinkify.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/Injector/RemoveEmpty.php plugins/wordpress-mobil e-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/Injector/RemoveSpansWithoutAttributes.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/Injector/SafeObject.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/Language.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/Language/classes/en-x-test.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/Language/messages/en-x-test.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/Language/messages/en-x-testmini.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/Language/messages/en.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/LanguageFactory.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/Length.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/Lexer.php plugins/wordpress-mobile-p ack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/Lexer/DOMLex.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/Lexer/DirectLex.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/Lexer/PH5P.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/Node.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/Node/Comment.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/Node/Element.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/Node/Text.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/PercentEncoder.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/Printer.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/Printer/CSSDefinition.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/Printer/ConfigForm.css plugins/w ordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/Printer/ConfigForm.js plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/Printer/ConfigForm.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/Printer/HTMLDefinition.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/PropertyList.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/PropertyListIterator.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/Queue.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/Strategy.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/Strategy/Composite.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/Strategy/Core.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/Strategy/FixNesting.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/ library/HTMLPurifier/Strategy/MakeWellFormed.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/Strategy/RemoveForeignElements.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/Strategy/ValidateAttributes.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/StringHash.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/StringHashParser.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/TagTransform.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/TagTransform/Font.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/TagTransform/Simple.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/Token.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/Token/Comment.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/Toke n/Empty.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/Token/End.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/Token/Start.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/Token/Tag.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/Token/Text.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/TokenFactory.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/URI.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/URIDefinition.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/URIFilter.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/URIFilter/DisableExternal.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/URIFilter/DisableExternalResources.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4. 6.0/library/HTMLPurifier/URIFilter/DisableResources.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/URIFilter/HostBlacklist.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/URIFilter/MakeAbsolute.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/URIFilter/Munge.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/URIFilter/SafeIframe.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/URIParser.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/URIScheme.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/URIScheme/callto.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/URIScheme/data.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/URIScheme/file.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/URIS cheme/ftp.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/URIScheme/http.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/URIScheme/https.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/URIScheme/mailto.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/URIScheme/news.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/URIScheme/nntp.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/URIScheme/skype.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/URIScheme/sms.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/URIScheme/tel.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/URIScheme/whatsapp.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/URISchemeRegistry.php plugins/wordpress-mobile-pack/libs /htmlpurifier-4.6.0/library/HTMLPurifier/UnitConverter.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/VarParser.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/VarParser/Flexible.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/VarParser/Native.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/VarParserException.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/Zipper.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier.auto.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier.autoload.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier.composer.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier.func.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier.includes.php plugins/wordpress-mobile-pack/libs/html purifier-4.8.0/library/HTMLPurifier.kses.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier.path.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier.safe-includes.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/Arborize.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/AttrCollections.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/AttrDef.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/AttrDef/CSS.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/AttrDef/CSS/AlphaValue.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/AttrDef/CSS/Background.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/AttrDef/CSS/BackgroundPosition.php plugins/wordpress-mob ile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/AttrDef/CSS/Border.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/AttrDef/CSS/Color.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/AttrDef/CSS/Composite.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/AttrDef/CSS/DenyElementDecorator.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/AttrDef/CSS/Filter.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/AttrDef/CSS/Font.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/AttrDef/CSS/FontFamily.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/AttrDef/CSS/Ident.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/AttrDef/CSS/ImportantDecorator.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/AttrDef/CSS/Length.php plugins/w ordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/AttrDef/CSS/ListStyle.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/AttrDef/CSS/Multiple.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/AttrDef/CSS/Number.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/AttrDef/CSS/Percentage.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/AttrDef/CSS/TextDecoration.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/AttrDef/CSS/URI.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/AttrDef/Clone.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/AttrDef/Enum.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/AttrDef/HTML/Bool.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/AttrDef/HTML/Class.php plugins/wordpress-mobile -pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/AttrDef/HTML/Color.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/AttrDef/HTML/FrameTarget.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/AttrDef/HTML/ID.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/AttrDef/HTML/Length.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/AttrDef/HTML/LinkTypes.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/AttrDef/HTML/MultiLength.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/AttrDef/HTML/Nmtokens.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/AttrDef/HTML/Pixels.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/AttrDef/Integer.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/AttrDef/Lang.php plugins/wordpress-mobile-pack/li bs/htmlpurifier-4.8.0/library/HTMLPurifier/AttrDef/Switch.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/AttrDef/Text.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/AttrDef/URI.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/AttrDef/URI/Email.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/AttrDef/URI/Email/SimpleCheck.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/AttrDef/URI/Host.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/AttrDef/URI/IPv4.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/AttrDef/URI/IPv6.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/AttrTransform.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/AttrTransform/Background.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library /HTMLPurifier/AttrTransform/BdoDir.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/AttrTransform/BgColor.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/AttrTransform/BoolToCSS.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/AttrTransform/Border.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/AttrTransform/EnumToCSS.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/AttrTransform/ImgRequired.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/AttrTransform/ImgSpace.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/AttrTransform/Input.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/AttrTransform/Lang.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/AttrTransform/Length.php plugins/wordpress-mobile-pack/libs/htmlpurifier -4.8.0/library/HTMLPurifier/AttrTransform/Name.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/AttrTransform/NameSync.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/AttrTransform/Nofollow.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/AttrTransform/SafeEmbed.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/AttrTransform/SafeObject.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/AttrTransform/SafeParam.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/AttrTransform/ScriptRequired.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/AttrTransform/TargetBlank.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/AttrTransform/TargetNoreferrer.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/AttrTransform/Textarea.php plugins /wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/AttrTypes.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/AttrValidator.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/Bootstrap.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/CSSDefinition.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/ChildDef.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/ChildDef/Chameleon.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/ChildDef/Custom.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/ChildDef/Empty.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/ChildDef/List.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/ChildDef/Optional.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/ ChildDef/Required.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/ChildDef/StrictBlockquote.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/ChildDef/Table.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/Config.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/ConfigSchema.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/ConfigSchema/Builder/ConfigSchema.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/ConfigSchema/Builder/Xml.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/ConfigSchema/Exception.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/ConfigSchema/Interchange.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/ConfigSchema/Interchange/Directive.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library /HTMLPurifier/ConfigSchema/Interchange/Id.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/ConfigSchema/InterchangeBuilder.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/ConfigSchema/Validator.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/ConfigSchema/ValidatorAtom.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/ConfigSchema/schema.ser plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/ConfigSchema/schema/Attr.AllowedClasses.txt plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/ConfigSchema/schema/Attr.AllowedFrameTargets.txt plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/ConfigSchema/schema/Attr.AllowedRel.txt plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/ConfigSchema/schema/Attr.AllowedRev.txt plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/librar y/HTMLPurifier/ConfigSchema/schema/Attr.ClassUseCDATA.txt plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/ConfigSchema/schema/Attr.DefaultImageAlt.txt plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/ConfigSchema/schema/Attr.DefaultInvalidImage.txt plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/ConfigSchema/schema/Attr.DefaultInvalidImageAlt.txt plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/ConfigSchema/schema/Attr.DefaultTextDir.txt plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/ConfigSchema/schema/Attr.EnableID.txt plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/ConfigSchema/schema/Attr.ForbiddenClasses.txt plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/ConfigSchema/schema/Attr.ID.HTML5.txt plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/ConfigSchema/schema/Attr.ID Blacklist.txt plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/ConfigSchema/schema/Attr.IDBlacklistRegexp.txt plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/ConfigSchema/schema/Attr.IDPrefix.txt plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/ConfigSchema/schema/Attr.IDPrefixLocal.txt plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/ConfigSchema/schema/AutoFormat.AutoParagraph.txt plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/ConfigSchema/schema/AutoFormat.Custom.txt plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/ConfigSchema/schema/AutoFormat.DisplayLinkURI.txt plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/ConfigSchema/schema/AutoFormat.Linkify.txt plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/ConfigSchema/schema/AutoFormat.PurifierLinkify.DocURL.txt plugins/wordp ress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/ConfigSchema/schema/AutoFormat.PurifierLinkify.txt plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/ConfigSchema/schema/AutoFormat.RemoveEmpty.Predicate.txt plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/ConfigSchema/schema/AutoFormat.RemoveEmpty.RemoveNbsp.Exceptions.txt plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/ConfigSchema/schema/AutoFormat.RemoveEmpty.RemoveNbsp.txt plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/ConfigSchema/schema/AutoFormat.RemoveEmpty.txt plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/ConfigSchema/schema/AutoFormat.RemoveSpansWithoutAttributes.txt plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/ConfigSchema/schema/CSS.AllowDuplicates.txt plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/ConfigSchema/schema/ CSS.AllowImportant.txt plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/ConfigSchema/schema/CSS.AllowTricky.txt plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/ConfigSchema/schema/CSS.AllowedFonts.txt plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/ConfigSchema/schema/CSS.AllowedProperties.txt plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/ConfigSchema/schema/CSS.DefinitionRev.txt plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/ConfigSchema/schema/CSS.ForbiddenProperties.txt plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/ConfigSchema/schema/CSS.MaxImgLength.txt plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/ConfigSchema/schema/CSS.Proprietary.txt plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/ConfigSchema/schema/CSS.Trusted.txt plugins/wordpress-mobile-pack/libs/htmlp urifier-4.8.0/library/HTMLPurifier/ConfigSchema/schema/Cache.DefinitionImpl.txt plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/ConfigSchema/schema/Cache.SerializerPath.txt plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/ConfigSchema/schema/Cache.SerializerPermissions.txt plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/ConfigSchema/schema/Core.AggressivelyFixLt.txt plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/ConfigSchema/schema/Core.AllowHostnameUnderscore.txt plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/ConfigSchema/schema/Core.CollectErrors.txt plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/ConfigSchema/schema/Core.ColorKeywords.txt plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/ConfigSchema/schema/Core.ConvertDocumentToFragment.txt plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/ library/HTMLPurifier/ConfigSchema/schema/Core.DirectLexLineNumberSyncInterval.txt plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/ConfigSchema/schema/Core.DisableExcludes.txt plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/ConfigSchema/schema/Core.EnableIDNA.txt plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/ConfigSchema/schema/Core.Encoding.txt plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/ConfigSchema/schema/Core.EscapeInvalidChildren.txt plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/ConfigSchema/schema/Core.EscapeInvalidTags.txt plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/ConfigSchema/schema/Core.EscapeNonASCIICharacters.txt plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/ConfigSchema/schema/Core.HiddenElements.txt plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurif ier/ConfigSchema/schema/Core.Language.txt plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/ConfigSchema/schema/Core.LexerImpl.txt plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/ConfigSchema/schema/Core.MaintainLineNumbers.txt plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/ConfigSchema/schema/Core.NormalizeNewlines.txt plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/ConfigSchema/schema/Core.RemoveInvalidImg.txt plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/ConfigSchema/schema/Core.RemoveProcessingInstructions.txt plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/ConfigSchema/schema/Core.RemoveScriptContents.txt plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/ConfigSchema/schema/Filter.Custom.txt plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/ConfigSchema/schema/Filter.E xtractStyleBlocks.Escaping.txt plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/ConfigSchema/schema/Filter.ExtractStyleBlocks.Scope.txt plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/ConfigSchema/schema/Filter.ExtractStyleBlocks.TidyImpl.txt plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/ConfigSchema/schema/Filter.ExtractStyleBlocks.txt plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/ConfigSchema/schema/Filter.YouTube.txt plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/ConfigSchema/schema/HTML.Allowed.txt plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/ConfigSchema/schema/HTML.AllowedAttributes.txt plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/ConfigSchema/schema/HTML.AllowedComments.txt plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/ConfigSchema/schema/HTML.AllowedC ommentsRegexp.txt plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/ConfigSchema/schema/HTML.AllowedElements.txt plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/ConfigSchema/schema/HTML.AllowedModules.txt plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/ConfigSchema/schema/HTML.Attr.Name.UseCDATA.txt plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/ConfigSchema/schema/HTML.BlockWrapper.txt plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/ConfigSchema/schema/HTML.CoreModules.txt plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/ConfigSchema/schema/HTML.CustomDoctype.txt plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/ConfigSchema/schema/HTML.DefinitionID.txt plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/ConfigSchema/schema/HTML.DefinitionRev.txt plugins/wordpress-mobile-pack/l ibs/htmlpurifier-4.8.0/library/HTMLPurifier/ConfigSchema/schema/HTML.Doctype.txt plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/ConfigSchema/schema/HTML.FlashAllowFullScreen.txt plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/ConfigSchema/schema/HTML.ForbiddenAttributes.txt plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/ConfigSchema/schema/HTML.ForbiddenElements.txt plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/ConfigSchema/schema/HTML.MaxImgLength.txt plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/ConfigSchema/schema/HTML.Nofollow.txt plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/ConfigSchema/schema/HTML.Parent.txt plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/ConfigSchema/schema/HTML.Proprietary.txt plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/ConfigSchema/ schema/HTML.SafeEmbed.txt plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/ConfigSchema/schema/HTML.SafeIframe.txt plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/ConfigSchema/schema/HTML.SafeObject.txt plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/ConfigSchema/schema/HTML.SafeScripting.txt plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/ConfigSchema/schema/HTML.Strict.txt plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/ConfigSchema/schema/HTML.TargetBlank.txt plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/ConfigSchema/schema/HTML.TargetNoreferrer.txt plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/ConfigSchema/schema/HTML.TidyAdd.txt plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/ConfigSchema/schema/HTML.TidyLevel.txt plugins/wordpress-mobile-pack/libs/htmlpurifier-4 .8.0/library/HTMLPurifier/ConfigSchema/schema/HTML.TidyRemove.txt plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/ConfigSchema/schema/HTML.Trusted.txt plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/ConfigSchema/schema/HTML.XHTML.txt plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/ConfigSchema/schema/Output.CommentScriptContents.txt plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/ConfigSchema/schema/Output.FixInnerHTML.txt plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/ConfigSchema/schema/Output.FlashCompat.txt plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/ConfigSchema/schema/Output.Newline.txt plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/ConfigSchema/schema/Output.SortAttr.txt plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/ConfigSchema/schema/Output.TidyFormat.tx t plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/ConfigSchema/schema/Test.ForceNoIconv.txt plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/ConfigSchema/schema/URI.AllowedSchemes.txt plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/ConfigSchema/schema/URI.Base.txt plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/ConfigSchema/schema/URI.DefaultScheme.txt plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/ConfigSchema/schema/URI.DefinitionID.txt plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/ConfigSchema/schema/URI.DefinitionRev.txt plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/ConfigSchema/schema/URI.Disable.txt plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/ConfigSchema/schema/URI.DisableExternal.txt plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifi er/ConfigSchema/schema/URI.DisableExternalResources.txt plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/ConfigSchema/schema/URI.DisableResources.txt plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/ConfigSchema/schema/URI.Host.txt plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/ConfigSchema/schema/URI.HostBlacklist.txt plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/ConfigSchema/schema/URI.MakeAbsolute.txt plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/ConfigSchema/schema/URI.Munge.txt plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/ConfigSchema/schema/URI.MungeResources.txt plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/ConfigSchema/schema/URI.MungeSecretKey.txt plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/ConfigSchema/schema/URI.OverrideAllowedSchemes.txt plugins/w ordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/ConfigSchema/schema/URI.SafeIframeRegexp.txt plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/ConfigSchema/schema/info.ini plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/ContentSets.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/Context.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/Definition.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/DefinitionCache.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/DefinitionCache/Decorator.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/DefinitionCache/Decorator/Cleanup.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/DefinitionCache/Decorator/Memory.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/DefinitionCach e/Decorator/Template.php.in plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/DefinitionCache/Null.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/DefinitionCache/Serializer.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/DefinitionCache/Serializer/README plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/DefinitionCacheFactory.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/Doctype.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/DoctypeRegistry.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/ElementDef.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/Encoder.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/EntityLookup.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/EntityLookup/entities.ser plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/EntityParser.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/ErrorCollector.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/ErrorStruct.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/Exception.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/Filter.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/Filter/ExtractStyleBlocks.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/Filter/YouTube.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/Generator.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/HTMLDefinition.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/HTMLModule.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifie r/HTMLModule/Bdo.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/HTMLModule/CommonAttributes.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/HTMLModule/Edit.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/HTMLModule/Forms.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/HTMLModule/Hypertext.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/HTMLModule/Iframe.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/HTMLModule/Image.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/HTMLModule/Legacy.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/HTMLModule/List.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/HTMLModule/Name.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/HTMLModule/Nofollow.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/HTMLModule/NonXMLCommonAttributes.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/HTMLModule/Object.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/HTMLModule/Presentation.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/HTMLModule/Proprietary.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/HTMLModule/Ruby.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/HTMLModule/SafeEmbed.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/HTMLModule/SafeObject.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/HTMLModule/SafeScripting.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/HTMLModule/Scripting.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/HTMLMo dule/StyleAttribute.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/HTMLModule/Tables.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/HTMLModule/Target.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/HTMLModule/TargetBlank.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/HTMLModule/TargetNoreferrer.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/HTMLModule/Text.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/HTMLModule/Tidy.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/HTMLModule/Tidy/Name.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/HTMLModule/Tidy/Proprietary.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/HTMLModule/Tidy/Strict.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurif ier/HTMLModule/Tidy/Transitional.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/HTMLModule/Tidy/XHTML.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/HTMLModule/Tidy/XHTMLAndHTML4.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/HTMLModule/XMLCommonAttributes.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/HTMLModuleManager.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/IDAccumulator.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/Injector.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/Injector/AutoParagraph.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/Injector/DisplayLinkURI.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/Injector/Linkify.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library /HTMLPurifier/Injector/PurifierLinkify.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/Injector/RemoveEmpty.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/Injector/RemoveSpansWithoutAttributes.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/Injector/SafeObject.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/Language.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/Language/classes/en-x-test.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/Language/messages/en-x-test.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/Language/messages/en-x-testmini.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/Language/messages/en.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/LanguageFactory.php plugins/wordpress-mobile-pack/l ibs/htmlpurifier-4.8.0/library/HTMLPurifier/Length.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/Lexer.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/Lexer/DOMLex.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/Lexer/DirectLex.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/Lexer/PH5P.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/Node.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/Node/Comment.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/Node/Element.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/Node/Text.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/PercentEncoder.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/Printer.php plugins/wordpress-mobile-pack/libs/htmlpur ifier-4.8.0/library/HTMLPurifier/Printer/CSSDefinition.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/Printer/ConfigForm.css plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/Printer/ConfigForm.js plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/Printer/ConfigForm.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/Printer/HTMLDefinition.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/PropertyList.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/PropertyListIterator.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/Queue.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/Strategy.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/Strategy/Composite.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/Strat egy/Core.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/Strategy/FixNesting.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/Strategy/MakeWellFormed.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/Strategy/RemoveForeignElements.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/Strategy/ValidateAttributes.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/StringHash.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/StringHashParser.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/TagTransform.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/TagTransform/Font.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/TagTransform/Simple.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/Token.php plugin s/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/Token/Comment.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/Token/Empty.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/Token/End.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/Token/Start.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/Token/Tag.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/Token/Text.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/TokenFactory.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/URI.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/URIDefinition.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/URIFilter.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/URIFilter/DisableExternal.ph p plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/URIFilter/DisableExternalResources.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/URIFilter/DisableResources.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/URIFilter/HostBlacklist.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/URIFilter/MakeAbsolute.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/URIFilter/Munge.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/URIFilter/SafeIframe.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/URIParser.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/URIScheme.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/URIScheme/callto.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/URIScheme/data.php plugins /wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/URIScheme/file.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/URIScheme/ftp.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/URIScheme/http.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/URIScheme/https.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/URIScheme/mailto.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/URIScheme/news.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/URIScheme/nntp.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/URIScheme/skype.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/URIScheme/sms.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/URIScheme/tel.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/H TMLPurifier/URIScheme/whatsapp.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/URISchemeRegistry.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/UnitConverter.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/VarParser.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/VarParser/Flexible.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/VarParser/Native.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/VarParserException.php plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/Zipper.php plugins/wordpress-mobile-pack/readme.txt plugins/wordpress-mobile-pack/wordpress-mobile-pack.php X-VCS-Directories: plugins/wordpress-mobile-pack/frontend/ plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/Interchange/ plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/Filter/ plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/Printer/ plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/Language/classes/ plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/HTMLModule/ plugins/wordpress-mobile-pack/admin/sass/mixins/ plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/AttrDef/HTML/ plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/AttrDef/HTML/ plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/AttrDef/URI/ plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/ plugins/wordpress-mobile-pack/inc/ plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/Pri nter/ plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/Language/messages/ plugins/wordpress-mobile-pack/admin/sass/modules/ plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/AttrDef/CSS/ plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/AttrDef/URI/Email/ plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/DefinitionCache/Serializer/ plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/ConfigSchema/ plugins/wordpress-mobile-pack/ plugins/wordpress-mobile-pack/admin/sass/core/ plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/ChildDef/ plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/AttrDef/ plugins/wordpress-mobile-pack/admin/ plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/AttrDef/URI/Email/ plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/Language/messages/ p lugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/VarParser/ plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/URIScheme/ plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/URIScheme/ plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/ plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/AttrDef/URI/ plugins/wordpress-mobile-pack/frontend/themes/app1/ plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/ plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/Injector/ plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/Strategy/ plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/HTMLModule/Tidy/ plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/Language/classes/ plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/DefinitionCache/Se rializer/ plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/VarParser/ plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/HTMLModule/Tidy/ plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/Lexer/ plugins/wordpress-mobile-pack/admin/sass/fonts/ plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/Node/ plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/ plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/URIFilter/ plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/ plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/TagTransform/ plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/EntityLookup/ plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/HTMLModule/ plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/ ConfigSchema/Builder/ plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/Injector/ plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/AttrDef/ plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/DefinitionCache/ plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/ConfigSchema/schema/ plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/DefinitionCache/Decorator/ plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/AttrTransform/ plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/ plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/ChildDef/ plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/AttrTransform/ plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/AttrDef/CSS/ plugins/wordpress-mobile-pack/admin/js/UI.Modules/Theming/ plugins/wordpress-mobile-pac k/export/ plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/Node/ plugins/wordpress-mobile-pack/core/ plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/URIFilter/ plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/Lexer/ plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/Token/ plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/DefinitionCache/ plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/EntityLookup/ plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/Filter/ plugins/wordpress-mobile-pack/admin/sass/ plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/ConfigSchema/Interchange/ plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/DefinitionCache/Decorator/ plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/Token/ plugins/wordpress-mobile-pack /libs/htmlpurifier-4.8.0/library/HTMLPurifier/Strategy/ plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/Builder/ plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/TagTransform/ plugins/wordpress-mobile-pack/admin/pages/ X-VCS-Committer: blueness X-VCS-Committer-Name: Anthony G. Basile X-VCS-Revision: e3ad53d7999e6002933959f97e3d5bee89009a83 X-VCS-Branch: master Date: Sat, 25 Mar 2017 17:27:42 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Archives-Salt: 062973b5-4840-4d35-b7f7-d78441c7a490 X-Archives-Hash: 502060671c2bdea1dcd61640eaa6db66 commit: e3ad53d7999e6002933959f97e3d5bee89009a83 Author: Anthony G. Basile gentoo org> AuthorDate: Sat Mar 25 17:26:44 2017 +0000 Commit: Anthony G. Basile gentoo org> CommitDate: Sat Mar 25 17:26:51 2017 +0000 URL: https://gitweb.gentoo.org/proj/blogs-gentoo.git/commit/?id=e3ad53d7 Update plugin wordpress-mobile-pack 2.2.9 .../admin/class-admin-init.php | 33 +- .../admin/js/UI.Modules/Theming/WMP_EDIT_THEME.js | 455 +- .../js/UI.Modules/Theming/WMP_EDIT_THEME.min.js | 2 +- .../admin/pages/theme-settings.php | 62 +- plugins/wordpress-mobile-pack/admin/sass/config.rb | 21 - .../admin/sass/core/_buttons.scss | 110 - .../admin/sass/core/_core.scss | 448 - .../admin/sass/core/_fonts.scss | 11 - .../admin/sass/core/_forms.scss | 409 - .../wordpress-mobile-pack/admin/sass/core/_ie.scss | 6 - .../admin/sass/core/_variables.scss | 102 - .../admin/sass/fonts/acorde-regular.eot | Bin 25550 -> 0 bytes .../admin/sass/fonts/acorde-regular.otf | Bin 142648 -> 0 bytes .../admin/sass/fonts/acorde-regular.svg | 1449 --- .../admin/sass/fonts/acorde-regular.ttf | Bin 78548 -> 0 bytes .../admin/sass/fonts/acorde-regular.woff | Bin 28940 -> 0 bytes .../admin/sass/fonts/acorde-semibold.eot | Bin 26084 -> 0 bytes .../admin/sass/fonts/acorde-semibold.otf | Bin 140888 -> 0 bytes .../admin/sass/fonts/acorde-semibold.svg | 1522 ---- .../admin/sass/fonts/acorde-semibold.ttf | Bin 75088 -> 0 bytes .../admin/sass/fonts/acorde-semibold.woff | Bin 29404 -> 0 bytes .../admin/sass/fonts/ol-round-gothic-light.eot | Bin 15471 -> 0 bytes .../admin/sass/fonts/ol-round-gothic-light.otf | Bin 64032 -> 0 bytes .../admin/sass/fonts/ol-round-gothic-light.svg | 1021 --- .../admin/sass/fonts/ol-round-gothic-light.ttf | Bin 36324 -> 0 bytes .../admin/sass/fonts/ol-round-gothic-light.woff | Bin 17720 -> 0 bytes .../admin/sass/fonts/open-sans-regular.eot | Bin 21096 -> 0 bytes .../admin/sass/fonts/open-sans-regular.otf | Bin 54272 -> 0 bytes .../admin/sass/fonts/open-sans-regular.svg | 1825 ---- .../admin/sass/fonts/open-sans-regular.ttf | Bin 45112 -> 0 bytes .../admin/sass/fonts/open-sans-regular.woff | Bin 24728 -> 0 bytes .../admin/sass/fonts/opensans-italic.eot | Bin 23404 -> 0 bytes .../admin/sass/fonts/opensans-italic.svg | 1825 ---- .../admin/sass/fonts/opensans-italic.ttf | Bin 51188 -> 0 bytes .../admin/sass/fonts/opensans-italic.woff | Bin 27212 -> 0 bytes .../admin/sass/fonts/opensans-semibold.eot | Bin 21299 -> 0 bytes .../admin/sass/fonts/opensans-semibold.svg | 1825 ---- .../admin/sass/fonts/opensans-semibold.ttf | Bin 45160 -> 0 bytes .../admin/sass/fonts/opensans-semibold.woff | Bin 24912 -> 0 bytes .../admin/sass/fonts/wp-font.eot | Bin 7112 -> 0 bytes .../admin/sass/fonts/wp-font.svg | 38 - .../admin/sass/fonts/wp-font.ttf | Bin 6920 -> 0 bytes .../admin/sass/fonts/wp-font.woff | Bin 6996 -> 0 bytes .../wordpress-mobile-pack/admin/sass/general.scss | 33 - .../admin/sass/mixins/_display.scss | 154 - .../admin/sass/mixins/_icon.scss | 58 - .../admin/sass/mixins/_mixins.scss | 115 - .../admin/sass/modules/_content.scss | 398 - .../admin/sass/modules/_look-and-feel.scss | 287 - .../admin/sass/modules/_perfect-scrollbar.scss | 128 - .../admin/sass/modules/_settings.scss | 40 - .../admin/sass/modules/_themes.scss | 265 - .../admin/sass/modules/_whats-new.scss | 107 - plugins/wordpress-mobile-pack/core/config.php | 2 +- .../wordpress-mobile-pack/export/class-export.php | 35 +- plugins/wordpress-mobile-pack/export/content.php | 2 +- .../frontend/class-application.php | 6 + .../frontend/themes/app1/template.php | 7 + .../inc/class-wmp-formatter.php | 422 +- .../inc/class-wmp-themes-config.php | 229 +- .../library/HTMLPurifier.composer.php | 4 - .../library/HTMLPurifier/ConfigSchema/schema.ser | Bin 15000 -> 0 bytes .../ConfigSchema/schema/Filter.Iframe.txt | 12 - .../library/HTMLPurifier/URIScheme/tel.php | 31 - .../library/HTMLPurifier.auto.php | 22 +- .../library/HTMLPurifier.autoload.php | 54 +- .../library/HTMLPurifier.composer.php | 4 + .../library/HTMLPurifier.func.php | 50 +- .../library/HTMLPurifier.includes.php | 461 +- .../library/HTMLPurifier.kses.php | 60 +- .../library/HTMLPurifier.path.php | 22 +- .../library/HTMLPurifier.php | 584 +- .../library/HTMLPurifier.safe-includes.php | 458 +- .../library/HTMLPurifier/Arborize.php | 142 +- .../library/HTMLPurifier/AttrCollections.php | 291 +- .../library/HTMLPurifier/AttrDef.php | 276 +- .../library/HTMLPurifier/AttrDef/CSS.php | 217 +- .../HTMLPurifier/AttrDef/CSS/AlphaValue.php | 68 +- .../HTMLPurifier/AttrDef/CSS/Background.php | 222 +- .../AttrDef/CSS/BackgroundPosition.php | 314 +- .../library/HTMLPurifier/AttrDef/CSS/Border.php | 112 +- .../library/HTMLPurifier/AttrDef/CSS/Color.php | 210 +- .../library/HTMLPurifier/AttrDef/CSS/Composite.php | 96 +- .../AttrDef/CSS/DenyElementDecorator.php | 88 +- .../library/HTMLPurifier/AttrDef/CSS/Filter.php | 154 +- .../library/HTMLPurifier/AttrDef/CSS/Font.php | 352 +- .../HTMLPurifier/AttrDef/CSS/FontFamily.php | 438 +- .../library/HTMLPurifier/AttrDef/CSS/Ident.php | 64 +- .../AttrDef/CSS/ImportantDecorator.php | 112 +- .../library/HTMLPurifier/AttrDef/CSS/Length.php | 154 +- .../library/HTMLPurifier/AttrDef/CSS/ListStyle.php | 224 +- .../library/HTMLPurifier/AttrDef/CSS/Multiple.php | 142 +- .../library/HTMLPurifier/AttrDef/CSS/Number.php | 168 +- .../HTMLPurifier/AttrDef/CSS/Percentage.php | 108 +- .../HTMLPurifier/AttrDef/CSS/TextDecoration.php | 92 +- .../library/HTMLPurifier/AttrDef/CSS/URI.php | 151 +- .../library/HTMLPurifier/AttrDef/Clone.php | 88 +- .../library/HTMLPurifier/AttrDef/Enum.php | 146 +- .../library/HTMLPurifier/AttrDef/HTML/Bool.php | 99 +- .../library/HTMLPurifier/AttrDef/HTML/Class.php | 96 +- .../library/HTMLPurifier/AttrDef/HTML/Color.php | 102 +- .../HTMLPurifier/AttrDef/HTML/FrameTarget.php | 76 +- .../library/HTMLPurifier/AttrDef/HTML/ID.php | 218 +- .../library/HTMLPurifier/AttrDef/HTML/Length.php | 112 +- .../HTMLPurifier/AttrDef/HTML/LinkTypes.php | 144 +- .../HTMLPurifier/AttrDef/HTML/MultiLength.php | 120 +- .../library/HTMLPurifier/AttrDef/HTML/Nmtokens.php | 140 +- .../library/HTMLPurifier/AttrDef/HTML/Pixels.php | 152 +- .../library/HTMLPurifier/AttrDef/Integer.php | 182 +- .../library/HTMLPurifier/AttrDef/Lang.php | 172 +- .../library/HTMLPurifier/AttrDef/Switch.php | 106 +- .../library/HTMLPurifier/AttrDef/Text.php | 42 +- .../library/HTMLPurifier/AttrDef/URI.php | 222 +- .../library/HTMLPurifier/AttrDef/URI/Email.php | 40 +- .../HTMLPurifier/AttrDef/URI/Email/SimpleCheck.php | 58 +- .../library/HTMLPurifier/AttrDef/URI/Host.php | 265 +- .../library/HTMLPurifier/AttrDef/URI/IPv4.php | 90 +- .../library/HTMLPurifier/AttrDef/URI/IPv6.php | 178 +- .../library/HTMLPurifier/AttrTransform.php | 120 +- .../HTMLPurifier/AttrTransform/Background.php | 56 +- .../library/HTMLPurifier/AttrTransform/BdoDir.php | 54 +- .../library/HTMLPurifier/AttrTransform/BgColor.php | 56 +- .../HTMLPurifier/AttrTransform/BoolToCSS.php | 94 +- .../library/HTMLPurifier/AttrTransform/Border.php | 52 +- .../HTMLPurifier/AttrTransform/EnumToCSS.php | 136 +- .../HTMLPurifier/AttrTransform/ImgRequired.php | 95 +- .../HTMLPurifier/AttrTransform/ImgSpace.php | 122 +- .../library/HTMLPurifier/AttrTransform/Input.php | 112 +- .../library/HTMLPurifier/AttrTransform/Lang.php | 62 +- .../library/HTMLPurifier/AttrTransform/Length.php | 90 +- .../library/HTMLPurifier/AttrTransform/Name.php | 66 +- .../HTMLPurifier/AttrTransform/NameSync.php | 82 +- .../HTMLPurifier/AttrTransform/Nofollow.php | 104 +- .../HTMLPurifier/AttrTransform/SafeEmbed.php | 50 +- .../HTMLPurifier/AttrTransform/SafeObject.php | 56 +- .../HTMLPurifier/AttrTransform/SafeParam.php | 158 +- .../HTMLPurifier/AttrTransform/ScriptRequired.php | 46 +- .../HTMLPurifier/AttrTransform/TargetBlank.php | 90 +- .../AttrTransform/TargetNoreferrer.php | 37 + .../HTMLPurifier/AttrTransform/Textarea.php | 54 +- .../library/HTMLPurifier/AttrTypes.php | 192 +- .../library/HTMLPurifier/AttrValidator.php | 356 +- .../library/HTMLPurifier/Bootstrap.php | 248 +- .../library/HTMLPurifier/CSSDefinition.php | 961 +- .../library/HTMLPurifier/ChildDef.php | 104 +- .../library/HTMLPurifier/ChildDef/Chameleon.php | 134 +- .../library/HTMLPurifier/ChildDef/Custom.php | 204 +- .../library/HTMLPurifier/ChildDef/Empty.php | 76 +- .../library/HTMLPurifier/ChildDef/List.php | 178 +- .../library/HTMLPurifier/ChildDef/Optional.php | 90 +- .../library/HTMLPurifier/ChildDef/Required.php | 236 +- .../HTMLPurifier/ChildDef/StrictBlockquote.php | 220 +- .../library/HTMLPurifier/ChildDef/Table.php | 448 +- .../library/HTMLPurifier/Config.php | 1831 ++-- .../library/HTMLPurifier/ConfigSchema.php | 352 +- .../ConfigSchema/Builder/ConfigSchema.php | 96 +- .../HTMLPurifier/ConfigSchema/Builder/Xml.php | 288 +- .../HTMLPurifier/ConfigSchema/Exception.php | 22 +- .../HTMLPurifier/ConfigSchema/Interchange.php | 94 +- .../ConfigSchema/Interchange/Directive.php | 178 +- .../HTMLPurifier/ConfigSchema/Interchange/Id.php | 116 +- .../ConfigSchema/InterchangeBuilder.php | 452 +- .../HTMLPurifier/ConfigSchema/Validator.php | 496 +- .../HTMLPurifier/ConfigSchema/ValidatorAtom.php | 260 +- .../library/HTMLPurifier/ConfigSchema/schema.ser | Bin 0 -> 15598 bytes .../ConfigSchema/schema/Attr.AllowedClasses.txt | 16 +- .../schema/Attr.AllowedFrameTargets.txt | 24 +- .../ConfigSchema/schema/Attr.AllowedRel.txt | 18 +- .../ConfigSchema/schema/Attr.AllowedRev.txt | 18 +- .../ConfigSchema/schema/Attr.ClassUseCDATA.txt | 38 +- .../ConfigSchema/schema/Attr.DefaultImageAlt.txt | 22 +- .../schema/Attr.DefaultInvalidImage.txt | 18 +- .../schema/Attr.DefaultInvalidImageAlt.txt | 16 +- .../ConfigSchema/schema/Attr.DefaultTextDir.txt | 20 +- .../ConfigSchema/schema/Attr.EnableID.txt | 32 +- .../ConfigSchema/schema/Attr.ForbiddenClasses.txt | 16 +- .../ConfigSchema/schema/Attr.ID.HTML5.txt | 10 + .../ConfigSchema/schema/Attr.IDBlacklist.txt | 10 +- .../ConfigSchema/schema/Attr.IDBlacklistRegexp.txt | 18 +- .../ConfigSchema/schema/Attr.IDPrefix.txt | 24 +- .../ConfigSchema/schema/Attr.IDPrefixLocal.txt | 28 +- .../schema/AutoFormat.AutoParagraph.txt | 62 +- .../ConfigSchema/schema/AutoFormat.Custom.txt | 24 +- .../schema/AutoFormat.DisplayLinkURI.txt | 22 +- .../ConfigSchema/schema/AutoFormat.Linkify.txt | 24 +- .../schema/AutoFormat.PurifierLinkify.DocURL.txt | 24 +- .../schema/AutoFormat.PurifierLinkify.txt | 24 +- .../schema/AutoFormat.RemoveEmpty.Predicate.txt | 14 + ...utoFormat.RemoveEmpty.RemoveNbsp.Exceptions.txt | 22 +- .../schema/AutoFormat.RemoveEmpty.RemoveNbsp.txt | 30 +- .../ConfigSchema/schema/AutoFormat.RemoveEmpty.txt | 92 +- .../AutoFormat.RemoveSpansWithoutAttributes.txt | 22 +- .../ConfigSchema/schema/CSS.AllowDuplicates.txt | 11 + .../ConfigSchema/schema/CSS.AllowImportant.txt | 16 +- .../ConfigSchema/schema/CSS.AllowTricky.txt | 22 +- .../ConfigSchema/schema/CSS.AllowedFonts.txt | 24 +- .../ConfigSchema/schema/CSS.AllowedProperties.txt | 36 +- .../ConfigSchema/schema/CSS.DefinitionRev.txt | 22 +- .../schema/CSS.ForbiddenProperties.txt | 26 +- .../ConfigSchema/schema/CSS.MaxImgLength.txt | 32 +- .../ConfigSchema/schema/CSS.Proprietary.txt | 20 +- .../ConfigSchema/schema/CSS.Trusted.txt | 18 +- .../ConfigSchema/schema/Cache.DefinitionImpl.txt | 28 +- .../ConfigSchema/schema/Cache.SerializerPath.txt | 26 +- .../schema/Cache.SerializerPermissions.txt | 27 +- .../ConfigSchema/schema/Core.AggressivelyFixLt.txt | 36 +- .../schema/Core.AllowHostnameUnderscore.txt | 32 +- .../ConfigSchema/schema/Core.CollectErrors.txt | 24 +- .../ConfigSchema/schema/Core.ColorKeywords.txt | 58 +- .../schema/Core.ConvertDocumentToFragment.txt | 28 +- .../Core.DirectLexLineNumberSyncInterval.txt | 34 +- .../ConfigSchema/schema/Core.DisableExcludes.txt | 28 +- .../ConfigSchema/schema/Core.EnableIDNA.txt | 18 +- .../ConfigSchema/schema/Core.Encoding.txt | 30 +- .../schema/Core.EscapeInvalidChildren.txt | 24 +- .../ConfigSchema/schema/Core.EscapeInvalidTags.txt | 14 +- .../schema/Core.EscapeNonASCIICharacters.txt | 26 +- .../ConfigSchema/schema/Core.HiddenElements.txt | 38 +- .../ConfigSchema/schema/Core.Language.txt | 20 +- .../ConfigSchema/schema/Core.LexerImpl.txt | 68 +- .../schema/Core.MaintainLineNumbers.txt | 32 +- .../ConfigSchema/schema/Core.NormalizeNewlines.txt | 22 +- .../ConfigSchema/schema/Core.RemoveInvalidImg.txt | 24 +- .../schema/Core.RemoveProcessingInstructions.txt | 22 +- .../schema/Core.RemoveScriptContents.txt | 24 +- .../ConfigSchema/schema/Filter.Custom.txt | 22 +- .../schema/Filter.ExtractStyleBlocks.Escaping.txt | 28 +- .../schema/Filter.ExtractStyleBlocks.Scope.txt | 58 +- .../schema/Filter.ExtractStyleBlocks.TidyImpl.txt | 32 +- .../schema/Filter.ExtractStyleBlocks.txt | 148 +- .../ConfigSchema/schema/Filter.YouTube.txt | 32 +- .../ConfigSchema/schema/HTML.Allowed.txt | 50 +- .../ConfigSchema/schema/HTML.AllowedAttributes.txt | 38 +- .../ConfigSchema/schema/HTML.AllowedComments.txt | 20 +- .../schema/HTML.AllowedCommentsRegexp.txt | 30 +- .../ConfigSchema/schema/HTML.AllowedElements.txt | 46 +- .../ConfigSchema/schema/HTML.AllowedModules.txt | 40 +- .../schema/HTML.Attr.Name.UseCDATA.txt | 22 +- .../ConfigSchema/schema/HTML.BlockWrapper.txt | 36 +- .../ConfigSchema/schema/HTML.CoreModules.txt | 46 +- .../ConfigSchema/schema/HTML.CustomDoctype.txt | 18 +- .../ConfigSchema/schema/HTML.DefinitionID.txt | 66 +- .../ConfigSchema/schema/HTML.DefinitionRev.txt | 32 +- .../ConfigSchema/schema/HTML.Doctype.txt | 22 +- .../schema/HTML.FlashAllowFullScreen.txt | 22 +- .../schema/HTML.ForbiddenAttributes.txt | 42 +- .../ConfigSchema/schema/HTML.ForbiddenElements.txt | 40 +- .../ConfigSchema/schema/HTML.MaxImgLength.txt | 28 +- .../ConfigSchema/schema/HTML.Nofollow.txt | 14 +- .../ConfigSchema/schema/HTML.Parent.txt | 24 +- .../ConfigSchema/schema/HTML.Proprietary.txt | 24 +- .../ConfigSchema/schema/HTML.SafeEmbed.txt | 26 +- .../ConfigSchema/schema/HTML.SafeIframe.txt | 26 +- .../ConfigSchema/schema/HTML.SafeObject.txt | 26 +- .../ConfigSchema/schema/HTML.SafeScripting.txt | 20 +- .../ConfigSchema/schema/HTML.Strict.txt | 18 +- .../ConfigSchema/schema/HTML.TargetBlank.txt | 16 +- .../ConfigSchema/schema/HTML.TargetNoreferrer.txt | 9 + .../ConfigSchema/schema/HTML.TidyAdd.txt | 16 +- .../ConfigSchema/schema/HTML.TidyLevel.txt | 48 +- .../ConfigSchema/schema/HTML.TidyRemove.txt | 16 +- .../ConfigSchema/schema/HTML.Trusted.txt | 18 +- .../ConfigSchema/schema/HTML.XHTML.txt | 22 +- .../schema/Output.CommentScriptContents.txt | 20 +- .../ConfigSchema/schema/Output.FixInnerHTML.txt | 30 +- .../ConfigSchema/schema/Output.FlashCompat.txt | 22 +- .../ConfigSchema/schema/Output.Newline.txt | 26 +- .../ConfigSchema/schema/Output.SortAttr.txt | 28 +- .../ConfigSchema/schema/Output.TidyFormat.txt | 50 +- .../ConfigSchema/schema/Test.ForceNoIconv.txt | 14 +- .../ConfigSchema/schema/URI.AllowedSchemes.txt | 35 +- .../HTMLPurifier/ConfigSchema/schema/URI.Base.txt | 34 +- .../ConfigSchema/schema/URI.DefaultScheme.txt | 20 +- .../ConfigSchema/schema/URI.DefinitionID.txt | 22 +- .../ConfigSchema/schema/URI.DefinitionRev.txt | 22 +- .../ConfigSchema/schema/URI.Disable.txt | 28 +- .../ConfigSchema/schema/URI.DisableExternal.txt | 22 +- .../schema/URI.DisableExternalResources.txt | 26 +- .../ConfigSchema/schema/URI.DisableResources.txt | 30 +- .../HTMLPurifier/ConfigSchema/schema/URI.Host.txt | 38 +- .../ConfigSchema/schema/URI.HostBlacklist.txt | 18 +- .../ConfigSchema/schema/URI.MakeAbsolute.txt | 26 +- .../HTMLPurifier/ConfigSchema/schema/URI.Munge.txt | 166 +- .../ConfigSchema/schema/URI.MungeResources.txt | 34 +- .../ConfigSchema/schema/URI.MungeSecretKey.txt | 60 +- .../schema/URI.OverrideAllowedSchemes.txt | 18 +- .../ConfigSchema/schema/URI.SafeIframeRegexp.txt | 44 +- .../HTMLPurifier/ConfigSchema/schema/info.ini | 6 +- .../library/HTMLPurifier/ContentSets.php | 340 +- .../library/HTMLPurifier/Context.php | 190 +- .../library/HTMLPurifier/Definition.php | 110 +- .../library/HTMLPurifier/DefinitionCache.php | 258 +- .../HTMLPurifier/DefinitionCache/Decorator.php | 224 +- .../DefinitionCache/Decorator/Cleanup.php | 156 +- .../DefinitionCache/Decorator/Memory.php | 170 +- .../DefinitionCache/Decorator/Template.php.in | 164 +- .../library/HTMLPurifier/DefinitionCache/Null.php | 152 +- .../HTMLPurifier/DefinitionCache/Serializer.php | 598 +- .../HTMLPurifier/DefinitionCache/Serializer/README | 6 +- .../HTMLPurifier/DefinitionCacheFactory.php | 212 +- .../library/HTMLPurifier/Doctype.php | 146 +- .../library/HTMLPurifier/DoctypeRegistry.php | 284 +- .../library/HTMLPurifier/ElementDef.php | 432 +- .../library/HTMLPurifier/Encoder.php | 1222 +-- .../library/HTMLPurifier/EntityLookup.php | 96 +- .../library/HTMLPurifier/EntityLookup/entities.ser | 0 .../library/HTMLPurifier/EntityParser.php | 306 +- .../library/HTMLPurifier/ErrorCollector.php | 488 +- .../library/HTMLPurifier/ErrorStruct.php | 148 +- .../library/HTMLPurifier/Exception.php | 24 +- .../library/HTMLPurifier/Filter.php | 112 +- .../HTMLPurifier/Filter/ExtractStyleBlocks.php | 676 +- .../library/HTMLPurifier/Filter/YouTube.php | 130 +- .../library/HTMLPurifier/Generator.php | 572 +- .../library/HTMLPurifier/HTMLDefinition.php | 986 +- .../library/HTMLPurifier/HTMLModule.php | 568 +- .../library/HTMLPurifier/HTMLModule/Bdo.php | 88 +- .../HTMLPurifier/HTMLModule/CommonAttributes.php | 62 +- .../library/HTMLPurifier/HTMLModule/Edit.php | 110 +- .../library/HTMLPurifier/HTMLModule/Forms.php | 380 +- .../library/HTMLPurifier/HTMLModule/Hypertext.php | 80 +- .../library/HTMLPurifier/HTMLModule/Iframe.php | 102 +- .../library/HTMLPurifier/HTMLModule/Image.php | 98 +- .../library/HTMLPurifier/HTMLModule/Legacy.php | 372 +- .../library/HTMLPurifier/HTMLModule/List.php | 102 +- .../library/HTMLPurifier/HTMLModule/Name.php | 52 +- .../library/HTMLPurifier/HTMLModule/Nofollow.php | 50 +- .../HTMLModule/NonXMLCommonAttributes.php | 40 +- .../library/HTMLPurifier/HTMLModule/Object.php | 124 +- .../HTMLPurifier/HTMLModule/Presentation.php | 84 +- .../HTMLPurifier/HTMLModule/Proprietary.php | 80 +- .../library/HTMLPurifier/HTMLModule/Ruby.php | 72 +- .../library/HTMLPurifier/HTMLModule/SafeEmbed.php | 80 +- .../library/HTMLPurifier/HTMLModule/SafeObject.php | 124 +- .../HTMLPurifier/HTMLModule/SafeScripting.php | 80 +- .../library/HTMLPurifier/HTMLModule/Scripting.php | 146 +- .../HTMLPurifier/HTMLModule/StyleAttribute.php | 66 +- .../library/HTMLPurifier/HTMLModule/Tables.php | 150 +- .../library/HTMLPurifier/HTMLModule/Target.php | 56 +- .../HTMLPurifier/HTMLModule/TargetBlank.php | 48 +- .../HTMLPurifier/HTMLModule/TargetNoreferrer.php | 21 + .../library/HTMLPurifier/HTMLModule/Text.php | 174 +- .../library/HTMLPurifier/HTMLModule/Tidy.php | 460 +- .../library/HTMLPurifier/HTMLModule/Tidy/Name.php | 66 +- .../HTMLPurifier/HTMLModule/Tidy/Proprietary.php | 68 +- .../HTMLPurifier/HTMLModule/Tidy/Strict.php | 86 +- .../HTMLPurifier/HTMLModule/Tidy/Transitional.php | 32 +- .../library/HTMLPurifier/HTMLModule/Tidy/XHTML.php | 52 +- .../HTMLPurifier/HTMLModule/Tidy/XHTMLAndHTML4.php | 358 +- .../HTMLModule/XMLCommonAttributes.php | 40 +- .../library/HTMLPurifier/HTMLModuleManager.php | 923 +- .../library/HTMLPurifier/IDAccumulator.php | 114 +- .../library/HTMLPurifier/Injector.php | 562 +- .../HTMLPurifier/Injector/AutoParagraph.php | 712 +- .../HTMLPurifier/Injector/DisplayLinkURI.php | 80 +- .../library/HTMLPurifier/Injector/Linkify.php | 123 +- .../HTMLPurifier/Injector/PurifierLinkify.php | 142 +- .../library/HTMLPurifier/Injector/RemoveEmpty.php | 213 +- .../Injector/RemoveSpansWithoutAttributes.php | 168 +- .../library/HTMLPurifier/Injector/SafeObject.php | 245 +- .../library/HTMLPurifier/Language.php | 408 +- .../HTMLPurifier/Language/classes/en-x-test.php | 18 +- .../HTMLPurifier/Language/messages/en-x-test.php | 22 +- .../Language/messages/en-x-testmini.php | 24 +- .../library/HTMLPurifier/Language/messages/en.php | 110 +- .../library/HTMLPurifier/LanguageFactory.php | 418 +- .../library/HTMLPurifier/Length.php | 320 +- .../library/HTMLPurifier/Lexer.php | 719 +- .../library/HTMLPurifier/Lexer/DOMLex.php | 559 +- .../library/HTMLPurifier/Lexer/DirectLex.php | 1078 +-- .../library/HTMLPurifier/Lexer/PH5P.php | 9575 ++++++++++---------- .../library/HTMLPurifier/Node.php | 98 +- .../library/HTMLPurifier/Node/Comment.php | 72 +- .../library/HTMLPurifier/Node/Element.php | 118 +- .../library/HTMLPurifier/Node/Text.php | 108 +- .../library/HTMLPurifier/PercentEncoder.php | 222 +- .../library/HTMLPurifier/Printer.php | 436 +- .../library/HTMLPurifier/Printer/CSSDefinition.php | 88 +- .../library/HTMLPurifier/Printer/ConfigForm.css | 20 +- .../library/HTMLPurifier/Printer/ConfigForm.js | 10 +- .../library/HTMLPurifier/Printer/ConfigForm.php | 898 +- .../HTMLPurifier/Printer/HTMLDefinition.php | 648 +- .../library/HTMLPurifier/PropertyList.php | 244 +- .../library/HTMLPurifier/PropertyListIterator.php | 84 +- .../library/HTMLPurifier/Queue.php | 112 +- .../library/HTMLPurifier/Strategy.php | 52 +- .../library/HTMLPurifier/Strategy/Composite.php | 60 +- .../library/HTMLPurifier/Strategy/Core.php | 34 +- .../library/HTMLPurifier/Strategy/FixNesting.php | 362 +- .../HTMLPurifier/Strategy/MakeWellFormed.php | 1200 +-- .../Strategy/RemoveForeignElements.php | 414 +- .../HTMLPurifier/Strategy/ValidateAttributes.php | 90 +- .../library/HTMLPurifier/StringHash.php | 94 +- .../library/HTMLPurifier/StringHashParser.php | 272 +- .../library/HTMLPurifier/TagTransform.php | 74 +- .../library/HTMLPurifier/TagTransform/Font.php | 228 +- .../library/HTMLPurifier/TagTransform/Simple.php | 88 +- .../library/HTMLPurifier/Token.php | 200 +- .../library/HTMLPurifier/Token/Comment.php | 76 +- .../library/HTMLPurifier/Token/Empty.php | 30 +- .../library/HTMLPurifier/Token/End.php | 48 +- .../library/HTMLPurifier/Token/Start.php | 20 +- .../library/HTMLPurifier/Token/Tag.php | 136 +- .../library/HTMLPurifier/Token/Text.php | 106 +- .../library/HTMLPurifier/TokenFactory.php | 236 +- .../library/HTMLPurifier/URI.php | 628 +- .../library/HTMLPurifier/URIDefinition.php | 224 +- .../library/HTMLPurifier/URIFilter.php | 148 +- .../HTMLPurifier/URIFilter/DisableExternal.php | 108 +- .../URIFilter/DisableExternalResources.php | 50 +- .../HTMLPurifier/URIFilter/DisableResources.php | 44 +- .../HTMLPurifier/URIFilter/HostBlacklist.php | 92 +- .../HTMLPurifier/URIFilter/MakeAbsolute.php | 316 +- .../library/HTMLPurifier/URIFilter/Munge.php | 230 +- .../library/HTMLPurifier/URIFilter/SafeIframe.php | 136 +- .../library/HTMLPurifier/URIParser.php | 142 +- .../library/HTMLPurifier/URIScheme.php | 204 +- .../library/HTMLPurifier/URIScheme/callto.php | 62 +- .../library/HTMLPurifier/URIScheme/data.php | 263 +- .../library/HTMLPurifier/URIScheme/file.php | 88 +- .../library/HTMLPurifier/URIScheme/ftp.php | 116 +- .../library/HTMLPurifier/URIScheme/http.php | 72 +- .../library/HTMLPurifier/URIScheme/https.php | 36 +- .../library/HTMLPurifier/URIScheme/mailto.php | 80 +- .../library/HTMLPurifier/URIScheme/news.php | 70 +- .../library/HTMLPurifier/URIScheme/nntp.php | 64 +- .../library/HTMLPurifier/URIScheme/skype.php | 64 +- .../library/HTMLPurifier/URIScheme/sms.php | 62 +- .../library/HTMLPurifier/URIScheme/tel.php | 46 + .../library/HTMLPurifier/URIScheme/whatsapp.php | 62 +- .../library/HTMLPurifier/URISchemeRegistry.php | 162 +- .../library/HTMLPurifier/UnitConverter.php | 614 +- .../library/HTMLPurifier/VarParser.php | 396 +- .../library/HTMLPurifier/VarParser/Flexible.php | 260 +- .../library/HTMLPurifier/VarParser/Native.php | 76 +- .../library/HTMLPurifier/VarParserException.php | 22 +- .../library/HTMLPurifier/Zipper.php | 314 +- plugins/wordpress-mobile-pack/readme.txt | 14 +- .../wordpress-mobile-pack.php | 6 +- 439 files changed, 32484 insertions(+), 44430 deletions(-) diff --git a/plugins/wordpress-mobile-pack/admin/class-admin-init.php b/plugins/wordpress-mobile-pack/admin/class-admin-init.php index e85f61b..2e374f0 100755 --- a/plugins/wordpress-mobile-pack/admin/class-admin-init.php +++ b/plugins/wordpress-mobile-pack/admin/class-admin-init.php @@ -104,15 +104,6 @@ if ( ! class_exists( 'WMobilePack_Admin_Init' ) ) { /** - * - * The oldest Wordpress version that will enable the custom select - * @var float - */ - public static $customselect_enable = 3.6; - - - - /** * Class constructor * * Init admin menu and enqueue general Javascript & CSS files @@ -210,13 +201,8 @@ if ( ! class_exists( 'WMobilePack_Admin_Init' ) ) { wp_enqueue_style(WMobilePack_Options::$prefix.'css_general', plugins_url(WMP_DOMAIN.'/admin/css/general.css'), array(), WMP_VERSION); // enqueue scripts - $blog_version = floatval(get_bloginfo('version')); - if ($blog_version < 3.6) - $dependencies = array('jquery'); - else - $dependencies = array('jquery-core', 'jquery-migrate'); + $dependencies = array('jquery-core', 'jquery-migrate'); - // enqueue scripts wp_enqueue_script(WMobilePack_Options::$prefix.'js_validate', plugins_url(WMP_DOMAIN.'/admin/js/UI.Interface/Lib/jquery.validate.min.js'), $dependencies, '1.11.1'); wp_enqueue_script(WMobilePack_Options::$prefix.'js_validate_additional', plugins_url(WMP_DOMAIN.'/admin/js/UI.Interface/Lib/validate-additional-methods.min.js'), $dependencies, '1.11.1'); wp_enqueue_script(WMobilePack_Options::$prefix.'js_loader', plugins_url(WMP_DOMAIN.'/admin/js/UI.Interface/Loader.min.js'), $dependencies, WMP_VERSION); @@ -255,18 +241,13 @@ if ( ! class_exists( 'WMobilePack_Admin_Init' ) ) { public function wmp_admin_load_theme_settings_js() { - $blog_version = floatval(get_bloginfo('version')); - - // activate custom select for newer wp versions - if ($blog_version >= self::$customselect_enable) { + wp_enqueue_style(WMobilePack_Options::$prefix.'css_select_box_it', plugins_url(WMP_DOMAIN.'/admin/css/jquery.selectBoxIt.css'), array(), '3.8.1'); + wp_enqueue_script(WMobilePack_Options::$prefix.'js_select_box_it', plugins_url(WMP_DOMAIN.'/admin/js/UI.Interface/Lib/jquery.selectBoxIt.min.js'), array('jquery','jquery-ui-core', 'jquery-ui-widget'), '3.8.1'); - wp_enqueue_style(WMobilePack_Options::$prefix.'css_select_box_it', plugins_url(WMP_DOMAIN.'/admin/css/jquery.selectBoxIt.css'), array(), '3.8.1'); - wp_enqueue_script(WMobilePack_Options::$prefix.'js_select_box_it', plugins_url(WMP_DOMAIN.'/admin/js/UI.Interface/Lib/jquery.selectBoxIt.min.js'), array('jquery','jquery-ui-core', 'jquery-ui-widget'), '3.8.1'); - - $allowed_fonts = WMobilePack_Themes_Config::$allowed_fonts; - foreach ($allowed_fonts as $key => $font_family) - wp_enqueue_style(WMobilePack_Options::$prefix.'css_font'.($key+1), plugins_url(WMP_DOMAIN.'/frontend/fonts/font-'.($key+1).'.css'), array(), WMP_VERSION); - } + $allowed_fonts = WMobilePack_Themes_Config::$allowed_fonts; + foreach ($allowed_fonts as $key => $font_family) { + wp_enqueue_style(WMobilePack_Options::$prefix.'css_font'.($key+1), plugins_url(WMP_DOMAIN.'/frontend/fonts/font-'.($key+1).'.css'), array(), WMP_VERSION); + } wp_enqueue_style('wp-color-picker'); diff --git a/plugins/wordpress-mobile-pack/admin/js/UI.Modules/Theming/WMP_EDIT_THEME.js b/plugins/wordpress-mobile-pack/admin/js/UI.Modules/Theming/WMP_EDIT_THEME.js index 07cc8eb..f4d0cc1 100755 --- a/plugins/wordpress-mobile-pack/admin/js/UI.Modules/Theming/WMP_EDIT_THEME.js +++ b/plugins/wordpress-mobile-pack/admin/js/UI.Modules/Theming/WMP_EDIT_THEME.js @@ -1,229 +1,226 @@ -/*****************************************************************************************************/ -/* */ -/* 'EDIT THEME COLORS AND FONTS' */ -/* */ -/*****************************************************************************************************/ - -function WMP_EDIT_THEME(){ - - var JSObject = this; - - this.type = "wmp_edittheme"; - - this.form; - this.DOMDoc; - - this.send_btn; - this.enableCustomSelects = 0; - - - /*****************************************************************************************************/ - /* */ - /* FUNCTION INIT - called from WMPJSInterface */ - /* */ - /*****************************************************************************************************/ - this.init = function(){ - - // save a reference to WMPJSInterface Object - WMPJSInterface = window.parent.WMPJSInterface; - - // save a reference to "SEND" Button - this.send_btn = jQuery('#'+this.type+'_send_btn',this.DOMDoc).get(0); - - // save a reference to the FORM and remove the default submit action - this.form = this.DOMDoc.getElementById(this.type+'_form'); - - // add actions to send, cancel, ... buttons - this.addButtonsActions(); - - if (this.form == null){ - return; - } - - this.initCustomColors(); - this.initCustomSelects(); - } - - - /*****************************************************************************************************/ - /* */ - /* ENABLE COLOR PICKERS */ - /* */ - /*****************************************************************************************************/ - this.initCustomColors = function(){ - - // enable color picker for the color inputs - jQuery('input[name^="' + JSObject.type + '_customcolor"]').wpColorPicker(); - - // toggle display for the custom colors section - jQuery('input[name="' + JSObject.type + '_colorscheme"]').click(function(){ - - if (jQuery(this).val() == 0){ - jQuery('.color-schemes-custom').show(); - } else { - jQuery('.color-schemes-custom').hide(); - } - }); - } - - - /*****************************************************************************************************/ - /* */ - /* FUNCTION ENABLE CUSTOM SELECTS */ - /* */ - /*****************************************************************************************************/ - this.initCustomSelects = function(){ - - if (this.enableCustomSelects == 1){ - - jQuery("#" + JSObject.type + "_fontheadlines").selectBoxIt(); - jQuery("#" + JSObject.type + "_fontsubtitles").selectBoxIt(); - jQuery("#" + JSObject.type + "_fontparagraphs").selectBoxIt(); - } - } - - - /*****************************************************************************************************/ - /* */ - /* FUNCTION ADD BUTTONS ACTIONS */ - /* */ - /*****************************************************************************************************/ - this.addButtonsActions = function(){ - - /*******************************************************/ - /* SEND "BUTTON" */ - /*******************************************************/ - jQuery(this.send_btn).unbind("click"); - jQuery(this.send_btn).bind("click",function(){ - JSObject.disableButton(this); - JSObject.sendData(); - }) - JSObject.enableButton(this.send_btn); - - } - - - /*****************************************************************************************************/ - /* */ - /* FUNCTION ENABLE BUTTON */ - /* */ - /*****************************************************************************************************/ - this.enableButton = function(btn){ - jQuery(btn).css('cursor','pointer'); - jQuery(btn).animate({opacity:1},100); - } - - - /*****************************************************************************************************/ - /* */ - /* FUNCTION DISABLE BUTTON */ - /* */ - /*****************************************************************************************************/ - this.disableButton = function(btn){ - jQuery(btn).unbind("click"); - jQuery(btn).animate({opacity:0.4},100); - jQuery(btn).css('cursor','default'); - } - - - /*****************************************************************************************************/ - /* */ - /* FUNCTION SUBMIT FORM THROUGH an IFRAME as target */ - /* */ - /*****************************************************************************************************/ - this.submitForm = function(){ - return WMPJSInterface.AjaxUpload.dosubmit(JSObject.form, {'onStart' : JSObject.startUploadingData, 'onComplete' : JSObject.completeUploadingData}); - } - - - /*****************************************************************************************************/ - /* */ - /* FUNCTION SEND DATA */ - /* */ - /*****************************************************************************************************/ - this.sendData = function(){ - - jQuery("#"+this.form.id,this.DOMDoc).unbind("submit"); - jQuery("#"+this.form.id,this.DOMDoc).bind("submit",function(){JSObject.submitForm();}); - jQuery("#"+this.form.id,this.DOMDoc).submit(); - - JSObject.disableButton(JSObject.send_btn); - } - - - /*****************************************************************************************************/ - /* */ - /* FUNCTION START UPLOADING DATA */ - /* */ - /*****************************************************************************************************/ - this.startUploadingData = function(){ - - WMPJSInterface.Preloader.start(); - - //disable form elements - setTimeout(function(){ - var aElems = JSObject.form.elements; - nElems = aElems.length; - - for (j=0; j= WMobilePack_Admin_Init::$customselect_enable) - $enable_custom_selects = true; - - if (array_key_exists($selected_theme, WMobilePack_Themes_Config::$color_schemes)): + if (array_key_exists($selected_theme, WMobilePack_Themes_Config::$color_schemes)): $theme_settings = WMobilePack_Themes_Config::$color_schemes[$selected_theme]; ?>
@@ -157,20 +150,9 @@
@@ -183,20 +165,9 @@
@@ -208,20 +179,9 @@
@@ -451,7 +411,7 @@ if (window.WMPJSInterface && window.WMPJSInterface != null){ jQuery(document).ready(function(){ - window.WMPJSInterface.add("UI_customizetheme","WMP_EDIT_THEME",{'DOMDoc':window.document, 'enableCustomSelects': }, window); + window.WMPJSInterface.add("UI_customizetheme","WMP_EDIT_THEME",{'DOMDoc':window.document}, window); window.WMPJSInterface.add("UI_editimages","WMP_EDIT_IMAGES",{'DOMDoc':window.document}, window); window.WMPJSInterface.add("UI_editcover","WMP_EDIT_COVER",{'DOMDoc':window.document}, window); diff --git a/plugins/wordpress-mobile-pack/admin/sass/config.rb b/plugins/wordpress-mobile-pack/admin/sass/config.rb deleted file mode 100755 index 52e432e..0000000 --- a/plugins/wordpress-mobile-pack/admin/sass/config.rb +++ /dev/null @@ -1,21 +0,0 @@ -# Require any additional compass plugins here. - -# Get the directory that this configuration file exists in -dir = File.dirname(__FILE__) - -# Set this to the root of your project when deployed: -http_path = "/" - -sass_path = dir -css_path = File.join(dir, "..", "css") -fonts_path = File.join(dir, "fonts") -images_path = File.join(dir, "..", "images") - -javascripts_path = File.join(dir, "..", "javascripts") - - -output_style = :compressed -environment = :production - -# output_style = :expanded -# environment = :development diff --git a/plugins/wordpress-mobile-pack/admin/sass/core/_buttons.scss b/plugins/wordpress-mobile-pack/admin/sass/core/_buttons.scss deleted file mode 100755 index 0a35abf..0000000 --- a/plugins/wordpress-mobile-pack/admin/sass/core/_buttons.scss +++ /dev/null @@ -1,110 +0,0 @@ -#wmpack-admin{ - .btn{ - @include wbz-display-box(); - @include wbz-box-orient(horizontal); - @include wbz-box-pack(center); - @include wbz-box-align(center); - - display:flex; - - font-family: 'AcordeRegular', sans-serif; - width: $btn-size-normal; - height: $btn-height; - line-height: $btn-height; - min-height: $btn-height; - background: #ffffff; - color: $btn-color; - font-size: $btn-font-size; - @include wbz-border-radius($btn-radius); - border: $btn-border; - padding: 0 15px; - margin: 0; - text-decoration: none; - - &.smallest{ - width: $btn-size-smallest; - } - &.smaller{ - width: $btn-size-smaller; - } - &.small{ - width: $btn-size-small; - } - &.big{ - width: $btn-size-big; - } - &.bigger{ - width: $btn-size-bigger; - } - - strong{ - @include wbz-display-inline-box(); - font-family: 'AcordeSemiBold', sans-serif; - font-weight: normal; - font-style: normal; - } - &:hover{ - background: #fafafa; - border: 1px solid darken($btn-border, $darken-amounth/2); - } - &.green{ - background: $base-green; - color: #ffffff; - border: 1px solid darken($base-green, $darken-amounth/2); - - &:hover{ - background: darken($base-green, $darken-amounth/2); - border: 1px solid darken($base-green, $darken-amounth); - } - } - - &.blue{ - background: $base-blue; - color: #ffffff; - border: 1px solid darken($base-blue, $darken-amounth/2); - - &:hover{ - background: darken($base-blue, $darken-amounth/2); - border: 1px solid darken($base-blue, $darken-amounth); - } - &.spaced-right{ - margin-right:20px; - } - } - &.orange{ - background: $base-orange; - color: #ffffff; - border: 1px solid darken($base-orange, $darken-amounth/2); - - &:hover{ - background: darken($base-orange, $darken-amounth/2); - border: 1px solid darken($base-orange, $darken-amounth); - } - } - &.grey{ - background: $base-grey; - color: #939494; - text-transform: uppercase; - border: 1px solid darken($base-grey, $darken-amounth/2); - - &:hover{ - background: darken($base-grey, $darken-amounth/2); - border: 1px solid darken($base-grey, $darken-amounth); - } - } - &.turquoise { - background: $base-turquoise; - color: #ffffff; - border: 1px solid darken($base-turquoise, $darken-amounth/2); - - &:hover{ - background: darken($base-turquoise, $darken-amounth/2); - border: 1px solid darken($base-turquoise, $darken-amounth); - } - } - } - - .inline-btns-container{ - @include wbz-display-inline-box(); - } -} diff --git a/plugins/wordpress-mobile-pack/admin/sass/core/_core.scss b/plugins/wordpress-mobile-pack/admin/sass/core/_core.scss deleted file mode 100755 index 383c3c7..0000000 --- a/plugins/wordpress-mobile-pack/admin/sass/core/_core.scss +++ /dev/null @@ -1,448 +0,0 @@ -#wmpack-admin{ - *, *:after, *:before { - font-weight: normal; - @include wbz-box-sizing(border-box); - -webkit-tap-highlight-color: rgba(0, 0, 0, 0); - -webkit-touch-callout: none; - -ms-touch-action: none; - -webkit-user-drag: none; - } - h1{ - font-family: 'OlRoundGothicLight', sans-serif; - font-size: $h1-font-size; - line-height: $h1-font-size; - font-weight: normal; - color: $base-text-color; - margin:0px; - padding:0px; - } - h2{ - font-family: 'AcordeRegular', sans-serif; - font-size: $h2-font-size; - line-height: $h2-font-size; - color: $base-text-color; - letter-spacing: 0.5px; - margin:0px; - padding:0px; - } - .underlined{ - border-bottom: 1px solid #EDF0F0; - margin: 0 0 30px; - padding: 0 0 10px; - } - p, span, a{ - font-family: 'OpenSansRegular', sans-serif; - font-size: 14px; - line-height: 19px; - color: $base-text-color; - } - p, span { - margin:0; - padding:0; - } - strong{ - font-weight: bold; - } - a{ - color: $base-blue; - text-decoration: none; - &:hover{ - color: darken($base-blue, $darken-amounth); - } - &:focus { - outline: none; - } - } - .left{ - float:left; - } - .right{ - float:right; - } - .notification{ - @include wbz-display-box(); - @include wbz-box-pack(center); - @include wbz-box-align(center); - position: relative; - width: 0px; - height: 0px; - - .count{ - @include wbz-border-radius(25px); - background: $base-red; - font-family: 'OpenSansRegular', sans-serif; - text-align: center; - color: #ffffff; - font-size: 12px; - line-height: 25px; - width: 25px; - height: 25px; - } - } - - @for $i from 0 through 100{ - .spacer-#{$i} { - @include wbz-spacer(#{$i}px); - } - } - .grey-line{ - @include wbz-spacer(1px); - border-top: 1px solid $body-color; - } - .grey-dotted-line{ - @include wbz-spacer(1px); - border-top: 1px dotted $base-p-color; - } - .relative{ - width: 0; - height: 0; - position: relative; - } - .corner{ - &.active{ - .indicator{ - width: 0; - height: 0; - border-top: 44px solid $base-green; - border-left: 44px solid transparent; - position: absolute; - right: 0px; - } - } - &.inactive{ - .indicator{ - width: 0; - height: 0; - border-top: 44px solid #ffffff; - border-left: 44px solid transparent; - position: absolute; - right: 0px; - } - } - } - .notice{ - padding: 25px; - margin: 0 0 15px 0; - background: $notice-bg; - border: 1px solid $notice-border; - @include wbz-border-radius($notice-radius); - position: relative; - - a { - font-family: "OpenSansRegular", sans-serif; - font-size: 13px; - line-height: 20px; - color: #819196; - text-decoration: underline; - } - - &.notice-left{ - &::before{ - left: -10px; - right: auto; - top: 50px; - bottom: auto; - border-color: transparent $notice-border; - border-width: 10px 10px 10px 0; - } - &::after{ - left: -9px; - right: auto; - top: 50px; - bottom: auto; - border-color: transparent $notice-bg; - border-width: 10px 10px 10px 0; - } - } - &::before{ - content: ""; - position: absolute; - top: -10px; - bottom: auto; - left: 50px; - right: auto; - border-style: solid; - border-color: $notice-border transparent; - border-width: 0 10px 10px; - display: block; - width: 0; - } - &::after{ - content: ""; - position: absolute; - bottom: auto; - top: -9px; - left: 50px; - right: auto; - border-style: solid; - border-color: $notice-bg transparent; - border-width: 0 10px 10px; - display: block; - width: 0; - } - span{ - font-family: "OpenSansRegular", sans-serif; - font-size: 13px; - line-height: 20px; - color: $notice-color; - } - } -} -body{ - min-width: $total-width; -} -#wp-content{ - background:$body-color; -} - -#wmpack-admin{ - width: 100%; - - .left-side{ - padding-right: 13px; - display: table-cell; - - nav.menu{ - width: 100%; - height: 69px; - position: relative; - padding: 0px; - min-width: 805px; - - .ribbon{ - .indicator{ - background: url(../images/ribbon-premium.png); - width: 67px; - height: 68px; - position: absolute; - top: -4px; - right: -5px; - } - } - ul{ - list-style-type: none; - display: flex; - flex-direction: row; - height: 69px; - border-bottom: 1px solid #DADDDE; - - li{ - height: 68px; - flex: 1 0 auto; - max-width: 200px; - background-color: #f5f7f7; - vertical-align: middle; - text-align: center; - border-right: #daddde 1px solid; - border-bottom: #daddde 1px solid; - - a{ - color: $base-text-color; - font-family: 'AcordeRegular'; - font-size: 17px; - line-height: normal; - padding: 20px 0; - width: 100%; - display: block; - border-top: 4px solid #f5f7f7; - } - - &:hover{ - border-bottom: 1px solid #dce0e0; - background-color: #dce0e0; - - a{ - border-top: 4px solid #dce0e0; - } - } - &.selected{ - border-bottom: 1px solid #ffffff; - background-color: #ffffff; - height: 69px; - - a{ - color: $base-green; - border-top: 4px solid $base-green; - border-bottom: 1px solid #ffffff; - } - } - } - } - } - } - .right-side{ - width:252px; - display: table-cell; - vertical-align: top; - padding: 0 10px 0 0; - - .updates{ - padding: 15px 5px 15px 15px; - background-color: $box-color; - - .details{ - height: 333px; - position: relative; - overflow: hidden; - } - p{ - font-size: 13px; - color: $base-p-color; - margin-right:10px; - - &.news-title { - font-size: 16px; - margin-bottom: 10px; - - a { - font-size: 16px; - outline: none; - } - } - } - a{ - font-size: 13px; - } - } - .appticles-updates{ - padding: 10px 15px; - background-color: #2a2d33; - border-top: #fff 1px solid; - height: 43px; - @include wbz-border-radius(0px 0px 4px 4px); - - div{ - float: left; - - p{ - margin: 0; - } - &.social{ - float: right; - - .facebook, .twitter, .google-plus { - width: 18px; - height: 18px; - background: #8c8d8d; - color: #2a2d33; - margin: 0 6px; - @include wbz-border-radius(18px); - display: block; - float: left; - - &::before{ - left: 5px; - top: -1px; - } - } - - .facebook { - @include wbz-inline-icon(facebook,10px); - } - - .twitter { - @include wbz-inline-icon(twitter,10px); - } - - .google-plus { - @include wbz-inline-icon(google-plus,10px); - } - } - } - } - .white-paper{ - width: 252px; - height: 250px; - border: #bfbfbf 1px solid; - display: table-cell; - text-align: center; - vertical-align: middle; - background-color: #fff; - - p{ - font-family: 'AcordeRegular', sans-serif; - font-size: 20px; - line-height: normal; - color: $base-text-color; - } - } - .form-box{ - padding: 15px; - background-color: $box-color; - - p{ - font-size: 13px; - } - - .field-message { - padding: 1px 0; - } - } - - .ask-review { - p, a { - font-size: 12px; - } - p { - padding: 0px 5px; - } - } - } - - .added{ - margin: 0 auto; - width: 190px; - - .switcher{ - width: 190px; - - .msg{ - font-family: 'AcordeSemiBold', sans-serif; - width: 150px; - height: $input-height; - background: $input-background; - color: $input-color; - font-size: $input-font-size; - @include wbz-border-radius($input-radius 0 0 $input-radius); - @include wbz-box-shadow(none); - border: 1px solid $input-border; - border-right: 0px; - padding: 0 10px; - line-height: 38px; - text-align: center; - float: left; - } - .check{ - @include wbz-border-radius(0 $input-radius $input-radius 0); - height: $input-height; - border: 1px solid darken($input-border, 10%); - border-left: 0px; - width: 40px; - float: right; - @include wbz-inline-icon(active, 17px); - color: #ffffff; - - &::before{ - height: 38px; - width: 40px; - right: -9px; - top: -2px; - line-height: 38px; - } - } - &.blue{ - .check{ - background: $base-blue; - border: 1px solid darken($base-blue, 10%); - border-left: 0px; - } - } - } - } -} - -.wp-admin{ - .mfp-bg, .mfp-wrap{ - z-index:10000; - } -} diff --git a/plugins/wordpress-mobile-pack/admin/sass/core/_fonts.scss b/plugins/wordpress-mobile-pack/admin/sass/core/_fonts.scss deleted file mode 100755 index e4f0ead..0000000 --- a/plugins/wordpress-mobile-pack/admin/sass/core/_fonts.scss +++ /dev/null @@ -1,11 +0,0 @@ -@import 'compass/css3'; - -@include font-face('AcordeRegular', inline-font-files('acorde-regular.woff', woff, 'acorde-regular.ttf', truetype,'acorde-regular.svg', svg,"acorde-regular.eot",eot)); -@include font-face('AcordeSemiBold', inline-font-files('acorde-semibold.woff', woff, 'acorde-semibold.ttf', truetype,'acorde-semibold.svg', svg,"acorde-semibold.eot",eot)); -@include font-face('OlRoundGothicLight', inline-font-files('ol-round-gothic-light.woff', woff, 'ol-round-gothic-light.ttf', truetype,'ol-round-gothic-light.svg', svg,"ol-round-gothic-light.eot",eot)); -@include font-face('OpenSansRegular', inline-font-files('open-sans-regular.woff', woff, 'open-sans-regular.ttf', truetype,'open-sans-regular.svg', svg,"open-sans-regular.eot",eot)); -@include font-face('OpenSansSemiBold', inline-font-files('opensans-semibold.woff',woff, 'opensans-semibold.ttf',truetype, 'opensans-semibold.svg', svg, "opensans-semibold.eot",eot)); -@include font-face('OpenSansItalic', inline-font-files('opensans-italic.woff',woff, 'opensans-italic.ttf',truetype, 'opensans-italic.svg',svg, 'opensans-italic.eot',eot)); - - -@include font-face('Appticles', inline-font-files('wp-font.woff', woff, 'wp-font.ttf', truetype,'wp-font.svg', svg,"wp-font.eot",eot)); \ No newline at end of file diff --git a/plugins/wordpress-mobile-pack/admin/sass/core/_forms.scss b/plugins/wordpress-mobile-pack/admin/sass/core/_forms.scss deleted file mode 100755 index f04d7a0..0000000 --- a/plugins/wordpress-mobile-pack/admin/sass/core/_forms.scss +++ /dev/null @@ -1,409 +0,0 @@ -#wmpack-admin{ - form{ - text-align: left; - } - input[type="text"], - input[type="password"], - input[type="file"], - input[type="email"]{ - - &:not(.wp-color-picker) { - font-family: 'AcordeSemiBold', sans-serif; - width: $input-size-normal; - height: $input-height; - background: $input-background; - color: $input-color; - font-size: $input-font-size; - @include wbz-border-radius($input-radius); - @include wbz-box-shadow(none); - border: 1px solid $input-border; - padding: 0 15px; - - &.smaller { - width: $input-size-smaller; - } - &.small { - width: $input-size-small; - } - &.big { - width: $input-size-big; - } - &:focus { - outline: none; - border: 1px solid darken($input-border, $darken-amounth); - } - &.error { - border-color: $error-color; - background: $error-bg; - } - &.indent { - margin: 0 0 0 30px; - } - } - } - select { - font-family: 'AcordeSemiBold', sans-serif; - width: $input-size-normal; - height: $input-height; - background: $input-background; - color: $input-color; - font-size: $input-font-size; - @include wbz-border-radius($input-radius); - @include wbz-box-shadow(none); - border: 1px solid $input-border; - padding: 0 15px; - - &.smaller{ - width: $input-size-smaller; - } - &.small{ - width: $input-size-small; - } - &.big{ - width: $input-size-big; - } - &:focus{ - outline:none; - border:1px solid darken($input-border,$darken-amounth); - } - } - - - .selectboxit-container{ - - .selectboxit{ - font-family: 'AcordeSemiBold', sans-serif; - width: $input-size-normal; - height: $input-height; - background: $input-background; - color: $input-color; - font-size: $input-font-size; - @include wbz-border-radius($input-radius); - @include wbz-box-shadow(none); - border: 1px solid $input-border; - padding: 0 15px; - width: 220px!important; - - &:focus{ - outline:none; - border:1px solid darken($input-border,$darken-amounth); - } - - span, .selectboxit-options a { - height: 36px; - line-height:33px; - } - } - - .selectboxit-arrow-container{ - width: 25px; - } - - .selectboxit-options{ - border-radius: 0; - width: 220px; - - .selectboxit-option{ - height: 36px; - border-bottom: $btn-border 1px solid; - - } - - a{ - height: 36px; - line-height: 33px; - } - .selectboxit-option-first,.selectboxit-option-last{ - border-radius: 0; - } - } - - span{ - height: 36px; - line-height: 33px; - } - - .selectboxit-list{ - > .selectboxit-focus{ - > .selectboxit-option-anchor{ - background: darken($base-grey, $darken-amounth/2); - } - } - } - } - - input[type="radio"], - input[type="checkbox"]{ - width: 16px; - height: 16px; - float: left; - margin: 0 10px 0 30px; - - &::before{ - margin: 4px; - } - } - input[type=checkbox]{ - &:checked { - &::before{ - margin: 0px; - float: left; - display: inline-block; - vertical-align: middle; - width: 16px; - font:normal 21px/1 'dashicons'; - speak: none; - -webkit-font-smoothing: antialiased; - -moz-osx-font-smoothing: grayscale; - position: relative; - top: -3px; - left: -4px; - } - } - } - textarea{ - font-family: 'AcordeSemiBold', sans-serif; - width: $input-size-normal; - height: $textarea-height; - background: $input-background; - color: $input-color; - font-size: $input-font-size; - @include wbz-border-radius($input-radius); - @include wbz-box-shadow(none); - border: 1px solid $input-border; - padding: 10px 15px; - resize: none; - - &.smaller{ - width: $input-size-smaller; - } - &.small{ - width: $input-size-small; - } - &.big{ - width: $input-size-big; - } - &:focus{ - outline:none; - border:1px solid darken($input-border,$darken-amounth); - } - &.error{ - border-color: $error-color; - background: $error-bg; - } - } - - label{ - @include wbz-display-box(); - font-family: 'AcordeRegular', sans-serif; - color: $label-color; - font-size: $label-font-size; - } - - ::-webkit-input-placeholder{ - padding: 2px 0 0 0; - color: #b2b5bc; - font-size: 13px; - } - :-moz-placeholder{ - padding: 2px 0 0 0; - color: #b2b5bc; - font-size: 13px; - } - ::-moz-placeholder{ - padding: 2px 0 0 0; - color: #b2b5bc; - font-size: 13px; - } - :-ms-input-placeholder{ - color: #b2b5bc!important; - font-size: 13px; - } - - .field-message{ - @include wbz-display-box(); - margin: 0px 0 0px 15px; - @include wbz-box-shadow(none); - background: transparent; - border: 0; - - span{ - font-family: "OpenSansRegular", sans-serif; - font-size: 13px; - line-height: 20px; - } - &.error{ - span{ - color: $error-color; - } - } - &.success{ - span{ - color: $success-color; - } - } - &.warning{ - span{ - color: $warning-color; - } - } - } - .message-container{ - display: block; - text-align: left; - width: 100%; - - a { - font-family: "OpenSansRegular", sans-serif; - font-size: 13px; - line-height: 20px; - } - - &.error{ - background:none; - border:none; - - } - - .wrapper{ - @include wbz-display-box(); - @include wbz-box-orient(vertical); - @include wbz-box-flex(1); - width: 100%; - padding: 25px 50px; - margin: 10px 0; - - .relative{ - width: 100%; - } - } - .title{ - width: 100%; - @include wbz-display-box(); - @include wbz-box-orient(horizontal, important); - - h2{ - font-family: 'OlRoundGothicLight', sans-serif; - @include wbz-display-box(); - @include wbz-box-flex(1); - margin: 0 0 15px 0!important; - font-size: 25px; - } - } - span{ - font-family: "OpenSansRegular", sans-serif; - font-size: 13px; - line-height: 20px; - } - .close-x{ - @include wbz-inline-icon(close-x, 25px); - @include wbz-display-box(); - @include wbz-box-pack(end); - @include wbz-box-align(center); - width: 25px; - height: 25px; - padding: 0 15px; - top: -10px; - right: -25px; - position: absolute; - - &:hover{ - cursor: pointer; - color: #ffc26b; - } - &::before{ - width: 25px; - height: 25px; - } - } - &.error{ - .wrapper{ - border: 1px solid $error-border; - background: $error-bg; - } - .title{ - h2{ - color: $error-color; - - &.underlined{ - border-bottom: 1px solid $error-border; - } - } - } - span{ - color: $error-color; - } - .close-x{ - color: $error-border; - - &:hover{ - color: darken($error-border,$darken-amounth/2); - } - } - } - &.success{ - .wrapper{ - border: 1px solid $success-border; - background: $success-bg; - } - .title{ - h2{ - color: $success-color; - - &.underlined{ - border-bottom: 1px solid $success-border; - } - } - } - span{ - color: $success-color; - } - .close-x{ - color: $success-border; - - &:hover{ - color: darken($success-border,$darken-amounth/2); - } - } - } - &.warning{ - .wrapper{ - border: 1px solid $warning-border; - background: $warning-bg; - } - .title{ - h2{ - color: $warning-color; - - &.underlined{ - border-bottom: 1px solid $warning-border; - } - } - } - span{ - color: $warning-color; - - a { - color: darken($warning-color,20%) !important; - text-decoration: underline !important; - } - } - .close-x{ - color: $warning-border; - - &:hover{ - color: darken($warning-border,$darken-amounth/2); - } - } - } - } -} - -.wmp_upgrade_notice.notice { - background: $warning-color; - color: #FFFFFF; - - .notice-dismiss:before { - color: #FFFFFF; - } -} \ No newline at end of file diff --git a/plugins/wordpress-mobile-pack/admin/sass/core/_ie.scss b/plugins/wordpress-mobile-pack/admin/sass/core/_ie.scss deleted file mode 100755 index 8738b3c..0000000 --- a/plugins/wordpress-mobile-pack/admin/sass/core/_ie.scss +++ /dev/null @@ -1,6 +0,0 @@ -@media screen and (min-width: 0 \0) { - body #main { - min-height: auto; - height: 100% !important; - } -} \ No newline at end of file diff --git a/plugins/wordpress-mobile-pack/admin/sass/core/_variables.scss b/plugins/wordpress-mobile-pack/admin/sass/core/_variables.scss deleted file mode 100755 index 6b380bf..0000000 --- a/plugins/wordpress-mobile-pack/admin/sass/core/_variables.scss +++ /dev/null @@ -1,102 +0,0 @@ -//color manipulation -$darken-amounth: 20%; -$lighten-amounth: 20%; - -$base-green: #9aca40; -$base-purple: #ae113d; -$base-orange: #ffbb42; -$base-red: #ff4e40; -$base-blue: #1ca8dd; -$base-dark-blue: #2a2d33; -$base-grey: #fcfcfc; -$base-turquoise: #66cc80; - - -$facebook-color: #3b5699; -$twitter-color: #55acee; -$google-color: #dd4b39; -$rss-color: #ff9900; -$wordpress-color: #333333; -$tumblr-color: #385774; - -$base-color: #eeeff1; -$base-color-lighter: #f5f7f7; -$base-color-darken: #dce0e0; - -$body-color: #edf0f0; -$box-color: #ffffff; -$main-menu-background: $base-dark-blue; - -//text styling -$base-text-color: #4b4b4b; -$base-p-color: #8c8d8d; -$h1-font-size: 47px; -$h2-font-size: 20px; -$h3-font-size: 18px; - -//buttons -$btn-radius: 3px; -$btn-background: #ffffff; -$btn-color: $base-dark-blue; -$btn-font-size: 14px; -$btn-border: #daddde; -$btn-height: 36px; -$btn-size-smallest: 50px; -$btn-size-smaller: 120px; -$btn-size-small: 220px; -$btn-size-normal: 240px; -$btn-size-big: 320px; -$btn-size-bigger: 455px; - - -$btn-action-border: 1px solid #7ca62c; - -//forms -$input-background: #fafafa; -$input-color: $base-dark-blue; -$input-font-size: 14px; -$input-height: 36px; -$textarea-height: 100px; -$input-size-smaller: 120px; -$input-size-small: 220px; -$input-size-normal: 240px; -$input-size-big: 320px; -$input-size-bigger: 455px; -$input-size-biggest: 550px; -$input-radius: 3px; -$input-border: #daddde; -$label-color: $base-dark-blue; -$label-font-size: 15px; - - //errors - $error-bg: #fef7f7; - $error-color: #d0160a; - $error-border: #ecc2c3; - - //messages - $success-bg: #f7fef7; - $success-color: #4cae4c; - $success-border: #5cb85c; - - //warnings - $warning-bg: #fffce1; - $warning-color: #f89406; - $warning-border: #ffd79e; - - //notices - $notice-bg: #f6f9f9; - $notice-border: #dfeaea; - $notice-color: #819196; - $notice-radius: 3px; - -//structure variables -$total-width: 1180px; -$left-menu-width: 110px; -$inner-width: 1070px; -$header-height: 90px; -$section-spacer: 10px; - - -$inner-width-centered: 850px; -$inner-width-popup: 525px; -$inner-width-account: 455px; diff --git a/plugins/wordpress-mobile-pack/admin/sass/fonts/acorde-regular.eot b/plugins/wordpress-mobile-pack/admin/sass/fonts/acorde-regular.eot deleted file mode 100755 index ac1a457..0000000 Binary files a/plugins/wordpress-mobile-pack/admin/sass/fonts/acorde-regular.eot and /dev/null differ diff --git a/plugins/wordpress-mobile-pack/admin/sass/fonts/acorde-regular.otf b/plugins/wordpress-mobile-pack/admin/sass/fonts/acorde-regular.otf deleted file mode 100755 index 0f3276a..0000000 Binary files a/plugins/wordpress-mobile-pack/admin/sass/fonts/acorde-regular.otf and /dev/null differ diff --git a/plugins/wordpress-mobile-pack/admin/sass/fonts/acorde-regular.svg b/plugins/wordpress-mobile-pack/admin/sass/fonts/acorde-regular.svg deleted file mode 100755 index c8635f5..0000000 --- a/plugins/wordpress-mobile-pack/admin/sass/fonts/acorde-regular.svg +++ /dev/null @@ -1,1449 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/plugins/wordpress-mobile-pack/admin/sass/fonts/acorde-regular.ttf b/plugins/wordpress-mobile-pack/admin/sass/fonts/acorde-regular.ttf deleted file mode 100755 index 4f51cab..0000000 Binary files a/plugins/wordpress-mobile-pack/admin/sass/fonts/acorde-regular.ttf and /dev/null differ diff --git a/plugins/wordpress-mobile-pack/admin/sass/fonts/acorde-regular.woff b/plugins/wordpress-mobile-pack/admin/sass/fonts/acorde-regular.woff deleted file mode 100755 index e65076f..0000000 Binary files a/plugins/wordpress-mobile-pack/admin/sass/fonts/acorde-regular.woff and /dev/null differ diff --git a/plugins/wordpress-mobile-pack/admin/sass/fonts/acorde-semibold.eot b/plugins/wordpress-mobile-pack/admin/sass/fonts/acorde-semibold.eot deleted file mode 100755 index e86df09..0000000 Binary files a/plugins/wordpress-mobile-pack/admin/sass/fonts/acorde-semibold.eot and /dev/null differ diff --git a/plugins/wordpress-mobile-pack/admin/sass/fonts/acorde-semibold.otf b/plugins/wordpress-mobile-pack/admin/sass/fonts/acorde-semibold.otf deleted file mode 100755 index 34f2ede..0000000 Binary files a/plugins/wordpress-mobile-pack/admin/sass/fonts/acorde-semibold.otf and /dev/null differ diff --git a/plugins/wordpress-mobile-pack/admin/sass/fonts/acorde-semibold.svg b/plugins/wordpress-mobile-pack/admin/sass/fonts/acorde-semibold.svg deleted file mode 100755 index 22b6762..0000000 --- a/plugins/wordpress-mobile-pack/admin/sass/fonts/acorde-semibold.svg +++ /dev/null @@ -1,1522 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/plugins/wordpress-mobile-pack/admin/sass/fonts/acorde-semibold.ttf b/plugins/wordpress-mobile-pack/admin/sass/fonts/acorde-semibold.ttf deleted file mode 100755 index cdc0d82..0000000 Binary files a/plugins/wordpress-mobile-pack/admin/sass/fonts/acorde-semibold.ttf and /dev/null differ diff --git a/plugins/wordpress-mobile-pack/admin/sass/fonts/acorde-semibold.woff b/plugins/wordpress-mobile-pack/admin/sass/fonts/acorde-semibold.woff deleted file mode 100755 index 32825d1..0000000 Binary files a/plugins/wordpress-mobile-pack/admin/sass/fonts/acorde-semibold.woff and /dev/null differ diff --git a/plugins/wordpress-mobile-pack/admin/sass/fonts/ol-round-gothic-light.eot b/plugins/wordpress-mobile-pack/admin/sass/fonts/ol-round-gothic-light.eot deleted file mode 100755 index 0c61bed..0000000 Binary files a/plugins/wordpress-mobile-pack/admin/sass/fonts/ol-round-gothic-light.eot and /dev/null differ diff --git a/plugins/wordpress-mobile-pack/admin/sass/fonts/ol-round-gothic-light.otf b/plugins/wordpress-mobile-pack/admin/sass/fonts/ol-round-gothic-light.otf deleted file mode 100755 index f1ec52d..0000000 Binary files a/plugins/wordpress-mobile-pack/admin/sass/fonts/ol-round-gothic-light.otf and /dev/null differ diff --git a/plugins/wordpress-mobile-pack/admin/sass/fonts/ol-round-gothic-light.svg b/plugins/wordpress-mobile-pack/admin/sass/fonts/ol-round-gothic-light.svg deleted file mode 100755 index 3647edf..0000000 --- a/plugins/wordpress-mobile-pack/admin/sass/fonts/ol-round-gothic-light.svg +++ /dev/null @@ -1,1021 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/plugins/wordpress-mobile-pack/admin/sass/fonts/ol-round-gothic-light.ttf b/plugins/wordpress-mobile-pack/admin/sass/fonts/ol-round-gothic-light.ttf deleted file mode 100755 index acfd177..0000000 Binary files a/plugins/wordpress-mobile-pack/admin/sass/fonts/ol-round-gothic-light.ttf and /dev/null differ diff --git a/plugins/wordpress-mobile-pack/admin/sass/fonts/ol-round-gothic-light.woff b/plugins/wordpress-mobile-pack/admin/sass/fonts/ol-round-gothic-light.woff deleted file mode 100755 index 8f60899..0000000 Binary files a/plugins/wordpress-mobile-pack/admin/sass/fonts/ol-round-gothic-light.woff and /dev/null differ diff --git a/plugins/wordpress-mobile-pack/admin/sass/fonts/open-sans-regular.eot b/plugins/wordpress-mobile-pack/admin/sass/fonts/open-sans-regular.eot deleted file mode 100755 index da780d7..0000000 Binary files a/plugins/wordpress-mobile-pack/admin/sass/fonts/open-sans-regular.eot and /dev/null differ diff --git a/plugins/wordpress-mobile-pack/admin/sass/fonts/open-sans-regular.otf b/plugins/wordpress-mobile-pack/admin/sass/fonts/open-sans-regular.otf deleted file mode 100755 index 784cf4d..0000000 Binary files a/plugins/wordpress-mobile-pack/admin/sass/fonts/open-sans-regular.otf and /dev/null differ diff --git a/plugins/wordpress-mobile-pack/admin/sass/fonts/open-sans-regular.svg b/plugins/wordpress-mobile-pack/admin/sass/fonts/open-sans-regular.svg deleted file mode 100755 index 800a03a..0000000 --- a/plugins/wordpress-mobile-pack/admin/sass/fonts/open-sans-regular.svg +++ /dev/null @@ -1,1825 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/plugins/wordpress-mobile-pack/admin/sass/fonts/open-sans-regular.ttf b/plugins/wordpress-mobile-pack/admin/sass/fonts/open-sans-regular.ttf deleted file mode 100755 index b3a0b0c..0000000 Binary files a/plugins/wordpress-mobile-pack/admin/sass/fonts/open-sans-regular.ttf and /dev/null differ diff --git a/plugins/wordpress-mobile-pack/admin/sass/fonts/open-sans-regular.woff b/plugins/wordpress-mobile-pack/admin/sass/fonts/open-sans-regular.woff deleted file mode 100755 index 8b67923..0000000 Binary files a/plugins/wordpress-mobile-pack/admin/sass/fonts/open-sans-regular.woff and /dev/null differ diff --git a/plugins/wordpress-mobile-pack/admin/sass/fonts/opensans-italic.eot b/plugins/wordpress-mobile-pack/admin/sass/fonts/opensans-italic.eot deleted file mode 100755 index c4b25ee..0000000 Binary files a/plugins/wordpress-mobile-pack/admin/sass/fonts/opensans-italic.eot and /dev/null differ diff --git a/plugins/wordpress-mobile-pack/admin/sass/fonts/opensans-italic.svg b/plugins/wordpress-mobile-pack/admin/sass/fonts/opensans-italic.svg deleted file mode 100755 index ff082d0..0000000 --- a/plugins/wordpress-mobile-pack/admin/sass/fonts/opensans-italic.svg +++ /dev/null @@ -1,1825 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/plugins/wordpress-mobile-pack/admin/sass/fonts/opensans-italic.ttf b/plugins/wordpress-mobile-pack/admin/sass/fonts/opensans-italic.ttf deleted file mode 100755 index 8866de2..0000000 Binary files a/plugins/wordpress-mobile-pack/admin/sass/fonts/opensans-italic.ttf and /dev/null differ diff --git a/plugins/wordpress-mobile-pack/admin/sass/fonts/opensans-italic.woff b/plugins/wordpress-mobile-pack/admin/sass/fonts/opensans-italic.woff deleted file mode 100755 index 24e1315..0000000 Binary files a/plugins/wordpress-mobile-pack/admin/sass/fonts/opensans-italic.woff and /dev/null differ diff --git a/plugins/wordpress-mobile-pack/admin/sass/fonts/opensans-semibold.eot b/plugins/wordpress-mobile-pack/admin/sass/fonts/opensans-semibold.eot deleted file mode 100755 index 0e97ec3..0000000 Binary files a/plugins/wordpress-mobile-pack/admin/sass/fonts/opensans-semibold.eot and /dev/null differ diff --git a/plugins/wordpress-mobile-pack/admin/sass/fonts/opensans-semibold.svg b/plugins/wordpress-mobile-pack/admin/sass/fonts/opensans-semibold.svg deleted file mode 100755 index b09279b..0000000 --- a/plugins/wordpress-mobile-pack/admin/sass/fonts/opensans-semibold.svg +++ /dev/null @@ -1,1825 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/plugins/wordpress-mobile-pack/admin/sass/fonts/opensans-semibold.ttf b/plugins/wordpress-mobile-pack/admin/sass/fonts/opensans-semibold.ttf deleted file mode 100755 index ab9167d..0000000 Binary files a/plugins/wordpress-mobile-pack/admin/sass/fonts/opensans-semibold.ttf and /dev/null differ diff --git a/plugins/wordpress-mobile-pack/admin/sass/fonts/opensans-semibold.woff b/plugins/wordpress-mobile-pack/admin/sass/fonts/opensans-semibold.woff deleted file mode 100755 index ab7e4a0..0000000 Binary files a/plugins/wordpress-mobile-pack/admin/sass/fonts/opensans-semibold.woff and /dev/null differ diff --git a/plugins/wordpress-mobile-pack/admin/sass/fonts/wp-font.eot b/plugins/wordpress-mobile-pack/admin/sass/fonts/wp-font.eot deleted file mode 100755 index 4311126..0000000 Binary files a/plugins/wordpress-mobile-pack/admin/sass/fonts/wp-font.eot and /dev/null differ diff --git a/plugins/wordpress-mobile-pack/admin/sass/fonts/wp-font.svg b/plugins/wordpress-mobile-pack/admin/sass/fonts/wp-font.svg deleted file mode 100755 index 22420ea..0000000 --- a/plugins/wordpress-mobile-pack/admin/sass/fonts/wp-font.svg +++ /dev/null @@ -1,38 +0,0 @@ - - - -Generated by IcoMoon - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/plugins/wordpress-mobile-pack/admin/sass/fonts/wp-font.ttf b/plugins/wordpress-mobile-pack/admin/sass/fonts/wp-font.ttf deleted file mode 100755 index 2ff4b55..0000000 Binary files a/plugins/wordpress-mobile-pack/admin/sass/fonts/wp-font.ttf and /dev/null differ diff --git a/plugins/wordpress-mobile-pack/admin/sass/fonts/wp-font.woff b/plugins/wordpress-mobile-pack/admin/sass/fonts/wp-font.woff deleted file mode 100755 index 9ebd989..0000000 Binary files a/plugins/wordpress-mobile-pack/admin/sass/fonts/wp-font.woff and /dev/null differ diff --git a/plugins/wordpress-mobile-pack/admin/sass/general.scss b/plugins/wordpress-mobile-pack/admin/sass/general.scss deleted file mode 100755 index 58a8cc1..0000000 --- a/plugins/wordpress-mobile-pack/admin/sass/general.scss +++ /dev/null @@ -1,33 +0,0 @@ -/**********************************************************************************************************************/ -/* -/* IMPORT MIXINS -/* -/**********************************************************************************************************************/ - -@import 'mixins/_mixins'; - -/**********************************************************************************************************************/ -/* -/* IMPORT CORE -/* -/**********************************************************************************************************************/ - -@import 'core/_fonts'; -@import 'core/_ie'; -@import 'core/_variables'; -@import 'core/_core'; -@import 'core/_forms'; -@import 'core/_buttons'; - -/**********************************************************************************************************************/ -/* -/* IMPORT MODULES -/* -/**********************************************************************************************************************/ - -@import 'modules/_content'; -@import 'modules/_settings'; -@import 'modules/_themes'; -@import 'modules/_look-and-feel'; -@import 'modules/_whats-new'; -@import 'modules/_perfect-scrollbar'; diff --git a/plugins/wordpress-mobile-pack/admin/sass/mixins/_display.scss b/plugins/wordpress-mobile-pack/admin/sass/mixins/_display.scss deleted file mode 100755 index ad6e767..0000000 --- a/plugins/wordpress-mobile-pack/admin/sass/mixins/_display.scss +++ /dev/null @@ -1,154 +0,0 @@ -@mixin wbz-display-box($important: no) { - @if $important == important{ - display: -webkit-box !important; - display: -ms-flexbox !important; - display: -moz-box !important; - display: box !important; - } - @else { - display: -webkit-box; - display: -ms-flexbox; - display: -moz-box; - display: box; - } -} -@mixin wbz-display-inline-box($important: no) { - @if $important == important{ - display: -webkit-inline-box !important; - display: -ms-inline-flexbox !important; - display: -moz-inline-box !important; - display: inline-flex !important; - } - @else { - display: -webkit-inline-box; - display: -ms-inline-flexbox; - display: -moz-inline-box; - display: inline-flex; - } -} -@mixin wbz-box-flex($flex: 1, $preferredSize: auto, $important: no) { - @if $important == important{ - -webkit-box-flex: $flex !important; - -ms-flex: $flex 0 $preferredSize !important; - -moz-box-flex: $flex !important; - box-flex: $flex !important; - flex: $flex 0 $preferredSize !important; - } - @else { - -webkit-box-flex: $flex; - -ms-flex: $flex 0 $preferredSize; - -moz-box-flex: $flex; - box-flex: $flex; - flex: $flex 0 $preferredSize; - } -} -@mixin wbz-box-orient($orient: horizontal, $important: no) { - @if $important == important { - -webkit-box-orient: $orient !important; - -moz-box-orient: $orient !important; - box-orient: $orient !important; - @if $orient == horizontal { - -ms-flex-direction: row !important; - flex-direction: row !important; - } @else { - -ms-flex-direction: column !important; - flex-direction: column !important; - } - } @else { - -webkit-box-orient: $orient; - -moz-box-orient: $orient; - box-orient: $orient; - @if $orient == horizontal { - -ms-flex-direction: row; - flex-direction: row; - } @else { - -ms-flex-direction: column; - flex-direction: column; - } - } -} -@mixin wbz-box-pack($pack: start, $important: no) { - @if $important == important { - -webkit-box-pack: $pack !important; - -moz-box-pack: $pack !important; - -ms-flex-pack: $pack !important; - box-pack: $pack !important; - @if $pack == start { - justify-content: flex-start !important; - } - @else if $pack == end { - justify-content: flex-end !important; - } - @else if $pack == justify { - justify-content: space-between !important; - } - @else { - justify-content: $pack !important; - } - } @else { - -webkit-box-pack: $pack; - -moz-box-pack: $pack; - -ms-flex-pack: $pack; - box-pack: $pack; - @if $pack == start { - justify-content: flex-start; - } - @else if $pack == end { - justify-content: flex-end; - } - @else if $pack == justify { - justify-content: space-between; - } - @else { - justify-content: $pack; - } - } -} -@mixin wbz-box-align($align: stretch, $important: no) { - @if $important == important{ - -webkit-box-align: $align!important; - -moz-box-align: $align!important; - -ms-flex-align: $align!important; - box-align: $align!important; - - @if $align == start { - align-items: flex-start!important; - } - @else if $align == end { - align-items: flex-end!important; - } - @else { - align-items: $align!important; - } - } - @else { - -webkit-box-align: $align; - -moz-box-align: $align; - -ms-flex-align: $align; - box-align: $align; - - @if $align == start { - align-items: flex-start; - } - @else if $align == end { - align-items: flex-end; - } - @else { - align-items: $align; - } - } -} -@mixin wbz-box-sizing($value, $important: no){ - @if $important == important{ - -webkit-box-sizing: $value !important; - -moz-box-sizing: $value !important; - box-sizing: $value !important; - } - @else { - -webkit-box-sizing: $value; - -moz-box-sizing: $value; - box-sizing: $value; - } -} - - diff --git a/plugins/wordpress-mobile-pack/admin/sass/mixins/_icon.scss b/plugins/wordpress-mobile-pack/admin/sass/mixins/_icon.scss deleted file mode 100755 index ea5ba93..0000000 --- a/plugins/wordpress-mobile-pack/admin/sass/mixins/_icon.scss +++ /dev/null @@ -1,58 +0,0 @@ -@mixin wbz-inline-icon($name, $font-size: 15px, $font-family: 'Appticles') { - $character: wbz-icon-character-for-name($name); - - &:before { - position: relative; - text-align: center; - font-family: $font-family!important; - font-size: $font-size!important; - font-weight: normal!important; - - @if $character { - content: "#{$character}"; - } @else { - content: "#{$name}"; - } - } -} - - -@function wbz-icon-character-for-name($name) { - - // Row 1 - @if ($name == "facebook") { @return "f"; } - @else if ($name == "twitter") { @return "t"; } - @else if ($name == "google-plus") { @return "g"; } - @else if ($name == "rss") { @return "r"; } - @else if ($name == "wordpress") { @return "w"; } - @else if ($name == "tumblr") { @return "\35"; } - @else if ($name == "youtube") {@return "\36"; } - @else if($name == "dfp") { @return "\37"; } - - @else if ($name == "close-x") { @return "\31"; } - @else if ($name == "active") { @return "\32"; } - @else if ($name == "preview") { @return "\113"; } - @else if ($name == "edit") { @return "\34"; } - - @else if($name == "apple") { @return "\e800"; } - @else if($name == "lock") { @return "\e801"; } - @else if($name == "blocked") { @return "\e802"; } - @else if($name == "airplane") { @return "\e803"; } - @else if($name == "cloud") { @return "\e804"; } - @else if($name == "stack") { @return "\e805"; } - @else if($name == "tablet") { @return "\e806"; } - @else if($name == "paint") { @return "\e807"; } - @else if($name == "shield") { @return "\e808"; } - @else if($name == "share") { @return "\e809"; } - - @else if($name == "coins") { @return "\e80a"; } - @else if($name == "headset") { @return "\e80b"; } - @else if($name == "pic") { @return "\e900"; } - - @else if ($name == "shopping") { @return "\115"; } - - @else { - // @debug "#icon: icon with name '#{$name}' not found."; - @return false; - } -} diff --git a/plugins/wordpress-mobile-pack/admin/sass/mixins/_mixins.scss b/plugins/wordpress-mobile-pack/admin/sass/mixins/_mixins.scss deleted file mode 100755 index cdfd2dd..0000000 --- a/plugins/wordpress-mobile-pack/admin/sass/mixins/_mixins.scss +++ /dev/null @@ -1,115 +0,0 @@ -/************************************************/ -/* import icon and display mixins files -/************************************************/ - -@import '_icon'; -@import '_display'; - -/************************************************/ -/* mixins for css3 animations -/************************************************/ - -@mixin wbz-transform-origin($value, $important: no) { - @if $important == important{ - -webkit-transform-origin: $value !important; - -moz-transform-origin: $value !important; - transform-origin: $value !important; - } - @else { - -webkit-transform-origin: $value; - -moz-transform-origin: $value; - transform-origin: $value; - } -} -@mixin wbz-transform($value, $important: no){ - @if $important == important{ - -webkit-transform: $value !important; - -moz-transform: $value !important; - transform: $value !important; - } - @else { - -webkit-transform: $value; - -moz-transform: $value; - transform: $value; - } -} -@mixin wbz-transition-timing($value, $important: no){ - @if $important == important{ - -webkit-transition-timing-function: $value !important; - -moz-transition-timing-function: $value !important; - transition-timing-function: $value !important; - } - @else { - -webkit-transition-timing-function: $value; - -moz-transition-timing-function: $value; - transition-timing-function: $value; - } -} -@mixin wbz-transition($value){ - -webkit-transition: $value; - -moz-transition: $value; - transition: $value; - -} - -/************************************************/ -/* other mixins -/************************************************/ -@mixin wbz-box-shadow($value, $important: no){ - @if $important == important{ - -webkit-box-shadow: $value !important; - -moz-box-shadow: $value !important; - box-shadow: $value !important; - } - @else { - -webkit-box-shadow: $value; - -moz-box-shadow: $value; - box-shadow: $value; - } -} -@mixin wbz-border-radius($value, $important: no){ - @if $important == important{ - -webkit-border-radius: $value !important; - -moz-border-radius: $value !important; - border-radius: $value !important; - } - @else { - -webkit-border-radius: $value; - -moz-border-radius: $value; - border-radius: $value; - } -} -@mixin wbz-opacity($value, $important: no){ - @if $important == important{ - filter: progid:DXImageTransform.Microsoft.Alpha(opacity=$value*100) !important; - -moz-opacity: $value !important; - opacity: $value !important; - } - @else { - filter: progid:DXImageTransform.Microsoft.Alpha(opacity=$value*100); - -moz-opacity: $value; - opacity: $value; - } -} -@mixin wbz-spacer($value){ - clear: both; - font-size: 1px; - height: $value; - line-height: 1px; - overflow: hidden; -} -@mixin wbz-placeholder-color($value){ - ::-webkit-input-placeholder { - color: $value; - } - :-moz-placeholder { - color: $value; - } - ::-moz-placeholder { - color: $value; - } - :-ms-input-placeholder { - color: $value; - } -} - diff --git a/plugins/wordpress-mobile-pack/admin/sass/modules/_content.scss b/plugins/wordpress-mobile-pack/admin/sass/modules/_content.scss deleted file mode 100755 index ce1cb44..0000000 --- a/plugins/wordpress-mobile-pack/admin/sass/modules/_content.scss +++ /dev/null @@ -1,398 +0,0 @@ -#wmpack-admin{ - .content{ - display: table; - width:100%; - .left-side{ - width: 100%; - display: table; - vertical-align: top; - - .details{ - padding:30px; - background-color: $box-color; - - h2.title{ - font-family: 'OlRoundGothicLight', sans-serif; - font-size: 25px; - line-height: normal; - color: $base-text-color; - } - } - ul.categories{ - list-style-type: none; - width: 100%; - display: block; - - li{ - @include wbz-display-box(); - @include wbz-box-orient(horizontal); - @include wbz-box-align(center); - @include wbz-box-pack(justify); - @include wbz-box-flex(1); - background-color: #fcfcfc; - height: 64px; - width: 100%; - border-bottom: #f0f1f2 1px solid; - margin-bottom: 5px; - cursor: pointer; - vertical-align: middle; - - .row{ - @include wbz-display-box(); - @include wbz-box-orient(horizontal); - @include wbz-box-align(center); - height: 64px; - width: 90%; - vertical-align: middle; - } - - &:hover{ - background-color: lighten($base-blue,45%); - border-bottom: lighten($base-blue,41%) 1px solid; - @include wbz-display-box(); - @include wbz-box-orient(horizontal); - - a{ - &.edit{ - display:block; - } - &.delete{ - @include wbz-display-box(); - } - &[class^="icon-"]{ - .relative{ - .img{ - @include wbz-transform(translateY(30%) translateX(30%) scale(0.4)); - @include wbz-transition(all 0.3s ease-in-out); - } - } - } - } - } - .buttons{ - @include wbz-display-box(); - @include wbz-box-flex(1); - @include wbz-box-pack(end); - } - span, - a{ - font-family: 'AcordeRegular', sans-serif; - - &.status{ - @include wbz-display-box(); - font-size: 12px; - color: #8c8d8d; - width: 70px; - position: relative; - margin: 0 0 0 20px; - - &.active::before{ - content: ''; - @include wbz-display-box(); - position: absolute; - width: 19px; - height: 19px; - border: #fff 3px solid; - @include wbz-border-radius(19px); - background-color: $base-green; - left: -29px; - top: 1px; - } - &.inactive::before{ - content: ''; - @include wbz-display-box(); - position: absolute; - width: 19px; - height: 19px; - border: #fff 3px solid; - @include wbz-border-radius(19px); - background-color: darken($base-red,30%); - left: -29px; - top: 1px; - } - } - &.pic{ - @include wbz-display-box(); - @include wbz-border-radius(48px); - - width: 48px; - height: 48px; - margin: 0 20px 0 0; - - background-color: #cbdde2; - background-size: cover; - background-position: center; - - color: #ffffff; - - &.default { - @include wbz-inline-icon(pic, 24px); - - &::before{ - width: 48px; - height: 48px; - line-height: 48px; - position: absolute; - } - } - } - &.title{ - @include wbz-display-box(); - font-size: 15px; - color: $base-dark-blue; - text-transform: uppercase; - width: 300px; - } - &.posts{ - @include wbz-display-box(); - font-family: 'OpenSansItalic',sans-serif; - color: $base-p-color; - font-size: 15px; - margin-right: 30px; - @include wbz-box-flex(1); - @include wbz-box-pack(end); - } - &.edit{ - @include wbz-inline-icon(edit, 24px); - width: 63px; - height: 63px; - background: #cbdde2; - color: #ffffff; - border-left: 1px solid #e0edf1; - display: none; - position: relative; - &:hover{ - background: #d3e3e8; - } - &::before{ - width: 63px; - height: 63px; - line-height: 63px; - position: absolute; - } - } - &.delete{ - @include wbz-inline-icon(close-x, 24px); - width: 63px; - height: 63px; - background: #cbdde2; - color: #ffffff; - border-left: 1px solid #e0edf1; - display: none; - position: relative; - - &:hover{ - background: #d3e3e8; - } - &::before{ - width: 63px; - height: 63px; - line-height: 63px; - position: absolute; - } - } - &[class^="icon-"]{ - @include wbz-display-box(); - @include wbz-border-radius(48px); - width: 48px; - height: 48px; - margin: 0 20px 0 0; - - &::before{ - width: 48px; - height: 48px; - line-height: 48px; - } - .relative{ - display: block; - width: 0; - - .img{ - @include wbz-border-radius(48px); - @include wbz-display-box(); - @include wbz-transform(translateY(0%) scale(1)); - @include wbz-transition(all 0.3s ease-in-out); - width: 48px; - height: 48px; - left: 0px; - top: 0px; - position: absolute; - background-color: #ffffff; - @include wbz-box-shadow(inset 0 0 1px rgba(0,0,0,0.5)); - } - } - } - } - } - &.pages{ - li{ - span{ - &.title{ - - } - } - } - } - } - } - .branding-category { - - .custom-upload { - position: relative; - height: 36px; - width: 450px; - margin: 10px 0; - - &:hover{ - .fake-file{ - .btn{ - background: darken($base-grey, $darken-amounth/2); - border: 1px solid darken($base-grey, $darken-amounth); - } - input{ - outline:none; - border:1px solid darken($input-border,$darken-amounth); - } - } - } - .remove{ - position: absolute; - top: 8px; - right: 160px; - width: 16px; - height: 16px; - z-index: 3; - @include wbz-inline-icon(close-x, 9px); - color: #ffffff; - background: $base-color-darken; - @include wbz-border-radius(16px); - padding: 3px; - - &::before{ - top: -4px; - left: 0px; - display: block; - } - } - } - .custom-upload input[type=file] { - outline: none; - position: relative; - text-align: right; - @include wbz-opacity(0); - z-index: 2; - width: 430px; - height: 100%; - } - .custom-upload .fake-file { - position: relative; - top: -38px; - left: 0px; - width: 430px; - padding: 0; - margin: 0; - z-index: 1; - line-height: 100%; - @include wbz-display-box(); - - .btn{ - margin: 0px 0px 0px 10px; - } - } - .custom-upload .fake-file input { - width: 300px; - font-family: 'AcordeSemiBold', sans-serif; - color: $input-color; - font-size: $input-font-size; - margin: 0; - } - .display-icon{ - text-align: left; - height: 70px; - - .edit{ - margin: 20px 0 0 0; - vertical-align: middle; - text-align: center; - float: left; - } - .remove{ - display: inline-block; - margin: 28px 0 0 10px; - } - img{ - width: 120px; - height: auto; - display: inline-block; - margin: 0 25px; - float: left; - } - label{ - width: 100px; - display: inline; - float: left; - margin: 25px 0 0 0; - } - } - .cancel-link{ - position: relative; - - .cancel{ - position: absolute; - top: -39px; - right: -30px; - } - } - } - .button{ - margin:2px; - padding: 0px 8px 1px 8px; - - &.insert-media{ - color: #555; - background: #f7f7f7; - box-shadow: inset 0 1px 0 #fff, 0 1px 0 rgba(0,0,0,.08); - padding: 0px 7px 1px 5px; - margin: 0px 5px 4px 0px; - display: inline-block; - line-height: 26px; - font-size:13px; - } - } - .wp-switch-editor{ - color:#555; - height:20px; - background: #ebebeb; - border:1px solid #dedede; - font: 13px/19px "Open Sans", sans-serif; - margin: 5px 0 0 5px; - padding: 3px 8px 4px; - @include wbz-box-sizing(initial); - } - .wp-editor-wrap{ - min-width:100%; - textarea{ - width:100%; - height:auto; - } - &.tmce-active{ - .switch-tmce{ - background: #f5f5f5; - color: #555; - height: 20px; - border-bottom-color:#f5f5f5; - } - } - &.html-active { - .switch-html { - background: #f5f5f5; - color: #555; - height: 20px; - border-bottom-color:#f5f5f5; - } - } - } - - } - -} \ No newline at end of file diff --git a/plugins/wordpress-mobile-pack/admin/sass/modules/_look-and-feel.scss b/plugins/wordpress-mobile-pack/admin/sass/modules/_look-and-feel.scss deleted file mode 100755 index 43cd8c3..0000000 --- a/plugins/wordpress-mobile-pack/admin/sass/modules/_look-and-feel.scss +++ /dev/null @@ -1,287 +0,0 @@ -#wmpack-admin{ - .look-and-feel{ - display: table; - - .left-side{ - width: 100%; - display: table; - vertical-align: top; - - .details{ - padding:30px; - background-color: $box-color; - - h2.title{ - font-family: 'OlRoundGothicLight', sans-serif; - font-size: 25px; - line-height: normal; - color: $base-text-color; - } - .section-header{ - font-family: 'AcorderSemiBold', sans-serif; - font-size: 18px; - line-height: normal; - color: $base-dark-blue; - } - - .color-schemes{ - width: 50%; - float: left; - - .colors{ - display: table; - width: 260px; - height: 16px; - border: #daddde 1px solid; - - &.description{ - border: none; - font-family: 'AcordeRegular', sans-serif; - margin-left:56px; - } - - [class^="color-"]{ - display: table-cell; - height: 16px; - width: 27px; - text-align: center; - } - - [class^="color-custom-"]{ - background: #eeeff1; - border-right: 1px solid #fff; - cursor:pointer; - - &:last-child{ - border-right:none; - } - } - } - } - - .color-schemes-custom { - - .set { - width: 50%; - float: left; - margin-bottom: 10px; - - .wp-picker-container * { - @include wbz-box-sizing(content-box); - /*display: inherit;*/ - - .button { - margin-left: 6px; - @include wbz-box-sizing(border-box); - } - } - > label { - width: 100%; - } - } - } - - .font-chooser{ - - label { - position: relative; - display: inline-block; - width: 135px; - } - - .subtext { - font-size: 11px; - - a { - font-size: 11px; - } - } - } - - &.branding{ - label, p{ - font-family: 'AcordeRegular', sans-serif; - font-size: 15px; - line-height: normal; - color: darken($base-blue,50%); - - } - .custom-upload { - position: relative; - height: 36px; - width: 450px; - margin: 10px 0; - - &:hover{ - .fake-file{ - .btn{ - background: darken($base-grey, $darken-amounth/2); - border: 1px solid darken($base-grey, $darken-amounth); - } - input{ - outline:none; - border:1px solid darken($input-border,$darken-amounth); - } - } - } - .remove{ - position: absolute; - top: 8px; - right: 160px; - width: 16px; - height: 16px; - z-index: 3; - @include wbz-inline-icon(close-x, 9px); - color: #ffffff; - background: $base-color-darken; - @include wbz-border-radius(16px); - padding: 3px; - - &::before{ - top: -4px; - left: 0px; - display: block; - } - } - } - .custom-upload input[type=file] { - outline: none; - position: relative; - text-align: right; - @include wbz-opacity(0); - z-index: 2; - width: 430px; - height: 100%; - } - .custom-upload .fake-file { - position: relative; - top: -38px; - left: 0px; - width: 430px; - padding: 0; - margin: 0; - z-index: 1; - line-height: 100%; - @include wbz-display-box(); - - .btn{ - margin: 0px 0px 0px 10px; - } - } - .custom-upload .fake-file input { - width: 300px; - font-family: 'AcordeSemiBold', sans-serif; - color: $input-color; - font-size: $input-font-size; - margin: 0; - } - .display-logo{ - text-align: left; - height: 120px; - - .edit{ - margin: 47px 0 0 0; - vertical-align: middle; - text-align: center; - float: left; - } - .remove{ - display: inline-block; - margin: 55px 0 0 10px; - } - .img{ - width: 120px; - height: 120px; - display: inline-block; - margin: 0 25px; - float: left; - } - label{ - width: 100px; - display: inline; - float: left; - margin: 55px 0 0 0; - } - } - .display-icon{ - @include wbz-display-box(); - @include wbz-box-orient(horizontal); - @include wbz-box-pack(start); - @include wbz-box-align(center); - text-align: left; - height: 120px; - - .edit{ - margin: 47px 0 0 0; - vertical-align: middle; - text-align: center; - float: left; - } - .remove{ - display: inline-block; - margin: 55px 0 0 10px; - } - img{ - width: 120px; - height: 120px; - @include wbz-border-radius(120px); - @include wbz-box-shadow(inset 0 0 5px 1px rgba(0,0,0,0.1)); - display: inline-block; - margin: 0 25px; - float: left; - } - label{ - width: 100px; - display: inline; - float: left; - margin: 55px 0 0 0; - } - } - .cancel-link{ - position: relative; - - .cancel{ - position: absolute; - top: -39px; - right: -30px; - } - } - - .wp-switch-editor{ - color:#555; - height:20px; - background: #ebebeb; - border:1px solid #dedede; - font: 13px/19px "Open Sans", sans-serif; - margin: 5px 0 0 5px; - padding: 3px 8px 4px; - @include wbz-box-sizing(initial); - } - .wp-editor-wrap{ - width: 60%; - float: left; - textarea{ - width:100%; - } - &.tmce-active{ - .switch-tmce{ - background: #f5f5f5; - color: #555; - height: 20px; - border-bottom-color:#f5f5f5; - } - } - &.html-active { - .switch-html { - background: #f5f5f5; - color: #555; - height: 20px; - border-bottom-color:#f5f5f5; - } - } - } - } - } - } - } -} diff --git a/plugins/wordpress-mobile-pack/admin/sass/modules/_perfect-scrollbar.scss b/plugins/wordpress-mobile-pack/admin/sass/modules/_perfect-scrollbar.scss deleted file mode 100755 index 91d336f..0000000 --- a/plugins/wordpress-mobile-pack/admin/sass/modules/_perfect-scrollbar.scss +++ /dev/null @@ -1,128 +0,0 @@ -/****************************/ -/* PERFECT SCROLLBAR */ - -.ps-container .ps-scrollbar-x-rail { - position: absolute; /* please don't change 'position' */ - bottom: 3px; /* there must be 'bottom' for ps-scrollbar-x-rail */ - height: 8px; - -webkit-border-radius: 4px; - -moz-border-radius: 4px; - border-radius: 4px; - opacity: 0; - filter: alpha(opacity = 0); - -o-transition: background-color .2s linear, opacity .2s linear; - -webkit-transition: background-color .2s linear, opacity .2s linear; - -moz-transition: background-color .2s linear, opacity .2s linear; - transition: background-color .2s linear, opacity .2s linear; -} - -.ps-container:hover .ps-scrollbar-x-rail, -.ps-container.hover .ps-scrollbar-x-rail { - opacity: 0.6; - filter: alpha(opacity = 60); -} - -.ps-container .ps-scrollbar-x-rail:hover, -.ps-container .ps-scrollbar-x-rail.hover { - background-color: #eee; - opacity: 0.9; - filter: alpha(opacity = 90); -} - -.ps-container .ps-scrollbar-x-rail.in-scrolling { - background-color: #eee; - opacity: 0.9; - filter: alpha(opacity = 90); -} - -.ps-container .ps-scrollbar-y-rail { - position: absolute; /* please don't change 'position' */ - right: 3px; /* there must be 'right' for ps-scrollbar-y-rail */ - width: 8px; - -webkit-border-radius: 4px; - -moz-border-radius: 4px; - border-radius: 4px; - opacity: 0; - filter: alpha(opacity = 0); - -o-transition: background-color .2s linear, opacity .2s linear; - -webkit-transition: background-color .2s linear, opacity .2s linear; - -moz-transition: background-color .2s linear, opacity .2s linear; - transition: background-color .2s linear, opacity .2s linear; -} - -.ps-container:hover .ps-scrollbar-y-rail, -.ps-container.hover .ps-scrollbar-y-rail { - opacity: 0.6; - filter: alpha(opacity = 60); -} - -.ps-container .ps-scrollbar-y-rail:hover, -.ps-container .ps-scrollbar-y-rail.hover { - background-color: #eee; - opacity: 0.9; - filter: alpha(opacity = 90); -} - -.ps-container .ps-scrollbar-y-rail.in-scrolling { - background-color: #eee; - opacity: 0.9; - filter: alpha(opacity = 90); -} - -.ps-container .ps-scrollbar-x { - position: absolute; /* please don't change 'position' */ - bottom: 0; /* there must be 'bottom' for ps-scrollbar-x */ - height: 8px; - background-color: #aaa; - -webkit-border-radius: 4px; - -moz-border-radius: 4px; - border-radius: 4px; - -o-transition: background-color .2s linear; - -webkit-transition: background-color.2s linear; - -moz-transition: background-color .2s linear; - transition: background-color .2s linear; -} - -.ps-container.ie6 .ps-scrollbar-x { - font-size: 0; /* fixed scrollbar height in xp sp3 ie6 */ -} - -.ps-container .ps-scrollbar-x-rail:hover .ps-scrollbar-x, -.ps-container .ps-scrollbar-x-rail.hover .ps-scrollbar-x { - background-color: #999; -} - -.ps-container .ps-scrollbar-y { - position: absolute; /* please don't change 'position' */ - right: 0; /* there must be 'right' for ps-scrollbar-y */ - width: 8px; - background-color: #aaa; - -webkit-border-radius: 4px; - -moz-border-radius: 4px; - border-radius: 4px; - -o-transition: background-color .2s linear; - -webkit-transition: background-color.2s linear; - -moz-transition: background-color .2s linear; - transition: background-color .2s linear; -} - -.ps-container.ie6 .ps-scrollbar-y { - font-size: 0; /* fixed scrollbar height in xp sp3 ie6 */ -} - -.ps-container .ps-scrollbar-y-rail:hover .ps-scrollbar-y, -.ps-container .ps-scrollbar-y-rail.hover .ps-scrollbar-y { - background-color: #999; -} - -.ps-container.ie .ps-scrollbar-x, -.ps-container.ie .ps-scrollbar-y { - visibility: hidden; -} - -.ps-container.ie:hover .ps-scrollbar-x, -.ps-container.ie:hover .ps-scrollbar-y, -.ps-container.ie.hover .ps-scrollbar-x, -.ps-container.ie.hover .ps-scrollbar-y { - visibility: visible; -} \ No newline at end of file diff --git a/plugins/wordpress-mobile-pack/admin/sass/modules/_settings.scss b/plugins/wordpress-mobile-pack/admin/sass/modules/_settings.scss deleted file mode 100755 index 3461a53..0000000 --- a/plugins/wordpress-mobile-pack/admin/sass/modules/_settings.scss +++ /dev/null @@ -1,40 +0,0 @@ -#wmpack-admin{ - .settings{ - display: table; - - .left-side{ - width: 100%; - display: table; - vertical-align: top; - - .details{ - padding: 30px; - background-color: $box-color; - - h2.title{ - font-family: 'OlRoundGothicLight', sans-serif; - font-size: 25px; - line-height: normal; - color: $base-text-color; - } - .display-mode{ - - p, label{ - font-family: 'AcordeRegular', sans-serif; - font-size:15px; - line-height: normal; - color: $base-text-color; - } - - .notices-container { - width: 465px; - - .notice { - max-width: 90%; - } - } - } - } - } - } -} diff --git a/plugins/wordpress-mobile-pack/admin/sass/modules/_themes.scss b/plugins/wordpress-mobile-pack/admin/sass/modules/_themes.scss deleted file mode 100755 index e7e5bb4..0000000 --- a/plugins/wordpress-mobile-pack/admin/sass/modules/_themes.scss +++ /dev/null @@ -1,265 +0,0 @@ -#wmpack-admin{ - .themes{ - display: table; - - .left-side{ - width: 100%; - display: table; - vertical-align: top; - - $theme-box-width: 195px; - $theme-box-height: 320px; - $theme-box-margin: 25px; - $theme-box-subsection-height: 41px; - - .corner{ - z-index: 1; - - &.active{ - .indicator{ - @include wbz-inline-icon(active, 11px); - color: #ffffff; - - top: 0px; - left: $theme-box-width - 44px; - - &::before{ - top: -40px; - right: 18px; - } - } - } - } - .details{ - padding:30px; - background-color: $box-color; - - h2.title{ - font-family: 'OlRoundGothicLight', sans-serif; - font-size: 25px; - line-height: normal; - color: $base-text-color; - } - .section-header{ - font-family: 'AcorderSemiBold', sans-serif; - font-size: 18px; - line-height: normal; - color: $base-dark-blue; - } - - &.theming{ - display: table; - width: 100%; - - h2.title { - text-align: center; - } - - .themes{ - display: block; - width: ($theme-box-width + $theme-box-margin) * 3 + 20; - margin: 0 auto; - - .theme{ - display: inline-block; - width: $theme-box-width; - height: $theme-box-height; - margin: 0 $theme-box-margin $theme-box-margin 0; - position: relative; - - &:nth-child(3){ - margin: 0; - } - - .name{ - font-family: 'AcordeRegular', sans-serif; - font-size: 16px; - color: $base-text-color; - background: $base-color-lighter; - height: $theme-box-subsection-height; - border-bottom: 1px solid #dce0e0; - padding: 10px; - text-transform: uppercase; - text-align: center; - } - .content{ - font-size: 14px; - color: $base-p-color; - height: $theme-box-subsection-height; - padding: 5px 5px; - text-align: center; - } - .image{ - background-size: cover; - background-repeat: no-repeat; - width: 100%; - height: $theme-box-height - $theme-box-subsection-height * 2; - overflow: hidden; - position: relative; - - &:hover{ - .overlay{ - visibility: visible; - @include wbz-transform(translateX(0%)); - @include wbz-opacity(1); - @include wbz-transition(all 0.3s ease-in-out); - } - } - } - .overlay{ - background: rgba(154,202,64,0.9); - position: absolute; - width: $theme-box-width; - height: $theme-box-height - $theme-box-subsection-height * 2; - text-align: center; - - @include wbz-transform(translateX(-100%)); - @include wbz-opacity(0); - @include wbz-transition(all 0.3s ease-in-out); - - .actions { - @include wbz-display-box(); - display: flex; - @include wbz-box-orient(horizontal); - @include wbz-box-align(center); - @include wbz-box-pack(center); - - .preview { - @include wbz-inline-icon(preview, 20px); - color: #ffffff; - background: #333333; - @include wbz-border-radius(33px); - width: 33px; - height: 33px; - margin: 0 2px; - float: none; - - &:hover { - cursor: pointer; - background: lighten(#333333, 10%); - } - - &::before { - width: 33px; - height: 33px; - line-height: 33px; - } - } - } - - [class^="text"] { - font-family: "OpenSansSemiBold", sans-serif; - font-size: 13px; - color: #333333; - text-align: center; - } - } - span.price { - border-radius: 50px; - background: $base-orange; - color: #ffffff; - padding: 3px 5px; - } - &.premium{ - /*.corner{ - .indicator{ - background: url(../images/ribbon-premium.png); - width: 67px; - height: 68px; - position: absolute; - top: -4px; - right: -5px; - left: $theme-box-width - 62px; - } - }*/ - .overlay{ - background: rgba(#fdf7d3,0.9); - - .unlock{ - @include wbz-inline-icon(unlock, 17px); - color: #ffffff; - background: $base-orange; - @include wbz-border-radius(33px); - width: 33px; - height: 33px; - margin: 0 2px; - float: none; - - &:hover{ - cursor: pointer; - background: lighten($base-orange, 10%); - } - - &::before{ - width: 33px; - height: 33px; - top: 7px; - left: 0px; - } - } - .preview{ - background: $base-orange; - - &:hover{ - background: lighten($base-orange, 10%); - } - } - .text{ - font-family: "OpenSansSemiBold", sans-serif; - font-size: 13px; - color: $base-text-color; - text-align: center; - display: block; - - &:last-child{ - font-size: 12px; - font-family: "OpenSansRegular", sans-serif; - } - span{ - font-size: 15px; - color: $base-text-color; - display: block; - } - } - .btn{ - margin: 0 auto; - width: 150px; - } - .info{ - margin: 0 auto; - width: $input-size-smaller + $btn-size-smallest + 10px; - - input[type="text"]{ - float: left; - background: rgba(250,250,250,0.8); - } - .btn{ - float: left; - margin: 0 0 0 10px; - } - } - } - .content { - a.btn.smaller { - width: 100%; - line-height: normal; - } - } - } - - &.bundle { - margin-bottom: 0; - } - } - } - - span.shopping { - @include wbz-inline-icon(shopping, 17px); - line-height: 33px; - color: #ffffff; - } - } - } - } - } -} diff --git a/plugins/wordpress-mobile-pack/admin/sass/modules/_whats-new.scss b/plugins/wordpress-mobile-pack/admin/sass/modules/_whats-new.scss deleted file mode 100755 index 74a6bc5..0000000 --- a/plugins/wordpress-mobile-pack/admin/sass/modules/_whats-new.scss +++ /dev/null @@ -1,107 +0,0 @@ -#wmpack-admin{ - .whats-new{ - display: table; - .left-side{ - width: 100%; - display: table; - vertical-align: top; - - - .details{ - padding:30px; - background-color: $box-color; - - &.waitlist { - padding-top: 0px; - - .waitlist-subscribe { - border: 2px dotted $base-green; - background: #f4f4f4; - padding: 20px; - margin: 0 20px 0 20px; - - p { - text-align: center; - } - - form { - float: none; - text-align: center; - - .error { - width: 220px; - margin: 0 auto; - } - - .btn { - margin: 0 auto; - } - } - } - .added { - margin: 0 auto; - } - } - - h1{ - font-family: 'OlRoundGothicLight', sans-serif; - font-size: 40px; - line-height: 40px; - color: $base-text-color; - text-align: center; - letter-spacing: 0.5px; - } - .upgrade-message{ - text-align: center; - } - h2.title{ - font-family: 'OlRoundGothicLight', sans-serif; - font-size: 25px; - line-height: normal; - color: $base-text-color; - } - .showcase{ - width: 671px; - margin: 0 auto; - } - - &.features { - - padding-bottom: 0px; - - .feature { - - margin-bottom: 30px; - - img { - width: 130px; - height: auto; - float: left; - margin: 20px 30px 0 0; - } - .text { - span { - font-family: "OpenSansRegular", sans-serif; - font-size: 14px; - color: $base-text-color; - - &.title { - display: block; - margin: 15px 0 8px 0; - font-size: 18px; - color: #333333; - } - } - } - &.right { - img { - float: right; - margin: 20px 0 0 30px; - } - } - } - } - } - } - } -} diff --git a/plugins/wordpress-mobile-pack/core/config.php b/plugins/wordpress-mobile-pack/core/config.php index 6b7b43e..3aa6a75 100755 --- a/plugins/wordpress-mobile-pack/core/config.php +++ b/plugins/wordpress-mobile-pack/core/config.php @@ -1,6 +1,6 @@ str_replace(basename($full_url), $thumbnail['file'], $full_url), @@ -1264,7 +1273,7 @@ if ( ! class_exists( 'WMobilePack_Export' ) ) { $comment_post_ID = $post->ID; $comment_author = (isset($_GET['author'])) ? trim(strip_tags($_GET['author'])) : ''; $comment_author_email = (isset($_GET['email'])) ? trim($_GET['email']) : ''; - $comment_author_url = (isset($_GET['url'])) ? trim($this->purifier->purify($_GET['url'])) : ''; + $comment_author_url = (isset($_GET['url'])) ? trim(filter_var($_GET['url'], FILTER_SANITIZE_URL)) : ''; $comment_content = (isset($_GET['comment'])) ? trim($this->purifier->purify($_GET['comment'])) : ''; $comment_type = 'comment'; $comment_parent = isset($_GET['comment_parent']) ? absint($_GET['comment_parent']) : 0; @@ -1360,7 +1369,7 @@ if ( ! class_exists( 'WMobilePack_Export' ) ) { 'message' => 'Duplicate comment' ); - echo $this->purifier->purify($_GET['callback']). '(' . json_encode($arr_response) . ')'; + echo filter_var($_GET['callback'], FILTER_SANITIZE_STRING). '(' . json_encode($arr_response) . ')'; // end exit(); @@ -1585,15 +1594,27 @@ if ( ! class_exists( 'WMobilePack_Export' ) ) { // set blog name $blog_name = get_bloginfo("name"); - // init response depending on the manifest type + // init response depending on the manifest type if (isset($_GET['content']) && $_GET['content'] == 'androidmanifest') { - $arr_manifest = array( + $arr_manifest = array( 'name' => $blog_name, 'start_url' => home_url(), - 'display' => 'standalone' + 'display' => 'standalone', + 'orientation' => 'any' ); + if (!class_exists('WMobilePack_Themes_Config')) { + require_once(WMP_PLUGIN_PATH . 'inc/class-wmp-themes-config.php'); + } + + $background_color = WMobilePack_Themes_Config::get_manifest_background(); + + if ($background_color !== false){ + $arr_manifest['theme_color'] = $background_color; + $arr_manifest['background_color'] = $background_color; + } + } else { // remove domain name from the launch path diff --git a/plugins/wordpress-mobile-pack/export/content.php b/plugins/wordpress-mobile-pack/export/content.php index d1f7b06..85aafa3 100755 --- a/plugins/wordpress-mobile-pack/export/content.php +++ b/plugins/wordpress-mobile-pack/export/content.php @@ -18,7 +18,7 @@ if ( isset( $_GET['content'] ) ) { if ( isset( $_GET['callback'] ) ) { // filter callback param - $callback = $export->purifier->purify( $_GET['callback'] ); + $callback = filter_var($_GET['callback'], FILTER_SANITIZE_STRING); header( 'Content-Type: application/javascript' ); diff --git a/plugins/wordpress-mobile-pack/frontend/class-application.php b/plugins/wordpress-mobile-pack/frontend/class-application.php index ed33304..d684719 100755 --- a/plugins/wordpress-mobile-pack/frontend/class-application.php +++ b/plugins/wordpress-mobile-pack/frontend/class-application.php @@ -505,6 +505,12 @@ if (!class_exists('WMobilePack_Application')) { $settings['comments_token'] = WMobilePack_Tokens::get_token(); + if (!class_exists('WMobilePack_Themes_Config')) { + require_once(WMP_PLUGIN_PATH . 'inc/class-wmp-themes-config.php'); + } + + $settings['manifest_color'] = WMobilePack_Themes_Config::get_manifest_background($settings['color_scheme']); + return $settings; } diff --git a/plugins/wordpress-mobile-pack/frontend/themes/app1/template.php b/plugins/wordpress-mobile-pack/frontend/themes/app1/template.php index 110c090..be447d4 100755 --- a/plugins/wordpress-mobile-pack/frontend/themes/app1/template.php +++ b/plugins/wordpress-mobile-pack/frontend/themes/app1/template.php @@ -34,6 +34,11 @@ if ($texts_json_exists === false) { + + + + + " /> @@ -41,6 +46,8 @@ if ($texts_json_exists === false) { <?php echo get_bloginfo("name");?> + + Some text'; - - $config = HTMLPurifier_Config::createDefault(); - $config->set('Filter', 'ExtractStyleBlocks', true); - $purifier = new HTMLPurifier($config); - - $html = $purifier->purify($dirty); - - // This implementation writes the stylesheets to the styles/ directory. - // You can also echo the styles inside the document, but it's a bit - // more difficult to make sure they get interpreted properly by - // browsers; try the usual CSS armoring techniques. - $styles = $purifier->context->get('StyleBlocks'); - $dir = 'styles/'; - if (!is_dir($dir)) mkdir($dir); - $hash = sha1($_GET['html']); - foreach ($styles as $i => $style) { - file_put_contents($name = $dir . $hash . "_$i"); - echo ''; - } -?> - - -
- -
- - -]]> -

- Warning: It is possible for a user to mount an - imagecrash attack using this CSS. Counter-measures are difficult; - it is not simply enough to limit the range of CSS lengths (using - relative lengths with many nesting levels allows for large values - to be attained without actually specifying them in the stylesheet), - and the flexible nature of selectors makes it difficult to selectively - disable lengths on image tags (HTML Purifier, however, does disable - CSS width and height in inline styling). There are probably two effective - counter measures: an explicit width and height set to auto in all - images in your document (unlikely) or the disabling of width and - height (somewhat reasonable). Whether or not these measures should be - used is left to the reader. -

---# vim: et sw=4 sts=4 +Filter.ExtractStyleBlocks +TYPE: bool +VERSION: 3.1.0 +DEFAULT: false +EXTERNAL: CSSTidy +--DESCRIPTION-- +

+ This directive turns on the style block extraction filter, which removes + style blocks from input HTML, cleans them up with CSSTidy, + and places them in the StyleBlocks context variable, for further + use by you, usually to be placed in an external stylesheet, or a + style block in the head of your document. +

+

+ Sample usage: +

+
';
+?>
+
+
+
+  Filter.ExtractStyleBlocks
+body {color:#F00;} Some text';
+
+    $config = HTMLPurifier_Config::createDefault();
+    $config->set('Filter', 'ExtractStyleBlocks', true);
+    $purifier = new HTMLPurifier($config);
+
+    $html = $purifier->purify($dirty);
+
+    // This implementation writes the stylesheets to the styles/ directory.
+    // You can also echo the styles inside the document, but it's a bit
+    // more difficult to make sure they get interpreted properly by
+    // browsers; try the usual CSS armoring techniques.
+    $styles = $purifier->context->get('StyleBlocks');
+    $dir = 'styles/';
+    if (!is_dir($dir)) mkdir($dir);
+    $hash = sha1($_GET['html']);
+    foreach ($styles as $i => $style) {
+        file_put_contents($name = $dir . $hash . "_$i");
+        echo '';
+    }
+?>
+
+
+  
+ +
+ + +]]>
+

+ Warning: It is possible for a user to mount an + imagecrash attack using this CSS. Counter-measures are difficult; + it is not simply enough to limit the range of CSS lengths (using + relative lengths with many nesting levels allows for large values + to be attained without actually specifying them in the stylesheet), + and the flexible nature of selectors makes it difficult to selectively + disable lengths on image tags (HTML Purifier, however, does disable + CSS width and height in inline styling). There are probably two effective + counter measures: an explicit width and height set to auto in all + images in your document (unlikely) or the disabling of width and + height (somewhat reasonable). Whether or not these measures should be + used is left to the reader. +

+--# vim: et sw=4 sts=4 diff --git a/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/Filter.YouTube.txt b/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/ConfigSchema/schema/Filter.YouTube.txt similarity index 96% rename from plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/Filter.YouTube.txt rename to plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/ConfigSchema/schema/Filter.YouTube.txt index 8822186..321eaa2 100755 --- a/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/Filter.YouTube.txt +++ b/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/ConfigSchema/schema/Filter.YouTube.txt @@ -1,16 +1,16 @@ -Filter.YouTube -TYPE: bool -VERSION: 3.1.0 -DEFAULT: false ---DESCRIPTION-- -

- Warning: Deprecated in favor of %HTML.SafeObject and - %Output.FlashCompat (turn both on to allow YouTube videos and other - Flash content). -

-

- This directive enables YouTube video embedding in HTML Purifier. Check - this document - on embedding videos for more information on what this filter does. -

---# vim: et sw=4 sts=4 +Filter.YouTube +TYPE: bool +VERSION: 3.1.0 +DEFAULT: false +--DESCRIPTION-- +

+ Warning: Deprecated in favor of %HTML.SafeObject and + %Output.FlashCompat (turn both on to allow YouTube videos and other + Flash content). +

+

+ This directive enables YouTube video embedding in HTML Purifier. Check + this document + on embedding videos for more information on what this filter does. +

+--# vim: et sw=4 sts=4 diff --git a/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/HTML.Allowed.txt b/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/ConfigSchema/schema/HTML.Allowed.txt similarity index 97% rename from plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/HTML.Allowed.txt rename to plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/ConfigSchema/schema/HTML.Allowed.txt index afd48a0..0b2c106 100755 --- a/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/HTML.Allowed.txt +++ b/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/ConfigSchema/schema/HTML.Allowed.txt @@ -1,25 +1,25 @@ -HTML.Allowed -TYPE: itext/null -VERSION: 2.0.0 -DEFAULT: NULL ---DESCRIPTION-- - -

- This is a preferred convenience directive that combines - %HTML.AllowedElements and %HTML.AllowedAttributes. - Specify elements and attributes that are allowed using: - element1[attr1|attr2],element2.... For example, - if you would like to only allow paragraphs and links, specify - a[href],p. You can specify attributes that apply - to all elements using an asterisk, e.g. *[lang]. - You can also use newlines instead of commas to separate elements. -

-

- Warning: - All of the constraints on the component directives are still enforced. - The syntax is a subset of TinyMCE's valid_elements - whitelist: directly copy-pasting it here will probably result in - broken whitelists. If %HTML.AllowedElements or %HTML.AllowedAttributes - are set, this directive has no effect. -

---# vim: et sw=4 sts=4 +HTML.Allowed +TYPE: itext/null +VERSION: 2.0.0 +DEFAULT: NULL +--DESCRIPTION-- + +

+ This is a preferred convenience directive that combines + %HTML.AllowedElements and %HTML.AllowedAttributes. + Specify elements and attributes that are allowed using: + element1[attr1|attr2],element2.... For example, + if you would like to only allow paragraphs and links, specify + a[href],p. You can specify attributes that apply + to all elements using an asterisk, e.g. *[lang]. + You can also use newlines instead of commas to separate elements. +

+

+ Warning: + All of the constraints on the component directives are still enforced. + The syntax is a subset of TinyMCE's valid_elements + whitelist: directly copy-pasting it here will probably result in + broken whitelists. If %HTML.AllowedElements or %HTML.AllowedAttributes + are set, this directive has no effect. +

+--# vim: et sw=4 sts=4 diff --git a/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/HTML.AllowedAttributes.txt b/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/ConfigSchema/schema/HTML.AllowedAttributes.txt similarity index 96% rename from plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/HTML.AllowedAttributes.txt rename to plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/ConfigSchema/schema/HTML.AllowedAttributes.txt index 0e6ec54..fcf093f 100755 --- a/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/HTML.AllowedAttributes.txt +++ b/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/ConfigSchema/schema/HTML.AllowedAttributes.txt @@ -1,19 +1,19 @@ -HTML.AllowedAttributes -TYPE: lookup/null -VERSION: 1.3.0 -DEFAULT: NULL ---DESCRIPTION-- - -

- If HTML Purifier's attribute set is unsatisfactory, overload it! - The syntax is "tag.attr" or "*.attr" for the global attributes - (style, id, class, dir, lang, xml:lang). -

-

- Warning: If another directive conflicts with the - elements here, that directive will win and override. For - example, %HTML.EnableAttrID will take precedence over *.id in this - directive. You must set that directive to true before you can use - IDs at all. -

---# vim: et sw=4 sts=4 +HTML.AllowedAttributes +TYPE: lookup/null +VERSION: 1.3.0 +DEFAULT: NULL +--DESCRIPTION-- + +

+ If HTML Purifier's attribute set is unsatisfactory, overload it! + The syntax is "tag.attr" or "*.attr" for the global attributes + (style, id, class, dir, lang, xml:lang). +

+

+ Warning: If another directive conflicts with the + elements here, that directive will win and override. For + example, %HTML.EnableAttrID will take precedence over *.id in this + directive. You must set that directive to true before you can use + IDs at all. +

+--# vim: et sw=4 sts=4 diff --git a/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/HTML.AllowedComments.txt b/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/ConfigSchema/schema/HTML.AllowedComments.txt similarity index 97% rename from plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/HTML.AllowedComments.txt rename to plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/ConfigSchema/schema/HTML.AllowedComments.txt index 8440bc3..140e214 100755 --- a/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/HTML.AllowedComments.txt +++ b/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/ConfigSchema/schema/HTML.AllowedComments.txt @@ -1,10 +1,10 @@ -HTML.AllowedComments -TYPE: lookup -VERSION: 4.4.0 -DEFAULT: array() ---DESCRIPTION-- -A whitelist which indicates what explicit comment bodies should be -allowed, modulo leading and trailing whitespace. See also %HTML.AllowedCommentsRegexp -(these directives are union'ed together, so a comment is considered -valid if any directive deems it valid.) ---# vim: et sw=4 sts=4 +HTML.AllowedComments +TYPE: lookup +VERSION: 4.4.0 +DEFAULT: array() +--DESCRIPTION-- +A whitelist which indicates what explicit comment bodies should be +allowed, modulo leading and trailing whitespace. See also %HTML.AllowedCommentsRegexp +(these directives are union'ed together, so a comment is considered +valid if any directive deems it valid.) +--# vim: et sw=4 sts=4 diff --git a/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/HTML.AllowedCommentsRegexp.txt b/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/ConfigSchema/schema/HTML.AllowedCommentsRegexp.txt similarity index 97% rename from plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/HTML.AllowedCommentsRegexp.txt rename to plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/ConfigSchema/schema/HTML.AllowedCommentsRegexp.txt index b1e65be..f22e977 100755 --- a/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/HTML.AllowedCommentsRegexp.txt +++ b/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/ConfigSchema/schema/HTML.AllowedCommentsRegexp.txt @@ -1,15 +1,15 @@ -HTML.AllowedCommentsRegexp -TYPE: string/null -VERSION: 4.4.0 -DEFAULT: NULL ---DESCRIPTION-- -A regexp, which if it matches the body of a comment, indicates that -it should be allowed. Trailing and leading spaces are removed prior -to running this regular expression. -Warning: Make sure you specify -correct anchor metacharacters ^regex$, otherwise you may accept -comments that you did not mean to! In particular, the regex /foo|bar/ -is probably not sufficiently strict, since it also allows foobar. -See also %HTML.AllowedComments (these directives are union'ed together, -so a comment is considered valid if any directive deems it valid.) ---# vim: et sw=4 sts=4 +HTML.AllowedCommentsRegexp +TYPE: string/null +VERSION: 4.4.0 +DEFAULT: NULL +--DESCRIPTION-- +A regexp, which if it matches the body of a comment, indicates that +it should be allowed. Trailing and leading spaces are removed prior +to running this regular expression. +Warning: Make sure you specify +correct anchor metacharacters ^regex$, otherwise you may accept +comments that you did not mean to! In particular, the regex /foo|bar/ +is probably not sufficiently strict, since it also allows foobar. +See also %HTML.AllowedComments (these directives are union'ed together, +so a comment is considered valid if any directive deems it valid.) +--# vim: et sw=4 sts=4 diff --git a/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/HTML.AllowedElements.txt b/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/ConfigSchema/schema/HTML.AllowedElements.txt similarity index 97% rename from plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/HTML.AllowedElements.txt rename to plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/ConfigSchema/schema/HTML.AllowedElements.txt index ca3c13d..1d3fa79 100755 --- a/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/HTML.AllowedElements.txt +++ b/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/ConfigSchema/schema/HTML.AllowedElements.txt @@ -1,23 +1,23 @@ -HTML.AllowedElements -TYPE: lookup/null -VERSION: 1.3.0 -DEFAULT: NULL ---DESCRIPTION-- -

- If HTML Purifier's tag set is unsatisfactory for your needs, you can - overload it with your own list of tags to allow. If you change - this, you probably also want to change %HTML.AllowedAttributes; see - also %HTML.Allowed which lets you set allowed elements and - attributes at the same time. -

-

- If you attempt to allow an element that HTML Purifier does not know - about, HTML Purifier will raise an error. You will need to manually - tell HTML Purifier about this element by using the - advanced customization features. -

-

- Warning: If another directive conflicts with the - elements here, that directive will win and override. -

---# vim: et sw=4 sts=4 +HTML.AllowedElements +TYPE: lookup/null +VERSION: 1.3.0 +DEFAULT: NULL +--DESCRIPTION-- +

+ If HTML Purifier's tag set is unsatisfactory for your needs, you can + overload it with your own list of tags to allow. If you change + this, you probably also want to change %HTML.AllowedAttributes; see + also %HTML.Allowed which lets you set allowed elements and + attributes at the same time. +

+

+ If you attempt to allow an element that HTML Purifier does not know + about, HTML Purifier will raise an error. You will need to manually + tell HTML Purifier about this element by using the + advanced customization features. +

+

+ Warning: If another directive conflicts with the + elements here, that directive will win and override. +

+--# vim: et sw=4 sts=4 diff --git a/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/HTML.AllowedModules.txt b/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/ConfigSchema/schema/HTML.AllowedModules.txt similarity index 97% rename from plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/HTML.AllowedModules.txt rename to plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/ConfigSchema/schema/HTML.AllowedModules.txt index e373791..5a59a55 100755 --- a/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/HTML.AllowedModules.txt +++ b/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/ConfigSchema/schema/HTML.AllowedModules.txt @@ -1,20 +1,20 @@ -HTML.AllowedModules -TYPE: lookup/null -VERSION: 2.0.0 -DEFAULT: NULL ---DESCRIPTION-- - -

- A doctype comes with a set of usual modules to use. Without having - to mucking about with the doctypes, you can quickly activate or - disable these modules by specifying which modules you wish to allow - with this directive. This is most useful for unit testing specific - modules, although end users may find it useful for their own ends. -

-

- If you specify a module that does not exist, the manager will silently - fail to use it, so be careful! User-defined modules are not affected - by this directive. Modules defined in %HTML.CoreModules are not - affected by this directive. -

---# vim: et sw=4 sts=4 +HTML.AllowedModules +TYPE: lookup/null +VERSION: 2.0.0 +DEFAULT: NULL +--DESCRIPTION-- + +

+ A doctype comes with a set of usual modules to use. Without having + to mucking about with the doctypes, you can quickly activate or + disable these modules by specifying which modules you wish to allow + with this directive. This is most useful for unit testing specific + modules, although end users may find it useful for their own ends. +

+

+ If you specify a module that does not exist, the manager will silently + fail to use it, so be careful! User-defined modules are not affected + by this directive. Modules defined in %HTML.CoreModules are not + affected by this directive. +

+--# vim: et sw=4 sts=4 diff --git a/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/HTML.Attr.Name.UseCDATA.txt b/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/ConfigSchema/schema/HTML.Attr.Name.UseCDATA.txt similarity index 97% rename from plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/HTML.Attr.Name.UseCDATA.txt rename to plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/ConfigSchema/schema/HTML.Attr.Name.UseCDATA.txt index 75d680e..151fb7b 100755 --- a/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/HTML.Attr.Name.UseCDATA.txt +++ b/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/ConfigSchema/schema/HTML.Attr.Name.UseCDATA.txt @@ -1,11 +1,11 @@ -HTML.Attr.Name.UseCDATA -TYPE: bool -DEFAULT: false -VERSION: 4.0.0 ---DESCRIPTION-- -The W3C specification DTD defines the name attribute to be CDATA, not ID, due -to limitations of DTD. In certain documents, this relaxed behavior is desired, -whether it is to specify duplicate names, or to specify names that would be -illegal IDs (for example, names that begin with a digit.) Set this configuration -directive to true to use the relaxed parsing rules. ---# vim: et sw=4 sts=4 +HTML.Attr.Name.UseCDATA +TYPE: bool +DEFAULT: false +VERSION: 4.0.0 +--DESCRIPTION-- +The W3C specification DTD defines the name attribute to be CDATA, not ID, due +to limitations of DTD. In certain documents, this relaxed behavior is desired, +whether it is to specify duplicate names, or to specify names that would be +illegal IDs (for example, names that begin with a digit.) Set this configuration +directive to true to use the relaxed parsing rules. +--# vim: et sw=4 sts=4 diff --git a/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/HTML.BlockWrapper.txt b/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/ConfigSchema/schema/HTML.BlockWrapper.txt similarity index 96% rename from plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/HTML.BlockWrapper.txt rename to plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/ConfigSchema/schema/HTML.BlockWrapper.txt index f32b802..45ae469 100755 --- a/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/HTML.BlockWrapper.txt +++ b/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/ConfigSchema/schema/HTML.BlockWrapper.txt @@ -1,18 +1,18 @@ -HTML.BlockWrapper -TYPE: string -VERSION: 1.3.0 -DEFAULT: 'p' ---DESCRIPTION-- - -

- String name of element to wrap inline elements that are inside a block - context. This only occurs in the children of blockquote in strict mode. -

-

- Example: by default value, - <blockquote>Foo</blockquote> would become - <blockquote><p>Foo</p></blockquote>. - The <p> tags can be replaced with whatever you desire, - as long as it is a block level element. -

---# vim: et sw=4 sts=4 +HTML.BlockWrapper +TYPE: string +VERSION: 1.3.0 +DEFAULT: 'p' +--DESCRIPTION-- + +

+ String name of element to wrap inline elements that are inside a block + context. This only occurs in the children of blockquote in strict mode. +

+

+ Example: by default value, + <blockquote>Foo</blockquote> would become + <blockquote><p>Foo</p></blockquote>. + The <p> tags can be replaced with whatever you desire, + as long as it is a block level element. +

+--# vim: et sw=4 sts=4 diff --git a/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/HTML.CoreModules.txt b/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/ConfigSchema/schema/HTML.CoreModules.txt similarity index 96% rename from plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/HTML.CoreModules.txt rename to plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/ConfigSchema/schema/HTML.CoreModules.txt index fc8e402..5246188 100755 --- a/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/HTML.CoreModules.txt +++ b/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/ConfigSchema/schema/HTML.CoreModules.txt @@ -1,23 +1,23 @@ -HTML.CoreModules -TYPE: lookup -VERSION: 2.0.0 ---DEFAULT-- -array ( - 'Structure' => true, - 'Text' => true, - 'Hypertext' => true, - 'List' => true, - 'NonXMLCommonAttributes' => true, - 'XMLCommonAttributes' => true, - 'CommonAttributes' => true, -) ---DESCRIPTION-- - -

- Certain modularized doctypes (XHTML, namely), have certain modules - that must be included for the doctype to be an conforming document - type: put those modules here. By default, XHTML's core modules - are used. You can set this to a blank array to disable core module - protection, but this is not recommended. -

---# vim: et sw=4 sts=4 +HTML.CoreModules +TYPE: lookup +VERSION: 2.0.0 +--DEFAULT-- +array ( + 'Structure' => true, + 'Text' => true, + 'Hypertext' => true, + 'List' => true, + 'NonXMLCommonAttributes' => true, + 'XMLCommonAttributes' => true, + 'CommonAttributes' => true, +) +--DESCRIPTION-- + +

+ Certain modularized doctypes (XHTML, namely), have certain modules + that must be included for the doctype to be an conforming document + type: put those modules here. By default, XHTML's core modules + are used. You can set this to a blank array to disable core module + protection, but this is not recommended. +

+--# vim: et sw=4 sts=4 diff --git a/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/HTML.CustomDoctype.txt b/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/ConfigSchema/schema/HTML.CustomDoctype.txt similarity index 69% rename from plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/HTML.CustomDoctype.txt rename to plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/ConfigSchema/schema/HTML.CustomDoctype.txt index a2bde5d..6ed70b5 100755 --- a/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/HTML.CustomDoctype.txt +++ b/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/ConfigSchema/schema/HTML.CustomDoctype.txt @@ -1,9 +1,9 @@ -HTML.CustomDoctype -TYPE: string/null -VERSION: 2.0.1 -DEFAULT: NULL ---DESCRIPTION-- - -A custom doctype for power-users who defined there own document -type. This directive only applies when %HTML.Doctype is blank. ---# vim: et sw=4 sts=4 +HTML.CustomDoctype +TYPE: string/null +VERSION: 2.0.1 +DEFAULT: NULL +--DESCRIPTION-- + +A custom doctype for power-users who defined their own document +type. This directive only applies when %HTML.Doctype is blank. +--# vim: et sw=4 sts=4 diff --git a/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/HTML.DefinitionID.txt b/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/ConfigSchema/schema/HTML.DefinitionID.txt similarity index 97% rename from plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/HTML.DefinitionID.txt rename to plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/ConfigSchema/schema/HTML.DefinitionID.txt index f5433e3..103db75 100755 --- a/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/HTML.DefinitionID.txt +++ b/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/ConfigSchema/schema/HTML.DefinitionID.txt @@ -1,33 +1,33 @@ -HTML.DefinitionID -TYPE: string/null -DEFAULT: NULL -VERSION: 2.0.0 ---DESCRIPTION-- - -

- Unique identifier for a custom-built HTML definition. If you edit - the raw version of the HTMLDefinition, introducing changes that the - configuration object does not reflect, you must specify this variable. - If you change your custom edits, you should change this directive, or - clear your cache. Example: -

-
-$config = HTMLPurifier_Config::createDefault();
-$config->set('HTML', 'DefinitionID', '1');
-$def = $config->getHTMLDefinition();
-$def->addAttribute('a', 'tabindex', 'Number');
-
-

- In the above example, the configuration is still at the defaults, but - using the advanced API, an extra attribute has been added. The - configuration object normally has no way of knowing that this change - has taken place, so it needs an extra directive: %HTML.DefinitionID. - If someone else attempts to use the default configuration, these two - pieces of code will not clobber each other in the cache, since one has - an extra directive attached to it. -

-

- You must specify a value to this directive to use the - advanced API features. -

---# vim: et sw=4 sts=4 +HTML.DefinitionID +TYPE: string/null +DEFAULT: NULL +VERSION: 2.0.0 +--DESCRIPTION-- + +

+ Unique identifier for a custom-built HTML definition. If you edit + the raw version of the HTMLDefinition, introducing changes that the + configuration object does not reflect, you must specify this variable. + If you change your custom edits, you should change this directive, or + clear your cache. Example: +

+
+$config = HTMLPurifier_Config::createDefault();
+$config->set('HTML', 'DefinitionID', '1');
+$def = $config->getHTMLDefinition();
+$def->addAttribute('a', 'tabindex', 'Number');
+
+

+ In the above example, the configuration is still at the defaults, but + using the advanced API, an extra attribute has been added. The + configuration object normally has no way of knowing that this change + has taken place, so it needs an extra directive: %HTML.DefinitionID. + If someone else attempts to use the default configuration, these two + pieces of code will not clobber each other in the cache, since one has + an extra directive attached to it. +

+

+ You must specify a value to this directive to use the + advanced API features. +

+--# vim: et sw=4 sts=4 diff --git a/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/HTML.DefinitionRev.txt b/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/ConfigSchema/schema/HTML.DefinitionRev.txt similarity index 97% rename from plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/HTML.DefinitionRev.txt rename to plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/ConfigSchema/schema/HTML.DefinitionRev.txt index 0bb5a71..229ae02 100755 --- a/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/HTML.DefinitionRev.txt +++ b/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/ConfigSchema/schema/HTML.DefinitionRev.txt @@ -1,16 +1,16 @@ -HTML.DefinitionRev -TYPE: int -VERSION: 2.0.0 -DEFAULT: 1 ---DESCRIPTION-- - -

- Revision identifier for your custom definition specified in - %HTML.DefinitionID. This serves the same purpose: uniquely identifying - your custom definition, but this one does so in a chronological - context: revision 3 is more up-to-date then revision 2. Thus, when - this gets incremented, the cache handling is smart enough to clean - up any older revisions of your definition as well as flush the - cache. -

---# vim: et sw=4 sts=4 +HTML.DefinitionRev +TYPE: int +VERSION: 2.0.0 +DEFAULT: 1 +--DESCRIPTION-- + +

+ Revision identifier for your custom definition specified in + %HTML.DefinitionID. This serves the same purpose: uniquely identifying + your custom definition, but this one does so in a chronological + context: revision 3 is more up-to-date then revision 2. Thus, when + this gets incremented, the cache handling is smart enough to clean + up any older revisions of your definition as well as flush the + cache. +

+--# vim: et sw=4 sts=4 diff --git a/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/HTML.Doctype.txt b/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/ConfigSchema/schema/HTML.Doctype.txt similarity index 97% rename from plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/HTML.Doctype.txt rename to plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/ConfigSchema/schema/HTML.Doctype.txt index a6969b9..9dab497 100755 --- a/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/HTML.Doctype.txt +++ b/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/ConfigSchema/schema/HTML.Doctype.txt @@ -1,11 +1,11 @@ -HTML.Doctype -TYPE: string/null -DEFAULT: NULL ---DESCRIPTION-- -Doctype to use during filtering. Technically speaking this is not actually -a doctype (as it does not identify a corresponding DTD), but we are using -this name for sake of simplicity. When non-blank, this will override any -older directives like %HTML.XHTML or %HTML.Strict. ---ALLOWED-- -'HTML 4.01 Transitional', 'HTML 4.01 Strict', 'XHTML 1.0 Transitional', 'XHTML 1.0 Strict', 'XHTML 1.1' ---# vim: et sw=4 sts=4 +HTML.Doctype +TYPE: string/null +DEFAULT: NULL +--DESCRIPTION-- +Doctype to use during filtering. Technically speaking this is not actually +a doctype (as it does not identify a corresponding DTD), but we are using +this name for sake of simplicity. When non-blank, this will override any +older directives like %HTML.XHTML or %HTML.Strict. +--ALLOWED-- +'HTML 4.01 Transitional', 'HTML 4.01 Strict', 'XHTML 1.0 Transitional', 'XHTML 1.0 Strict', 'XHTML 1.1' +--# vim: et sw=4 sts=4 diff --git a/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/HTML.FlashAllowFullScreen.txt b/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/ConfigSchema/schema/HTML.FlashAllowFullScreen.txt similarity index 96% rename from plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/HTML.FlashAllowFullScreen.txt rename to plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/ConfigSchema/schema/HTML.FlashAllowFullScreen.txt index 08d641f..7878dc0 100755 --- a/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/HTML.FlashAllowFullScreen.txt +++ b/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/ConfigSchema/schema/HTML.FlashAllowFullScreen.txt @@ -1,11 +1,11 @@ -HTML.FlashAllowFullScreen -TYPE: bool -VERSION: 4.2.0 -DEFAULT: false ---DESCRIPTION-- -

- Whether or not to permit embedded Flash content from - %HTML.SafeObject to expand to the full screen. Corresponds to - the allowFullScreen parameter. -

---# vim: et sw=4 sts=4 +HTML.FlashAllowFullScreen +TYPE: bool +VERSION: 4.2.0 +DEFAULT: false +--DESCRIPTION-- +

+ Whether or not to permit embedded Flash content from + %HTML.SafeObject to expand to the full screen. Corresponds to + the allowFullScreen parameter. +

+--# vim: et sw=4 sts=4 diff --git a/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/HTML.ForbiddenAttributes.txt b/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/ConfigSchema/schema/HTML.ForbiddenAttributes.txt similarity index 97% rename from plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/HTML.ForbiddenAttributes.txt rename to plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/ConfigSchema/schema/HTML.ForbiddenAttributes.txt index 2b8df97..57358f9 100755 --- a/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/HTML.ForbiddenAttributes.txt +++ b/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/ConfigSchema/schema/HTML.ForbiddenAttributes.txt @@ -1,21 +1,21 @@ -HTML.ForbiddenAttributes -TYPE: lookup -VERSION: 3.1.0 -DEFAULT: array() ---DESCRIPTION-- -

- While this directive is similar to %HTML.AllowedAttributes, for - forwards-compatibility with XML, this attribute has a different syntax. Instead of - tag.attr, use tag@attr. To disallow href - attributes in a tags, set this directive to - a@href. You can also disallow an attribute globally with - attr or *@attr (either syntax is fine; the latter - is provided for consistency with %HTML.AllowedAttributes). -

-

- Warning: This directive complements %HTML.ForbiddenElements, - accordingly, check - out that directive for a discussion of why you - should think twice before using this directive. -

---# vim: et sw=4 sts=4 +HTML.ForbiddenAttributes +TYPE: lookup +VERSION: 3.1.0 +DEFAULT: array() +--DESCRIPTION-- +

+ While this directive is similar to %HTML.AllowedAttributes, for + forwards-compatibility with XML, this attribute has a different syntax. Instead of + tag.attr, use tag@attr. To disallow href + attributes in a tags, set this directive to + a@href. You can also disallow an attribute globally with + attr or *@attr (either syntax is fine; the latter + is provided for consistency with %HTML.AllowedAttributes). +

+

+ Warning: This directive complements %HTML.ForbiddenElements, + accordingly, check + out that directive for a discussion of why you + should think twice before using this directive. +

+--# vim: et sw=4 sts=4 diff --git a/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/HTML.ForbiddenElements.txt b/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/ConfigSchema/schema/HTML.ForbiddenElements.txt similarity index 97% rename from plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/HTML.ForbiddenElements.txt rename to plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/ConfigSchema/schema/HTML.ForbiddenElements.txt index 40466c4..93a53e1 100755 --- a/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/HTML.ForbiddenElements.txt +++ b/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/ConfigSchema/schema/HTML.ForbiddenElements.txt @@ -1,20 +1,20 @@ -HTML.ForbiddenElements -TYPE: lookup -VERSION: 3.1.0 -DEFAULT: array() ---DESCRIPTION-- -

- This was, perhaps, the most requested feature ever in HTML - Purifier. Please don't abuse it! This is the logical inverse of - %HTML.AllowedElements, and it will override that directive, or any - other directive. -

-

- If possible, %HTML.Allowed is recommended over this directive, because it - can sometimes be difficult to tell whether or not you've forbidden all of - the behavior you would like to disallow. If you forbid img - with the expectation of preventing images on your site, you'll be in for - a nasty surprise when people start using the background-image - CSS property. -

---# vim: et sw=4 sts=4 +HTML.ForbiddenElements +TYPE: lookup +VERSION: 3.1.0 +DEFAULT: array() +--DESCRIPTION-- +

+ This was, perhaps, the most requested feature ever in HTML + Purifier. Please don't abuse it! This is the logical inverse of + %HTML.AllowedElements, and it will override that directive, or any + other directive. +

+

+ If possible, %HTML.Allowed is recommended over this directive, because it + can sometimes be difficult to tell whether or not you've forbidden all of + the behavior you would like to disallow. If you forbid img + with the expectation of preventing images on your site, you'll be in for + a nasty surprise when people start using the background-image + CSS property. +

+--# vim: et sw=4 sts=4 diff --git a/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/HTML.MaxImgLength.txt b/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/ConfigSchema/schema/HTML.MaxImgLength.txt similarity index 97% rename from plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/HTML.MaxImgLength.txt rename to plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/ConfigSchema/schema/HTML.MaxImgLength.txt index 3197479..e424c38 100755 --- a/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/HTML.MaxImgLength.txt +++ b/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/ConfigSchema/schema/HTML.MaxImgLength.txt @@ -1,14 +1,14 @@ -HTML.MaxImgLength -TYPE: int/null -DEFAULT: 1200 -VERSION: 3.1.1 ---DESCRIPTION-- -

- This directive controls the maximum number of pixels in the width and - height attributes in img tags. This is - in place to prevent imagecrash attacks, disable with null at your own risk. - This directive is similar to %CSS.MaxImgLength, and both should be - concurrently edited, although there are - subtle differences in the input format (the HTML max is an integer). -

---# vim: et sw=4 sts=4 +HTML.MaxImgLength +TYPE: int/null +DEFAULT: 1200 +VERSION: 3.1.1 +--DESCRIPTION-- +

+ This directive controls the maximum number of pixels in the width and + height attributes in img tags. This is + in place to prevent imagecrash attacks, disable with null at your own risk. + This directive is similar to %CSS.MaxImgLength, and both should be + concurrently edited, although there are + subtle differences in the input format (the HTML max is an integer). +

+--# vim: et sw=4 sts=4 diff --git a/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/HTML.Nofollow.txt b/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/ConfigSchema/schema/HTML.Nofollow.txt similarity index 95% rename from plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/HTML.Nofollow.txt rename to plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/ConfigSchema/schema/HTML.Nofollow.txt index 7aa3563..700b309 100755 --- a/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/HTML.Nofollow.txt +++ b/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/ConfigSchema/schema/HTML.Nofollow.txt @@ -1,7 +1,7 @@ -HTML.Nofollow -TYPE: bool -VERSION: 4.3.0 -DEFAULT: FALSE ---DESCRIPTION-- -If enabled, nofollow rel attributes are added to all outgoing links. ---# vim: et sw=4 sts=4 +HTML.Nofollow +TYPE: bool +VERSION: 4.3.0 +DEFAULT: FALSE +--DESCRIPTION-- +If enabled, nofollow rel attributes are added to all outgoing links. +--# vim: et sw=4 sts=4 diff --git a/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/HTML.Parent.txt b/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/ConfigSchema/schema/HTML.Parent.txt similarity index 96% rename from plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/HTML.Parent.txt rename to plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/ConfigSchema/schema/HTML.Parent.txt index 2d2fbd1..62e8e16 100755 --- a/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/HTML.Parent.txt +++ b/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/ConfigSchema/schema/HTML.Parent.txt @@ -1,12 +1,12 @@ -HTML.Parent -TYPE: string -VERSION: 1.3.0 -DEFAULT: 'div' ---DESCRIPTION-- - -

- String name of element that HTML fragment passed to library will be - inserted in. An interesting variation would be using span as the - parent element, meaning that only inline tags would be allowed. -

---# vim: et sw=4 sts=4 +HTML.Parent +TYPE: string +VERSION: 1.3.0 +DEFAULT: 'div' +--DESCRIPTION-- + +

+ String name of element that HTML fragment passed to library will be + inserted in. An interesting variation would be using span as the + parent element, meaning that only inline tags would be allowed. +

+--# vim: et sw=4 sts=4 diff --git a/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/HTML.Proprietary.txt b/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/ConfigSchema/schema/HTML.Proprietary.txt similarity index 96% rename from plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/HTML.Proprietary.txt rename to plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/ConfigSchema/schema/HTML.Proprietary.txt index b3c45e1..dfb7204 100755 --- a/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/HTML.Proprietary.txt +++ b/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/ConfigSchema/schema/HTML.Proprietary.txt @@ -1,12 +1,12 @@ -HTML.Proprietary -TYPE: bool -VERSION: 3.1.0 -DEFAULT: false ---DESCRIPTION-- -

- Whether or not to allow proprietary elements and attributes in your - documents, as per HTMLPurifier_HTMLModule_Proprietary. - Warning: This can cause your documents to stop - validating! -

---# vim: et sw=4 sts=4 +HTML.Proprietary +TYPE: bool +VERSION: 3.1.0 +DEFAULT: false +--DESCRIPTION-- +

+ Whether or not to allow proprietary elements and attributes in your + documents, as per HTMLPurifier_HTMLModule_Proprietary. + Warning: This can cause your documents to stop + validating! +

+--# vim: et sw=4 sts=4 diff --git a/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/HTML.SafeEmbed.txt b/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/ConfigSchema/schema/HTML.SafeEmbed.txt similarity index 97% rename from plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/HTML.SafeEmbed.txt rename to plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/ConfigSchema/schema/HTML.SafeEmbed.txt index 556fa67..cdda09a 100755 --- a/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/HTML.SafeEmbed.txt +++ b/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/ConfigSchema/schema/HTML.SafeEmbed.txt @@ -1,13 +1,13 @@ -HTML.SafeEmbed -TYPE: bool -VERSION: 3.1.1 -DEFAULT: false ---DESCRIPTION-- -

- Whether or not to permit embed tags in documents, with a number of extra - security features added to prevent script execution. This is similar to - what websites like MySpace do to embed tags. Embed is a proprietary - element and will cause your website to stop validating; you should - see if you can use %Output.FlashCompat with %HTML.SafeObject instead - first.

---# vim: et sw=4 sts=4 +HTML.SafeEmbed +TYPE: bool +VERSION: 3.1.1 +DEFAULT: false +--DESCRIPTION-- +

+ Whether or not to permit embed tags in documents, with a number of extra + security features added to prevent script execution. This is similar to + what websites like MySpace do to embed tags. Embed is a proprietary + element and will cause your website to stop validating; you should + see if you can use %Output.FlashCompat with %HTML.SafeObject instead + first.

+--# vim: et sw=4 sts=4 diff --git a/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/HTML.SafeIframe.txt b/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/ConfigSchema/schema/HTML.SafeIframe.txt similarity index 96% rename from plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/HTML.SafeIframe.txt rename to plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/ConfigSchema/schema/HTML.SafeIframe.txt index 295a8cf..5eb6ec2 100755 --- a/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/HTML.SafeIframe.txt +++ b/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/ConfigSchema/schema/HTML.SafeIframe.txt @@ -1,13 +1,13 @@ -HTML.SafeIframe -TYPE: bool -VERSION: 4.4.0 -DEFAULT: false ---DESCRIPTION-- -

- Whether or not to permit iframe tags in untrusted documents. This - directive must be accompanied by a whitelist of permitted iframes, - such as %URI.SafeIframeRegexp, otherwise it will fatally error. - This directive has no effect on strict doctypes, as iframes are not - valid. -

---# vim: et sw=4 sts=4 +HTML.SafeIframe +TYPE: bool +VERSION: 4.4.0 +DEFAULT: false +--DESCRIPTION-- +

+ Whether or not to permit iframe tags in untrusted documents. This + directive must be accompanied by a whitelist of permitted iframes, + such as %URI.SafeIframeRegexp, otherwise it will fatally error. + This directive has no effect on strict doctypes, as iframes are not + valid. +

+--# vim: et sw=4 sts=4 diff --git a/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/HTML.SafeObject.txt b/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/ConfigSchema/schema/HTML.SafeObject.txt similarity index 97% rename from plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/HTML.SafeObject.txt rename to plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/ConfigSchema/schema/HTML.SafeObject.txt index 07f6e53..ceb342e 100755 --- a/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/HTML.SafeObject.txt +++ b/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/ConfigSchema/schema/HTML.SafeObject.txt @@ -1,13 +1,13 @@ -HTML.SafeObject -TYPE: bool -VERSION: 3.1.1 -DEFAULT: false ---DESCRIPTION-- -

- Whether or not to permit object tags in documents, with a number of extra - security features added to prevent script execution. This is similar to - what websites like MySpace do to object tags. You should also enable - %Output.FlashCompat in order to generate Internet Explorer - compatibility code for your object tags. -

---# vim: et sw=4 sts=4 +HTML.SafeObject +TYPE: bool +VERSION: 3.1.1 +DEFAULT: false +--DESCRIPTION-- +

+ Whether or not to permit object tags in documents, with a number of extra + security features added to prevent script execution. This is similar to + what websites like MySpace do to object tags. You should also enable + %Output.FlashCompat in order to generate Internet Explorer + compatibility code for your object tags. +

+--# vim: et sw=4 sts=4 diff --git a/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/HTML.SafeScripting.txt b/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/ConfigSchema/schema/HTML.SafeScripting.txt similarity index 96% rename from plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/HTML.SafeScripting.txt rename to plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/ConfigSchema/schema/HTML.SafeScripting.txt index 641b4a8..5ebc7a1 100755 --- a/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/HTML.SafeScripting.txt +++ b/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/ConfigSchema/schema/HTML.SafeScripting.txt @@ -1,10 +1,10 @@ -HTML.SafeScripting -TYPE: lookup -VERSION: 4.5.0 -DEFAULT: array() ---DESCRIPTION-- -

- Whether or not to permit script tags to external scripts in documents. - Inline scripting is not allowed, and the script must match an explicit whitelist. -

---# vim: et sw=4 sts=4 +HTML.SafeScripting +TYPE: lookup +VERSION: 4.5.0 +DEFAULT: array() +--DESCRIPTION-- +

+ Whether or not to permit script tags to external scripts in documents. + Inline scripting is not allowed, and the script must match an explicit whitelist. +

+--# vim: et sw=4 sts=4 diff --git a/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/HTML.Strict.txt b/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/ConfigSchema/schema/HTML.Strict.txt similarity index 96% rename from plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/HTML.Strict.txt rename to plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/ConfigSchema/schema/HTML.Strict.txt index d99663a..a8b1de5 100755 --- a/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/HTML.Strict.txt +++ b/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/ConfigSchema/schema/HTML.Strict.txt @@ -1,9 +1,9 @@ -HTML.Strict -TYPE: bool -VERSION: 1.3.0 -DEFAULT: false -DEPRECATED-VERSION: 1.7.0 -DEPRECATED-USE: HTML.Doctype ---DESCRIPTION-- -Determines whether or not to use Transitional (loose) or Strict rulesets. ---# vim: et sw=4 sts=4 +HTML.Strict +TYPE: bool +VERSION: 1.3.0 +DEFAULT: false +DEPRECATED-VERSION: 1.7.0 +DEPRECATED-USE: HTML.Doctype +--DESCRIPTION-- +Determines whether or not to use Transitional (loose) or Strict rulesets. +--# vim: et sw=4 sts=4 diff --git a/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/HTML.TargetBlank.txt b/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/ConfigSchema/schema/HTML.TargetBlank.txt similarity index 96% rename from plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/HTML.TargetBlank.txt rename to plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/ConfigSchema/schema/HTML.TargetBlank.txt index d65f0d0..587a167 100755 --- a/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/HTML.TargetBlank.txt +++ b/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/ConfigSchema/schema/HTML.TargetBlank.txt @@ -1,8 +1,8 @@ -HTML.TargetBlank -TYPE: bool -VERSION: 4.4.0 -DEFAULT: FALSE ---DESCRIPTION-- -If enabled, target=blank attributes are added to all outgoing links. -(This includes links from an HTTPS version of a page to an HTTP version.) ---# vim: et sw=4 sts=4 +HTML.TargetBlank +TYPE: bool +VERSION: 4.4.0 +DEFAULT: FALSE +--DESCRIPTION-- +If enabled, target=blank attributes are added to all outgoing links. +(This includes links from an HTTPS version of a page to an HTTP version.) +--# vim: et sw=4 sts=4 diff --git a/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/ConfigSchema/schema/HTML.TargetNoreferrer.txt b/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/ConfigSchema/schema/HTML.TargetNoreferrer.txt new file mode 100755 index 0000000..cb5a0b0 --- /dev/null +++ b/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/ConfigSchema/schema/HTML.TargetNoreferrer.txt @@ -0,0 +1,9 @@ +HTML.TargetNoreferrer +TYPE: bool +VERSION: 4.8.0 +DEFAULT: TRUE +--DESCRIPTION-- +If enabled, noreferrer rel attributes are added to links which have +a target attribute associated with them. This prevents malicious +destinations from overwriting the original window. +--# vim: et sw=4 sts=4 diff --git a/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/HTML.TidyAdd.txt b/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/ConfigSchema/schema/HTML.TidyAdd.txt similarity index 95% rename from plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/HTML.TidyAdd.txt rename to plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/ConfigSchema/schema/HTML.TidyAdd.txt index 602453f..b4c271b 100755 --- a/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/HTML.TidyAdd.txt +++ b/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/ConfigSchema/schema/HTML.TidyAdd.txt @@ -1,8 +1,8 @@ -HTML.TidyAdd -TYPE: lookup -VERSION: 2.0.0 -DEFAULT: array() ---DESCRIPTION-- - -Fixes to add to the default set of Tidy fixes as per your level. ---# vim: et sw=4 sts=4 +HTML.TidyAdd +TYPE: lookup +VERSION: 2.0.0 +DEFAULT: array() +--DESCRIPTION-- + +Fixes to add to the default set of Tidy fixes as per your level. +--# vim: et sw=4 sts=4 diff --git a/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/HTML.TidyLevel.txt b/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/ConfigSchema/schema/HTML.TidyLevel.txt similarity index 96% rename from plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/HTML.TidyLevel.txt rename to plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/ConfigSchema/schema/HTML.TidyLevel.txt index bf943e8..4186ccd 100755 --- a/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/HTML.TidyLevel.txt +++ b/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/ConfigSchema/schema/HTML.TidyLevel.txt @@ -1,24 +1,24 @@ -HTML.TidyLevel -TYPE: string -VERSION: 2.0.0 -DEFAULT: 'medium' ---DESCRIPTION-- - -

General level of cleanliness the Tidy module should enforce. -There are four allowed values:

-
-
none
-
No extra tidying should be done
-
light
-
Only fix elements that would be discarded otherwise due to - lack of support in doctype
-
medium
-
Enforce best practices
-
heavy
-
Transform all deprecated elements and attributes to standards - compliant equivalents
-
- ---ALLOWED-- -'none', 'light', 'medium', 'heavy' ---# vim: et sw=4 sts=4 +HTML.TidyLevel +TYPE: string +VERSION: 2.0.0 +DEFAULT: 'medium' +--DESCRIPTION-- + +

General level of cleanliness the Tidy module should enforce. +There are four allowed values:

+
+
none
+
No extra tidying should be done
+
light
+
Only fix elements that would be discarded otherwise due to + lack of support in doctype
+
medium
+
Enforce best practices
+
heavy
+
Transform all deprecated elements and attributes to standards + compliant equivalents
+
+ +--ALLOWED-- +'none', 'light', 'medium', 'heavy' +--# vim: et sw=4 sts=4 diff --git a/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/HTML.TidyRemove.txt b/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/ConfigSchema/schema/HTML.TidyRemove.txt similarity index 95% rename from plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/HTML.TidyRemove.txt rename to plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/ConfigSchema/schema/HTML.TidyRemove.txt index 92cca2a..996762b 100755 --- a/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/HTML.TidyRemove.txt +++ b/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/ConfigSchema/schema/HTML.TidyRemove.txt @@ -1,8 +1,8 @@ -HTML.TidyRemove -TYPE: lookup -VERSION: 2.0.0 -DEFAULT: array() ---DESCRIPTION-- - -Fixes to remove from the default set of Tidy fixes as per your level. ---# vim: et sw=4 sts=4 +HTML.TidyRemove +TYPE: lookup +VERSION: 2.0.0 +DEFAULT: array() +--DESCRIPTION-- + +Fixes to remove from the default set of Tidy fixes as per your level. +--# vim: et sw=4 sts=4 diff --git a/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/HTML.Trusted.txt b/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/ConfigSchema/schema/HTML.Trusted.txt similarity index 96% rename from plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/HTML.Trusted.txt rename to plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/ConfigSchema/schema/HTML.Trusted.txt index bc8e654..1db9237 100755 --- a/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/HTML.Trusted.txt +++ b/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/ConfigSchema/schema/HTML.Trusted.txt @@ -1,9 +1,9 @@ -HTML.Trusted -TYPE: bool -VERSION: 2.0.0 -DEFAULT: false ---DESCRIPTION-- -Indicates whether or not the user input is trusted or not. If the input is -trusted, a more expansive set of allowed tags and attributes will be used. -See also %CSS.Trusted. ---# vim: et sw=4 sts=4 +HTML.Trusted +TYPE: bool +VERSION: 2.0.0 +DEFAULT: false +--DESCRIPTION-- +Indicates whether or not the user input is trusted or not. If the input is +trusted, a more expansive set of allowed tags and attributes will be used. +See also %CSS.Trusted. +--# vim: et sw=4 sts=4 diff --git a/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/HTML.XHTML.txt b/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/ConfigSchema/schema/HTML.XHTML.txt similarity index 95% rename from plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/HTML.XHTML.txt rename to plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/ConfigSchema/schema/HTML.XHTML.txt index a3c2f42..2a47e38 100755 --- a/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/HTML.XHTML.txt +++ b/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/ConfigSchema/schema/HTML.XHTML.txt @@ -1,11 +1,11 @@ -HTML.XHTML -TYPE: bool -DEFAULT: true -VERSION: 1.1.0 -DEPRECATED-VERSION: 1.7.0 -DEPRECATED-USE: HTML.Doctype ---DESCRIPTION-- -Determines whether or not output is XHTML 1.0 or HTML 4.01 flavor. ---ALIASES-- -Core.XHTML ---# vim: et sw=4 sts=4 +HTML.XHTML +TYPE: bool +DEFAULT: true +VERSION: 1.1.0 +DEPRECATED-VERSION: 1.7.0 +DEPRECATED-USE: HTML.Doctype +--DESCRIPTION-- +Determines whether or not output is XHTML 1.0 or HTML 4.01 flavor. +--ALIASES-- +Core.XHTML +--# vim: et sw=4 sts=4 diff --git a/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/Output.CommentScriptContents.txt b/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/ConfigSchema/schema/Output.CommentScriptContents.txt similarity index 96% rename from plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/Output.CommentScriptContents.txt rename to plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/ConfigSchema/schema/Output.CommentScriptContents.txt index 2a13704..08921fd 100755 --- a/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/Output.CommentScriptContents.txt +++ b/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/ConfigSchema/schema/Output.CommentScriptContents.txt @@ -1,10 +1,10 @@ -Output.CommentScriptContents -TYPE: bool -VERSION: 2.0.0 -DEFAULT: true ---DESCRIPTION-- -Determines whether or not HTML Purifier should attempt to fix up the -contents of script tags for legacy browsers with comments. ---ALIASES-- -Core.CommentScriptContents ---# vim: et sw=4 sts=4 +Output.CommentScriptContents +TYPE: bool +VERSION: 2.0.0 +DEFAULT: true +--DESCRIPTION-- +Determines whether or not HTML Purifier should attempt to fix up the +contents of script tags for legacy browsers with comments. +--ALIASES-- +Core.CommentScriptContents +--# vim: et sw=4 sts=4 diff --git a/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/Output.FixInnerHTML.txt b/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/ConfigSchema/schema/Output.FixInnerHTML.txt similarity index 97% rename from plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/Output.FixInnerHTML.txt rename to plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/ConfigSchema/schema/Output.FixInnerHTML.txt index d215ba2..d6f0d9f 100755 --- a/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/Output.FixInnerHTML.txt +++ b/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/ConfigSchema/schema/Output.FixInnerHTML.txt @@ -1,15 +1,15 @@ -Output.FixInnerHTML -TYPE: bool -VERSION: 4.3.0 -DEFAULT: true ---DESCRIPTION-- -

- If true, HTML Purifier will protect against Internet Explorer's - mishandling of the innerHTML attribute by appending - a space to any attribute that does not contain angled brackets, spaces - or quotes, but contains a backtick. This slightly changes the - semantics of any given attribute, so if this is unacceptable and - you do not use innerHTML on any of your pages, you can - turn this directive off. -

---# vim: et sw=4 sts=4 +Output.FixInnerHTML +TYPE: bool +VERSION: 4.3.0 +DEFAULT: true +--DESCRIPTION-- +

+ If true, HTML Purifier will protect against Internet Explorer's + mishandling of the innerHTML attribute by appending + a space to any attribute that does not contain angled brackets, spaces + or quotes, but contains a backtick. This slightly changes the + semantics of any given attribute, so if this is unacceptable and + you do not use innerHTML on any of your pages, you can + turn this directive off. +

+--# vim: et sw=4 sts=4 diff --git a/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/Output.FlashCompat.txt b/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/ConfigSchema/schema/Output.FlashCompat.txt similarity index 96% rename from plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/Output.FlashCompat.txt rename to plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/ConfigSchema/schema/Output.FlashCompat.txt index e58f91a..93398e8 100755 --- a/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/Output.FlashCompat.txt +++ b/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/ConfigSchema/schema/Output.FlashCompat.txt @@ -1,11 +1,11 @@ -Output.FlashCompat -TYPE: bool -VERSION: 4.1.0 -DEFAULT: false ---DESCRIPTION-- -

- If true, HTML Purifier will generate Internet Explorer compatibility - code for all object code. This is highly recommended if you enable - %HTML.SafeObject. -

---# vim: et sw=4 sts=4 +Output.FlashCompat +TYPE: bool +VERSION: 4.1.0 +DEFAULT: false +--DESCRIPTION-- +

+ If true, HTML Purifier will generate Internet Explorer compatibility + code for all object code. This is highly recommended if you enable + %HTML.SafeObject. +

+--# vim: et sw=4 sts=4 diff --git a/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/Output.Newline.txt b/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/ConfigSchema/schema/Output.Newline.txt similarity index 96% rename from plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/Output.Newline.txt rename to plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/ConfigSchema/schema/Output.Newline.txt index 4bb9025..79f8ad8 100755 --- a/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/Output.Newline.txt +++ b/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/ConfigSchema/schema/Output.Newline.txt @@ -1,13 +1,13 @@ -Output.Newline -TYPE: string/null -VERSION: 2.0.1 -DEFAULT: NULL ---DESCRIPTION-- - -

- Newline string to format final output with. If left null, HTML Purifier - will auto-detect the default newline type of the system and use that; - you can manually override it here. Remember, \r\n is Windows, \r - is Mac, and \n is Unix. -

---# vim: et sw=4 sts=4 +Output.Newline +TYPE: string/null +VERSION: 2.0.1 +DEFAULT: NULL +--DESCRIPTION-- + +

+ Newline string to format final output with. If left null, HTML Purifier + will auto-detect the default newline type of the system and use that; + you can manually override it here. Remember, \r\n is Windows, \r + is Mac, and \n is Unix. +

+--# vim: et sw=4 sts=4 diff --git a/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/Output.SortAttr.txt b/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/ConfigSchema/schema/Output.SortAttr.txt similarity index 97% rename from plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/Output.SortAttr.txt rename to plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/ConfigSchema/schema/Output.SortAttr.txt index 3223106..232b023 100755 --- a/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/Output.SortAttr.txt +++ b/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/ConfigSchema/schema/Output.SortAttr.txt @@ -1,14 +1,14 @@ -Output.SortAttr -TYPE: bool -VERSION: 3.2.0 -DEFAULT: false ---DESCRIPTION-- -

- If true, HTML Purifier will sort attributes by name before writing them back - to the document, converting a tag like: <el b="" a="" c="" /> - to <el a="" b="" c="" />. This is a workaround for - a bug in FCKeditor which causes it to swap attributes order, adding noise - to text diffs. If you're not seeing this bug, chances are, you don't need - this directive. -

---# vim: et sw=4 sts=4 +Output.SortAttr +TYPE: bool +VERSION: 3.2.0 +DEFAULT: false +--DESCRIPTION-- +

+ If true, HTML Purifier will sort attributes by name before writing them back + to the document, converting a tag like: <el b="" a="" c="" /> + to <el a="" b="" c="" />. This is a workaround for + a bug in FCKeditor which causes it to swap attributes order, adding noise + to text diffs. If you're not seeing this bug, chances are, you don't need + this directive. +

+--# vim: et sw=4 sts=4 diff --git a/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/Output.TidyFormat.txt b/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/ConfigSchema/schema/Output.TidyFormat.txt similarity index 97% rename from plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/Output.TidyFormat.txt rename to plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/ConfigSchema/schema/Output.TidyFormat.txt index 23dd4d3..06bab00 100755 --- a/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/Output.TidyFormat.txt +++ b/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/ConfigSchema/schema/Output.TidyFormat.txt @@ -1,25 +1,25 @@ -Output.TidyFormat -TYPE: bool -VERSION: 1.1.1 -DEFAULT: false ---DESCRIPTION-- -

- Determines whether or not to run Tidy on the final output for pretty - formatting reasons, such as indentation and wrap. -

-

- This can greatly improve readability for editors who are hand-editing - the HTML, but is by no means necessary as HTML Purifier has already - fixed all major errors the HTML may have had. Tidy is a non-default - extension, and this directive will silently fail if Tidy is not - available. -

-

- If you are looking to make the overall look of your page's source - better, I recommend running Tidy on the entire page rather than just - user-content (after all, the indentation relative to the containing - blocks will be incorrect). -

---ALIASES-- -Core.TidyFormat ---# vim: et sw=4 sts=4 +Output.TidyFormat +TYPE: bool +VERSION: 1.1.1 +DEFAULT: false +--DESCRIPTION-- +

+ Determines whether or not to run Tidy on the final output for pretty + formatting reasons, such as indentation and wrap. +

+

+ This can greatly improve readability for editors who are hand-editing + the HTML, but is by no means necessary as HTML Purifier has already + fixed all major errors the HTML may have had. Tidy is a non-default + extension, and this directive will silently fail if Tidy is not + available. +

+

+ If you are looking to make the overall look of your page's source + better, I recommend running Tidy on the entire page rather than just + user-content (after all, the indentation relative to the containing + blocks will be incorrect). +

+--ALIASES-- +Core.TidyFormat +--# vim: et sw=4 sts=4 diff --git a/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/Test.ForceNoIconv.txt b/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/ConfigSchema/schema/Test.ForceNoIconv.txt similarity index 96% rename from plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/Test.ForceNoIconv.txt rename to plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/ConfigSchema/schema/Test.ForceNoIconv.txt index d1820cd..071bc02 100755 --- a/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/Test.ForceNoIconv.txt +++ b/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/ConfigSchema/schema/Test.ForceNoIconv.txt @@ -1,7 +1,7 @@ -Test.ForceNoIconv -TYPE: bool -DEFAULT: false ---DESCRIPTION-- -When set to true, HTMLPurifier_Encoder will act as if iconv does not exist -and use only pure PHP implementations. ---# vim: et sw=4 sts=4 +Test.ForceNoIconv +TYPE: bool +DEFAULT: false +--DESCRIPTION-- +When set to true, HTMLPurifier_Encoder will act as if iconv does not exist +and use only pure PHP implementations. +--# vim: et sw=4 sts=4 diff --git a/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/URI.AllowedSchemes.txt b/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/ConfigSchema/schema/URI.AllowedSchemes.txt similarity index 96% rename from plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/URI.AllowedSchemes.txt rename to plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/ConfigSchema/schema/URI.AllowedSchemes.txt index 47714f5..eb97307 100755 --- a/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/URI.AllowedSchemes.txt +++ b/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/ConfigSchema/schema/URI.AllowedSchemes.txt @@ -1,17 +1,18 @@ -URI.AllowedSchemes -TYPE: lookup ---DEFAULT-- -array ( - 'http' => true, - 'https' => true, - 'mailto' => true, - 'ftp' => true, - 'nntp' => true, - 'news' => true, -) ---DESCRIPTION-- -Whitelist that defines the schemes that a URI is allowed to have. This -prevents XSS attacks from using pseudo-schemes like javascript or mocha. -There is also support for the data and file -URI schemes, but they are not enabled by default. ---# vim: et sw=4 sts=4 +URI.AllowedSchemes +TYPE: lookup +--DEFAULT-- +array ( + 'http' => true, + 'https' => true, + 'mailto' => true, + 'ftp' => true, + 'nntp' => true, + 'news' => true, + 'tel' => true, +) +--DESCRIPTION-- +Whitelist that defines the schemes that a URI is allowed to have. This +prevents XSS attacks from using pseudo-schemes like javascript or mocha. +There is also support for the data and file +URI schemes, but they are not enabled by default. +--# vim: et sw=4 sts=4 diff --git a/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/URI.Base.txt b/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/ConfigSchema/schema/URI.Base.txt similarity index 97% rename from plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/URI.Base.txt rename to plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/ConfigSchema/schema/URI.Base.txt index ba47308..876f068 100755 --- a/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/URI.Base.txt +++ b/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/ConfigSchema/schema/URI.Base.txt @@ -1,17 +1,17 @@ -URI.Base -TYPE: string/null -VERSION: 2.1.0 -DEFAULT: NULL ---DESCRIPTION-- - -

- The base URI is the URI of the document this purified HTML will be - inserted into. This information is important if HTML Purifier needs - to calculate absolute URIs from relative URIs, such as when %URI.MakeAbsolute - is on. You may use a non-absolute URI for this value, but behavior - may vary (%URI.MakeAbsolute deals nicely with both absolute and - relative paths, but forwards-compatibility is not guaranteed). - Warning: If set, the scheme on this URI - overrides the one specified by %URI.DefaultScheme. -

---# vim: et sw=4 sts=4 +URI.Base +TYPE: string/null +VERSION: 2.1.0 +DEFAULT: NULL +--DESCRIPTION-- + +

+ The base URI is the URI of the document this purified HTML will be + inserted into. This information is important if HTML Purifier needs + to calculate absolute URIs from relative URIs, such as when %URI.MakeAbsolute + is on. You may use a non-absolute URI for this value, but behavior + may vary (%URI.MakeAbsolute deals nicely with both absolute and + relative paths, but forwards-compatibility is not guaranteed). + Warning: If set, the scheme on this URI + overrides the one specified by %URI.DefaultScheme. +

+--# vim: et sw=4 sts=4 diff --git a/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/URI.DefaultScheme.txt b/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/ConfigSchema/schema/URI.DefaultScheme.txt similarity index 96% rename from plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/URI.DefaultScheme.txt rename to plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/ConfigSchema/schema/URI.DefaultScheme.txt index 0700e0b..728e378 100755 --- a/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/URI.DefaultScheme.txt +++ b/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/ConfigSchema/schema/URI.DefaultScheme.txt @@ -1,10 +1,10 @@ -URI.DefaultScheme -TYPE: string -DEFAULT: 'http' ---DESCRIPTION-- - -

- Defines through what scheme the output will be served, in order to - select the proper object validator when no scheme information is present. -

---# vim: et sw=4 sts=4 +URI.DefaultScheme +TYPE: string +DEFAULT: 'http' +--DESCRIPTION-- + +

+ Defines through what scheme the output will be served, in order to + select the proper object validator when no scheme information is present. +

+--# vim: et sw=4 sts=4 diff --git a/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/URI.DefinitionID.txt b/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/ConfigSchema/schema/URI.DefinitionID.txt similarity index 95% rename from plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/URI.DefinitionID.txt rename to plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/ConfigSchema/schema/URI.DefinitionID.txt index 523204c..f05312b 100755 --- a/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/URI.DefinitionID.txt +++ b/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/ConfigSchema/schema/URI.DefinitionID.txt @@ -1,11 +1,11 @@ -URI.DefinitionID -TYPE: string/null -VERSION: 2.1.0 -DEFAULT: NULL ---DESCRIPTION-- - -

- Unique identifier for a custom-built URI definition. If you want - to add custom URIFilters, you must specify this value. -

---# vim: et sw=4 sts=4 +URI.DefinitionID +TYPE: string/null +VERSION: 2.1.0 +DEFAULT: NULL +--DESCRIPTION-- + +

+ Unique identifier for a custom-built URI definition. If you want + to add custom URIFilters, you must specify this value. +

+--# vim: et sw=4 sts=4 diff --git a/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/URI.DefinitionRev.txt b/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/ConfigSchema/schema/URI.DefinitionRev.txt similarity index 94% rename from plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/URI.DefinitionRev.txt rename to plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/ConfigSchema/schema/URI.DefinitionRev.txt index a9c07b1..80cfea9 100755 --- a/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/URI.DefinitionRev.txt +++ b/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/ConfigSchema/schema/URI.DefinitionRev.txt @@ -1,11 +1,11 @@ -URI.DefinitionRev -TYPE: int -VERSION: 2.1.0 -DEFAULT: 1 ---DESCRIPTION-- - -

- Revision identifier for your custom definition. See - %HTML.DefinitionRev for details. -

---# vim: et sw=4 sts=4 +URI.DefinitionRev +TYPE: int +VERSION: 2.1.0 +DEFAULT: 1 +--DESCRIPTION-- + +

+ Revision identifier for your custom definition. See + %HTML.DefinitionRev for details. +

+--# vim: et sw=4 sts=4 diff --git a/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/URI.Disable.txt b/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/ConfigSchema/schema/URI.Disable.txt similarity index 95% rename from plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/URI.Disable.txt rename to plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/ConfigSchema/schema/URI.Disable.txt index b19ca1d..71ce025 100755 --- a/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/URI.Disable.txt +++ b/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/ConfigSchema/schema/URI.Disable.txt @@ -1,14 +1,14 @@ -URI.Disable -TYPE: bool -VERSION: 1.3.0 -DEFAULT: false ---DESCRIPTION-- - -

- Disables all URIs in all forms. Not sure why you'd want to do that - (after all, the Internet's founded on the notion of a hyperlink). -

- ---ALIASES-- -Attr.DisableURI ---# vim: et sw=4 sts=4 +URI.Disable +TYPE: bool +VERSION: 1.3.0 +DEFAULT: false +--DESCRIPTION-- + +

+ Disables all URIs in all forms. Not sure why you'd want to do that + (after all, the Internet's founded on the notion of a hyperlink). +

+ +--ALIASES-- +Attr.DisableURI +--# vim: et sw=4 sts=4 diff --git a/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/URI.DisableExternal.txt b/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/ConfigSchema/schema/URI.DisableExternal.txt similarity index 97% rename from plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/URI.DisableExternal.txt rename to plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/ConfigSchema/schema/URI.DisableExternal.txt index 9132ea4..13c122c 100755 --- a/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/URI.DisableExternal.txt +++ b/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/ConfigSchema/schema/URI.DisableExternal.txt @@ -1,11 +1,11 @@ -URI.DisableExternal -TYPE: bool -VERSION: 1.2.0 -DEFAULT: false ---DESCRIPTION-- -Disables links to external websites. This is a highly effective anti-spam -and anti-pagerank-leech measure, but comes at a hefty price: nolinks or -images outside of your domain will be allowed. Non-linkified URIs will -still be preserved. If you want to be able to link to subdomains or use -absolute URIs, specify %URI.Host for your website. ---# vim: et sw=4 sts=4 +URI.DisableExternal +TYPE: bool +VERSION: 1.2.0 +DEFAULT: false +--DESCRIPTION-- +Disables links to external websites. This is a highly effective anti-spam +and anti-pagerank-leech measure, but comes at a hefty price: nolinks or +images outside of your domain will be allowed. Non-linkified URIs will +still be preserved. If you want to be able to link to subdomains or use +absolute URIs, specify %URI.Host for your website. +--# vim: et sw=4 sts=4 diff --git a/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/URI.DisableExternalResources.txt b/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/ConfigSchema/schema/URI.DisableExternalResources.txt similarity index 97% rename from plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/URI.DisableExternalResources.txt rename to plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/ConfigSchema/schema/URI.DisableExternalResources.txt index d74bc1e..abcc1ef 100755 --- a/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/URI.DisableExternalResources.txt +++ b/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/ConfigSchema/schema/URI.DisableExternalResources.txt @@ -1,13 +1,13 @@ -URI.DisableExternalResources -TYPE: bool -VERSION: 1.3.0 -DEFAULT: false ---DESCRIPTION-- -Disables the embedding of external resources, preventing users from -embedding things like images from other hosts. This prevents access -tracking (good for email viewers), bandwidth leeching, cross-site request -forging, goatse.cx posting, and other nasties, but also results in a loss -of end-user functionality (they can't directly post a pic they posted from -Flickr anymore). Use it if you don't have a robust user-content moderation -team. ---# vim: et sw=4 sts=4 +URI.DisableExternalResources +TYPE: bool +VERSION: 1.3.0 +DEFAULT: false +--DESCRIPTION-- +Disables the embedding of external resources, preventing users from +embedding things like images from other hosts. This prevents access +tracking (good for email viewers), bandwidth leeching, cross-site request +forging, goatse.cx posting, and other nasties, but also results in a loss +of end-user functionality (they can't directly post a pic they posted from +Flickr anymore). Use it if you don't have a robust user-content moderation +team. +--# vim: et sw=4 sts=4 diff --git a/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/URI.DisableResources.txt b/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/ConfigSchema/schema/URI.DisableResources.txt similarity index 96% rename from plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/URI.DisableResources.txt rename to plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/ConfigSchema/schema/URI.DisableResources.txt index 6c10614..f891de4 100755 --- a/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/URI.DisableResources.txt +++ b/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/ConfigSchema/schema/URI.DisableResources.txt @@ -1,15 +1,15 @@ -URI.DisableResources -TYPE: bool -VERSION: 4.2.0 -DEFAULT: false ---DESCRIPTION-- -

- Disables embedding resources, essentially meaning no pictures. You can - still link to them though. See %URI.DisableExternalResources for why - this might be a good idea. -

-

- Note: While this directive has been available since 1.3.0, - it didn't actually start doing anything until 4.2.0. -

---# vim: et sw=4 sts=4 +URI.DisableResources +TYPE: bool +VERSION: 4.2.0 +DEFAULT: false +--DESCRIPTION-- +

+ Disables embedding resources, essentially meaning no pictures. You can + still link to them though. See %URI.DisableExternalResources for why + this might be a good idea. +

+

+ Note: While this directive has been available since 1.3.0, + it didn't actually start doing anything until 4.2.0. +

+--# vim: et sw=4 sts=4 diff --git a/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/URI.Host.txt b/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/ConfigSchema/schema/URI.Host.txt similarity index 97% rename from plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/URI.Host.txt rename to plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/ConfigSchema/schema/URI.Host.txt index ba0e6bc..ee83b12 100755 --- a/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/URI.Host.txt +++ b/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/ConfigSchema/schema/URI.Host.txt @@ -1,19 +1,19 @@ -URI.Host -TYPE: string/null -VERSION: 1.2.0 -DEFAULT: NULL ---DESCRIPTION-- - -

- Defines the domain name of the server, so we can determine whether or - an absolute URI is from your website or not. Not strictly necessary, - as users should be using relative URIs to reference resources on your - website. It will, however, let you use absolute URIs to link to - subdomains of the domain you post here: i.e. example.com will allow - sub.example.com. However, higher up domains will still be excluded: - if you set %URI.Host to sub.example.com, example.com will be blocked. - Note: This directive overrides %URI.Base because - a given page may be on a sub-domain, but you wish HTML Purifier to be - more relaxed and allow some of the parent domains too. -

---# vim: et sw=4 sts=4 +URI.Host +TYPE: string/null +VERSION: 1.2.0 +DEFAULT: NULL +--DESCRIPTION-- + +

+ Defines the domain name of the server, so we can determine whether or + an absolute URI is from your website or not. Not strictly necessary, + as users should be using relative URIs to reference resources on your + website. It will, however, let you use absolute URIs to link to + subdomains of the domain you post here: i.e. example.com will allow + sub.example.com. However, higher up domains will still be excluded: + if you set %URI.Host to sub.example.com, example.com will be blocked. + Note: This directive overrides %URI.Base because + a given page may be on a sub-domain, but you wish HTML Purifier to be + more relaxed and allow some of the parent domains too. +

+--# vim: et sw=4 sts=4 diff --git a/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/URI.HostBlacklist.txt b/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/ConfigSchema/schema/URI.HostBlacklist.txt similarity index 97% rename from plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/URI.HostBlacklist.txt rename to plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/ConfigSchema/schema/URI.HostBlacklist.txt index 825fef2..0b6df76 100755 --- a/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/URI.HostBlacklist.txt +++ b/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/ConfigSchema/schema/URI.HostBlacklist.txt @@ -1,9 +1,9 @@ -URI.HostBlacklist -TYPE: list -VERSION: 1.3.0 -DEFAULT: array() ---DESCRIPTION-- -List of strings that are forbidden in the host of any URI. Use it to kill -domain names of spam, etc. Note that it will catch anything in the domain, -so moo.com will catch moo.com.example.com. ---# vim: et sw=4 sts=4 +URI.HostBlacklist +TYPE: list +VERSION: 1.3.0 +DEFAULT: array() +--DESCRIPTION-- +List of strings that are forbidden in the host of any URI. Use it to kill +domain names of spam, etc. Note that it will catch anything in the domain, +so moo.com will catch moo.com.example.com. +--# vim: et sw=4 sts=4 diff --git a/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/URI.MakeAbsolute.txt b/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/ConfigSchema/schema/URI.MakeAbsolute.txt similarity index 96% rename from plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/URI.MakeAbsolute.txt rename to plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/ConfigSchema/schema/URI.MakeAbsolute.txt index eb58c7f..4214900 100755 --- a/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/URI.MakeAbsolute.txt +++ b/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/ConfigSchema/schema/URI.MakeAbsolute.txt @@ -1,13 +1,13 @@ -URI.MakeAbsolute -TYPE: bool -VERSION: 2.1.0 -DEFAULT: false ---DESCRIPTION-- - -

- Converts all URIs into absolute forms. This is useful when the HTML - being filtered assumes a specific base path, but will actually be - viewed in a different context (and setting an alternate base URI is - not possible). %URI.Base must be set for this directive to work. -

---# vim: et sw=4 sts=4 +URI.MakeAbsolute +TYPE: bool +VERSION: 2.1.0 +DEFAULT: false +--DESCRIPTION-- + +

+ Converts all URIs into absolute forms. This is useful when the HTML + being filtered assumes a specific base path, but will actually be + viewed in a different context (and setting an alternate base URI is + not possible). %URI.Base must be set for this directive to work. +

+--# vim: et sw=4 sts=4 diff --git a/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/URI.Munge.txt b/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/ConfigSchema/schema/URI.Munge.txt similarity index 97% rename from plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/URI.Munge.txt rename to plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/ConfigSchema/schema/URI.Munge.txt index bedd610..58c81dc 100755 --- a/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/URI.Munge.txt +++ b/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/ConfigSchema/schema/URI.Munge.txt @@ -1,83 +1,83 @@ -URI.Munge -TYPE: string/null -VERSION: 1.3.0 -DEFAULT: NULL ---DESCRIPTION-- - -

- Munges all browsable (usually http, https and ftp) - absolute URIs into another URI, usually a URI redirection service. - This directive accepts a URI, formatted with a %s where - the url-encoded original URI should be inserted (sample: - http://www.google.com/url?q=%s). -

-

- Uses for this directive: -

-
    -
  • - Prevent PageRank leaks, while being fairly transparent - to users (you may also want to add some client side JavaScript to - override the text in the statusbar). Notice: - Many security experts believe that this form of protection does not deter spam-bots. -
  • -
  • - Redirect users to a splash page telling them they are leaving your - website. While this is poor usability practice, it is often mandated - in corporate environments. -
  • -
-

- Prior to HTML Purifier 3.1.1, this directive also enabled the munging - of browsable external resources, which could break things if your redirection - script was a splash page or used meta tags. To revert to - previous behavior, please use %URI.MungeResources. -

-

- You may want to also use %URI.MungeSecretKey along with this directive - in order to enforce what URIs your redirector script allows. Open - redirector scripts can be a security risk and negatively affect the - reputation of your domain name. -

-

- Starting with HTML Purifier 3.1.1, there is also these substitutions: -

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
KeyDescriptionExample <a href="">
%r1 - The URI embeds a resource
(blank) - The URI is merely a link
%nThe name of the tag this URI came froma
%mThe name of the attribute this URI came fromhref
%pThe name of the CSS property this URI came from, or blank if irrelevant
-

- Admittedly, these letters are somewhat arbitrary; the only stipulation - was that they couldn't be a through f. r is for resource (I would have preferred - e, but you take what you can get), n is for name, m - was picked because it came after n (and I couldn't use a), p is for - property. -

---# vim: et sw=4 sts=4 +URI.Munge +TYPE: string/null +VERSION: 1.3.0 +DEFAULT: NULL +--DESCRIPTION-- + +

+ Munges all browsable (usually http, https and ftp) + absolute URIs into another URI, usually a URI redirection service. + This directive accepts a URI, formatted with a %s where + the url-encoded original URI should be inserted (sample: + http://www.google.com/url?q=%s). +

+

+ Uses for this directive: +

+
    +
  • + Prevent PageRank leaks, while being fairly transparent + to users (you may also want to add some client side JavaScript to + override the text in the statusbar). Notice: + Many security experts believe that this form of protection does not deter spam-bots. +
  • +
  • + Redirect users to a splash page telling them they are leaving your + website. While this is poor usability practice, it is often mandated + in corporate environments. +
  • +
+

+ Prior to HTML Purifier 3.1.1, this directive also enabled the munging + of browsable external resources, which could break things if your redirection + script was a splash page or used meta tags. To revert to + previous behavior, please use %URI.MungeResources. +

+

+ You may want to also use %URI.MungeSecretKey along with this directive + in order to enforce what URIs your redirector script allows. Open + redirector scripts can be a security risk and negatively affect the + reputation of your domain name. +

+

+ Starting with HTML Purifier 3.1.1, there is also these substitutions: +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
KeyDescriptionExample <a href="">
%r1 - The URI embeds a resource
(blank) - The URI is merely a link
%nThe name of the tag this URI came froma
%mThe name of the attribute this URI came fromhref
%pThe name of the CSS property this URI came from, or blank if irrelevant
+

+ Admittedly, these letters are somewhat arbitrary; the only stipulation + was that they couldn't be a through f. r is for resource (I would have preferred + e, but you take what you can get), n is for name, m + was picked because it came after n (and I couldn't use a), p is for + property. +

+--# vim: et sw=4 sts=4 diff --git a/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/URI.MungeResources.txt b/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/ConfigSchema/schema/URI.MungeResources.txt similarity index 97% rename from plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/URI.MungeResources.txt rename to plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/ConfigSchema/schema/URI.MungeResources.txt index ed4b5b0..6fce0fd 100755 --- a/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/URI.MungeResources.txt +++ b/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/ConfigSchema/schema/URI.MungeResources.txt @@ -1,17 +1,17 @@ -URI.MungeResources -TYPE: bool -VERSION: 3.1.1 -DEFAULT: false ---DESCRIPTION-- -

- If true, any URI munging directives like %URI.Munge - will also apply to embedded resources, such as <img src="">. - Be careful enabling this directive if you have a redirector script - that does not use the Location HTTP header; all of your images - and other embedded resources will break. -

-

- Warning: It is strongly advised you use this in conjunction - %URI.MungeSecretKey to mitigate the security risk of an open redirector. -

---# vim: et sw=4 sts=4 +URI.MungeResources +TYPE: bool +VERSION: 3.1.1 +DEFAULT: false +--DESCRIPTION-- +

+ If true, any URI munging directives like %URI.Munge + will also apply to embedded resources, such as <img src="">. + Be careful enabling this directive if you have a redirector script + that does not use the Location HTTP header; all of your images + and other embedded resources will break. +

+

+ Warning: It is strongly advised you use this in conjunction + %URI.MungeSecretKey to mitigate the security risk of an open redirector. +

+--# vim: et sw=4 sts=4 diff --git a/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/URI.MungeSecretKey.txt b/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/ConfigSchema/schema/URI.MungeSecretKey.txt similarity index 97% rename from plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/URI.MungeSecretKey.txt rename to plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/ConfigSchema/schema/URI.MungeSecretKey.txt index 123b6e2..1e17c1d 100755 --- a/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/URI.MungeSecretKey.txt +++ b/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/ConfigSchema/schema/URI.MungeSecretKey.txt @@ -1,30 +1,30 @@ -URI.MungeSecretKey -TYPE: string/null -VERSION: 3.1.1 -DEFAULT: NULL ---DESCRIPTION-- -

- This directive enables secure checksum generation along with %URI.Munge. - It should be set to a secure key that is not shared with anyone else. - The checksum can be placed in the URI using %t. Use of this checksum - affords an additional level of protection by allowing a redirector - to check if a URI has passed through HTML Purifier with this line: -

- -
$checksum === hash_hmac("sha256", $url, $secret_key)
- -

- If the output is TRUE, the redirector script should accept the URI. -

- -

- Please note that it would still be possible for an attacker to procure - secure hashes en-mass by abusing your website's Preview feature or the - like, but this service affords an additional level of protection - that should be combined with website blacklisting. -

- -

- Remember this has no effect if %URI.Munge is not on. -

---# vim: et sw=4 sts=4 +URI.MungeSecretKey +TYPE: string/null +VERSION: 3.1.1 +DEFAULT: NULL +--DESCRIPTION-- +

+ This directive enables secure checksum generation along with %URI.Munge. + It should be set to a secure key that is not shared with anyone else. + The checksum can be placed in the URI using %t. Use of this checksum + affords an additional level of protection by allowing a redirector + to check if a URI has passed through HTML Purifier with this line: +

+ +
$checksum === hash_hmac("sha256", $url, $secret_key)
+ +

+ If the output is TRUE, the redirector script should accept the URI. +

+ +

+ Please note that it would still be possible for an attacker to procure + secure hashes en-mass by abusing your website's Preview feature or the + like, but this service affords an additional level of protection + that should be combined with website blacklisting. +

+ +

+ Remember this has no effect if %URI.Munge is not on. +

+--# vim: et sw=4 sts=4 diff --git a/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/URI.OverrideAllowedSchemes.txt b/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/ConfigSchema/schema/URI.OverrideAllowedSchemes.txt similarity index 97% rename from plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/URI.OverrideAllowedSchemes.txt rename to plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/ConfigSchema/schema/URI.OverrideAllowedSchemes.txt index 8b387de..23331a4 100755 --- a/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/URI.OverrideAllowedSchemes.txt +++ b/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/ConfigSchema/schema/URI.OverrideAllowedSchemes.txt @@ -1,9 +1,9 @@ -URI.OverrideAllowedSchemes -TYPE: bool -DEFAULT: true ---DESCRIPTION-- -If this is set to true (which it is by default), you can override -%URI.AllowedSchemes by simply registering a HTMLPurifier_URIScheme to the -registry. If false, you will also have to update that directive in order -to add more schemes. ---# vim: et sw=4 sts=4 +URI.OverrideAllowedSchemes +TYPE: bool +DEFAULT: true +--DESCRIPTION-- +If this is set to true (which it is by default), you can override +%URI.AllowedSchemes by simply registering a HTMLPurifier_URIScheme to the +registry. If false, you will also have to update that directive in order +to add more schemes. +--# vim: et sw=4 sts=4 diff --git a/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/URI.SafeIframeRegexp.txt b/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/ConfigSchema/schema/URI.SafeIframeRegexp.txt similarity index 97% rename from plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/URI.SafeIframeRegexp.txt rename to plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/ConfigSchema/schema/URI.SafeIframeRegexp.txt index 7e1f227..7908483 100755 --- a/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/URI.SafeIframeRegexp.txt +++ b/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/ConfigSchema/schema/URI.SafeIframeRegexp.txt @@ -1,22 +1,22 @@ -URI.SafeIframeRegexp -TYPE: string/null -VERSION: 4.4.0 -DEFAULT: NULL ---DESCRIPTION-- -

- A PCRE regular expression that will be matched against an iframe URI. This is - a relatively inflexible scheme, but works well enough for the most common - use-case of iframes: embedded video. This directive only has an effect if - %HTML.SafeIframe is enabled. Here are some example values: -

-
    -
  • %^http://www.youtube.com/embed/% - Allow YouTube videos
  • -
  • %^http://player.vimeo.com/video/% - Allow Vimeo videos
  • -
  • %^http://(www.youtube.com/embed/|player.vimeo.com/video/)% - Allow both
  • -
-

- Note that this directive does not give you enough granularity to, say, disable - all autoplay videos. Pipe up on the HTML Purifier forums if this - is a capability you want. -

---# vim: et sw=4 sts=4 +URI.SafeIframeRegexp +TYPE: string/null +VERSION: 4.4.0 +DEFAULT: NULL +--DESCRIPTION-- +

+ A PCRE regular expression that will be matched against an iframe URI. This is + a relatively inflexible scheme, but works well enough for the most common + use-case of iframes: embedded video. This directive only has an effect if + %HTML.SafeIframe is enabled. Here are some example values: +

+
    +
  • %^http://www.youtube.com/embed/% - Allow YouTube videos
  • +
  • %^http://player.vimeo.com/video/% - Allow Vimeo videos
  • +
  • %^http://(www.youtube.com/embed/|player.vimeo.com/video/)% - Allow both
  • +
+

+ Note that this directive does not give you enough granularity to, say, disable + all autoplay videos. Pipe up on the HTML Purifier forums if this + is a capability you want. +

+--# vim: et sw=4 sts=4 diff --git a/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/info.ini b/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/ConfigSchema/schema/info.ini similarity index 93% rename from plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/info.ini rename to plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/ConfigSchema/schema/info.ini index 58e0ce4..5de4505 100755 --- a/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/info.ini +++ b/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/ConfigSchema/schema/info.ini @@ -1,3 +1,3 @@ -name = "HTML Purifier" - -; vim: et sw=4 sts=4 +name = "HTML Purifier" + +; vim: et sw=4 sts=4 diff --git a/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/ContentSets.php b/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/ContentSets.php similarity index 97% rename from plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/ContentSets.php rename to plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/ContentSets.php index f68b196..543e3f8 100755 --- a/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/ContentSets.php +++ b/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/ContentSets.php @@ -1,170 +1,170 @@ - true) indexed by name. - * @type array - * @note This is in HTMLPurifier_HTMLDefinition->info_content_sets - */ - public $lookup = array(); - - /** - * Synchronized list of defined content sets (keys of info). - * @type array - */ - protected $keys = array(); - /** - * Synchronized list of defined content values (values of info). - * @type array - */ - protected $values = array(); - - /** - * Merges in module's content sets, expands identifiers in the content - * sets and populates the keys, values and lookup member variables. - * @param HTMLPurifier_HTMLModule[] $modules List of HTMLPurifier_HTMLModule - */ - public function __construct($modules) - { - if (!is_array($modules)) { - $modules = array($modules); - } - // populate content_sets based on module hints - // sorry, no way of overloading - foreach ($modules as $module) { - foreach ($module->content_sets as $key => $value) { - $temp = $this->convertToLookup($value); - if (isset($this->lookup[$key])) { - // add it into the existing content set - $this->lookup[$key] = array_merge($this->lookup[$key], $temp); - } else { - $this->lookup[$key] = $temp; - } - } - } - $old_lookup = false; - while ($old_lookup !== $this->lookup) { - $old_lookup = $this->lookup; - foreach ($this->lookup as $i => $set) { - $add = array(); - foreach ($set as $element => $x) { - if (isset($this->lookup[$element])) { - $add += $this->lookup[$element]; - unset($this->lookup[$i][$element]); - } - } - $this->lookup[$i] += $add; - } - } - - foreach ($this->lookup as $key => $lookup) { - $this->info[$key] = implode(' | ', array_keys($lookup)); - } - $this->keys = array_keys($this->info); - $this->values = array_values($this->info); - } - - /** - * Accepts a definition; generates and assigns a ChildDef for it - * @param HTMLPurifier_ElementDef $def HTMLPurifier_ElementDef reference - * @param HTMLPurifier_HTMLModule $module Module that defined the ElementDef - */ - public function generateChildDef(&$def, $module) - { - if (!empty($def->child)) { // already done! - return; - } - $content_model = $def->content_model; - if (is_string($content_model)) { - // Assume that $this->keys is alphanumeric - $def->content_model = preg_replace_callback( - '/\b(' . implode('|', $this->keys) . ')\b/', - array($this, 'generateChildDefCallback'), - $content_model - ); - //$def->content_model = str_replace( - // $this->keys, $this->values, $content_model); - } - $def->child = $this->getChildDef($def, $module); - } - - public function generateChildDefCallback($matches) - { - return $this->info[$matches[0]]; - } - - /** - * Instantiates a ChildDef based on content_model and content_model_type - * member variables in HTMLPurifier_ElementDef - * @note This will also defer to modules for custom HTMLPurifier_ChildDef - * subclasses that need content set expansion - * @param HTMLPurifier_ElementDef $def HTMLPurifier_ElementDef to have ChildDef extracted - * @param HTMLPurifier_HTMLModule $module Module that defined the ElementDef - * @return HTMLPurifier_ChildDef corresponding to ElementDef - */ - public function getChildDef($def, $module) - { - $value = $def->content_model; - if (is_object($value)) { - trigger_error( - 'Literal object child definitions should be stored in '. - 'ElementDef->child not ElementDef->content_model', - E_USER_NOTICE - ); - return $value; - } - switch ($def->content_model_type) { - case 'required': - return new HTMLPurifier_ChildDef_Required($value); - case 'optional': - return new HTMLPurifier_ChildDef_Optional($value); - case 'empty': - return new HTMLPurifier_ChildDef_Empty(); - case 'custom': - return new HTMLPurifier_ChildDef_Custom($value); - } - // defer to its module - $return = false; - if ($module->defines_child_def) { // save a func call - $return = $module->getChildDef($def); - } - if ($return !== false) { - return $return; - } - // error-out - trigger_error( - 'Could not determine which ChildDef class to instantiate', - E_USER_ERROR - ); - return false; - } - - /** - * Converts a string list of elements separated by pipes into - * a lookup array. - * @param string $string List of elements - * @return array Lookup array of elements - */ - protected function convertToLookup($string) - { - $array = explode('|', str_replace(' ', '', $string)); - $ret = array(); - foreach ($array as $k) { - $ret[$k] = true; - } - return $ret; - } -} - -// vim: et sw=4 sts=4 + true) indexed by name. + * @type array + * @note This is in HTMLPurifier_HTMLDefinition->info_content_sets + */ + public $lookup = array(); + + /** + * Synchronized list of defined content sets (keys of info). + * @type array + */ + protected $keys = array(); + /** + * Synchronized list of defined content values (values of info). + * @type array + */ + protected $values = array(); + + /** + * Merges in module's content sets, expands identifiers in the content + * sets and populates the keys, values and lookup member variables. + * @param HTMLPurifier_HTMLModule[] $modules List of HTMLPurifier_HTMLModule + */ + public function __construct($modules) + { + if (!is_array($modules)) { + $modules = array($modules); + } + // populate content_sets based on module hints + // sorry, no way of overloading + foreach ($modules as $module) { + foreach ($module->content_sets as $key => $value) { + $temp = $this->convertToLookup($value); + if (isset($this->lookup[$key])) { + // add it into the existing content set + $this->lookup[$key] = array_merge($this->lookup[$key], $temp); + } else { + $this->lookup[$key] = $temp; + } + } + } + $old_lookup = false; + while ($old_lookup !== $this->lookup) { + $old_lookup = $this->lookup; + foreach ($this->lookup as $i => $set) { + $add = array(); + foreach ($set as $element => $x) { + if (isset($this->lookup[$element])) { + $add += $this->lookup[$element]; + unset($this->lookup[$i][$element]); + } + } + $this->lookup[$i] += $add; + } + } + + foreach ($this->lookup as $key => $lookup) { + $this->info[$key] = implode(' | ', array_keys($lookup)); + } + $this->keys = array_keys($this->info); + $this->values = array_values($this->info); + } + + /** + * Accepts a definition; generates and assigns a ChildDef for it + * @param HTMLPurifier_ElementDef $def HTMLPurifier_ElementDef reference + * @param HTMLPurifier_HTMLModule $module Module that defined the ElementDef + */ + public function generateChildDef(&$def, $module) + { + if (!empty($def->child)) { // already done! + return; + } + $content_model = $def->content_model; + if (is_string($content_model)) { + // Assume that $this->keys is alphanumeric + $def->content_model = preg_replace_callback( + '/\b(' . implode('|', $this->keys) . ')\b/', + array($this, 'generateChildDefCallback'), + $content_model + ); + //$def->content_model = str_replace( + // $this->keys, $this->values, $content_model); + } + $def->child = $this->getChildDef($def, $module); + } + + public function generateChildDefCallback($matches) + { + return $this->info[$matches[0]]; + } + + /** + * Instantiates a ChildDef based on content_model and content_model_type + * member variables in HTMLPurifier_ElementDef + * @note This will also defer to modules for custom HTMLPurifier_ChildDef + * subclasses that need content set expansion + * @param HTMLPurifier_ElementDef $def HTMLPurifier_ElementDef to have ChildDef extracted + * @param HTMLPurifier_HTMLModule $module Module that defined the ElementDef + * @return HTMLPurifier_ChildDef corresponding to ElementDef + */ + public function getChildDef($def, $module) + { + $value = $def->content_model; + if (is_object($value)) { + trigger_error( + 'Literal object child definitions should be stored in '. + 'ElementDef->child not ElementDef->content_model', + E_USER_NOTICE + ); + return $value; + } + switch ($def->content_model_type) { + case 'required': + return new HTMLPurifier_ChildDef_Required($value); + case 'optional': + return new HTMLPurifier_ChildDef_Optional($value); + case 'empty': + return new HTMLPurifier_ChildDef_Empty(); + case 'custom': + return new HTMLPurifier_ChildDef_Custom($value); + } + // defer to its module + $return = false; + if ($module->defines_child_def) { // save a func call + $return = $module->getChildDef($def); + } + if ($return !== false) { + return $return; + } + // error-out + trigger_error( + 'Could not determine which ChildDef class to instantiate', + E_USER_ERROR + ); + return false; + } + + /** + * Converts a string list of elements separated by pipes into + * a lookup array. + * @param string $string List of elements + * @return array Lookup array of elements + */ + protected function convertToLookup($string) + { + $array = explode('|', str_replace(' ', '', $string)); + $ret = array(); + foreach ($array as $k) { + $ret[$k] = true; + } + return $ret; + } +} + +// vim: et sw=4 sts=4 diff --git a/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/Context.php b/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/Context.php similarity index 96% rename from plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/Context.php rename to plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/Context.php index 5ad536d..00e509c 100755 --- a/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/Context.php +++ b/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/Context.php @@ -1,95 +1,95 @@ -_storage)) { - trigger_error( - "Name $name produces collision, cannot re-register", - E_USER_ERROR - ); - return; - } - $this->_storage[$name] =& $ref; - } - - /** - * Retrieves a variable reference from the context. - * @param string $name String name - * @param bool $ignore_error Boolean whether or not to ignore error - * @return mixed - */ - public function &get($name, $ignore_error = false) - { - if (!array_key_exists($name, $this->_storage)) { - if (!$ignore_error) { - trigger_error( - "Attempted to retrieve non-existent variable $name", - E_USER_ERROR - ); - } - $var = null; // so we can return by reference - return $var; - } - return $this->_storage[$name]; - } - - /** - * Destroys a variable in the context. - * @param string $name String name - */ - public function destroy($name) - { - if (!array_key_exists($name, $this->_storage)) { - trigger_error( - "Attempted to destroy non-existent variable $name", - E_USER_ERROR - ); - return; - } - unset($this->_storage[$name]); - } - - /** - * Checks whether or not the variable exists. - * @param string $name String name - * @return bool - */ - public function exists($name) - { - return array_key_exists($name, $this->_storage); - } - - /** - * Loads a series of variables from an associative array - * @param array $context_array Assoc array of variables to load - */ - public function loadArray($context_array) - { - foreach ($context_array as $key => $discard) { - $this->register($key, $context_array[$key]); - } - } -} - -// vim: et sw=4 sts=4 +_storage)) { + trigger_error( + "Name $name produces collision, cannot re-register", + E_USER_ERROR + ); + return; + } + $this->_storage[$name] =& $ref; + } + + /** + * Retrieves a variable reference from the context. + * @param string $name String name + * @param bool $ignore_error Boolean whether or not to ignore error + * @return mixed + */ + public function &get($name, $ignore_error = false) + { + if (!array_key_exists($name, $this->_storage)) { + if (!$ignore_error) { + trigger_error( + "Attempted to retrieve non-existent variable $name", + E_USER_ERROR + ); + } + $var = null; // so we can return by reference + return $var; + } + return $this->_storage[$name]; + } + + /** + * Destroys a variable in the context. + * @param string $name String name + */ + public function destroy($name) + { + if (!array_key_exists($name, $this->_storage)) { + trigger_error( + "Attempted to destroy non-existent variable $name", + E_USER_ERROR + ); + return; + } + unset($this->_storage[$name]); + } + + /** + * Checks whether or not the variable exists. + * @param string $name String name + * @return bool + */ + public function exists($name) + { + return array_key_exists($name, $this->_storage); + } + + /** + * Loads a series of variables from an associative array + * @param array $context_array Assoc array of variables to load + */ + public function loadArray($context_array) + { + foreach ($context_array as $key => $discard) { + $this->register($key, $context_array[$key]); + } + } +} + +// vim: et sw=4 sts=4 diff --git a/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/Definition.php b/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/Definition.php similarity index 96% rename from plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/Definition.php rename to plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/Definition.php index f987e60..bc6d433 100755 --- a/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/Definition.php +++ b/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/Definition.php @@ -1,55 +1,55 @@ -setup) { - return; - } - $this->setup = true; - $this->doSetup($config); - } -} - -// vim: et sw=4 sts=4 +setup) { + return; + } + $this->setup = true; + $this->doSetup($config); + } +} + +// vim: et sw=4 sts=4 diff --git a/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/DefinitionCache.php b/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/DefinitionCache.php similarity index 95% rename from plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/DefinitionCache.php rename to plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/DefinitionCache.php index d7f0bb1..9aa8ff3 100755 --- a/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/DefinitionCache.php +++ b/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/DefinitionCache.php @@ -1,129 +1,129 @@ -type = $type; - } - - /** - * Generates a unique identifier for a particular configuration - * @param HTMLPurifier_Config $config Instance of HTMLPurifier_Config - * @return string - */ - public function generateKey($config) - { - return $config->version . ',' . // possibly replace with function calls - $config->getBatchSerial($this->type) . ',' . - $config->get($this->type . '.DefinitionRev'); - } - - /** - * Tests whether or not a key is old with respect to the configuration's - * version and revision number. - * @param string $key Key to test - * @param HTMLPurifier_Config $config Instance of HTMLPurifier_Config to test against - * @return bool - */ - public function isOld($key, $config) - { - if (substr_count($key, ',') < 2) { - return true; - } - list($version, $hash, $revision) = explode(',', $key, 3); - $compare = version_compare($version, $config->version); - // version mismatch, is always old - if ($compare != 0) { - return true; - } - // versions match, ids match, check revision number - if ($hash == $config->getBatchSerial($this->type) && - $revision < $config->get($this->type . '.DefinitionRev')) { - return true; - } - return false; - } - - /** - * Checks if a definition's type jives with the cache's type - * @note Throws an error on failure - * @param HTMLPurifier_Definition $def Definition object to check - * @return bool true if good, false if not - */ - public function checkDefType($def) - { - if ($def->type !== $this->type) { - trigger_error("Cannot use definition of type {$def->type} in cache for {$this->type}"); - return false; - } - return true; - } - - /** - * Adds a definition object to the cache - * @param HTMLPurifier_Definition $def - * @param HTMLPurifier_Config $config - */ - abstract public function add($def, $config); - - /** - * Unconditionally saves a definition object to the cache - * @param HTMLPurifier_Definition $def - * @param HTMLPurifier_Config $config - */ - abstract public function set($def, $config); - - /** - * Replace an object in the cache - * @param HTMLPurifier_Definition $def - * @param HTMLPurifier_Config $config - */ - abstract public function replace($def, $config); - - /** - * Retrieves a definition object from the cache - * @param HTMLPurifier_Config $config - */ - abstract public function get($config); - - /** - * Removes a definition object to the cache - * @param HTMLPurifier_Config $config - */ - abstract public function remove($config); - - /** - * Clears all objects from cache - * @param HTMLPurifier_Config $config - */ - abstract public function flush($config); - - /** - * Clears all expired (older version or revision) objects from cache - * @note Be carefuly implementing this method as flush. Flush must - * not interfere with other Definition types, and cleanup() - * should not be repeatedly called by userland code. - * @param HTMLPurifier_Config $config - */ - abstract public function cleanup($config); -} - -// vim: et sw=4 sts=4 +type = $type; + } + + /** + * Generates a unique identifier for a particular configuration + * @param HTMLPurifier_Config $config Instance of HTMLPurifier_Config + * @return string + */ + public function generateKey($config) + { + return $config->version . ',' . // possibly replace with function calls + $config->getBatchSerial($this->type) . ',' . + $config->get($this->type . '.DefinitionRev'); + } + + /** + * Tests whether or not a key is old with respect to the configuration's + * version and revision number. + * @param string $key Key to test + * @param HTMLPurifier_Config $config Instance of HTMLPurifier_Config to test against + * @return bool + */ + public function isOld($key, $config) + { + if (substr_count($key, ',') < 2) { + return true; + } + list($version, $hash, $revision) = explode(',', $key, 3); + $compare = version_compare($version, $config->version); + // version mismatch, is always old + if ($compare != 0) { + return true; + } + // versions match, ids match, check revision number + if ($hash == $config->getBatchSerial($this->type) && + $revision < $config->get($this->type . '.DefinitionRev')) { + return true; + } + return false; + } + + /** + * Checks if a definition's type jives with the cache's type + * @note Throws an error on failure + * @param HTMLPurifier_Definition $def Definition object to check + * @return bool true if good, false if not + */ + public function checkDefType($def) + { + if ($def->type !== $this->type) { + trigger_error("Cannot use definition of type {$def->type} in cache for {$this->type}"); + return false; + } + return true; + } + + /** + * Adds a definition object to the cache + * @param HTMLPurifier_Definition $def + * @param HTMLPurifier_Config $config + */ + abstract public function add($def, $config); + + /** + * Unconditionally saves a definition object to the cache + * @param HTMLPurifier_Definition $def + * @param HTMLPurifier_Config $config + */ + abstract public function set($def, $config); + + /** + * Replace an object in the cache + * @param HTMLPurifier_Definition $def + * @param HTMLPurifier_Config $config + */ + abstract public function replace($def, $config); + + /** + * Retrieves a definition object from the cache + * @param HTMLPurifier_Config $config + */ + abstract public function get($config); + + /** + * Removes a definition object to the cache + * @param HTMLPurifier_Config $config + */ + abstract public function remove($config); + + /** + * Clears all objects from cache + * @param HTMLPurifier_Config $config + */ + abstract public function flush($config); + + /** + * Clears all expired (older version or revision) objects from cache + * @note Be careful implementing this method as flush. Flush must + * not interfere with other Definition types, and cleanup() + * should not be repeatedly called by userland code. + * @param HTMLPurifier_Config $config + */ + abstract public function cleanup($config); +} + +// vim: et sw=4 sts=4 diff --git a/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/DefinitionCache/Decorator.php b/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/DefinitionCache/Decorator.php similarity index 95% rename from plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/DefinitionCache/Decorator.php rename to plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/DefinitionCache/Decorator.php index 09cdc1c..b57a51b 100755 --- a/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/DefinitionCache/Decorator.php +++ b/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/DefinitionCache/Decorator.php @@ -1,112 +1,112 @@ -copy(); - // reference is necessary for mocks in PHP 4 - $decorator->cache =& $cache; - $decorator->type = $cache->type; - return $decorator; - } - - /** - * Cross-compatible clone substitute - * @return HTMLPurifier_DefinitionCache_Decorator - */ - public function copy() - { - return new HTMLPurifier_DefinitionCache_Decorator(); - } - - /** - * @param HTMLPurifier_Definition $def - * @param HTMLPurifier_Config $config - * @return mixed - */ - public function add($def, $config) - { - return $this->cache->add($def, $config); - } - - /** - * @param HTMLPurifier_Definition $def - * @param HTMLPurifier_Config $config - * @return mixed - */ - public function set($def, $config) - { - return $this->cache->set($def, $config); - } - - /** - * @param HTMLPurifier_Definition $def - * @param HTMLPurifier_Config $config - * @return mixed - */ - public function replace($def, $config) - { - return $this->cache->replace($def, $config); - } - - /** - * @param HTMLPurifier_Config $config - * @return mixed - */ - public function get($config) - { - return $this->cache->get($config); - } - - /** - * @param HTMLPurifier_Config $config - * @return mixed - */ - public function remove($config) - { - return $this->cache->remove($config); - } - - /** - * @param HTMLPurifier_Config $config - * @return mixed - */ - public function flush($config) - { - return $this->cache->flush($config); - } - - /** - * @param HTMLPurifier_Config $config - * @return mixed - */ - public function cleanup($config) - { - return $this->cache->cleanup($config); - } -} - -// vim: et sw=4 sts=4 +copy(); + // reference is necessary for mocks in PHP 4 + $decorator->cache =& $cache; + $decorator->type = $cache->type; + return $decorator; + } + + /** + * Cross-compatible clone substitute + * @return HTMLPurifier_DefinitionCache_Decorator + */ + public function copy() + { + return new HTMLPurifier_DefinitionCache_Decorator(); + } + + /** + * @param HTMLPurifier_Definition $def + * @param HTMLPurifier_Config $config + * @return mixed + */ + public function add($def, $config) + { + return $this->cache->add($def, $config); + } + + /** + * @param HTMLPurifier_Definition $def + * @param HTMLPurifier_Config $config + * @return mixed + */ + public function set($def, $config) + { + return $this->cache->set($def, $config); + } + + /** + * @param HTMLPurifier_Definition $def + * @param HTMLPurifier_Config $config + * @return mixed + */ + public function replace($def, $config) + { + return $this->cache->replace($def, $config); + } + + /** + * @param HTMLPurifier_Config $config + * @return mixed + */ + public function get($config) + { + return $this->cache->get($config); + } + + /** + * @param HTMLPurifier_Config $config + * @return mixed + */ + public function remove($config) + { + return $this->cache->remove($config); + } + + /** + * @param HTMLPurifier_Config $config + * @return mixed + */ + public function flush($config) + { + return $this->cache->flush($config); + } + + /** + * @param HTMLPurifier_Config $config + * @return mixed + */ + public function cleanup($config) + { + return $this->cache->cleanup($config); + } +} + +// vim: et sw=4 sts=4 diff --git a/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/DefinitionCache/Decorator/Cleanup.php b/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/DefinitionCache/Decorator/Cleanup.php similarity index 95% rename from plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/DefinitionCache/Decorator/Cleanup.php rename to plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/DefinitionCache/Decorator/Cleanup.php index 53dca67..4991777 100755 --- a/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/DefinitionCache/Decorator/Cleanup.php +++ b/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/DefinitionCache/Decorator/Cleanup.php @@ -1,78 +1,78 @@ -definitions[$this->generateKey($config)] = $def; - } - return $status; - } - - /** - * @param HTMLPurifier_Definition $def - * @param HTMLPurifier_Config $config - * @return mixed - */ - public function set($def, $config) - { - $status = parent::set($def, $config); - if ($status) { - $this->definitions[$this->generateKey($config)] = $def; - } - return $status; - } - - /** - * @param HTMLPurifier_Definition $def - * @param HTMLPurifier_Config $config - * @return mixed - */ - public function replace($def, $config) - { - $status = parent::replace($def, $config); - if ($status) { - $this->definitions[$this->generateKey($config)] = $def; - } - return $status; - } - - /** - * @param HTMLPurifier_Config $config - * @return mixed - */ - public function get($config) - { - $key = $this->generateKey($config); - if (isset($this->definitions[$key])) { - return $this->definitions[$key]; - } - $this->definitions[$key] = parent::get($config); - return $this->definitions[$key]; - } -} - -// vim: et sw=4 sts=4 +definitions[$this->generateKey($config)] = $def; + } + return $status; + } + + /** + * @param HTMLPurifier_Definition $def + * @param HTMLPurifier_Config $config + * @return mixed + */ + public function set($def, $config) + { + $status = parent::set($def, $config); + if ($status) { + $this->definitions[$this->generateKey($config)] = $def; + } + return $status; + } + + /** + * @param HTMLPurifier_Definition $def + * @param HTMLPurifier_Config $config + * @return mixed + */ + public function replace($def, $config) + { + $status = parent::replace($def, $config); + if ($status) { + $this->definitions[$this->generateKey($config)] = $def; + } + return $status; + } + + /** + * @param HTMLPurifier_Config $config + * @return mixed + */ + public function get($config) + { + $key = $this->generateKey($config); + if (isset($this->definitions[$key])) { + return $this->definitions[$key]; + } + $this->definitions[$key] = parent::get($config); + return $this->definitions[$key]; + } +} + +// vim: et sw=4 sts=4 diff --git a/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/DefinitionCache/Decorator/Template.php.in b/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/DefinitionCache/Decorator/Template.php.in similarity index 95% rename from plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/DefinitionCache/Decorator/Template.php.in rename to plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/DefinitionCache/Decorator/Template.php.in index c586890..b1fec8d 100755 --- a/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/DefinitionCache/Decorator/Template.php.in +++ b/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/DefinitionCache/Decorator/Template.php.in @@ -1,82 +1,82 @@ -checkDefType($def)) { - return; - } - $file = $this->generateFilePath($config); - if (file_exists($file)) { - return false; - } - if (!$this->_prepareDir($config)) { - return false; - } - return $this->_write($file, serialize($def), $config); - } - - /** - * @param HTMLPurifier_Definition $def - * @param HTMLPurifier_Config $config - * @return int|bool - */ - public function set($def, $config) - { - if (!$this->checkDefType($def)) { - return; - } - $file = $this->generateFilePath($config); - if (!$this->_prepareDir($config)) { - return false; - } - return $this->_write($file, serialize($def), $config); - } - - /** - * @param HTMLPurifier_Definition $def - * @param HTMLPurifier_Config $config - * @return int|bool - */ - public function replace($def, $config) - { - if (!$this->checkDefType($def)) { - return; - } - $file = $this->generateFilePath($config); - if (!file_exists($file)) { - return false; - } - if (!$this->_prepareDir($config)) { - return false; - } - return $this->_write($file, serialize($def), $config); - } - - /** - * @param HTMLPurifier_Config $config - * @return bool|HTMLPurifier_Config - */ - public function get($config) - { - $file = $this->generateFilePath($config); - if (!file_exists($file)) { - return false; - } - return unserialize(file_get_contents($file)); - } - - /** - * @param HTMLPurifier_Config $config - * @return bool - */ - public function remove($config) - { - $file = $this->generateFilePath($config); - if (!file_exists($file)) { - return false; - } - return unlink($file); - } - - /** - * @param HTMLPurifier_Config $config - * @return bool - */ - public function flush($config) - { - if (!$this->_prepareDir($config)) { - return false; - } - $dir = $this->generateDirectoryPath($config); - $dh = opendir($dir); - while (false !== ($filename = readdir($dh))) { - if (empty($filename)) { - continue; - } - if ($filename[0] === '.') { - continue; - } - unlink($dir . '/' . $filename); - } - } - - /** - * @param HTMLPurifier_Config $config - * @return bool - */ - public function cleanup($config) - { - if (!$this->_prepareDir($config)) { - return false; - } - $dir = $this->generateDirectoryPath($config); - $dh = opendir($dir); - while (false !== ($filename = readdir($dh))) { - if (empty($filename)) { - continue; - } - if ($filename[0] === '.') { - continue; - } - $key = substr($filename, 0, strlen($filename) - 4); - if ($this->isOld($key, $config)) { - unlink($dir . '/' . $filename); - } - } - } - - /** - * Generates the file path to the serial file corresponding to - * the configuration and definition name - * @param HTMLPurifier_Config $config - * @return string - * @todo Make protected - */ - public function generateFilePath($config) - { - $key = $this->generateKey($config); - return $this->generateDirectoryPath($config) . '/' . $key . '.ser'; - } - - /** - * Generates the path to the directory contain this cache's serial files - * @param HTMLPurifier_Config $config - * @return string - * @note No trailing slash - * @todo Make protected - */ - public function generateDirectoryPath($config) - { - $base = $this->generateBaseDirectoryPath($config); - return $base . '/' . $this->type; - } - - /** - * Generates path to base directory that contains all definition type - * serials - * @param HTMLPurifier_Config $config - * @return mixed|string - * @todo Make protected - */ - public function generateBaseDirectoryPath($config) - { - $base = $config->get('Cache.SerializerPath'); - $base = is_null($base) ? HTMLPURIFIER_PREFIX . '/HTMLPurifier/DefinitionCache/Serializer' : $base; - return $base; - } - - /** - * Convenience wrapper function for file_put_contents - * @param string $file File name to write to - * @param string $data Data to write into file - * @param HTMLPurifier_Config $config - * @return int|bool Number of bytes written if success, or false if failure. - */ - private function _write($file, $data, $config) - { - $result = file_put_contents($file, $data); - if ($result !== false) { - // set permissions of the new file (no execute) - $chmod = $config->get('Cache.SerializerPermissions'); - if (!$chmod) { - $chmod = 0644; // invalid config or simpletest - } - $chmod = $chmod & 0666; - chmod($file, $chmod); - } - return $result; - } - - /** - * Prepares the directory that this type stores the serials in - * @param HTMLPurifier_Config $config - * @return bool True if successful - */ - private function _prepareDir($config) - { - $directory = $this->generateDirectoryPath($config); - $chmod = $config->get('Cache.SerializerPermissions'); - if (!$chmod) { - $chmod = 0755; // invalid config or simpletest - } - if (!is_dir($directory)) { - $base = $this->generateBaseDirectoryPath($config); - if (!is_dir($base)) { - trigger_error( - 'Base directory ' . $base . ' does not exist, - please create or change using %Cache.SerializerPath', - E_USER_WARNING - ); - return false; - } elseif (!$this->_testPermissions($base, $chmod)) { - return false; - } - $old = umask(0000); - mkdir($directory, $chmod); - umask($old); - } elseif (!$this->_testPermissions($directory, $chmod)) { - return false; - } - return true; - } - - /** - * Tests permissions on a directory and throws out friendly - * error messages and attempts to chmod it itself if possible - * @param string $dir Directory path - * @param int $chmod Permissions - * @return bool True if directory is writable - */ - private function _testPermissions($dir, $chmod) - { - // early abort, if it is writable, everything is hunky-dory - if (is_writable($dir)) { - return true; - } - if (!is_dir($dir)) { - // generally, you'll want to handle this beforehand - // so a more specific error message can be given - trigger_error( - 'Directory ' . $dir . ' does not exist', - E_USER_WARNING - ); - return false; - } - if (function_exists('posix_getuid')) { - // POSIX system, we can give more specific advice - if (fileowner($dir) === posix_getuid()) { - // we can chmod it ourselves - $chmod = $chmod | 0700; - if (chmod($dir, $chmod)) { - return true; - } - } elseif (filegroup($dir) === posix_getgid()) { - $chmod = $chmod | 0070; - } else { - // PHP's probably running as nobody, so we'll - // need to give global permissions - $chmod = $chmod | 0777; - } - trigger_error( - 'Directory ' . $dir . ' not writable, ' . - 'please chmod to ' . decoct($chmod), - E_USER_WARNING - ); - } else { - // generic error message - trigger_error( - 'Directory ' . $dir . ' not writable, ' . - 'please alter file permissions', - E_USER_WARNING - ); - } - return false; - } -} - -// vim: et sw=4 sts=4 +checkDefType($def)) { + return; + } + $file = $this->generateFilePath($config); + if (file_exists($file)) { + return false; + } + if (!$this->_prepareDir($config)) { + return false; + } + return $this->_write($file, serialize($def), $config); + } + + /** + * @param HTMLPurifier_Definition $def + * @param HTMLPurifier_Config $config + * @return int|bool + */ + public function set($def, $config) + { + if (!$this->checkDefType($def)) { + return; + } + $file = $this->generateFilePath($config); + if (!$this->_prepareDir($config)) { + return false; + } + return $this->_write($file, serialize($def), $config); + } + + /** + * @param HTMLPurifier_Definition $def + * @param HTMLPurifier_Config $config + * @return int|bool + */ + public function replace($def, $config) + { + if (!$this->checkDefType($def)) { + return; + } + $file = $this->generateFilePath($config); + if (!file_exists($file)) { + return false; + } + if (!$this->_prepareDir($config)) { + return false; + } + return $this->_write($file, serialize($def), $config); + } + + /** + * @param HTMLPurifier_Config $config + * @return bool|HTMLPurifier_Config + */ + public function get($config) + { + $file = $this->generateFilePath($config); + if (!file_exists($file)) { + return false; + } + return unserialize(file_get_contents($file)); + } + + /** + * @param HTMLPurifier_Config $config + * @return bool + */ + public function remove($config) + { + $file = $this->generateFilePath($config); + if (!file_exists($file)) { + return false; + } + return unlink($file); + } + + /** + * @param HTMLPurifier_Config $config + * @return bool + */ + public function flush($config) + { + if (!$this->_prepareDir($config)) { + return false; + } + $dir = $this->generateDirectoryPath($config); + $dh = opendir($dir); + // Apparently, on some versions of PHP, readdir will return + // an empty string if you pass an invalid argument to readdir. + // So you need this test. See #49. + if (false === $dh) { + return false; + } + while (false !== ($filename = readdir($dh))) { + if (empty($filename)) { + continue; + } + if ($filename[0] === '.') { + continue; + } + unlink($dir . '/' . $filename); + } + return true; + } + + /** + * @param HTMLPurifier_Config $config + * @return bool + */ + public function cleanup($config) + { + if (!$this->_prepareDir($config)) { + return false; + } + $dir = $this->generateDirectoryPath($config); + $dh = opendir($dir); + // See #49 (and above). + if (false === $dh) { + return false; + } + while (false !== ($filename = readdir($dh))) { + if (empty($filename)) { + continue; + } + if ($filename[0] === '.') { + continue; + } + $key = substr($filename, 0, strlen($filename) - 4); + if ($this->isOld($key, $config)) { + unlink($dir . '/' . $filename); + } + } + return true; + } + + /** + * Generates the file path to the serial file corresponding to + * the configuration and definition name + * @param HTMLPurifier_Config $config + * @return string + * @todo Make protected + */ + public function generateFilePath($config) + { + $key = $this->generateKey($config); + return $this->generateDirectoryPath($config) . '/' . $key . '.ser'; + } + + /** + * Generates the path to the directory contain this cache's serial files + * @param HTMLPurifier_Config $config + * @return string + * @note No trailing slash + * @todo Make protected + */ + public function generateDirectoryPath($config) + { + $base = $this->generateBaseDirectoryPath($config); + return $base . '/' . $this->type; + } + + /** + * Generates path to base directory that contains all definition type + * serials + * @param HTMLPurifier_Config $config + * @return mixed|string + * @todo Make protected + */ + public function generateBaseDirectoryPath($config) + { + $base = $config->get('Cache.SerializerPath'); + $base = is_null($base) ? HTMLPURIFIER_PREFIX . '/HTMLPurifier/DefinitionCache/Serializer' : $base; + return $base; + } + + /** + * Convenience wrapper function for file_put_contents + * @param string $file File name to write to + * @param string $data Data to write into file + * @param HTMLPurifier_Config $config + * @return int|bool Number of bytes written if success, or false if failure. + */ + private function _write($file, $data, $config) + { + $result = file_put_contents($file, $data); + if ($result !== false) { + // set permissions of the new file (no execute) + $chmod = $config->get('Cache.SerializerPermissions'); + if ($chmod === null) { + // don't do anything + } else { + $chmod = $chmod & 0666; + chmod($file, $chmod); + } + } + return $result; + } + + /** + * Prepares the directory that this type stores the serials in + * @param HTMLPurifier_Config $config + * @return bool True if successful + */ + private function _prepareDir($config) + { + $directory = $this->generateDirectoryPath($config); + $chmod = $config->get('Cache.SerializerPermissions'); + if (!is_dir($directory)) { + $base = $this->generateBaseDirectoryPath($config); + if (!is_dir($base)) { + trigger_error( + 'Base directory ' . $base . ' does not exist, + please create or change using %Cache.SerializerPath', + E_USER_WARNING + ); + return false; + } elseif (!$this->_testPermissions($base, $chmod)) { + return false; + } + if ($chmod === null) { + trigger_error( + 'Base directory ' . $base . ' does not exist, + please create or change using %Cache.SerializerPath', + E_USER_WARNING + ); + return false; + } + if ($chmod !== null) { + mkdir($directory, $chmod); + } else { + mkdir($directory); + } + if (!$this->_testPermissions($directory, $chmod)) { + trigger_error( + 'Base directory ' . $base . ' does not exist, + please create or change using %Cache.SerializerPath', + E_USER_WARNING + ); + return false; + } + } elseif (!$this->_testPermissions($directory, $chmod)) { + return false; + } + return true; + } + + /** + * Tests permissions on a directory and throws out friendly + * error messages and attempts to chmod it itself if possible + * @param string $dir Directory path + * @param int $chmod Permissions + * @return bool True if directory is writable + */ + private function _testPermissions($dir, $chmod) + { + // early abort, if it is writable, everything is hunky-dory + if (is_writable($dir)) { + return true; + } + if (!is_dir($dir)) { + // generally, you'll want to handle this beforehand + // so a more specific error message can be given + trigger_error( + 'Directory ' . $dir . ' does not exist', + E_USER_WARNING + ); + return false; + } + if (function_exists('posix_getuid') && $chmod !== null) { + // POSIX system, we can give more specific advice + if (fileowner($dir) === posix_getuid()) { + // we can chmod it ourselves + $chmod = $chmod | 0700; + if (chmod($dir, $chmod)) { + return true; + } + } elseif (filegroup($dir) === posix_getgid()) { + $chmod = $chmod | 0070; + } else { + // PHP's probably running as nobody, so we'll + // need to give global permissions + $chmod = $chmod | 0777; + } + trigger_error( + 'Directory ' . $dir . ' not writable, ' . + 'please chmod to ' . decoct($chmod), + E_USER_WARNING + ); + } else { + // generic error message + trigger_error( + 'Directory ' . $dir . ' not writable, ' . + 'please alter file permissions', + E_USER_WARNING + ); + } + return false; + } +} + +// vim: et sw=4 sts=4 diff --git a/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/DefinitionCache/Serializer/README b/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/DefinitionCache/Serializer/README similarity index 96% rename from plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/DefinitionCache/Serializer/README rename to plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/DefinitionCache/Serializer/README index ba005de..2e35c1c 100755 --- a/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/DefinitionCache/Serializer/README +++ b/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/DefinitionCache/Serializer/README @@ -1,3 +1,3 @@ -This is a dummy file to prevent Git from ignoring this empty directory. - - vim: et sw=4 sts=4 +This is a dummy file to prevent Git from ignoring this empty directory. + + vim: et sw=4 sts=4 diff --git a/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/DefinitionCacheFactory.php b/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/DefinitionCacheFactory.php similarity index 96% rename from plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/DefinitionCacheFactory.php rename to plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/DefinitionCacheFactory.php index 737b8bb..fd1cc9b 100755 --- a/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/DefinitionCacheFactory.php +++ b/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/DefinitionCacheFactory.php @@ -1,106 +1,106 @@ - array()); - - /** - * @type array - */ - protected $implementations = array(); - - /** - * @type HTMLPurifier_DefinitionCache_Decorator[] - */ - protected $decorators = array(); - - /** - * Initialize default decorators - */ - public function setup() - { - $this->addDecorator('Cleanup'); - } - - /** - * Retrieves an instance of global definition cache factory. - * @param HTMLPurifier_DefinitionCacheFactory $prototype - * @return HTMLPurifier_DefinitionCacheFactory - */ - public static function instance($prototype = null) - { - static $instance; - if ($prototype !== null) { - $instance = $prototype; - } elseif ($instance === null || $prototype === true) { - $instance = new HTMLPurifier_DefinitionCacheFactory(); - $instance->setup(); - } - return $instance; - } - - /** - * Registers a new definition cache object - * @param string $short Short name of cache object, for reference - * @param string $long Full class name of cache object, for construction - */ - public function register($short, $long) - { - $this->implementations[$short] = $long; - } - - /** - * Factory method that creates a cache object based on configuration - * @param string $type Name of definitions handled by cache - * @param HTMLPurifier_Config $config Config instance - * @return mixed - */ - public function create($type, $config) - { - $method = $config->get('Cache.DefinitionImpl'); - if ($method === null) { - return new HTMLPurifier_DefinitionCache_Null($type); - } - if (!empty($this->caches[$method][$type])) { - return $this->caches[$method][$type]; - } - if (isset($this->implementations[$method]) && - class_exists($class = $this->implementations[$method], false)) { - $cache = new $class($type); - } else { - if ($method != 'Serializer') { - trigger_error("Unrecognized DefinitionCache $method, using Serializer instead", E_USER_WARNING); - } - $cache = new HTMLPurifier_DefinitionCache_Serializer($type); - } - foreach ($this->decorators as $decorator) { - $new_cache = $decorator->decorate($cache); - // prevent infinite recursion in PHP 4 - unset($cache); - $cache = $new_cache; - } - $this->caches[$method][$type] = $cache; - return $this->caches[$method][$type]; - } - - /** - * Registers a decorator to add to all new cache objects - * @param HTMLPurifier_DefinitionCache_Decorator|string $decorator An instance or the name of a decorator - */ - public function addDecorator($decorator) - { - if (is_string($decorator)) { - $class = "HTMLPurifier_DefinitionCache_Decorator_$decorator"; - $decorator = new $class; - } - $this->decorators[$decorator->name] = $decorator; - } -} - -// vim: et sw=4 sts=4 + array()); + + /** + * @type array + */ + protected $implementations = array(); + + /** + * @type HTMLPurifier_DefinitionCache_Decorator[] + */ + protected $decorators = array(); + + /** + * Initialize default decorators + */ + public function setup() + { + $this->addDecorator('Cleanup'); + } + + /** + * Retrieves an instance of global definition cache factory. + * @param HTMLPurifier_DefinitionCacheFactory $prototype + * @return HTMLPurifier_DefinitionCacheFactory + */ + public static function instance($prototype = null) + { + static $instance; + if ($prototype !== null) { + $instance = $prototype; + } elseif ($instance === null || $prototype === true) { + $instance = new HTMLPurifier_DefinitionCacheFactory(); + $instance->setup(); + } + return $instance; + } + + /** + * Registers a new definition cache object + * @param string $short Short name of cache object, for reference + * @param string $long Full class name of cache object, for construction + */ + public function register($short, $long) + { + $this->implementations[$short] = $long; + } + + /** + * Factory method that creates a cache object based on configuration + * @param string $type Name of definitions handled by cache + * @param HTMLPurifier_Config $config Config instance + * @return mixed + */ + public function create($type, $config) + { + $method = $config->get('Cache.DefinitionImpl'); + if ($method === null) { + return new HTMLPurifier_DefinitionCache_Null($type); + } + if (!empty($this->caches[$method][$type])) { + return $this->caches[$method][$type]; + } + if (isset($this->implementations[$method]) && + class_exists($class = $this->implementations[$method], false)) { + $cache = new $class($type); + } else { + if ($method != 'Serializer') { + trigger_error("Unrecognized DefinitionCache $method, using Serializer instead", E_USER_WARNING); + } + $cache = new HTMLPurifier_DefinitionCache_Serializer($type); + } + foreach ($this->decorators as $decorator) { + $new_cache = $decorator->decorate($cache); + // prevent infinite recursion in PHP 4 + unset($cache); + $cache = $new_cache; + } + $this->caches[$method][$type] = $cache; + return $this->caches[$method][$type]; + } + + /** + * Registers a decorator to add to all new cache objects + * @param HTMLPurifier_DefinitionCache_Decorator|string $decorator An instance or the name of a decorator + */ + public function addDecorator($decorator) + { + if (is_string($decorator)) { + $class = "HTMLPurifier_DefinitionCache_Decorator_$decorator"; + $decorator = new $class; + } + $this->decorators[$decorator->name] = $decorator; + } +} + +// vim: et sw=4 sts=4 diff --git a/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/Doctype.php b/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/Doctype.php similarity index 95% rename from plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/Doctype.php rename to plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/Doctype.php index 4d72312..4acd06e 100755 --- a/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/Doctype.php +++ b/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/Doctype.php @@ -1,73 +1,73 @@ -renderDoctype. - * If structure changes, please update that function. - */ -class HTMLPurifier_Doctype -{ - /** - * Full name of doctype - * @type string - */ - public $name; - - /** - * List of standard modules (string identifiers or literal objects) - * that this doctype uses - * @type array - */ - public $modules = array(); - - /** - * List of modules to use for tidying up code - * @type array - */ - public $tidyModules = array(); - - /** - * Is the language derived from XML (i.e. XHTML)? - * @type bool - */ - public $xml = true; - - /** - * List of aliases for this doctype - * @type array - */ - public $aliases = array(); - - /** - * Public DTD identifier - * @type string - */ - public $dtdPublic; - - /** - * System DTD identifier - * @type string - */ - public $dtdSystem; - - public function __construct( - $name = null, - $xml = true, - $modules = array(), - $tidyModules = array(), - $aliases = array(), - $dtd_public = null, - $dtd_system = null - ) { - $this->name = $name; - $this->xml = $xml; - $this->modules = $modules; - $this->tidyModules = $tidyModules; - $this->aliases = $aliases; - $this->dtdPublic = $dtd_public; - $this->dtdSystem = $dtd_system; - } -} - -// vim: et sw=4 sts=4 +renderDoctype. + * If structure changes, please update that function. + */ +class HTMLPurifier_Doctype +{ + /** + * Full name of doctype + * @type string + */ + public $name; + + /** + * List of standard modules (string identifiers or literal objects) + * that this doctype uses + * @type array + */ + public $modules = array(); + + /** + * List of modules to use for tidying up code + * @type array + */ + public $tidyModules = array(); + + /** + * Is the language derived from XML (i.e. XHTML)? + * @type bool + */ + public $xml = true; + + /** + * List of aliases for this doctype + * @type array + */ + public $aliases = array(); + + /** + * Public DTD identifier + * @type string + */ + public $dtdPublic; + + /** + * System DTD identifier + * @type string + */ + public $dtdSystem; + + public function __construct( + $name = null, + $xml = true, + $modules = array(), + $tidyModules = array(), + $aliases = array(), + $dtd_public = null, + $dtd_system = null + ) { + $this->name = $name; + $this->xml = $xml; + $this->modules = $modules; + $this->tidyModules = $tidyModules; + $this->aliases = $aliases; + $this->dtdPublic = $dtd_public; + $this->dtdSystem = $dtd_system; + } +} + +// vim: et sw=4 sts=4 diff --git a/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/DoctypeRegistry.php b/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/DoctypeRegistry.php similarity index 96% rename from plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/DoctypeRegistry.php rename to plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/DoctypeRegistry.php index cab9dc5..acc1d64 100755 --- a/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/DoctypeRegistry.php +++ b/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/DoctypeRegistry.php @@ -1,142 +1,142 @@ -doctypes[$doctype->name] = $doctype; - $name = $doctype->name; - // hookup aliases - foreach ($doctype->aliases as $alias) { - if (isset($this->doctypes[$alias])) { - continue; - } - $this->aliases[$alias] = $name; - } - // remove old aliases - if (isset($this->aliases[$name])) { - unset($this->aliases[$name]); - } - return $doctype; - } - - /** - * Retrieves reference to a doctype of a certain name - * @note This function resolves aliases - * @note When possible, use the more fully-featured make() - * @param string $doctype Name of doctype - * @return HTMLPurifier_Doctype Editable doctype object - */ - public function get($doctype) - { - if (isset($this->aliases[$doctype])) { - $doctype = $this->aliases[$doctype]; - } - if (!isset($this->doctypes[$doctype])) { - trigger_error('Doctype ' . htmlspecialchars($doctype) . ' does not exist', E_USER_ERROR); - $anon = new HTMLPurifier_Doctype($doctype); - return $anon; - } - return $this->doctypes[$doctype]; - } - - /** - * Creates a doctype based on a configuration object, - * will perform initialization on the doctype - * @note Use this function to get a copy of doctype that config - * can hold on to (this is necessary in order to tell - * Generator whether or not the current document is XML - * based or not). - * @param HTMLPurifier_Config $config - * @return HTMLPurifier_Doctype - */ - public function make($config) - { - return clone $this->get($this->getDoctypeFromConfig($config)); - } - - /** - * Retrieves the doctype from the configuration object - * @param HTMLPurifier_Config $config - * @return string - */ - public function getDoctypeFromConfig($config) - { - // recommended test - $doctype = $config->get('HTML.Doctype'); - if (!empty($doctype)) { - return $doctype; - } - $doctype = $config->get('HTML.CustomDoctype'); - if (!empty($doctype)) { - return $doctype; - } - // backwards-compatibility - if ($config->get('HTML.XHTML')) { - $doctype = 'XHTML 1.0'; - } else { - $doctype = 'HTML 4.01'; - } - if ($config->get('HTML.Strict')) { - $doctype .= ' Strict'; - } else { - $doctype .= ' Transitional'; - } - return $doctype; - } -} - -// vim: et sw=4 sts=4 +doctypes[$doctype->name] = $doctype; + $name = $doctype->name; + // hookup aliases + foreach ($doctype->aliases as $alias) { + if (isset($this->doctypes[$alias])) { + continue; + } + $this->aliases[$alias] = $name; + } + // remove old aliases + if (isset($this->aliases[$name])) { + unset($this->aliases[$name]); + } + return $doctype; + } + + /** + * Retrieves reference to a doctype of a certain name + * @note This function resolves aliases + * @note When possible, use the more fully-featured make() + * @param string $doctype Name of doctype + * @return HTMLPurifier_Doctype Editable doctype object + */ + public function get($doctype) + { + if (isset($this->aliases[$doctype])) { + $doctype = $this->aliases[$doctype]; + } + if (!isset($this->doctypes[$doctype])) { + trigger_error('Doctype ' . htmlspecialchars($doctype) . ' does not exist', E_USER_ERROR); + $anon = new HTMLPurifier_Doctype($doctype); + return $anon; + } + return $this->doctypes[$doctype]; + } + + /** + * Creates a doctype based on a configuration object, + * will perform initialization on the doctype + * @note Use this function to get a copy of doctype that config + * can hold on to (this is necessary in order to tell + * Generator whether or not the current document is XML + * based or not). + * @param HTMLPurifier_Config $config + * @return HTMLPurifier_Doctype + */ + public function make($config) + { + return clone $this->get($this->getDoctypeFromConfig($config)); + } + + /** + * Retrieves the doctype from the configuration object + * @param HTMLPurifier_Config $config + * @return string + */ + public function getDoctypeFromConfig($config) + { + // recommended test + $doctype = $config->get('HTML.Doctype'); + if (!empty($doctype)) { + return $doctype; + } + $doctype = $config->get('HTML.CustomDoctype'); + if (!empty($doctype)) { + return $doctype; + } + // backwards-compatibility + if ($config->get('HTML.XHTML')) { + $doctype = 'XHTML 1.0'; + } else { + $doctype = 'HTML 4.01'; + } + if ($config->get('HTML.Strict')) { + $doctype .= ' Strict'; + } else { + $doctype .= ' Transitional'; + } + return $doctype; + } +} + +// vim: et sw=4 sts=4 diff --git a/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/ElementDef.php b/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/ElementDef.php similarity index 97% rename from plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/ElementDef.php rename to plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/ElementDef.php index 089f7ef..d5311ce 100755 --- a/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/ElementDef.php +++ b/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/ElementDef.php @@ -1,216 +1,216 @@ -setup(), this array may also - * contain an array at index 0 that indicates which attribute - * collections to load into the full array. It may also - * contain string indentifiers in lieu of HTMLPurifier_AttrDef, - * see HTMLPurifier_AttrTypes on how they are expanded during - * HTMLPurifier_HTMLDefinition->setup() processing. - */ - public $attr = array(); - - // XXX: Design note: currently, it's not possible to override - // previously defined AttrTransforms without messing around with - // the final generated config. This is by design; a previous version - // used an associated list of attr_transform, but it was extremely - // easy to accidentally override other attribute transforms by - // forgetting to specify an index (and just using 0.) While we - // could check this by checking the index number and complaining, - // there is a second problem which is that it is not at all easy to - // tell when something is getting overridden. Combine this with a - // codebase where this isn't really being used, and it's perfect for - // nuking. - - /** - * List of tags HTMLPurifier_AttrTransform to be done before validation. - * @type array - */ - public $attr_transform_pre = array(); - - /** - * List of tags HTMLPurifier_AttrTransform to be done after validation. - * @type array - */ - public $attr_transform_post = array(); - - /** - * HTMLPurifier_ChildDef of this tag. - * @type HTMLPurifier_ChildDef - */ - public $child; - - /** - * Abstract string representation of internal ChildDef rules. - * @see HTMLPurifier_ContentSets for how this is parsed and then transformed - * into an HTMLPurifier_ChildDef. - * @warning This is a temporary variable that is not available after - * being processed by HTMLDefinition - * @type string - */ - public $content_model; - - /** - * Value of $child->type, used to determine which ChildDef to use, - * used in combination with $content_model. - * @warning This must be lowercase - * @warning This is a temporary variable that is not available after - * being processed by HTMLDefinition - * @type string - */ - public $content_model_type; - - /** - * Does the element have a content model (#PCDATA | Inline)*? This - * is important for chameleon ins and del processing in - * HTMLPurifier_ChildDef_Chameleon. Dynamically set: modules don't - * have to worry about this one. - * @type bool - */ - public $descendants_are_inline = false; - - /** - * List of the names of required attributes this element has. - * Dynamically populated by HTMLPurifier_HTMLDefinition::getElement() - * @type array - */ - public $required_attr = array(); - - /** - * Lookup table of tags excluded from all descendants of this tag. - * @type array - * @note SGML permits exclusions for all descendants, but this is - * not possible with DTDs or XML Schemas. W3C has elected to - * use complicated compositions of content_models to simulate - * exclusion for children, but we go the simpler, SGML-style - * route of flat-out exclusions, which correctly apply to - * all descendants and not just children. Note that the XHTML - * Modularization Abstract Modules are blithely unaware of such - * distinctions. - */ - public $excludes = array(); - - /** - * This tag is explicitly auto-closed by the following tags. - * @type array - */ - public $autoclose = array(); - - /** - * If a foreign element is found in this element, test if it is - * allowed by this sub-element; if it is, instead of closing the - * current element, place it inside this element. - * @type string - */ - public $wrap; - - /** - * Whether or not this is a formatting element affected by the - * "Active Formatting Elements" algorithm. - * @type bool - */ - public $formatting; - - /** - * Low-level factory constructor for creating new standalone element defs - */ - public static function create($content_model, $content_model_type, $attr) - { - $def = new HTMLPurifier_ElementDef(); - $def->content_model = $content_model; - $def->content_model_type = $content_model_type; - $def->attr = $attr; - return $def; - } - - /** - * Merges the values of another element definition into this one. - * Values from the new element def take precedence if a value is - * not mergeable. - * @param HTMLPurifier_ElementDef $def - */ - public function mergeIn($def) - { - // later keys takes precedence - foreach ($def->attr as $k => $v) { - if ($k === 0) { - // merge in the includes - // sorry, no way to override an include - foreach ($v as $v2) { - $this->attr[0][] = $v2; - } - continue; - } - if ($v === false) { - if (isset($this->attr[$k])) { - unset($this->attr[$k]); - } - continue; - } - $this->attr[$k] = $v; - } - $this->_mergeAssocArray($this->excludes, $def->excludes); - $this->attr_transform_pre = array_merge($this->attr_transform_pre, $def->attr_transform_pre); - $this->attr_transform_post = array_merge($this->attr_transform_post, $def->attr_transform_post); - - if (!empty($def->content_model)) { - $this->content_model = - str_replace("#SUPER", $this->content_model, $def->content_model); - $this->child = false; - } - if (!empty($def->content_model_type)) { - $this->content_model_type = $def->content_model_type; - $this->child = false; - } - if (!is_null($def->child)) { - $this->child = $def->child; - } - if (!is_null($def->formatting)) { - $this->formatting = $def->formatting; - } - if ($def->descendants_are_inline) { - $this->descendants_are_inline = $def->descendants_are_inline; - } - } - - /** - * Merges one array into another, removes values which equal false - * @param $a1 Array by reference that is merged into - * @param $a2 Array that merges into $a1 - */ - private function _mergeAssocArray(&$a1, $a2) - { - foreach ($a2 as $k => $v) { - if ($v === false) { - if (isset($a1[$k])) { - unset($a1[$k]); - } - continue; - } - $a1[$k] = $v; - } - } -} - -// vim: et sw=4 sts=4 +setup(), this array may also + * contain an array at index 0 that indicates which attribute + * collections to load into the full array. It may also + * contain string indentifiers in lieu of HTMLPurifier_AttrDef, + * see HTMLPurifier_AttrTypes on how they are expanded during + * HTMLPurifier_HTMLDefinition->setup() processing. + */ + public $attr = array(); + + // XXX: Design note: currently, it's not possible to override + // previously defined AttrTransforms without messing around with + // the final generated config. This is by design; a previous version + // used an associated list of attr_transform, but it was extremely + // easy to accidentally override other attribute transforms by + // forgetting to specify an index (and just using 0.) While we + // could check this by checking the index number and complaining, + // there is a second problem which is that it is not at all easy to + // tell when something is getting overridden. Combine this with a + // codebase where this isn't really being used, and it's perfect for + // nuking. + + /** + * List of tags HTMLPurifier_AttrTransform to be done before validation. + * @type array + */ + public $attr_transform_pre = array(); + + /** + * List of tags HTMLPurifier_AttrTransform to be done after validation. + * @type array + */ + public $attr_transform_post = array(); + + /** + * HTMLPurifier_ChildDef of this tag. + * @type HTMLPurifier_ChildDef + */ + public $child; + + /** + * Abstract string representation of internal ChildDef rules. + * @see HTMLPurifier_ContentSets for how this is parsed and then transformed + * into an HTMLPurifier_ChildDef. + * @warning This is a temporary variable that is not available after + * being processed by HTMLDefinition + * @type string + */ + public $content_model; + + /** + * Value of $child->type, used to determine which ChildDef to use, + * used in combination with $content_model. + * @warning This must be lowercase + * @warning This is a temporary variable that is not available after + * being processed by HTMLDefinition + * @type string + */ + public $content_model_type; + + /** + * Does the element have a content model (#PCDATA | Inline)*? This + * is important for chameleon ins and del processing in + * HTMLPurifier_ChildDef_Chameleon. Dynamically set: modules don't + * have to worry about this one. + * @type bool + */ + public $descendants_are_inline = false; + + /** + * List of the names of required attributes this element has. + * Dynamically populated by HTMLPurifier_HTMLDefinition::getElement() + * @type array + */ + public $required_attr = array(); + + /** + * Lookup table of tags excluded from all descendants of this tag. + * @type array + * @note SGML permits exclusions for all descendants, but this is + * not possible with DTDs or XML Schemas. W3C has elected to + * use complicated compositions of content_models to simulate + * exclusion for children, but we go the simpler, SGML-style + * route of flat-out exclusions, which correctly apply to + * all descendants and not just children. Note that the XHTML + * Modularization Abstract Modules are blithely unaware of such + * distinctions. + */ + public $excludes = array(); + + /** + * This tag is explicitly auto-closed by the following tags. + * @type array + */ + public $autoclose = array(); + + /** + * If a foreign element is found in this element, test if it is + * allowed by this sub-element; if it is, instead of closing the + * current element, place it inside this element. + * @type string + */ + public $wrap; + + /** + * Whether or not this is a formatting element affected by the + * "Active Formatting Elements" algorithm. + * @type bool + */ + public $formatting; + + /** + * Low-level factory constructor for creating new standalone element defs + */ + public static function create($content_model, $content_model_type, $attr) + { + $def = new HTMLPurifier_ElementDef(); + $def->content_model = $content_model; + $def->content_model_type = $content_model_type; + $def->attr = $attr; + return $def; + } + + /** + * Merges the values of another element definition into this one. + * Values from the new element def take precedence if a value is + * not mergeable. + * @param HTMLPurifier_ElementDef $def + */ + public function mergeIn($def) + { + // later keys takes precedence + foreach ($def->attr as $k => $v) { + if ($k === 0) { + // merge in the includes + // sorry, no way to override an include + foreach ($v as $v2) { + $this->attr[0][] = $v2; + } + continue; + } + if ($v === false) { + if (isset($this->attr[$k])) { + unset($this->attr[$k]); + } + continue; + } + $this->attr[$k] = $v; + } + $this->_mergeAssocArray($this->excludes, $def->excludes); + $this->attr_transform_pre = array_merge($this->attr_transform_pre, $def->attr_transform_pre); + $this->attr_transform_post = array_merge($this->attr_transform_post, $def->attr_transform_post); + + if (!empty($def->content_model)) { + $this->content_model = + str_replace("#SUPER", $this->content_model, $def->content_model); + $this->child = false; + } + if (!empty($def->content_model_type)) { + $this->content_model_type = $def->content_model_type; + $this->child = false; + } + if (!is_null($def->child)) { + $this->child = $def->child; + } + if (!is_null($def->formatting)) { + $this->formatting = $def->formatting; + } + if ($def->descendants_are_inline) { + $this->descendants_are_inline = $def->descendants_are_inline; + } + } + + /** + * Merges one array into another, removes values which equal false + * @param $a1 Array by reference that is merged into + * @param $a2 Array that merges into $a1 + */ + private function _mergeAssocArray(&$a1, $a2) + { + foreach ($a2 as $k => $v) { + if ($v === false) { + if (isset($a1[$k])) { + unset($a1[$k]); + } + continue; + } + $a1[$k] = $v; + } + } +} + +// vim: et sw=4 sts=4 diff --git a/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/Encoder.php b/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/Encoder.php similarity index 97% rename from plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/Encoder.php rename to plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/Encoder.php index 3aa00ca..fef9b58 100755 --- a/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/Encoder.php +++ b/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/Encoder.php @@ -1,611 +1,611 @@ -= $c) { - $r .= self::unsafeIconv($in, $out, substr($text, $i)); - break; - } - // wibble the boundary - if (0x80 != (0xC0 & ord($text[$i + $max_chunk_size]))) { - $chunk_size = $max_chunk_size; - } elseif (0x80 != (0xC0 & ord($text[$i + $max_chunk_size - 1]))) { - $chunk_size = $max_chunk_size - 1; - } elseif (0x80 != (0xC0 & ord($text[$i + $max_chunk_size - 2]))) { - $chunk_size = $max_chunk_size - 2; - } elseif (0x80 != (0xC0 & ord($text[$i + $max_chunk_size - 3]))) { - $chunk_size = $max_chunk_size - 3; - } else { - return false; // rather confusing UTF-8... - } - $chunk = substr($text, $i, $chunk_size); // substr doesn't mind overlong lengths - $r .= self::unsafeIconv($in, $out, $chunk); - $i += $chunk_size; - } - return $r; - } else { - return false; - } - } else { - return false; - } - } - - /** - * Cleans a UTF-8 string for well-formedness and SGML validity - * - * It will parse according to UTF-8 and return a valid UTF8 string, with - * non-SGML codepoints excluded. - * - * @param string $str The string to clean - * @param bool $force_php - * @return string - * - * @note Just for reference, the non-SGML code points are 0 to 31 and - * 127 to 159, inclusive. However, we allow code points 9, 10 - * and 13, which are the tab, line feed and carriage return - * respectively. 128 and above the code points map to multibyte - * UTF-8 representations. - * - * @note Fallback code adapted from utf8ToUnicode by Henri Sivonen and - * hsivonen@iki.fi at under the - * LGPL license. Notes on what changed are inside, but in general, - * the original code transformed UTF-8 text into an array of integer - * Unicode codepoints. Understandably, transforming that back to - * a string would be somewhat expensive, so the function was modded to - * directly operate on the string. However, this discourages code - * reuse, and the logic enumerated here would be useful for any - * function that needs to be able to understand UTF-8 characters. - * As of right now, only smart lossless character encoding converters - * would need that, and I'm probably not going to implement them. - * Once again, PHP 6 should solve all our problems. - */ - public static function cleanUTF8($str, $force_php = false) - { - // UTF-8 validity is checked since PHP 4.3.5 - // This is an optimization: if the string is already valid UTF-8, no - // need to do PHP stuff. 99% of the time, this will be the case. - // The regexp matches the XML char production, as well as well as excluding - // non-SGML codepoints U+007F to U+009F - if (preg_match( - '/^[\x{9}\x{A}\x{D}\x{20}-\x{7E}\x{A0}-\x{D7FF}\x{E000}-\x{FFFD}\x{10000}-\x{10FFFF}]*$/Du', - $str - )) { - return $str; - } - - $mState = 0; // cached expected number of octets after the current octet - // until the beginning of the next UTF8 character sequence - $mUcs4 = 0; // cached Unicode character - $mBytes = 1; // cached expected number of octets in the current sequence - - // original code involved an $out that was an array of Unicode - // codepoints. Instead of having to convert back into UTF-8, we've - // decided to directly append valid UTF-8 characters onto a string - // $out once they're done. $char accumulates raw bytes, while $mUcs4 - // turns into the Unicode code point, so there's some redundancy. - - $out = ''; - $char = ''; - - $len = strlen($str); - for ($i = 0; $i < $len; $i++) { - $in = ord($str{$i}); - $char .= $str[$i]; // append byte to char - if (0 == $mState) { - // When mState is zero we expect either a US-ASCII character - // or a multi-octet sequence. - if (0 == (0x80 & ($in))) { - // US-ASCII, pass straight through. - if (($in <= 31 || $in == 127) && - !($in == 9 || $in == 13 || $in == 10) // save \r\t\n - ) { - // control characters, remove - } else { - $out .= $char; - } - // reset - $char = ''; - $mBytes = 1; - } elseif (0xC0 == (0xE0 & ($in))) { - // First octet of 2 octet sequence - $mUcs4 = ($in); - $mUcs4 = ($mUcs4 & 0x1F) << 6; - $mState = 1; - $mBytes = 2; - } elseif (0xE0 == (0xF0 & ($in))) { - // First octet of 3 octet sequence - $mUcs4 = ($in); - $mUcs4 = ($mUcs4 & 0x0F) << 12; - $mState = 2; - $mBytes = 3; - } elseif (0xF0 == (0xF8 & ($in))) { - // First octet of 4 octet sequence - $mUcs4 = ($in); - $mUcs4 = ($mUcs4 & 0x07) << 18; - $mState = 3; - $mBytes = 4; - } elseif (0xF8 == (0xFC & ($in))) { - // First octet of 5 octet sequence. - // - // This is illegal because the encoded codepoint must be - // either: - // (a) not the shortest form or - // (b) outside the Unicode range of 0-0x10FFFF. - // Rather than trying to resynchronize, we will carry on - // until the end of the sequence and let the later error - // handling code catch it. - $mUcs4 = ($in); - $mUcs4 = ($mUcs4 & 0x03) << 24; - $mState = 4; - $mBytes = 5; - } elseif (0xFC == (0xFE & ($in))) { - // First octet of 6 octet sequence, see comments for 5 - // octet sequence. - $mUcs4 = ($in); - $mUcs4 = ($mUcs4 & 1) << 30; - $mState = 5; - $mBytes = 6; - } else { - // Current octet is neither in the US-ASCII range nor a - // legal first octet of a multi-octet sequence. - $mState = 0; - $mUcs4 = 0; - $mBytes = 1; - $char = ''; - } - } else { - // When mState is non-zero, we expect a continuation of the - // multi-octet sequence - if (0x80 == (0xC0 & ($in))) { - // Legal continuation. - $shift = ($mState - 1) * 6; - $tmp = $in; - $tmp = ($tmp & 0x0000003F) << $shift; - $mUcs4 |= $tmp; - - if (0 == --$mState) { - // End of the multi-octet sequence. mUcs4 now contains - // the final Unicode codepoint to be output - - // Check for illegal sequences and codepoints. - - // From Unicode 3.1, non-shortest form is illegal - if (((2 == $mBytes) && ($mUcs4 < 0x0080)) || - ((3 == $mBytes) && ($mUcs4 < 0x0800)) || - ((4 == $mBytes) && ($mUcs4 < 0x10000)) || - (4 < $mBytes) || - // From Unicode 3.2, surrogate characters = illegal - (($mUcs4 & 0xFFFFF800) == 0xD800) || - // Codepoints outside the Unicode range are illegal - ($mUcs4 > 0x10FFFF) - ) { - - } elseif (0xFEFF != $mUcs4 && // omit BOM - // check for valid Char unicode codepoints - ( - 0x9 == $mUcs4 || - 0xA == $mUcs4 || - 0xD == $mUcs4 || - (0x20 <= $mUcs4 && 0x7E >= $mUcs4) || - // 7F-9F is not strictly prohibited by XML, - // but it is non-SGML, and thus we don't allow it - (0xA0 <= $mUcs4 && 0xD7FF >= $mUcs4) || - (0x10000 <= $mUcs4 && 0x10FFFF >= $mUcs4) - ) - ) { - $out .= $char; - } - // initialize UTF8 cache (reset) - $mState = 0; - $mUcs4 = 0; - $mBytes = 1; - $char = ''; - } - } else { - // ((0xC0 & (*in) != 0x80) && (mState != 0)) - // Incomplete multi-octet sequence. - // used to result in complete fail, but we'll reset - $mState = 0; - $mUcs4 = 0; - $mBytes = 1; - $char =''; - } - } - } - return $out; - } - - /** - * Translates a Unicode codepoint into its corresponding UTF-8 character. - * @note Based on Feyd's function at - * , - * which is in public domain. - * @note While we're going to do code point parsing anyway, a good - * optimization would be to refuse to translate code points that - * are non-SGML characters. However, this could lead to duplication. - * @note This is very similar to the unichr function in - * maintenance/generate-entity-file.php (although this is superior, - * due to its sanity checks). - */ - - // +----------+----------+----------+----------+ - // | 33222222 | 22221111 | 111111 | | - // | 10987654 | 32109876 | 54321098 | 76543210 | bit - // +----------+----------+----------+----------+ - // | | | | 0xxxxxxx | 1 byte 0x00000000..0x0000007F - // | | | 110yyyyy | 10xxxxxx | 2 byte 0x00000080..0x000007FF - // | | 1110zzzz | 10yyyyyy | 10xxxxxx | 3 byte 0x00000800..0x0000FFFF - // | 11110www | 10wwzzzz | 10yyyyyy | 10xxxxxx | 4 byte 0x00010000..0x0010FFFF - // +----------+----------+----------+----------+ - // | 00000000 | 00011111 | 11111111 | 11111111 | Theoretical upper limit of legal scalars: 2097151 (0x001FFFFF) - // | 00000000 | 00010000 | 11111111 | 11111111 | Defined upper limit of legal scalar codes - // +----------+----------+----------+----------+ - - public static function unichr($code) - { - if ($code > 1114111 or $code < 0 or - ($code >= 55296 and $code <= 57343) ) { - // bits are set outside the "valid" range as defined - // by UNICODE 4.1.0 - return ''; - } - - $x = $y = $z = $w = 0; - if ($code < 128) { - // regular ASCII character - $x = $code; - } else { - // set up bits for UTF-8 - $x = ($code & 63) | 128; - if ($code < 2048) { - $y = (($code & 2047) >> 6) | 192; - } else { - $y = (($code & 4032) >> 6) | 128; - if ($code < 65536) { - $z = (($code >> 12) & 15) | 224; - } else { - $z = (($code >> 12) & 63) | 128; - $w = (($code >> 18) & 7) | 240; - } - } - } - // set up the actual character - $ret = ''; - if ($w) { - $ret .= chr($w); - } - if ($z) { - $ret .= chr($z); - } - if ($y) { - $ret .= chr($y); - } - $ret .= chr($x); - - return $ret; - } - - /** - * @return bool - */ - public static function iconvAvailable() - { - static $iconv = null; - if ($iconv === null) { - $iconv = function_exists('iconv') && self::testIconvTruncateBug() != self::ICONV_UNUSABLE; - } - return $iconv; - } - - /** - * Convert a string to UTF-8 based on configuration. - * @param string $str The string to convert - * @param HTMLPurifier_Config $config - * @param HTMLPurifier_Context $context - * @return string - */ - public static function convertToUTF8($str, $config, $context) - { - $encoding = $config->get('Core.Encoding'); - if ($encoding === 'utf-8') { - return $str; - } - static $iconv = null; - if ($iconv === null) { - $iconv = self::iconvAvailable(); - } - if ($iconv && !$config->get('Test.ForceNoIconv')) { - // unaffected by bugs, since UTF-8 support all characters - $str = self::unsafeIconv($encoding, 'utf-8//IGNORE', $str); - if ($str === false) { - // $encoding is not a valid encoding - trigger_error('Invalid encoding ' . $encoding, E_USER_ERROR); - return ''; - } - // If the string is bjorked by Shift_JIS or a similar encoding - // that doesn't support all of ASCII, convert the naughty - // characters to their true byte-wise ASCII/UTF-8 equivalents. - $str = strtr($str, self::testEncodingSupportsASCII($encoding)); - return $str; - } elseif ($encoding === 'iso-8859-1') { - $str = utf8_encode($str); - return $str; - } - $bug = HTMLPurifier_Encoder::testIconvTruncateBug(); - if ($bug == self::ICONV_OK) { - trigger_error('Encoding not supported, please install iconv', E_USER_ERROR); - } else { - trigger_error( - 'You have a buggy version of iconv, see https://bugs.php.net/bug.php?id=48147 ' . - 'and http://sourceware.org/bugzilla/show_bug.cgi?id=13541', - E_USER_ERROR - ); - } - } - - /** - * Converts a string from UTF-8 based on configuration. - * @param string $str The string to convert - * @param HTMLPurifier_Config $config - * @param HTMLPurifier_Context $context - * @return string - * @note Currently, this is a lossy conversion, with unexpressable - * characters being omitted. - */ - public static function convertFromUTF8($str, $config, $context) - { - $encoding = $config->get('Core.Encoding'); - if ($escape = $config->get('Core.EscapeNonASCIICharacters')) { - $str = self::convertToASCIIDumbLossless($str); - } - if ($encoding === 'utf-8') { - return $str; - } - static $iconv = null; - if ($iconv === null) { - $iconv = self::iconvAvailable(); - } - if ($iconv && !$config->get('Test.ForceNoIconv')) { - // Undo our previous fix in convertToUTF8, otherwise iconv will barf - $ascii_fix = self::testEncodingSupportsASCII($encoding); - if (!$escape && !empty($ascii_fix)) { - $clear_fix = array(); - foreach ($ascii_fix as $utf8 => $native) { - $clear_fix[$utf8] = ''; - } - $str = strtr($str, $clear_fix); - } - $str = strtr($str, array_flip($ascii_fix)); - // Normal stuff - $str = self::iconv('utf-8', $encoding . '//IGNORE', $str); - return $str; - } elseif ($encoding === 'iso-8859-1') { - $str = utf8_decode($str); - return $str; - } - trigger_error('Encoding not supported', E_USER_ERROR); - // You might be tempted to assume that the ASCII representation - // might be OK, however, this is *not* universally true over all - // encodings. So we take the conservative route here, rather - // than forcibly turn on %Core.EscapeNonASCIICharacters - } - - /** - * Lossless (character-wise) conversion of HTML to ASCII - * @param string $str UTF-8 string to be converted to ASCII - * @return string ASCII encoded string with non-ASCII character entity-ized - * @warning Adapted from MediaWiki, claiming fair use: this is a common - * algorithm. If you disagree with this license fudgery, - * implement it yourself. - * @note Uses decimal numeric entities since they are best supported. - * @note This is a DUMB function: it has no concept of keeping - * character entities that the projected character encoding - * can allow. We could possibly implement a smart version - * but that would require it to also know which Unicode - * codepoints the charset supported (not an easy task). - * @note Sort of with cleanUTF8() but it assumes that $str is - * well-formed UTF-8 - */ - public static function convertToASCIIDumbLossless($str) - { - $bytesleft = 0; - $result = ''; - $working = 0; - $len = strlen($str); - for ($i = 0; $i < $len; $i++) { - $bytevalue = ord($str[$i]); - if ($bytevalue <= 0x7F) { //0xxx xxxx - $result .= chr($bytevalue); - $bytesleft = 0; - } elseif ($bytevalue <= 0xBF) { //10xx xxxx - $working = $working << 6; - $working += ($bytevalue & 0x3F); - $bytesleft--; - if ($bytesleft <= 0) { - $result .= "&#" . $working . ";"; - } - } elseif ($bytevalue <= 0xDF) { //110x xxxx - $working = $bytevalue & 0x1F; - $bytesleft = 1; - } elseif ($bytevalue <= 0xEF) { //1110 xxxx - $working = $bytevalue & 0x0F; - $bytesleft = 2; - } else { //1111 0xxx - $working = $bytevalue & 0x07; - $bytesleft = 3; - } - } - return $result; - } - - /** No bugs detected in iconv. */ - const ICONV_OK = 0; - - /** Iconv truncates output if converting from UTF-8 to another - * character set with //IGNORE, and a non-encodable character is found */ - const ICONV_TRUNCATES = 1; - - /** Iconv does not support //IGNORE, making it unusable for - * transcoding purposes */ - const ICONV_UNUSABLE = 2; - - /** - * glibc iconv has a known bug where it doesn't handle the magic - * //IGNORE stanza correctly. In particular, rather than ignore - * characters, it will return an EILSEQ after consuming some number - * of characters, and expect you to restart iconv as if it were - * an E2BIG. Old versions of PHP did not respect the errno, and - * returned the fragment, so as a result you would see iconv - * mysteriously truncating output. We can work around this by - * manually chopping our input into segments of about 8000 - * characters, as long as PHP ignores the error code. If PHP starts - * paying attention to the error code, iconv becomes unusable. - * - * @return int Error code indicating severity of bug. - */ - public static function testIconvTruncateBug() - { - static $code = null; - if ($code === null) { - // better not use iconv, otherwise infinite loop! - $r = self::unsafeIconv('utf-8', 'ascii//IGNORE', "\xCE\xB1" . str_repeat('a', 9000)); - if ($r === false) { - $code = self::ICONV_UNUSABLE; - } elseif (($c = strlen($r)) < 9000) { - $code = self::ICONV_TRUNCATES; - } elseif ($c > 9000) { - trigger_error( - 'Your copy of iconv is extremely buggy. Please notify HTML Purifier maintainers: ' . - 'include your iconv version as per phpversion()', - E_USER_ERROR - ); - } else { - $code = self::ICONV_OK; - } - } - return $code; - } - - /** - * This expensive function tests whether or not a given character - * encoding supports ASCII. 7/8-bit encodings like Shift_JIS will - * fail this test, and require special processing. Variable width - * encodings shouldn't ever fail. - * - * @param string $encoding Encoding name to test, as per iconv format - * @param bool $bypass Whether or not to bypass the precompiled arrays. - * @return Array of UTF-8 characters to their corresponding ASCII, - * which can be used to "undo" any overzealous iconv action. - */ - public static function testEncodingSupportsASCII($encoding, $bypass = false) - { - // All calls to iconv here are unsafe, proof by case analysis: - // If ICONV_OK, no difference. - // If ICONV_TRUNCATE, all calls involve one character inputs, - // so bug is not triggered. - // If ICONV_UNUSABLE, this call is irrelevant - static $encodings = array(); - if (!$bypass) { - if (isset($encodings[$encoding])) { - return $encodings[$encoding]; - } - $lenc = strtolower($encoding); - switch ($lenc) { - case 'shift_jis': - return array("\xC2\xA5" => '\\', "\xE2\x80\xBE" => '~'); - case 'johab': - return array("\xE2\x82\xA9" => '\\'); - } - if (strpos($lenc, 'iso-8859-') === 0) { - return array(); - } - } - $ret = array(); - if (self::unsafeIconv('UTF-8', $encoding, 'a') === false) { - return false; - } - for ($i = 0x20; $i <= 0x7E; $i++) { // all printable ASCII chars - $c = chr($i); // UTF-8 char - $r = self::unsafeIconv('UTF-8', "$encoding//IGNORE", $c); // initial conversion - if ($r === '' || - // This line is needed for iconv implementations that do not - // omit characters that do not exist in the target character set - ($r === $c && self::unsafeIconv($encoding, 'UTF-8//IGNORE', $r) !== $c) - ) { - // Reverse engineer: what's the UTF-8 equiv of this byte - // sequence? This assumes that there's no variable width - // encoding that doesn't support ASCII. - $ret[self::unsafeIconv($encoding, 'UTF-8//IGNORE', $c)] = $c; - } - } - $encodings[$encoding] = $ret; - return $ret; - } -} - -// vim: et sw=4 sts=4 += $c) { + $r .= self::unsafeIconv($in, $out, substr($text, $i)); + break; + } + // wibble the boundary + if (0x80 != (0xC0 & ord($text[$i + $max_chunk_size]))) { + $chunk_size = $max_chunk_size; + } elseif (0x80 != (0xC0 & ord($text[$i + $max_chunk_size - 1]))) { + $chunk_size = $max_chunk_size - 1; + } elseif (0x80 != (0xC0 & ord($text[$i + $max_chunk_size - 2]))) { + $chunk_size = $max_chunk_size - 2; + } elseif (0x80 != (0xC0 & ord($text[$i + $max_chunk_size - 3]))) { + $chunk_size = $max_chunk_size - 3; + } else { + return false; // rather confusing UTF-8... + } + $chunk = substr($text, $i, $chunk_size); // substr doesn't mind overlong lengths + $r .= self::unsafeIconv($in, $out, $chunk); + $i += $chunk_size; + } + return $r; + } else { + return false; + } + } else { + return false; + } + } + + /** + * Cleans a UTF-8 string for well-formedness and SGML validity + * + * It will parse according to UTF-8 and return a valid UTF8 string, with + * non-SGML codepoints excluded. + * + * @param string $str The string to clean + * @param bool $force_php + * @return string + * + * @note Just for reference, the non-SGML code points are 0 to 31 and + * 127 to 159, inclusive. However, we allow code points 9, 10 + * and 13, which are the tab, line feed and carriage return + * respectively. 128 and above the code points map to multibyte + * UTF-8 representations. + * + * @note Fallback code adapted from utf8ToUnicode by Henri Sivonen and + * hsivonen@iki.fi at under the + * LGPL license. Notes on what changed are inside, but in general, + * the original code transformed UTF-8 text into an array of integer + * Unicode codepoints. Understandably, transforming that back to + * a string would be somewhat expensive, so the function was modded to + * directly operate on the string. However, this discourages code + * reuse, and the logic enumerated here would be useful for any + * function that needs to be able to understand UTF-8 characters. + * As of right now, only smart lossless character encoding converters + * would need that, and I'm probably not going to implement them. + * Once again, PHP 6 should solve all our problems. + */ + public static function cleanUTF8($str, $force_php = false) + { + // UTF-8 validity is checked since PHP 4.3.5 + // This is an optimization: if the string is already valid UTF-8, no + // need to do PHP stuff. 99% of the time, this will be the case. + // The regexp matches the XML char production, as well as well as excluding + // non-SGML codepoints U+007F to U+009F + if (preg_match( + '/^[\x{9}\x{A}\x{D}\x{20}-\x{7E}\x{A0}-\x{D7FF}\x{E000}-\x{FFFD}\x{10000}-\x{10FFFF}]*$/Du', + $str + )) { + return $str; + } + + $mState = 0; // cached expected number of octets after the current octet + // until the beginning of the next UTF8 character sequence + $mUcs4 = 0; // cached Unicode character + $mBytes = 1; // cached expected number of octets in the current sequence + + // original code involved an $out that was an array of Unicode + // codepoints. Instead of having to convert back into UTF-8, we've + // decided to directly append valid UTF-8 characters onto a string + // $out once they're done. $char accumulates raw bytes, while $mUcs4 + // turns into the Unicode code point, so there's some redundancy. + + $out = ''; + $char = ''; + + $len = strlen($str); + for ($i = 0; $i < $len; $i++) { + $in = ord($str{$i}); + $char .= $str[$i]; // append byte to char + if (0 == $mState) { + // When mState is zero we expect either a US-ASCII character + // or a multi-octet sequence. + if (0 == (0x80 & ($in))) { + // US-ASCII, pass straight through. + if (($in <= 31 || $in == 127) && + !($in == 9 || $in == 13 || $in == 10) // save \r\t\n + ) { + // control characters, remove + } else { + $out .= $char; + } + // reset + $char = ''; + $mBytes = 1; + } elseif (0xC0 == (0xE0 & ($in))) { + // First octet of 2 octet sequence + $mUcs4 = ($in); + $mUcs4 = ($mUcs4 & 0x1F) << 6; + $mState = 1; + $mBytes = 2; + } elseif (0xE0 == (0xF0 & ($in))) { + // First octet of 3 octet sequence + $mUcs4 = ($in); + $mUcs4 = ($mUcs4 & 0x0F) << 12; + $mState = 2; + $mBytes = 3; + } elseif (0xF0 == (0xF8 & ($in))) { + // First octet of 4 octet sequence + $mUcs4 = ($in); + $mUcs4 = ($mUcs4 & 0x07) << 18; + $mState = 3; + $mBytes = 4; + } elseif (0xF8 == (0xFC & ($in))) { + // First octet of 5 octet sequence. + // + // This is illegal because the encoded codepoint must be + // either: + // (a) not the shortest form or + // (b) outside the Unicode range of 0-0x10FFFF. + // Rather than trying to resynchronize, we will carry on + // until the end of the sequence and let the later error + // handling code catch it. + $mUcs4 = ($in); + $mUcs4 = ($mUcs4 & 0x03) << 24; + $mState = 4; + $mBytes = 5; + } elseif (0xFC == (0xFE & ($in))) { + // First octet of 6 octet sequence, see comments for 5 + // octet sequence. + $mUcs4 = ($in); + $mUcs4 = ($mUcs4 & 1) << 30; + $mState = 5; + $mBytes = 6; + } else { + // Current octet is neither in the US-ASCII range nor a + // legal first octet of a multi-octet sequence. + $mState = 0; + $mUcs4 = 0; + $mBytes = 1; + $char = ''; + } + } else { + // When mState is non-zero, we expect a continuation of the + // multi-octet sequence + if (0x80 == (0xC0 & ($in))) { + // Legal continuation. + $shift = ($mState - 1) * 6; + $tmp = $in; + $tmp = ($tmp & 0x0000003F) << $shift; + $mUcs4 |= $tmp; + + if (0 == --$mState) { + // End of the multi-octet sequence. mUcs4 now contains + // the final Unicode codepoint to be output + + // Check for illegal sequences and codepoints. + + // From Unicode 3.1, non-shortest form is illegal + if (((2 == $mBytes) && ($mUcs4 < 0x0080)) || + ((3 == $mBytes) && ($mUcs4 < 0x0800)) || + ((4 == $mBytes) && ($mUcs4 < 0x10000)) || + (4 < $mBytes) || + // From Unicode 3.2, surrogate characters = illegal + (($mUcs4 & 0xFFFFF800) == 0xD800) || + // Codepoints outside the Unicode range are illegal + ($mUcs4 > 0x10FFFF) + ) { + + } elseif (0xFEFF != $mUcs4 && // omit BOM + // check for valid Char unicode codepoints + ( + 0x9 == $mUcs4 || + 0xA == $mUcs4 || + 0xD == $mUcs4 || + (0x20 <= $mUcs4 && 0x7E >= $mUcs4) || + // 7F-9F is not strictly prohibited by XML, + // but it is non-SGML, and thus we don't allow it + (0xA0 <= $mUcs4 && 0xD7FF >= $mUcs4) || + (0x10000 <= $mUcs4 && 0x10FFFF >= $mUcs4) + ) + ) { + $out .= $char; + } + // initialize UTF8 cache (reset) + $mState = 0; + $mUcs4 = 0; + $mBytes = 1; + $char = ''; + } + } else { + // ((0xC0 & (*in) != 0x80) && (mState != 0)) + // Incomplete multi-octet sequence. + // used to result in complete fail, but we'll reset + $mState = 0; + $mUcs4 = 0; + $mBytes = 1; + $char =''; + } + } + } + return $out; + } + + /** + * Translates a Unicode codepoint into its corresponding UTF-8 character. + * @note Based on Feyd's function at + * , + * which is in public domain. + * @note While we're going to do code point parsing anyway, a good + * optimization would be to refuse to translate code points that + * are non-SGML characters. However, this could lead to duplication. + * @note This is very similar to the unichr function in + * maintenance/generate-entity-file.php (although this is superior, + * due to its sanity checks). + */ + + // +----------+----------+----------+----------+ + // | 33222222 | 22221111 | 111111 | | + // | 10987654 | 32109876 | 54321098 | 76543210 | bit + // +----------+----------+----------+----------+ + // | | | | 0xxxxxxx | 1 byte 0x00000000..0x0000007F + // | | | 110yyyyy | 10xxxxxx | 2 byte 0x00000080..0x000007FF + // | | 1110zzzz | 10yyyyyy | 10xxxxxx | 3 byte 0x00000800..0x0000FFFF + // | 11110www | 10wwzzzz | 10yyyyyy | 10xxxxxx | 4 byte 0x00010000..0x0010FFFF + // +----------+----------+----------+----------+ + // | 00000000 | 00011111 | 11111111 | 11111111 | Theoretical upper limit of legal scalars: 2097151 (0x001FFFFF) + // | 00000000 | 00010000 | 11111111 | 11111111 | Defined upper limit of legal scalar codes + // +----------+----------+----------+----------+ + + public static function unichr($code) + { + if ($code > 1114111 or $code < 0 or + ($code >= 55296 and $code <= 57343) ) { + // bits are set outside the "valid" range as defined + // by UNICODE 4.1.0 + return ''; + } + + $x = $y = $z = $w = 0; + if ($code < 128) { + // regular ASCII character + $x = $code; + } else { + // set up bits for UTF-8 + $x = ($code & 63) | 128; + if ($code < 2048) { + $y = (($code & 2047) >> 6) | 192; + } else { + $y = (($code & 4032) >> 6) | 128; + if ($code < 65536) { + $z = (($code >> 12) & 15) | 224; + } else { + $z = (($code >> 12) & 63) | 128; + $w = (($code >> 18) & 7) | 240; + } + } + } + // set up the actual character + $ret = ''; + if ($w) { + $ret .= chr($w); + } + if ($z) { + $ret .= chr($z); + } + if ($y) { + $ret .= chr($y); + } + $ret .= chr($x); + + return $ret; + } + + /** + * @return bool + */ + public static function iconvAvailable() + { + static $iconv = null; + if ($iconv === null) { + $iconv = function_exists('iconv') && self::testIconvTruncateBug() != self::ICONV_UNUSABLE; + } + return $iconv; + } + + /** + * Convert a string to UTF-8 based on configuration. + * @param string $str The string to convert + * @param HTMLPurifier_Config $config + * @param HTMLPurifier_Context $context + * @return string + */ + public static function convertToUTF8($str, $config, $context) + { + $encoding = $config->get('Core.Encoding'); + if ($encoding === 'utf-8') { + return $str; + } + static $iconv = null; + if ($iconv === null) { + $iconv = self::iconvAvailable(); + } + if ($iconv && !$config->get('Test.ForceNoIconv')) { + // unaffected by bugs, since UTF-8 support all characters + $str = self::unsafeIconv($encoding, 'utf-8//IGNORE', $str); + if ($str === false) { + // $encoding is not a valid encoding + trigger_error('Invalid encoding ' . $encoding, E_USER_ERROR); + return ''; + } + // If the string is bjorked by Shift_JIS or a similar encoding + // that doesn't support all of ASCII, convert the naughty + // characters to their true byte-wise ASCII/UTF-8 equivalents. + $str = strtr($str, self::testEncodingSupportsASCII($encoding)); + return $str; + } elseif ($encoding === 'iso-8859-1') { + $str = utf8_encode($str); + return $str; + } + $bug = HTMLPurifier_Encoder::testIconvTruncateBug(); + if ($bug == self::ICONV_OK) { + trigger_error('Encoding not supported, please install iconv', E_USER_ERROR); + } else { + trigger_error( + 'You have a buggy version of iconv, see https://bugs.php.net/bug.php?id=48147 ' . + 'and http://sourceware.org/bugzilla/show_bug.cgi?id=13541', + E_USER_ERROR + ); + } + } + + /** + * Converts a string from UTF-8 based on configuration. + * @param string $str The string to convert + * @param HTMLPurifier_Config $config + * @param HTMLPurifier_Context $context + * @return string + * @note Currently, this is a lossy conversion, with unexpressable + * characters being omitted. + */ + public static function convertFromUTF8($str, $config, $context) + { + $encoding = $config->get('Core.Encoding'); + if ($escape = $config->get('Core.EscapeNonASCIICharacters')) { + $str = self::convertToASCIIDumbLossless($str); + } + if ($encoding === 'utf-8') { + return $str; + } + static $iconv = null; + if ($iconv === null) { + $iconv = self::iconvAvailable(); + } + if ($iconv && !$config->get('Test.ForceNoIconv')) { + // Undo our previous fix in convertToUTF8, otherwise iconv will barf + $ascii_fix = self::testEncodingSupportsASCII($encoding); + if (!$escape && !empty($ascii_fix)) { + $clear_fix = array(); + foreach ($ascii_fix as $utf8 => $native) { + $clear_fix[$utf8] = ''; + } + $str = strtr($str, $clear_fix); + } + $str = strtr($str, array_flip($ascii_fix)); + // Normal stuff + $str = self::iconv('utf-8', $encoding . '//IGNORE', $str); + return $str; + } elseif ($encoding === 'iso-8859-1') { + $str = utf8_decode($str); + return $str; + } + trigger_error('Encoding not supported', E_USER_ERROR); + // You might be tempted to assume that the ASCII representation + // might be OK, however, this is *not* universally true over all + // encodings. So we take the conservative route here, rather + // than forcibly turn on %Core.EscapeNonASCIICharacters + } + + /** + * Lossless (character-wise) conversion of HTML to ASCII + * @param string $str UTF-8 string to be converted to ASCII + * @return string ASCII encoded string with non-ASCII character entity-ized + * @warning Adapted from MediaWiki, claiming fair use: this is a common + * algorithm. If you disagree with this license fudgery, + * implement it yourself. + * @note Uses decimal numeric entities since they are best supported. + * @note This is a DUMB function: it has no concept of keeping + * character entities that the projected character encoding + * can allow. We could possibly implement a smart version + * but that would require it to also know which Unicode + * codepoints the charset supported (not an easy task). + * @note Sort of with cleanUTF8() but it assumes that $str is + * well-formed UTF-8 + */ + public static function convertToASCIIDumbLossless($str) + { + $bytesleft = 0; + $result = ''; + $working = 0; + $len = strlen($str); + for ($i = 0; $i < $len; $i++) { + $bytevalue = ord($str[$i]); + if ($bytevalue <= 0x7F) { //0xxx xxxx + $result .= chr($bytevalue); + $bytesleft = 0; + } elseif ($bytevalue <= 0xBF) { //10xx xxxx + $working = $working << 6; + $working += ($bytevalue & 0x3F); + $bytesleft--; + if ($bytesleft <= 0) { + $result .= "&#" . $working . ";"; + } + } elseif ($bytevalue <= 0xDF) { //110x xxxx + $working = $bytevalue & 0x1F; + $bytesleft = 1; + } elseif ($bytevalue <= 0xEF) { //1110 xxxx + $working = $bytevalue & 0x0F; + $bytesleft = 2; + } else { //1111 0xxx + $working = $bytevalue & 0x07; + $bytesleft = 3; + } + } + return $result; + } + + /** No bugs detected in iconv. */ + const ICONV_OK = 0; + + /** Iconv truncates output if converting from UTF-8 to another + * character set with //IGNORE, and a non-encodable character is found */ + const ICONV_TRUNCATES = 1; + + /** Iconv does not support //IGNORE, making it unusable for + * transcoding purposes */ + const ICONV_UNUSABLE = 2; + + /** + * glibc iconv has a known bug where it doesn't handle the magic + * //IGNORE stanza correctly. In particular, rather than ignore + * characters, it will return an EILSEQ after consuming some number + * of characters, and expect you to restart iconv as if it were + * an E2BIG. Old versions of PHP did not respect the errno, and + * returned the fragment, so as a result you would see iconv + * mysteriously truncating output. We can work around this by + * manually chopping our input into segments of about 8000 + * characters, as long as PHP ignores the error code. If PHP starts + * paying attention to the error code, iconv becomes unusable. + * + * @return int Error code indicating severity of bug. + */ + public static function testIconvTruncateBug() + { + static $code = null; + if ($code === null) { + // better not use iconv, otherwise infinite loop! + $r = self::unsafeIconv('utf-8', 'ascii//IGNORE', "\xCE\xB1" . str_repeat('a', 9000)); + if ($r === false) { + $code = self::ICONV_UNUSABLE; + } elseif (($c = strlen($r)) < 9000) { + $code = self::ICONV_TRUNCATES; + } elseif ($c > 9000) { + trigger_error( + 'Your copy of iconv is extremely buggy. Please notify HTML Purifier maintainers: ' . + 'include your iconv version as per phpversion()', + E_USER_ERROR + ); + } else { + $code = self::ICONV_OK; + } + } + return $code; + } + + /** + * This expensive function tests whether or not a given character + * encoding supports ASCII. 7/8-bit encodings like Shift_JIS will + * fail this test, and require special processing. Variable width + * encodings shouldn't ever fail. + * + * @param string $encoding Encoding name to test, as per iconv format + * @param bool $bypass Whether or not to bypass the precompiled arrays. + * @return Array of UTF-8 characters to their corresponding ASCII, + * which can be used to "undo" any overzealous iconv action. + */ + public static function testEncodingSupportsASCII($encoding, $bypass = false) + { + // All calls to iconv here are unsafe, proof by case analysis: + // If ICONV_OK, no difference. + // If ICONV_TRUNCATE, all calls involve one character inputs, + // so bug is not triggered. + // If ICONV_UNUSABLE, this call is irrelevant + static $encodings = array(); + if (!$bypass) { + if (isset($encodings[$encoding])) { + return $encodings[$encoding]; + } + $lenc = strtolower($encoding); + switch ($lenc) { + case 'shift_jis': + return array("\xC2\xA5" => '\\', "\xE2\x80\xBE" => '~'); + case 'johab': + return array("\xE2\x82\xA9" => '\\'); + } + if (strpos($lenc, 'iso-8859-') === 0) { + return array(); + } + } + $ret = array(); + if (self::unsafeIconv('UTF-8', $encoding, 'a') === false) { + return false; + } + for ($i = 0x20; $i <= 0x7E; $i++) { // all printable ASCII chars + $c = chr($i); // UTF-8 char + $r = self::unsafeIconv('UTF-8', "$encoding//IGNORE", $c); // initial conversion + if ($r === '' || + // This line is needed for iconv implementations that do not + // omit characters that do not exist in the target character set + ($r === $c && self::unsafeIconv($encoding, 'UTF-8//IGNORE', $r) !== $c) + ) { + // Reverse engineer: what's the UTF-8 equiv of this byte + // sequence? This assumes that there's no variable width + // encoding that doesn't support ASCII. + $ret[self::unsafeIconv($encoding, 'UTF-8//IGNORE', $c)] = $c; + } + } + $encodings[$encoding] = $ret; + return $ret; + } +} + +// vim: et sw=4 sts=4 diff --git a/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/EntityLookup.php b/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/EntityLookup.php similarity index 96% rename from plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/EntityLookup.php rename to plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/EntityLookup.php index cb3474e..f12ff13 100755 --- a/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/EntityLookup.php +++ b/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/EntityLookup.php @@ -1,48 +1,48 @@ -table = unserialize(file_get_contents($file)); - } - - /** - * Retrieves sole instance of the object. - * @param bool|HTMLPurifier_EntityLookup $prototype Optional prototype of custom lookup table to overload with. - * @return HTMLPurifier_EntityLookup - */ - public static function instance($prototype = false) - { - // no references, since PHP doesn't copy unless modified - static $instance = null; - if ($prototype) { - $instance = $prototype; - } elseif (!$instance) { - $instance = new HTMLPurifier_EntityLookup(); - $instance->setup(); - } - return $instance; - } -} - -// vim: et sw=4 sts=4 +table = unserialize(file_get_contents($file)); + } + + /** + * Retrieves sole instance of the object. + * @param bool|HTMLPurifier_EntityLookup $prototype Optional prototype of custom lookup table to overload with. + * @return HTMLPurifier_EntityLookup + */ + public static function instance($prototype = false) + { + // no references, since PHP doesn't copy unless modified + static $instance = null; + if ($prototype) { + $instance = $prototype; + } elseif (!$instance) { + $instance = new HTMLPurifier_EntityLookup(); + $instance->setup(); + } + return $instance; + } +} + +// vim: et sw=4 sts=4 diff --git a/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/EntityLookup/entities.ser b/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/EntityLookup/entities.ser similarity index 100% rename from plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/EntityLookup/entities.ser rename to plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/EntityLookup/entities.ser diff --git a/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/EntityParser.php b/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/EntityParser.php similarity index 97% rename from plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/EntityParser.php rename to plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/EntityParser.php index 432a4f9..61529dc 100755 --- a/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/EntityParser.php +++ b/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/EntityParser.php @@ -1,153 +1,153 @@ - '"', - 38 => '&', - 39 => "'", - 60 => '<', - 62 => '>' - ); - - /** - * Stripped entity names to decimal conversion table for special entities. - * @type array - */ - protected $_special_ent2dec = - array( - 'quot' => 34, - 'amp' => 38, - 'lt' => 60, - 'gt' => 62 - ); - - /** - * Substitutes non-special entities with their parsed equivalents. Since - * running this whenever you have parsed character is t3h 5uck, we run - * it before everything else. - * - * @param string $string String to have non-special entities parsed. - * @return string Parsed string. - */ - public function substituteNonSpecialEntities($string) - { - // it will try to detect missing semicolons, but don't rely on it - return preg_replace_callback( - $this->_substituteEntitiesRegex, - array($this, 'nonSpecialEntityCallback'), - $string - ); - } - - /** - * Callback function for substituteNonSpecialEntities() that does the work. - * - * @param array $matches PCRE matches array, with 0 the entire match, and - * either index 1, 2 or 3 set with a hex value, dec value, - * or string (respectively). - * @return string Replacement string. - */ - - protected function nonSpecialEntityCallback($matches) - { - // replaces all but big five - $entity = $matches[0]; - $is_num = (@$matches[0][1] === '#'); - if ($is_num) { - $is_hex = (@$entity[2] === 'x'); - $code = $is_hex ? hexdec($matches[1]) : (int) $matches[2]; - // abort for special characters - if (isset($this->_special_dec2str[$code])) { - return $entity; - } - return HTMLPurifier_Encoder::unichr($code); - } else { - if (isset($this->_special_ent2dec[$matches[3]])) { - return $entity; - } - if (!$this->_entity_lookup) { - $this->_entity_lookup = HTMLPurifier_EntityLookup::instance(); - } - if (isset($this->_entity_lookup->table[$matches[3]])) { - return $this->_entity_lookup->table[$matches[3]]; - } else { - return $entity; - } - } - } - - /** - * Substitutes only special entities with their parsed equivalents. - * - * @notice We try to avoid calling this function because otherwise, it - * would have to be called a lot (for every parsed section). - * - * @param string $string String to have non-special entities parsed. - * @return string Parsed string. - */ - public function substituteSpecialEntities($string) - { - return preg_replace_callback( - $this->_substituteEntitiesRegex, - array($this, 'specialEntityCallback'), - $string - ); - } - - /** - * Callback function for substituteSpecialEntities() that does the work. - * - * This callback has same syntax as nonSpecialEntityCallback(). - * - * @param array $matches PCRE-style matches array, with 0 the entire match, and - * either index 1, 2 or 3 set with a hex value, dec value, - * or string (respectively). - * @return string Replacement string. - */ - protected function specialEntityCallback($matches) - { - $entity = $matches[0]; - $is_num = (@$matches[0][1] === '#'); - if ($is_num) { - $is_hex = (@$entity[2] === 'x'); - $int = $is_hex ? hexdec($matches[1]) : (int) $matches[2]; - return isset($this->_special_dec2str[$int]) ? - $this->_special_dec2str[$int] : - $entity; - } else { - return isset($this->_special_ent2dec[$matches[3]]) ? - $this->_special_ent2dec[$matches[3]] : - $entity; - } - } -} - -// vim: et sw=4 sts=4 + '"', + 38 => '&', + 39 => "'", + 60 => '<', + 62 => '>' + ); + + /** + * Stripped entity names to decimal conversion table for special entities. + * @type array + */ + protected $_special_ent2dec = + array( + 'quot' => 34, + 'amp' => 38, + 'lt' => 60, + 'gt' => 62 + ); + + /** + * Substitutes non-special entities with their parsed equivalents. Since + * running this whenever you have parsed character is t3h 5uck, we run + * it before everything else. + * + * @param string $string String to have non-special entities parsed. + * @return string Parsed string. + */ + public function substituteNonSpecialEntities($string) + { + // it will try to detect missing semicolons, but don't rely on it + return preg_replace_callback( + $this->_substituteEntitiesRegex, + array($this, 'nonSpecialEntityCallback'), + $string + ); + } + + /** + * Callback function for substituteNonSpecialEntities() that does the work. + * + * @param array $matches PCRE matches array, with 0 the entire match, and + * either index 1, 2 or 3 set with a hex value, dec value, + * or string (respectively). + * @return string Replacement string. + */ + + protected function nonSpecialEntityCallback($matches) + { + // replaces all but big five + $entity = $matches[0]; + $is_num = (@$matches[0][1] === '#'); + if ($is_num) { + $is_hex = (@$entity[2] === 'x'); + $code = $is_hex ? hexdec($matches[1]) : (int) $matches[2]; + // abort for special characters + if (isset($this->_special_dec2str[$code])) { + return $entity; + } + return HTMLPurifier_Encoder::unichr($code); + } else { + if (isset($this->_special_ent2dec[$matches[3]])) { + return $entity; + } + if (!$this->_entity_lookup) { + $this->_entity_lookup = HTMLPurifier_EntityLookup::instance(); + } + if (isset($this->_entity_lookup->table[$matches[3]])) { + return $this->_entity_lookup->table[$matches[3]]; + } else { + return $entity; + } + } + } + + /** + * Substitutes only special entities with their parsed equivalents. + * + * @notice We try to avoid calling this function because otherwise, it + * would have to be called a lot (for every parsed section). + * + * @param string $string String to have non-special entities parsed. + * @return string Parsed string. + */ + public function substituteSpecialEntities($string) + { + return preg_replace_callback( + $this->_substituteEntitiesRegex, + array($this, 'specialEntityCallback'), + $string + ); + } + + /** + * Callback function for substituteSpecialEntities() that does the work. + * + * This callback has same syntax as nonSpecialEntityCallback(). + * + * @param array $matches PCRE-style matches array, with 0 the entire match, and + * either index 1, 2 or 3 set with a hex value, dec value, + * or string (respectively). + * @return string Replacement string. + */ + protected function specialEntityCallback($matches) + { + $entity = $matches[0]; + $is_num = (@$matches[0][1] === '#'); + if ($is_num) { + $is_hex = (@$entity[2] === 'x'); + $int = $is_hex ? hexdec($matches[1]) : (int) $matches[2]; + return isset($this->_special_dec2str[$int]) ? + $this->_special_dec2str[$int] : + $entity; + } else { + return isset($this->_special_ent2dec[$matches[3]]) ? + $this->_special_ent2dec[$matches[3]] : + $entity; + } + } +} + +// vim: et sw=4 sts=4 diff --git a/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/ErrorCollector.php b/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/ErrorCollector.php similarity index 96% rename from plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/ErrorCollector.php rename to plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/ErrorCollector.php index a6cbcaa..d47e3f2 100755 --- a/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/ErrorCollector.php +++ b/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/ErrorCollector.php @@ -1,244 +1,244 @@ -locale =& $context->get('Locale'); - $this->context = $context; - $this->_current =& $this->_stacks[0]; - $this->errors =& $this->_stacks[0]; - } - - /** - * Sends an error message to the collector for later use - * @param int $severity Error severity, PHP error style (don't use E_USER_) - * @param string $msg Error message text - */ - public function send($severity, $msg) - { - $args = array(); - if (func_num_args() > 2) { - $args = func_get_args(); - array_shift($args); - unset($args[0]); - } - - $token = $this->context->get('CurrentToken', true); - $line = $token ? $token->line : $this->context->get('CurrentLine', true); - $col = $token ? $token->col : $this->context->get('CurrentCol', true); - $attr = $this->context->get('CurrentAttr', true); - - // perform special substitutions, also add custom parameters - $subst = array(); - if (!is_null($token)) { - $args['CurrentToken'] = $token; - } - if (!is_null($attr)) { - $subst['$CurrentAttr.Name'] = $attr; - if (isset($token->attr[$attr])) { - $subst['$CurrentAttr.Value'] = $token->attr[$attr]; - } - } - - if (empty($args)) { - $msg = $this->locale->getMessage($msg); - } else { - $msg = $this->locale->formatMessage($msg, $args); - } - - if (!empty($subst)) { - $msg = strtr($msg, $subst); - } - - // (numerically indexed) - $error = array( - self::LINENO => $line, - self::SEVERITY => $severity, - self::MESSAGE => $msg, - self::CHILDREN => array() - ); - $this->_current[] = $error; - - // NEW CODE BELOW ... - // Top-level errors are either: - // TOKEN type, if $value is set appropriately, or - // "syntax" type, if $value is null - $new_struct = new HTMLPurifier_ErrorStruct(); - $new_struct->type = HTMLPurifier_ErrorStruct::TOKEN; - if ($token) { - $new_struct->value = clone $token; - } - if (is_int($line) && is_int($col)) { - if (isset($this->lines[$line][$col])) { - $struct = $this->lines[$line][$col]; - } else { - $struct = $this->lines[$line][$col] = $new_struct; - } - // These ksorts may present a performance problem - ksort($this->lines[$line], SORT_NUMERIC); - } else { - if (isset($this->lines[-1])) { - $struct = $this->lines[-1]; - } else { - $struct = $this->lines[-1] = $new_struct; - } - } - ksort($this->lines, SORT_NUMERIC); - - // Now, check if we need to operate on a lower structure - if (!empty($attr)) { - $struct = $struct->getChild(HTMLPurifier_ErrorStruct::ATTR, $attr); - if (!$struct->value) { - $struct->value = array($attr, 'PUT VALUE HERE'); - } - } - if (!empty($cssprop)) { - $struct = $struct->getChild(HTMLPurifier_ErrorStruct::CSSPROP, $cssprop); - if (!$struct->value) { - // if we tokenize CSS this might be a little more difficult to do - $struct->value = array($cssprop, 'PUT VALUE HERE'); - } - } - - // Ok, structs are all setup, now time to register the error - $struct->addError($severity, $msg); - } - - /** - * Retrieves raw error data for custom formatter to use - */ - public function getRaw() - { - return $this->errors; - } - - /** - * Default HTML formatting implementation for error messages - * @param HTMLPurifier_Config $config Configuration, vital for HTML output nature - * @param array $errors Errors array to display; used for recursion. - * @return string - */ - public function getHTMLFormatted($config, $errors = null) - { - $ret = array(); - - $this->generator = new HTMLPurifier_Generator($config, $this->context); - if ($errors === null) { - $errors = $this->errors; - } - - // 'At line' message needs to be removed - - // generation code for new structure goes here. It needs to be recursive. - foreach ($this->lines as $line => $col_array) { - if ($line == -1) { - continue; - } - foreach ($col_array as $col => $struct) { - $this->_renderStruct($ret, $struct, $line, $col); - } - } - if (isset($this->lines[-1])) { - $this->_renderStruct($ret, $this->lines[-1]); - } - - if (empty($errors)) { - return '

' . $this->locale->getMessage('ErrorCollector: No errors') . '

'; - } else { - return '
  • ' . implode('
  • ', $ret) . '
'; - } - - } - - private function _renderStruct(&$ret, $struct, $line = null, $col = null) - { - $stack = array($struct); - $context_stack = array(array()); - while ($current = array_pop($stack)) { - $context = array_pop($context_stack); - foreach ($current->errors as $error) { - list($severity, $msg) = $error; - $string = ''; - $string .= '
'; - // W3C uses an icon to indicate the severity of the error. - $error = $this->locale->getErrorName($severity); - $string .= "$error "; - if (!is_null($line) && !is_null($col)) { - $string .= "Line $line, Column $col: "; - } else { - $string .= 'End of Document: '; - } - $string .= '' . $this->generator->escape($msg) . ' '; - $string .= '
'; - // Here, have a marker for the character on the column appropriate. - // Be sure to clip extremely long lines. - //$string .= '
';
-                //$string .= '';
-                //$string .= '
'; - $ret[] = $string; - } - foreach ($current->children as $array) { - $context[] = $current; - $stack = array_merge($stack, array_reverse($array, true)); - for ($i = count($array); $i > 0; $i--) { - $context_stack[] = $context; - } - } - } - } -} - -// vim: et sw=4 sts=4 +locale =& $context->get('Locale'); + $this->context = $context; + $this->_current =& $this->_stacks[0]; + $this->errors =& $this->_stacks[0]; + } + + /** + * Sends an error message to the collector for later use + * @param int $severity Error severity, PHP error style (don't use E_USER_) + * @param string $msg Error message text + */ + public function send($severity, $msg) + { + $args = array(); + if (func_num_args() > 2) { + $args = func_get_args(); + array_shift($args); + unset($args[0]); + } + + $token = $this->context->get('CurrentToken', true); + $line = $token ? $token->line : $this->context->get('CurrentLine', true); + $col = $token ? $token->col : $this->context->get('CurrentCol', true); + $attr = $this->context->get('CurrentAttr', true); + + // perform special substitutions, also add custom parameters + $subst = array(); + if (!is_null($token)) { + $args['CurrentToken'] = $token; + } + if (!is_null($attr)) { + $subst['$CurrentAttr.Name'] = $attr; + if (isset($token->attr[$attr])) { + $subst['$CurrentAttr.Value'] = $token->attr[$attr]; + } + } + + if (empty($args)) { + $msg = $this->locale->getMessage($msg); + } else { + $msg = $this->locale->formatMessage($msg, $args); + } + + if (!empty($subst)) { + $msg = strtr($msg, $subst); + } + + // (numerically indexed) + $error = array( + self::LINENO => $line, + self::SEVERITY => $severity, + self::MESSAGE => $msg, + self::CHILDREN => array() + ); + $this->_current[] = $error; + + // NEW CODE BELOW ... + // Top-level errors are either: + // TOKEN type, if $value is set appropriately, or + // "syntax" type, if $value is null + $new_struct = new HTMLPurifier_ErrorStruct(); + $new_struct->type = HTMLPurifier_ErrorStruct::TOKEN; + if ($token) { + $new_struct->value = clone $token; + } + if (is_int($line) && is_int($col)) { + if (isset($this->lines[$line][$col])) { + $struct = $this->lines[$line][$col]; + } else { + $struct = $this->lines[$line][$col] = $new_struct; + } + // These ksorts may present a performance problem + ksort($this->lines[$line], SORT_NUMERIC); + } else { + if (isset($this->lines[-1])) { + $struct = $this->lines[-1]; + } else { + $struct = $this->lines[-1] = $new_struct; + } + } + ksort($this->lines, SORT_NUMERIC); + + // Now, check if we need to operate on a lower structure + if (!empty($attr)) { + $struct = $struct->getChild(HTMLPurifier_ErrorStruct::ATTR, $attr); + if (!$struct->value) { + $struct->value = array($attr, 'PUT VALUE HERE'); + } + } + if (!empty($cssprop)) { + $struct = $struct->getChild(HTMLPurifier_ErrorStruct::CSSPROP, $cssprop); + if (!$struct->value) { + // if we tokenize CSS this might be a little more difficult to do + $struct->value = array($cssprop, 'PUT VALUE HERE'); + } + } + + // Ok, structs are all setup, now time to register the error + $struct->addError($severity, $msg); + } + + /** + * Retrieves raw error data for custom formatter to use + */ + public function getRaw() + { + return $this->errors; + } + + /** + * Default HTML formatting implementation for error messages + * @param HTMLPurifier_Config $config Configuration, vital for HTML output nature + * @param array $errors Errors array to display; used for recursion. + * @return string + */ + public function getHTMLFormatted($config, $errors = null) + { + $ret = array(); + + $this->generator = new HTMLPurifier_Generator($config, $this->context); + if ($errors === null) { + $errors = $this->errors; + } + + // 'At line' message needs to be removed + + // generation code for new structure goes here. It needs to be recursive. + foreach ($this->lines as $line => $col_array) { + if ($line == -1) { + continue; + } + foreach ($col_array as $col => $struct) { + $this->_renderStruct($ret, $struct, $line, $col); + } + } + if (isset($this->lines[-1])) { + $this->_renderStruct($ret, $this->lines[-1]); + } + + if (empty($errors)) { + return '

' . $this->locale->getMessage('ErrorCollector: No errors') . '

'; + } else { + return '
  • ' . implode('
  • ', $ret) . '
'; + } + + } + + private function _renderStruct(&$ret, $struct, $line = null, $col = null) + { + $stack = array($struct); + $context_stack = array(array()); + while ($current = array_pop($stack)) { + $context = array_pop($context_stack); + foreach ($current->errors as $error) { + list($severity, $msg) = $error; + $string = ''; + $string .= '
'; + // W3C uses an icon to indicate the severity of the error. + $error = $this->locale->getErrorName($severity); + $string .= "$error "; + if (!is_null($line) && !is_null($col)) { + $string .= "Line $line, Column $col: "; + } else { + $string .= 'End of Document: '; + } + $string .= '' . $this->generator->escape($msg) . ' '; + $string .= '
'; + // Here, have a marker for the character on the column appropriate. + // Be sure to clip extremely long lines. + //$string .= '
';
+                //$string .= '';
+                //$string .= '
'; + $ret[] = $string; + } + foreach ($current->children as $array) { + $context[] = $current; + $stack = array_merge($stack, array_reverse($array, true)); + for ($i = count($array); $i > 0; $i--) { + $context_stack[] = $context; + } + } + } + } +} + +// vim: et sw=4 sts=4 diff --git a/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/ErrorStruct.php b/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/ErrorStruct.php similarity index 96% rename from plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/ErrorStruct.php rename to plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/ErrorStruct.php index a6c0da2..cf869d3 100755 --- a/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/ErrorStruct.php +++ b/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/ErrorStruct.php @@ -1,74 +1,74 @@ -children[$type][$id])) { - $this->children[$type][$id] = new HTMLPurifier_ErrorStruct(); - $this->children[$type][$id]->type = $type; - } - return $this->children[$type][$id]; - } - - /** - * @param int $severity - * @param string $message - */ - public function addError($severity, $message) - { - $this->errors[] = array($severity, $message); - } -} - -// vim: et sw=4 sts=4 +children[$type][$id])) { + $this->children[$type][$id] = new HTMLPurifier_ErrorStruct(); + $this->children[$type][$id]->type = $type; + } + return $this->children[$type][$id]; + } + + /** + * @param int $severity + * @param string $message + */ + public function addError($severity, $message) + { + $this->errors[] = array($severity, $message); + } +} + +// vim: et sw=4 sts=4 diff --git a/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/Exception.php b/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/Exception.php similarity index 93% rename from plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/Exception.php rename to plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/Exception.php index defe157..be85b4c 100755 --- a/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/Exception.php +++ b/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/Exception.php @@ -1,12 +1,12 @@ -preFilter, - * 2->preFilter, 3->preFilter, purify, 3->postFilter, 2->postFilter, - * 1->postFilter. - * - * @note Methods are not declared abstract as it is perfectly legitimate - * for an implementation not to want anything to happen on a step - */ - -class HTMLPurifier_Filter -{ - - /** - * Name of the filter for identification purposes. - * @type string - */ - public $name; - - /** - * Pre-processor function, handles HTML before HTML Purifier - * @param string $html - * @param HTMLPurifier_Config $config - * @param HTMLPurifier_Context $context - * @return string - */ - public function preFilter($html, $config, $context) - { - return $html; - } - - /** - * Post-processor function, handles HTML after HTML Purifier - * @param string $html - * @param HTMLPurifier_Config $config - * @param HTMLPurifier_Context $context - * @return string - */ - public function postFilter($html, $config, $context) - { - return $html; - } -} - -// vim: et sw=4 sts=4 +preFilter, + * 2->preFilter, 3->preFilter, purify, 3->postFilter, 2->postFilter, + * 1->postFilter. + * + * @note Methods are not declared abstract as it is perfectly legitimate + * for an implementation not to want anything to happen on a step + */ + +class HTMLPurifier_Filter +{ + + /** + * Name of the filter for identification purposes. + * @type string + */ + public $name; + + /** + * Pre-processor function, handles HTML before HTML Purifier + * @param string $html + * @param HTMLPurifier_Config $config + * @param HTMLPurifier_Context $context + * @return string + */ + public function preFilter($html, $config, $context) + { + return $html; + } + + /** + * Post-processor function, handles HTML after HTML Purifier + * @param string $html + * @param HTMLPurifier_Config $config + * @param HTMLPurifier_Context $context + * @return string + */ + public function postFilter($html, $config, $context) + { + return $html; + } +} + +// vim: et sw=4 sts=4 diff --git a/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/Filter/ExtractStyleBlocks.php b/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/Filter/ExtractStyleBlocks.php similarity index 97% rename from plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/Filter/ExtractStyleBlocks.php rename to plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/Filter/ExtractStyleBlocks.php index 9a115d8..08e62c1 100755 --- a/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/Filter/ExtractStyleBlocks.php +++ b/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/Filter/ExtractStyleBlocks.php @@ -1,338 +1,338 @@ - blocks from input HTML, cleans them up - * using CSSTidy, and then places them in $purifier->context->get('StyleBlocks') - * so they can be used elsewhere in the document. - * - * @note - * See tests/HTMLPurifier/Filter/ExtractStyleBlocksTest.php for - * sample usage. - * - * @note - * This filter can also be used on stylesheets not included in the - * document--something purists would probably prefer. Just directly - * call HTMLPurifier_Filter_ExtractStyleBlocks->cleanCSS() - */ -class HTMLPurifier_Filter_ExtractStyleBlocks extends HTMLPurifier_Filter -{ - /** - * @type string - */ - public $name = 'ExtractStyleBlocks'; - - /** - * @type array - */ - private $_styleMatches = array(); - - /** - * @type csstidy - */ - private $_tidy; - - /** - * @type HTMLPurifier_AttrDef_HTML_ID - */ - private $_id_attrdef; - - /** - * @type HTMLPurifier_AttrDef_CSS_Ident - */ - private $_class_attrdef; - - /** - * @type HTMLPurifier_AttrDef_Enum - */ - private $_enum_attrdef; - - public function __construct() - { - $this->_tidy = new csstidy(); - $this->_tidy->set_cfg('lowercase_s', false); - $this->_id_attrdef = new HTMLPurifier_AttrDef_HTML_ID(true); - $this->_class_attrdef = new HTMLPurifier_AttrDef_CSS_Ident(); - $this->_enum_attrdef = new HTMLPurifier_AttrDef_Enum( - array( - 'first-child', - 'link', - 'visited', - 'active', - 'hover', - 'focus' - ) - ); - } - - /** - * Save the contents of CSS blocks to style matches - * @param array $matches preg_replace style $matches array - */ - protected function styleCallback($matches) - { - $this->_styleMatches[] = $matches[1]; - } - - /** - * Removes inline #isU', array($this, 'styleCallback'), $html); - $style_blocks = $this->_styleMatches; - $this->_styleMatches = array(); // reset - $context->register('StyleBlocks', $style_blocks); // $context must not be reused - if ($this->_tidy) { - foreach ($style_blocks as &$style) { - $style = $this->cleanCSS($style, $config, $context); - } - } - return $html; - } - - /** - * Takes CSS (the stuff found in in a font-family prop). - if ($config->get('Filter.ExtractStyleBlocks.Escaping')) { - $css = str_replace( - array('<', '>', '&'), - array('\3C ', '\3E ', '\26 '), - $css - ); - } - return $css; - } -} - -// vim: et sw=4 sts=4 + blocks from input HTML, cleans them up + * using CSSTidy, and then places them in $purifier->context->get('StyleBlocks') + * so they can be used elsewhere in the document. + * + * @note + * See tests/HTMLPurifier/Filter/ExtractStyleBlocksTest.php for + * sample usage. + * + * @note + * This filter can also be used on stylesheets not included in the + * document--something purists would probably prefer. Just directly + * call HTMLPurifier_Filter_ExtractStyleBlocks->cleanCSS() + */ +class HTMLPurifier_Filter_ExtractStyleBlocks extends HTMLPurifier_Filter +{ + /** + * @type string + */ + public $name = 'ExtractStyleBlocks'; + + /** + * @type array + */ + private $_styleMatches = array(); + + /** + * @type csstidy + */ + private $_tidy; + + /** + * @type HTMLPurifier_AttrDef_HTML_ID + */ + private $_id_attrdef; + + /** + * @type HTMLPurifier_AttrDef_CSS_Ident + */ + private $_class_attrdef; + + /** + * @type HTMLPurifier_AttrDef_Enum + */ + private $_enum_attrdef; + + public function __construct() + { + $this->_tidy = new csstidy(); + $this->_tidy->set_cfg('lowercase_s', false); + $this->_id_attrdef = new HTMLPurifier_AttrDef_HTML_ID(true); + $this->_class_attrdef = new HTMLPurifier_AttrDef_CSS_Ident(); + $this->_enum_attrdef = new HTMLPurifier_AttrDef_Enum( + array( + 'first-child', + 'link', + 'visited', + 'active', + 'hover', + 'focus' + ) + ); + } + + /** + * Save the contents of CSS blocks to style matches + * @param array $matches preg_replace style $matches array + */ + protected function styleCallback($matches) + { + $this->_styleMatches[] = $matches[1]; + } + + /** + * Removes inline #isU', array($this, 'styleCallback'), $html); + $style_blocks = $this->_styleMatches; + $this->_styleMatches = array(); // reset + $context->register('StyleBlocks', $style_blocks); // $context must not be reused + if ($this->_tidy) { + foreach ($style_blocks as &$style) { + $style = $this->cleanCSS($style, $config, $context); + } + } + return $html; + } + + /** + * Takes CSS (the stuff found in in a font-family prop). + if ($config->get('Filter.ExtractStyleBlocks.Escaping')) { + $css = str_replace( + array('<', '>', '&'), + array('\3C ', '\3E ', '\26 '), + $css + ); + } + return $css; + } +} + +// vim: et sw=4 sts=4 diff --git a/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/Filter/YouTube.php b/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/Filter/YouTube.php similarity index 81% rename from plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/Filter/YouTube.php rename to plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/Filter/YouTube.php index 9200802..276d836 100755 --- a/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/Filter/YouTube.php +++ b/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/Filter/YouTube.php @@ -1,65 +1,65 @@ -]+>.+?' . - 'http://www.youtube.com/((?:v|cp)/[A-Za-z0-9\-_=]+).+?#s'; - $pre_replace = '\1'; - return preg_replace($pre_regex, $pre_replace, $html); - } - - /** - * @param string $html - * @param HTMLPurifier_Config $config - * @param HTMLPurifier_Context $context - * @return string - */ - public function postFilter($html, $config, $context) - { - $post_regex = '#((?:v|cp)/[A-Za-z0-9\-_=]+)#'; - return preg_replace_callback($post_regex, array($this, 'postFilterCallback'), $html); - } - - /** - * @param $url - * @return string - */ - protected function armorUrl($url) - { - return str_replace('--', '--', $url); - } - - /** - * @param array $matches - * @return string - */ - protected function postFilterCallback($matches) - { - $url = $this->armorUrl($matches[1]); - return '' . - '' . - '' . - ''; - } -} - -// vim: et sw=4 sts=4 +]+>.+?' . + '(?:http:)?//www.youtube.com/((?:v|cp)/[A-Za-z0-9\-_=]+).+?#s'; + $pre_replace = '\1'; + return preg_replace($pre_regex, $pre_replace, $html); + } + + /** + * @param string $html + * @param HTMLPurifier_Config $config + * @param HTMLPurifier_Context $context + * @return string + */ + public function postFilter($html, $config, $context) + { + $post_regex = '#((?:v|cp)/[A-Za-z0-9\-_=]+)#'; + return preg_replace_callback($post_regex, array($this, 'postFilterCallback'), $html); + } + + /** + * @param $url + * @return string + */ + protected function armorUrl($url) + { + return str_replace('--', '--', $url); + } + + /** + * @param array $matches + * @return string + */ + protected function postFilterCallback($matches) + { + $url = $this->armorUrl($matches[1]); + return '' . + '' . + '' . + ''; + } +} + +// vim: et sw=4 sts=4 diff --git a/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/Generator.php b/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/Generator.php similarity index 97% rename from plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/Generator.php rename to plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/Generator.php index ca76ba6..6fb5687 100755 --- a/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/Generator.php +++ b/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/Generator.php @@ -1,286 +1,286 @@ - tags. - * @type bool - */ - private $_scriptFix = false; - - /** - * Cache of HTMLDefinition during HTML output to determine whether or - * not attributes should be minimized. - * @type HTMLPurifier_HTMLDefinition - */ - private $_def; - - /** - * Cache of %Output.SortAttr. - * @type bool - */ - private $_sortAttr; - - /** - * Cache of %Output.FlashCompat. - * @type bool - */ - private $_flashCompat; - - /** - * Cache of %Output.FixInnerHTML. - * @type bool - */ - private $_innerHTMLFix; - - /** - * Stack for keeping track of object information when outputting IE - * compatibility code. - * @type array - */ - private $_flashStack = array(); - - /** - * Configuration for the generator - * @type HTMLPurifier_Config - */ - protected $config; - - /** - * @param HTMLPurifier_Config $config - * @param HTMLPurifier_Context $context - */ - public function __construct($config, $context) - { - $this->config = $config; - $this->_scriptFix = $config->get('Output.CommentScriptContents'); - $this->_innerHTMLFix = $config->get('Output.FixInnerHTML'); - $this->_sortAttr = $config->get('Output.SortAttr'); - $this->_flashCompat = $config->get('Output.FlashCompat'); - $this->_def = $config->getHTMLDefinition(); - $this->_xhtml = $this->_def->doctype->xml; - } - - /** - * Generates HTML from an array of tokens. - * @param HTMLPurifier_Token[] $tokens Array of HTMLPurifier_Token - * @return string Generated HTML - */ - public function generateFromTokens($tokens) - { - if (!$tokens) { - return ''; - } - - // Basic algorithm - $html = ''; - for ($i = 0, $size = count($tokens); $i < $size; $i++) { - if ($this->_scriptFix && $tokens[$i]->name === 'script' - && $i + 2 < $size && $tokens[$i+2] instanceof HTMLPurifier_Token_End) { - // script special case - // the contents of the script block must be ONE token - // for this to work. - $html .= $this->generateFromToken($tokens[$i++]); - $html .= $this->generateScriptFromToken($tokens[$i++]); - } - $html .= $this->generateFromToken($tokens[$i]); - } - - // Tidy cleanup - if (extension_loaded('tidy') && $this->config->get('Output.TidyFormat')) { - $tidy = new Tidy; - $tidy->parseString( - $html, - array( - 'indent'=> true, - 'output-xhtml' => $this->_xhtml, - 'show-body-only' => true, - 'indent-spaces' => 2, - 'wrap' => 68, - ), - 'utf8' - ); - $tidy->cleanRepair(); - $html = (string) $tidy; // explicit cast necessary - } - - // Normalize newlines to system defined value - if ($this->config->get('Core.NormalizeNewlines')) { - $nl = $this->config->get('Output.Newline'); - if ($nl === null) { - $nl = PHP_EOL; - } - if ($nl !== "\n") { - $html = str_replace("\n", $nl, $html); - } - } - return $html; - } - - /** - * Generates HTML from a single token. - * @param HTMLPurifier_Token $token HTMLPurifier_Token object. - * @return string Generated HTML - */ - public function generateFromToken($token) - { - if (!$token instanceof HTMLPurifier_Token) { - trigger_error('Cannot generate HTML from non-HTMLPurifier_Token object', E_USER_WARNING); - return ''; - - } elseif ($token instanceof HTMLPurifier_Token_Start) { - $attr = $this->generateAttributes($token->attr, $token->name); - if ($this->_flashCompat) { - if ($token->name == "object") { - $flash = new stdclass(); - $flash->attr = $token->attr; - $flash->param = array(); - $this->_flashStack[] = $flash; - } - } - return '<' . $token->name . ($attr ? ' ' : '') . $attr . '>'; - - } elseif ($token instanceof HTMLPurifier_Token_End) { - $_extra = ''; - if ($this->_flashCompat) { - if ($token->name == "object" && !empty($this->_flashStack)) { - // doesn't do anything for now - } - } - return $_extra . 'name . '>'; - - } elseif ($token instanceof HTMLPurifier_Token_Empty) { - if ($this->_flashCompat && $token->name == "param" && !empty($this->_flashStack)) { - $this->_flashStack[count($this->_flashStack)-1]->param[$token->attr['name']] = $token->attr['value']; - } - $attr = $this->generateAttributes($token->attr, $token->name); - return '<' . $token->name . ($attr ? ' ' : '') . $attr . - ( $this->_xhtml ? ' /': '' ) //
v.
- . '>'; - - } elseif ($token instanceof HTMLPurifier_Token_Text) { - return $this->escape($token->data, ENT_NOQUOTES); - - } elseif ($token instanceof HTMLPurifier_Token_Comment) { - return ''; - } else { - return ''; - - } - } - - /** - * Special case processor for the contents of script tags - * @param HTMLPurifier_Token $token HTMLPurifier_Token object. - * @return string - * @warning This runs into problems if there's already a literal - * --> somewhere inside the script contents. - */ - public function generateScriptFromToken($token) - { - if (!$token instanceof HTMLPurifier_Token_Text) { - return $this->generateFromToken($token); - } - // Thanks - $data = preg_replace('#//\s*$#', '', $token->data); - return ''; - } - - /** - * Generates attribute declarations from attribute array. - * @note This does not include the leading or trailing space. - * @param array $assoc_array_of_attributes Attribute array - * @param string $element Name of element attributes are for, used to check - * attribute minimization. - * @return string Generated HTML fragment for insertion. - */ - public function generateAttributes($assoc_array_of_attributes, $element = '') - { - $html = ''; - if ($this->_sortAttr) { - ksort($assoc_array_of_attributes); - } - foreach ($assoc_array_of_attributes as $key => $value) { - if (!$this->_xhtml) { - // Remove namespaced attributes - if (strpos($key, ':') !== false) { - continue; - } - // Check if we should minimize the attribute: val="val" -> val - if ($element && !empty($this->_def->info[$element]->attr[$key]->minimized)) { - $html .= $key . ' '; - continue; - } - } - // Workaround for Internet Explorer innerHTML bug. - // Essentially, Internet Explorer, when calculating - // innerHTML, omits quotes if there are no instances of - // angled brackets, quotes or spaces. However, when parsing - // HTML (for example, when you assign to innerHTML), it - // treats backticks as quotes. Thus, - // `` - // becomes - // `` - // becomes - // - // Fortunately, all we need to do is trigger an appropriate - // quoting style, which we do by adding an extra space. - // This also is consistent with the W3C spec, which states - // that user agents may ignore leading or trailing - // whitespace (in fact, most don't, at least for attributes - // like alt, but an extra space at the end is barely - // noticeable). Still, we have a configuration knob for - // this, since this transformation is not necesary if you - // don't process user input with innerHTML or you don't plan - // on supporting Internet Explorer. - if ($this->_innerHTMLFix) { - if (strpos($value, '`') !== false) { - // check if correct quoting style would not already be - // triggered - if (strcspn($value, '"\' <>') === strlen($value)) { - // protect! - $value .= ' '; - } - } - } - $html .= $key.'="'.$this->escape($value).'" '; - } - return rtrim($html); - } - - /** - * Escapes raw text data. - * @todo This really ought to be protected, but until we have a facility - * for properly generating HTML here w/o using tokens, it stays - * public. - * @param string $string String data to escape for HTML. - * @param int $quote Quoting style, like htmlspecialchars. ENT_NOQUOTES is - * permissible for non-attribute output. - * @return string escaped data. - */ - public function escape($string, $quote = null) - { - // Workaround for APC bug on Mac Leopard reported by sidepodcast - // http://htmlpurifier.org/phorum/read.php?3,4823,4846 - if ($quote === null) { - $quote = ENT_COMPAT; - } - return htmlspecialchars($string, $quote, 'UTF-8'); - } -} - -// vim: et sw=4 sts=4 + tags. + * @type bool + */ + private $_scriptFix = false; + + /** + * Cache of HTMLDefinition during HTML output to determine whether or + * not attributes should be minimized. + * @type HTMLPurifier_HTMLDefinition + */ + private $_def; + + /** + * Cache of %Output.SortAttr. + * @type bool + */ + private $_sortAttr; + + /** + * Cache of %Output.FlashCompat. + * @type bool + */ + private $_flashCompat; + + /** + * Cache of %Output.FixInnerHTML. + * @type bool + */ + private $_innerHTMLFix; + + /** + * Stack for keeping track of object information when outputting IE + * compatibility code. + * @type array + */ + private $_flashStack = array(); + + /** + * Configuration for the generator + * @type HTMLPurifier_Config + */ + protected $config; + + /** + * @param HTMLPurifier_Config $config + * @param HTMLPurifier_Context $context + */ + public function __construct($config, $context) + { + $this->config = $config; + $this->_scriptFix = $config->get('Output.CommentScriptContents'); + $this->_innerHTMLFix = $config->get('Output.FixInnerHTML'); + $this->_sortAttr = $config->get('Output.SortAttr'); + $this->_flashCompat = $config->get('Output.FlashCompat'); + $this->_def = $config->getHTMLDefinition(); + $this->_xhtml = $this->_def->doctype->xml; + } + + /** + * Generates HTML from an array of tokens. + * @param HTMLPurifier_Token[] $tokens Array of HTMLPurifier_Token + * @return string Generated HTML + */ + public function generateFromTokens($tokens) + { + if (!$tokens) { + return ''; + } + + // Basic algorithm + $html = ''; + for ($i = 0, $size = count($tokens); $i < $size; $i++) { + if ($this->_scriptFix && $tokens[$i]->name === 'script' + && $i + 2 < $size && $tokens[$i+2] instanceof HTMLPurifier_Token_End) { + // script special case + // the contents of the script block must be ONE token + // for this to work. + $html .= $this->generateFromToken($tokens[$i++]); + $html .= $this->generateScriptFromToken($tokens[$i++]); + } + $html .= $this->generateFromToken($tokens[$i]); + } + + // Tidy cleanup + if (extension_loaded('tidy') && $this->config->get('Output.TidyFormat')) { + $tidy = new Tidy; + $tidy->parseString( + $html, + array( + 'indent'=> true, + 'output-xhtml' => $this->_xhtml, + 'show-body-only' => true, + 'indent-spaces' => 2, + 'wrap' => 68, + ), + 'utf8' + ); + $tidy->cleanRepair(); + $html = (string) $tidy; // explicit cast necessary + } + + // Normalize newlines to system defined value + if ($this->config->get('Core.NormalizeNewlines')) { + $nl = $this->config->get('Output.Newline'); + if ($nl === null) { + $nl = PHP_EOL; + } + if ($nl !== "\n") { + $html = str_replace("\n", $nl, $html); + } + } + return $html; + } + + /** + * Generates HTML from a single token. + * @param HTMLPurifier_Token $token HTMLPurifier_Token object. + * @return string Generated HTML + */ + public function generateFromToken($token) + { + if (!$token instanceof HTMLPurifier_Token) { + trigger_error('Cannot generate HTML from non-HTMLPurifier_Token object', E_USER_WARNING); + return ''; + + } elseif ($token instanceof HTMLPurifier_Token_Start) { + $attr = $this->generateAttributes($token->attr, $token->name); + if ($this->_flashCompat) { + if ($token->name == "object") { + $flash = new stdclass(); + $flash->attr = $token->attr; + $flash->param = array(); + $this->_flashStack[] = $flash; + } + } + return '<' . $token->name . ($attr ? ' ' : '') . $attr . '>'; + + } elseif ($token instanceof HTMLPurifier_Token_End) { + $_extra = ''; + if ($this->_flashCompat) { + if ($token->name == "object" && !empty($this->_flashStack)) { + // doesn't do anything for now + } + } + return $_extra . 'name . '>'; + + } elseif ($token instanceof HTMLPurifier_Token_Empty) { + if ($this->_flashCompat && $token->name == "param" && !empty($this->_flashStack)) { + $this->_flashStack[count($this->_flashStack)-1]->param[$token->attr['name']] = $token->attr['value']; + } + $attr = $this->generateAttributes($token->attr, $token->name); + return '<' . $token->name . ($attr ? ' ' : '') . $attr . + ( $this->_xhtml ? ' /': '' ) //
v.
+ . '>'; + + } elseif ($token instanceof HTMLPurifier_Token_Text) { + return $this->escape($token->data, ENT_NOQUOTES); + + } elseif ($token instanceof HTMLPurifier_Token_Comment) { + return ''; + } else { + return ''; + + } + } + + /** + * Special case processor for the contents of script tags + * @param HTMLPurifier_Token $token HTMLPurifier_Token object. + * @return string + * @warning This runs into problems if there's already a literal + * --> somewhere inside the script contents. + */ + public function generateScriptFromToken($token) + { + if (!$token instanceof HTMLPurifier_Token_Text) { + return $this->generateFromToken($token); + } + // Thanks + $data = preg_replace('#//\s*$#', '', $token->data); + return ''; + } + + /** + * Generates attribute declarations from attribute array. + * @note This does not include the leading or trailing space. + * @param array $assoc_array_of_attributes Attribute array + * @param string $element Name of element attributes are for, used to check + * attribute minimization. + * @return string Generated HTML fragment for insertion. + */ + public function generateAttributes($assoc_array_of_attributes, $element = '') + { + $html = ''; + if ($this->_sortAttr) { + ksort($assoc_array_of_attributes); + } + foreach ($assoc_array_of_attributes as $key => $value) { + if (!$this->_xhtml) { + // Remove namespaced attributes + if (strpos($key, ':') !== false) { + continue; + } + // Check if we should minimize the attribute: val="val" -> val + if ($element && !empty($this->_def->info[$element]->attr[$key]->minimized)) { + $html .= $key . ' '; + continue; + } + } + // Workaround for Internet Explorer innerHTML bug. + // Essentially, Internet Explorer, when calculating + // innerHTML, omits quotes if there are no instances of + // angled brackets, quotes or spaces. However, when parsing + // HTML (for example, when you assign to innerHTML), it + // treats backticks as quotes. Thus, + // `` + // becomes + // `` + // becomes + // + // Fortunately, all we need to do is trigger an appropriate + // quoting style, which we do by adding an extra space. + // This also is consistent with the W3C spec, which states + // that user agents may ignore leading or trailing + // whitespace (in fact, most don't, at least for attributes + // like alt, but an extra space at the end is barely + // noticeable). Still, we have a configuration knob for + // this, since this transformation is not necesary if you + // don't process user input with innerHTML or you don't plan + // on supporting Internet Explorer. + if ($this->_innerHTMLFix) { + if (strpos($value, '`') !== false) { + // check if correct quoting style would not already be + // triggered + if (strcspn($value, '"\' <>') === strlen($value)) { + // protect! + $value .= ' '; + } + } + } + $html .= $key.'="'.$this->escape($value).'" '; + } + return rtrim($html); + } + + /** + * Escapes raw text data. + * @todo This really ought to be protected, but until we have a facility + * for properly generating HTML here w/o using tokens, it stays + * public. + * @param string $string String data to escape for HTML. + * @param int $quote Quoting style, like htmlspecialchars. ENT_NOQUOTES is + * permissible for non-attribute output. + * @return string escaped data. + */ + public function escape($string, $quote = null) + { + // Workaround for APC bug on Mac Leopard reported by sidepodcast + // http://htmlpurifier.org/phorum/read.php?3,4823,4846 + if ($quote === null) { + $quote = ENT_COMPAT; + } + return htmlspecialchars($string, $quote, 'UTF-8'); + } +} + +// vim: et sw=4 sts=4 diff --git a/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/HTMLDefinition.php b/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/HTMLDefinition.php similarity index 97% rename from plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/HTMLDefinition.php rename to plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/HTMLDefinition.php index 027c85d..9b7b334 100755 --- a/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/HTMLDefinition.php +++ b/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/HTMLDefinition.php @@ -1,493 +1,493 @@ -getAnonymousModule(); - if (!isset($module->info[$element_name])) { - $element = $module->addBlankElement($element_name); - } else { - $element = $module->info[$element_name]; - } - $element->attr[$attr_name] = $def; - } - - /** - * Adds a custom element to your HTML definition - * @see HTMLPurifier_HTMLModule::addElement() for detailed - * parameter and return value descriptions. - */ - public function addElement($element_name, $type, $contents, $attr_collections, $attributes = array()) - { - $module = $this->getAnonymousModule(); - // assume that if the user is calling this, the element - // is safe. This may not be a good idea - $element = $module->addElement($element_name, $type, $contents, $attr_collections, $attributes); - return $element; - } - - /** - * Adds a blank element to your HTML definition, for overriding - * existing behavior - * @param string $element_name - * @return HTMLPurifier_ElementDef - * @see HTMLPurifier_HTMLModule::addBlankElement() for detailed - * parameter and return value descriptions. - */ - public function addBlankElement($element_name) - { - $module = $this->getAnonymousModule(); - $element = $module->addBlankElement($element_name); - return $element; - } - - /** - * Retrieves a reference to the anonymous module, so you can - * bust out advanced features without having to make your own - * module. - * @return HTMLPurifier_HTMLModule - */ - public function getAnonymousModule() - { - if (!$this->_anonModule) { - $this->_anonModule = new HTMLPurifier_HTMLModule(); - $this->_anonModule->name = 'Anonymous'; - } - return $this->_anonModule; - } - - private $_anonModule = null; - - // PUBLIC BUT INTERNAL VARIABLES -------------------------------------- - - /** - * @type string - */ - public $type = 'HTML'; - - /** - * @type HTMLPurifier_HTMLModuleManager - */ - public $manager; - - /** - * Performs low-cost, preliminary initialization. - */ - public function __construct() - { - $this->manager = new HTMLPurifier_HTMLModuleManager(); - } - - /** - * @param HTMLPurifier_Config $config - */ - protected function doSetup($config) - { - $this->processModules($config); - $this->setupConfigStuff($config); - unset($this->manager); - - // cleanup some of the element definitions - foreach ($this->info as $k => $v) { - unset($this->info[$k]->content_model); - unset($this->info[$k]->content_model_type); - } - } - - /** - * Extract out the information from the manager - * @param HTMLPurifier_Config $config - */ - protected function processModules($config) - { - if ($this->_anonModule) { - // for user specific changes - // this is late-loaded so we don't have to deal with PHP4 - // reference wonky-ness - $this->manager->addModule($this->_anonModule); - unset($this->_anonModule); - } - - $this->manager->setup($config); - $this->doctype = $this->manager->doctype; - - foreach ($this->manager->modules as $module) { - foreach ($module->info_tag_transform as $k => $v) { - if ($v === false) { - unset($this->info_tag_transform[$k]); - } else { - $this->info_tag_transform[$k] = $v; - } - } - foreach ($module->info_attr_transform_pre as $k => $v) { - if ($v === false) { - unset($this->info_attr_transform_pre[$k]); - } else { - $this->info_attr_transform_pre[$k] = $v; - } - } - foreach ($module->info_attr_transform_post as $k => $v) { - if ($v === false) { - unset($this->info_attr_transform_post[$k]); - } else { - $this->info_attr_transform_post[$k] = $v; - } - } - foreach ($module->info_injector as $k => $v) { - if ($v === false) { - unset($this->info_injector[$k]); - } else { - $this->info_injector[$k] = $v; - } - } - } - $this->info = $this->manager->getElements(); - $this->info_content_sets = $this->manager->contentSets->lookup; - } - - /** - * Sets up stuff based on config. We need a better way of doing this. - * @param HTMLPurifier_Config $config - */ - protected function setupConfigStuff($config) - { - $block_wrapper = $config->get('HTML.BlockWrapper'); - if (isset($this->info_content_sets['Block'][$block_wrapper])) { - $this->info_block_wrapper = $block_wrapper; - } else { - trigger_error( - 'Cannot use non-block element as block wrapper', - E_USER_ERROR - ); - } - - $parent = $config->get('HTML.Parent'); - $def = $this->manager->getElement($parent, true); - if ($def) { - $this->info_parent = $parent; - $this->info_parent_def = $def; - } else { - trigger_error( - 'Cannot use unrecognized element as parent', - E_USER_ERROR - ); - $this->info_parent_def = $this->manager->getElement($this->info_parent, true); - } - - // support template text - $support = "(for information on implementing this, see the support forums) "; - - // setup allowed elements ----------------------------------------- - - $allowed_elements = $config->get('HTML.AllowedElements'); - $allowed_attributes = $config->get('HTML.AllowedAttributes'); // retrieve early - - if (!is_array($allowed_elements) && !is_array($allowed_attributes)) { - $allowed = $config->get('HTML.Allowed'); - if (is_string($allowed)) { - list($allowed_elements, $allowed_attributes) = $this->parseTinyMCEAllowedList($allowed); - } - } - - if (is_array($allowed_elements)) { - foreach ($this->info as $name => $d) { - if (!isset($allowed_elements[$name])) { - unset($this->info[$name]); - } - unset($allowed_elements[$name]); - } - // emit errors - foreach ($allowed_elements as $element => $d) { - $element = htmlspecialchars($element); // PHP doesn't escape errors, be careful! - trigger_error("Element '$element' is not supported $support", E_USER_WARNING); - } - } - - // setup allowed attributes --------------------------------------- - - $allowed_attributes_mutable = $allowed_attributes; // by copy! - if (is_array($allowed_attributes)) { - // This actually doesn't do anything, since we went away from - // global attributes. It's possible that userland code uses - // it, but HTMLModuleManager doesn't! - foreach ($this->info_global_attr as $attr => $x) { - $keys = array($attr, "*@$attr", "*.$attr"); - $delete = true; - foreach ($keys as $key) { - if ($delete && isset($allowed_attributes[$key])) { - $delete = false; - } - if (isset($allowed_attributes_mutable[$key])) { - unset($allowed_attributes_mutable[$key]); - } - } - if ($delete) { - unset($this->info_global_attr[$attr]); - } - } - - foreach ($this->info as $tag => $info) { - foreach ($info->attr as $attr => $x) { - $keys = array("$tag@$attr", $attr, "*@$attr", "$tag.$attr", "*.$attr"); - $delete = true; - foreach ($keys as $key) { - if ($delete && isset($allowed_attributes[$key])) { - $delete = false; - } - if (isset($allowed_attributes_mutable[$key])) { - unset($allowed_attributes_mutable[$key]); - } - } - if ($delete) { - if ($this->info[$tag]->attr[$attr]->required) { - trigger_error( - "Required attribute '$attr' in element '$tag' " . - "was not allowed, which means '$tag' will not be allowed either", - E_USER_WARNING - ); - } - unset($this->info[$tag]->attr[$attr]); - } - } - } - // emit errors - foreach ($allowed_attributes_mutable as $elattr => $d) { - $bits = preg_split('/[.@]/', $elattr, 2); - $c = count($bits); - switch ($c) { - case 2: - if ($bits[0] !== '*') { - $element = htmlspecialchars($bits[0]); - $attribute = htmlspecialchars($bits[1]); - if (!isset($this->info[$element])) { - trigger_error( - "Cannot allow attribute '$attribute' if element " . - "'$element' is not allowed/supported $support" - ); - } else { - trigger_error( - "Attribute '$attribute' in element '$element' not supported $support", - E_USER_WARNING - ); - } - break; - } - // otherwise fall through - case 1: - $attribute = htmlspecialchars($bits[0]); - trigger_error( - "Global attribute '$attribute' is not ". - "supported in any elements $support", - E_USER_WARNING - ); - break; - } - } - } - - // setup forbidden elements --------------------------------------- - - $forbidden_elements = $config->get('HTML.ForbiddenElements'); - $forbidden_attributes = $config->get('HTML.ForbiddenAttributes'); - - foreach ($this->info as $tag => $info) { - if (isset($forbidden_elements[$tag])) { - unset($this->info[$tag]); - continue; - } - foreach ($info->attr as $attr => $x) { - if (isset($forbidden_attributes["$tag@$attr"]) || - isset($forbidden_attributes["*@$attr"]) || - isset($forbidden_attributes[$attr]) - ) { - unset($this->info[$tag]->attr[$attr]); - continue; - } elseif (isset($forbidden_attributes["$tag.$attr"])) { // this segment might get removed eventually - // $tag.$attr are not user supplied, so no worries! - trigger_error( - "Error with $tag.$attr: tag.attr syntax not supported for " . - "HTML.ForbiddenAttributes; use tag@attr instead", - E_USER_WARNING - ); - } - } - } - foreach ($forbidden_attributes as $key => $v) { - if (strlen($key) < 2) { - continue; - } - if ($key[0] != '*') { - continue; - } - if ($key[1] == '.') { - trigger_error( - "Error with $key: *.attr syntax not supported for HTML.ForbiddenAttributes; use attr instead", - E_USER_WARNING - ); - } - } - - // setup injectors ----------------------------------------------------- - foreach ($this->info_injector as $i => $injector) { - if ($injector->checkNeeded($config) !== false) { - // remove injector that does not have it's required - // elements/attributes present, and is thus not needed. - unset($this->info_injector[$i]); - } - } - } - - /** - * Parses a TinyMCE-flavored Allowed Elements and Attributes list into - * separate lists for processing. Format is element[attr1|attr2],element2... - * @warning Although it's largely drawn from TinyMCE's implementation, - * it is different, and you'll probably have to modify your lists - * @param array $list String list to parse - * @return array - * @todo Give this its own class, probably static interface - */ - public function parseTinyMCEAllowedList($list) - { - $list = str_replace(array(' ', "\t"), '', $list); - - $elements = array(); - $attributes = array(); - - $chunks = preg_split('/(,|[\n\r]+)/', $list); - foreach ($chunks as $chunk) { - if (empty($chunk)) { - continue; - } - // remove TinyMCE element control characters - if (!strpos($chunk, '[')) { - $element = $chunk; - $attr = false; - } else { - list($element, $attr) = explode('[', $chunk); - } - if ($element !== '*') { - $elements[$element] = true; - } - if (!$attr) { - continue; - } - $attr = substr($attr, 0, strlen($attr) - 1); // remove trailing ] - $attr = explode('|', $attr); - foreach ($attr as $key) { - $attributes["$element.$key"] = true; - } - } - return array($elements, $attributes); - } -} - -// vim: et sw=4 sts=4 +getAnonymousModule(); + if (!isset($module->info[$element_name])) { + $element = $module->addBlankElement($element_name); + } else { + $element = $module->info[$element_name]; + } + $element->attr[$attr_name] = $def; + } + + /** + * Adds a custom element to your HTML definition + * @see HTMLPurifier_HTMLModule::addElement() for detailed + * parameter and return value descriptions. + */ + public function addElement($element_name, $type, $contents, $attr_collections, $attributes = array()) + { + $module = $this->getAnonymousModule(); + // assume that if the user is calling this, the element + // is safe. This may not be a good idea + $element = $module->addElement($element_name, $type, $contents, $attr_collections, $attributes); + return $element; + } + + /** + * Adds a blank element to your HTML definition, for overriding + * existing behavior + * @param string $element_name + * @return HTMLPurifier_ElementDef + * @see HTMLPurifier_HTMLModule::addBlankElement() for detailed + * parameter and return value descriptions. + */ + public function addBlankElement($element_name) + { + $module = $this->getAnonymousModule(); + $element = $module->addBlankElement($element_name); + return $element; + } + + /** + * Retrieves a reference to the anonymous module, so you can + * bust out advanced features without having to make your own + * module. + * @return HTMLPurifier_HTMLModule + */ + public function getAnonymousModule() + { + if (!$this->_anonModule) { + $this->_anonModule = new HTMLPurifier_HTMLModule(); + $this->_anonModule->name = 'Anonymous'; + } + return $this->_anonModule; + } + + private $_anonModule = null; + + // PUBLIC BUT INTERNAL VARIABLES -------------------------------------- + + /** + * @type string + */ + public $type = 'HTML'; + + /** + * @type HTMLPurifier_HTMLModuleManager + */ + public $manager; + + /** + * Performs low-cost, preliminary initialization. + */ + public function __construct() + { + $this->manager = new HTMLPurifier_HTMLModuleManager(); + } + + /** + * @param HTMLPurifier_Config $config + */ + protected function doSetup($config) + { + $this->processModules($config); + $this->setupConfigStuff($config); + unset($this->manager); + + // cleanup some of the element definitions + foreach ($this->info as $k => $v) { + unset($this->info[$k]->content_model); + unset($this->info[$k]->content_model_type); + } + } + + /** + * Extract out the information from the manager + * @param HTMLPurifier_Config $config + */ + protected function processModules($config) + { + if ($this->_anonModule) { + // for user specific changes + // this is late-loaded so we don't have to deal with PHP4 + // reference wonky-ness + $this->manager->addModule($this->_anonModule); + unset($this->_anonModule); + } + + $this->manager->setup($config); + $this->doctype = $this->manager->doctype; + + foreach ($this->manager->modules as $module) { + foreach ($module->info_tag_transform as $k => $v) { + if ($v === false) { + unset($this->info_tag_transform[$k]); + } else { + $this->info_tag_transform[$k] = $v; + } + } + foreach ($module->info_attr_transform_pre as $k => $v) { + if ($v === false) { + unset($this->info_attr_transform_pre[$k]); + } else { + $this->info_attr_transform_pre[$k] = $v; + } + } + foreach ($module->info_attr_transform_post as $k => $v) { + if ($v === false) { + unset($this->info_attr_transform_post[$k]); + } else { + $this->info_attr_transform_post[$k] = $v; + } + } + foreach ($module->info_injector as $k => $v) { + if ($v === false) { + unset($this->info_injector[$k]); + } else { + $this->info_injector[$k] = $v; + } + } + } + $this->info = $this->manager->getElements(); + $this->info_content_sets = $this->manager->contentSets->lookup; + } + + /** + * Sets up stuff based on config. We need a better way of doing this. + * @param HTMLPurifier_Config $config + */ + protected function setupConfigStuff($config) + { + $block_wrapper = $config->get('HTML.BlockWrapper'); + if (isset($this->info_content_sets['Block'][$block_wrapper])) { + $this->info_block_wrapper = $block_wrapper; + } else { + trigger_error( + 'Cannot use non-block element as block wrapper', + E_USER_ERROR + ); + } + + $parent = $config->get('HTML.Parent'); + $def = $this->manager->getElement($parent, true); + if ($def) { + $this->info_parent = $parent; + $this->info_parent_def = $def; + } else { + trigger_error( + 'Cannot use unrecognized element as parent', + E_USER_ERROR + ); + $this->info_parent_def = $this->manager->getElement($this->info_parent, true); + } + + // support template text + $support = "(for information on implementing this, see the support forums) "; + + // setup allowed elements ----------------------------------------- + + $allowed_elements = $config->get('HTML.AllowedElements'); + $allowed_attributes = $config->get('HTML.AllowedAttributes'); // retrieve early + + if (!is_array($allowed_elements) && !is_array($allowed_attributes)) { + $allowed = $config->get('HTML.Allowed'); + if (is_string($allowed)) { + list($allowed_elements, $allowed_attributes) = $this->parseTinyMCEAllowedList($allowed); + } + } + + if (is_array($allowed_elements)) { + foreach ($this->info as $name => $d) { + if (!isset($allowed_elements[$name])) { + unset($this->info[$name]); + } + unset($allowed_elements[$name]); + } + // emit errors + foreach ($allowed_elements as $element => $d) { + $element = htmlspecialchars($element); // PHP doesn't escape errors, be careful! + trigger_error("Element '$element' is not supported $support", E_USER_WARNING); + } + } + + // setup allowed attributes --------------------------------------- + + $allowed_attributes_mutable = $allowed_attributes; // by copy! + if (is_array($allowed_attributes)) { + // This actually doesn't do anything, since we went away from + // global attributes. It's possible that userland code uses + // it, but HTMLModuleManager doesn't! + foreach ($this->info_global_attr as $attr => $x) { + $keys = array($attr, "*@$attr", "*.$attr"); + $delete = true; + foreach ($keys as $key) { + if ($delete && isset($allowed_attributes[$key])) { + $delete = false; + } + if (isset($allowed_attributes_mutable[$key])) { + unset($allowed_attributes_mutable[$key]); + } + } + if ($delete) { + unset($this->info_global_attr[$attr]); + } + } + + foreach ($this->info as $tag => $info) { + foreach ($info->attr as $attr => $x) { + $keys = array("$tag@$attr", $attr, "*@$attr", "$tag.$attr", "*.$attr"); + $delete = true; + foreach ($keys as $key) { + if ($delete && isset($allowed_attributes[$key])) { + $delete = false; + } + if (isset($allowed_attributes_mutable[$key])) { + unset($allowed_attributes_mutable[$key]); + } + } + if ($delete) { + if ($this->info[$tag]->attr[$attr]->required) { + trigger_error( + "Required attribute '$attr' in element '$tag' " . + "was not allowed, which means '$tag' will not be allowed either", + E_USER_WARNING + ); + } + unset($this->info[$tag]->attr[$attr]); + } + } + } + // emit errors + foreach ($allowed_attributes_mutable as $elattr => $d) { + $bits = preg_split('/[.@]/', $elattr, 2); + $c = count($bits); + switch ($c) { + case 2: + if ($bits[0] !== '*') { + $element = htmlspecialchars($bits[0]); + $attribute = htmlspecialchars($bits[1]); + if (!isset($this->info[$element])) { + trigger_error( + "Cannot allow attribute '$attribute' if element " . + "'$element' is not allowed/supported $support" + ); + } else { + trigger_error( + "Attribute '$attribute' in element '$element' not supported $support", + E_USER_WARNING + ); + } + break; + } + // otherwise fall through + case 1: + $attribute = htmlspecialchars($bits[0]); + trigger_error( + "Global attribute '$attribute' is not ". + "supported in any elements $support", + E_USER_WARNING + ); + break; + } + } + } + + // setup forbidden elements --------------------------------------- + + $forbidden_elements = $config->get('HTML.ForbiddenElements'); + $forbidden_attributes = $config->get('HTML.ForbiddenAttributes'); + + foreach ($this->info as $tag => $info) { + if (isset($forbidden_elements[$tag])) { + unset($this->info[$tag]); + continue; + } + foreach ($info->attr as $attr => $x) { + if (isset($forbidden_attributes["$tag@$attr"]) || + isset($forbidden_attributes["*@$attr"]) || + isset($forbidden_attributes[$attr]) + ) { + unset($this->info[$tag]->attr[$attr]); + continue; + } elseif (isset($forbidden_attributes["$tag.$attr"])) { // this segment might get removed eventually + // $tag.$attr are not user supplied, so no worries! + trigger_error( + "Error with $tag.$attr: tag.attr syntax not supported for " . + "HTML.ForbiddenAttributes; use tag@attr instead", + E_USER_WARNING + ); + } + } + } + foreach ($forbidden_attributes as $key => $v) { + if (strlen($key) < 2) { + continue; + } + if ($key[0] != '*') { + continue; + } + if ($key[1] == '.') { + trigger_error( + "Error with $key: *.attr syntax not supported for HTML.ForbiddenAttributes; use attr instead", + E_USER_WARNING + ); + } + } + + // setup injectors ----------------------------------------------------- + foreach ($this->info_injector as $i => $injector) { + if ($injector->checkNeeded($config) !== false) { + // remove injector that does not have it's required + // elements/attributes present, and is thus not needed. + unset($this->info_injector[$i]); + } + } + } + + /** + * Parses a TinyMCE-flavored Allowed Elements and Attributes list into + * separate lists for processing. Format is element[attr1|attr2],element2... + * @warning Although it's largely drawn from TinyMCE's implementation, + * it is different, and you'll probably have to modify your lists + * @param array $list String list to parse + * @return array + * @todo Give this its own class, probably static interface + */ + public function parseTinyMCEAllowedList($list) + { + $list = str_replace(array(' ', "\t"), '', $list); + + $elements = array(); + $attributes = array(); + + $chunks = preg_split('/(,|[\n\r]+)/', $list); + foreach ($chunks as $chunk) { + if (empty($chunk)) { + continue; + } + // remove TinyMCE element control characters + if (!strpos($chunk, '[')) { + $element = $chunk; + $attr = false; + } else { + list($element, $attr) = explode('[', $chunk); + } + if ($element !== '*') { + $elements[$element] = true; + } + if (!$attr) { + continue; + } + $attr = substr($attr, 0, strlen($attr) - 1); // remove trailing ] + $attr = explode('|', $attr); + foreach ($attr as $key) { + $attributes["$element.$key"] = true; + } + } + return array($elements, $attributes); + } +} + +// vim: et sw=4 sts=4 diff --git a/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/HTMLModule.php b/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/HTMLModule.php similarity index 97% rename from plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/HTMLModule.php rename to plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/HTMLModule.php index 9877f9e..bb3a923 100755 --- a/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/HTMLModule.php +++ b/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/HTMLModule.php @@ -1,284 +1,284 @@ -info, since the object's data is only info, - * with extra behavior associated with it. - * @type array - */ - public $attr_collections = array(); - - /** - * Associative array of deprecated tag name to HTMLPurifier_TagTransform. - * @type array - */ - public $info_tag_transform = array(); - - /** - * List of HTMLPurifier_AttrTransform to be performed before validation. - * @type array - */ - public $info_attr_transform_pre = array(); - - /** - * List of HTMLPurifier_AttrTransform to be performed after validation. - * @type array - */ - public $info_attr_transform_post = array(); - - /** - * List of HTMLPurifier_Injector to be performed during well-formedness fixing. - * An injector will only be invoked if all of it's pre-requisites are met; - * if an injector fails setup, there will be no error; it will simply be - * silently disabled. - * @type array - */ - public $info_injector = array(); - - /** - * Boolean flag that indicates whether or not getChildDef is implemented. - * For optimization reasons: may save a call to a function. Be sure - * to set it if you do implement getChildDef(), otherwise it will have - * no effect! - * @type bool - */ - public $defines_child_def = false; - - /** - * Boolean flag whether or not this module is safe. If it is not safe, all - * of its members are unsafe. Modules are safe by default (this might be - * slightly dangerous, but it doesn't make much sense to force HTML Purifier, - * which is based off of safe HTML, to explicitly say, "This is safe," even - * though there are modules which are "unsafe") - * - * @type bool - * @note Previously, safety could be applied at an element level granularity. - * We've removed this ability, so in order to add "unsafe" elements - * or attributes, a dedicated module with this property set to false - * must be used. - */ - public $safe = true; - - /** - * Retrieves a proper HTMLPurifier_ChildDef subclass based on - * content_model and content_model_type member variables of - * the HTMLPurifier_ElementDef class. There is a similar function - * in HTMLPurifier_HTMLDefinition. - * @param HTMLPurifier_ElementDef $def - * @return HTMLPurifier_ChildDef subclass - */ - public function getChildDef($def) - { - return false; - } - - // -- Convenience ----------------------------------------------------- - - /** - * Convenience function that sets up a new element - * @param string $element Name of element to add - * @param string|bool $type What content set should element be registered to? - * Set as false to skip this step. - * @param string $contents Allowed children in form of: - * "$content_model_type: $content_model" - * @param array $attr_includes What attribute collections to register to - * element? - * @param array $attr What unique attributes does the element define? - * @see HTMLPurifier_ElementDef:: for in-depth descriptions of these parameters. - * @return HTMLPurifier_ElementDef Created element definition object, so you - * can set advanced parameters - */ - public function addElement($element, $type, $contents, $attr_includes = array(), $attr = array()) - { - $this->elements[] = $element; - // parse content_model - list($content_model_type, $content_model) = $this->parseContents($contents); - // merge in attribute inclusions - $this->mergeInAttrIncludes($attr, $attr_includes); - // add element to content sets - if ($type) { - $this->addElementToContentSet($element, $type); - } - // create element - $this->info[$element] = HTMLPurifier_ElementDef::create( - $content_model, - $content_model_type, - $attr - ); - // literal object $contents means direct child manipulation - if (!is_string($contents)) { - $this->info[$element]->child = $contents; - } - return $this->info[$element]; - } - - /** - * Convenience function that creates a totally blank, non-standalone - * element. - * @param string $element Name of element to create - * @return HTMLPurifier_ElementDef Created element - */ - public function addBlankElement($element) - { - if (!isset($this->info[$element])) { - $this->elements[] = $element; - $this->info[$element] = new HTMLPurifier_ElementDef(); - $this->info[$element]->standalone = false; - } else { - trigger_error("Definition for $element already exists in module, cannot redefine"); - } - return $this->info[$element]; - } - - /** - * Convenience function that registers an element to a content set - * @param string $element Element to register - * @param string $type Name content set (warning: case sensitive, usually upper-case - * first letter) - */ - public function addElementToContentSet($element, $type) - { - if (!isset($this->content_sets[$type])) { - $this->content_sets[$type] = ''; - } else { - $this->content_sets[$type] .= ' | '; - } - $this->content_sets[$type] .= $element; - } - - /** - * Convenience function that transforms single-string contents - * into separate content model and content model type - * @param string $contents Allowed children in form of: - * "$content_model_type: $content_model" - * @return array - * @note If contents is an object, an array of two nulls will be - * returned, and the callee needs to take the original $contents - * and use it directly. - */ - public function parseContents($contents) - { - if (!is_string($contents)) { - return array(null, null); - } // defer - switch ($contents) { - // check for shorthand content model forms - case 'Empty': - return array('empty', ''); - case 'Inline': - return array('optional', 'Inline | #PCDATA'); - case 'Flow': - return array('optional', 'Flow | #PCDATA'); - } - list($content_model_type, $content_model) = explode(':', $contents); - $content_model_type = strtolower(trim($content_model_type)); - $content_model = trim($content_model); - return array($content_model_type, $content_model); - } - - /** - * Convenience function that merges a list of attribute includes into - * an attribute array. - * @param array $attr Reference to attr array to modify - * @param array $attr_includes Array of includes / string include to merge in - */ - public function mergeInAttrIncludes(&$attr, $attr_includes) - { - if (!is_array($attr_includes)) { - if (empty($attr_includes)) { - $attr_includes = array(); - } else { - $attr_includes = array($attr_includes); - } - } - $attr[0] = $attr_includes; - } - - /** - * Convenience function that generates a lookup table with boolean - * true as value. - * @param string $list List of values to turn into a lookup - * @note You can also pass an arbitrary number of arguments in - * place of the regular argument - * @return array array equivalent of list - */ - public function makeLookup($list) - { - if (is_string($list)) { - $list = func_get_args(); - } - $ret = array(); - foreach ($list as $value) { - if (is_null($value)) { - continue; - } - $ret[$value] = true; - } - return $ret; - } - - /** - * Lazy load construction of the module after determining whether - * or not it's needed, and also when a finalized configuration object - * is available. - * @param HTMLPurifier_Config $config - */ - public function setup($config) - { - } -} - -// vim: et sw=4 sts=4 +info, since the object's data is only info, + * with extra behavior associated with it. + * @type array + */ + public $attr_collections = array(); + + /** + * Associative array of deprecated tag name to HTMLPurifier_TagTransform. + * @type array + */ + public $info_tag_transform = array(); + + /** + * List of HTMLPurifier_AttrTransform to be performed before validation. + * @type array + */ + public $info_attr_transform_pre = array(); + + /** + * List of HTMLPurifier_AttrTransform to be performed after validation. + * @type array + */ + public $info_attr_transform_post = array(); + + /** + * List of HTMLPurifier_Injector to be performed during well-formedness fixing. + * An injector will only be invoked if all of it's pre-requisites are met; + * if an injector fails setup, there will be no error; it will simply be + * silently disabled. + * @type array + */ + public $info_injector = array(); + + /** + * Boolean flag that indicates whether or not getChildDef is implemented. + * For optimization reasons: may save a call to a function. Be sure + * to set it if you do implement getChildDef(), otherwise it will have + * no effect! + * @type bool + */ + public $defines_child_def = false; + + /** + * Boolean flag whether or not this module is safe. If it is not safe, all + * of its members are unsafe. Modules are safe by default (this might be + * slightly dangerous, but it doesn't make much sense to force HTML Purifier, + * which is based off of safe HTML, to explicitly say, "This is safe," even + * though there are modules which are "unsafe") + * + * @type bool + * @note Previously, safety could be applied at an element level granularity. + * We've removed this ability, so in order to add "unsafe" elements + * or attributes, a dedicated module with this property set to false + * must be used. + */ + public $safe = true; + + /** + * Retrieves a proper HTMLPurifier_ChildDef subclass based on + * content_model and content_model_type member variables of + * the HTMLPurifier_ElementDef class. There is a similar function + * in HTMLPurifier_HTMLDefinition. + * @param HTMLPurifier_ElementDef $def + * @return HTMLPurifier_ChildDef subclass + */ + public function getChildDef($def) + { + return false; + } + + // -- Convenience ----------------------------------------------------- + + /** + * Convenience function that sets up a new element + * @param string $element Name of element to add + * @param string|bool $type What content set should element be registered to? + * Set as false to skip this step. + * @param string $contents Allowed children in form of: + * "$content_model_type: $content_model" + * @param array $attr_includes What attribute collections to register to + * element? + * @param array $attr What unique attributes does the element define? + * @see HTMLPurifier_ElementDef:: for in-depth descriptions of these parameters. + * @return HTMLPurifier_ElementDef Created element definition object, so you + * can set advanced parameters + */ + public function addElement($element, $type, $contents, $attr_includes = array(), $attr = array()) + { + $this->elements[] = $element; + // parse content_model + list($content_model_type, $content_model) = $this->parseContents($contents); + // merge in attribute inclusions + $this->mergeInAttrIncludes($attr, $attr_includes); + // add element to content sets + if ($type) { + $this->addElementToContentSet($element, $type); + } + // create element + $this->info[$element] = HTMLPurifier_ElementDef::create( + $content_model, + $content_model_type, + $attr + ); + // literal object $contents means direct child manipulation + if (!is_string($contents)) { + $this->info[$element]->child = $contents; + } + return $this->info[$element]; + } + + /** + * Convenience function that creates a totally blank, non-standalone + * element. + * @param string $element Name of element to create + * @return HTMLPurifier_ElementDef Created element + */ + public function addBlankElement($element) + { + if (!isset($this->info[$element])) { + $this->elements[] = $element; + $this->info[$element] = new HTMLPurifier_ElementDef(); + $this->info[$element]->standalone = false; + } else { + trigger_error("Definition for $element already exists in module, cannot redefine"); + } + return $this->info[$element]; + } + + /** + * Convenience function that registers an element to a content set + * @param string $element Element to register + * @param string $type Name content set (warning: case sensitive, usually upper-case + * first letter) + */ + public function addElementToContentSet($element, $type) + { + if (!isset($this->content_sets[$type])) { + $this->content_sets[$type] = ''; + } else { + $this->content_sets[$type] .= ' | '; + } + $this->content_sets[$type] .= $element; + } + + /** + * Convenience function that transforms single-string contents + * into separate content model and content model type + * @param string $contents Allowed children in form of: + * "$content_model_type: $content_model" + * @return array + * @note If contents is an object, an array of two nulls will be + * returned, and the callee needs to take the original $contents + * and use it directly. + */ + public function parseContents($contents) + { + if (!is_string($contents)) { + return array(null, null); + } // defer + switch ($contents) { + // check for shorthand content model forms + case 'Empty': + return array('empty', ''); + case 'Inline': + return array('optional', 'Inline | #PCDATA'); + case 'Flow': + return array('optional', 'Flow | #PCDATA'); + } + list($content_model_type, $content_model) = explode(':', $contents); + $content_model_type = strtolower(trim($content_model_type)); + $content_model = trim($content_model); + return array($content_model_type, $content_model); + } + + /** + * Convenience function that merges a list of attribute includes into + * an attribute array. + * @param array $attr Reference to attr array to modify + * @param array $attr_includes Array of includes / string include to merge in + */ + public function mergeInAttrIncludes(&$attr, $attr_includes) + { + if (!is_array($attr_includes)) { + if (empty($attr_includes)) { + $attr_includes = array(); + } else { + $attr_includes = array($attr_includes); + } + } + $attr[0] = $attr_includes; + } + + /** + * Convenience function that generates a lookup table with boolean + * true as value. + * @param string $list List of values to turn into a lookup + * @note You can also pass an arbitrary number of arguments in + * place of the regular argument + * @return array array equivalent of list + */ + public function makeLookup($list) + { + if (is_string($list)) { + $list = func_get_args(); + } + $ret = array(); + foreach ($list as $value) { + if (is_null($value)) { + continue; + } + $ret[$value] = true; + } + return $ret; + } + + /** + * Lazy load construction of the module after determining whether + * or not it's needed, and also when a finalized configuration object + * is available. + * @param HTMLPurifier_Config $config + */ + public function setup($config) + { + } +} + +// vim: et sw=4 sts=4 diff --git a/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/HTMLModule/Bdo.php b/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/HTMLModule/Bdo.php similarity index 95% rename from plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/HTMLModule/Bdo.php rename to plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/HTMLModule/Bdo.php index 191a78d..1e67c79 100755 --- a/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/HTMLModule/Bdo.php +++ b/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/HTMLModule/Bdo.php @@ -1,44 +1,44 @@ - array('dir' => false) - ); - - /** - * @param HTMLPurifier_Config $config - */ - public function setup($config) - { - $bdo = $this->addElement( - 'bdo', - 'Inline', - 'Inline', - array('Core', 'Lang'), - array( - 'dir' => 'Enum#ltr,rtl', // required - // The Abstract Module specification has the attribute - // inclusions wrong for bdo: bdo allows Lang - ) - ); - $bdo->attr_transform_post[] = new HTMLPurifier_AttrTransform_BdoDir(); - - $this->attr_collections['I18N']['dir'] = 'Enum#ltr,rtl'; - } -} - -// vim: et sw=4 sts=4 + array('dir' => false) + ); + + /** + * @param HTMLPurifier_Config $config + */ + public function setup($config) + { + $bdo = $this->addElement( + 'bdo', + 'Inline', + 'Inline', + array('Core', 'Lang'), + array( + 'dir' => 'Enum#ltr,rtl', // required + // The Abstract Module specification has the attribute + // inclusions wrong for bdo: bdo allows Lang + ) + ); + $bdo->attr_transform_post[] = new HTMLPurifier_AttrTransform_BdoDir(); + + $this->attr_collections['I18N']['dir'] = 'Enum#ltr,rtl'; + } +} + +// vim: et sw=4 sts=4 diff --git a/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/HTMLModule/CommonAttributes.php b/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/HTMLModule/CommonAttributes.php similarity index 95% rename from plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/HTMLModule/CommonAttributes.php rename to plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/HTMLModule/CommonAttributes.php index e2fe53f..a96ab1b 100755 --- a/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/HTMLModule/CommonAttributes.php +++ b/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/HTMLModule/CommonAttributes.php @@ -1,31 +1,31 @@ - array( - 0 => array('Style'), - // 'xml:space' => false, - 'class' => 'Class', - 'id' => 'ID', - 'title' => 'CDATA', - ), - 'Lang' => array(), - 'I18N' => array( - 0 => array('Lang'), // proprietary, for xml:lang/lang - ), - 'Common' => array( - 0 => array('Core', 'I18N') - ) - ); -} - -// vim: et sw=4 sts=4 + array( + 0 => array('Style'), + // 'xml:space' => false, + 'class' => 'Class', + 'id' => 'ID', + 'title' => 'CDATA', + ), + 'Lang' => array(), + 'I18N' => array( + 0 => array('Lang'), // proprietary, for xml:lang/lang + ), + 'Common' => array( + 0 => array('Core', 'I18N') + ) + ); +} + +// vim: et sw=4 sts=4 diff --git a/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/HTMLModule/Edit.php b/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/HTMLModule/Edit.php similarity index 96% rename from plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/HTMLModule/Edit.php rename to plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/HTMLModule/Edit.php index b828836..a9042a3 100755 --- a/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/HTMLModule/Edit.php +++ b/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/HTMLModule/Edit.php @@ -1,55 +1,55 @@ - 'URI', - // 'datetime' => 'Datetime', // not implemented - ); - $this->addElement('del', 'Inline', $contents, 'Common', $attr); - $this->addElement('ins', 'Inline', $contents, 'Common', $attr); - } - - // HTML 4.01 specifies that ins/del must not contain block - // elements when used in an inline context, chameleon is - // a complicated workaround to acheive this effect - - // Inline context ! Block context (exclamation mark is - // separator, see getChildDef for parsing) - - /** - * @type bool - */ - public $defines_child_def = true; - - /** - * @param HTMLPurifier_ElementDef $def - * @return HTMLPurifier_ChildDef_Chameleon - */ - public function getChildDef($def) - { - if ($def->content_model_type != 'chameleon') { - return false; - } - $value = explode('!', $def->content_model); - return new HTMLPurifier_ChildDef_Chameleon($value[0], $value[1]); - } -} - -// vim: et sw=4 sts=4 + 'URI', + // 'datetime' => 'Datetime', // not implemented + ); + $this->addElement('del', 'Inline', $contents, 'Common', $attr); + $this->addElement('ins', 'Inline', $contents, 'Common', $attr); + } + + // HTML 4.01 specifies that ins/del must not contain block + // elements when used in an inline context, chameleon is + // a complicated workaround to acheive this effect + + // Inline context ! Block context (exclamation mark is + // separator, see getChildDef for parsing) + + /** + * @type bool + */ + public $defines_child_def = true; + + /** + * @param HTMLPurifier_ElementDef $def + * @return HTMLPurifier_ChildDef_Chameleon + */ + public function getChildDef($def) + { + if ($def->content_model_type != 'chameleon') { + return false; + } + $value = explode('!', $def->content_model); + return new HTMLPurifier_ChildDef_Chameleon($value[0], $value[1]); + } +} + +// vim: et sw=4 sts=4 diff --git a/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/HTMLModule/Forms.php b/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/HTMLModule/Forms.php similarity index 96% rename from plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/HTMLModule/Forms.php rename to plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/HTMLModule/Forms.php index 13ce6ad..6f7ddbc 100755 --- a/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/HTMLModule/Forms.php +++ b/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/HTMLModule/Forms.php @@ -1,190 +1,190 @@ - 'Form', - 'Inline' => 'Formctrl', - ); - - /** - * @param HTMLPurifier_Config $config - */ - public function setup($config) - { - $form = $this->addElement( - 'form', - 'Form', - 'Required: Heading | List | Block | fieldset', - 'Common', - array( - 'accept' => 'ContentTypes', - 'accept-charset' => 'Charsets', - 'action*' => 'URI', - 'method' => 'Enum#get,post', - // really ContentType, but these two are the only ones used today - 'enctype' => 'Enum#application/x-www-form-urlencoded,multipart/form-data', - ) - ); - $form->excludes = array('form' => true); - - $input = $this->addElement( - 'input', - 'Formctrl', - 'Empty', - 'Common', - array( - 'accept' => 'ContentTypes', - 'accesskey' => 'Character', - 'alt' => 'Text', - 'checked' => 'Bool#checked', - 'disabled' => 'Bool#disabled', - 'maxlength' => 'Number', - 'name' => 'CDATA', - 'readonly' => 'Bool#readonly', - 'size' => 'Number', - 'src' => 'URI#embedded', - 'tabindex' => 'Number', - 'type' => 'Enum#text,password,checkbox,button,radio,submit,reset,file,hidden,image', - 'value' => 'CDATA', - ) - ); - $input->attr_transform_post[] = new HTMLPurifier_AttrTransform_Input(); - - $this->addElement( - 'select', - 'Formctrl', - 'Required: optgroup | option', - 'Common', - array( - 'disabled' => 'Bool#disabled', - 'multiple' => 'Bool#multiple', - 'name' => 'CDATA', - 'size' => 'Number', - 'tabindex' => 'Number', - ) - ); - - $this->addElement( - 'option', - false, - 'Optional: #PCDATA', - 'Common', - array( - 'disabled' => 'Bool#disabled', - 'label' => 'Text', - 'selected' => 'Bool#selected', - 'value' => 'CDATA', - ) - ); - // It's illegal for there to be more than one selected, but not - // be multiple. Also, no selected means undefined behavior. This might - // be difficult to implement; perhaps an injector, or a context variable. - - $textarea = $this->addElement( - 'textarea', - 'Formctrl', - 'Optional: #PCDATA', - 'Common', - array( - 'accesskey' => 'Character', - 'cols*' => 'Number', - 'disabled' => 'Bool#disabled', - 'name' => 'CDATA', - 'readonly' => 'Bool#readonly', - 'rows*' => 'Number', - 'tabindex' => 'Number', - ) - ); - $textarea->attr_transform_pre[] = new HTMLPurifier_AttrTransform_Textarea(); - - $button = $this->addElement( - 'button', - 'Formctrl', - 'Optional: #PCDATA | Heading | List | Block | Inline', - 'Common', - array( - 'accesskey' => 'Character', - 'disabled' => 'Bool#disabled', - 'name' => 'CDATA', - 'tabindex' => 'Number', - 'type' => 'Enum#button,submit,reset', - 'value' => 'CDATA', - ) - ); - - // For exclusions, ideally we'd specify content sets, not literal elements - $button->excludes = $this->makeLookup( - 'form', - 'fieldset', // Form - 'input', - 'select', - 'textarea', - 'label', - 'button', // Formctrl - 'a', // as per HTML 4.01 spec, this is omitted by modularization - 'isindex', - 'iframe' // legacy items - ); - - // Extra exclusion: img usemap="" is not permitted within this element. - // We'll omit this for now, since we don't have any good way of - // indicating it yet. - - // This is HIGHLY user-unfriendly; we need a custom child-def for this - $this->addElement('fieldset', 'Form', 'Custom: (#WS?,legend,(Flow|#PCDATA)*)', 'Common'); - - $label = $this->addElement( - 'label', - 'Formctrl', - 'Optional: #PCDATA | Inline', - 'Common', - array( - 'accesskey' => 'Character', - // 'for' => 'IDREF', // IDREF not implemented, cannot allow - ) - ); - $label->excludes = array('label' => true); - - $this->addElement( - 'legend', - false, - 'Optional: #PCDATA | Inline', - 'Common', - array( - 'accesskey' => 'Character', - ) - ); - - $this->addElement( - 'optgroup', - false, - 'Required: option', - 'Common', - array( - 'disabled' => 'Bool#disabled', - 'label*' => 'Text', - ) - ); - // Don't forget an injector for . This one's a little complex - // because it maps to multiple elements. - } -} - -// vim: et sw=4 sts=4 + 'Form', + 'Inline' => 'Formctrl', + ); + + /** + * @param HTMLPurifier_Config $config + */ + public function setup($config) + { + $form = $this->addElement( + 'form', + 'Form', + 'Required: Heading | List | Block | fieldset', + 'Common', + array( + 'accept' => 'ContentTypes', + 'accept-charset' => 'Charsets', + 'action*' => 'URI', + 'method' => 'Enum#get,post', + // really ContentType, but these two are the only ones used today + 'enctype' => 'Enum#application/x-www-form-urlencoded,multipart/form-data', + ) + ); + $form->excludes = array('form' => true); + + $input = $this->addElement( + 'input', + 'Formctrl', + 'Empty', + 'Common', + array( + 'accept' => 'ContentTypes', + 'accesskey' => 'Character', + 'alt' => 'Text', + 'checked' => 'Bool#checked', + 'disabled' => 'Bool#disabled', + 'maxlength' => 'Number', + 'name' => 'CDATA', + 'readonly' => 'Bool#readonly', + 'size' => 'Number', + 'src' => 'URI#embedded', + 'tabindex' => 'Number', + 'type' => 'Enum#text,password,checkbox,button,radio,submit,reset,file,hidden,image', + 'value' => 'CDATA', + ) + ); + $input->attr_transform_post[] = new HTMLPurifier_AttrTransform_Input(); + + $this->addElement( + 'select', + 'Formctrl', + 'Required: optgroup | option', + 'Common', + array( + 'disabled' => 'Bool#disabled', + 'multiple' => 'Bool#multiple', + 'name' => 'CDATA', + 'size' => 'Number', + 'tabindex' => 'Number', + ) + ); + + $this->addElement( + 'option', + false, + 'Optional: #PCDATA', + 'Common', + array( + 'disabled' => 'Bool#disabled', + 'label' => 'Text', + 'selected' => 'Bool#selected', + 'value' => 'CDATA', + ) + ); + // It's illegal for there to be more than one selected, but not + // be multiple. Also, no selected means undefined behavior. This might + // be difficult to implement; perhaps an injector, or a context variable. + + $textarea = $this->addElement( + 'textarea', + 'Formctrl', + 'Optional: #PCDATA', + 'Common', + array( + 'accesskey' => 'Character', + 'cols*' => 'Number', + 'disabled' => 'Bool#disabled', + 'name' => 'CDATA', + 'readonly' => 'Bool#readonly', + 'rows*' => 'Number', + 'tabindex' => 'Number', + ) + ); + $textarea->attr_transform_pre[] = new HTMLPurifier_AttrTransform_Textarea(); + + $button = $this->addElement( + 'button', + 'Formctrl', + 'Optional: #PCDATA | Heading | List | Block | Inline', + 'Common', + array( + 'accesskey' => 'Character', + 'disabled' => 'Bool#disabled', + 'name' => 'CDATA', + 'tabindex' => 'Number', + 'type' => 'Enum#button,submit,reset', + 'value' => 'CDATA', + ) + ); + + // For exclusions, ideally we'd specify content sets, not literal elements + $button->excludes = $this->makeLookup( + 'form', + 'fieldset', // Form + 'input', + 'select', + 'textarea', + 'label', + 'button', // Formctrl + 'a', // as per HTML 4.01 spec, this is omitted by modularization + 'isindex', + 'iframe' // legacy items + ); + + // Extra exclusion: img usemap="" is not permitted within this element. + // We'll omit this for now, since we don't have any good way of + // indicating it yet. + + // This is HIGHLY user-unfriendly; we need a custom child-def for this + $this->addElement('fieldset', 'Form', 'Custom: (#WS?,legend,(Flow|#PCDATA)*)', 'Common'); + + $label = $this->addElement( + 'label', + 'Formctrl', + 'Optional: #PCDATA | Inline', + 'Common', + array( + 'accesskey' => 'Character', + // 'for' => 'IDREF', // IDREF not implemented, cannot allow + ) + ); + $label->excludes = array('label' => true); + + $this->addElement( + 'legend', + false, + 'Optional: #PCDATA | Inline', + 'Common', + array( + 'accesskey' => 'Character', + ) + ); + + $this->addElement( + 'optgroup', + false, + 'Required: option', + 'Common', + array( + 'disabled' => 'Bool#disabled', + 'label*' => 'Text', + ) + ); + // Don't forget an injector for . This one's a little complex + // because it maps to multiple elements. + } +} + +// vim: et sw=4 sts=4 diff --git a/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/HTMLModule/Hypertext.php b/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/HTMLModule/Hypertext.php similarity index 96% rename from plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/HTMLModule/Hypertext.php rename to plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/HTMLModule/Hypertext.php index 968c07e..72d7a31 100755 --- a/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/HTMLModule/Hypertext.php +++ b/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/HTMLModule/Hypertext.php @@ -1,40 +1,40 @@ -addElement( - 'a', - 'Inline', - 'Inline', - 'Common', - array( - // 'accesskey' => 'Character', - // 'charset' => 'Charset', - 'href' => 'URI', - // 'hreflang' => 'LanguageCode', - 'rel' => new HTMLPurifier_AttrDef_HTML_LinkTypes('rel'), - 'rev' => new HTMLPurifier_AttrDef_HTML_LinkTypes('rev'), - // 'tabindex' => 'Number', - // 'type' => 'ContentType', - ) - ); - $a->formatting = true; - $a->excludes = array('a' => true); - } -} - -// vim: et sw=4 sts=4 +addElement( + 'a', + 'Inline', + 'Inline', + 'Common', + array( + // 'accesskey' => 'Character', + // 'charset' => 'Charset', + 'href' => 'URI', + // 'hreflang' => 'LanguageCode', + 'rel' => new HTMLPurifier_AttrDef_HTML_LinkTypes('rel'), + 'rev' => new HTMLPurifier_AttrDef_HTML_LinkTypes('rev'), + // 'tabindex' => 'Number', + // 'type' => 'ContentType', + ) + ); + $a->formatting = true; + $a->excludes = array('a' => true); + } +} + +// vim: et sw=4 sts=4 diff --git a/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/HTMLModule/Iframe.php b/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/HTMLModule/Iframe.php similarity index 95% rename from plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/HTMLModule/Iframe.php rename to plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/HTMLModule/Iframe.php index 2c9bdc5..f7e7c91 100755 --- a/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/HTMLModule/Iframe.php +++ b/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/HTMLModule/Iframe.php @@ -1,51 +1,51 @@ -get('HTML.SafeIframe')) { - $this->safe = true; - } - $this->addElement( - 'iframe', - 'Inline', - 'Flow', - 'Common', - array( - 'src' => 'URI#embedded', - 'width' => 'Length', - 'height' => 'Length', - 'name' => 'ID', - 'scrolling' => 'Enum#yes,no,auto', - 'frameborder' => 'Enum#0,1', - 'longdesc' => 'URI', - 'marginheight' => 'Pixels', - 'marginwidth' => 'Pixels', - ) - ); - } -} - -// vim: et sw=4 sts=4 +get('HTML.SafeIframe')) { + $this->safe = true; + } + $this->addElement( + 'iframe', + 'Inline', + 'Flow', + 'Common', + array( + 'src' => 'URI#embedded', + 'width' => 'Length', + 'height' => 'Length', + 'name' => 'ID', + 'scrolling' => 'Enum#yes,no,auto', + 'frameborder' => 'Enum#0,1', + 'longdesc' => 'URI', + 'marginheight' => 'Pixels', + 'marginwidth' => 'Pixels', + ) + ); + } +} + +// vim: et sw=4 sts=4 diff --git a/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/HTMLModule/Image.php b/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/HTMLModule/Image.php similarity index 96% rename from plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/HTMLModule/Image.php rename to plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/HTMLModule/Image.php index 0ed7411..0f5fdb3 100755 --- a/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/HTMLModule/Image.php +++ b/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/HTMLModule/Image.php @@ -1,49 +1,49 @@ -get('HTML.MaxImgLength'); - $img = $this->addElement( - 'img', - 'Inline', - 'Empty', - 'Common', - array( - 'alt*' => 'Text', - // According to the spec, it's Length, but percents can - // be abused, so we allow only Pixels. - 'height' => 'Pixels#' . $max, - 'width' => 'Pixels#' . $max, - 'longdesc' => 'URI', - 'src*' => new HTMLPurifier_AttrDef_URI(true), // embedded - ) - ); - if ($max === null || $config->get('HTML.Trusted')) { - $img->attr['height'] = - $img->attr['width'] = 'Length'; - } - - // kind of strange, but splitting things up would be inefficient - $img->attr_transform_pre[] = - $img->attr_transform_post[] = - new HTMLPurifier_AttrTransform_ImgRequired(); - } -} - -// vim: et sw=4 sts=4 +get('HTML.MaxImgLength'); + $img = $this->addElement( + 'img', + 'Inline', + 'Empty', + 'Common', + array( + 'alt*' => 'Text', + // According to the spec, it's Length, but percents can + // be abused, so we allow only Pixels. + 'height' => 'Pixels#' . $max, + 'width' => 'Pixels#' . $max, + 'longdesc' => 'URI', + 'src*' => new HTMLPurifier_AttrDef_URI(true), // embedded + ) + ); + if ($max === null || $config->get('HTML.Trusted')) { + $img->attr['height'] = + $img->attr['width'] = 'Length'; + } + + // kind of strange, but splitting things up would be inefficient + $img->attr_transform_pre[] = + $img->attr_transform_post[] = + new HTMLPurifier_AttrTransform_ImgRequired(); + } +} + +// vim: et sw=4 sts=4 diff --git a/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/HTMLModule/Legacy.php b/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/HTMLModule/Legacy.php similarity index 96% rename from plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/HTMLModule/Legacy.php rename to plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/HTMLModule/Legacy.php index 9ca1cb3..86b5299 100755 --- a/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/HTMLModule/Legacy.php +++ b/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/HTMLModule/Legacy.php @@ -1,186 +1,186 @@ -addElement( - 'basefont', - 'Inline', - 'Empty', - null, - array( - 'color' => 'Color', - 'face' => 'Text', // extremely broad, we should - 'size' => 'Text', // tighten it - 'id' => 'ID' - ) - ); - $this->addElement('center', 'Block', 'Flow', 'Common'); - $this->addElement( - 'dir', - 'Block', - 'Required: li', - 'Common', - array( - 'compact' => 'Bool#compact' - ) - ); - $this->addElement( - 'font', - 'Inline', - 'Inline', - array('Core', 'I18N'), - array( - 'color' => 'Color', - 'face' => 'Text', // extremely broad, we should - 'size' => 'Text', // tighten it - ) - ); - $this->addElement( - 'menu', - 'Block', - 'Required: li', - 'Common', - array( - 'compact' => 'Bool#compact' - ) - ); - - $s = $this->addElement('s', 'Inline', 'Inline', 'Common'); - $s->formatting = true; - - $strike = $this->addElement('strike', 'Inline', 'Inline', 'Common'); - $strike->formatting = true; - - $u = $this->addElement('u', 'Inline', 'Inline', 'Common'); - $u->formatting = true; - - // setup modifications to old elements - - $align = 'Enum#left,right,center,justify'; - - $address = $this->addBlankElement('address'); - $address->content_model = 'Inline | #PCDATA | p'; - $address->content_model_type = 'optional'; - $address->child = false; - - $blockquote = $this->addBlankElement('blockquote'); - $blockquote->content_model = 'Flow | #PCDATA'; - $blockquote->content_model_type = 'optional'; - $blockquote->child = false; - - $br = $this->addBlankElement('br'); - $br->attr['clear'] = 'Enum#left,all,right,none'; - - $caption = $this->addBlankElement('caption'); - $caption->attr['align'] = 'Enum#top,bottom,left,right'; - - $div = $this->addBlankElement('div'); - $div->attr['align'] = $align; - - $dl = $this->addBlankElement('dl'); - $dl->attr['compact'] = 'Bool#compact'; - - for ($i = 1; $i <= 6; $i++) { - $h = $this->addBlankElement("h$i"); - $h->attr['align'] = $align; - } - - $hr = $this->addBlankElement('hr'); - $hr->attr['align'] = $align; - $hr->attr['noshade'] = 'Bool#noshade'; - $hr->attr['size'] = 'Pixels'; - $hr->attr['width'] = 'Length'; - - $img = $this->addBlankElement('img'); - $img->attr['align'] = 'IAlign'; - $img->attr['border'] = 'Pixels'; - $img->attr['hspace'] = 'Pixels'; - $img->attr['vspace'] = 'Pixels'; - - // figure out this integer business - - $li = $this->addBlankElement('li'); - $li->attr['value'] = new HTMLPurifier_AttrDef_Integer(); - $li->attr['type'] = 'Enum#s:1,i,I,a,A,disc,square,circle'; - - $ol = $this->addBlankElement('ol'); - $ol->attr['compact'] = 'Bool#compact'; - $ol->attr['start'] = new HTMLPurifier_AttrDef_Integer(); - $ol->attr['type'] = 'Enum#s:1,i,I,a,A'; - - $p = $this->addBlankElement('p'); - $p->attr['align'] = $align; - - $pre = $this->addBlankElement('pre'); - $pre->attr['width'] = 'Number'; - - // script omitted - - $table = $this->addBlankElement('table'); - $table->attr['align'] = 'Enum#left,center,right'; - $table->attr['bgcolor'] = 'Color'; - - $tr = $this->addBlankElement('tr'); - $tr->attr['bgcolor'] = 'Color'; - - $th = $this->addBlankElement('th'); - $th->attr['bgcolor'] = 'Color'; - $th->attr['height'] = 'Length'; - $th->attr['nowrap'] = 'Bool#nowrap'; - $th->attr['width'] = 'Length'; - - $td = $this->addBlankElement('td'); - $td->attr['bgcolor'] = 'Color'; - $td->attr['height'] = 'Length'; - $td->attr['nowrap'] = 'Bool#nowrap'; - $td->attr['width'] = 'Length'; - - $ul = $this->addBlankElement('ul'); - $ul->attr['compact'] = 'Bool#compact'; - $ul->attr['type'] = 'Enum#square,disc,circle'; - - // "safe" modifications to "unsafe" elements - // WARNING: If you want to add support for an unsafe, legacy - // attribute, make a new TrustedLegacy module with the trusted - // bit set appropriately - - $form = $this->addBlankElement('form'); - $form->content_model = 'Flow | #PCDATA'; - $form->content_model_type = 'optional'; - $form->attr['target'] = 'FrameTarget'; - - $input = $this->addBlankElement('input'); - $input->attr['align'] = 'IAlign'; - - $legend = $this->addBlankElement('legend'); - $legend->attr['align'] = 'LAlign'; - } -} - -// vim: et sw=4 sts=4 +addElement( + 'basefont', + 'Inline', + 'Empty', + null, + array( + 'color' => 'Color', + 'face' => 'Text', // extremely broad, we should + 'size' => 'Text', // tighten it + 'id' => 'ID' + ) + ); + $this->addElement('center', 'Block', 'Flow', 'Common'); + $this->addElement( + 'dir', + 'Block', + 'Required: li', + 'Common', + array( + 'compact' => 'Bool#compact' + ) + ); + $this->addElement( + 'font', + 'Inline', + 'Inline', + array('Core', 'I18N'), + array( + 'color' => 'Color', + 'face' => 'Text', // extremely broad, we should + 'size' => 'Text', // tighten it + ) + ); + $this->addElement( + 'menu', + 'Block', + 'Required: li', + 'Common', + array( + 'compact' => 'Bool#compact' + ) + ); + + $s = $this->addElement('s', 'Inline', 'Inline', 'Common'); + $s->formatting = true; + + $strike = $this->addElement('strike', 'Inline', 'Inline', 'Common'); + $strike->formatting = true; + + $u = $this->addElement('u', 'Inline', 'Inline', 'Common'); + $u->formatting = true; + + // setup modifications to old elements + + $align = 'Enum#left,right,center,justify'; + + $address = $this->addBlankElement('address'); + $address->content_model = 'Inline | #PCDATA | p'; + $address->content_model_type = 'optional'; + $address->child = false; + + $blockquote = $this->addBlankElement('blockquote'); + $blockquote->content_model = 'Flow | #PCDATA'; + $blockquote->content_model_type = 'optional'; + $blockquote->child = false; + + $br = $this->addBlankElement('br'); + $br->attr['clear'] = 'Enum#left,all,right,none'; + + $caption = $this->addBlankElement('caption'); + $caption->attr['align'] = 'Enum#top,bottom,left,right'; + + $div = $this->addBlankElement('div'); + $div->attr['align'] = $align; + + $dl = $this->addBlankElement('dl'); + $dl->attr['compact'] = 'Bool#compact'; + + for ($i = 1; $i <= 6; $i++) { + $h = $this->addBlankElement("h$i"); + $h->attr['align'] = $align; + } + + $hr = $this->addBlankElement('hr'); + $hr->attr['align'] = $align; + $hr->attr['noshade'] = 'Bool#noshade'; + $hr->attr['size'] = 'Pixels'; + $hr->attr['width'] = 'Length'; + + $img = $this->addBlankElement('img'); + $img->attr['align'] = 'IAlign'; + $img->attr['border'] = 'Pixels'; + $img->attr['hspace'] = 'Pixels'; + $img->attr['vspace'] = 'Pixels'; + + // figure out this integer business + + $li = $this->addBlankElement('li'); + $li->attr['value'] = new HTMLPurifier_AttrDef_Integer(); + $li->attr['type'] = 'Enum#s:1,i,I,a,A,disc,square,circle'; + + $ol = $this->addBlankElement('ol'); + $ol->attr['compact'] = 'Bool#compact'; + $ol->attr['start'] = new HTMLPurifier_AttrDef_Integer(); + $ol->attr['type'] = 'Enum#s:1,i,I,a,A'; + + $p = $this->addBlankElement('p'); + $p->attr['align'] = $align; + + $pre = $this->addBlankElement('pre'); + $pre->attr['width'] = 'Number'; + + // script omitted + + $table = $this->addBlankElement('table'); + $table->attr['align'] = 'Enum#left,center,right'; + $table->attr['bgcolor'] = 'Color'; + + $tr = $this->addBlankElement('tr'); + $tr->attr['bgcolor'] = 'Color'; + + $th = $this->addBlankElement('th'); + $th->attr['bgcolor'] = 'Color'; + $th->attr['height'] = 'Length'; + $th->attr['nowrap'] = 'Bool#nowrap'; + $th->attr['width'] = 'Length'; + + $td = $this->addBlankElement('td'); + $td->attr['bgcolor'] = 'Color'; + $td->attr['height'] = 'Length'; + $td->attr['nowrap'] = 'Bool#nowrap'; + $td->attr['width'] = 'Length'; + + $ul = $this->addBlankElement('ul'); + $ul->attr['compact'] = 'Bool#compact'; + $ul->attr['type'] = 'Enum#square,disc,circle'; + + // "safe" modifications to "unsafe" elements + // WARNING: If you want to add support for an unsafe, legacy + // attribute, make a new TrustedLegacy module with the trusted + // bit set appropriately + + $form = $this->addBlankElement('form'); + $form->content_model = 'Flow | #PCDATA'; + $form->content_model_type = 'optional'; + $form->attr['target'] = 'FrameTarget'; + + $input = $this->addBlankElement('input'); + $input->attr['align'] = 'IAlign'; + + $legend = $this->addBlankElement('legend'); + $legend->attr['align'] = 'LAlign'; + } +} + +// vim: et sw=4 sts=4 diff --git a/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/HTMLModule/List.php b/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/HTMLModule/List.php similarity index 97% rename from plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/HTMLModule/List.php rename to plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/HTMLModule/List.php index 605e37c..7a20ff7 100755 --- a/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/HTMLModule/List.php +++ b/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/HTMLModule/List.php @@ -1,51 +1,51 @@ - 'List'); - - /** - * @param HTMLPurifier_Config $config - */ - public function setup($config) - { - $ol = $this->addElement('ol', 'List', new HTMLPurifier_ChildDef_List(), 'Common'); - $ul = $this->addElement('ul', 'List', new HTMLPurifier_ChildDef_List(), 'Common'); - // XXX The wrap attribute is handled by MakeWellFormed. This is all - // quite unsatisfactory, because we generated this - // *specifically* for lists, and now a big chunk of the handling - // is done properly by the List ChildDef. So actually, we just - // want enough information to make autoclosing work properly, - // and then hand off the tricky stuff to the ChildDef. - $ol->wrap = 'li'; - $ul->wrap = 'li'; - $this->addElement('dl', 'List', 'Required: dt | dd', 'Common'); - - $this->addElement('li', false, 'Flow', 'Common'); - - $this->addElement('dd', false, 'Flow', 'Common'); - $this->addElement('dt', false, 'Inline', 'Common'); - } -} - -// vim: et sw=4 sts=4 + 'List'); + + /** + * @param HTMLPurifier_Config $config + */ + public function setup($config) + { + $ol = $this->addElement('ol', 'List', new HTMLPurifier_ChildDef_List(), 'Common'); + $ul = $this->addElement('ul', 'List', new HTMLPurifier_ChildDef_List(), 'Common'); + // XXX The wrap attribute is handled by MakeWellFormed. This is all + // quite unsatisfactory, because we generated this + // *specifically* for lists, and now a big chunk of the handling + // is done properly by the List ChildDef. So actually, we just + // want enough information to make autoclosing work properly, + // and then hand off the tricky stuff to the ChildDef. + $ol->wrap = 'li'; + $ul->wrap = 'li'; + $this->addElement('dl', 'List', 'Required: dt | dd', 'Common'); + + $this->addElement('li', false, 'Flow', 'Common'); + + $this->addElement('dd', false, 'Flow', 'Common'); + $this->addElement('dt', false, 'Inline', 'Common'); + } +} + +// vim: et sw=4 sts=4 diff --git a/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/HTMLModule/Name.php b/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/HTMLModule/Name.php similarity index 96% rename from plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/HTMLModule/Name.php rename to plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/HTMLModule/Name.php index 315e22a..60c0545 100755 --- a/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/HTMLModule/Name.php +++ b/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/HTMLModule/Name.php @@ -1,26 +1,26 @@ -addBlankElement($name); - $element->attr['name'] = 'CDATA'; - if (!$config->get('HTML.Attr.Name.UseCDATA')) { - $element->attr_transform_post[] = new HTMLPurifier_AttrTransform_NameSync(); - } - } - } -} - -// vim: et sw=4 sts=4 +addBlankElement($name); + $element->attr['name'] = 'CDATA'; + if (!$config->get('HTML.Attr.Name.UseCDATA')) { + $element->attr_transform_post[] = new HTMLPurifier_AttrTransform_NameSync(); + } + } + } +} + +// vim: et sw=4 sts=4 diff --git a/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/HTMLModule/Nofollow.php b/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/HTMLModule/Nofollow.php similarity index 95% rename from plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/HTMLModule/Nofollow.php rename to plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/HTMLModule/Nofollow.php index c145e8e..dc9410a 100755 --- a/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/HTMLModule/Nofollow.php +++ b/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/HTMLModule/Nofollow.php @@ -1,25 +1,25 @@ -addBlankElement('a'); - $a->attr_transform_post[] = new HTMLPurifier_AttrTransform_Nofollow(); - } -} - -// vim: et sw=4 sts=4 +addBlankElement('a'); + $a->attr_transform_post[] = new HTMLPurifier_AttrTransform_Nofollow(); + } +} + +// vim: et sw=4 sts=4 diff --git a/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/HTMLModule/NonXMLCommonAttributes.php b/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/HTMLModule/NonXMLCommonAttributes.php similarity index 94% rename from plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/HTMLModule/NonXMLCommonAttributes.php rename to plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/HTMLModule/NonXMLCommonAttributes.php index 7d66e11..da72225 100755 --- a/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/HTMLModule/NonXMLCommonAttributes.php +++ b/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/HTMLModule/NonXMLCommonAttributes.php @@ -1,20 +1,20 @@ - array( - 'lang' => 'LanguageCode', - ) - ); -} - -// vim: et sw=4 sts=4 + array( + 'lang' => 'LanguageCode', + ) + ); +} + +// vim: et sw=4 sts=4 diff --git a/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/HTMLModule/Object.php b/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/HTMLModule/Object.php similarity index 96% rename from plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/HTMLModule/Object.php rename to plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/HTMLModule/Object.php index d388b24..2f9efc5 100755 --- a/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/HTMLModule/Object.php +++ b/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/HTMLModule/Object.php @@ -1,62 +1,62 @@ - to cater to legacy browsers: this - * module does not allow this sort of behavior - */ -class HTMLPurifier_HTMLModule_Object extends HTMLPurifier_HTMLModule -{ - /** - * @type string - */ - public $name = 'Object'; - - /** - * @type bool - */ - public $safe = false; - - /** - * @param HTMLPurifier_Config $config - */ - public function setup($config) - { - $this->addElement( - 'object', - 'Inline', - 'Optional: #PCDATA | Flow | param', - 'Common', - array( - 'archive' => 'URI', - 'classid' => 'URI', - 'codebase' => 'URI', - 'codetype' => 'Text', - 'data' => 'URI', - 'declare' => 'Bool#declare', - 'height' => 'Length', - 'name' => 'CDATA', - 'standby' => 'Text', - 'tabindex' => 'Number', - 'type' => 'ContentType', - 'width' => 'Length' - ) - ); - - $this->addElement( - 'param', - false, - 'Empty', - null, - array( - 'id' => 'ID', - 'name*' => 'Text', - 'type' => 'Text', - 'value' => 'Text', - 'valuetype' => 'Enum#data,ref,object' - ) - ); - } -} - -// vim: et sw=4 sts=4 + to cater to legacy browsers: this + * module does not allow this sort of behavior + */ +class HTMLPurifier_HTMLModule_Object extends HTMLPurifier_HTMLModule +{ + /** + * @type string + */ + public $name = 'Object'; + + /** + * @type bool + */ + public $safe = false; + + /** + * @param HTMLPurifier_Config $config + */ + public function setup($config) + { + $this->addElement( + 'object', + 'Inline', + 'Optional: #PCDATA | Flow | param', + 'Common', + array( + 'archive' => 'URI', + 'classid' => 'URI', + 'codebase' => 'URI', + 'codetype' => 'Text', + 'data' => 'URI', + 'declare' => 'Bool#declare', + 'height' => 'Length', + 'name' => 'CDATA', + 'standby' => 'Text', + 'tabindex' => 'Number', + 'type' => 'ContentType', + 'width' => 'Length' + ) + ); + + $this->addElement( + 'param', + false, + 'Empty', + null, + array( + 'id' => 'ID', + 'name*' => 'Text', + 'type' => 'Text', + 'value' => 'Text', + 'valuetype' => 'Enum#data,ref,object' + ) + ); + } +} + +// vim: et sw=4 sts=4 diff --git a/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/HTMLModule/Presentation.php b/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/HTMLModule/Presentation.php similarity index 97% rename from plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/HTMLModule/Presentation.php rename to plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/HTMLModule/Presentation.php index 831db4c..6458ce9 100755 --- a/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/HTMLModule/Presentation.php +++ b/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/HTMLModule/Presentation.php @@ -1,42 +1,42 @@ -addElement('hr', 'Block', 'Empty', 'Common'); - $this->addElement('sub', 'Inline', 'Inline', 'Common'); - $this->addElement('sup', 'Inline', 'Inline', 'Common'); - $b = $this->addElement('b', 'Inline', 'Inline', 'Common'); - $b->formatting = true; - $big = $this->addElement('big', 'Inline', 'Inline', 'Common'); - $big->formatting = true; - $i = $this->addElement('i', 'Inline', 'Inline', 'Common'); - $i->formatting = true; - $small = $this->addElement('small', 'Inline', 'Inline', 'Common'); - $small->formatting = true; - $tt = $this->addElement('tt', 'Inline', 'Inline', 'Common'); - $tt->formatting = true; - } -} - -// vim: et sw=4 sts=4 +addElement('hr', 'Block', 'Empty', 'Common'); + $this->addElement('sub', 'Inline', 'Inline', 'Common'); + $this->addElement('sup', 'Inline', 'Inline', 'Common'); + $b = $this->addElement('b', 'Inline', 'Inline', 'Common'); + $b->formatting = true; + $big = $this->addElement('big', 'Inline', 'Inline', 'Common'); + $big->formatting = true; + $i = $this->addElement('i', 'Inline', 'Inline', 'Common'); + $i->formatting = true; + $small = $this->addElement('small', 'Inline', 'Inline', 'Common'); + $small->formatting = true; + $tt = $this->addElement('tt', 'Inline', 'Inline', 'Common'); + $tt->formatting = true; + } +} + +// vim: et sw=4 sts=4 diff --git a/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/HTMLModule/Proprietary.php b/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/HTMLModule/Proprietary.php similarity index 96% rename from plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/HTMLModule/Proprietary.php rename to plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/HTMLModule/Proprietary.php index 4593fc4..5ee3c8e 100755 --- a/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/HTMLModule/Proprietary.php +++ b/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/HTMLModule/Proprietary.php @@ -1,40 +1,40 @@ -addElement( - 'marquee', - 'Inline', - 'Flow', - 'Common', - array( - 'direction' => 'Enum#left,right,up,down', - 'behavior' => 'Enum#alternate', - 'width' => 'Length', - 'height' => 'Length', - 'scrolldelay' => 'Number', - 'scrollamount' => 'Number', - 'loop' => 'Number', - 'bgcolor' => 'Color', - 'hspace' => 'Pixels', - 'vspace' => 'Pixels', - ) - ); - } -} - -// vim: et sw=4 sts=4 +addElement( + 'marquee', + 'Inline', + 'Flow', + 'Common', + array( + 'direction' => 'Enum#left,right,up,down', + 'behavior' => 'Enum#alternate', + 'width' => 'Length', + 'height' => 'Length', + 'scrolldelay' => 'Number', + 'scrollamount' => 'Number', + 'loop' => 'Number', + 'bgcolor' => 'Color', + 'hspace' => 'Pixels', + 'vspace' => 'Pixels', + ) + ); + } +} + +// vim: et sw=4 sts=4 diff --git a/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/HTMLModule/Ruby.php b/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/HTMLModule/Ruby.php similarity index 96% rename from plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/HTMLModule/Ruby.php rename to plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/HTMLModule/Ruby.php index 9a26172..a0d4892 100755 --- a/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/HTMLModule/Ruby.php +++ b/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/HTMLModule/Ruby.php @@ -1,36 +1,36 @@ -addElement( - 'ruby', - 'Inline', - 'Custom: ((rb, (rt | (rp, rt, rp))) | (rbc, rtc, rtc?))', - 'Common' - ); - $this->addElement('rbc', false, 'Required: rb', 'Common'); - $this->addElement('rtc', false, 'Required: rt', 'Common'); - $rb = $this->addElement('rb', false, 'Inline', 'Common'); - $rb->excludes = array('ruby' => true); - $rt = $this->addElement('rt', false, 'Inline', 'Common', array('rbspan' => 'Number')); - $rt->excludes = array('ruby' => true); - $this->addElement('rp', false, 'Optional: #PCDATA', 'Common'); - } -} - -// vim: et sw=4 sts=4 +addElement( + 'ruby', + 'Inline', + 'Custom: ((rb, (rt | (rp, rt, rp))) | (rbc, rtc, rtc?))', + 'Common' + ); + $this->addElement('rbc', false, 'Required: rb', 'Common'); + $this->addElement('rtc', false, 'Required: rt', 'Common'); + $rb = $this->addElement('rb', false, 'Inline', 'Common'); + $rb->excludes = array('ruby' => true); + $rt = $this->addElement('rt', false, 'Inline', 'Common', array('rbspan' => 'Number')); + $rt->excludes = array('ruby' => true); + $this->addElement('rp', false, 'Optional: #PCDATA', 'Common'); + } +} + +// vim: et sw=4 sts=4 diff --git a/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/HTMLModule/SafeEmbed.php b/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/HTMLModule/SafeEmbed.php similarity index 96% rename from plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/HTMLModule/SafeEmbed.php rename to plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/HTMLModule/SafeEmbed.php index 1157288..04e6689 100755 --- a/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/HTMLModule/SafeEmbed.php +++ b/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/HTMLModule/SafeEmbed.php @@ -1,40 +1,40 @@ -get('HTML.MaxImgLength'); - $embed = $this->addElement( - 'embed', - 'Inline', - 'Empty', - 'Common', - array( - 'src*' => 'URI#embedded', - 'type' => 'Enum#application/x-shockwave-flash', - 'width' => 'Pixels#' . $max, - 'height' => 'Pixels#' . $max, - 'allowscriptaccess' => 'Enum#never', - 'allownetworking' => 'Enum#internal', - 'flashvars' => 'Text', - 'wmode' => 'Enum#window,transparent,opaque', - 'name' => 'ID', - ) - ); - $embed->attr_transform_post[] = new HTMLPurifier_AttrTransform_SafeEmbed(); - } -} - -// vim: et sw=4 sts=4 +get('HTML.MaxImgLength'); + $embed = $this->addElement( + 'embed', + 'Inline', + 'Empty', + 'Common', + array( + 'src*' => 'URI#embedded', + 'type' => 'Enum#application/x-shockwave-flash', + 'width' => 'Pixels#' . $max, + 'height' => 'Pixels#' . $max, + 'allowscriptaccess' => 'Enum#never', + 'allownetworking' => 'Enum#internal', + 'flashvars' => 'Text', + 'wmode' => 'Enum#window,transparent,opaque', + 'name' => 'ID', + ) + ); + $embed->attr_transform_post[] = new HTMLPurifier_AttrTransform_SafeEmbed(); + } +} + +// vim: et sw=4 sts=4 diff --git a/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/HTMLModule/SafeObject.php b/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/HTMLModule/SafeObject.php similarity index 96% rename from plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/HTMLModule/SafeObject.php rename to plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/HTMLModule/SafeObject.php index a061cec..1297f80 100755 --- a/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/HTMLModule/SafeObject.php +++ b/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/HTMLModule/SafeObject.php @@ -1,62 +1,62 @@ -get('HTML.MaxImgLength'); - $object = $this->addElement( - 'object', - 'Inline', - 'Optional: param | Flow | #PCDATA', - 'Common', - array( - // While technically not required by the spec, we're forcing - // it to this value. - 'type' => 'Enum#application/x-shockwave-flash', - 'width' => 'Pixels#' . $max, - 'height' => 'Pixels#' . $max, - 'data' => 'URI#embedded', - 'codebase' => new HTMLPurifier_AttrDef_Enum( - array( - 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0' - ) - ), - ) - ); - $object->attr_transform_post[] = new HTMLPurifier_AttrTransform_SafeObject(); - - $param = $this->addElement( - 'param', - false, - 'Empty', - false, - array( - 'id' => 'ID', - 'name*' => 'Text', - 'value' => 'Text' - ) - ); - $param->attr_transform_post[] = new HTMLPurifier_AttrTransform_SafeParam(); - $this->info_injector[] = 'SafeObject'; - } -} - -// vim: et sw=4 sts=4 +get('HTML.MaxImgLength'); + $object = $this->addElement( + 'object', + 'Inline', + 'Optional: param | Flow | #PCDATA', + 'Common', + array( + // While technically not required by the spec, we're forcing + // it to this value. + 'type' => 'Enum#application/x-shockwave-flash', + 'width' => 'Pixels#' . $max, + 'height' => 'Pixels#' . $max, + 'data' => 'URI#embedded', + 'codebase' => new HTMLPurifier_AttrDef_Enum( + array( + 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0' + ) + ), + ) + ); + $object->attr_transform_post[] = new HTMLPurifier_AttrTransform_SafeObject(); + + $param = $this->addElement( + 'param', + false, + 'Empty', + false, + array( + 'id' => 'ID', + 'name*' => 'Text', + 'value' => 'Text' + ) + ); + $param->attr_transform_post[] = new HTMLPurifier_AttrTransform_SafeParam(); + $this->info_injector[] = 'SafeObject'; + } +} + +// vim: et sw=4 sts=4 diff --git a/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/HTMLModule/SafeScripting.php b/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/HTMLModule/SafeScripting.php similarity index 96% rename from plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/HTMLModule/SafeScripting.php rename to plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/HTMLModule/SafeScripting.php index 6e9113c..0330cd9 100755 --- a/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/HTMLModule/SafeScripting.php +++ b/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/HTMLModule/SafeScripting.php @@ -1,40 +1,40 @@ -get('HTML.SafeScripting'); - $script = $this->addElement( - 'script', - 'Inline', - 'Empty', - null, - array( - // While technically not required by the spec, we're forcing - // it to this value. - 'type' => 'Enum#text/javascript', - 'src*' => new HTMLPurifier_AttrDef_Enum(array_keys($allowed)) - ) - ); - $script->attr_transform_pre[] = - $script->attr_transform_post[] = new HTMLPurifier_AttrTransform_ScriptRequired(); - } -} - -// vim: et sw=4 sts=4 +get('HTML.SafeScripting'); + $script = $this->addElement( + 'script', + 'Inline', + 'Empty', + null, + array( + // While technically not required by the spec, we're forcing + // it to this value. + 'type' => 'Enum#text/javascript', + 'src*' => new HTMLPurifier_AttrDef_Enum(array_keys($allowed)) + ) + ); + $script->attr_transform_pre[] = + $script->attr_transform_post[] = new HTMLPurifier_AttrTransform_ScriptRequired(); + } +} + +// vim: et sw=4 sts=4 diff --git a/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/HTMLModule/Scripting.php b/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/HTMLModule/Scripting.php similarity index 96% rename from plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/HTMLModule/Scripting.php rename to plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/HTMLModule/Scripting.php index 1878537..8b28a7b 100755 --- a/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/HTMLModule/Scripting.php +++ b/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/HTMLModule/Scripting.php @@ -1,73 +1,73 @@ - 'script | noscript', 'Inline' => 'script | noscript'); - - /** - * @type bool - */ - public $safe = false; - - /** - * @param HTMLPurifier_Config $config - */ - public function setup($config) - { - // TODO: create custom child-definition for noscript that - // auto-wraps stray #PCDATA in a similar manner to - // blockquote's custom definition (we would use it but - // blockquote's contents are optional while noscript's contents - // are required) - - // TODO: convert this to new syntax, main problem is getting - // both content sets working - - // In theory, this could be safe, but I don't see any reason to - // allow it. - $this->info['noscript'] = new HTMLPurifier_ElementDef(); - $this->info['noscript']->attr = array(0 => array('Common')); - $this->info['noscript']->content_model = 'Heading | List | Block'; - $this->info['noscript']->content_model_type = 'required'; - - $this->info['script'] = new HTMLPurifier_ElementDef(); - $this->info['script']->attr = array( - 'defer' => new HTMLPurifier_AttrDef_Enum(array('defer')), - 'src' => new HTMLPurifier_AttrDef_URI(true), - 'type' => new HTMLPurifier_AttrDef_Enum(array('text/javascript')) - ); - $this->info['script']->content_model = '#PCDATA'; - $this->info['script']->content_model_type = 'optional'; - $this->info['script']->attr_transform_pre[] = - $this->info['script']->attr_transform_post[] = - new HTMLPurifier_AttrTransform_ScriptRequired(); - } -} - -// vim: et sw=4 sts=4 + 'script | noscript', 'Inline' => 'script | noscript'); + + /** + * @type bool + */ + public $safe = false; + + /** + * @param HTMLPurifier_Config $config + */ + public function setup($config) + { + // TODO: create custom child-definition for noscript that + // auto-wraps stray #PCDATA in a similar manner to + // blockquote's custom definition (we would use it but + // blockquote's contents are optional while noscript's contents + // are required) + + // TODO: convert this to new syntax, main problem is getting + // both content sets working + + // In theory, this could be safe, but I don't see any reason to + // allow it. + $this->info['noscript'] = new HTMLPurifier_ElementDef(); + $this->info['noscript']->attr = array(0 => array('Common')); + $this->info['noscript']->content_model = 'Heading | List | Block'; + $this->info['noscript']->content_model_type = 'required'; + + $this->info['script'] = new HTMLPurifier_ElementDef(); + $this->info['script']->attr = array( + 'defer' => new HTMLPurifier_AttrDef_Enum(array('defer')), + 'src' => new HTMLPurifier_AttrDef_URI(true), + 'type' => new HTMLPurifier_AttrDef_Enum(array('text/javascript')) + ); + $this->info['script']->content_model = '#PCDATA'; + $this->info['script']->content_model_type = 'optional'; + $this->info['script']->attr_transform_pre[] = + $this->info['script']->attr_transform_post[] = + new HTMLPurifier_AttrTransform_ScriptRequired(); + } +} + +// vim: et sw=4 sts=4 diff --git a/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/HTMLModule/StyleAttribute.php b/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/HTMLModule/StyleAttribute.php similarity index 95% rename from plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/HTMLModule/StyleAttribute.php rename to plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/HTMLModule/StyleAttribute.php index f192780..497b832 100755 --- a/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/HTMLModule/StyleAttribute.php +++ b/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/HTMLModule/StyleAttribute.php @@ -1,33 +1,33 @@ - array('style' => false), // see constructor - 'Core' => array(0 => array('Style')) - ); - - /** - * @param HTMLPurifier_Config $config - */ - public function setup($config) - { - $this->attr_collections['Style']['style'] = new HTMLPurifier_AttrDef_CSS(); - } -} - -// vim: et sw=4 sts=4 + array('style' => false), // see constructor + 'Core' => array(0 => array('Style')) + ); + + /** + * @param HTMLPurifier_Config $config + */ + public function setup($config) + { + $this->attr_collections['Style']['style'] = new HTMLPurifier_AttrDef_CSS(); + } +} + +// vim: et sw=4 sts=4 diff --git a/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/HTMLModule/Tables.php b/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/HTMLModule/Tables.php similarity index 96% rename from plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/HTMLModule/Tables.php rename to plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/HTMLModule/Tables.php index f993e3c..8a0b3b4 100755 --- a/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/HTMLModule/Tables.php +++ b/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/HTMLModule/Tables.php @@ -1,75 +1,75 @@ -addElement('caption', false, 'Inline', 'Common'); - - $this->addElement( - 'table', - 'Block', - new HTMLPurifier_ChildDef_Table(), - 'Common', - array( - 'border' => 'Pixels', - 'cellpadding' => 'Length', - 'cellspacing' => 'Length', - 'frame' => 'Enum#void,above,below,hsides,lhs,rhs,vsides,box,border', - 'rules' => 'Enum#none,groups,rows,cols,all', - 'summary' => 'Text', - 'width' => 'Length' - ) - ); - - // common attributes - $cell_align = array( - 'align' => 'Enum#left,center,right,justify,char', - 'charoff' => 'Length', - 'valign' => 'Enum#top,middle,bottom,baseline', - ); - - $cell_t = array_merge( - array( - 'abbr' => 'Text', - 'colspan' => 'Number', - 'rowspan' => 'Number', - // Apparently, as of HTML5 this attribute only applies - // to 'th' elements. - 'scope' => 'Enum#row,col,rowgroup,colgroup', - ), - $cell_align - ); - $this->addElement('td', false, 'Flow', 'Common', $cell_t); - $this->addElement('th', false, 'Flow', 'Common', $cell_t); - - $this->addElement('tr', false, 'Required: td | th', 'Common', $cell_align); - - $cell_col = array_merge( - array( - 'span' => 'Number', - 'width' => 'MultiLength', - ), - $cell_align - ); - $this->addElement('col', false, 'Empty', 'Common', $cell_col); - $this->addElement('colgroup', false, 'Optional: col', 'Common', $cell_col); - - $this->addElement('tbody', false, 'Required: tr', 'Common', $cell_align); - $this->addElement('thead', false, 'Required: tr', 'Common', $cell_align); - $this->addElement('tfoot', false, 'Required: tr', 'Common', $cell_align); - } -} - -// vim: et sw=4 sts=4 +addElement('caption', false, 'Inline', 'Common'); + + $this->addElement( + 'table', + 'Block', + new HTMLPurifier_ChildDef_Table(), + 'Common', + array( + 'border' => 'Pixels', + 'cellpadding' => 'Length', + 'cellspacing' => 'Length', + 'frame' => 'Enum#void,above,below,hsides,lhs,rhs,vsides,box,border', + 'rules' => 'Enum#none,groups,rows,cols,all', + 'summary' => 'Text', + 'width' => 'Length' + ) + ); + + // common attributes + $cell_align = array( + 'align' => 'Enum#left,center,right,justify,char', + 'charoff' => 'Length', + 'valign' => 'Enum#top,middle,bottom,baseline', + ); + + $cell_t = array_merge( + array( + 'abbr' => 'Text', + 'colspan' => 'Number', + 'rowspan' => 'Number', + // Apparently, as of HTML5 this attribute only applies + // to 'th' elements. + 'scope' => 'Enum#row,col,rowgroup,colgroup', + ), + $cell_align + ); + $this->addElement('td', false, 'Flow', 'Common', $cell_t); + $this->addElement('th', false, 'Flow', 'Common', $cell_t); + + $this->addElement('tr', false, 'Required: td | th', 'Common', $cell_align); + + $cell_col = array_merge( + array( + 'span' => 'Number', + 'width' => 'MultiLength', + ), + $cell_align + ); + $this->addElement('col', false, 'Empty', 'Common', $cell_col); + $this->addElement('colgroup', false, 'Optional: col', 'Common', $cell_col); + + $this->addElement('tbody', false, 'Required: tr', 'Common', $cell_align); + $this->addElement('thead', false, 'Required: tr', 'Common', $cell_align); + $this->addElement('tfoot', false, 'Required: tr', 'Common', $cell_align); + } +} + +// vim: et sw=4 sts=4 diff --git a/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/HTMLModule/Target.php b/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/HTMLModule/Target.php similarity index 95% rename from plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/HTMLModule/Target.php rename to plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/HTMLModule/Target.php index f3af048..b188ac9 100755 --- a/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/HTMLModule/Target.php +++ b/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/HTMLModule/Target.php @@ -1,28 +1,28 @@ -addBlankElement($name); - $e->attr = array( - 'target' => new HTMLPurifier_AttrDef_HTML_FrameTarget() - ); - } - } -} - -// vim: et sw=4 sts=4 +addBlankElement($name); + $e->attr = array( + 'target' => new HTMLPurifier_AttrDef_HTML_FrameTarget() + ); + } + } +} + +// vim: et sw=4 sts=4 diff --git a/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/HTMLModule/TargetBlank.php b/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/HTMLModule/TargetBlank.php similarity index 95% rename from plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/HTMLModule/TargetBlank.php rename to plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/HTMLModule/TargetBlank.php index 757cddc..58ccc68 100755 --- a/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/HTMLModule/TargetBlank.php +++ b/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/HTMLModule/TargetBlank.php @@ -1,24 +1,24 @@ -addBlankElement('a'); - $a->attr_transform_post[] = new HTMLPurifier_AttrTransform_TargetBlank(); - } -} - -// vim: et sw=4 sts=4 +addBlankElement('a'); + $a->attr_transform_post[] = new HTMLPurifier_AttrTransform_TargetBlank(); + } +} + +// vim: et sw=4 sts=4 diff --git a/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/HTMLModule/TargetNoreferrer.php b/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/HTMLModule/TargetNoreferrer.php new file mode 100755 index 0000000..32484d6 --- /dev/null +++ b/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/HTMLModule/TargetNoreferrer.php @@ -0,0 +1,21 @@ +addBlankElement('a'); + $a->attr_transform_post[] = new HTMLPurifier_AttrTransform_TargetNoreferrer(); + } +} diff --git a/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/HTMLModule/Text.php b/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/HTMLModule/Text.php similarity index 97% rename from plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/HTMLModule/Text.php rename to plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/HTMLModule/Text.php index 11fdd8b..7a65e00 100755 --- a/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/HTMLModule/Text.php +++ b/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/HTMLModule/Text.php @@ -1,87 +1,87 @@ - 'Heading | Block | Inline' - ); - - /** - * @param HTMLPurifier_Config $config - */ - public function setup($config) - { - // Inline Phrasal ------------------------------------------------- - $this->addElement('abbr', 'Inline', 'Inline', 'Common'); - $this->addElement('acronym', 'Inline', 'Inline', 'Common'); - $this->addElement('cite', 'Inline', 'Inline', 'Common'); - $this->addElement('dfn', 'Inline', 'Inline', 'Common'); - $this->addElement('kbd', 'Inline', 'Inline', 'Common'); - $this->addElement('q', 'Inline', 'Inline', 'Common', array('cite' => 'URI')); - $this->addElement('samp', 'Inline', 'Inline', 'Common'); - $this->addElement('var', 'Inline', 'Inline', 'Common'); - - $em = $this->addElement('em', 'Inline', 'Inline', 'Common'); - $em->formatting = true; - - $strong = $this->addElement('strong', 'Inline', 'Inline', 'Common'); - $strong->formatting = true; - - $code = $this->addElement('code', 'Inline', 'Inline', 'Common'); - $code->formatting = true; - - // Inline Structural ---------------------------------------------- - $this->addElement('span', 'Inline', 'Inline', 'Common'); - $this->addElement('br', 'Inline', 'Empty', 'Core'); - - // Block Phrasal -------------------------------------------------- - $this->addElement('address', 'Block', 'Inline', 'Common'); - $this->addElement('blockquote', 'Block', 'Optional: Heading | Block | List', 'Common', array('cite' => 'URI')); - $pre = $this->addElement('pre', 'Block', 'Inline', 'Common'); - $pre->excludes = $this->makeLookup( - 'img', - 'big', - 'small', - 'object', - 'applet', - 'font', - 'basefont' - ); - $this->addElement('h1', 'Heading', 'Inline', 'Common'); - $this->addElement('h2', 'Heading', 'Inline', 'Common'); - $this->addElement('h3', 'Heading', 'Inline', 'Common'); - $this->addElement('h4', 'Heading', 'Inline', 'Common'); - $this->addElement('h5', 'Heading', 'Inline', 'Common'); - $this->addElement('h6', 'Heading', 'Inline', 'Common'); - - // Block Structural ----------------------------------------------- - $p = $this->addElement('p', 'Block', 'Inline', 'Common'); - $p->autoclose = array_flip( - array("address", "blockquote", "center", "dir", "div", "dl", "fieldset", "ol", "p", "ul") - ); - - $this->addElement('div', 'Block', 'Flow', 'Common'); - } -} - -// vim: et sw=4 sts=4 + 'Heading | Block | Inline' + ); + + /** + * @param HTMLPurifier_Config $config + */ + public function setup($config) + { + // Inline Phrasal ------------------------------------------------- + $this->addElement('abbr', 'Inline', 'Inline', 'Common'); + $this->addElement('acronym', 'Inline', 'Inline', 'Common'); + $this->addElement('cite', 'Inline', 'Inline', 'Common'); + $this->addElement('dfn', 'Inline', 'Inline', 'Common'); + $this->addElement('kbd', 'Inline', 'Inline', 'Common'); + $this->addElement('q', 'Inline', 'Inline', 'Common', array('cite' => 'URI')); + $this->addElement('samp', 'Inline', 'Inline', 'Common'); + $this->addElement('var', 'Inline', 'Inline', 'Common'); + + $em = $this->addElement('em', 'Inline', 'Inline', 'Common'); + $em->formatting = true; + + $strong = $this->addElement('strong', 'Inline', 'Inline', 'Common'); + $strong->formatting = true; + + $code = $this->addElement('code', 'Inline', 'Inline', 'Common'); + $code->formatting = true; + + // Inline Structural ---------------------------------------------- + $this->addElement('span', 'Inline', 'Inline', 'Common'); + $this->addElement('br', 'Inline', 'Empty', 'Core'); + + // Block Phrasal -------------------------------------------------- + $this->addElement('address', 'Block', 'Inline', 'Common'); + $this->addElement('blockquote', 'Block', 'Optional: Heading | Block | List', 'Common', array('cite' => 'URI')); + $pre = $this->addElement('pre', 'Block', 'Inline', 'Common'); + $pre->excludes = $this->makeLookup( + 'img', + 'big', + 'small', + 'object', + 'applet', + 'font', + 'basefont' + ); + $this->addElement('h1', 'Heading', 'Inline', 'Common'); + $this->addElement('h2', 'Heading', 'Inline', 'Common'); + $this->addElement('h3', 'Heading', 'Inline', 'Common'); + $this->addElement('h4', 'Heading', 'Inline', 'Common'); + $this->addElement('h5', 'Heading', 'Inline', 'Common'); + $this->addElement('h6', 'Heading', 'Inline', 'Common'); + + // Block Structural ----------------------------------------------- + $p = $this->addElement('p', 'Block', 'Inline', 'Common'); + $p->autoclose = array_flip( + array("address", "blockquote", "center", "dir", "div", "dl", "fieldset", "ol", "p", "ul") + ); + + $this->addElement('div', 'Block', 'Flow', 'Common'); + } +} + +// vim: et sw=4 sts=4 diff --git a/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/HTMLModule/Tidy.php b/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/HTMLModule/Tidy.php similarity index 96% rename from plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/HTMLModule/Tidy.php rename to plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/HTMLModule/Tidy.php index f482a37..08aa232 100755 --- a/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/HTMLModule/Tidy.php +++ b/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/HTMLModule/Tidy.php @@ -1,230 +1,230 @@ - 'none', 'light', 'medium', 'heavy'); - - /** - * Default level to place all fixes in. - * Disabled by default. - * @type string - */ - public $defaultLevel = null; - - /** - * Lists of fixes used by getFixesForLevel(). - * Format is: - * HTMLModule_Tidy->fixesForLevel[$level] = array('fix-1', 'fix-2'); - * @type array - */ - public $fixesForLevel = array( - 'light' => array(), - 'medium' => array(), - 'heavy' => array() - ); - - /** - * Lazy load constructs the module by determining the necessary - * fixes to create and then delegating to the populate() function. - * @param HTMLPurifier_Config $config - * @todo Wildcard matching and error reporting when an added or - * subtracted fix has no effect. - */ - public function setup($config) - { - // create fixes, initialize fixesForLevel - $fixes = $this->makeFixes(); - $this->makeFixesForLevel($fixes); - - // figure out which fixes to use - $level = $config->get('HTML.TidyLevel'); - $fixes_lookup = $this->getFixesForLevel($level); - - // get custom fix declarations: these need namespace processing - $add_fixes = $config->get('HTML.TidyAdd'); - $remove_fixes = $config->get('HTML.TidyRemove'); - - foreach ($fixes as $name => $fix) { - // needs to be refactored a little to implement globbing - if (isset($remove_fixes[$name]) || - (!isset($add_fixes[$name]) && !isset($fixes_lookup[$name]))) { - unset($fixes[$name]); - } - } - - // populate this module with necessary fixes - $this->populate($fixes); - } - - /** - * Retrieves all fixes per a level, returning fixes for that specific - * level as well as all levels below it. - * @param string $level level identifier, see $levels for valid values - * @return array Lookup up table of fixes - */ - public function getFixesForLevel($level) - { - if ($level == $this->levels[0]) { - return array(); - } - $activated_levels = array(); - for ($i = 1, $c = count($this->levels); $i < $c; $i++) { - $activated_levels[] = $this->levels[$i]; - if ($this->levels[$i] == $level) { - break; - } - } - if ($i == $c) { - trigger_error( - 'Tidy level ' . htmlspecialchars($level) . ' not recognized', - E_USER_WARNING - ); - return array(); - } - $ret = array(); - foreach ($activated_levels as $level) { - foreach ($this->fixesForLevel[$level] as $fix) { - $ret[$fix] = true; - } - } - return $ret; - } - - /** - * Dynamically populates the $fixesForLevel member variable using - * the fixes array. It may be custom overloaded, used in conjunction - * with $defaultLevel, or not used at all. - * @param array $fixes - */ - public function makeFixesForLevel($fixes) - { - if (!isset($this->defaultLevel)) { - return; - } - if (!isset($this->fixesForLevel[$this->defaultLevel])) { - trigger_error( - 'Default level ' . $this->defaultLevel . ' does not exist', - E_USER_ERROR - ); - return; - } - $this->fixesForLevel[$this->defaultLevel] = array_keys($fixes); - } - - /** - * Populates the module with transforms and other special-case code - * based on a list of fixes passed to it - * @param array $fixes Lookup table of fixes to activate - */ - public function populate($fixes) - { - foreach ($fixes as $name => $fix) { - // determine what the fix is for - list($type, $params) = $this->getFixType($name); - switch ($type) { - case 'attr_transform_pre': - case 'attr_transform_post': - $attr = $params['attr']; - if (isset($params['element'])) { - $element = $params['element']; - if (empty($this->info[$element])) { - $e = $this->addBlankElement($element); - } else { - $e = $this->info[$element]; - } - } else { - $type = "info_$type"; - $e = $this; - } - // PHP does some weird parsing when I do - // $e->$type[$attr], so I have to assign a ref. - $f =& $e->$type; - $f[$attr] = $fix; - break; - case 'tag_transform': - $this->info_tag_transform[$params['element']] = $fix; - break; - case 'child': - case 'content_model_type': - $element = $params['element']; - if (empty($this->info[$element])) { - $e = $this->addBlankElement($element); - } else { - $e = $this->info[$element]; - } - $e->$type = $fix; - break; - default: - trigger_error("Fix type $type not supported", E_USER_ERROR); - break; - } - } - } - - /** - * Parses a fix name and determines what kind of fix it is, as well - * as other information defined by the fix - * @param $name String name of fix - * @return array(string $fix_type, array $fix_parameters) - * @note $fix_parameters is type dependant, see populate() for usage - * of these parameters - */ - public function getFixType($name) - { - // parse it - $property = $attr = null; - if (strpos($name, '#') !== false) { - list($name, $property) = explode('#', $name); - } - if (strpos($name, '@') !== false) { - list($name, $attr) = explode('@', $name); - } - - // figure out the parameters - $params = array(); - if ($name !== '') { - $params['element'] = $name; - } - if (!is_null($attr)) { - $params['attr'] = $attr; - } - - // special case: attribute transform - if (!is_null($attr)) { - if (is_null($property)) { - $property = 'pre'; - } - $type = 'attr_transform_' . $property; - return array($type, $params); - } - - // special case: tag transform - if (is_null($property)) { - return array('tag_transform', $params); - } - - return array($property, $params); - - } - - /** - * Defines all fixes the module will perform in a compact - * associative array of fix name to fix implementation. - * @return array - */ - public function makeFixes() - { - } -} - -// vim: et sw=4 sts=4 + 'none', 'light', 'medium', 'heavy'); + + /** + * Default level to place all fixes in. + * Disabled by default. + * @type string + */ + public $defaultLevel = null; + + /** + * Lists of fixes used by getFixesForLevel(). + * Format is: + * HTMLModule_Tidy->fixesForLevel[$level] = array('fix-1', 'fix-2'); + * @type array + */ + public $fixesForLevel = array( + 'light' => array(), + 'medium' => array(), + 'heavy' => array() + ); + + /** + * Lazy load constructs the module by determining the necessary + * fixes to create and then delegating to the populate() function. + * @param HTMLPurifier_Config $config + * @todo Wildcard matching and error reporting when an added or + * subtracted fix has no effect. + */ + public function setup($config) + { + // create fixes, initialize fixesForLevel + $fixes = $this->makeFixes(); + $this->makeFixesForLevel($fixes); + + // figure out which fixes to use + $level = $config->get('HTML.TidyLevel'); + $fixes_lookup = $this->getFixesForLevel($level); + + // get custom fix declarations: these need namespace processing + $add_fixes = $config->get('HTML.TidyAdd'); + $remove_fixes = $config->get('HTML.TidyRemove'); + + foreach ($fixes as $name => $fix) { + // needs to be refactored a little to implement globbing + if (isset($remove_fixes[$name]) || + (!isset($add_fixes[$name]) && !isset($fixes_lookup[$name]))) { + unset($fixes[$name]); + } + } + + // populate this module with necessary fixes + $this->populate($fixes); + } + + /** + * Retrieves all fixes per a level, returning fixes for that specific + * level as well as all levels below it. + * @param string $level level identifier, see $levels for valid values + * @return array Lookup up table of fixes + */ + public function getFixesForLevel($level) + { + if ($level == $this->levels[0]) { + return array(); + } + $activated_levels = array(); + for ($i = 1, $c = count($this->levels); $i < $c; $i++) { + $activated_levels[] = $this->levels[$i]; + if ($this->levels[$i] == $level) { + break; + } + } + if ($i == $c) { + trigger_error( + 'Tidy level ' . htmlspecialchars($level) . ' not recognized', + E_USER_WARNING + ); + return array(); + } + $ret = array(); + foreach ($activated_levels as $level) { + foreach ($this->fixesForLevel[$level] as $fix) { + $ret[$fix] = true; + } + } + return $ret; + } + + /** + * Dynamically populates the $fixesForLevel member variable using + * the fixes array. It may be custom overloaded, used in conjunction + * with $defaultLevel, or not used at all. + * @param array $fixes + */ + public function makeFixesForLevel($fixes) + { + if (!isset($this->defaultLevel)) { + return; + } + if (!isset($this->fixesForLevel[$this->defaultLevel])) { + trigger_error( + 'Default level ' . $this->defaultLevel . ' does not exist', + E_USER_ERROR + ); + return; + } + $this->fixesForLevel[$this->defaultLevel] = array_keys($fixes); + } + + /** + * Populates the module with transforms and other special-case code + * based on a list of fixes passed to it + * @param array $fixes Lookup table of fixes to activate + */ + public function populate($fixes) + { + foreach ($fixes as $name => $fix) { + // determine what the fix is for + list($type, $params) = $this->getFixType($name); + switch ($type) { + case 'attr_transform_pre': + case 'attr_transform_post': + $attr = $params['attr']; + if (isset($params['element'])) { + $element = $params['element']; + if (empty($this->info[$element])) { + $e = $this->addBlankElement($element); + } else { + $e = $this->info[$element]; + } + } else { + $type = "info_$type"; + $e = $this; + } + // PHP does some weird parsing when I do + // $e->$type[$attr], so I have to assign a ref. + $f =& $e->$type; + $f[$attr] = $fix; + break; + case 'tag_transform': + $this->info_tag_transform[$params['element']] = $fix; + break; + case 'child': + case 'content_model_type': + $element = $params['element']; + if (empty($this->info[$element])) { + $e = $this->addBlankElement($element); + } else { + $e = $this->info[$element]; + } + $e->$type = $fix; + break; + default: + trigger_error("Fix type $type not supported", E_USER_ERROR); + break; + } + } + } + + /** + * Parses a fix name and determines what kind of fix it is, as well + * as other information defined by the fix + * @param $name String name of fix + * @return array(string $fix_type, array $fix_parameters) + * @note $fix_parameters is type dependant, see populate() for usage + * of these parameters + */ + public function getFixType($name) + { + // parse it + $property = $attr = null; + if (strpos($name, '#') !== false) { + list($name, $property) = explode('#', $name); + } + if (strpos($name, '@') !== false) { + list($name, $attr) = explode('@', $name); + } + + // figure out the parameters + $params = array(); + if ($name !== '') { + $params['element'] = $name; + } + if (!is_null($attr)) { + $params['attr'] = $attr; + } + + // special case: attribute transform + if (!is_null($attr)) { + if (is_null($property)) { + $property = 'pre'; + } + $type = 'attr_transform_' . $property; + return array($type, $params); + } + + // special case: tag transform + if (is_null($property)) { + return array('tag_transform', $params); + } + + return array($property, $params); + + } + + /** + * Defines all fixes the module will perform in a compact + * associative array of fix name to fix implementation. + * @return array + */ + public function makeFixes() + { + } +} + +// vim: et sw=4 sts=4 diff --git a/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/HTMLModule/Tidy/Name.php b/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/HTMLModule/Tidy/Name.php similarity index 95% rename from plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/HTMLModule/Tidy/Name.php rename to plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/HTMLModule/Tidy/Name.php index bb47baf..a995161 100755 --- a/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/HTMLModule/Tidy/Name.php +++ b/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/HTMLModule/Tidy/Name.php @@ -1,33 +1,33 @@ -content_model_type != 'strictblockquote') { - return parent::getChildDef($def); - } - return new HTMLPurifier_ChildDef_StrictBlockquote($def->content_model); - } -} - -// vim: et sw=4 sts=4 +content_model_type != 'strictblockquote') { + return parent::getChildDef($def); + } + return new HTMLPurifier_ChildDef_StrictBlockquote($def->content_model); + } +} + +// vim: et sw=4 sts=4 diff --git a/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/HTMLModule/Tidy/Transitional.php b/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/HTMLModule/Tidy/Transitional.php similarity index 94% rename from plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/HTMLModule/Tidy/Transitional.php rename to plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/HTMLModule/Tidy/Transitional.php index 79411d2..c095ad9 100755 --- a/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/HTMLModule/Tidy/Transitional.php +++ b/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/HTMLModule/Tidy/Transitional.php @@ -1,16 +1,16 @@ - 'text-align:left;', - 'right' => 'text-align:right;', - 'top' => 'caption-side:top;', - 'bottom' => 'caption-side:bottom;' // not supported by IE - ) - ); - - // @align for img ------------------------------------------------- - $r['img@align'] = - new HTMLPurifier_AttrTransform_EnumToCSS( - 'align', - array( - 'left' => 'float:left;', - 'right' => 'float:right;', - 'top' => 'vertical-align:top;', - 'middle' => 'vertical-align:middle;', - 'bottom' => 'vertical-align:baseline;', - ) - ); - - // @align for table ----------------------------------------------- - $r['table@align'] = - new HTMLPurifier_AttrTransform_EnumToCSS( - 'align', - array( - 'left' => 'float:left;', - 'center' => 'margin-left:auto;margin-right:auto;', - 'right' => 'float:right;' - ) - ); - - // @align for hr ----------------------------------------------- - $r['hr@align'] = - new HTMLPurifier_AttrTransform_EnumToCSS( - 'align', - array( - // we use both text-align and margin because these work - // for different browsers (IE and Firefox, respectively) - // and the melange makes for a pretty cross-compatible - // solution - 'left' => 'margin-left:0;margin-right:auto;text-align:left;', - 'center' => 'margin-left:auto;margin-right:auto;text-align:center;', - 'right' => 'margin-left:auto;margin-right:0;text-align:right;' - ) - ); - - // @align for h1, h2, h3, h4, h5, h6, p, div ---------------------- - // {{{ - $align_lookup = array(); - $align_values = array('left', 'right', 'center', 'justify'); - foreach ($align_values as $v) { - $align_lookup[$v] = "text-align:$v;"; - } - // }}} - $r['h1@align'] = - $r['h2@align'] = - $r['h3@align'] = - $r['h4@align'] = - $r['h5@align'] = - $r['h6@align'] = - $r['p@align'] = - $r['div@align'] = - new HTMLPurifier_AttrTransform_EnumToCSS('align', $align_lookup); - - // @bgcolor for table, tr, td, th --------------------------------- - $r['table@bgcolor'] = - $r['td@bgcolor'] = - $r['th@bgcolor'] = - new HTMLPurifier_AttrTransform_BgColor(); - - // @border for img ------------------------------------------------ - $r['img@border'] = new HTMLPurifier_AttrTransform_Border(); - - // @clear for br -------------------------------------------------- - $r['br@clear'] = - new HTMLPurifier_AttrTransform_EnumToCSS( - 'clear', - array( - 'left' => 'clear:left;', - 'right' => 'clear:right;', - 'all' => 'clear:both;', - 'none' => 'clear:none;', - ) - ); - - // @height for td, th --------------------------------------------- - $r['td@height'] = - $r['th@height'] = - new HTMLPurifier_AttrTransform_Length('height'); - - // @hspace for img ------------------------------------------------ - $r['img@hspace'] = new HTMLPurifier_AttrTransform_ImgSpace('hspace'); - - // @noshade for hr ------------------------------------------------ - // this transformation is not precise but often good enough. - // different browsers use different styles to designate noshade - $r['hr@noshade'] = - new HTMLPurifier_AttrTransform_BoolToCSS( - 'noshade', - 'color:#808080;background-color:#808080;border:0;' - ); - - // @nowrap for td, th --------------------------------------------- - $r['td@nowrap'] = - $r['th@nowrap'] = - new HTMLPurifier_AttrTransform_BoolToCSS( - 'nowrap', - 'white-space:nowrap;' - ); - - // @size for hr -------------------------------------------------- - $r['hr@size'] = new HTMLPurifier_AttrTransform_Length('size', 'height'); - - // @type for li, ol, ul ------------------------------------------- - // {{{ - $ul_types = array( - 'disc' => 'list-style-type:disc;', - 'square' => 'list-style-type:square;', - 'circle' => 'list-style-type:circle;' - ); - $ol_types = array( - '1' => 'list-style-type:decimal;', - 'i' => 'list-style-type:lower-roman;', - 'I' => 'list-style-type:upper-roman;', - 'a' => 'list-style-type:lower-alpha;', - 'A' => 'list-style-type:upper-alpha;' - ); - $li_types = $ul_types + $ol_types; - // }}} - - $r['ul@type'] = new HTMLPurifier_AttrTransform_EnumToCSS('type', $ul_types); - $r['ol@type'] = new HTMLPurifier_AttrTransform_EnumToCSS('type', $ol_types, true); - $r['li@type'] = new HTMLPurifier_AttrTransform_EnumToCSS('type', $li_types, true); - - // @vspace for img ------------------------------------------------ - $r['img@vspace'] = new HTMLPurifier_AttrTransform_ImgSpace('vspace'); - - // @width for hr, td, th ------------------------------------------ - $r['td@width'] = - $r['th@width'] = - $r['hr@width'] = new HTMLPurifier_AttrTransform_Length('width'); - - return $r; - } -} - -// vim: et sw=4 sts=4 + 'text-align:left;', + 'right' => 'text-align:right;', + 'top' => 'caption-side:top;', + 'bottom' => 'caption-side:bottom;' // not supported by IE + ) + ); + + // @align for img ------------------------------------------------- + $r['img@align'] = + new HTMLPurifier_AttrTransform_EnumToCSS( + 'align', + array( + 'left' => 'float:left;', + 'right' => 'float:right;', + 'top' => 'vertical-align:top;', + 'middle' => 'vertical-align:middle;', + 'bottom' => 'vertical-align:baseline;', + ) + ); + + // @align for table ----------------------------------------------- + $r['table@align'] = + new HTMLPurifier_AttrTransform_EnumToCSS( + 'align', + array( + 'left' => 'float:left;', + 'center' => 'margin-left:auto;margin-right:auto;', + 'right' => 'float:right;' + ) + ); + + // @align for hr ----------------------------------------------- + $r['hr@align'] = + new HTMLPurifier_AttrTransform_EnumToCSS( + 'align', + array( + // we use both text-align and margin because these work + // for different browsers (IE and Firefox, respectively) + // and the melange makes for a pretty cross-compatible + // solution + 'left' => 'margin-left:0;margin-right:auto;text-align:left;', + 'center' => 'margin-left:auto;margin-right:auto;text-align:center;', + 'right' => 'margin-left:auto;margin-right:0;text-align:right;' + ) + ); + + // @align for h1, h2, h3, h4, h5, h6, p, div ---------------------- + // {{{ + $align_lookup = array(); + $align_values = array('left', 'right', 'center', 'justify'); + foreach ($align_values as $v) { + $align_lookup[$v] = "text-align:$v;"; + } + // }}} + $r['h1@align'] = + $r['h2@align'] = + $r['h3@align'] = + $r['h4@align'] = + $r['h5@align'] = + $r['h6@align'] = + $r['p@align'] = + $r['div@align'] = + new HTMLPurifier_AttrTransform_EnumToCSS('align', $align_lookup); + + // @bgcolor for table, tr, td, th --------------------------------- + $r['table@bgcolor'] = + $r['td@bgcolor'] = + $r['th@bgcolor'] = + new HTMLPurifier_AttrTransform_BgColor(); + + // @border for img ------------------------------------------------ + $r['img@border'] = new HTMLPurifier_AttrTransform_Border(); + + // @clear for br -------------------------------------------------- + $r['br@clear'] = + new HTMLPurifier_AttrTransform_EnumToCSS( + 'clear', + array( + 'left' => 'clear:left;', + 'right' => 'clear:right;', + 'all' => 'clear:both;', + 'none' => 'clear:none;', + ) + ); + + // @height for td, th --------------------------------------------- + $r['td@height'] = + $r['th@height'] = + new HTMLPurifier_AttrTransform_Length('height'); + + // @hspace for img ------------------------------------------------ + $r['img@hspace'] = new HTMLPurifier_AttrTransform_ImgSpace('hspace'); + + // @noshade for hr ------------------------------------------------ + // this transformation is not precise but often good enough. + // different browsers use different styles to designate noshade + $r['hr@noshade'] = + new HTMLPurifier_AttrTransform_BoolToCSS( + 'noshade', + 'color:#808080;background-color:#808080;border:0;' + ); + + // @nowrap for td, th --------------------------------------------- + $r['td@nowrap'] = + $r['th@nowrap'] = + new HTMLPurifier_AttrTransform_BoolToCSS( + 'nowrap', + 'white-space:nowrap;' + ); + + // @size for hr -------------------------------------------------- + $r['hr@size'] = new HTMLPurifier_AttrTransform_Length('size', 'height'); + + // @type for li, ol, ul ------------------------------------------- + // {{{ + $ul_types = array( + 'disc' => 'list-style-type:disc;', + 'square' => 'list-style-type:square;', + 'circle' => 'list-style-type:circle;' + ); + $ol_types = array( + '1' => 'list-style-type:decimal;', + 'i' => 'list-style-type:lower-roman;', + 'I' => 'list-style-type:upper-roman;', + 'a' => 'list-style-type:lower-alpha;', + 'A' => 'list-style-type:upper-alpha;' + ); + $li_types = $ul_types + $ol_types; + // }}} + + $r['ul@type'] = new HTMLPurifier_AttrTransform_EnumToCSS('type', $ul_types); + $r['ol@type'] = new HTMLPurifier_AttrTransform_EnumToCSS('type', $ol_types, true); + $r['li@type'] = new HTMLPurifier_AttrTransform_EnumToCSS('type', $li_types, true); + + // @vspace for img ------------------------------------------------ + $r['img@vspace'] = new HTMLPurifier_AttrTransform_ImgSpace('vspace'); + + // @width for hr, td, th ------------------------------------------ + $r['td@width'] = + $r['th@width'] = + $r['hr@width'] = new HTMLPurifier_AttrTransform_Length('width'); + + return $r; + } +} + +// vim: et sw=4 sts=4 diff --git a/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/HTMLModule/XMLCommonAttributes.php b/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/HTMLModule/XMLCommonAttributes.php similarity index 94% rename from plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/HTMLModule/XMLCommonAttributes.php rename to plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/HTMLModule/XMLCommonAttributes.php index 27a353d..01dbe9d 100755 --- a/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/HTMLModule/XMLCommonAttributes.php +++ b/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/HTMLModule/XMLCommonAttributes.php @@ -1,20 +1,20 @@ - array( - 'xml:lang' => 'LanguageCode', - ) - ); -} - -// vim: et sw=4 sts=4 + array( + 'xml:lang' => 'LanguageCode', + ) + ); +} + +// vim: et sw=4 sts=4 diff --git a/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/HTMLModuleManager.php b/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/HTMLModuleManager.php similarity index 97% rename from plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/HTMLModuleManager.php rename to plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/HTMLModuleManager.php index c684961..2546c04 100755 --- a/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/HTMLModuleManager.php +++ b/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/HTMLModuleManager.php @@ -1,459 +1,464 @@ -attrTypes = new HTMLPurifier_AttrTypes(); - $this->doctypes = new HTMLPurifier_DoctypeRegistry(); - - // setup basic modules - $common = array( - 'CommonAttributes', 'Text', 'Hypertext', 'List', - 'Presentation', 'Edit', 'Bdo', 'Tables', 'Image', - 'StyleAttribute', - // Unsafe: - 'Scripting', 'Object', 'Forms', - // Sorta legacy, but present in strict: - 'Name', - ); - $transitional = array('Legacy', 'Target', 'Iframe'); - $xml = array('XMLCommonAttributes'); - $non_xml = array('NonXMLCommonAttributes'); - - // setup basic doctypes - $this->doctypes->register( - 'HTML 4.01 Transitional', - false, - array_merge($common, $transitional, $non_xml), - array('Tidy_Transitional', 'Tidy_Proprietary'), - array(), - '-//W3C//DTD HTML 4.01 Transitional//EN', - 'http://www.w3.org/TR/html4/loose.dtd' - ); - - $this->doctypes->register( - 'HTML 4.01 Strict', - false, - array_merge($common, $non_xml), - array('Tidy_Strict', 'Tidy_Proprietary', 'Tidy_Name'), - array(), - '-//W3C//DTD HTML 4.01//EN', - 'http://www.w3.org/TR/html4/strict.dtd' - ); - - $this->doctypes->register( - 'XHTML 1.0 Transitional', - true, - array_merge($common, $transitional, $xml, $non_xml), - array('Tidy_Transitional', 'Tidy_XHTML', 'Tidy_Proprietary', 'Tidy_Name'), - array(), - '-//W3C//DTD XHTML 1.0 Transitional//EN', - 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd' - ); - - $this->doctypes->register( - 'XHTML 1.0 Strict', - true, - array_merge($common, $xml, $non_xml), - array('Tidy_Strict', 'Tidy_XHTML', 'Tidy_Strict', 'Tidy_Proprietary', 'Tidy_Name'), - array(), - '-//W3C//DTD XHTML 1.0 Strict//EN', - 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd' - ); - - $this->doctypes->register( - 'XHTML 1.1', - true, - // Iframe is a real XHTML 1.1 module, despite being - // "transitional"! - array_merge($common, $xml, array('Ruby', 'Iframe')), - array('Tidy_Strict', 'Tidy_XHTML', 'Tidy_Proprietary', 'Tidy_Strict', 'Tidy_Name'), // Tidy_XHTML1_1 - array(), - '-//W3C//DTD XHTML 1.1//EN', - 'http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd' - ); - - } - - /** - * Registers a module to the recognized module list, useful for - * overloading pre-existing modules. - * @param $module Mixed: string module name, with or without - * HTMLPurifier_HTMLModule prefix, or instance of - * subclass of HTMLPurifier_HTMLModule. - * @param $overload Boolean whether or not to overload previous modules. - * If this is not set, and you do overload a module, - * HTML Purifier will complain with a warning. - * @note This function will not call autoload, you must instantiate - * (and thus invoke) autoload outside the method. - * @note If a string is passed as a module name, different variants - * will be tested in this order: - * - Check for HTMLPurifier_HTMLModule_$name - * - Check all prefixes with $name in order they were added - * - Check for literal object name - * - Throw fatal error - * If your object name collides with an internal class, specify - * your module manually. All modules must have been included - * externally: registerModule will not perform inclusions for you! - */ - public function registerModule($module, $overload = false) - { - if (is_string($module)) { - // attempt to load the module - $original_module = $module; - $ok = false; - foreach ($this->prefixes as $prefix) { - $module = $prefix . $original_module; - if (class_exists($module)) { - $ok = true; - break; - } - } - if (!$ok) { - $module = $original_module; - if (!class_exists($module)) { - trigger_error( - $original_module . ' module does not exist', - E_USER_ERROR - ); - return; - } - } - $module = new $module(); - } - if (empty($module->name)) { - trigger_error('Module instance of ' . get_class($module) . ' must have name'); - return; - } - if (!$overload && isset($this->registeredModules[$module->name])) { - trigger_error('Overloading ' . $module->name . ' without explicit overload parameter', E_USER_WARNING); - } - $this->registeredModules[$module->name] = $module; - } - - /** - * Adds a module to the current doctype by first registering it, - * and then tacking it on to the active doctype - */ - public function addModule($module) - { - $this->registerModule($module); - if (is_object($module)) { - $module = $module->name; - } - $this->userModules[] = $module; - } - - /** - * Adds a class prefix that registerModule() will use to resolve a - * string name to a concrete class - */ - public function addPrefix($prefix) - { - $this->prefixes[] = $prefix; - } - - /** - * Performs processing on modules, after being called you may - * use getElement() and getElements() - * @param HTMLPurifier_Config $config - */ - public function setup($config) - { - $this->trusted = $config->get('HTML.Trusted'); - - // generate - $this->doctype = $this->doctypes->make($config); - $modules = $this->doctype->modules; - - // take out the default modules that aren't allowed - $lookup = $config->get('HTML.AllowedModules'); - $special_cases = $config->get('HTML.CoreModules'); - - if (is_array($lookup)) { - foreach ($modules as $k => $m) { - if (isset($special_cases[$m])) { - continue; - } - if (!isset($lookup[$m])) { - unset($modules[$k]); - } - } - } - - // custom modules - if ($config->get('HTML.Proprietary')) { - $modules[] = 'Proprietary'; - } - if ($config->get('HTML.SafeObject')) { - $modules[] = 'SafeObject'; - } - if ($config->get('HTML.SafeEmbed')) { - $modules[] = 'SafeEmbed'; - } - if ($config->get('HTML.SafeScripting') !== array()) { - $modules[] = 'SafeScripting'; - } - if ($config->get('HTML.Nofollow')) { - $modules[] = 'Nofollow'; - } - if ($config->get('HTML.TargetBlank')) { - $modules[] = 'TargetBlank'; - } - - // merge in custom modules - $modules = array_merge($modules, $this->userModules); - - foreach ($modules as $module) { - $this->processModule($module); - $this->modules[$module]->setup($config); - } - - foreach ($this->doctype->tidyModules as $module) { - $this->processModule($module); - $this->modules[$module]->setup($config); - } - - // prepare any injectors - foreach ($this->modules as $module) { - $n = array(); - foreach ($module->info_injector as $injector) { - if (!is_object($injector)) { - $class = "HTMLPurifier_Injector_$injector"; - $injector = new $class; - } - $n[$injector->name] = $injector; - } - $module->info_injector = $n; - } - - // setup lookup table based on all valid modules - foreach ($this->modules as $module) { - foreach ($module->info as $name => $def) { - if (!isset($this->elementLookup[$name])) { - $this->elementLookup[$name] = array(); - } - $this->elementLookup[$name][] = $module->name; - } - } - - // note the different choice - $this->contentSets = new HTMLPurifier_ContentSets( - // content set assembly deals with all possible modules, - // not just ones deemed to be "safe" - $this->modules - ); - $this->attrCollections = new HTMLPurifier_AttrCollections( - $this->attrTypes, - // there is no way to directly disable a global attribute, - // but using AllowedAttributes or simply not including - // the module in your custom doctype should be sufficient - $this->modules - ); - } - - /** - * Takes a module and adds it to the active module collection, - * registering it if necessary. - */ - public function processModule($module) - { - if (!isset($this->registeredModules[$module]) || is_object($module)) { - $this->registerModule($module); - } - $this->modules[$module] = $this->registeredModules[$module]; - } - - /** - * Retrieves merged element definitions. - * @return Array of HTMLPurifier_ElementDef - */ - public function getElements() - { - $elements = array(); - foreach ($this->modules as $module) { - if (!$this->trusted && !$module->safe) { - continue; - } - foreach ($module->info as $name => $v) { - if (isset($elements[$name])) { - continue; - } - $elements[$name] = $this->getElement($name); - } - } - - // remove dud elements, this happens when an element that - // appeared to be safe actually wasn't - foreach ($elements as $n => $v) { - if ($v === false) { - unset($elements[$n]); - } - } - - return $elements; - - } - - /** - * Retrieves a single merged element definition - * @param string $name Name of element - * @param bool $trusted Boolean trusted overriding parameter: set to true - * if you want the full version of an element - * @return HTMLPurifier_ElementDef Merged HTMLPurifier_ElementDef - * @note You may notice that modules are getting iterated over twice (once - * in getElements() and once here). This - * is because - */ - public function getElement($name, $trusted = null) - { - if (!isset($this->elementLookup[$name])) { - return false; - } - - // setup global state variables - $def = false; - if ($trusted === null) { - $trusted = $this->trusted; - } - - // iterate through each module that has registered itself to this - // element - foreach ($this->elementLookup[$name] as $module_name) { - $module = $this->modules[$module_name]; - - // refuse to create/merge from a module that is deemed unsafe-- - // pretend the module doesn't exist--when trusted mode is not on. - if (!$trusted && !$module->safe) { - continue; - } - - // clone is used because, ideally speaking, the original - // definition should not be modified. Usually, this will - // make no difference, but for consistency's sake - $new_def = clone $module->info[$name]; - - if (!$def && $new_def->standalone) { - $def = $new_def; - } elseif ($def) { - // This will occur even if $new_def is standalone. In practice, - // this will usually result in a full replacement. - $def->mergeIn($new_def); - } else { - // :TODO: - // non-standalone definitions that don't have a standalone - // to merge into could be deferred to the end - // HOWEVER, it is perfectly valid for a non-standalone - // definition to lack a standalone definition, even - // after all processing: this allows us to safely - // specify extra attributes for elements that may not be - // enabled all in one place. In particular, this might - // be the case for trusted elements. WARNING: care must - // be taken that the /extra/ definitions are all safe. - continue; - } - - // attribute value expansions - $this->attrCollections->performInclusions($def->attr); - $this->attrCollections->expandIdentifiers($def->attr, $this->attrTypes); - - // descendants_are_inline, for ChildDef_Chameleon - if (is_string($def->content_model) && - strpos($def->content_model, 'Inline') !== false) { - if ($name != 'del' && $name != 'ins') { - // this is for you, ins/del - $def->descendants_are_inline = true; - } - } - - $this->contentSets->generateChildDef($def, $module); - } - - // This can occur if there is a blank definition, but no base to - // mix it in with - if (!$def) { - return false; - } - - // add information on required attributes - foreach ($def->attr as $attr_name => $attr_def) { - if ($attr_def->required) { - $def->required_attr[] = $attr_name; - } - } - return $def; - } -} - -// vim: et sw=4 sts=4 +attrTypes = new HTMLPurifier_AttrTypes(); + $this->doctypes = new HTMLPurifier_DoctypeRegistry(); + + // setup basic modules + $common = array( + 'CommonAttributes', 'Text', 'Hypertext', 'List', + 'Presentation', 'Edit', 'Bdo', 'Tables', 'Image', + 'StyleAttribute', + // Unsafe: + 'Scripting', 'Object', 'Forms', + // Sorta legacy, but present in strict: + 'Name', + ); + $transitional = array('Legacy', 'Target', 'Iframe'); + $xml = array('XMLCommonAttributes'); + $non_xml = array('NonXMLCommonAttributes'); + + // setup basic doctypes + $this->doctypes->register( + 'HTML 4.01 Transitional', + false, + array_merge($common, $transitional, $non_xml), + array('Tidy_Transitional', 'Tidy_Proprietary'), + array(), + '-//W3C//DTD HTML 4.01 Transitional//EN', + 'http://www.w3.org/TR/html4/loose.dtd' + ); + + $this->doctypes->register( + 'HTML 4.01 Strict', + false, + array_merge($common, $non_xml), + array('Tidy_Strict', 'Tidy_Proprietary', 'Tidy_Name'), + array(), + '-//W3C//DTD HTML 4.01//EN', + 'http://www.w3.org/TR/html4/strict.dtd' + ); + + $this->doctypes->register( + 'XHTML 1.0 Transitional', + true, + array_merge($common, $transitional, $xml, $non_xml), + array('Tidy_Transitional', 'Tidy_XHTML', 'Tidy_Proprietary', 'Tidy_Name'), + array(), + '-//W3C//DTD XHTML 1.0 Transitional//EN', + 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd' + ); + + $this->doctypes->register( + 'XHTML 1.0 Strict', + true, + array_merge($common, $xml, $non_xml), + array('Tidy_Strict', 'Tidy_XHTML', 'Tidy_Strict', 'Tidy_Proprietary', 'Tidy_Name'), + array(), + '-//W3C//DTD XHTML 1.0 Strict//EN', + 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd' + ); + + $this->doctypes->register( + 'XHTML 1.1', + true, + // Iframe is a real XHTML 1.1 module, despite being + // "transitional"! + array_merge($common, $xml, array('Ruby', 'Iframe')), + array('Tidy_Strict', 'Tidy_XHTML', 'Tidy_Proprietary', 'Tidy_Strict', 'Tidy_Name'), // Tidy_XHTML1_1 + array(), + '-//W3C//DTD XHTML 1.1//EN', + 'http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd' + ); + + } + + /** + * Registers a module to the recognized module list, useful for + * overloading pre-existing modules. + * @param $module Mixed: string module name, with or without + * HTMLPurifier_HTMLModule prefix, or instance of + * subclass of HTMLPurifier_HTMLModule. + * @param $overload Boolean whether or not to overload previous modules. + * If this is not set, and you do overload a module, + * HTML Purifier will complain with a warning. + * @note This function will not call autoload, you must instantiate + * (and thus invoke) autoload outside the method. + * @note If a string is passed as a module name, different variants + * will be tested in this order: + * - Check for HTMLPurifier_HTMLModule_$name + * - Check all prefixes with $name in order they were added + * - Check for literal object name + * - Throw fatal error + * If your object name collides with an internal class, specify + * your module manually. All modules must have been included + * externally: registerModule will not perform inclusions for you! + */ + public function registerModule($module, $overload = false) + { + if (is_string($module)) { + // attempt to load the module + $original_module = $module; + $ok = false; + foreach ($this->prefixes as $prefix) { + $module = $prefix . $original_module; + if (class_exists($module)) { + $ok = true; + break; + } + } + if (!$ok) { + $module = $original_module; + if (!class_exists($module)) { + trigger_error( + $original_module . ' module does not exist', + E_USER_ERROR + ); + return; + } + } + $module = new $module(); + } + if (empty($module->name)) { + trigger_error('Module instance of ' . get_class($module) . ' must have name'); + return; + } + if (!$overload && isset($this->registeredModules[$module->name])) { + trigger_error('Overloading ' . $module->name . ' without explicit overload parameter', E_USER_WARNING); + } + $this->registeredModules[$module->name] = $module; + } + + /** + * Adds a module to the current doctype by first registering it, + * and then tacking it on to the active doctype + */ + public function addModule($module) + { + $this->registerModule($module); + if (is_object($module)) { + $module = $module->name; + } + $this->userModules[] = $module; + } + + /** + * Adds a class prefix that registerModule() will use to resolve a + * string name to a concrete class + */ + public function addPrefix($prefix) + { + $this->prefixes[] = $prefix; + } + + /** + * Performs processing on modules, after being called you may + * use getElement() and getElements() + * @param HTMLPurifier_Config $config + */ + public function setup($config) + { + $this->trusted = $config->get('HTML.Trusted'); + + // generate + $this->doctype = $this->doctypes->make($config); + $modules = $this->doctype->modules; + + // take out the default modules that aren't allowed + $lookup = $config->get('HTML.AllowedModules'); + $special_cases = $config->get('HTML.CoreModules'); + + if (is_array($lookup)) { + foreach ($modules as $k => $m) { + if (isset($special_cases[$m])) { + continue; + } + if (!isset($lookup[$m])) { + unset($modules[$k]); + } + } + } + + // custom modules + if ($config->get('HTML.Proprietary')) { + $modules[] = 'Proprietary'; + } + if ($config->get('HTML.SafeObject')) { + $modules[] = 'SafeObject'; + } + if ($config->get('HTML.SafeEmbed')) { + $modules[] = 'SafeEmbed'; + } + if ($config->get('HTML.SafeScripting') !== array()) { + $modules[] = 'SafeScripting'; + } + if ($config->get('HTML.Nofollow')) { + $modules[] = 'Nofollow'; + } + if ($config->get('HTML.TargetBlank')) { + $modules[] = 'TargetBlank'; + } + // NB: HTML.TargetNoreferrer must be AFTER HTML.TargetBlank + // so that its post-attr-transform gets run afterwards. + if ($config->get('HTML.TargetNoreferrer')) { + $modules[] = 'TargetNoreferrer'; + } + + // merge in custom modules + $modules = array_merge($modules, $this->userModules); + + foreach ($modules as $module) { + $this->processModule($module); + $this->modules[$module]->setup($config); + } + + foreach ($this->doctype->tidyModules as $module) { + $this->processModule($module); + $this->modules[$module]->setup($config); + } + + // prepare any injectors + foreach ($this->modules as $module) { + $n = array(); + foreach ($module->info_injector as $injector) { + if (!is_object($injector)) { + $class = "HTMLPurifier_Injector_$injector"; + $injector = new $class; + } + $n[$injector->name] = $injector; + } + $module->info_injector = $n; + } + + // setup lookup table based on all valid modules + foreach ($this->modules as $module) { + foreach ($module->info as $name => $def) { + if (!isset($this->elementLookup[$name])) { + $this->elementLookup[$name] = array(); + } + $this->elementLookup[$name][] = $module->name; + } + } + + // note the different choice + $this->contentSets = new HTMLPurifier_ContentSets( + // content set assembly deals with all possible modules, + // not just ones deemed to be "safe" + $this->modules + ); + $this->attrCollections = new HTMLPurifier_AttrCollections( + $this->attrTypes, + // there is no way to directly disable a global attribute, + // but using AllowedAttributes or simply not including + // the module in your custom doctype should be sufficient + $this->modules + ); + } + + /** + * Takes a module and adds it to the active module collection, + * registering it if necessary. + */ + public function processModule($module) + { + if (!isset($this->registeredModules[$module]) || is_object($module)) { + $this->registerModule($module); + } + $this->modules[$module] = $this->registeredModules[$module]; + } + + /** + * Retrieves merged element definitions. + * @return Array of HTMLPurifier_ElementDef + */ + public function getElements() + { + $elements = array(); + foreach ($this->modules as $module) { + if (!$this->trusted && !$module->safe) { + continue; + } + foreach ($module->info as $name => $v) { + if (isset($elements[$name])) { + continue; + } + $elements[$name] = $this->getElement($name); + } + } + + // remove dud elements, this happens when an element that + // appeared to be safe actually wasn't + foreach ($elements as $n => $v) { + if ($v === false) { + unset($elements[$n]); + } + } + + return $elements; + + } + + /** + * Retrieves a single merged element definition + * @param string $name Name of element + * @param bool $trusted Boolean trusted overriding parameter: set to true + * if you want the full version of an element + * @return HTMLPurifier_ElementDef Merged HTMLPurifier_ElementDef + * @note You may notice that modules are getting iterated over twice (once + * in getElements() and once here). This + * is because + */ + public function getElement($name, $trusted = null) + { + if (!isset($this->elementLookup[$name])) { + return false; + } + + // setup global state variables + $def = false; + if ($trusted === null) { + $trusted = $this->trusted; + } + + // iterate through each module that has registered itself to this + // element + foreach ($this->elementLookup[$name] as $module_name) { + $module = $this->modules[$module_name]; + + // refuse to create/merge from a module that is deemed unsafe-- + // pretend the module doesn't exist--when trusted mode is not on. + if (!$trusted && !$module->safe) { + continue; + } + + // clone is used because, ideally speaking, the original + // definition should not be modified. Usually, this will + // make no difference, but for consistency's sake + $new_def = clone $module->info[$name]; + + if (!$def && $new_def->standalone) { + $def = $new_def; + } elseif ($def) { + // This will occur even if $new_def is standalone. In practice, + // this will usually result in a full replacement. + $def->mergeIn($new_def); + } else { + // :TODO: + // non-standalone definitions that don't have a standalone + // to merge into could be deferred to the end + // HOWEVER, it is perfectly valid for a non-standalone + // definition to lack a standalone definition, even + // after all processing: this allows us to safely + // specify extra attributes for elements that may not be + // enabled all in one place. In particular, this might + // be the case for trusted elements. WARNING: care must + // be taken that the /extra/ definitions are all safe. + continue; + } + + // attribute value expansions + $this->attrCollections->performInclusions($def->attr); + $this->attrCollections->expandIdentifiers($def->attr, $this->attrTypes); + + // descendants_are_inline, for ChildDef_Chameleon + if (is_string($def->content_model) && + strpos($def->content_model, 'Inline') !== false) { + if ($name != 'del' && $name != 'ins') { + // this is for you, ins/del + $def->descendants_are_inline = true; + } + } + + $this->contentSets->generateChildDef($def, $module); + } + + // This can occur if there is a blank definition, but no base to + // mix it in with + if (!$def) { + return false; + } + + // add information on required attributes + foreach ($def->attr as $attr_name => $attr_def) { + if ($attr_def->required) { + $def->required_attr[] = $attr_name; + } + } + return $def; + } +} + +// vim: et sw=4 sts=4 diff --git a/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/IDAccumulator.php b/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/IDAccumulator.php similarity index 96% rename from plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/IDAccumulator.php rename to plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/IDAccumulator.php index bf399af..65c902c 100755 --- a/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/IDAccumulator.php +++ b/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/IDAccumulator.php @@ -1,57 +1,57 @@ -load($config->get('Attr.IDBlacklist')); - return $id_accumulator; - } - - /** - * Add an ID to the lookup table. - * @param string $id ID to be added. - * @return bool status, true if success, false if there's a dupe - */ - public function add($id) - { - if (isset($this->ids[$id])) { - return false; - } - return $this->ids[$id] = true; - } - - /** - * Load a list of IDs into the lookup table - * @param $array_of_ids Array of IDs to load - * @note This function doesn't care about duplicates - */ - public function load($array_of_ids) - { - foreach ($array_of_ids as $id) { - $this->ids[$id] = true; - } - } -} - -// vim: et sw=4 sts=4 +load($config->get('Attr.IDBlacklist')); + return $id_accumulator; + } + + /** + * Add an ID to the lookup table. + * @param string $id ID to be added. + * @return bool status, true if success, false if there's a dupe + */ + public function add($id) + { + if (isset($this->ids[$id])) { + return false; + } + return $this->ids[$id] = true; + } + + /** + * Load a list of IDs into the lookup table + * @param $array_of_ids Array of IDs to load + * @note This function doesn't care about duplicates + */ + public function load($array_of_ids) + { + foreach ($array_of_ids as $id) { + $this->ids[$id] = true; + } + } +} + +// vim: et sw=4 sts=4 diff --git a/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/Injector.php b/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/Injector.php similarity index 96% rename from plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/Injector.php rename to plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/Injector.php index f1a74a4..5060eef 100755 --- a/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/Injector.php +++ b/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/Injector.php @@ -1,281 +1,281 @@ -processToken() - * documentation. - * - * @todo Allow injectors to request a re-run on their output. This - * would help if an operation is recursive. - */ -abstract class HTMLPurifier_Injector -{ - - /** - * Advisory name of injector, this is for friendly error messages. - * @type string - */ - public $name; - - /** - * @type HTMLPurifier_HTMLDefinition - */ - protected $htmlDefinition; - - /** - * Reference to CurrentNesting variable in Context. This is an array - * list of tokens that we are currently "inside" - * @type array - */ - protected $currentNesting; - - /** - * Reference to current token. - * @type HTMLPurifier_Token - */ - protected $currentToken; - - /** - * Reference to InputZipper variable in Context. - * @type HTMLPurifier_Zipper - */ - protected $inputZipper; - - /** - * Array of elements and attributes this injector creates and therefore - * need to be allowed by the definition. Takes form of - * array('element' => array('attr', 'attr2'), 'element2') - * @type array - */ - public $needed = array(); - - /** - * Number of elements to rewind backwards (relative). - * @type bool|int - */ - protected $rewindOffset = false; - - /** - * Rewind to a spot to re-perform processing. This is useful if you - * deleted a node, and now need to see if this change affected any - * earlier nodes. Rewinding does not affect other injectors, and can - * result in infinite loops if not used carefully. - * @param bool|int $offset - * @warning HTML Purifier will prevent you from fast-forwarding with this - * function. - */ - public function rewindOffset($offset) - { - $this->rewindOffset = $offset; - } - - /** - * Retrieves rewind offset, and then unsets it. - * @return bool|int - */ - public function getRewindOffset() - { - $r = $this->rewindOffset; - $this->rewindOffset = false; - return $r; - } - - /** - * Prepares the injector by giving it the config and context objects: - * this allows references to important variables to be made within - * the injector. This function also checks if the HTML environment - * will work with the Injector (see checkNeeded()). - * @param HTMLPurifier_Config $config - * @param HTMLPurifier_Context $context - * @return bool|string Boolean false if success, string of missing needed element/attribute if failure - */ - public function prepare($config, $context) - { - $this->htmlDefinition = $config->getHTMLDefinition(); - // Even though this might fail, some unit tests ignore this and - // still test checkNeeded, so be careful. Maybe get rid of that - // dependency. - $result = $this->checkNeeded($config); - if ($result !== false) { - return $result; - } - $this->currentNesting =& $context->get('CurrentNesting'); - $this->currentToken =& $context->get('CurrentToken'); - $this->inputZipper =& $context->get('InputZipper'); - return false; - } - - /** - * This function checks if the HTML environment - * will work with the Injector: if p tags are not allowed, the - * Auto-Paragraphing injector should not be enabled. - * @param HTMLPurifier_Config $config - * @return bool|string Boolean false if success, string of missing needed element/attribute if failure - */ - public function checkNeeded($config) - { - $def = $config->getHTMLDefinition(); - foreach ($this->needed as $element => $attributes) { - if (is_int($element)) { - $element = $attributes; - } - if (!isset($def->info[$element])) { - return $element; - } - if (!is_array($attributes)) { - continue; - } - foreach ($attributes as $name) { - if (!isset($def->info[$element]->attr[$name])) { - return "$element.$name"; - } - } - } - return false; - } - - /** - * Tests if the context node allows a certain element - * @param string $name Name of element to test for - * @return bool True if element is allowed, false if it is not - */ - public function allowsElement($name) - { - if (!empty($this->currentNesting)) { - $parent_token = array_pop($this->currentNesting); - $this->currentNesting[] = $parent_token; - $parent = $this->htmlDefinition->info[$parent_token->name]; - } else { - $parent = $this->htmlDefinition->info_parent_def; - } - if (!isset($parent->child->elements[$name]) || isset($parent->excludes[$name])) { - return false; - } - // check for exclusion - for ($i = count($this->currentNesting) - 2; $i >= 0; $i--) { - $node = $this->currentNesting[$i]; - $def = $this->htmlDefinition->info[$node->name]; - if (isset($def->excludes[$name])) { - return false; - } - } - return true; - } - - /** - * Iterator function, which starts with the next token and continues until - * you reach the end of the input tokens. - * @warning Please prevent previous references from interfering with this - * functions by setting $i = null beforehand! - * @param int $i Current integer index variable for inputTokens - * @param HTMLPurifier_Token $current Current token variable. - * Do NOT use $token, as that variable is also a reference - * @return bool - */ - protected function forward(&$i, &$current) - { - if ($i === null) { - $i = count($this->inputZipper->back) - 1; - } else { - $i--; - } - if ($i < 0) { - return false; - } - $current = $this->inputZipper->back[$i]; - return true; - } - - /** - * Similar to _forward, but accepts a third parameter $nesting (which - * should be initialized at 0) and stops when we hit the end tag - * for the node $this->inputIndex starts in. - * @param int $i Current integer index variable for inputTokens - * @param HTMLPurifier_Token $current Current token variable. - * Do NOT use $token, as that variable is also a reference - * @param int $nesting - * @return bool - */ - protected function forwardUntilEndToken(&$i, &$current, &$nesting) - { - $result = $this->forward($i, $current); - if (!$result) { - return false; - } - if ($nesting === null) { - $nesting = 0; - } - if ($current instanceof HTMLPurifier_Token_Start) { - $nesting++; - } elseif ($current instanceof HTMLPurifier_Token_End) { - if ($nesting <= 0) { - return false; - } - $nesting--; - } - return true; - } - - /** - * Iterator function, starts with the previous token and continues until - * you reach the beginning of input tokens. - * @warning Please prevent previous references from interfering with this - * functions by setting $i = null beforehand! - * @param int $i Current integer index variable for inputTokens - * @param HTMLPurifier_Token $current Current token variable. - * Do NOT use $token, as that variable is also a reference - * @return bool - */ - protected function backward(&$i, &$current) - { - if ($i === null) { - $i = count($this->inputZipper->front) - 1; - } else { - $i--; - } - if ($i < 0) { - return false; - } - $current = $this->inputZipper->front[$i]; - return true; - } - - /** - * Handler that is called when a text token is processed - */ - public function handleText(&$token) - { - } - - /** - * Handler that is called when a start or empty token is processed - */ - public function handleElement(&$token) - { - } - - /** - * Handler that is called when an end token is processed - */ - public function handleEnd(&$token) - { - $this->notifyEnd($token); - } - - /** - * Notifier that is called when an end token is processed - * @param HTMLPurifier_Token $token Current token variable. - * @note This differs from handlers in that the token is read-only - * @deprecated - */ - public function notifyEnd($token) - { - } -} - -// vim: et sw=4 sts=4 +processToken() + * documentation. + * + * @todo Allow injectors to request a re-run on their output. This + * would help if an operation is recursive. + */ +abstract class HTMLPurifier_Injector +{ + + /** + * Advisory name of injector, this is for friendly error messages. + * @type string + */ + public $name; + + /** + * @type HTMLPurifier_HTMLDefinition + */ + protected $htmlDefinition; + + /** + * Reference to CurrentNesting variable in Context. This is an array + * list of tokens that we are currently "inside" + * @type array + */ + protected $currentNesting; + + /** + * Reference to current token. + * @type HTMLPurifier_Token + */ + protected $currentToken; + + /** + * Reference to InputZipper variable in Context. + * @type HTMLPurifier_Zipper + */ + protected $inputZipper; + + /** + * Array of elements and attributes this injector creates and therefore + * need to be allowed by the definition. Takes form of + * array('element' => array('attr', 'attr2'), 'element2') + * @type array + */ + public $needed = array(); + + /** + * Number of elements to rewind backwards (relative). + * @type bool|int + */ + protected $rewindOffset = false; + + /** + * Rewind to a spot to re-perform processing. This is useful if you + * deleted a node, and now need to see if this change affected any + * earlier nodes. Rewinding does not affect other injectors, and can + * result in infinite loops if not used carefully. + * @param bool|int $offset + * @warning HTML Purifier will prevent you from fast-forwarding with this + * function. + */ + public function rewindOffset($offset) + { + $this->rewindOffset = $offset; + } + + /** + * Retrieves rewind offset, and then unsets it. + * @return bool|int + */ + public function getRewindOffset() + { + $r = $this->rewindOffset; + $this->rewindOffset = false; + return $r; + } + + /** + * Prepares the injector by giving it the config and context objects: + * this allows references to important variables to be made within + * the injector. This function also checks if the HTML environment + * will work with the Injector (see checkNeeded()). + * @param HTMLPurifier_Config $config + * @param HTMLPurifier_Context $context + * @return bool|string Boolean false if success, string of missing needed element/attribute if failure + */ + public function prepare($config, $context) + { + $this->htmlDefinition = $config->getHTMLDefinition(); + // Even though this might fail, some unit tests ignore this and + // still test checkNeeded, so be careful. Maybe get rid of that + // dependency. + $result = $this->checkNeeded($config); + if ($result !== false) { + return $result; + } + $this->currentNesting =& $context->get('CurrentNesting'); + $this->currentToken =& $context->get('CurrentToken'); + $this->inputZipper =& $context->get('InputZipper'); + return false; + } + + /** + * This function checks if the HTML environment + * will work with the Injector: if p tags are not allowed, the + * Auto-Paragraphing injector should not be enabled. + * @param HTMLPurifier_Config $config + * @return bool|string Boolean false if success, string of missing needed element/attribute if failure + */ + public function checkNeeded($config) + { + $def = $config->getHTMLDefinition(); + foreach ($this->needed as $element => $attributes) { + if (is_int($element)) { + $element = $attributes; + } + if (!isset($def->info[$element])) { + return $element; + } + if (!is_array($attributes)) { + continue; + } + foreach ($attributes as $name) { + if (!isset($def->info[$element]->attr[$name])) { + return "$element.$name"; + } + } + } + return false; + } + + /** + * Tests if the context node allows a certain element + * @param string $name Name of element to test for + * @return bool True if element is allowed, false if it is not + */ + public function allowsElement($name) + { + if (!empty($this->currentNesting)) { + $parent_token = array_pop($this->currentNesting); + $this->currentNesting[] = $parent_token; + $parent = $this->htmlDefinition->info[$parent_token->name]; + } else { + $parent = $this->htmlDefinition->info_parent_def; + } + if (!isset($parent->child->elements[$name]) || isset($parent->excludes[$name])) { + return false; + } + // check for exclusion + for ($i = count($this->currentNesting) - 2; $i >= 0; $i--) { + $node = $this->currentNesting[$i]; + $def = $this->htmlDefinition->info[$node->name]; + if (isset($def->excludes[$name])) { + return false; + } + } + return true; + } + + /** + * Iterator function, which starts with the next token and continues until + * you reach the end of the input tokens. + * @warning Please prevent previous references from interfering with this + * functions by setting $i = null beforehand! + * @param int $i Current integer index variable for inputTokens + * @param HTMLPurifier_Token $current Current token variable. + * Do NOT use $token, as that variable is also a reference + * @return bool + */ + protected function forward(&$i, &$current) + { + if ($i === null) { + $i = count($this->inputZipper->back) - 1; + } else { + $i--; + } + if ($i < 0) { + return false; + } + $current = $this->inputZipper->back[$i]; + return true; + } + + /** + * Similar to _forward, but accepts a third parameter $nesting (which + * should be initialized at 0) and stops when we hit the end tag + * for the node $this->inputIndex starts in. + * @param int $i Current integer index variable for inputTokens + * @param HTMLPurifier_Token $current Current token variable. + * Do NOT use $token, as that variable is also a reference + * @param int $nesting + * @return bool + */ + protected function forwardUntilEndToken(&$i, &$current, &$nesting) + { + $result = $this->forward($i, $current); + if (!$result) { + return false; + } + if ($nesting === null) { + $nesting = 0; + } + if ($current instanceof HTMLPurifier_Token_Start) { + $nesting++; + } elseif ($current instanceof HTMLPurifier_Token_End) { + if ($nesting <= 0) { + return false; + } + $nesting--; + } + return true; + } + + /** + * Iterator function, starts with the previous token and continues until + * you reach the beginning of input tokens. + * @warning Please prevent previous references from interfering with this + * functions by setting $i = null beforehand! + * @param int $i Current integer index variable for inputTokens + * @param HTMLPurifier_Token $current Current token variable. + * Do NOT use $token, as that variable is also a reference + * @return bool + */ + protected function backward(&$i, &$current) + { + if ($i === null) { + $i = count($this->inputZipper->front) - 1; + } else { + $i--; + } + if ($i < 0) { + return false; + } + $current = $this->inputZipper->front[$i]; + return true; + } + + /** + * Handler that is called when a text token is processed + */ + public function handleText(&$token) + { + } + + /** + * Handler that is called when a start or empty token is processed + */ + public function handleElement(&$token) + { + } + + /** + * Handler that is called when an end token is processed + */ + public function handleEnd(&$token) + { + $this->notifyEnd($token); + } + + /** + * Notifier that is called when an end token is processed + * @param HTMLPurifier_Token $token Current token variable. + * @note This differs from handlers in that the token is read-only + * @deprecated + */ + public function notifyEnd($token) + { + } +} + +// vim: et sw=4 sts=4 diff --git a/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/Injector/AutoParagraph.php b/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/Injector/AutoParagraph.php similarity index 97% rename from plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/Injector/AutoParagraph.php rename to plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/Injector/AutoParagraph.php index d3ec44f..4afdd12 100755 --- a/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/Injector/AutoParagraph.php +++ b/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/Injector/AutoParagraph.php @@ -1,356 +1,356 @@ -armor['MakeWellFormed_TagClosedError'] = true; - return $par; - } - - /** - * @param HTMLPurifier_Token_Text $token - */ - public function handleText(&$token) - { - $text = $token->data; - // Does the current parent allow

tags? - if ($this->allowsElement('p')) { - if (empty($this->currentNesting) || strpos($text, "\n\n") !== false) { - // Note that we have differing behavior when dealing with text - // in the anonymous root node, or a node inside the document. - // If the text as a double-newline, the treatment is the same; - // if it doesn't, see the next if-block if you're in the document. - - $i = $nesting = null; - if (!$this->forwardUntilEndToken($i, $current, $nesting) && $token->is_whitespace) { - // State 1.1: ... ^ (whitespace, then document end) - // ---- - // This is a degenerate case - } else { - if (!$token->is_whitespace || $this->_isInline($current)) { - // State 1.2: PAR1 - // ---- - - // State 1.3: PAR1\n\nPAR2 - // ------------ - - // State 1.4:

PAR1\n\nPAR2 (see State 2) - // ------------ - $token = array($this->_pStart()); - $this->_splitText($text, $token); - } else { - // State 1.5: \n
- // -- - } - } - } else { - // State 2:
PAR1... (similar to 1.4) - // ---- - - // We're in an element that allows paragraph tags, but we're not - // sure if we're going to need them. - if ($this->_pLookAhead()) { - // State 2.1:
PAR1PAR1\n\nPAR2 - // ---- - // Note: This will always be the first child, since any - // previous inline element would have triggered this very - // same routine, and found the double newline. One possible - // exception would be a comment. - $token = array($this->_pStart(), $token); - } else { - // State 2.2.1:
PAR1
- // ---- - - // State 2.2.2:
PAR1PAR1
- // ---- - } - } - // Is the current parent a

tag? - } elseif (!empty($this->currentNesting) && - $this->currentNesting[count($this->currentNesting) - 1]->name == 'p') { - // State 3.1: ...

PAR1 - // ---- - - // State 3.2: ...

PAR1\n\nPAR2 - // ------------ - $token = array(); - $this->_splitText($text, $token); - // Abort! - } else { - // State 4.1: ...PAR1 - // ---- - - // State 4.2: ...PAR1\n\nPAR2 - // ------------ - } - } - - /** - * @param HTMLPurifier_Token $token - */ - public function handleElement(&$token) - { - // We don't have to check if we're already in a

tag for block - // tokens, because the tag would have been autoclosed by MakeWellFormed. - if ($this->allowsElement('p')) { - if (!empty($this->currentNesting)) { - if ($this->_isInline($token)) { - // State 1:

... - // --- - // Check if this token is adjacent to the parent token - // (seek backwards until token isn't whitespace) - $i = null; - $this->backward($i, $prev); - - if (!$prev instanceof HTMLPurifier_Token_Start) { - // Token wasn't adjacent - if ($prev instanceof HTMLPurifier_Token_Text && - substr($prev->data, -2) === "\n\n" - ) { - // State 1.1.4:

PAR1

\n\n - // --- - // Quite frankly, this should be handled by splitText - $token = array($this->_pStart(), $token); - } else { - // State 1.1.1:

PAR1

- // --- - // State 1.1.2:

- // --- - // State 1.1.3:
PAR - // --- - } - } else { - // State 1.2.1:
- // --- - // Lookahead to see if

is needed. - if ($this->_pLookAhead()) { - // State 1.3.1:

PAR1\n\nPAR2 - // --- - $token = array($this->_pStart(), $token); - } else { - // State 1.3.2:
PAR1
- // --- - - // State 1.3.3:
PAR1
\n\n
- // --- - } - } - } else { - // State 2.3: ...
- // ----- - } - } else { - if ($this->_isInline($token)) { - // State 3.1: - // --- - // This is where the {p} tag is inserted, not reflected in - // inputTokens yet, however. - $token = array($this->_pStart(), $token); - } else { - // State 3.2:
- // ----- - } - - $i = null; - if ($this->backward($i, $prev)) { - if (!$prev instanceof HTMLPurifier_Token_Text) { - // State 3.1.1: ...

{p} - // --- - // State 3.2.1: ...

- // ----- - if (!is_array($token)) { - $token = array($token); - } - array_unshift($token, new HTMLPurifier_Token_Text("\n\n")); - } else { - // State 3.1.2: ...

\n\n{p} - // --- - // State 3.2.2: ...

\n\n
- // ----- - // Note: PAR cannot occur because PAR would have been - // wrapped in

tags. - } - } - } - } else { - // State 2.2:

  • - // ---- - // State 2.4:

    - // --- - } - } - - /** - * Splits up a text in paragraph tokens and appends them - * to the result stream that will replace the original - * @param string $data String text data that will be processed - * into paragraphs - * @param HTMLPurifier_Token[] $result Reference to array of tokens that the - * tags will be appended onto - */ - private function _splitText($data, &$result) - { - $raw_paragraphs = explode("\n\n", $data); - $paragraphs = array(); // without empty paragraphs - $needs_start = false; - $needs_end = false; - - $c = count($raw_paragraphs); - if ($c == 1) { - // There were no double-newlines, abort quickly. In theory this - // should never happen. - $result[] = new HTMLPurifier_Token_Text($data); - return; - } - for ($i = 0; $i < $c; $i++) { - $par = $raw_paragraphs[$i]; - if (trim($par) !== '') { - $paragraphs[] = $par; - } else { - if ($i == 0) { - // Double newline at the front - if (empty($result)) { - // The empty result indicates that the AutoParagraph - // injector did not add any start paragraph tokens. - // This means that we have been in a paragraph for - // a while, and the newline means we should start a new one. - $result[] = new HTMLPurifier_Token_End('p'); - $result[] = new HTMLPurifier_Token_Text("\n\n"); - // However, the start token should only be added if - // there is more processing to be done (i.e. there are - // real paragraphs in here). If there are none, the - // next start paragraph tag will be handled by the - // next call to the injector - $needs_start = true; - } else { - // We just started a new paragraph! - // Reinstate a double-newline for presentation's sake, since - // it was in the source code. - array_unshift($result, new HTMLPurifier_Token_Text("\n\n")); - } - } elseif ($i + 1 == $c) { - // Double newline at the end - // There should be a trailing

    when we're finally done. - $needs_end = true; - } - } - } - - // Check if this was just a giant blob of whitespace. Move this earlier, - // perhaps? - if (empty($paragraphs)) { - return; - } - - // Add the start tag indicated by \n\n at the beginning of $data - if ($needs_start) { - $result[] = $this->_pStart(); - } - - // Append the paragraphs onto the result - foreach ($paragraphs as $par) { - $result[] = new HTMLPurifier_Token_Text($par); - $result[] = new HTMLPurifier_Token_End('p'); - $result[] = new HTMLPurifier_Token_Text("\n\n"); - $result[] = $this->_pStart(); - } - - // Remove trailing start token; Injector will handle this later if - // it was indeed needed. This prevents from needing to do a lookahead, - // at the cost of a lookbehind later. - array_pop($result); - - // If there is no need for an end tag, remove all of it and let - // MakeWellFormed close it later. - if (!$needs_end) { - array_pop($result); // removes \n\n - array_pop($result); // removes

    - } - } - - /** - * Returns true if passed token is inline (and, ergo, allowed in - * paragraph tags) - * @param HTMLPurifier_Token $token - * @return bool - */ - private function _isInline($token) - { - return isset($this->htmlDefinition->info['p']->child->elements[$token->name]); - } - - /** - * Looks ahead in the token list and determines whether or not we need - * to insert a

    tag. - * @return bool - */ - private function _pLookAhead() - { - if ($this->currentToken instanceof HTMLPurifier_Token_Start) { - $nesting = 1; - } else { - $nesting = 0; - } - $ok = false; - $i = null; - while ($this->forwardUntilEndToken($i, $current, $nesting)) { - $result = $this->_checkNeedsP($current); - if ($result !== null) { - $ok = $result; - break; - } - } - return $ok; - } - - /** - * Determines if a particular token requires an earlier inline token - * to get a paragraph. This should be used with _forwardUntilEndToken - * @param HTMLPurifier_Token $current - * @return bool - */ - private function _checkNeedsP($current) - { - if ($current instanceof HTMLPurifier_Token_Start) { - if (!$this->_isInline($current)) { - //

    PAR1
    - // ---- - // Terminate early, since we hit a block element - return false; - } - } elseif ($current instanceof HTMLPurifier_Token_Text) { - if (strpos($current->data, "\n\n") !== false) { - //
    PAR1PAR1\n\nPAR2 - // ---- - return true; - } else { - //
    PAR1PAR1... - // ---- - } - } - return null; - } -} - -// vim: et sw=4 sts=4 +armor['MakeWellFormed_TagClosedError'] = true; + return $par; + } + + /** + * @param HTMLPurifier_Token_Text $token + */ + public function handleText(&$token) + { + $text = $token->data; + // Does the current parent allow

    tags? + if ($this->allowsElement('p')) { + if (empty($this->currentNesting) || strpos($text, "\n\n") !== false) { + // Note that we have differing behavior when dealing with text + // in the anonymous root node, or a node inside the document. + // If the text as a double-newline, the treatment is the same; + // if it doesn't, see the next if-block if you're in the document. + + $i = $nesting = null; + if (!$this->forwardUntilEndToken($i, $current, $nesting) && $token->is_whitespace) { + // State 1.1: ... ^ (whitespace, then document end) + // ---- + // This is a degenerate case + } else { + if (!$token->is_whitespace || $this->_isInline($current)) { + // State 1.2: PAR1 + // ---- + + // State 1.3: PAR1\n\nPAR2 + // ------------ + + // State 1.4:

    PAR1\n\nPAR2 (see State 2) + // ------------ + $token = array($this->_pStart()); + $this->_splitText($text, $token); + } else { + // State 1.5: \n
    + // -- + } + } + } else { + // State 2:
    PAR1... (similar to 1.4) + // ---- + + // We're in an element that allows paragraph tags, but we're not + // sure if we're going to need them. + if ($this->_pLookAhead()) { + // State 2.1:
    PAR1PAR1\n\nPAR2 + // ---- + // Note: This will always be the first child, since any + // previous inline element would have triggered this very + // same routine, and found the double newline. One possible + // exception would be a comment. + $token = array($this->_pStart(), $token); + } else { + // State 2.2.1:
    PAR1
    + // ---- + + // State 2.2.2:
    PAR1PAR1
    + // ---- + } + } + // Is the current parent a

    tag? + } elseif (!empty($this->currentNesting) && + $this->currentNesting[count($this->currentNesting) - 1]->name == 'p') { + // State 3.1: ...

    PAR1 + // ---- + + // State 3.2: ...

    PAR1\n\nPAR2 + // ------------ + $token = array(); + $this->_splitText($text, $token); + // Abort! + } else { + // State 4.1: ...PAR1 + // ---- + + // State 4.2: ...PAR1\n\nPAR2 + // ------------ + } + } + + /** + * @param HTMLPurifier_Token $token + */ + public function handleElement(&$token) + { + // We don't have to check if we're already in a

    tag for block + // tokens, because the tag would have been autoclosed by MakeWellFormed. + if ($this->allowsElement('p')) { + if (!empty($this->currentNesting)) { + if ($this->_isInline($token)) { + // State 1:

    ... + // --- + // Check if this token is adjacent to the parent token + // (seek backwards until token isn't whitespace) + $i = null; + $this->backward($i, $prev); + + if (!$prev instanceof HTMLPurifier_Token_Start) { + // Token wasn't adjacent + if ($prev instanceof HTMLPurifier_Token_Text && + substr($prev->data, -2) === "\n\n" + ) { + // State 1.1.4:

    PAR1

    \n\n + // --- + // Quite frankly, this should be handled by splitText + $token = array($this->_pStart(), $token); + } else { + // State 1.1.1:

    PAR1

    + // --- + // State 1.1.2:

    + // --- + // State 1.1.3:
    PAR + // --- + } + } else { + // State 1.2.1:
    + // --- + // Lookahead to see if

    is needed. + if ($this->_pLookAhead()) { + // State 1.3.1:

    PAR1\n\nPAR2 + // --- + $token = array($this->_pStart(), $token); + } else { + // State 1.3.2:
    PAR1
    + // --- + + // State 1.3.3:
    PAR1
    \n\n
    + // --- + } + } + } else { + // State 2.3: ...
    + // ----- + } + } else { + if ($this->_isInline($token)) { + // State 3.1: + // --- + // This is where the {p} tag is inserted, not reflected in + // inputTokens yet, however. + $token = array($this->_pStart(), $token); + } else { + // State 3.2:
    + // ----- + } + + $i = null; + if ($this->backward($i, $prev)) { + if (!$prev instanceof HTMLPurifier_Token_Text) { + // State 3.1.1: ...

    {p} + // --- + // State 3.2.1: ...

    + // ----- + if (!is_array($token)) { + $token = array($token); + } + array_unshift($token, new HTMLPurifier_Token_Text("\n\n")); + } else { + // State 3.1.2: ...

    \n\n{p} + // --- + // State 3.2.2: ...

    \n\n
    + // ----- + // Note: PAR cannot occur because PAR would have been + // wrapped in

    tags. + } + } + } + } else { + // State 2.2:

    • + // ---- + // State 2.4:

      + // --- + } + } + + /** + * Splits up a text in paragraph tokens and appends them + * to the result stream that will replace the original + * @param string $data String text data that will be processed + * into paragraphs + * @param HTMLPurifier_Token[] $result Reference to array of tokens that the + * tags will be appended onto + */ + private function _splitText($data, &$result) + { + $raw_paragraphs = explode("\n\n", $data); + $paragraphs = array(); // without empty paragraphs + $needs_start = false; + $needs_end = false; + + $c = count($raw_paragraphs); + if ($c == 1) { + // There were no double-newlines, abort quickly. In theory this + // should never happen. + $result[] = new HTMLPurifier_Token_Text($data); + return; + } + for ($i = 0; $i < $c; $i++) { + $par = $raw_paragraphs[$i]; + if (trim($par) !== '') { + $paragraphs[] = $par; + } else { + if ($i == 0) { + // Double newline at the front + if (empty($result)) { + // The empty result indicates that the AutoParagraph + // injector did not add any start paragraph tokens. + // This means that we have been in a paragraph for + // a while, and the newline means we should start a new one. + $result[] = new HTMLPurifier_Token_End('p'); + $result[] = new HTMLPurifier_Token_Text("\n\n"); + // However, the start token should only be added if + // there is more processing to be done (i.e. there are + // real paragraphs in here). If there are none, the + // next start paragraph tag will be handled by the + // next call to the injector + $needs_start = true; + } else { + // We just started a new paragraph! + // Reinstate a double-newline for presentation's sake, since + // it was in the source code. + array_unshift($result, new HTMLPurifier_Token_Text("\n\n")); + } + } elseif ($i + 1 == $c) { + // Double newline at the end + // There should be a trailing

      when we're finally done. + $needs_end = true; + } + } + } + + // Check if this was just a giant blob of whitespace. Move this earlier, + // perhaps? + if (empty($paragraphs)) { + return; + } + + // Add the start tag indicated by \n\n at the beginning of $data + if ($needs_start) { + $result[] = $this->_pStart(); + } + + // Append the paragraphs onto the result + foreach ($paragraphs as $par) { + $result[] = new HTMLPurifier_Token_Text($par); + $result[] = new HTMLPurifier_Token_End('p'); + $result[] = new HTMLPurifier_Token_Text("\n\n"); + $result[] = $this->_pStart(); + } + + // Remove trailing start token; Injector will handle this later if + // it was indeed needed. This prevents from needing to do a lookahead, + // at the cost of a lookbehind later. + array_pop($result); + + // If there is no need for an end tag, remove all of it and let + // MakeWellFormed close it later. + if (!$needs_end) { + array_pop($result); // removes \n\n + array_pop($result); // removes

      + } + } + + /** + * Returns true if passed token is inline (and, ergo, allowed in + * paragraph tags) + * @param HTMLPurifier_Token $token + * @return bool + */ + private function _isInline($token) + { + return isset($this->htmlDefinition->info['p']->child->elements[$token->name]); + } + + /** + * Looks ahead in the token list and determines whether or not we need + * to insert a

      tag. + * @return bool + */ + private function _pLookAhead() + { + if ($this->currentToken instanceof HTMLPurifier_Token_Start) { + $nesting = 1; + } else { + $nesting = 0; + } + $ok = false; + $i = null; + while ($this->forwardUntilEndToken($i, $current, $nesting)) { + $result = $this->_checkNeedsP($current); + if ($result !== null) { + $ok = $result; + break; + } + } + return $ok; + } + + /** + * Determines if a particular token requires an earlier inline token + * to get a paragraph. This should be used with _forwardUntilEndToken + * @param HTMLPurifier_Token $current + * @return bool + */ + private function _checkNeedsP($current) + { + if ($current instanceof HTMLPurifier_Token_Start) { + if (!$this->_isInline($current)) { + //

      PAR1
      + // ---- + // Terminate early, since we hit a block element + return false; + } + } elseif ($current instanceof HTMLPurifier_Token_Text) { + if (strpos($current->data, "\n\n") !== false) { + //
      PAR1PAR1\n\nPAR2 + // ---- + return true; + } else { + //
      PAR1PAR1... + // ---- + } + } + return null; + } +} + +// vim: et sw=4 sts=4 diff --git a/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/Injector/DisplayLinkURI.php b/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/Injector/DisplayLinkURI.php similarity index 95% rename from plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/Injector/DisplayLinkURI.php rename to plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/Injector/DisplayLinkURI.php index 9f90448..c19b1bc 100755 --- a/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/Injector/DisplayLinkURI.php +++ b/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/Injector/DisplayLinkURI.php @@ -1,40 +1,40 @@ -start->attr['href'])) { - $url = $token->start->attr['href']; - unset($token->start->attr['href']); - $token = array($token, new HTMLPurifier_Token_Text(" ($url)")); - } else { - // nothing to display - } - } -} - -// vim: et sw=4 sts=4 +start->attr['href'])) { + $url = $token->start->attr['href']; + unset($token->start->attr['href']); + $token = array($token, new HTMLPurifier_Token_Text(" ($url)")); + } else { + // nothing to display + } + } +} + +// vim: et sw=4 sts=4 diff --git a/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/Injector/Linkify.php b/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/Injector/Linkify.php similarity index 69% rename from plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/Injector/Linkify.php rename to plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/Injector/Linkify.php index 5eed3c1..74f83ea 100755 --- a/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/Injector/Linkify.php +++ b/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/Injector/Linkify.php @@ -1,59 +1,64 @@ - array('href')); - - /** - * @param HTMLPurifier_Token $token - */ - public function handleText(&$token) - { - if (!$this->allowsElement('a')) { - return; - } - - if (strpos($token->data, '://') === false) { - // our really quick heuristic failed, abort - // this may not work so well if we want to match things like - // "google.com", but then again, most people don't - return; - } - - // there is/are URL(s). Let's split the string: - // Note: this regex is extremely permissive - $bits = preg_split('#((?:https?|ftp)://[^\s\'",<>()]+)#Su', $token->data, -1, PREG_SPLIT_DELIM_CAPTURE); - - - $token = array(); - - // $i = index - // $c = count - // $l = is link - for ($i = 0, $c = count($bits), $l = false; $i < $c; $i++, $l = !$l) { - if (!$l) { - if ($bits[$i] === '') { - continue; - } - $token[] = new HTMLPurifier_Token_Text($bits[$i]); - } else { - $token[] = new HTMLPurifier_Token_Start('a', array('href' => $bits[$i])); - $token[] = new HTMLPurifier_Token_Text($bits[$i]); - $token[] = new HTMLPurifier_Token_End('a'); - } - } - } -} - -// vim: et sw=4 sts=4 + array('href')); + + /** + * @param HTMLPurifier_Token $token + */ + public function handleText(&$token) + { + if (!$this->allowsElement('a')) { + return; + } + + if (strpos($token->data, '://') === false) { + // our really quick heuristic failed, abort + // this may not work so well if we want to match things like + // "google.com", but then again, most people don't + return; + } + + // there is/are URL(s). Let's split the string. + // We use this regex: + // https://gist.github.com/gruber/249502 + // but with @cscott's backtracking fix and also + // the Unicode characters un-Unicodified. + $bits = preg_split( + '/\\b((?:[a-z][\\w\\-]+:(?:\\/{1,3}|[a-z0-9%])|www\\d{0,3}[.]|[a-z0-9.\\-]+[.][a-z]{2,4}\\/)(?:[^\\s()<>]|\\((?:[^\\s()<>]|(?:\\([^\\s()<>]+\\)))*\\))+(?:\\((?:[^\\s()<>]|(?:\\([^\\s()<>]+\\)))*\\)|[^\\s`!()\\[\\]{};:\'".,<>?\x{00ab}\x{00bb}\x{201c}\x{201d}\x{2018}\x{2019}]))/iu', + $token->data, -1, PREG_SPLIT_DELIM_CAPTURE); + + + $token = array(); + + // $i = index + // $c = count + // $l = is link + for ($i = 0, $c = count($bits), $l = false; $i < $c; $i++, $l = !$l) { + if (!$l) { + if ($bits[$i] === '') { + continue; + } + $token[] = new HTMLPurifier_Token_Text($bits[$i]); + } else { + $token[] = new HTMLPurifier_Token_Start('a', array('href' => $bits[$i])); + $token[] = new HTMLPurifier_Token_Text($bits[$i]); + $token[] = new HTMLPurifier_Token_End('a'); + } + } + } +} + +// vim: et sw=4 sts=4 diff --git a/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/Injector/PurifierLinkify.php b/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/Injector/PurifierLinkify.php similarity index 96% rename from plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/Injector/PurifierLinkify.php rename to plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/Injector/PurifierLinkify.php index d7dd7d9..cb9046f 100755 --- a/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/Injector/PurifierLinkify.php +++ b/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/Injector/PurifierLinkify.php @@ -1,71 +1,71 @@ - array('href')); - - /** - * @param HTMLPurifier_Config $config - * @param HTMLPurifier_Context $context - * @return string - */ - public function prepare($config, $context) - { - $this->docURL = $config->get('AutoFormat.PurifierLinkify.DocURL'); - return parent::prepare($config, $context); - } - - /** - * @param HTMLPurifier_Token $token - */ - public function handleText(&$token) - { - if (!$this->allowsElement('a')) { - return; - } - if (strpos($token->data, '%') === false) { - return; - } - - $bits = preg_split('#%([a-z0-9]+\.[a-z0-9]+)#Si', $token->data, -1, PREG_SPLIT_DELIM_CAPTURE); - $token = array(); - - // $i = index - // $c = count - // $l = is link - for ($i = 0, $c = count($bits), $l = false; $i < $c; $i++, $l = !$l) { - if (!$l) { - if ($bits[$i] === '') { - continue; - } - $token[] = new HTMLPurifier_Token_Text($bits[$i]); - } else { - $token[] = new HTMLPurifier_Token_Start( - 'a', - array('href' => str_replace('%s', $bits[$i], $this->docURL)) - ); - $token[] = new HTMLPurifier_Token_Text('%' . $bits[$i]); - $token[] = new HTMLPurifier_Token_End('a'); - } - } - } -} - -// vim: et sw=4 sts=4 + array('href')); + + /** + * @param HTMLPurifier_Config $config + * @param HTMLPurifier_Context $context + * @return string + */ + public function prepare($config, $context) + { + $this->docURL = $config->get('AutoFormat.PurifierLinkify.DocURL'); + return parent::prepare($config, $context); + } + + /** + * @param HTMLPurifier_Token $token + */ + public function handleText(&$token) + { + if (!$this->allowsElement('a')) { + return; + } + if (strpos($token->data, '%') === false) { + return; + } + + $bits = preg_split('#%([a-z0-9]+\.[a-z0-9]+)#Si', $token->data, -1, PREG_SPLIT_DELIM_CAPTURE); + $token = array(); + + // $i = index + // $c = count + // $l = is link + for ($i = 0, $c = count($bits), $l = false; $i < $c; $i++, $l = !$l) { + if (!$l) { + if ($bits[$i] === '') { + continue; + } + $token[] = new HTMLPurifier_Token_Text($bits[$i]); + } else { + $token[] = new HTMLPurifier_Token_Start( + 'a', + array('href' => str_replace('%s', $bits[$i], $this->docURL)) + ); + $token[] = new HTMLPurifier_Token_Text('%' . $bits[$i]); + $token[] = new HTMLPurifier_Token_End('a'); + } + } + } +} + +// vim: et sw=4 sts=4 diff --git a/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/Injector/RemoveEmpty.php b/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/Injector/RemoveEmpty.php similarity index 81% rename from plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/Injector/RemoveEmpty.php rename to plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/Injector/RemoveEmpty.php index 55669d1..0ebc477 100755 --- a/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/Injector/RemoveEmpty.php +++ b/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/Injector/RemoveEmpty.php @@ -1,101 +1,112 @@ - 1, 'th' => 1, 'td' => 1, 'iframe' => 1); - - /** - * @param HTMLPurifier_Config $config - * @param HTMLPurifier_Context $context - * @return void - */ - public function prepare($config, $context) - { - parent::prepare($config, $context); - $this->config = $config; - $this->context = $context; - $this->removeNbsp = $config->get('AutoFormat.RemoveEmpty.RemoveNbsp'); - $this->removeNbspExceptions = $config->get('AutoFormat.RemoveEmpty.RemoveNbsp.Exceptions'); - $this->attrValidator = new HTMLPurifier_AttrValidator(); - } - - /** - * @param HTMLPurifier_Token $token - */ - public function handleElement(&$token) - { - if (!$token instanceof HTMLPurifier_Token_Start) { - return; - } - $next = false; - $deleted = 1; // the current tag - for ($i = count($this->inputZipper->back) - 1; $i >= 0; $i--, $deleted++) { - $next = $this->inputZipper->back[$i]; - if ($next instanceof HTMLPurifier_Token_Text) { - if ($next->is_whitespace) { - continue; - } - if ($this->removeNbsp && !isset($this->removeNbspExceptions[$token->name])) { - $plain = str_replace("\xC2\xA0", "", $next->data); - $isWsOrNbsp = $plain === '' || ctype_space($plain); - if ($isWsOrNbsp) { - continue; - } - } - } - break; - } - if (!$next || ($next instanceof HTMLPurifier_Token_End && $next->name == $token->name)) { - if (isset($this->_exclude[$token->name])) { - return; - } - $this->attrValidator->validateToken($token, $this->config, $this->context); - $token->armor['ValidateAttributes'] = true; - if (isset($token->attr['id']) || isset($token->attr['name'])) { - return; - } - $token = $deleted + 1; - for ($b = 0, $c = count($this->inputZipper->front); $b < $c; $b++) { - $prev = $this->inputZipper->front[$b]; - if ($prev instanceof HTMLPurifier_Token_Text && $prev->is_whitespace) { - continue; - } - break; - } - // This is safe because we removed the token that triggered this. - $this->rewindOffset($b+$deleted); - return; - } - } -} - -// vim: et sw=4 sts=4 +config = $config; + $this->context = $context; + $this->removeNbsp = $config->get('AutoFormat.RemoveEmpty.RemoveNbsp'); + $this->removeNbspExceptions = $config->get('AutoFormat.RemoveEmpty.RemoveNbsp.Exceptions'); + $this->exclude = $config->get('AutoFormat.RemoveEmpty.Predicate'); + foreach ($this->exclude as $key => $attrs) { + if (!is_array($attrs)) { + // HACK, see HTMLPurifier/Printer/ConfigForm.php + $this->exclude[$key] = explode(';', $attrs); + } + } + $this->attrValidator = new HTMLPurifier_AttrValidator(); + } + + /** + * @param HTMLPurifier_Token $token + */ + public function handleElement(&$token) + { + if (!$token instanceof HTMLPurifier_Token_Start) { + return; + } + $next = false; + $deleted = 1; // the current tag + for ($i = count($this->inputZipper->back) - 1; $i >= 0; $i--, $deleted++) { + $next = $this->inputZipper->back[$i]; + if ($next instanceof HTMLPurifier_Token_Text) { + if ($next->is_whitespace) { + continue; + } + if ($this->removeNbsp && !isset($this->removeNbspExceptions[$token->name])) { + $plain = str_replace("\xC2\xA0", "", $next->data); + $isWsOrNbsp = $plain === '' || ctype_space($plain); + if ($isWsOrNbsp) { + continue; + } + } + } + break; + } + if (!$next || ($next instanceof HTMLPurifier_Token_End && $next->name == $token->name)) { + $this->attrValidator->validateToken($token, $this->config, $this->context); + $token->armor['ValidateAttributes'] = true; + if (isset($this->exclude[$token->name])) { + $r = true; + foreach ($this->exclude[$token->name] as $elem) { + if (!isset($token->attr[$elem])) $r = false; + } + if ($r) return; + } + if (isset($token->attr['id']) || isset($token->attr['name'])) { + return; + } + $token = $deleted + 1; + for ($b = 0, $c = count($this->inputZipper->front); $b < $c; $b++) { + $prev = $this->inputZipper->front[$b]; + if ($prev instanceof HTMLPurifier_Token_Text && $prev->is_whitespace) { + continue; + } + break; + } + // This is safe because we removed the token that triggered this. + $this->rewindOffset($b+$deleted); + return; + } + } +} + +// vim: et sw=4 sts=4 diff --git a/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/Injector/RemoveSpansWithoutAttributes.php b/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/Injector/RemoveSpansWithoutAttributes.php similarity index 96% rename from plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/Injector/RemoveSpansWithoutAttributes.php rename to plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/Injector/RemoveSpansWithoutAttributes.php index 270b7f8..9ee7aa8 100755 --- a/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/Injector/RemoveSpansWithoutAttributes.php +++ b/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/Injector/RemoveSpansWithoutAttributes.php @@ -1,84 +1,84 @@ -attrValidator = new HTMLPurifier_AttrValidator(); - $this->config = $config; - $this->context = $context; - return parent::prepare($config, $context); - } - - /** - * @param HTMLPurifier_Token $token - */ - public function handleElement(&$token) - { - if ($token->name !== 'span' || !$token instanceof HTMLPurifier_Token_Start) { - return; - } - - // We need to validate the attributes now since this doesn't normally - // happen until after MakeWellFormed. If all the attributes are removed - // the span needs to be removed too. - $this->attrValidator->validateToken($token, $this->config, $this->context); - $token->armor['ValidateAttributes'] = true; - - if (!empty($token->attr)) { - return; - } - - $nesting = 0; - while ($this->forwardUntilEndToken($i, $current, $nesting)) { - } - - if ($current instanceof HTMLPurifier_Token_End && $current->name === 'span') { - // Mark closing span tag for deletion - $current->markForDeletion = true; - // Delete open span tag - $token = false; - } - } - - /** - * @param HTMLPurifier_Token $token - */ - public function handleEnd(&$token) - { - if ($token->markForDeletion) { - $token = false; - } - } -} - -// vim: et sw=4 sts=4 +attrValidator = new HTMLPurifier_AttrValidator(); + $this->config = $config; + $this->context = $context; + return parent::prepare($config, $context); + } + + /** + * @param HTMLPurifier_Token $token + */ + public function handleElement(&$token) + { + if ($token->name !== 'span' || !$token instanceof HTMLPurifier_Token_Start) { + return; + } + + // We need to validate the attributes now since this doesn't normally + // happen until after MakeWellFormed. If all the attributes are removed + // the span needs to be removed too. + $this->attrValidator->validateToken($token, $this->config, $this->context); + $token->armor['ValidateAttributes'] = true; + + if (!empty($token->attr)) { + return; + } + + $nesting = 0; + while ($this->forwardUntilEndToken($i, $current, $nesting)) { + } + + if ($current instanceof HTMLPurifier_Token_End && $current->name === 'span') { + // Mark closing span tag for deletion + $current->markForDeletion = true; + // Delete open span tag + $token = false; + } + } + + /** + * @param HTMLPurifier_Token $token + */ + public function handleEnd(&$token) + { + if ($token->markForDeletion) { + $token = false; + } + } +} + +// vim: et sw=4 sts=4 diff --git a/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/Injector/SafeObject.php b/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/Injector/SafeObject.php similarity index 91% rename from plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/Injector/SafeObject.php rename to plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/Injector/SafeObject.php index 8450948..317f786 100755 --- a/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/Injector/SafeObject.php +++ b/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/Injector/SafeObject.php @@ -1,121 +1,124 @@ - 'never', - 'allowNetworking' => 'internal', - ); - - /** - * @type array - */ - protected $allowedParam = array( - 'wmode' => true, - 'movie' => true, - 'flashvars' => true, - 'src' => true, - 'allowFullScreen' => true, // if omitted, assume to be 'false' - ); - - /** - * @param HTMLPurifier_Config $config - * @param HTMLPurifier_Context $context - * @return void - */ - public function prepare($config, $context) - { - parent::prepare($config, $context); - } - - /** - * @param HTMLPurifier_Token $token - */ - public function handleElement(&$token) - { - if ($token->name == 'object') { - $this->objectStack[] = $token; - $this->paramStack[] = array(); - $new = array($token); - foreach ($this->addParam as $name => $value) { - $new[] = new HTMLPurifier_Token_Empty('param', array('name' => $name, 'value' => $value)); - } - $token = $new; - } elseif ($token->name == 'param') { - $nest = count($this->currentNesting) - 1; - if ($nest >= 0 && $this->currentNesting[$nest]->name === 'object') { - $i = count($this->objectStack) - 1; - if (!isset($token->attr['name'])) { - $token = false; - return; - } - $n = $token->attr['name']; - // We need this fix because YouTube doesn't supply a data - // attribute, which we need if a type is specified. This is - // *very* Flash specific. - if (!isset($this->objectStack[$i]->attr['data']) && - ($token->attr['name'] == 'movie' || $token->attr['name'] == 'src') - ) { - $this->objectStack[$i]->attr['data'] = $token->attr['value']; - } - // Check if the parameter is the correct value but has not - // already been added - if (!isset($this->paramStack[$i][$n]) && - isset($this->addParam[$n]) && - $token->attr['name'] === $this->addParam[$n]) { - // keep token, and add to param stack - $this->paramStack[$i][$n] = true; - } elseif (isset($this->allowedParam[$n])) { - // keep token, don't do anything to it - // (could possibly check for duplicates here) - } else { - $token = false; - } - } else { - // not directly inside an object, DENY! - $token = false; - } - } - } - - public function handleEnd(&$token) - { - // This is the WRONG way of handling the object and param stacks; - // we should be inserting them directly on the relevant object tokens - // so that the global stack handling handles it. - if ($token->name == 'object') { - array_pop($this->objectStack); - array_pop($this->paramStack); - } - } -} - -// vim: et sw=4 sts=4 + 'never', + 'allowNetworking' => 'internal', + ); + + /** + * These are all lower-case keys. + * @type array + */ + protected $allowedParam = array( + 'wmode' => true, + 'movie' => true, + 'flashvars' => true, + 'src' => true, + 'allowfullscreen' => true, // if omitted, assume to be 'false' + ); + + /** + * @param HTMLPurifier_Config $config + * @param HTMLPurifier_Context $context + * @return void + */ + public function prepare($config, $context) + { + parent::prepare($config, $context); + } + + /** + * @param HTMLPurifier_Token $token + */ + public function handleElement(&$token) + { + if ($token->name == 'object') { + $this->objectStack[] = $token; + $this->paramStack[] = array(); + $new = array($token); + foreach ($this->addParam as $name => $value) { + $new[] = new HTMLPurifier_Token_Empty('param', array('name' => $name, 'value' => $value)); + } + $token = $new; + } elseif ($token->name == 'param') { + $nest = count($this->currentNesting) - 1; + if ($nest >= 0 && $this->currentNesting[$nest]->name === 'object') { + $i = count($this->objectStack) - 1; + if (!isset($token->attr['name'])) { + $token = false; + return; + } + $n = $token->attr['name']; + // We need this fix because YouTube doesn't supply a data + // attribute, which we need if a type is specified. This is + // *very* Flash specific. + if (!isset($this->objectStack[$i]->attr['data']) && + ($token->attr['name'] == 'movie' || $token->attr['name'] == 'src') + ) { + $this->objectStack[$i]->attr['data'] = $token->attr['value']; + } + // Check if the parameter is the correct value but has not + // already been added + if (!isset($this->paramStack[$i][$n]) && + isset($this->addParam[$n]) && + $token->attr['name'] === $this->addParam[$n]) { + // keep token, and add to param stack + $this->paramStack[$i][$n] = true; + } elseif (isset($this->allowedParam[strtolower($n)])) { + // keep token, don't do anything to it + // (could possibly check for duplicates here) + // Note: In principle, parameters should be case sensitive. + // But it seems they are not really; so accept any case. + } else { + $token = false; + } + } else { + // not directly inside an object, DENY! + $token = false; + } + } + } + + public function handleEnd(&$token) + { + // This is the WRONG way of handling the object and param stacks; + // we should be inserting them directly on the relevant object tokens + // so that the global stack handling handles it. + if ($token->name == 'object') { + array_pop($this->objectStack); + array_pop($this->paramStack); + } + } +} + +// vim: et sw=4 sts=4 diff --git a/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/Language.php b/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/Language.php similarity index 96% rename from plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/Language.php rename to plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/Language.php index 35a13f7..65277dd 100755 --- a/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/Language.php +++ b/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/Language.php @@ -1,204 +1,204 @@ -config = $config; - $this->context = $context; - } - - /** - * Loads language object with necessary info from factory cache - * @note This is a lazy loader - */ - public function load() - { - if ($this->_loaded) { - return; - } - $factory = HTMLPurifier_LanguageFactory::instance(); - $factory->loadLanguage($this->code); - foreach ($factory->keys as $key) { - $this->$key = $factory->cache[$this->code][$key]; - } - $this->_loaded = true; - } - - /** - * Retrieves a localised message. - * @param string $key string identifier of message - * @return string localised message - */ - public function getMessage($key) - { - if (!$this->_loaded) { - $this->load(); - } - if (!isset($this->messages[$key])) { - return "[$key]"; - } - return $this->messages[$key]; - } - - /** - * Retrieves a localised error name. - * @param int $int error number, corresponding to PHP's error reporting - * @return string localised message - */ - public function getErrorName($int) - { - if (!$this->_loaded) { - $this->load(); - } - if (!isset($this->errorNames[$int])) { - return "[Error: $int]"; - } - return $this->errorNames[$int]; - } - - /** - * Converts an array list into a string readable representation - * @param array $array - * @return string - */ - public function listify($array) - { - $sep = $this->getMessage('Item separator'); - $sep_last = $this->getMessage('Item separator last'); - $ret = ''; - for ($i = 0, $c = count($array); $i < $c; $i++) { - if ($i == 0) { - } elseif ($i + 1 < $c) { - $ret .= $sep; - } else { - $ret .= $sep_last; - } - $ret .= $array[$i]; - } - return $ret; - } - - /** - * Formats a localised message with passed parameters - * @param string $key string identifier of message - * @param array $args Parameters to substitute in - * @return string localised message - * @todo Implement conditionals? Right now, some messages make - * reference to line numbers, but those aren't always available - */ - public function formatMessage($key, $args = array()) - { - if (!$this->_loaded) { - $this->load(); - } - if (!isset($this->messages[$key])) { - return "[$key]"; - } - $raw = $this->messages[$key]; - $subst = array(); - $generator = false; - foreach ($args as $i => $value) { - if (is_object($value)) { - if ($value instanceof HTMLPurifier_Token) { - // factor this out some time - if (!$generator) { - $generator = $this->context->get('Generator'); - } - if (isset($value->name)) { - $subst['$'.$i.'.Name'] = $value->name; - } - if (isset($value->data)) { - $subst['$'.$i.'.Data'] = $value->data; - } - $subst['$'.$i.'.Compact'] = - $subst['$'.$i.'.Serialized'] = $generator->generateFromToken($value); - // a more complex algorithm for compact representation - // could be introduced for all types of tokens. This - // may need to be factored out into a dedicated class - if (!empty($value->attr)) { - $stripped_token = clone $value; - $stripped_token->attr = array(); - $subst['$'.$i.'.Compact'] = $generator->generateFromToken($stripped_token); - } - $subst['$'.$i.'.Line'] = $value->line ? $value->line : 'unknown'; - } - continue; - } elseif (is_array($value)) { - $keys = array_keys($value); - if (array_keys($keys) === $keys) { - // list - $subst['$'.$i] = $this->listify($value); - } else { - // associative array - // no $i implementation yet, sorry - $subst['$'.$i.'.Keys'] = $this->listify($keys); - $subst['$'.$i.'.Values'] = $this->listify(array_values($value)); - } - continue; - } - $subst['$' . $i] = $value; - } - return strtr($raw, $subst); - } -} - -// vim: et sw=4 sts=4 +config = $config; + $this->context = $context; + } + + /** + * Loads language object with necessary info from factory cache + * @note This is a lazy loader + */ + public function load() + { + if ($this->_loaded) { + return; + } + $factory = HTMLPurifier_LanguageFactory::instance(); + $factory->loadLanguage($this->code); + foreach ($factory->keys as $key) { + $this->$key = $factory->cache[$this->code][$key]; + } + $this->_loaded = true; + } + + /** + * Retrieves a localised message. + * @param string $key string identifier of message + * @return string localised message + */ + public function getMessage($key) + { + if (!$this->_loaded) { + $this->load(); + } + if (!isset($this->messages[$key])) { + return "[$key]"; + } + return $this->messages[$key]; + } + + /** + * Retrieves a localised error name. + * @param int $int error number, corresponding to PHP's error reporting + * @return string localised message + */ + public function getErrorName($int) + { + if (!$this->_loaded) { + $this->load(); + } + if (!isset($this->errorNames[$int])) { + return "[Error: $int]"; + } + return $this->errorNames[$int]; + } + + /** + * Converts an array list into a string readable representation + * @param array $array + * @return string + */ + public function listify($array) + { + $sep = $this->getMessage('Item separator'); + $sep_last = $this->getMessage('Item separator last'); + $ret = ''; + for ($i = 0, $c = count($array); $i < $c; $i++) { + if ($i == 0) { + } elseif ($i + 1 < $c) { + $ret .= $sep; + } else { + $ret .= $sep_last; + } + $ret .= $array[$i]; + } + return $ret; + } + + /** + * Formats a localised message with passed parameters + * @param string $key string identifier of message + * @param array $args Parameters to substitute in + * @return string localised message + * @todo Implement conditionals? Right now, some messages make + * reference to line numbers, but those aren't always available + */ + public function formatMessage($key, $args = array()) + { + if (!$this->_loaded) { + $this->load(); + } + if (!isset($this->messages[$key])) { + return "[$key]"; + } + $raw = $this->messages[$key]; + $subst = array(); + $generator = false; + foreach ($args as $i => $value) { + if (is_object($value)) { + if ($value instanceof HTMLPurifier_Token) { + // factor this out some time + if (!$generator) { + $generator = $this->context->get('Generator'); + } + if (isset($value->name)) { + $subst['$'.$i.'.Name'] = $value->name; + } + if (isset($value->data)) { + $subst['$'.$i.'.Data'] = $value->data; + } + $subst['$'.$i.'.Compact'] = + $subst['$'.$i.'.Serialized'] = $generator->generateFromToken($value); + // a more complex algorithm for compact representation + // could be introduced for all types of tokens. This + // may need to be factored out into a dedicated class + if (!empty($value->attr)) { + $stripped_token = clone $value; + $stripped_token->attr = array(); + $subst['$'.$i.'.Compact'] = $generator->generateFromToken($stripped_token); + } + $subst['$'.$i.'.Line'] = $value->line ? $value->line : 'unknown'; + } + continue; + } elseif (is_array($value)) { + $keys = array_keys($value); + if (array_keys($keys) === $keys) { + // list + $subst['$'.$i] = $this->listify($value); + } else { + // associative array + // no $i implementation yet, sorry + $subst['$'.$i.'.Keys'] = $this->listify($keys); + $subst['$'.$i.'.Values'] = $this->listify(array_values($value)); + } + continue; + } + $subst['$' . $i] = $value; + } + return strtr($raw, $subst); + } +} + +// vim: et sw=4 sts=4 diff --git a/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/Language/classes/en-x-test.php b/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/Language/classes/en-x-test.php similarity index 93% rename from plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/Language/classes/en-x-test.php rename to plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/Language/classes/en-x-test.php index a6f8d16..8828f5c 100755 --- a/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/Language/classes/en-x-test.php +++ b/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/Language/classes/en-x-test.php @@ -1,9 +1,9 @@ - 'HTML Purifier X' -); - -// vim: et sw=4 sts=4 + 'HTML Purifier X' +); + +// vim: et sw=4 sts=4 diff --git a/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/Language/messages/en-x-testmini.php b/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/Language/messages/en-x-testmini.php similarity index 95% rename from plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/Language/messages/en-x-testmini.php rename to plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/Language/messages/en-x-testmini.php index ed8560f..806c83f 100755 --- a/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/Language/messages/en-x-testmini.php +++ b/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/Language/messages/en-x-testmini.php @@ -1,12 +1,12 @@ - 'HTML Purifier XNone' -); - -// vim: et sw=4 sts=4 + 'HTML Purifier XNone' +); + +// vim: et sw=4 sts=4 diff --git a/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/Language/messages/en.php b/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/Language/messages/en.php similarity index 98% rename from plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/Language/messages/en.php rename to plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/Language/messages/en.php index 1fa30bd..c7f197e 100755 --- a/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/Language/messages/en.php +++ b/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/Language/messages/en.php @@ -1,55 +1,55 @@ - 'HTML Purifier', -// for unit testing purposes - 'LanguageFactoryTest: Pizza' => 'Pizza', - 'LanguageTest: List' => '$1', - 'LanguageTest: Hash' => '$1.Keys; $1.Values', - 'Item separator' => ', ', - 'Item separator last' => ' and ', // non-Harvard style - - 'ErrorCollector: No errors' => 'No errors detected. However, because error reporting is still incomplete, there may have been errors that the error collector was not notified of; please inspect the output HTML carefully.', - 'ErrorCollector: At line' => ' at line $line', - 'ErrorCollector: Incidental errors' => 'Incidental errors', - 'Lexer: Unclosed comment' => 'Unclosed comment', - 'Lexer: Unescaped lt' => 'Unescaped less-than sign (<) should be <', - 'Lexer: Missing gt' => 'Missing greater-than sign (>), previous less-than sign (<) should be escaped', - 'Lexer: Missing attribute key' => 'Attribute declaration has no key', - 'Lexer: Missing end quote' => 'Attribute declaration has no end quote', - 'Lexer: Extracted body' => 'Removed document metadata tags', - 'Strategy_RemoveForeignElements: Tag transform' => '<$1> element transformed into $CurrentToken.Serialized', - 'Strategy_RemoveForeignElements: Missing required attribute' => '$CurrentToken.Compact element missing required attribute $1', - 'Strategy_RemoveForeignElements: Foreign element to text' => 'Unrecognized $CurrentToken.Serialized tag converted to text', - 'Strategy_RemoveForeignElements: Foreign element removed' => 'Unrecognized $CurrentToken.Serialized tag removed', - 'Strategy_RemoveForeignElements: Comment removed' => 'Comment containing "$CurrentToken.Data" removed', - 'Strategy_RemoveForeignElements: Foreign meta element removed' => 'Unrecognized $CurrentToken.Serialized meta tag and all descendants removed', - 'Strategy_RemoveForeignElements: Token removed to end' => 'Tags and text starting from $1 element where removed to end', - 'Strategy_RemoveForeignElements: Trailing hyphen in comment removed' => 'Trailing hyphen(s) in comment removed', - 'Strategy_RemoveForeignElements: Hyphens in comment collapsed' => 'Double hyphens in comments are not allowed, and were collapsed into single hyphens', - 'Strategy_MakeWellFormed: Unnecessary end tag removed' => 'Unnecessary $CurrentToken.Serialized tag removed', - 'Strategy_MakeWellFormed: Unnecessary end tag to text' => 'Unnecessary $CurrentToken.Serialized tag converted to text', - 'Strategy_MakeWellFormed: Tag auto closed' => '$1.Compact started on line $1.Line auto-closed by $CurrentToken.Compact', - 'Strategy_MakeWellFormed: Tag carryover' => '$1.Compact started on line $1.Line auto-continued into $CurrentToken.Compact', - 'Strategy_MakeWellFormed: Stray end tag removed' => 'Stray $CurrentToken.Serialized tag removed', - 'Strategy_MakeWellFormed: Stray end tag to text' => 'Stray $CurrentToken.Serialized tag converted to text', - 'Strategy_MakeWellFormed: Tag closed by element end' => '$1.Compact tag started on line $1.Line closed by end of $CurrentToken.Serialized', - 'Strategy_MakeWellFormed: Tag closed by document end' => '$1.Compact tag started on line $1.Line closed by end of document', - 'Strategy_FixNesting: Node removed' => '$CurrentToken.Compact node removed', - 'Strategy_FixNesting: Node excluded' => '$CurrentToken.Compact node removed due to descendant exclusion by ancestor element', - 'Strategy_FixNesting: Node reorganized' => 'Contents of $CurrentToken.Compact node reorganized to enforce its content model', - 'Strategy_FixNesting: Node contents removed' => 'Contents of $CurrentToken.Compact node removed', - 'AttrValidator: Attributes transformed' => 'Attributes on $CurrentToken.Compact transformed from $1.Keys to $2.Keys', - 'AttrValidator: Attribute removed' => '$CurrentAttr.Name attribute on $CurrentToken.Compact removed', -); - -$errorNames = array( - E_ERROR => 'Error', - E_WARNING => 'Warning', - E_NOTICE => 'Notice' -); - -// vim: et sw=4 sts=4 + 'HTML Purifier', +// for unit testing purposes + 'LanguageFactoryTest: Pizza' => 'Pizza', + 'LanguageTest: List' => '$1', + 'LanguageTest: Hash' => '$1.Keys; $1.Values', + 'Item separator' => ', ', + 'Item separator last' => ' and ', // non-Harvard style + + 'ErrorCollector: No errors' => 'No errors detected. However, because error reporting is still incomplete, there may have been errors that the error collector was not notified of; please inspect the output HTML carefully.', + 'ErrorCollector: At line' => ' at line $line', + 'ErrorCollector: Incidental errors' => 'Incidental errors', + 'Lexer: Unclosed comment' => 'Unclosed comment', + 'Lexer: Unescaped lt' => 'Unescaped less-than sign (<) should be <', + 'Lexer: Missing gt' => 'Missing greater-than sign (>), previous less-than sign (<) should be escaped', + 'Lexer: Missing attribute key' => 'Attribute declaration has no key', + 'Lexer: Missing end quote' => 'Attribute declaration has no end quote', + 'Lexer: Extracted body' => 'Removed document metadata tags', + 'Strategy_RemoveForeignElements: Tag transform' => '<$1> element transformed into $CurrentToken.Serialized', + 'Strategy_RemoveForeignElements: Missing required attribute' => '$CurrentToken.Compact element missing required attribute $1', + 'Strategy_RemoveForeignElements: Foreign element to text' => 'Unrecognized $CurrentToken.Serialized tag converted to text', + 'Strategy_RemoveForeignElements: Foreign element removed' => 'Unrecognized $CurrentToken.Serialized tag removed', + 'Strategy_RemoveForeignElements: Comment removed' => 'Comment containing "$CurrentToken.Data" removed', + 'Strategy_RemoveForeignElements: Foreign meta element removed' => 'Unrecognized $CurrentToken.Serialized meta tag and all descendants removed', + 'Strategy_RemoveForeignElements: Token removed to end' => 'Tags and text starting from $1 element where removed to end', + 'Strategy_RemoveForeignElements: Trailing hyphen in comment removed' => 'Trailing hyphen(s) in comment removed', + 'Strategy_RemoveForeignElements: Hyphens in comment collapsed' => 'Double hyphens in comments are not allowed, and were collapsed into single hyphens', + 'Strategy_MakeWellFormed: Unnecessary end tag removed' => 'Unnecessary $CurrentToken.Serialized tag removed', + 'Strategy_MakeWellFormed: Unnecessary end tag to text' => 'Unnecessary $CurrentToken.Serialized tag converted to text', + 'Strategy_MakeWellFormed: Tag auto closed' => '$1.Compact started on line $1.Line auto-closed by $CurrentToken.Compact', + 'Strategy_MakeWellFormed: Tag carryover' => '$1.Compact started on line $1.Line auto-continued into $CurrentToken.Compact', + 'Strategy_MakeWellFormed: Stray end tag removed' => 'Stray $CurrentToken.Serialized tag removed', + 'Strategy_MakeWellFormed: Stray end tag to text' => 'Stray $CurrentToken.Serialized tag converted to text', + 'Strategy_MakeWellFormed: Tag closed by element end' => '$1.Compact tag started on line $1.Line closed by end of $CurrentToken.Serialized', + 'Strategy_MakeWellFormed: Tag closed by document end' => '$1.Compact tag started on line $1.Line closed by end of document', + 'Strategy_FixNesting: Node removed' => '$CurrentToken.Compact node removed', + 'Strategy_FixNesting: Node excluded' => '$CurrentToken.Compact node removed due to descendant exclusion by ancestor element', + 'Strategy_FixNesting: Node reorganized' => 'Contents of $CurrentToken.Compact node reorganized to enforce its content model', + 'Strategy_FixNesting: Node contents removed' => 'Contents of $CurrentToken.Compact node removed', + 'AttrValidator: Attributes transformed' => 'Attributes on $CurrentToken.Compact transformed from $1.Keys to $2.Keys', + 'AttrValidator: Attribute removed' => '$CurrentAttr.Name attribute on $CurrentToken.Compact removed', +); + +$errorNames = array( + E_ERROR => 'Error', + E_WARNING => 'Warning', + E_NOTICE => 'Notice' +); + +// vim: et sw=4 sts=4 diff --git a/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/LanguageFactory.php b/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/LanguageFactory.php similarity index 96% rename from plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/LanguageFactory.php rename to plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/LanguageFactory.php index e3e7a3b..4e35272 100755 --- a/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/LanguageFactory.php +++ b/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/LanguageFactory.php @@ -1,209 +1,209 @@ -cache[$language_code][$key] = $value - * @type array - */ - public $cache; - - /** - * Valid keys in the HTMLPurifier_Language object. Designates which - * variables to slurp out of a message file. - * @type array - */ - public $keys = array('fallback', 'messages', 'errorNames'); - - /** - * Instance to validate language codes. - * @type HTMLPurifier_AttrDef_Lang - * - */ - protected $validator; - - /** - * Cached copy of dirname(__FILE__), directory of current file without - * trailing slash. - * @type string - */ - protected $dir; - - /** - * Keys whose contents are a hash map and can be merged. - * @type array - */ - protected $mergeable_keys_map = array('messages' => true, 'errorNames' => true); - - /** - * Keys whose contents are a list and can be merged. - * @value array lookup - */ - protected $mergeable_keys_list = array(); - - /** - * Retrieve sole instance of the factory. - * @param HTMLPurifier_LanguageFactory $prototype Optional prototype to overload sole instance with, - * or bool true to reset to default factory. - * @return HTMLPurifier_LanguageFactory - */ - public static function instance($prototype = null) - { - static $instance = null; - if ($prototype !== null) { - $instance = $prototype; - } elseif ($instance === null || $prototype == true) { - $instance = new HTMLPurifier_LanguageFactory(); - $instance->setup(); - } - return $instance; - } - - /** - * Sets up the singleton, much like a constructor - * @note Prevents people from getting this outside of the singleton - */ - public function setup() - { - $this->validator = new HTMLPurifier_AttrDef_Lang(); - $this->dir = HTMLPURIFIER_PREFIX . '/HTMLPurifier'; - } - - /** - * Creates a language object, handles class fallbacks - * @param HTMLPurifier_Config $config - * @param HTMLPurifier_Context $context - * @param bool|string $code Code to override configuration with. Private parameter. - * @return HTMLPurifier_Language - */ - public function create($config, $context, $code = false) - { - // validate language code - if ($code === false) { - $code = $this->validator->validate( - $config->get('Core.Language'), - $config, - $context - ); - } else { - $code = $this->validator->validate($code, $config, $context); - } - if ($code === false) { - $code = 'en'; // malformed code becomes English - } - - $pcode = str_replace('-', '_', $code); // make valid PHP classname - static $depth = 0; // recursion protection - - if ($code == 'en') { - $lang = new HTMLPurifier_Language($config, $context); - } else { - $class = 'HTMLPurifier_Language_' . $pcode; - $file = $this->dir . '/Language/classes/' . $code . '.php'; - if (file_exists($file) || class_exists($class, false)) { - $lang = new $class($config, $context); - } else { - // Go fallback - $raw_fallback = $this->getFallbackFor($code); - $fallback = $raw_fallback ? $raw_fallback : 'en'; - $depth++; - $lang = $this->create($config, $context, $fallback); - if (!$raw_fallback) { - $lang->error = true; - } - $depth--; - } - } - $lang->code = $code; - return $lang; - } - - /** - * Returns the fallback language for language - * @note Loads the original language into cache - * @param string $code language code - * @return string|bool - */ - public function getFallbackFor($code) - { - $this->loadLanguage($code); - return $this->cache[$code]['fallback']; - } - - /** - * Loads language into the cache, handles message file and fallbacks - * @param string $code language code - */ - public function loadLanguage($code) - { - static $languages_seen = array(); // recursion guard - - // abort if we've already loaded it - if (isset($this->cache[$code])) { - return; - } - - // generate filename - $filename = $this->dir . '/Language/messages/' . $code . '.php'; - - // default fallback : may be overwritten by the ensuing include - $fallback = ($code != 'en') ? 'en' : false; - - // load primary localisation - if (!file_exists($filename)) { - // skip the include: will rely solely on fallback - $filename = $this->dir . '/Language/messages/en.php'; - $cache = array(); - } else { - include $filename; - $cache = compact($this->keys); - } - - // load fallback localisation - if (!empty($fallback)) { - - // infinite recursion guard - if (isset($languages_seen[$code])) { - trigger_error( - 'Circular fallback reference in language ' . - $code, - E_USER_ERROR - ); - $fallback = 'en'; - } - $language_seen[$code] = true; - - // load the fallback recursively - $this->loadLanguage($fallback); - $fallback_cache = $this->cache[$fallback]; - - // merge fallback with current language - foreach ($this->keys as $key) { - if (isset($cache[$key]) && isset($fallback_cache[$key])) { - if (isset($this->mergeable_keys_map[$key])) { - $cache[$key] = $cache[$key] + $fallback_cache[$key]; - } elseif (isset($this->mergeable_keys_list[$key])) { - $cache[$key] = array_merge($fallback_cache[$key], $cache[$key]); - } - } else { - $cache[$key] = $fallback_cache[$key]; - } - } - } - - // save to cache for later retrieval - $this->cache[$code] = $cache; - return; - } -} - -// vim: et sw=4 sts=4 +cache[$language_code][$key] = $value + * @type array + */ + public $cache; + + /** + * Valid keys in the HTMLPurifier_Language object. Designates which + * variables to slurp out of a message file. + * @type array + */ + public $keys = array('fallback', 'messages', 'errorNames'); + + /** + * Instance to validate language codes. + * @type HTMLPurifier_AttrDef_Lang + * + */ + protected $validator; + + /** + * Cached copy of dirname(__FILE__), directory of current file without + * trailing slash. + * @type string + */ + protected $dir; + + /** + * Keys whose contents are a hash map and can be merged. + * @type array + */ + protected $mergeable_keys_map = array('messages' => true, 'errorNames' => true); + + /** + * Keys whose contents are a list and can be merged. + * @value array lookup + */ + protected $mergeable_keys_list = array(); + + /** + * Retrieve sole instance of the factory. + * @param HTMLPurifier_LanguageFactory $prototype Optional prototype to overload sole instance with, + * or bool true to reset to default factory. + * @return HTMLPurifier_LanguageFactory + */ + public static function instance($prototype = null) + { + static $instance = null; + if ($prototype !== null) { + $instance = $prototype; + } elseif ($instance === null || $prototype == true) { + $instance = new HTMLPurifier_LanguageFactory(); + $instance->setup(); + } + return $instance; + } + + /** + * Sets up the singleton, much like a constructor + * @note Prevents people from getting this outside of the singleton + */ + public function setup() + { + $this->validator = new HTMLPurifier_AttrDef_Lang(); + $this->dir = HTMLPURIFIER_PREFIX . '/HTMLPurifier'; + } + + /** + * Creates a language object, handles class fallbacks + * @param HTMLPurifier_Config $config + * @param HTMLPurifier_Context $context + * @param bool|string $code Code to override configuration with. Private parameter. + * @return HTMLPurifier_Language + */ + public function create($config, $context, $code = false) + { + // validate language code + if ($code === false) { + $code = $this->validator->validate( + $config->get('Core.Language'), + $config, + $context + ); + } else { + $code = $this->validator->validate($code, $config, $context); + } + if ($code === false) { + $code = 'en'; // malformed code becomes English + } + + $pcode = str_replace('-', '_', $code); // make valid PHP classname + static $depth = 0; // recursion protection + + if ($code == 'en') { + $lang = new HTMLPurifier_Language($config, $context); + } else { + $class = 'HTMLPurifier_Language_' . $pcode; + $file = $this->dir . '/Language/classes/' . $code . '.php'; + if (file_exists($file) || class_exists($class, false)) { + $lang = new $class($config, $context); + } else { + // Go fallback + $raw_fallback = $this->getFallbackFor($code); + $fallback = $raw_fallback ? $raw_fallback : 'en'; + $depth++; + $lang = $this->create($config, $context, $fallback); + if (!$raw_fallback) { + $lang->error = true; + } + $depth--; + } + } + $lang->code = $code; + return $lang; + } + + /** + * Returns the fallback language for language + * @note Loads the original language into cache + * @param string $code language code + * @return string|bool + */ + public function getFallbackFor($code) + { + $this->loadLanguage($code); + return $this->cache[$code]['fallback']; + } + + /** + * Loads language into the cache, handles message file and fallbacks + * @param string $code language code + */ + public function loadLanguage($code) + { + static $languages_seen = array(); // recursion guard + + // abort if we've already loaded it + if (isset($this->cache[$code])) { + return; + } + + // generate filename + $filename = $this->dir . '/Language/messages/' . $code . '.php'; + + // default fallback : may be overwritten by the ensuing include + $fallback = ($code != 'en') ? 'en' : false; + + // load primary localisation + if (!file_exists($filename)) { + // skip the include: will rely solely on fallback + $filename = $this->dir . '/Language/messages/en.php'; + $cache = array(); + } else { + include $filename; + $cache = compact($this->keys); + } + + // load fallback localisation + if (!empty($fallback)) { + + // infinite recursion guard + if (isset($languages_seen[$code])) { + trigger_error( + 'Circular fallback reference in language ' . + $code, + E_USER_ERROR + ); + $fallback = 'en'; + } + $language_seen[$code] = true; + + // load the fallback recursively + $this->loadLanguage($fallback); + $fallback_cache = $this->cache[$fallback]; + + // merge fallback with current language + foreach ($this->keys as $key) { + if (isset($cache[$key]) && isset($fallback_cache[$key])) { + if (isset($this->mergeable_keys_map[$key])) { + $cache[$key] = $cache[$key] + $fallback_cache[$key]; + } elseif (isset($this->mergeable_keys_list[$key])) { + $cache[$key] = array_merge($fallback_cache[$key], $cache[$key]); + } + } else { + $cache[$key] = $fallback_cache[$key]; + } + } + } + + // save to cache for later retrieval + $this->cache[$code] = $cache; + return; + } +} + +// vim: et sw=4 sts=4 diff --git a/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/Length.php b/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/Length.php similarity index 95% rename from plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/Length.php rename to plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/Length.php index 149fcf4..bbfbe66 100755 --- a/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/Length.php +++ b/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/Length.php @@ -1,160 +1,160 @@ - true, 'ex' => true, 'px' => true, 'in' => true, - 'cm' => true, 'mm' => true, 'pt' => true, 'pc' => true - ); - - /** - * @param string $n Magnitude - * @param bool|string $u Unit - */ - public function __construct($n = '0', $u = false) - { - $this->n = (string) $n; - $this->unit = $u !== false ? (string) $u : false; - } - - /** - * @param string $s Unit string, like '2em' or '3.4in' - * @return HTMLPurifier_Length - * @warning Does not perform validation. - */ - public static function make($s) - { - if ($s instanceof HTMLPurifier_Length) { - return $s; - } - $n_length = strspn($s, '1234567890.+-'); - $n = substr($s, 0, $n_length); - $unit = substr($s, $n_length); - if ($unit === '') { - $unit = false; - } - return new HTMLPurifier_Length($n, $unit); - } - - /** - * Validates the number and unit. - * @return bool - */ - protected function validate() - { - // Special case: - if ($this->n === '+0' || $this->n === '-0') { - $this->n = '0'; - } - if ($this->n === '0' && $this->unit === false) { - return true; - } - if (!ctype_lower($this->unit)) { - $this->unit = strtolower($this->unit); - } - if (!isset(HTMLPurifier_Length::$allowedUnits[$this->unit])) { - return false; - } - // Hack: - $def = new HTMLPurifier_AttrDef_CSS_Number(); - $result = $def->validate($this->n, false, false); - if ($result === false) { - return false; - } - $this->n = $result; - return true; - } - - /** - * Returns string representation of number. - * @return string - */ - public function toString() - { - if (!$this->isValid()) { - return false; - } - return $this->n . $this->unit; - } - - /** - * Retrieves string numeric magnitude. - * @return string - */ - public function getN() - { - return $this->n; - } - - /** - * Retrieves string unit. - * @return string - */ - public function getUnit() - { - return $this->unit; - } - - /** - * Returns true if this length unit is valid. - * @return bool - */ - public function isValid() - { - if ($this->isValid === null) { - $this->isValid = $this->validate(); - } - return $this->isValid; - } - - /** - * Compares two lengths, and returns 1 if greater, -1 if less and 0 if equal. - * @param HTMLPurifier_Length $l - * @return int - * @warning If both values are too large or small, this calculation will - * not work properly - */ - public function compareTo($l) - { - if ($l === false) { - return false; - } - if ($l->unit !== $this->unit) { - $converter = new HTMLPurifier_UnitConverter(); - $l = $converter->convert($l, $this->unit); - if ($l === false) { - return false; - } - } - return $this->n - $l->n; - } -} - -// vim: et sw=4 sts=4 + true, 'ex' => true, 'px' => true, 'in' => true, + 'cm' => true, 'mm' => true, 'pt' => true, 'pc' => true + ); + + /** + * @param string $n Magnitude + * @param bool|string $u Unit + */ + public function __construct($n = '0', $u = false) + { + $this->n = (string) $n; + $this->unit = $u !== false ? (string) $u : false; + } + + /** + * @param string $s Unit string, like '2em' or '3.4in' + * @return HTMLPurifier_Length + * @warning Does not perform validation. + */ + public static function make($s) + { + if ($s instanceof HTMLPurifier_Length) { + return $s; + } + $n_length = strspn($s, '1234567890.+-'); + $n = substr($s, 0, $n_length); + $unit = substr($s, $n_length); + if ($unit === '') { + $unit = false; + } + return new HTMLPurifier_Length($n, $unit); + } + + /** + * Validates the number and unit. + * @return bool + */ + protected function validate() + { + // Special case: + if ($this->n === '+0' || $this->n === '-0') { + $this->n = '0'; + } + if ($this->n === '0' && $this->unit === false) { + return true; + } + if (!ctype_lower($this->unit)) { + $this->unit = strtolower($this->unit); + } + if (!isset(HTMLPurifier_Length::$allowedUnits[$this->unit])) { + return false; + } + // Hack: + $def = new HTMLPurifier_AttrDef_CSS_Number(); + $result = $def->validate($this->n, false, false); + if ($result === false) { + return false; + } + $this->n = $result; + return true; + } + + /** + * Returns string representation of number. + * @return string + */ + public function toString() + { + if (!$this->isValid()) { + return false; + } + return $this->n . $this->unit; + } + + /** + * Retrieves string numeric magnitude. + * @return string + */ + public function getN() + { + return $this->n; + } + + /** + * Retrieves string unit. + * @return string + */ + public function getUnit() + { + return $this->unit; + } + + /** + * Returns true if this length unit is valid. + * @return bool + */ + public function isValid() + { + if ($this->isValid === null) { + $this->isValid = $this->validate(); + } + return $this->isValid; + } + + /** + * Compares two lengths, and returns 1 if greater, -1 if less and 0 if equal. + * @param HTMLPurifier_Length $l + * @return int + * @warning If both values are too large or small, this calculation will + * not work properly + */ + public function compareTo($l) + { + if ($l === false) { + return false; + } + if ($l->unit !== $this->unit) { + $converter = new HTMLPurifier_UnitConverter(); + $l = $converter->convert($l, $this->unit); + if ($l === false) { + return false; + } + } + return $this->n - $l->n; + } +} + +// vim: et sw=4 sts=4 diff --git a/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/Lexer.php b/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/Lexer.php similarity index 96% rename from plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/Lexer.php rename to plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/Lexer.php index 2a9a9d6..44c5c65 100755 --- a/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/Lexer.php +++ b/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/Lexer.php @@ -1,357 +1,362 @@ -get('Core.LexerImpl'); - } - - $needs_tracking = - $config->get('Core.MaintainLineNumbers') || - $config->get('Core.CollectErrors'); - - $inst = null; - if (is_object($lexer)) { - $inst = $lexer; - } else { - if (is_null($lexer)) { - do { - // auto-detection algorithm - if ($needs_tracking) { - $lexer = 'DirectLex'; - break; - } - - if (class_exists('DOMDocument') && - method_exists('DOMDocument', 'loadHTML') && - !extension_loaded('domxml') - ) { - // check for DOM support, because while it's part of the - // core, it can be disabled compile time. Also, the PECL - // domxml extension overrides the default DOM, and is evil - // and nasty and we shan't bother to support it - $lexer = 'DOMLex'; - } else { - $lexer = 'DirectLex'; - } - } while (0); - } // do..while so we can break - - // instantiate recognized string names - switch ($lexer) { - case 'DOMLex': - $inst = new HTMLPurifier_Lexer_DOMLex(); - break; - case 'DirectLex': - $inst = new HTMLPurifier_Lexer_DirectLex(); - break; - case 'PH5P': - $inst = new HTMLPurifier_Lexer_PH5P(); - break; - default: - throw new HTMLPurifier_Exception( - "Cannot instantiate unrecognized Lexer type " . - htmlspecialchars($lexer) - ); - } - } - - if (!$inst) { - throw new HTMLPurifier_Exception('No lexer was instantiated'); - } - - // once PHP DOM implements native line numbers, or we - // hack out something using XSLT, remove this stipulation - if ($needs_tracking && !$inst->tracksLineNumbers) { - throw new HTMLPurifier_Exception( - 'Cannot use lexer that does not support line numbers with ' . - 'Core.MaintainLineNumbers or Core.CollectErrors (use DirectLex instead)' - ); - } - - return $inst; - - } - - // -- CONVENIENCE MEMBERS --------------------------------------------- - - public function __construct() - { - $this->_entity_parser = new HTMLPurifier_EntityParser(); - } - - /** - * Most common entity to raw value conversion table for special entities. - * @type array - */ - protected $_special_entity2str = - array( - '"' => '"', - '&' => '&', - '<' => '<', - '>' => '>', - ''' => "'", - ''' => "'", - ''' => "'" - ); - - /** - * Parses special entities into the proper characters. - * - * This string will translate escaped versions of the special characters - * into the correct ones. - * - * @warning - * You should be able to treat the output of this function as - * completely parsed, but that's only because all other entities should - * have been handled previously in substituteNonSpecialEntities() - * - * @param string $string String character data to be parsed. - * @return string Parsed character data. - */ - public function parseData($string) - { - // following functions require at least one character - if ($string === '') { - return ''; - } - - // subtracts amps that cannot possibly be escaped - $num_amp = substr_count($string, '&') - substr_count($string, '& ') - - ($string[strlen($string) - 1] === '&' ? 1 : 0); - - if (!$num_amp) { - return $string; - } // abort if no entities - $num_esc_amp = substr_count($string, '&'); - $string = strtr($string, $this->_special_entity2str); - - // code duplication for sake of optimization, see above - $num_amp_2 = substr_count($string, '&') - substr_count($string, '& ') - - ($string[strlen($string) - 1] === '&' ? 1 : 0); - - if ($num_amp_2 <= $num_esc_amp) { - return $string; - } - - // hmm... now we have some uncommon entities. Use the callback. - $string = $this->_entity_parser->substituteSpecialEntities($string); - return $string; - } - - /** - * Lexes an HTML string into tokens. - * @param $string String HTML. - * @param HTMLPurifier_Config $config - * @param HTMLPurifier_Context $context - * @return HTMLPurifier_Token[] array representation of HTML. - */ - public function tokenizeHTML($string, $config, $context) - { - trigger_error('Call to abstract class', E_USER_ERROR); - } - - /** - * Translates CDATA sections into regular sections (through escaping). - * @param string $string HTML string to process. - * @return string HTML with CDATA sections escaped. - */ - protected static function escapeCDATA($string) - { - return preg_replace_callback( - '//s', - array('HTMLPurifier_Lexer', 'CDATACallback'), - $string - ); - } - - /** - * Special CDATA case that is especially convoluted for )#si', - array($this, 'scriptCallback'), - $html - ); - } - - $html = $this->normalize($html, $config, $context); - - $cursor = 0; // our location in the text - $inside_tag = false; // whether or not we're parsing the inside of a tag - $array = array(); // result array - - // This is also treated to mean maintain *column* numbers too - $maintain_line_numbers = $config->get('Core.MaintainLineNumbers'); - - if ($maintain_line_numbers === null) { - // automatically determine line numbering by checking - // if error collection is on - $maintain_line_numbers = $config->get('Core.CollectErrors'); - } - - if ($maintain_line_numbers) { - $current_line = 1; - $current_col = 0; - $length = strlen($html); - } else { - $current_line = false; - $current_col = false; - $length = false; - } - $context->register('CurrentLine', $current_line); - $context->register('CurrentCol', $current_col); - $nl = "\n"; - // how often to manually recalculate. This will ALWAYS be right, - // but it's pretty wasteful. Set to 0 to turn off - $synchronize_interval = $config->get('Core.DirectLexLineNumberSyncInterval'); - - $e = false; - if ($config->get('Core.CollectErrors')) { - $e =& $context->get('ErrorCollector'); - } - - // for testing synchronization - $loops = 0; - - while (++$loops) { - // $cursor is either at the start of a token, or inside of - // a tag (i.e. there was a < immediately before it), as indicated - // by $inside_tag - - if ($maintain_line_numbers) { - // $rcursor, however, is always at the start of a token. - $rcursor = $cursor - (int)$inside_tag; - - // Column number is cheap, so we calculate it every round. - // We're interested at the *end* of the newline string, so - // we need to add strlen($nl) == 1 to $nl_pos before subtracting it - // from our "rcursor" position. - $nl_pos = strrpos($html, $nl, $rcursor - $length); - $current_col = $rcursor - (is_bool($nl_pos) ? 0 : $nl_pos + 1); - - // recalculate lines - if ($synchronize_interval && // synchronization is on - $cursor > 0 && // cursor is further than zero - $loops % $synchronize_interval === 0) { // time to synchronize! - $current_line = 1 + $this->substrCount($html, $nl, 0, $cursor); - } - } - - $position_next_lt = strpos($html, '<', $cursor); - $position_next_gt = strpos($html, '>', $cursor); - - // triggers on "asdf" but not "asdf " - // special case to set up context - if ($position_next_lt === $cursor) { - $inside_tag = true; - $cursor++; - } - - if (!$inside_tag && $position_next_lt !== false) { - // We are not inside tag and there still is another tag to parse - $token = new - HTMLPurifier_Token_Text( - $this->parseData( - substr( - $html, - $cursor, - $position_next_lt - $cursor - ) - ) - ); - if ($maintain_line_numbers) { - $token->rawPosition($current_line, $current_col); - $current_line += $this->substrCount($html, $nl, $cursor, $position_next_lt - $cursor); - } - $array[] = $token; - $cursor = $position_next_lt + 1; - $inside_tag = true; - continue; - } elseif (!$inside_tag) { - // We are not inside tag but there are no more tags - // If we're already at the end, break - if ($cursor === strlen($html)) { - break; - } - // Create Text of rest of string - $token = new - HTMLPurifier_Token_Text( - $this->parseData( - substr( - $html, - $cursor - ) - ) - ); - if ($maintain_line_numbers) { - $token->rawPosition($current_line, $current_col); - } - $array[] = $token; - break; - } elseif ($inside_tag && $position_next_gt !== false) { - // We are in tag and it is well formed - // Grab the internals of the tag - $strlen_segment = $position_next_gt - $cursor; - - if ($strlen_segment < 1) { - // there's nothing to process! - $token = new HTMLPurifier_Token_Text('<'); - $cursor++; - continue; - } - - $segment = substr($html, $cursor, $strlen_segment); - - if ($segment === false) { - // somehow, we attempted to access beyond the end of - // the string, defense-in-depth, reported by Nate Abele - break; - } - - // Check if it's a comment - if (substr($segment, 0, 3) === '!--') { - // re-determine segment length, looking for --> - $position_comment_end = strpos($html, '-->', $cursor); - if ($position_comment_end === false) { - // uh oh, we have a comment that extends to - // infinity. Can't be helped: set comment - // end position to end of string - if ($e) { - $e->send(E_WARNING, 'Lexer: Unclosed comment'); - } - $position_comment_end = strlen($html); - $end = true; - } else { - $end = false; - } - $strlen_segment = $position_comment_end - $cursor; - $segment = substr($html, $cursor, $strlen_segment); - $token = new - HTMLPurifier_Token_Comment( - substr( - $segment, - 3, - $strlen_segment - 3 - ) - ); - if ($maintain_line_numbers) { - $token->rawPosition($current_line, $current_col); - $current_line += $this->substrCount($html, $nl, $cursor, $strlen_segment); - } - $array[] = $token; - $cursor = $end ? $position_comment_end : $position_comment_end + 3; - $inside_tag = false; - continue; - } - - // Check if it's an end tag - $is_end_tag = (strpos($segment, '/') === 0); - if ($is_end_tag) { - $type = substr($segment, 1); - $token = new HTMLPurifier_Token_End($type); - if ($maintain_line_numbers) { - $token->rawPosition($current_line, $current_col); - $current_line += $this->substrCount($html, $nl, $cursor, $position_next_gt - $cursor); - } - $array[] = $token; - $inside_tag = false; - $cursor = $position_next_gt + 1; - continue; - } - - // Check leading character is alnum, if not, we may - // have accidently grabbed an emoticon. Translate into - // text and go our merry way - if (!ctype_alpha($segment[0])) { - // XML: $segment[0] !== '_' && $segment[0] !== ':' - if ($e) { - $e->send(E_NOTICE, 'Lexer: Unescaped lt'); - } - $token = new HTMLPurifier_Token_Text('<'); - if ($maintain_line_numbers) { - $token->rawPosition($current_line, $current_col); - $current_line += $this->substrCount($html, $nl, $cursor, $position_next_gt - $cursor); - } - $array[] = $token; - $inside_tag = false; - continue; - } - - // Check if it is explicitly self closing, if so, remove - // trailing slash. Remember, we could have a tag like
      , so - // any later token processing scripts must convert improperly - // classified EmptyTags from StartTags. - $is_self_closing = (strrpos($segment, '/') === $strlen_segment - 1); - if ($is_self_closing) { - $strlen_segment--; - $segment = substr($segment, 0, $strlen_segment); - } - - // Check if there are any attributes - $position_first_space = strcspn($segment, $this->_whitespace); - - if ($position_first_space >= $strlen_segment) { - if ($is_self_closing) { - $token = new HTMLPurifier_Token_Empty($segment); - } else { - $token = new HTMLPurifier_Token_Start($segment); - } - if ($maintain_line_numbers) { - $token->rawPosition($current_line, $current_col); - $current_line += $this->substrCount($html, $nl, $cursor, $position_next_gt - $cursor); - } - $array[] = $token; - $inside_tag = false; - $cursor = $position_next_gt + 1; - continue; - } - - // Grab out all the data - $type = substr($segment, 0, $position_first_space); - $attribute_string = - trim( - substr( - $segment, - $position_first_space - ) - ); - if ($attribute_string) { - $attr = $this->parseAttributeString( - $attribute_string, - $config, - $context - ); - } else { - $attr = array(); - } - - if ($is_self_closing) { - $token = new HTMLPurifier_Token_Empty($type, $attr); - } else { - $token = new HTMLPurifier_Token_Start($type, $attr); - } - if ($maintain_line_numbers) { - $token->rawPosition($current_line, $current_col); - $current_line += $this->substrCount($html, $nl, $cursor, $position_next_gt - $cursor); - } - $array[] = $token; - $cursor = $position_next_gt + 1; - $inside_tag = false; - continue; - } else { - // inside tag, but there's no ending > sign - if ($e) { - $e->send(E_WARNING, 'Lexer: Missing gt'); - } - $token = new - HTMLPurifier_Token_Text( - '<' . - $this->parseData( - substr($html, $cursor) - ) - ); - if ($maintain_line_numbers) { - $token->rawPosition($current_line, $current_col); - } - // no cursor scroll? Hmm... - $array[] = $token; - break; - } - break; - } - - $context->destroy('CurrentLine'); - $context->destroy('CurrentCol'); - return $array; - } - - /** - * PHP 5.0.x compatible substr_count that implements offset and length - * @param string $haystack - * @param string $needle - * @param int $offset - * @param int $length - * @return int - */ - protected function substrCount($haystack, $needle, $offset, $length) - { - static $oldVersion; - if ($oldVersion === null) { - $oldVersion = version_compare(PHP_VERSION, '5.1', '<'); - } - if ($oldVersion) { - $haystack = substr($haystack, $offset, $length); - return substr_count($haystack, $needle); - } else { - return substr_count($haystack, $needle, $offset, $length); - } - } - - /** - * Takes the inside of an HTML tag and makes an assoc array of attributes. - * - * @param string $string Inside of tag excluding name. - * @param HTMLPurifier_Config $config - * @param HTMLPurifier_Context $context - * @return array Assoc array of attributes. - */ - public function parseAttributeString($string, $config, $context) - { - $string = (string)$string; // quick typecast - - if ($string == '') { - return array(); - } // no attributes - - $e = false; - if ($config->get('Core.CollectErrors')) { - $e =& $context->get('ErrorCollector'); - } - - // let's see if we can abort as quickly as possible - // one equal sign, no spaces => one attribute - $num_equal = substr_count($string, '='); - $has_space = strpos($string, ' '); - if ($num_equal === 0 && !$has_space) { - // bool attribute - return array($string => $string); - } elseif ($num_equal === 1 && !$has_space) { - // only one attribute - list($key, $quoted_value) = explode('=', $string); - $quoted_value = trim($quoted_value); - if (!$key) { - if ($e) { - $e->send(E_ERROR, 'Lexer: Missing attribute key'); - } - return array(); - } - if (!$quoted_value) { - return array($key => ''); - } - $first_char = @$quoted_value[0]; - $last_char = @$quoted_value[strlen($quoted_value) - 1]; - - $same_quote = ($first_char == $last_char); - $open_quote = ($first_char == '"' || $first_char == "'"); - - if ($same_quote && $open_quote) { - // well behaved - $value = substr($quoted_value, 1, strlen($quoted_value) - 2); - } else { - // not well behaved - if ($open_quote) { - if ($e) { - $e->send(E_ERROR, 'Lexer: Missing end quote'); - } - $value = substr($quoted_value, 1); - } else { - $value = $quoted_value; - } - } - if ($value === false) { - $value = ''; - } - return array($key => $this->parseData($value)); - } - - // setup loop environment - $array = array(); // return assoc array of attributes - $cursor = 0; // current position in string (moves forward) - $size = strlen($string); // size of the string (stays the same) - - // if we have unquoted attributes, the parser expects a terminating - // space, so let's guarantee that there's always a terminating space. - $string .= ' '; - - $old_cursor = -1; - while ($cursor < $size) { - if ($old_cursor >= $cursor) { - throw new Exception("Infinite loop detected"); - } - $old_cursor = $cursor; - - $cursor += ($value = strspn($string, $this->_whitespace, $cursor)); - // grab the key - - $key_begin = $cursor; //we're currently at the start of the key - - // scroll past all characters that are the key (not whitespace or =) - $cursor += strcspn($string, $this->_whitespace . '=', $cursor); - - $key_end = $cursor; // now at the end of the key - - $key = substr($string, $key_begin, $key_end - $key_begin); - - if (!$key) { - if ($e) { - $e->send(E_ERROR, 'Lexer: Missing attribute key'); - } - $cursor += 1 + strcspn($string, $this->_whitespace, $cursor + 1); // prevent infinite loop - continue; // empty key - } - - // scroll past all whitespace - $cursor += strspn($string, $this->_whitespace, $cursor); - - if ($cursor >= $size) { - $array[$key] = $key; - break; - } - - // if the next character is an equal sign, we've got a regular - // pair, otherwise, it's a bool attribute - $first_char = @$string[$cursor]; - - if ($first_char == '=') { - // key="value" - - $cursor++; - $cursor += strspn($string, $this->_whitespace, $cursor); - - if ($cursor === false) { - $array[$key] = ''; - break; - } - - // we might be in front of a quote right now - - $char = @$string[$cursor]; - - if ($char == '"' || $char == "'") { - // it's quoted, end bound is $char - $cursor++; - $value_begin = $cursor; - $cursor = strpos($string, $char, $cursor); - $value_end = $cursor; - } else { - // it's not quoted, end bound is whitespace - $value_begin = $cursor; - $cursor += strcspn($string, $this->_whitespace, $cursor); - $value_end = $cursor; - } - - // we reached a premature end - if ($cursor === false) { - $cursor = $size; - $value_end = $cursor; - } - - $value = substr($string, $value_begin, $value_end - $value_begin); - if ($value === false) { - $value = ''; - } - $array[$key] = $this->parseData($value); - $cursor++; - } else { - // boolattr - if ($key !== '') { - $array[$key] = $key; - } else { - // purely theoretical - if ($e) { - $e->send(E_ERROR, 'Lexer: Missing attribute key'); - } - } - } - } - return $array; - } -} - -// vim: et sw=4 sts=4 +get('HTML.Trusted')) { + $html = preg_replace_callback( + '#(]*>)(\s*[^<].+?)()#si', + array($this, 'scriptCallback'), + $html + ); + } + + $html = $this->normalize($html, $config, $context); + + $cursor = 0; // our location in the text + $inside_tag = false; // whether or not we're parsing the inside of a tag + $array = array(); // result array + + // This is also treated to mean maintain *column* numbers too + $maintain_line_numbers = $config->get('Core.MaintainLineNumbers'); + + if ($maintain_line_numbers === null) { + // automatically determine line numbering by checking + // if error collection is on + $maintain_line_numbers = $config->get('Core.CollectErrors'); + } + + if ($maintain_line_numbers) { + $current_line = 1; + $current_col = 0; + $length = strlen($html); + } else { + $current_line = false; + $current_col = false; + $length = false; + } + $context->register('CurrentLine', $current_line); + $context->register('CurrentCol', $current_col); + $nl = "\n"; + // how often to manually recalculate. This will ALWAYS be right, + // but it's pretty wasteful. Set to 0 to turn off + $synchronize_interval = $config->get('Core.DirectLexLineNumberSyncInterval'); + + $e = false; + if ($config->get('Core.CollectErrors')) { + $e =& $context->get('ErrorCollector'); + } + + // for testing synchronization + $loops = 0; + + while (++$loops) { + // $cursor is either at the start of a token, or inside of + // a tag (i.e. there was a < immediately before it), as indicated + // by $inside_tag + + if ($maintain_line_numbers) { + // $rcursor, however, is always at the start of a token. + $rcursor = $cursor - (int)$inside_tag; + + // Column number is cheap, so we calculate it every round. + // We're interested at the *end* of the newline string, so + // we need to add strlen($nl) == 1 to $nl_pos before subtracting it + // from our "rcursor" position. + $nl_pos = strrpos($html, $nl, $rcursor - $length); + $current_col = $rcursor - (is_bool($nl_pos) ? 0 : $nl_pos + 1); + + // recalculate lines + if ($synchronize_interval && // synchronization is on + $cursor > 0 && // cursor is further than zero + $loops % $synchronize_interval === 0) { // time to synchronize! + $current_line = 1 + $this->substrCount($html, $nl, 0, $cursor); + } + } + + $position_next_lt = strpos($html, '<', $cursor); + $position_next_gt = strpos($html, '>', $cursor); + + // triggers on "asdf" but not "asdf " + // special case to set up context + if ($position_next_lt === $cursor) { + $inside_tag = true; + $cursor++; + } + + if (!$inside_tag && $position_next_lt !== false) { + // We are not inside tag and there still is another tag to parse + $token = new + HTMLPurifier_Token_Text( + $this->parseData( + substr( + $html, + $cursor, + $position_next_lt - $cursor + ) + ) + ); + if ($maintain_line_numbers) { + $token->rawPosition($current_line, $current_col); + $current_line += $this->substrCount($html, $nl, $cursor, $position_next_lt - $cursor); + } + $array[] = $token; + $cursor = $position_next_lt + 1; + $inside_tag = true; + continue; + } elseif (!$inside_tag) { + // We are not inside tag but there are no more tags + // If we're already at the end, break + if ($cursor === strlen($html)) { + break; + } + // Create Text of rest of string + $token = new + HTMLPurifier_Token_Text( + $this->parseData( + substr( + $html, + $cursor + ) + ) + ); + if ($maintain_line_numbers) { + $token->rawPosition($current_line, $current_col); + } + $array[] = $token; + break; + } elseif ($inside_tag && $position_next_gt !== false) { + // We are in tag and it is well formed + // Grab the internals of the tag + $strlen_segment = $position_next_gt - $cursor; + + if ($strlen_segment < 1) { + // there's nothing to process! + $token = new HTMLPurifier_Token_Text('<'); + $cursor++; + continue; + } + + $segment = substr($html, $cursor, $strlen_segment); + + if ($segment === false) { + // somehow, we attempted to access beyond the end of + // the string, defense-in-depth, reported by Nate Abele + break; + } + + // Check if it's a comment + if (substr($segment, 0, 3) === '!--') { + // re-determine segment length, looking for --> + $position_comment_end = strpos($html, '-->', $cursor); + if ($position_comment_end === false) { + // uh oh, we have a comment that extends to + // infinity. Can't be helped: set comment + // end position to end of string + if ($e) { + $e->send(E_WARNING, 'Lexer: Unclosed comment'); + } + $position_comment_end = strlen($html); + $end = true; + } else { + $end = false; + } + $strlen_segment = $position_comment_end - $cursor; + $segment = substr($html, $cursor, $strlen_segment); + $token = new + HTMLPurifier_Token_Comment( + substr( + $segment, + 3, + $strlen_segment - 3 + ) + ); + if ($maintain_line_numbers) { + $token->rawPosition($current_line, $current_col); + $current_line += $this->substrCount($html, $nl, $cursor, $strlen_segment); + } + $array[] = $token; + $cursor = $end ? $position_comment_end : $position_comment_end + 3; + $inside_tag = false; + continue; + } + + // Check if it's an end tag + $is_end_tag = (strpos($segment, '/') === 0); + if ($is_end_tag) { + $type = substr($segment, 1); + $token = new HTMLPurifier_Token_End($type); + if ($maintain_line_numbers) { + $token->rawPosition($current_line, $current_col); + $current_line += $this->substrCount($html, $nl, $cursor, $position_next_gt - $cursor); + } + $array[] = $token; + $inside_tag = false; + $cursor = $position_next_gt + 1; + continue; + } + + // Check leading character is alnum, if not, we may + // have accidently grabbed an emoticon. Translate into + // text and go our merry way + if (!ctype_alpha($segment[0])) { + // XML: $segment[0] !== '_' && $segment[0] !== ':' + if ($e) { + $e->send(E_NOTICE, 'Lexer: Unescaped lt'); + } + $token = new HTMLPurifier_Token_Text('<'); + if ($maintain_line_numbers) { + $token->rawPosition($current_line, $current_col); + $current_line += $this->substrCount($html, $nl, $cursor, $position_next_gt - $cursor); + } + $array[] = $token; + $inside_tag = false; + continue; + } + + // Check if it is explicitly self closing, if so, remove + // trailing slash. Remember, we could have a tag like
      , so + // any later token processing scripts must convert improperly + // classified EmptyTags from StartTags. + $is_self_closing = (strrpos($segment, '/') === $strlen_segment - 1); + if ($is_self_closing) { + $strlen_segment--; + $segment = substr($segment, 0, $strlen_segment); + } + + // Check if there are any attributes + $position_first_space = strcspn($segment, $this->_whitespace); + + if ($position_first_space >= $strlen_segment) { + if ($is_self_closing) { + $token = new HTMLPurifier_Token_Empty($segment); + } else { + $token = new HTMLPurifier_Token_Start($segment); + } + if ($maintain_line_numbers) { + $token->rawPosition($current_line, $current_col); + $current_line += $this->substrCount($html, $nl, $cursor, $position_next_gt - $cursor); + } + $array[] = $token; + $inside_tag = false; + $cursor = $position_next_gt + 1; + continue; + } + + // Grab out all the data + $type = substr($segment, 0, $position_first_space); + $attribute_string = + trim( + substr( + $segment, + $position_first_space + ) + ); + if ($attribute_string) { + $attr = $this->parseAttributeString( + $attribute_string, + $config, + $context + ); + } else { + $attr = array(); + } + + if ($is_self_closing) { + $token = new HTMLPurifier_Token_Empty($type, $attr); + } else { + $token = new HTMLPurifier_Token_Start($type, $attr); + } + if ($maintain_line_numbers) { + $token->rawPosition($current_line, $current_col); + $current_line += $this->substrCount($html, $nl, $cursor, $position_next_gt - $cursor); + } + $array[] = $token; + $cursor = $position_next_gt + 1; + $inside_tag = false; + continue; + } else { + // inside tag, but there's no ending > sign + if ($e) { + $e->send(E_WARNING, 'Lexer: Missing gt'); + } + $token = new + HTMLPurifier_Token_Text( + '<' . + $this->parseData( + substr($html, $cursor) + ) + ); + if ($maintain_line_numbers) { + $token->rawPosition($current_line, $current_col); + } + // no cursor scroll? Hmm... + $array[] = $token; + break; + } + break; + } + + $context->destroy('CurrentLine'); + $context->destroy('CurrentCol'); + return $array; + } + + /** + * PHP 5.0.x compatible substr_count that implements offset and length + * @param string $haystack + * @param string $needle + * @param int $offset + * @param int $length + * @return int + */ + protected function substrCount($haystack, $needle, $offset, $length) + { + static $oldVersion; + if ($oldVersion === null) { + $oldVersion = version_compare(PHP_VERSION, '5.1', '<'); + } + if ($oldVersion) { + $haystack = substr($haystack, $offset, $length); + return substr_count($haystack, $needle); + } else { + return substr_count($haystack, $needle, $offset, $length); + } + } + + /** + * Takes the inside of an HTML tag and makes an assoc array of attributes. + * + * @param string $string Inside of tag excluding name. + * @param HTMLPurifier_Config $config + * @param HTMLPurifier_Context $context + * @return array Assoc array of attributes. + */ + public function parseAttributeString($string, $config, $context) + { + $string = (string)$string; // quick typecast + + if ($string == '') { + return array(); + } // no attributes + + $e = false; + if ($config->get('Core.CollectErrors')) { + $e =& $context->get('ErrorCollector'); + } + + // let's see if we can abort as quickly as possible + // one equal sign, no spaces => one attribute + $num_equal = substr_count($string, '='); + $has_space = strpos($string, ' '); + if ($num_equal === 0 && !$has_space) { + // bool attribute + return array($string => $string); + } elseif ($num_equal === 1 && !$has_space) { + // only one attribute + list($key, $quoted_value) = explode('=', $string); + $quoted_value = trim($quoted_value); + if (!$key) { + if ($e) { + $e->send(E_ERROR, 'Lexer: Missing attribute key'); + } + return array(); + } + if (!$quoted_value) { + return array($key => ''); + } + $first_char = @$quoted_value[0]; + $last_char = @$quoted_value[strlen($quoted_value) - 1]; + + $same_quote = ($first_char == $last_char); + $open_quote = ($first_char == '"' || $first_char == "'"); + + if ($same_quote && $open_quote) { + // well behaved + $value = substr($quoted_value, 1, strlen($quoted_value) - 2); + } else { + // not well behaved + if ($open_quote) { + if ($e) { + $e->send(E_ERROR, 'Lexer: Missing end quote'); + } + $value = substr($quoted_value, 1); + } else { + $value = $quoted_value; + } + } + if ($value === false) { + $value = ''; + } + return array($key => $this->parseData($value)); + } + + // setup loop environment + $array = array(); // return assoc array of attributes + $cursor = 0; // current position in string (moves forward) + $size = strlen($string); // size of the string (stays the same) + + // if we have unquoted attributes, the parser expects a terminating + // space, so let's guarantee that there's always a terminating space. + $string .= ' '; + + $old_cursor = -1; + while ($cursor < $size) { + if ($old_cursor >= $cursor) { + throw new Exception("Infinite loop detected"); + } + $old_cursor = $cursor; + + $cursor += ($value = strspn($string, $this->_whitespace, $cursor)); + // grab the key + + $key_begin = $cursor; //we're currently at the start of the key + + // scroll past all characters that are the key (not whitespace or =) + $cursor += strcspn($string, $this->_whitespace . '=', $cursor); + + $key_end = $cursor; // now at the end of the key + + $key = substr($string, $key_begin, $key_end - $key_begin); + + if (!$key) { + if ($e) { + $e->send(E_ERROR, 'Lexer: Missing attribute key'); + } + $cursor += 1 + strcspn($string, $this->_whitespace, $cursor + 1); // prevent infinite loop + continue; // empty key + } + + // scroll past all whitespace + $cursor += strspn($string, $this->_whitespace, $cursor); + + if ($cursor >= $size) { + $array[$key] = $key; + break; + } + + // if the next character is an equal sign, we've got a regular + // pair, otherwise, it's a bool attribute + $first_char = @$string[$cursor]; + + if ($first_char == '=') { + // key="value" + + $cursor++; + $cursor += strspn($string, $this->_whitespace, $cursor); + + if ($cursor === false) { + $array[$key] = ''; + break; + } + + // we might be in front of a quote right now + + $char = @$string[$cursor]; + + if ($char == '"' || $char == "'") { + // it's quoted, end bound is $char + $cursor++; + $value_begin = $cursor; + $cursor = strpos($string, $char, $cursor); + $value_end = $cursor; + } else { + // it's not quoted, end bound is whitespace + $value_begin = $cursor; + $cursor += strcspn($string, $this->_whitespace, $cursor); + $value_end = $cursor; + } + + // we reached a premature end + if ($cursor === false) { + $cursor = $size; + $value_end = $cursor; + } + + $value = substr($string, $value_begin, $value_end - $value_begin); + if ($value === false) { + $value = ''; + } + $array[$key] = $this->parseData($value); + $cursor++; + } else { + // boolattr + if ($key !== '') { + $array[$key] = $key; + } else { + // purely theoretical + if ($e) { + $e->send(E_ERROR, 'Lexer: Missing attribute key'); + } + } + } + } + return $array; + } +} + +// vim: et sw=4 sts=4 diff --git a/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/Lexer/PH5P.php b/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/Lexer/PH5P.php similarity index 97% rename from plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/Lexer/PH5P.php rename to plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/Lexer/PH5P.php index 48b5f9a..ff4fa21 100755 --- a/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/Lexer/PH5P.php +++ b/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/Lexer/PH5P.php @@ -1,4788 +1,4787 @@ -normalize($html, $config, $context); - $new_html = $this->wrapHTML($new_html, $config, $context); - try { - $parser = new HTML5($new_html); - $doc = $parser->save(); - } catch (DOMException $e) { - // Uh oh, it failed. Punt to DirectLex. - $lexer = new HTMLPurifier_Lexer_DirectLex(); - $context->register('PH5PError', $e); // save the error, so we can detect it - return $lexer->tokenizeHTML($html, $config, $context); // use original HTML - } - $tokens = array(); - $this->tokenizeDOM( - $doc->getElementsByTagName('html')->item(0)-> // - getElementsByTagName('body')->item(0)-> // - getElementsByTagName('div')->item(0) //
      - , - $tokens - ); - return $tokens; - } -} - -/* - -Copyright 2007 Jeroen van der Meer - -Permission is hereby granted, free of charge, to any person obtaining a -copy of this software and associated documentation files (the -"Software"), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be included -in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -*/ - -class HTML5 -{ - private $data; - private $char; - private $EOF; - private $state; - private $tree; - private $token; - private $content_model; - private $escape = false; - private $entities = array( - 'AElig;', - 'AElig', - 'AMP;', - 'AMP', - 'Aacute;', - 'Aacute', - 'Acirc;', - 'Acirc', - 'Agrave;', - 'Agrave', - 'Alpha;', - 'Aring;', - 'Aring', - 'Atilde;', - 'Atilde', - 'Auml;', - 'Auml', - 'Beta;', - 'COPY;', - 'COPY', - 'Ccedil;', - 'Ccedil', - 'Chi;', - 'Dagger;', - 'Delta;', - 'ETH;', - 'ETH', - 'Eacute;', - 'Eacute', - 'Ecirc;', - 'Ecirc', - 'Egrave;', - 'Egrave', - 'Epsilon;', - 'Eta;', - 'Euml;', - 'Euml', - 'GT;', - 'GT', - 'Gamma;', - 'Iacute;', - 'Iacute', - 'Icirc;', - 'Icirc', - 'Igrave;', - 'Igrave', - 'Iota;', - 'Iuml;', - 'Iuml', - 'Kappa;', - 'LT;', - 'LT', - 'Lambda;', - 'Mu;', - 'Ntilde;', - 'Ntilde', - 'Nu;', - 'OElig;', - 'Oacute;', - 'Oacute', - 'Ocirc;', - 'Ocirc', - 'Ograve;', - 'Ograve', - 'Omega;', - 'Omicron;', - 'Oslash;', - 'Oslash', - 'Otilde;', - 'Otilde', - 'Ouml;', - 'Ouml', - 'Phi;', - 'Pi;', - 'Prime;', - 'Psi;', - 'QUOT;', - 'QUOT', - 'REG;', - 'REG', - 'Rho;', - 'Scaron;', - 'Sigma;', - 'THORN;', - 'THORN', - 'TRADE;', - 'Tau;', - 'Theta;', - 'Uacute;', - 'Uacute', - 'Ucirc;', - 'Ucirc', - 'Ugrave;', - 'Ugrave', - 'Upsilon;', - 'Uuml;', - 'Uuml', - 'Xi;', - 'Yacute;', - 'Yacute', - 'Yuml;', - 'Zeta;', - 'aacute;', - 'aacute', - 'acirc;', - 'acirc', - 'acute;', - 'acute', - 'aelig;', - 'aelig', - 'agrave;', - 'agrave', - 'alefsym;', - 'alpha;', - 'amp;', - 'amp', - 'and;', - 'ang;', - 'apos;', - 'aring;', - 'aring', - 'asymp;', - 'atilde;', - 'atilde', - 'auml;', - 'auml', - 'bdquo;', - 'beta;', - 'brvbar;', - 'brvbar', - 'bull;', - 'cap;', - 'ccedil;', - 'ccedil', - 'cedil;', - 'cedil', - 'cent;', - 'cent', - 'chi;', - 'circ;', - 'clubs;', - 'cong;', - 'copy;', - 'copy', - 'crarr;', - 'cup;', - 'curren;', - 'curren', - 'dArr;', - 'dagger;', - 'darr;', - 'deg;', - 'deg', - 'delta;', - 'diams;', - 'divide;', - 'divide', - 'eacute;', - 'eacute', - 'ecirc;', - 'ecirc', - 'egrave;', - 'egrave', - 'empty;', - 'emsp;', - 'ensp;', - 'epsilon;', - 'equiv;', - 'eta;', - 'eth;', - 'eth', - 'euml;', - 'euml', - 'euro;', - 'exist;', - 'fnof;', - 'forall;', - 'frac12;', - 'frac12', - 'frac14;', - 'frac14', - 'frac34;', - 'frac34', - 'frasl;', - 'gamma;', - 'ge;', - 'gt;', - 'gt', - 'hArr;', - 'harr;', - 'hearts;', - 'hellip;', - 'iacute;', - 'iacute', - 'icirc;', - 'icirc', - 'iexcl;', - 'iexcl', - 'igrave;', - 'igrave', - 'image;', - 'infin;', - 'int;', - 'iota;', - 'iquest;', - 'iquest', - 'isin;', - 'iuml;', - 'iuml', - 'kappa;', - 'lArr;', - 'lambda;', - 'lang;', - 'laquo;', - 'laquo', - 'larr;', - 'lceil;', - 'ldquo;', - 'le;', - 'lfloor;', - 'lowast;', - 'loz;', - 'lrm;', - 'lsaquo;', - 'lsquo;', - 'lt;', - 'lt', - 'macr;', - 'macr', - 'mdash;', - 'micro;', - 'micro', - 'middot;', - 'middot', - 'minus;', - 'mu;', - 'nabla;', - 'nbsp;', - 'nbsp', - 'ndash;', - 'ne;', - 'ni;', - 'not;', - 'not', - 'notin;', - 'nsub;', - 'ntilde;', - 'ntilde', - 'nu;', - 'oacute;', - 'oacute', - 'ocirc;', - 'ocirc', - 'oelig;', - 'ograve;', - 'ograve', - 'oline;', - 'omega;', - 'omicron;', - 'oplus;', - 'or;', - 'ordf;', - 'ordf', - 'ordm;', - 'ordm', - 'oslash;', - 'oslash', - 'otilde;', - 'otilde', - 'otimes;', - 'ouml;', - 'ouml', - 'para;', - 'para', - 'part;', - 'permil;', - 'perp;', - 'phi;', - 'pi;', - 'piv;', - 'plusmn;', - 'plusmn', - 'pound;', - 'pound', - 'prime;', - 'prod;', - 'prop;', - 'psi;', - 'quot;', - 'quot', - 'rArr;', - 'radic;', - 'rang;', - 'raquo;', - 'raquo', - 'rarr;', - 'rceil;', - 'rdquo;', - 'real;', - 'reg;', - 'reg', - 'rfloor;', - 'rho;', - 'rlm;', - 'rsaquo;', - 'rsquo;', - 'sbquo;', - 'scaron;', - 'sdot;', - 'sect;', - 'sect', - 'shy;', - 'shy', - 'sigma;', - 'sigmaf;', - 'sim;', - 'spades;', - 'sub;', - 'sube;', - 'sum;', - 'sup1;', - 'sup1', - 'sup2;', - 'sup2', - 'sup3;', - 'sup3', - 'sup;', - 'supe;', - 'szlig;', - 'szlig', - 'tau;', - 'there4;', - 'theta;', - 'thetasym;', - 'thinsp;', - 'thorn;', - 'thorn', - 'tilde;', - 'times;', - 'times', - 'trade;', - 'uArr;', - 'uacute;', - 'uacute', - 'uarr;', - 'ucirc;', - 'ucirc', - 'ugrave;', - 'ugrave', - 'uml;', - 'uml', - 'upsih;', - 'upsilon;', - 'uuml;', - 'uuml', - 'weierp;', - 'xi;', - 'yacute;', - 'yacute', - 'yen;', - 'yen', - 'yuml;', - 'yuml', - 'zeta;', - 'zwj;', - 'zwnj;' - ); - - const PCDATA = 0; - const RCDATA = 1; - const CDATA = 2; - const PLAINTEXT = 3; - - const DOCTYPE = 0; - const STARTTAG = 1; - const ENDTAG = 2; - const COMMENT = 3; - const CHARACTR = 4; - const EOF = 5; - - public function __construct($data) - { - $this->data = $data; - $this->char = -1; - $this->EOF = strlen($data); - $this->tree = new HTML5TreeConstructer; - $this->content_model = self::PCDATA; - - $this->state = 'data'; - - while ($this->state !== null) { - $this->{$this->state . 'State'}(); - } - } - - public function save() - { - return $this->tree->save(); - } - - private function char() - { - return ($this->char < $this->EOF) - ? $this->data[$this->char] - : false; - } - - private function character($s, $l = 0) - { - if ($s + $l < $this->EOF) { - if ($l === 0) { - return $this->data[$s]; - } else { - return substr($this->data, $s, $l); - } - } - } - - private function characters($char_class, $start) - { - return preg_replace('#^([' . $char_class . ']+).*#s', '\\1', substr($this->data, $start)); - } - - private function dataState() - { - // Consume the next input character - $this->char++; - $char = $this->char(); - - if ($char === '&' && ($this->content_model === self::PCDATA || $this->content_model === self::RCDATA)) { - /* U+0026 AMPERSAND (&) - When the content model flag is set to one of the PCDATA or RCDATA - states: switch to the entity data state. Otherwise: treat it as per - the "anything else" entry below. */ - $this->state = 'entityData'; - - } elseif ($char === '-') { - /* If the content model flag is set to either the RCDATA state or - the CDATA state, and the escape flag is false, and there are at - least three characters before this one in the input stream, and the - last four characters in the input stream, including this one, are - U+003C LESS-THAN SIGN, U+0021 EXCLAMATION MARK, U+002D HYPHEN-MINUS, - and U+002D HYPHEN-MINUS (""), - set the escape flag to false. */ - if (($this->content_model === self::RCDATA || - $this->content_model === self::CDATA) && $this->escape === true && - $this->character($this->char, 3) === '-->' - ) { - $this->escape = false; - } - - /* In any case, emit the input character as a character token. - Stay in the data state. */ - $this->emitToken( - array( - 'type' => self::CHARACTR, - 'data' => $char - ) - ); - - } elseif ($this->char === $this->EOF) { - /* EOF - Emit an end-of-file token. */ - $this->EOF(); - - } elseif ($this->content_model === self::PLAINTEXT) { - /* When the content model flag is set to the PLAINTEXT state - THIS DIFFERS GREATLY FROM THE SPEC: Get the remaining characters of - the text and emit it as a character token. */ - $this->emitToken( - array( - 'type' => self::CHARACTR, - 'data' => substr($this->data, $this->char) - ) - ); - - $this->EOF(); - - } else { - /* Anything else - THIS DIFFERS GREATLY FROM THE SPEC: Get as many character that - otherwise would also be treated as a character token and emit it - as a single character token. Stay in the data state. */ - $len = strcspn($this->data, '<&', $this->char); - $char = substr($this->data, $this->char, $len); - $this->char += $len - 1; - - $this->emitToken( - array( - 'type' => self::CHARACTR, - 'data' => $char - ) - ); - - $this->state = 'data'; - } - } - - private function entityDataState() - { - // Attempt to consume an entity. - $entity = $this->entity(); - - // If nothing is returned, emit a U+0026 AMPERSAND character token. - // Otherwise, emit the character token that was returned. - $char = (!$entity) ? '&' : $entity; - $this->emitToken( - array( - 'type' => self::CHARACTR, - 'data' => $char - ) - ); - - // Finally, switch to the data state. - $this->state = 'data'; - } - - private function tagOpenState() - { - switch ($this->content_model) { - case self::RCDATA: - case self::CDATA: - /* If the next input character is a U+002F SOLIDUS (/) character, - consume it and switch to the close tag open state. If the next - input character is not a U+002F SOLIDUS (/) character, emit a - U+003C LESS-THAN SIGN character token and switch to the data - state to process the next input character. */ - if ($this->character($this->char + 1) === '/') { - $this->char++; - $this->state = 'closeTagOpen'; - - } else { - $this->emitToken( - array( - 'type' => self::CHARACTR, - 'data' => '<' - ) - ); - - $this->state = 'data'; - } - break; - - case self::PCDATA: - // If the content model flag is set to the PCDATA state - // Consume the next input character: - $this->char++; - $char = $this->char(); - - if ($char === '!') { - /* U+0021 EXCLAMATION MARK (!) - Switch to the markup declaration open state. */ - $this->state = 'markupDeclarationOpen'; - - } elseif ($char === '/') { - /* U+002F SOLIDUS (/) - Switch to the close tag open state. */ - $this->state = 'closeTagOpen'; - - } elseif (preg_match('/^[A-Za-z]$/', $char)) { - /* U+0041 LATIN LETTER A through to U+005A LATIN LETTER Z - Create a new start tag token, set its tag name to the lowercase - version of the input character (add 0x0020 to the character's code - point), then switch to the tag name state. (Don't emit the token - yet; further details will be filled in before it is emitted.) */ - $this->token = array( - 'name' => strtolower($char), - 'type' => self::STARTTAG, - 'attr' => array() - ); - - $this->state = 'tagName'; - - } elseif ($char === '>') { - /* U+003E GREATER-THAN SIGN (>) - Parse error. Emit a U+003C LESS-THAN SIGN character token and a - U+003E GREATER-THAN SIGN character token. Switch to the data state. */ - $this->emitToken( - array( - 'type' => self::CHARACTR, - 'data' => '<>' - ) - ); - - $this->state = 'data'; - - } elseif ($char === '?') { - /* U+003F QUESTION MARK (?) - Parse error. Switch to the bogus comment state. */ - $this->state = 'bogusComment'; - - } else { - /* Anything else - Parse error. Emit a U+003C LESS-THAN SIGN character token and - reconsume the current input character in the data state. */ - $this->emitToken( - array( - 'type' => self::CHARACTR, - 'data' => '<' - ) - ); - - $this->char--; - $this->state = 'data'; - } - break; - } - } - - private function closeTagOpenState() - { - $next_node = strtolower($this->characters('A-Za-z', $this->char + 1)); - $the_same = count($this->tree->stack) > 0 && $next_node === end($this->tree->stack)->nodeName; - - if (($this->content_model === self::RCDATA || $this->content_model === self::CDATA) && - (!$the_same || ($the_same && (!preg_match( - '/[\t\n\x0b\x0c >\/]/', - $this->character($this->char + 1 + strlen($next_node)) - ) || $this->EOF === $this->char))) - ) { - /* If the content model flag is set to the RCDATA or CDATA states then - examine the next few characters. If they do not match the tag name of - the last start tag token emitted (case insensitively), or if they do but - they are not immediately followed by one of the following characters: - * U+0009 CHARACTER TABULATION - * U+000A LINE FEED (LF) - * U+000B LINE TABULATION - * U+000C FORM FEED (FF) - * U+0020 SPACE - * U+003E GREATER-THAN SIGN (>) - * U+002F SOLIDUS (/) - * EOF - ...then there is a parse error. Emit a U+003C LESS-THAN SIGN character - token, a U+002F SOLIDUS character token, and switch to the data state - to process the next input character. */ - $this->emitToken( - array( - 'type' => self::CHARACTR, - 'data' => 'state = 'data'; - - } else { - /* Otherwise, if the content model flag is set to the PCDATA state, - or if the next few characters do match that tag name, consume the - next input character: */ - $this->char++; - $char = $this->char(); - - if (preg_match('/^[A-Za-z]$/', $char)) { - /* U+0041 LATIN LETTER A through to U+005A LATIN LETTER Z - Create a new end tag token, set its tag name to the lowercase version - of the input character (add 0x0020 to the character's code point), then - switch to the tag name state. (Don't emit the token yet; further details - will be filled in before it is emitted.) */ - $this->token = array( - 'name' => strtolower($char), - 'type' => self::ENDTAG - ); - - $this->state = 'tagName'; - - } elseif ($char === '>') { - /* U+003E GREATER-THAN SIGN (>) - Parse error. Switch to the data state. */ - $this->state = 'data'; - - } elseif ($this->char === $this->EOF) { - /* EOF - Parse error. Emit a U+003C LESS-THAN SIGN character token and a U+002F - SOLIDUS character token. Reconsume the EOF character in the data state. */ - $this->emitToken( - array( - 'type' => self::CHARACTR, - 'data' => 'char--; - $this->state = 'data'; - - } else { - /* Parse error. Switch to the bogus comment state. */ - $this->state = 'bogusComment'; - } - } - } - - private function tagNameState() - { - // Consume the next input character: - $this->char++; - $char = $this->character($this->char); - - if (preg_match('/^[\t\n\x0b\x0c ]$/', $char)) { - /* U+0009 CHARACTER TABULATION - U+000A LINE FEED (LF) - U+000B LINE TABULATION - U+000C FORM FEED (FF) - U+0020 SPACE - Switch to the before attribute name state. */ - $this->state = 'beforeAttributeName'; - - } elseif ($char === '>') { - /* U+003E GREATER-THAN SIGN (>) - Emit the current tag token. Switch to the data state. */ - $this->emitToken($this->token); - $this->state = 'data'; - - } elseif ($this->char === $this->EOF) { - /* EOF - Parse error. Emit the current tag token. Reconsume the EOF - character in the data state. */ - $this->emitToken($this->token); - - $this->char--; - $this->state = 'data'; - - } elseif ($char === '/') { - /* U+002F SOLIDUS (/) - Parse error unless this is a permitted slash. Switch to the before - attribute name state. */ - $this->state = 'beforeAttributeName'; - - } else { - /* Anything else - Append the current input character to the current tag token's tag name. - Stay in the tag name state. */ - $this->token['name'] .= strtolower($char); - $this->state = 'tagName'; - } - } - - private function beforeAttributeNameState() - { - // Consume the next input character: - $this->char++; - $char = $this->character($this->char); - - if (preg_match('/^[\t\n\x0b\x0c ]$/', $char)) { - /* U+0009 CHARACTER TABULATION - U+000A LINE FEED (LF) - U+000B LINE TABULATION - U+000C FORM FEED (FF) - U+0020 SPACE - Stay in the before attribute name state. */ - $this->state = 'beforeAttributeName'; - - } elseif ($char === '>') { - /* U+003E GREATER-THAN SIGN (>) - Emit the current tag token. Switch to the data state. */ - $this->emitToken($this->token); - $this->state = 'data'; - - } elseif ($char === '/') { - /* U+002F SOLIDUS (/) - Parse error unless this is a permitted slash. Stay in the before - attribute name state. */ - $this->state = 'beforeAttributeName'; - - } elseif ($this->char === $this->EOF) { - /* EOF - Parse error. Emit the current tag token. Reconsume the EOF - character in the data state. */ - $this->emitToken($this->token); - - $this->char--; - $this->state = 'data'; - - } else { - /* Anything else - Start a new attribute in the current tag token. Set that attribute's - name to the current input character, and its value to the empty string. - Switch to the attribute name state. */ - $this->token['attr'][] = array( - 'name' => strtolower($char), - 'value' => null - ); - - $this->state = 'attributeName'; - } - } - - private function attributeNameState() - { - // Consume the next input character: - $this->char++; - $char = $this->character($this->char); - - if (preg_match('/^[\t\n\x0b\x0c ]$/', $char)) { - /* U+0009 CHARACTER TABULATION - U+000A LINE FEED (LF) - U+000B LINE TABULATION - U+000C FORM FEED (FF) - U+0020 SPACE - Stay in the before attribute name state. */ - $this->state = 'afterAttributeName'; - - } elseif ($char === '=') { - /* U+003D EQUALS SIGN (=) - Switch to the before attribute value state. */ - $this->state = 'beforeAttributeValue'; - - } elseif ($char === '>') { - /* U+003E GREATER-THAN SIGN (>) - Emit the current tag token. Switch to the data state. */ - $this->emitToken($this->token); - $this->state = 'data'; - - } elseif ($char === '/' && $this->character($this->char + 1) !== '>') { - /* U+002F SOLIDUS (/) - Parse error unless this is a permitted slash. Switch to the before - attribute name state. */ - $this->state = 'beforeAttributeName'; - - } elseif ($this->char === $this->EOF) { - /* EOF - Parse error. Emit the current tag token. Reconsume the EOF - character in the data state. */ - $this->emitToken($this->token); - - $this->char--; - $this->state = 'data'; - - } else { - /* Anything else - Append the current input character to the current attribute's name. - Stay in the attribute name state. */ - $last = count($this->token['attr']) - 1; - $this->token['attr'][$last]['name'] .= strtolower($char); - - $this->state = 'attributeName'; - } - } - - private function afterAttributeNameState() - { - // Consume the next input character: - $this->char++; - $char = $this->character($this->char); - - if (preg_match('/^[\t\n\x0b\x0c ]$/', $char)) { - /* U+0009 CHARACTER TABULATION - U+000A LINE FEED (LF) - U+000B LINE TABULATION - U+000C FORM FEED (FF) - U+0020 SPACE - Stay in the after attribute name state. */ - $this->state = 'afterAttributeName'; - - } elseif ($char === '=') { - /* U+003D EQUALS SIGN (=) - Switch to the before attribute value state. */ - $this->state = 'beforeAttributeValue'; - - } elseif ($char === '>') { - /* U+003E GREATER-THAN SIGN (>) - Emit the current tag token. Switch to the data state. */ - $this->emitToken($this->token); - $this->state = 'data'; - - } elseif ($char === '/' && $this->character($this->char + 1) !== '>') { - /* U+002F SOLIDUS (/) - Parse error unless this is a permitted slash. Switch to the - before attribute name state. */ - $this->state = 'beforeAttributeName'; - - } elseif ($this->char === $this->EOF) { - /* EOF - Parse error. Emit the current tag token. Reconsume the EOF - character in the data state. */ - $this->emitToken($this->token); - - $this->char--; - $this->state = 'data'; - - } else { - /* Anything else - Start a new attribute in the current tag token. Set that attribute's - name to the current input character, and its value to the empty string. - Switch to the attribute name state. */ - $this->token['attr'][] = array( - 'name' => strtolower($char), - 'value' => null - ); - - $this->state = 'attributeName'; - } - } - - private function beforeAttributeValueState() - { - // Consume the next input character: - $this->char++; - $char = $this->character($this->char); - - if (preg_match('/^[\t\n\x0b\x0c ]$/', $char)) { - /* U+0009 CHARACTER TABULATION - U+000A LINE FEED (LF) - U+000B LINE TABULATION - U+000C FORM FEED (FF) - U+0020 SPACE - Stay in the before attribute value state. */ - $this->state = 'beforeAttributeValue'; - - } elseif ($char === '"') { - /* U+0022 QUOTATION MARK (") - Switch to the attribute value (double-quoted) state. */ - $this->state = 'attributeValueDoubleQuoted'; - - } elseif ($char === '&') { - /* U+0026 AMPERSAND (&) - Switch to the attribute value (unquoted) state and reconsume - this input character. */ - $this->char--; - $this->state = 'attributeValueUnquoted'; - - } elseif ($char === '\'') { - /* U+0027 APOSTROPHE (') - Switch to the attribute value (single-quoted) state. */ - $this->state = 'attributeValueSingleQuoted'; - - } elseif ($char === '>') { - /* U+003E GREATER-THAN SIGN (>) - Emit the current tag token. Switch to the data state. */ - $this->emitToken($this->token); - $this->state = 'data'; - - } else { - /* Anything else - Append the current input character to the current attribute's value. - Switch to the attribute value (unquoted) state. */ - $last = count($this->token['attr']) - 1; - $this->token['attr'][$last]['value'] .= $char; - - $this->state = 'attributeValueUnquoted'; - } - } - - private function attributeValueDoubleQuotedState() - { - // Consume the next input character: - $this->char++; - $char = $this->character($this->char); - - if ($char === '"') { - /* U+0022 QUOTATION MARK (") - Switch to the before attribute name state. */ - $this->state = 'beforeAttributeName'; - - } elseif ($char === '&') { - /* U+0026 AMPERSAND (&) - Switch to the entity in attribute value state. */ - $this->entityInAttributeValueState('double'); - - } elseif ($this->char === $this->EOF) { - /* EOF - Parse error. Emit the current tag token. Reconsume the character - in the data state. */ - $this->emitToken($this->token); - - $this->char--; - $this->state = 'data'; - - } else { - /* Anything else - Append the current input character to the current attribute's value. - Stay in the attribute value (double-quoted) state. */ - $last = count($this->token['attr']) - 1; - $this->token['attr'][$last]['value'] .= $char; - - $this->state = 'attributeValueDoubleQuoted'; - } - } - - private function attributeValueSingleQuotedState() - { - // Consume the next input character: - $this->char++; - $char = $this->character($this->char); - - if ($char === '\'') { - /* U+0022 QUOTATION MARK (') - Switch to the before attribute name state. */ - $this->state = 'beforeAttributeName'; - - } elseif ($char === '&') { - /* U+0026 AMPERSAND (&) - Switch to the entity in attribute value state. */ - $this->entityInAttributeValueState('single'); - - } elseif ($this->char === $this->EOF) { - /* EOF - Parse error. Emit the current tag token. Reconsume the character - in the data state. */ - $this->emitToken($this->token); - - $this->char--; - $this->state = 'data'; - - } else { - /* Anything else - Append the current input character to the current attribute's value. - Stay in the attribute value (single-quoted) state. */ - $last = count($this->token['attr']) - 1; - $this->token['attr'][$last]['value'] .= $char; - - $this->state = 'attributeValueSingleQuoted'; - } - } - - private function attributeValueUnquotedState() - { - // Consume the next input character: - $this->char++; - $char = $this->character($this->char); - - if (preg_match('/^[\t\n\x0b\x0c ]$/', $char)) { - /* U+0009 CHARACTER TABULATION - U+000A LINE FEED (LF) - U+000B LINE TABULATION - U+000C FORM FEED (FF) - U+0020 SPACE - Switch to the before attribute name state. */ - $this->state = 'beforeAttributeName'; - - } elseif ($char === '&') { - /* U+0026 AMPERSAND (&) - Switch to the entity in attribute value state. */ - $this->entityInAttributeValueState(); - - } elseif ($char === '>') { - /* U+003E GREATER-THAN SIGN (>) - Emit the current tag token. Switch to the data state. */ - $this->emitToken($this->token); - $this->state = 'data'; - - } else { - /* Anything else - Append the current input character to the current attribute's value. - Stay in the attribute value (unquoted) state. */ - $last = count($this->token['attr']) - 1; - $this->token['attr'][$last]['value'] .= $char; - - $this->state = 'attributeValueUnquoted'; - } - } - - private function entityInAttributeValueState() - { - // Attempt to consume an entity. - $entity = $this->entity(); - - // If nothing is returned, append a U+0026 AMPERSAND character to the - // current attribute's value. Otherwise, emit the character token that - // was returned. - $char = (!$entity) - ? '&' - : $entity; - - $last = count($this->token['attr']) - 1; - $this->token['attr'][$last]['value'] .= $char; - } - - private function bogusCommentState() - { - /* Consume every character up to the first U+003E GREATER-THAN SIGN - character (>) or the end of the file (EOF), whichever comes first. Emit - a comment token whose data is the concatenation of all the characters - starting from and including the character that caused the state machine - to switch into the bogus comment state, up to and including the last - consumed character before the U+003E character, if any, or up to the - end of the file otherwise. (If the comment was started by the end of - the file (EOF), the token is empty.) */ - $data = $this->characters('^>', $this->char); - $this->emitToken( - array( - 'data' => $data, - 'type' => self::COMMENT - ) - ); - - $this->char += strlen($data); - - /* Switch to the data state. */ - $this->state = 'data'; - - /* If the end of the file was reached, reconsume the EOF character. */ - if ($this->char === $this->EOF) { - $this->char = $this->EOF - 1; - } - } - - private function markupDeclarationOpenState() - { - /* If the next two characters are both U+002D HYPHEN-MINUS (-) - characters, consume those two characters, create a comment token whose - data is the empty string, and switch to the comment state. */ - if ($this->character($this->char + 1, 2) === '--') { - $this->char += 2; - $this->state = 'comment'; - $this->token = array( - 'data' => null, - 'type' => self::COMMENT - ); - - /* Otherwise if the next seven chacacters are a case-insensitive match - for the word "DOCTYPE", then consume those characters and switch to the - DOCTYPE state. */ - } elseif (strtolower($this->character($this->char + 1, 7)) === 'doctype') { - $this->char += 7; - $this->state = 'doctype'; - - /* Otherwise, is is a parse error. Switch to the bogus comment state. - The next character that is consumed, if any, is the first character - that will be in the comment. */ - } else { - $this->char++; - $this->state = 'bogusComment'; - } - } - - private function commentState() - { - /* Consume the next input character: */ - $this->char++; - $char = $this->char(); - - /* U+002D HYPHEN-MINUS (-) */ - if ($char === '-') { - /* Switch to the comment dash state */ - $this->state = 'commentDash'; - - /* EOF */ - } elseif ($this->char === $this->EOF) { - /* Parse error. Emit the comment token. Reconsume the EOF character - in the data state. */ - $this->emitToken($this->token); - $this->char--; - $this->state = 'data'; - - /* Anything else */ - } else { - /* Append the input character to the comment token's data. Stay in - the comment state. */ - $this->token['data'] .= $char; - } - } - - private function commentDashState() - { - /* Consume the next input character: */ - $this->char++; - $char = $this->char(); - - /* U+002D HYPHEN-MINUS (-) */ - if ($char === '-') { - /* Switch to the comment end state */ - $this->state = 'commentEnd'; - - /* EOF */ - } elseif ($this->char === $this->EOF) { - /* Parse error. Emit the comment token. Reconsume the EOF character - in the data state. */ - $this->emitToken($this->token); - $this->char--; - $this->state = 'data'; - - /* Anything else */ - } else { - /* Append a U+002D HYPHEN-MINUS (-) character and the input - character to the comment token's data. Switch to the comment state. */ - $this->token['data'] .= '-' . $char; - $this->state = 'comment'; - } - } - - private function commentEndState() - { - /* Consume the next input character: */ - $this->char++; - $char = $this->char(); - - if ($char === '>') { - $this->emitToken($this->token); - $this->state = 'data'; - - } elseif ($char === '-') { - $this->token['data'] .= '-'; - - } elseif ($this->char === $this->EOF) { - $this->emitToken($this->token); - $this->char--; - $this->state = 'data'; - - } else { - $this->token['data'] .= '--' . $char; - $this->state = 'comment'; - } - } - - private function doctypeState() - { - /* Consume the next input character: */ - $this->char++; - $char = $this->char(); - - if (preg_match('/^[\t\n\x0b\x0c ]$/', $char)) { - $this->state = 'beforeDoctypeName'; - - } else { - $this->char--; - $this->state = 'beforeDoctypeName'; - } - } - - private function beforeDoctypeNameState() - { - /* Consume the next input character: */ - $this->char++; - $char = $this->char(); - - if (preg_match('/^[\t\n\x0b\x0c ]$/', $char)) { - // Stay in the before DOCTYPE name state. - - } elseif (preg_match('/^[a-z]$/', $char)) { - $this->token = array( - 'name' => strtoupper($char), - 'type' => self::DOCTYPE, - 'error' => true - ); - - $this->state = 'doctypeName'; - - } elseif ($char === '>') { - $this->emitToken( - array( - 'name' => null, - 'type' => self::DOCTYPE, - 'error' => true - ) - ); - - $this->state = 'data'; - - } elseif ($this->char === $this->EOF) { - $this->emitToken( - array( - 'name' => null, - 'type' => self::DOCTYPE, - 'error' => true - ) - ); - - $this->char--; - $this->state = 'data'; - - } else { - $this->token = array( - 'name' => $char, - 'type' => self::DOCTYPE, - 'error' => true - ); - - $this->state = 'doctypeName'; - } - } - - private function doctypeNameState() - { - /* Consume the next input character: */ - $this->char++; - $char = $this->char(); - - if (preg_match('/^[\t\n\x0b\x0c ]$/', $char)) { - $this->state = 'AfterDoctypeName'; - - } elseif ($char === '>') { - $this->emitToken($this->token); - $this->state = 'data'; - - } elseif (preg_match('/^[a-z]$/', $char)) { - $this->token['name'] .= strtoupper($char); - - } elseif ($this->char === $this->EOF) { - $this->emitToken($this->token); - $this->char--; - $this->state = 'data'; - - } else { - $this->token['name'] .= $char; - } - - $this->token['error'] = ($this->token['name'] === 'HTML') - ? false - : true; - } - - private function afterDoctypeNameState() - { - /* Consume the next input character: */ - $this->char++; - $char = $this->char(); - - if (preg_match('/^[\t\n\x0b\x0c ]$/', $char)) { - // Stay in the DOCTYPE name state. - - } elseif ($char === '>') { - $this->emitToken($this->token); - $this->state = 'data'; - - } elseif ($this->char === $this->EOF) { - $this->emitToken($this->token); - $this->char--; - $this->state = 'data'; - - } else { - $this->token['error'] = true; - $this->state = 'bogusDoctype'; - } - } - - private function bogusDoctypeState() - { - /* Consume the next input character: */ - $this->char++; - $char = $this->char(); - - if ($char === '>') { - $this->emitToken($this->token); - $this->state = 'data'; - - } elseif ($this->char === $this->EOF) { - $this->emitToken($this->token); - $this->char--; - $this->state = 'data'; - - } else { - // Stay in the bogus DOCTYPE state. - } - } - - private function entity() - { - $start = $this->char; - - // This section defines how to consume an entity. This definition is - // used when parsing entities in text and in attributes. - - // The behaviour depends on the identity of the next character (the - // one immediately after the U+0026 AMPERSAND character): - - switch ($this->character($this->char + 1)) { - // U+0023 NUMBER SIGN (#) - case '#': - - // The behaviour further depends on the character after the - // U+0023 NUMBER SIGN: - switch ($this->character($this->char + 1)) { - // U+0078 LATIN SMALL LETTER X - // U+0058 LATIN CAPITAL LETTER X - case 'x': - case 'X': - // Follow the steps below, but using the range of - // characters U+0030 DIGIT ZERO through to U+0039 DIGIT - // NINE, U+0061 LATIN SMALL LETTER A through to U+0066 - // LATIN SMALL LETTER F, and U+0041 LATIN CAPITAL LETTER - // A, through to U+0046 LATIN CAPITAL LETTER F (in other - // words, 0-9, A-F, a-f). - $char = 1; - $char_class = '0-9A-Fa-f'; - break; - - // Anything else - default: - // Follow the steps below, but using the range of - // characters U+0030 DIGIT ZERO through to U+0039 DIGIT - // NINE (i.e. just 0-9). - $char = 0; - $char_class = '0-9'; - break; - } - - // Consume as many characters as match the range of characters - // given above. - $this->char++; - $e_name = $this->characters($char_class, $this->char + $char + 1); - $entity = $this->character($start, $this->char); - $cond = strlen($e_name) > 0; - - // The rest of the parsing happens bellow. - break; - - // Anything else - default: - // Consume the maximum number of characters possible, with the - // consumed characters case-sensitively matching one of the - // identifiers in the first column of the entities table. - $e_name = $this->characters('0-9A-Za-z;', $this->char + 1); - $len = strlen($e_name); - - for ($c = 1; $c <= $len; $c++) { - $id = substr($e_name, 0, $c); - $this->char++; - - if (in_array($id, $this->entities)) { - if ($e_name[$c - 1] !== ';') { - if ($c < $len && $e_name[$c] == ';') { - $this->char++; // consume extra semicolon - } - } - $entity = $id; - break; - } - } - - $cond = isset($entity); - // The rest of the parsing happens bellow. - break; - } - - if (!$cond) { - // If no match can be made, then this is a parse error. No - // characters are consumed, and nothing is returned. - $this->char = $start; - return false; - } - - // Return a character token for the character corresponding to the - // entity name (as given by the second column of the entities table). - return html_entity_decode('&' . $entity . ';', ENT_QUOTES, 'UTF-8'); - } - - private function emitToken($token) - { - $emit = $this->tree->emitToken($token); - - if (is_int($emit)) { - $this->content_model = $emit; - - } elseif ($token['type'] === self::ENDTAG) { - $this->content_model = self::PCDATA; - } - } - - private function EOF() - { - $this->state = null; - $this->tree->emitToken( - array( - 'type' => self::EOF - ) - ); - } -} - -class HTML5TreeConstructer -{ - public $stack = array(); - - private $phase; - private $mode; - private $dom; - private $foster_parent = null; - private $a_formatting = array(); - - private $head_pointer = null; - private $form_pointer = null; - - private $scoping = array('button', 'caption', 'html', 'marquee', 'object', 'table', 'td', 'th'); - private $formatting = array( - 'a', - 'b', - 'big', - 'em', - 'font', - 'i', - 'nobr', - 's', - 'small', - 'strike', - 'strong', - 'tt', - 'u' - ); - private $special = array( - 'address', - 'area', - 'base', - 'basefont', - 'bgsound', - 'blockquote', - 'body', - 'br', - 'center', - 'col', - 'colgroup', - 'dd', - 'dir', - 'div', - 'dl', - 'dt', - 'embed', - 'fieldset', - 'form', - 'frame', - 'frameset', - 'h1', - 'h2', - 'h3', - 'h4', - 'h5', - 'h6', - 'head', - 'hr', - 'iframe', - 'image', - 'img', - 'input', - 'isindex', - 'li', - 'link', - 'listing', - 'menu', - 'meta', - 'noembed', - 'noframes', - 'noscript', - 'ol', - 'optgroup', - 'option', - 'p', - 'param', - 'plaintext', - 'pre', - 'script', - 'select', - 'spacer', - 'style', - 'tbody', - 'textarea', - 'tfoot', - 'thead', - 'title', - 'tr', - 'ul', - 'wbr' - ); - - // The different phases. - const INIT_PHASE = 0; - const ROOT_PHASE = 1; - const MAIN_PHASE = 2; - const END_PHASE = 3; - - // The different insertion modes for the main phase. - const BEFOR_HEAD = 0; - const IN_HEAD = 1; - const AFTER_HEAD = 2; - const IN_BODY = 3; - const IN_TABLE = 4; - const IN_CAPTION = 5; - const IN_CGROUP = 6; - const IN_TBODY = 7; - const IN_ROW = 8; - const IN_CELL = 9; - const IN_SELECT = 10; - const AFTER_BODY = 11; - const IN_FRAME = 12; - const AFTR_FRAME = 13; - - // The different types of elements. - const SPECIAL = 0; - const SCOPING = 1; - const FORMATTING = 2; - const PHRASING = 3; - - const MARKER = 0; - - public function __construct() - { - $this->phase = self::INIT_PHASE; - $this->mode = self::BEFOR_HEAD; - $this->dom = new DOMDocument; - - $this->dom->encoding = 'UTF-8'; - $this->dom->preserveWhiteSpace = true; - $this->dom->substituteEntities = true; - $this->dom->strictErrorChecking = false; - } - - // Process tag tokens - public function emitToken($token) - { - switch ($this->phase) { - case self::INIT_PHASE: - return $this->initPhase($token); - break; - case self::ROOT_PHASE: - return $this->rootElementPhase($token); - break; - case self::MAIN_PHASE: - return $this->mainPhase($token); - break; - case self::END_PHASE : - return $this->trailingEndPhase($token); - break; - } - } - - private function initPhase($token) - { - /* Initially, the tree construction stage must handle each token - emitted from the tokenisation stage as follows: */ - - /* A DOCTYPE token that is marked as being in error - A comment token - A start tag token - An end tag token - A character token that is not one of one of U+0009 CHARACTER TABULATION, - U+000A LINE FEED (LF), U+000B LINE TABULATION, U+000C FORM FEED (FF), - or U+0020 SPACE - An end-of-file token */ - if ((isset($token['error']) && $token['error']) || - $token['type'] === HTML5::COMMENT || - $token['type'] === HTML5::STARTTAG || - $token['type'] === HTML5::ENDTAG || - $token['type'] === HTML5::EOF || - ($token['type'] === HTML5::CHARACTR && isset($token['data']) && - !preg_match('/^[\t\n\x0b\x0c ]+$/', $token['data'])) - ) { - /* This specification does not define how to handle this case. In - particular, user agents may ignore the entirety of this specification - altogether for such documents, and instead invoke special parse modes - with a greater emphasis on backwards compatibility. */ - - $this->phase = self::ROOT_PHASE; - return $this->rootElementPhase($token); - - /* A DOCTYPE token marked as being correct */ - } elseif (isset($token['error']) && !$token['error']) { - /* Append a DocumentType node to the Document node, with the name - attribute set to the name given in the DOCTYPE token (which will be - "HTML"), and the other attributes specific to DocumentType objects - set to null, empty lists, or the empty string as appropriate. */ - $doctype = new DOMDocumentType(null, null, 'HTML'); - - /* Then, switch to the root element phase of the tree construction - stage. */ - $this->phase = self::ROOT_PHASE; - - /* A character token that is one of one of U+0009 CHARACTER TABULATION, - U+000A LINE FEED (LF), U+000B LINE TABULATION, U+000C FORM FEED (FF), - or U+0020 SPACE */ - } elseif (isset($token['data']) && preg_match( - '/^[\t\n\x0b\x0c ]+$/', - $token['data'] - ) - ) { - /* Append that character to the Document node. */ - $text = $this->dom->createTextNode($token['data']); - $this->dom->appendChild($text); - } - } - - private function rootElementPhase($token) - { - /* After the initial phase, as each token is emitted from the tokenisation - stage, it must be processed as described in this section. */ - - /* A DOCTYPE token */ - if ($token['type'] === HTML5::DOCTYPE) { - // Parse error. Ignore the token. - - /* A comment token */ - } elseif ($token['type'] === HTML5::COMMENT) { - /* Append a Comment node to the Document object with the data - attribute set to the data given in the comment token. */ - $comment = $this->dom->createComment($token['data']); - $this->dom->appendChild($comment); - - /* A character token that is one of one of U+0009 CHARACTER TABULATION, - U+000A LINE FEED (LF), U+000B LINE TABULATION, U+000C FORM FEED (FF), - or U+0020 SPACE */ - } elseif ($token['type'] === HTML5::CHARACTR && - preg_match('/^[\t\n\x0b\x0c ]+$/', $token['data']) - ) { - /* Append that character to the Document node. */ - $text = $this->dom->createTextNode($token['data']); - $this->dom->appendChild($text); - - /* A character token that is not one of U+0009 CHARACTER TABULATION, - U+000A LINE FEED (LF), U+000B LINE TABULATION, U+000C FORM FEED - (FF), or U+0020 SPACE - A start tag token - An end tag token - An end-of-file token */ - } elseif (($token['type'] === HTML5::CHARACTR && - !preg_match('/^[\t\n\x0b\x0c ]+$/', $token['data'])) || - $token['type'] === HTML5::STARTTAG || - $token['type'] === HTML5::ENDTAG || - $token['type'] === HTML5::EOF - ) { - /* Create an HTMLElement node with the tag name html, in the HTML - namespace. Append it to the Document object. Switch to the main - phase and reprocess the current token. */ - $html = $this->dom->createElement('html'); - $this->dom->appendChild($html); - $this->stack[] = $html; - - $this->phase = self::MAIN_PHASE; - return $this->mainPhase($token); - } - } - - private function mainPhase($token) - { - /* Tokens in the main phase must be handled as follows: */ - - /* A DOCTYPE token */ - if ($token['type'] === HTML5::DOCTYPE) { - // Parse error. Ignore the token. - - /* A start tag token with the tag name "html" */ - } elseif ($token['type'] === HTML5::STARTTAG && $token['name'] === 'html') { - /* If this start tag token was not the first start tag token, then - it is a parse error. */ - - /* For each attribute on the token, check to see if the attribute - is already present on the top element of the stack of open elements. - If it is not, add the attribute and its corresponding value to that - element. */ - foreach ($token['attr'] as $attr) { - if (!$this->stack[0]->hasAttribute($attr['name'])) { - $this->stack[0]->setAttribute($attr['name'], $attr['value']); - } - } - - /* An end-of-file token */ - } elseif ($token['type'] === HTML5::EOF) { - /* Generate implied end tags. */ - $this->generateImpliedEndTags(); - - /* Anything else. */ - } else { - /* Depends on the insertion mode: */ - switch ($this->mode) { - case self::BEFOR_HEAD: - return $this->beforeHead($token); - break; - case self::IN_HEAD: - return $this->inHead($token); - break; - case self::AFTER_HEAD: - return $this->afterHead($token); - break; - case self::IN_BODY: - return $this->inBody($token); - break; - case self::IN_TABLE: - return $this->inTable($token); - break; - case self::IN_CAPTION: - return $this->inCaption($token); - break; - case self::IN_CGROUP: - return $this->inColumnGroup($token); - break; - case self::IN_TBODY: - return $this->inTableBody($token); - break; - case self::IN_ROW: - return $this->inRow($token); - break; - case self::IN_CELL: - return $this->inCell($token); - break; - case self::IN_SELECT: - return $this->inSelect($token); - break; - case self::AFTER_BODY: - return $this->afterBody($token); - break; - case self::IN_FRAME: - return $this->inFrameset($token); - break; - case self::AFTR_FRAME: - return $this->afterFrameset($token); - break; - case self::END_PHASE: - return $this->trailingEndPhase($token); - break; - } - } - } - - private function beforeHead($token) - { - /* Handle the token as follows: */ - - /* A character token that is one of one of U+0009 CHARACTER TABULATION, - U+000A LINE FEED (LF), U+000B LINE TABULATION, U+000C FORM FEED (FF), - or U+0020 SPACE */ - if ($token['type'] === HTML5::CHARACTR && - preg_match('/^[\t\n\x0b\x0c ]+$/', $token['data']) - ) { - /* Append the character to the current node. */ - $this->insertText($token['data']); - - /* A comment token */ - } elseif ($token['type'] === HTML5::COMMENT) { - /* Append a Comment node to the current node with the data attribute - set to the data given in the comment token. */ - $this->insertComment($token['data']); - - /* A start tag token with the tag name "head" */ - } elseif ($token['type'] === HTML5::STARTTAG && $token['name'] === 'head') { - /* Create an element for the token, append the new element to the - current node and push it onto the stack of open elements. */ - $element = $this->insertElement($token); - - /* Set the head element pointer to this new element node. */ - $this->head_pointer = $element; - - /* Change the insertion mode to "in head". */ - $this->mode = self::IN_HEAD; - - /* A start tag token whose tag name is one of: "base", "link", "meta", - "script", "style", "title". Or an end tag with the tag name "html". - Or a character token that is not one of U+0009 CHARACTER TABULATION, - U+000A LINE FEED (LF), U+000B LINE TABULATION, U+000C FORM FEED (FF), - or U+0020 SPACE. Or any other start tag token */ - } elseif ($token['type'] === HTML5::STARTTAG || - ($token['type'] === HTML5::ENDTAG && $token['name'] === 'html') || - ($token['type'] === HTML5::CHARACTR && !preg_match( - '/^[\t\n\x0b\x0c ]$/', - $token['data'] - )) - ) { - /* Act as if a start tag token with the tag name "head" and no - attributes had been seen, then reprocess the current token. */ - $this->beforeHead( - array( - 'name' => 'head', - 'type' => HTML5::STARTTAG, - 'attr' => array() - ) - ); - - return $this->inHead($token); - - /* Any other end tag */ - } elseif ($token['type'] === HTML5::ENDTAG) { - /* Parse error. Ignore the token. */ - } - } - - private function inHead($token) - { - /* Handle the token as follows: */ - - /* A character token that is one of one of U+0009 CHARACTER TABULATION, - U+000A LINE FEED (LF), U+000B LINE TABULATION, U+000C FORM FEED (FF), - or U+0020 SPACE. - - THIS DIFFERS FROM THE SPEC: If the current node is either a title, style - or script element, append the character to the current node regardless - of its content. */ - if (($token['type'] === HTML5::CHARACTR && - preg_match('/^[\t\n\x0b\x0c ]+$/', $token['data'])) || ( - $token['type'] === HTML5::CHARACTR && in_array( - end($this->stack)->nodeName, - array('title', 'style', 'script') - )) - ) { - /* Append the character to the current node. */ - $this->insertText($token['data']); - - /* A comment token */ - } elseif ($token['type'] === HTML5::COMMENT) { - /* Append a Comment node to the current node with the data attribute - set to the data given in the comment token. */ - $this->insertComment($token['data']); - - } elseif ($token['type'] === HTML5::ENDTAG && - in_array($token['name'], array('title', 'style', 'script')) - ) { - array_pop($this->stack); - return HTML5::PCDATA; - - /* A start tag with the tag name "title" */ - } elseif ($token['type'] === HTML5::STARTTAG && $token['name'] === 'title') { - /* Create an element for the token and append the new element to the - node pointed to by the head element pointer, or, if that is null - (innerHTML case), to the current node. */ - if ($this->head_pointer !== null) { - $element = $this->insertElement($token, false); - $this->head_pointer->appendChild($element); - - } else { - $element = $this->insertElement($token); - } - - /* Switch the tokeniser's content model flag to the RCDATA state. */ - return HTML5::RCDATA; - - /* A start tag with the tag name "style" */ - } elseif ($token['type'] === HTML5::STARTTAG && $token['name'] === 'style') { - /* Create an element for the token and append the new element to the - node pointed to by the head element pointer, or, if that is null - (innerHTML case), to the current node. */ - if ($this->head_pointer !== null) { - $element = $this->insertElement($token, false); - $this->head_pointer->appendChild($element); - - } else { - $this->insertElement($token); - } - - /* Switch the tokeniser's content model flag to the CDATA state. */ - return HTML5::CDATA; - - /* A start tag with the tag name "script" */ - } elseif ($token['type'] === HTML5::STARTTAG && $token['name'] === 'script') { - /* Create an element for the token. */ - $element = $this->insertElement($token, false); - $this->head_pointer->appendChild($element); - - /* Switch the tokeniser's content model flag to the CDATA state. */ - return HTML5::CDATA; - - /* A start tag with the tag name "base", "link", or "meta" */ - } elseif ($token['type'] === HTML5::STARTTAG && in_array( - $token['name'], - array('base', 'link', 'meta') - ) - ) { - /* Create an element for the token and append the new element to the - node pointed to by the head element pointer, or, if that is null - (innerHTML case), to the current node. */ - if ($this->head_pointer !== null) { - $element = $this->insertElement($token, false); - $this->head_pointer->appendChild($element); - array_pop($this->stack); - - } else { - $this->insertElement($token); - } - - /* An end tag with the tag name "head" */ - } elseif ($token['type'] === HTML5::ENDTAG && $token['name'] === 'head') { - /* If the current node is a head element, pop the current node off - the stack of open elements. */ - if ($this->head_pointer->isSameNode(end($this->stack))) { - array_pop($this->stack); - - /* Otherwise, this is a parse error. */ - } else { - // k - } - - /* Change the insertion mode to "after head". */ - $this->mode = self::AFTER_HEAD; - - /* A start tag with the tag name "head" or an end tag except "html". */ - } elseif (($token['type'] === HTML5::STARTTAG && $token['name'] === 'head') || - ($token['type'] === HTML5::ENDTAG && $token['name'] !== 'html') - ) { - // Parse error. Ignore the token. - - /* Anything else */ - } else { - /* If the current node is a head element, act as if an end tag - token with the tag name "head" had been seen. */ - if ($this->head_pointer->isSameNode(end($this->stack))) { - $this->inHead( - array( - 'name' => 'head', - 'type' => HTML5::ENDTAG - ) - ); - - /* Otherwise, change the insertion mode to "after head". */ - } else { - $this->mode = self::AFTER_HEAD; - } - - /* Then, reprocess the current token. */ - return $this->afterHead($token); - } - } - - private function afterHead($token) - { - /* Handle the token as follows: */ - - /* A character token that is one of one of U+0009 CHARACTER TABULATION, - U+000A LINE FEED (LF), U+000B LINE TABULATION, U+000C FORM FEED (FF), - or U+0020 SPACE */ - if ($token['type'] === HTML5::CHARACTR && - preg_match('/^[\t\n\x0b\x0c ]+$/', $token['data']) - ) { - /* Append the character to the current node. */ - $this->insertText($token['data']); - - /* A comment token */ - } elseif ($token['type'] === HTML5::COMMENT) { - /* Append a Comment node to the current node with the data attribute - set to the data given in the comment token. */ - $this->insertComment($token['data']); - - /* A start tag token with the tag name "body" */ - } elseif ($token['type'] === HTML5::STARTTAG && $token['name'] === 'body') { - /* Insert a body element for the token. */ - $this->insertElement($token); - - /* Change the insertion mode to "in body". */ - $this->mode = self::IN_BODY; - - /* A start tag token with the tag name "frameset" */ - } elseif ($token['type'] === HTML5::STARTTAG && $token['name'] === 'frameset') { - /* Insert a frameset element for the token. */ - $this->insertElement($token); - - /* Change the insertion mode to "in frameset". */ - $this->mode = self::IN_FRAME; - - /* A start tag token whose tag name is one of: "base", "link", "meta", - "script", "style", "title" */ - } elseif ($token['type'] === HTML5::STARTTAG && in_array( - $token['name'], - array('base', 'link', 'meta', 'script', 'style', 'title') - ) - ) { - /* Parse error. Switch the insertion mode back to "in head" and - reprocess the token. */ - $this->mode = self::IN_HEAD; - return $this->inHead($token); - - /* Anything else */ - } else { - /* Act as if a start tag token with the tag name "body" and no - attributes had been seen, and then reprocess the current token. */ - $this->afterHead( - array( - 'name' => 'body', - 'type' => HTML5::STARTTAG, - 'attr' => array() - ) - ); - - return $this->inBody($token); - } - } - - private function inBody($token) - { - /* Handle the token as follows: */ - - switch ($token['type']) { - /* A character token */ - case HTML5::CHARACTR: - /* Reconstruct the active formatting elements, if any. */ - $this->reconstructActiveFormattingElements(); - - /* Append the token's character to the current node. */ - $this->insertText($token['data']); - break; - - /* A comment token */ - case HTML5::COMMENT: - /* Append a Comment node to the current node with the data - attribute set to the data given in the comment token. */ - $this->insertComment($token['data']); - break; - - case HTML5::STARTTAG: - switch ($token['name']) { - /* A start tag token whose tag name is one of: "script", - "style" */ - case 'script': - case 'style': - /* Process the token as if the insertion mode had been "in - head". */ - return $this->inHead($token); - break; - - /* A start tag token whose tag name is one of: "base", "link", - "meta", "title" */ - case 'base': - case 'link': - case 'meta': - case 'title': - /* Parse error. Process the token as if the insertion mode - had been "in head". */ - return $this->inHead($token); - break; - - /* A start tag token with the tag name "body" */ - case 'body': - /* Parse error. If the second element on the stack of open - elements is not a body element, or, if the stack of open - elements has only one node on it, then ignore the token. - (innerHTML case) */ - if (count($this->stack) === 1 || $this->stack[1]->nodeName !== 'body') { - // Ignore - - /* Otherwise, for each attribute on the token, check to see - if the attribute is already present on the body element (the - second element) on the stack of open elements. If it is not, - add the attribute and its corresponding value to that - element. */ - } else { - foreach ($token['attr'] as $attr) { - if (!$this->stack[1]->hasAttribute($attr['name'])) { - $this->stack[1]->setAttribute($attr['name'], $attr['value']); - } - } - } - break; - - /* A start tag whose tag name is one of: "address", - "blockquote", "center", "dir", "div", "dl", "fieldset", - "listing", "menu", "ol", "p", "ul" */ - case 'address': - case 'blockquote': - case 'center': - case 'dir': - case 'div': - case 'dl': - case 'fieldset': - case 'listing': - case 'menu': - case 'ol': - case 'p': - case 'ul': - /* If the stack of open elements has a p element in scope, - then act as if an end tag with the tag name p had been - seen. */ - if ($this->elementInScope('p')) { - $this->emitToken( - array( - 'name' => 'p', - 'type' => HTML5::ENDTAG - ) - ); - } - - /* Insert an HTML element for the token. */ - $this->insertElement($token); - break; - - /* A start tag whose tag name is "form" */ - case 'form': - /* If the form element pointer is not null, ignore the - token with a parse error. */ - if ($this->form_pointer !== null) { - // Ignore. - - /* Otherwise: */ - } else { - /* If the stack of open elements has a p element in - scope, then act as if an end tag with the tag name p - had been seen. */ - if ($this->elementInScope('p')) { - $this->emitToken( - array( - 'name' => 'p', - 'type' => HTML5::ENDTAG - ) - ); - } - - /* Insert an HTML element for the token, and set the - form element pointer to point to the element created. */ - $element = $this->insertElement($token); - $this->form_pointer = $element; - } - break; - - /* A start tag whose tag name is "li", "dd" or "dt" */ - case 'li': - case 'dd': - case 'dt': - /* If the stack of open elements has a p element in scope, - then act as if an end tag with the tag name p had been - seen. */ - if ($this->elementInScope('p')) { - $this->emitToken( - array( - 'name' => 'p', - 'type' => HTML5::ENDTAG - ) - ); - } - - $stack_length = count($this->stack) - 1; - - for ($n = $stack_length; 0 <= $n; $n--) { - /* 1. Initialise node to be the current node (the - bottommost node of the stack). */ - $stop = false; - $node = $this->stack[$n]; - $cat = $this->getElementCategory($node->tagName); - - /* 2. If node is an li, dd or dt element, then pop all - the nodes from the current node up to node, including - node, then stop this algorithm. */ - if ($token['name'] === $node->tagName || ($token['name'] !== 'li' - && ($node->tagName === 'dd' || $node->tagName === 'dt')) - ) { - for ($x = $stack_length; $x >= $n; $x--) { - array_pop($this->stack); - } - - break; - } - - /* 3. If node is not in the formatting category, and is - not in the phrasing category, and is not an address or - div element, then stop this algorithm. */ - if ($cat !== self::FORMATTING && $cat !== self::PHRASING && - $node->tagName !== 'address' && $node->tagName !== 'div' - ) { - break; - } - } - - /* Finally, insert an HTML element with the same tag - name as the token's. */ - $this->insertElement($token); - break; - - /* A start tag token whose tag name is "plaintext" */ - case 'plaintext': - /* If the stack of open elements has a p element in scope, - then act as if an end tag with the tag name p had been - seen. */ - if ($this->elementInScope('p')) { - $this->emitToken( - array( - 'name' => 'p', - 'type' => HTML5::ENDTAG - ) - ); - } - - /* Insert an HTML element for the token. */ - $this->insertElement($token); - - return HTML5::PLAINTEXT; - break; - - /* A start tag whose tag name is one of: "h1", "h2", "h3", "h4", - "h5", "h6" */ - case 'h1': - case 'h2': - case 'h3': - case 'h4': - case 'h5': - case 'h6': - /* If the stack of open elements has a p element in scope, - then act as if an end tag with the tag name p had been seen. */ - if ($this->elementInScope('p')) { - $this->emitToken( - array( - 'name' => 'p', - 'type' => HTML5::ENDTAG - ) - ); - } - - /* If the stack of open elements has in scope an element whose - tag name is one of "h1", "h2", "h3", "h4", "h5", or "h6", then - this is a parse error; pop elements from the stack until an - element with one of those tag names has been popped from the - stack. */ - while ($this->elementInScope(array('h1', 'h2', 'h3', 'h4', 'h5', 'h6'))) { - array_pop($this->stack); - } - - /* Insert an HTML element for the token. */ - $this->insertElement($token); - break; - - /* A start tag whose tag name is "a" */ - case 'a': - /* If the list of active formatting elements contains - an element whose tag name is "a" between the end of the - list and the last marker on the list (or the start of - the list if there is no marker on the list), then this - is a parse error; act as if an end tag with the tag name - "a" had been seen, then remove that element from the list - of active formatting elements and the stack of open - elements if the end tag didn't already remove it (it - might not have if the element is not in table scope). */ - $leng = count($this->a_formatting); - - for ($n = $leng - 1; $n >= 0; $n--) { - if ($this->a_formatting[$n] === self::MARKER) { - break; - - } elseif ($this->a_formatting[$n]->nodeName === 'a') { - $this->emitToken( - array( - 'name' => 'a', - 'type' => HTML5::ENDTAG - ) - ); - break; - } - } - - /* Reconstruct the active formatting elements, if any. */ - $this->reconstructActiveFormattingElements(); - - /* Insert an HTML element for the token. */ - $el = $this->insertElement($token); - - /* Add that element to the list of active formatting - elements. */ - $this->a_formatting[] = $el; - break; - - /* A start tag whose tag name is one of: "b", "big", "em", "font", - "i", "nobr", "s", "small", "strike", "strong", "tt", "u" */ - case 'b': - case 'big': - case 'em': - case 'font': - case 'i': - case 'nobr': - case 's': - case 'small': - case 'strike': - case 'strong': - case 'tt': - case 'u': - /* Reconstruct the active formatting elements, if any. */ - $this->reconstructActiveFormattingElements(); - - /* Insert an HTML element for the token. */ - $el = $this->insertElement($token); - - /* Add that element to the list of active formatting - elements. */ - $this->a_formatting[] = $el; - break; - - /* A start tag token whose tag name is "button" */ - case 'button': - /* If the stack of open elements has a button element in scope, - then this is a parse error; act as if an end tag with the tag - name "button" had been seen, then reprocess the token. (We don't - do that. Unnecessary.) */ - if ($this->elementInScope('button')) { - $this->inBody( - array( - 'name' => 'button', - 'type' => HTML5::ENDTAG - ) - ); - } - - /* Reconstruct the active formatting elements, if any. */ - $this->reconstructActiveFormattingElements(); - - /* Insert an HTML element for the token. */ - $this->insertElement($token); - - /* Insert a marker at the end of the list of active - formatting elements. */ - $this->a_formatting[] = self::MARKER; - break; - - /* A start tag token whose tag name is one of: "marquee", "object" */ - case 'marquee': - case 'object': - /* Reconstruct the active formatting elements, if any. */ - $this->reconstructActiveFormattingElements(); - - /* Insert an HTML element for the token. */ - $this->insertElement($token); - - /* Insert a marker at the end of the list of active - formatting elements. */ - $this->a_formatting[] = self::MARKER; - break; - - /* A start tag token whose tag name is "xmp" */ - case 'xmp': - /* Reconstruct the active formatting elements, if any. */ - $this->reconstructActiveFormattingElements(); - - /* Insert an HTML element for the token. */ - $this->insertElement($token); - - /* Switch the content model flag to the CDATA state. */ - return HTML5::CDATA; - break; - - /* A start tag whose tag name is "table" */ - case 'table': - /* If the stack of open elements has a p element in scope, - then act as if an end tag with the tag name p had been seen. */ - if ($this->elementInScope('p')) { - $this->emitToken( - array( - 'name' => 'p', - 'type' => HTML5::ENDTAG - ) - ); - } - - /* Insert an HTML element for the token. */ - $this->insertElement($token); - - /* Change the insertion mode to "in table". */ - $this->mode = self::IN_TABLE; - break; - - /* A start tag whose tag name is one of: "area", "basefont", - "bgsound", "br", "embed", "img", "param", "spacer", "wbr" */ - case 'area': - case 'basefont': - case 'bgsound': - case 'br': - case 'embed': - case 'img': - case 'param': - case 'spacer': - case 'wbr': - /* Reconstruct the active formatting elements, if any. */ - $this->reconstructActiveFormattingElements(); - - /* Insert an HTML element for the token. */ - $this->insertElement($token); - - /* Immediately pop the current node off the stack of open elements. */ - array_pop($this->stack); - break; - - /* A start tag whose tag name is "hr" */ - case 'hr': - /* If the stack of open elements has a p element in scope, - then act as if an end tag with the tag name p had been seen. */ - if ($this->elementInScope('p')) { - $this->emitToken( - array( - 'name' => 'p', - 'type' => HTML5::ENDTAG - ) - ); - } - - /* Insert an HTML element for the token. */ - $this->insertElement($token); - - /* Immediately pop the current node off the stack of open elements. */ - array_pop($this->stack); - break; - - /* A start tag whose tag name is "image" */ - case 'image': - /* Parse error. Change the token's tag name to "img" and - reprocess it. (Don't ask.) */ - $token['name'] = 'img'; - return $this->inBody($token); - break; - - /* A start tag whose tag name is "input" */ - case 'input': - /* Reconstruct the active formatting elements, if any. */ - $this->reconstructActiveFormattingElements(); - - /* Insert an input element for the token. */ - $element = $this->insertElement($token, false); - - /* If the form element pointer is not null, then associate the - input element with the form element pointed to by the form - element pointer. */ - $this->form_pointer !== null - ? $this->form_pointer->appendChild($element) - : end($this->stack)->appendChild($element); - - /* Pop that input element off the stack of open elements. */ - array_pop($this->stack); - break; - - /* A start tag whose tag name is "isindex" */ - case 'isindex': - /* Parse error. */ - // w/e - - /* If the form element pointer is not null, - then ignore the token. */ - if ($this->form_pointer === null) { - /* Act as if a start tag token with the tag name "form" had - been seen. */ - $this->inBody( - array( - 'name' => 'body', - 'type' => HTML5::STARTTAG, - 'attr' => array() - ) - ); - - /* Act as if a start tag token with the tag name "hr" had - been seen. */ - $this->inBody( - array( - 'name' => 'hr', - 'type' => HTML5::STARTTAG, - 'attr' => array() - ) - ); - - /* Act as if a start tag token with the tag name "p" had - been seen. */ - $this->inBody( - array( - 'name' => 'p', - 'type' => HTML5::STARTTAG, - 'attr' => array() - ) - ); - - /* Act as if a start tag token with the tag name "label" - had been seen. */ - $this->inBody( - array( - 'name' => 'label', - 'type' => HTML5::STARTTAG, - 'attr' => array() - ) - ); - - /* Act as if a stream of character tokens had been seen. */ - $this->insertText( - 'This is a searchable index. ' . - 'Insert your search keywords here: ' - ); - - /* Act as if a start tag token with the tag name "input" - had been seen, with all the attributes from the "isindex" - token, except with the "name" attribute set to the value - "isindex" (ignoring any explicit "name" attribute). */ - $attr = $token['attr']; - $attr[] = array('name' => 'name', 'value' => 'isindex'); - - $this->inBody( - array( - 'name' => 'input', - 'type' => HTML5::STARTTAG, - 'attr' => $attr - ) - ); - - /* Act as if a stream of character tokens had been seen - (see below for what they should say). */ - $this->insertText( - 'This is a searchable index. ' . - 'Insert your search keywords here: ' - ); - - /* Act as if an end tag token with the tag name "label" - had been seen. */ - $this->inBody( - array( - 'name' => 'label', - 'type' => HTML5::ENDTAG - ) - ); - - /* Act as if an end tag token with the tag name "p" had - been seen. */ - $this->inBody( - array( - 'name' => 'p', - 'type' => HTML5::ENDTAG - ) - ); - - /* Act as if a start tag token with the tag name "hr" had - been seen. */ - $this->inBody( - array( - 'name' => 'hr', - 'type' => HTML5::ENDTAG - ) - ); - - /* Act as if an end tag token with the tag name "form" had - been seen. */ - $this->inBody( - array( - 'name' => 'form', - 'type' => HTML5::ENDTAG - ) - ); - } - break; - - /* A start tag whose tag name is "textarea" */ - case 'textarea': - $this->insertElement($token); - - /* Switch the tokeniser's content model flag to the - RCDATA state. */ - return HTML5::RCDATA; - break; - - /* A start tag whose tag name is one of: "iframe", "noembed", - "noframes" */ - case 'iframe': - case 'noembed': - case 'noframes': - $this->insertElement($token); - - /* Switch the tokeniser's content model flag to the CDATA state. */ - return HTML5::CDATA; - break; - - /* A start tag whose tag name is "select" */ - case 'select': - /* Reconstruct the active formatting elements, if any. */ - $this->reconstructActiveFormattingElements(); - - /* Insert an HTML element for the token. */ - $this->insertElement($token); - - /* Change the insertion mode to "in select". */ - $this->mode = self::IN_SELECT; - break; - - /* A start or end tag whose tag name is one of: "caption", "col", - "colgroup", "frame", "frameset", "head", "option", "optgroup", - "tbody", "td", "tfoot", "th", "thead", "tr". */ - case 'caption': - case 'col': - case 'colgroup': - case 'frame': - case 'frameset': - case 'head': - case 'option': - case 'optgroup': - case 'tbody': - case 'td': - case 'tfoot': - case 'th': - case 'thead': - case 'tr': - // Parse error. Ignore the token. - break; - - /* A start or end tag whose tag name is one of: "event-source", - "section", "nav", "article", "aside", "header", "footer", - "datagrid", "command" */ - case 'event-source': - case 'section': - case 'nav': - case 'article': - case 'aside': - case 'header': - case 'footer': - case 'datagrid': - case 'command': - // Work in progress! - break; - - /* A start tag token not covered by the previous entries */ - default: - /* Reconstruct the active formatting elements, if any. */ - $this->reconstructActiveFormattingElements(); - - $this->insertElement($token, true, true); - break; - } - break; - - case HTML5::ENDTAG: - switch ($token['name']) { - /* An end tag with the tag name "body" */ - case 'body': - /* If the second element in the stack of open elements is - not a body element, this is a parse error. Ignore the token. - (innerHTML case) */ - if (count($this->stack) < 2 || $this->stack[1]->nodeName !== 'body') { - // Ignore. - - /* If the current node is not the body element, then this - is a parse error. */ - } elseif (end($this->stack)->nodeName !== 'body') { - // Parse error. - } - - /* Change the insertion mode to "after body". */ - $this->mode = self::AFTER_BODY; - break; - - /* An end tag with the tag name "html" */ - case 'html': - /* Act as if an end tag with tag name "body" had been seen, - then, if that token wasn't ignored, reprocess the current - token. */ - $this->inBody( - array( - 'name' => 'body', - 'type' => HTML5::ENDTAG - ) - ); - - return $this->afterBody($token); - break; - - /* An end tag whose tag name is one of: "address", "blockquote", - "center", "dir", "div", "dl", "fieldset", "listing", "menu", - "ol", "pre", "ul" */ - case 'address': - case 'blockquote': - case 'center': - case 'dir': - case 'div': - case 'dl': - case 'fieldset': - case 'listing': - case 'menu': - case 'ol': - case 'pre': - case 'ul': - /* If the stack of open elements has an element in scope - with the same tag name as that of the token, then generate - implied end tags. */ - if ($this->elementInScope($token['name'])) { - $this->generateImpliedEndTags(); - - /* Now, if the current node is not an element with - the same tag name as that of the token, then this - is a parse error. */ - // w/e - - /* If the stack of open elements has an element in - scope with the same tag name as that of the token, - then pop elements from this stack until an element - with that tag name has been popped from the stack. */ - for ($n = count($this->stack) - 1; $n >= 0; $n--) { - if ($this->stack[$n]->nodeName === $token['name']) { - $n = -1; - } - - array_pop($this->stack); - } - } - break; - - /* An end tag whose tag name is "form" */ - case 'form': - /* If the stack of open elements has an element in scope - with the same tag name as that of the token, then generate - implied end tags. */ - if ($this->elementInScope($token['name'])) { - $this->generateImpliedEndTags(); - - } - - if (end($this->stack)->nodeName !== $token['name']) { - /* Now, if the current node is not an element with the - same tag name as that of the token, then this is a parse - error. */ - // w/e - - } else { - /* Otherwise, if the current node is an element with - the same tag name as that of the token pop that element - from the stack. */ - array_pop($this->stack); - } - - /* In any case, set the form element pointer to null. */ - $this->form_pointer = null; - break; - - /* An end tag whose tag name is "p" */ - case 'p': - /* If the stack of open elements has a p element in scope, - then generate implied end tags, except for p elements. */ - if ($this->elementInScope('p')) { - $this->generateImpliedEndTags(array('p')); - - /* If the current node is not a p element, then this is - a parse error. */ - // k - - /* If the stack of open elements has a p element in - scope, then pop elements from this stack until the stack - no longer has a p element in scope. */ - for ($n = count($this->stack) - 1; $n >= 0; $n--) { - if ($this->elementInScope('p')) { - array_pop($this->stack); - - } else { - break; - } - } - } - break; - - /* An end tag whose tag name is "dd", "dt", or "li" */ - case 'dd': - case 'dt': - case 'li': - /* If the stack of open elements has an element in scope - whose tag name matches the tag name of the token, then - generate implied end tags, except for elements with the - same tag name as the token. */ - if ($this->elementInScope($token['name'])) { - $this->generateImpliedEndTags(array($token['name'])); - - /* If the current node is not an element with the same - tag name as the token, then this is a parse error. */ - // w/e - - /* If the stack of open elements has an element in scope - whose tag name matches the tag name of the token, then - pop elements from this stack until an element with that - tag name has been popped from the stack. */ - for ($n = count($this->stack) - 1; $n >= 0; $n--) { - if ($this->stack[$n]->nodeName === $token['name']) { - $n = -1; - } - - array_pop($this->stack); - } - } - break; - - /* An end tag whose tag name is one of: "h1", "h2", "h3", "h4", - "h5", "h6" */ - case 'h1': - case 'h2': - case 'h3': - case 'h4': - case 'h5': - case 'h6': - $elements = array('h1', 'h2', 'h3', 'h4', 'h5', 'h6'); - - /* If the stack of open elements has in scope an element whose - tag name is one of "h1", "h2", "h3", "h4", "h5", or "h6", then - generate implied end tags. */ - if ($this->elementInScope($elements)) { - $this->generateImpliedEndTags(); - - /* Now, if the current node is not an element with the same - tag name as that of the token, then this is a parse error. */ - // w/e - - /* If the stack of open elements has in scope an element - whose tag name is one of "h1", "h2", "h3", "h4", "h5", or - "h6", then pop elements from the stack until an element - with one of those tag names has been popped from the stack. */ - while ($this->elementInScope($elements)) { - array_pop($this->stack); - } - } - break; - - /* An end tag whose tag name is one of: "a", "b", "big", "em", - "font", "i", "nobr", "s", "small", "strike", "strong", "tt", "u" */ - case 'a': - case 'b': - case 'big': - case 'em': - case 'font': - case 'i': - case 'nobr': - case 's': - case 'small': - case 'strike': - case 'strong': - case 'tt': - case 'u': - /* 1. Let the formatting element be the last element in - the list of active formatting elements that: - * is between the end of the list and the last scope - marker in the list, if any, or the start of the list - otherwise, and - * has the same tag name as the token. - */ - while (true) { - for ($a = count($this->a_formatting) - 1; $a >= 0; $a--) { - if ($this->a_formatting[$a] === self::MARKER) { - break; - - } elseif ($this->a_formatting[$a]->tagName === $token['name']) { - $formatting_element = $this->a_formatting[$a]; - $in_stack = in_array($formatting_element, $this->stack, true); - $fe_af_pos = $a; - break; - } - } - - /* If there is no such node, or, if that node is - also in the stack of open elements but the element - is not in scope, then this is a parse error. Abort - these steps. The token is ignored. */ - if (!isset($formatting_element) || ($in_stack && - !$this->elementInScope($token['name'])) - ) { - break; - - /* Otherwise, if there is such a node, but that node - is not in the stack of open elements, then this is a - parse error; remove the element from the list, and - abort these steps. */ - } elseif (isset($formatting_element) && !$in_stack) { - unset($this->a_formatting[$fe_af_pos]); - $this->a_formatting = array_merge($this->a_formatting); - break; - } - - /* 2. Let the furthest block be the topmost node in the - stack of open elements that is lower in the stack - than the formatting element, and is not an element in - the phrasing or formatting categories. There might - not be one. */ - $fe_s_pos = array_search($formatting_element, $this->stack, true); - $length = count($this->stack); - - for ($s = $fe_s_pos + 1; $s < $length; $s++) { - $category = $this->getElementCategory($this->stack[$s]->nodeName); - - if ($category !== self::PHRASING && $category !== self::FORMATTING) { - $furthest_block = $this->stack[$s]; - } - } - - /* 3. If there is no furthest block, then the UA must - skip the subsequent steps and instead just pop all - the nodes from the bottom of the stack of open - elements, from the current node up to the formatting - element, and remove the formatting element from the - list of active formatting elements. */ - if (!isset($furthest_block)) { - for ($n = $length - 1; $n >= $fe_s_pos; $n--) { - array_pop($this->stack); - } - - unset($this->a_formatting[$fe_af_pos]); - $this->a_formatting = array_merge($this->a_formatting); - break; - } - - /* 4. Let the common ancestor be the element - immediately above the formatting element in the stack - of open elements. */ - $common_ancestor = $this->stack[$fe_s_pos - 1]; - - /* 5. If the furthest block has a parent node, then - remove the furthest block from its parent node. */ - if ($furthest_block->parentNode !== null) { - $furthest_block->parentNode->removeChild($furthest_block); - } - - /* 6. Let a bookmark note the position of the - formatting element in the list of active formatting - elements relative to the elements on either side - of it in the list. */ - $bookmark = $fe_af_pos; - - /* 7. Let node and last node be the furthest block. - Follow these steps: */ - $node = $furthest_block; - $last_node = $furthest_block; - - while (true) { - for ($n = array_search($node, $this->stack, true) - 1; $n >= 0; $n--) { - /* 7.1 Let node be the element immediately - prior to node in the stack of open elements. */ - $node = $this->stack[$n]; - - /* 7.2 If node is not in the list of active - formatting elements, then remove node from - the stack of open elements and then go back - to step 1. */ - if (!in_array($node, $this->a_formatting, true)) { - unset($this->stack[$n]); - $this->stack = array_merge($this->stack); - - } else { - break; - } - } - - /* 7.3 Otherwise, if node is the formatting - element, then go to the next step in the overall - algorithm. */ - if ($node === $formatting_element) { - break; - - /* 7.4 Otherwise, if last node is the furthest - block, then move the aforementioned bookmark to - be immediately after the node in the list of - active formatting elements. */ - } elseif ($last_node === $furthest_block) { - $bookmark = array_search($node, $this->a_formatting, true) + 1; - } - - /* 7.5 If node has any children, perform a - shallow clone of node, replace the entry for - node in the list of active formatting elements - with an entry for the clone, replace the entry - for node in the stack of open elements with an - entry for the clone, and let node be the clone. */ - if ($node->hasChildNodes()) { - $clone = $node->cloneNode(); - $s_pos = array_search($node, $this->stack, true); - $a_pos = array_search($node, $this->a_formatting, true); - - $this->stack[$s_pos] = $clone; - $this->a_formatting[$a_pos] = $clone; - $node = $clone; - } - - /* 7.6 Insert last node into node, first removing - it from its previous parent node if any. */ - if ($last_node->parentNode !== null) { - $last_node->parentNode->removeChild($last_node); - } - - $node->appendChild($last_node); - - /* 7.7 Let last node be node. */ - $last_node = $node; - } - - /* 8. Insert whatever last node ended up being in - the previous step into the common ancestor node, - first removing it from its previous parent node if - any. */ - if ($last_node->parentNode !== null) { - $last_node->parentNode->removeChild($last_node); - } - - $common_ancestor->appendChild($last_node); - - /* 9. Perform a shallow clone of the formatting - element. */ - $clone = $formatting_element->cloneNode(); - - /* 10. Take all of the child nodes of the furthest - block and append them to the clone created in the - last step. */ - while ($furthest_block->hasChildNodes()) { - $child = $furthest_block->firstChild; - $furthest_block->removeChild($child); - $clone->appendChild($child); - } - - /* 11. Append that clone to the furthest block. */ - $furthest_block->appendChild($clone); - - /* 12. Remove the formatting element from the list - of active formatting elements, and insert the clone - into the list of active formatting elements at the - position of the aforementioned bookmark. */ - $fe_af_pos = array_search($formatting_element, $this->a_formatting, true); - unset($this->a_formatting[$fe_af_pos]); - $this->a_formatting = array_merge($this->a_formatting); - - $af_part1 = array_slice($this->a_formatting, 0, $bookmark - 1); - $af_part2 = array_slice($this->a_formatting, $bookmark, count($this->a_formatting)); - $this->a_formatting = array_merge($af_part1, array($clone), $af_part2); - - /* 13. Remove the formatting element from the stack - of open elements, and insert the clone into the stack - of open elements immediately after (i.e. in a more - deeply nested position than) the position of the - furthest block in that stack. */ - $fe_s_pos = array_search($formatting_element, $this->stack, true); - $fb_s_pos = array_search($furthest_block, $this->stack, true); - unset($this->stack[$fe_s_pos]); - - $s_part1 = array_slice($this->stack, 0, $fb_s_pos); - $s_part2 = array_slice($this->stack, $fb_s_pos + 1, count($this->stack)); - $this->stack = array_merge($s_part1, array($clone), $s_part2); - - /* 14. Jump back to step 1 in this series of steps. */ - unset($formatting_element, $fe_af_pos, $fe_s_pos, $furthest_block); - } - break; - - /* An end tag token whose tag name is one of: "button", - "marquee", "object" */ - case 'button': - case 'marquee': - case 'object': - /* If the stack of open elements has an element in scope whose - tag name matches the tag name of the token, then generate implied - tags. */ - if ($this->elementInScope($token['name'])) { - $this->generateImpliedEndTags(); - - /* Now, if the current node is not an element with the same - tag name as the token, then this is a parse error. */ - // k - - /* Now, if the stack of open elements has an element in scope - whose tag name matches the tag name of the token, then pop - elements from the stack until that element has been popped from - the stack, and clear the list of active formatting elements up - to the last marker. */ - for ($n = count($this->stack) - 1; $n >= 0; $n--) { - if ($this->stack[$n]->nodeName === $token['name']) { - $n = -1; - } - - array_pop($this->stack); - } - - $marker = end(array_keys($this->a_formatting, self::MARKER, true)); - - for ($n = count($this->a_formatting) - 1; $n > $marker; $n--) { - array_pop($this->a_formatting); - } - } - break; - - /* Or an end tag whose tag name is one of: "area", "basefont", - "bgsound", "br", "embed", "hr", "iframe", "image", "img", - "input", "isindex", "noembed", "noframes", "param", "select", - "spacer", "table", "textarea", "wbr" */ - case 'area': - case 'basefont': - case 'bgsound': - case 'br': - case 'embed': - case 'hr': - case 'iframe': - case 'image': - case 'img': - case 'input': - case 'isindex': - case 'noembed': - case 'noframes': - case 'param': - case 'select': - case 'spacer': - case 'table': - case 'textarea': - case 'wbr': - // Parse error. Ignore the token. - break; - - /* An end tag token not covered by the previous entries */ - default: - for ($n = count($this->stack) - 1; $n >= 0; $n--) { - /* Initialise node to be the current node (the bottommost - node of the stack). */ - $node = end($this->stack); - - /* If node has the same tag name as the end tag token, - then: */ - if ($token['name'] === $node->nodeName) { - /* Generate implied end tags. */ - $this->generateImpliedEndTags(); - - /* If the tag name of the end tag token does not - match the tag name of the current node, this is a - parse error. */ - // k - - /* Pop all the nodes from the current node up to - node, including node, then stop this algorithm. */ - for ($x = count($this->stack) - $n; $x >= $n; $x--) { - array_pop($this->stack); - } - - } else { - $category = $this->getElementCategory($node); - - if ($category !== self::SPECIAL && $category !== self::SCOPING) { - /* Otherwise, if node is in neither the formatting - category nor the phrasing category, then this is a - parse error. Stop this algorithm. The end tag token - is ignored. */ - return false; - } - } - } - break; - } - break; - } - } - - private function inTable($token) - { - $clear = array('html', 'table'); - - /* A character token that is one of one of U+0009 CHARACTER TABULATION, - U+000A LINE FEED (LF), U+000B LINE TABULATION, U+000C FORM FEED (FF), - or U+0020 SPACE */ - if ($token['type'] === HTML5::CHARACTR && - preg_match('/^[\t\n\x0b\x0c ]+$/', $token['data']) - ) { - /* Append the character to the current node. */ - $text = $this->dom->createTextNode($token['data']); - end($this->stack)->appendChild($text); - - /* A comment token */ - } elseif ($token['type'] === HTML5::COMMENT) { - /* Append a Comment node to the current node with the data - attribute set to the data given in the comment token. */ - $comment = $this->dom->createComment($token['data']); - end($this->stack)->appendChild($comment); - - /* A start tag whose tag name is "caption" */ - } elseif ($token['type'] === HTML5::STARTTAG && - $token['name'] === 'caption' - ) { - /* Clear the stack back to a table context. */ - $this->clearStackToTableContext($clear); - - /* Insert a marker at the end of the list of active - formatting elements. */ - $this->a_formatting[] = self::MARKER; - - /* Insert an HTML element for the token, then switch the - insertion mode to "in caption". */ - $this->insertElement($token); - $this->mode = self::IN_CAPTION; - - /* A start tag whose tag name is "colgroup" */ - } elseif ($token['type'] === HTML5::STARTTAG && - $token['name'] === 'colgroup' - ) { - /* Clear the stack back to a table context. */ - $this->clearStackToTableContext($clear); - - /* Insert an HTML element for the token, then switch the - insertion mode to "in column group". */ - $this->insertElement($token); - $this->mode = self::IN_CGROUP; - - /* A start tag whose tag name is "col" */ - } elseif ($token['type'] === HTML5::STARTTAG && - $token['name'] === 'col' - ) { - $this->inTable( - array( - 'name' => 'colgroup', - 'type' => HTML5::STARTTAG, - 'attr' => array() - ) - ); - - $this->inColumnGroup($token); - - /* A start tag whose tag name is one of: "tbody", "tfoot", "thead" */ - } elseif ($token['type'] === HTML5::STARTTAG && in_array( - $token['name'], - array('tbody', 'tfoot', 'thead') - ) - ) { - /* Clear the stack back to a table context. */ - $this->clearStackToTableContext($clear); - - /* Insert an HTML element for the token, then switch the insertion - mode to "in table body". */ - $this->insertElement($token); - $this->mode = self::IN_TBODY; - - /* A start tag whose tag name is one of: "td", "th", "tr" */ - } elseif ($token['type'] === HTML5::STARTTAG && - in_array($token['name'], array('td', 'th', 'tr')) - ) { - /* Act as if a start tag token with the tag name "tbody" had been - seen, then reprocess the current token. */ - $this->inTable( - array( - 'name' => 'tbody', - 'type' => HTML5::STARTTAG, - 'attr' => array() - ) - ); - - return $this->inTableBody($token); - - /* A start tag whose tag name is "table" */ - } elseif ($token['type'] === HTML5::STARTTAG && - $token['name'] === 'table' - ) { - /* Parse error. Act as if an end tag token with the tag name "table" - had been seen, then, if that token wasn't ignored, reprocess the - current token. */ - $this->inTable( - array( - 'name' => 'table', - 'type' => HTML5::ENDTAG - ) - ); - - return $this->mainPhase($token); - - /* An end tag whose tag name is "table" */ - } elseif ($token['type'] === HTML5::ENDTAG && - $token['name'] === 'table' - ) { - /* If the stack of open elements does not have an element in table - scope with the same tag name as the token, this is a parse error. - Ignore the token. (innerHTML case) */ - if (!$this->elementInScope($token['name'], true)) { - return false; - - /* Otherwise: */ - } else { - /* Generate implied end tags. */ - $this->generateImpliedEndTags(); - - /* Now, if the current node is not a table element, then this - is a parse error. */ - // w/e - - /* Pop elements from this stack until a table element has been - popped from the stack. */ - while (true) { - $current = end($this->stack)->nodeName; - array_pop($this->stack); - - if ($current === 'table') { - break; - } - } - - /* Reset the insertion mode appropriately. */ - $this->resetInsertionMode(); - } - - /* An end tag whose tag name is one of: "body", "caption", "col", - "colgroup", "html", "tbody", "td", "tfoot", "th", "thead", "tr" */ - } elseif ($token['type'] === HTML5::ENDTAG && in_array( - $token['name'], - array( - 'body', - 'caption', - 'col', - 'colgroup', - 'html', - 'tbody', - 'td', - 'tfoot', - 'th', - 'thead', - 'tr' - ) - ) - ) { - // Parse error. Ignore the token. - - /* Anything else */ - } else { - /* Parse error. Process the token as if the insertion mode was "in - body", with the following exception: */ - - /* If the current node is a table, tbody, tfoot, thead, or tr - element, then, whenever a node would be inserted into the current - node, it must instead be inserted into the foster parent element. */ - if (in_array( - end($this->stack)->nodeName, - array('table', 'tbody', 'tfoot', 'thead', 'tr') - ) - ) { - /* The foster parent element is the parent element of the last - table element in the stack of open elements, if there is a - table element and it has such a parent element. If there is no - table element in the stack of open elements (innerHTML case), - then the foster parent element is the first element in the - stack of open elements (the html element). Otherwise, if there - is a table element in the stack of open elements, but the last - table element in the stack of open elements has no parent, or - its parent node is not an element, then the foster parent - element is the element before the last table element in the - stack of open elements. */ - for ($n = count($this->stack) - 1; $n >= 0; $n--) { - if ($this->stack[$n]->nodeName === 'table') { - $table = $this->stack[$n]; - break; - } - } - - if (isset($table) && $table->parentNode !== null) { - $this->foster_parent = $table->parentNode; - - } elseif (!isset($table)) { - $this->foster_parent = $this->stack[0]; - - } elseif (isset($table) && ($table->parentNode === null || - $table->parentNode->nodeType !== XML_ELEMENT_NODE) - ) { - $this->foster_parent = $this->stack[$n - 1]; - } - } - - $this->inBody($token); - } - } - - private function inCaption($token) - { - /* An end tag whose tag name is "caption" */ - if ($token['type'] === HTML5::ENDTAG && $token['name'] === 'caption') { - /* If the stack of open elements does not have an element in table - scope with the same tag name as the token, this is a parse error. - Ignore the token. (innerHTML case) */ - if (!$this->elementInScope($token['name'], true)) { - // Ignore - - /* Otherwise: */ - } else { - /* Generate implied end tags. */ - $this->generateImpliedEndTags(); - - /* Now, if the current node is not a caption element, then this - is a parse error. */ - // w/e - - /* Pop elements from this stack until a caption element has - been popped from the stack. */ - while (true) { - $node = end($this->stack)->nodeName; - array_pop($this->stack); - - if ($node === 'caption') { - break; - } - } - - /* Clear the list of active formatting elements up to the last - marker. */ - $this->clearTheActiveFormattingElementsUpToTheLastMarker(); - - /* Switch the insertion mode to "in table". */ - $this->mode = self::IN_TABLE; - } - - /* A start tag whose tag name is one of: "caption", "col", "colgroup", - "tbody", "td", "tfoot", "th", "thead", "tr", or an end tag whose tag - name is "table" */ - } elseif (($token['type'] === HTML5::STARTTAG && in_array( - $token['name'], - array( - 'caption', - 'col', - 'colgroup', - 'tbody', - 'td', - 'tfoot', - 'th', - 'thead', - 'tr' - ) - )) || ($token['type'] === HTML5::ENDTAG && - $token['name'] === 'table') - ) { - /* Parse error. Act as if an end tag with the tag name "caption" - had been seen, then, if that token wasn't ignored, reprocess the - current token. */ - $this->inCaption( - array( - 'name' => 'caption', - 'type' => HTML5::ENDTAG - ) - ); - - return $this->inTable($token); - - /* An end tag whose tag name is one of: "body", "col", "colgroup", - "html", "tbody", "td", "tfoot", "th", "thead", "tr" */ - } elseif ($token['type'] === HTML5::ENDTAG && in_array( - $token['name'], - array( - 'body', - 'col', - 'colgroup', - 'html', - 'tbody', - 'tfoot', - 'th', - 'thead', - 'tr' - ) - ) - ) { - // Parse error. Ignore the token. - - /* Anything else */ - } else { - /* Process the token as if the insertion mode was "in body". */ - $this->inBody($token); - } - } - - private function inColumnGroup($token) - { - /* A character token that is one of one of U+0009 CHARACTER TABULATION, - U+000A LINE FEED (LF), U+000B LINE TABULATION, U+000C FORM FEED (FF), - or U+0020 SPACE */ - if ($token['type'] === HTML5::CHARACTR && - preg_match('/^[\t\n\x0b\x0c ]+$/', $token['data']) - ) { - /* Append the character to the current node. */ - $text = $this->dom->createTextNode($token['data']); - end($this->stack)->appendChild($text); - - /* A comment token */ - } elseif ($token['type'] === HTML5::COMMENT) { - /* Append a Comment node to the current node with the data - attribute set to the data given in the comment token. */ - $comment = $this->dom->createComment($token['data']); - end($this->stack)->appendChild($comment); - - /* A start tag whose tag name is "col" */ - } elseif ($token['type'] === HTML5::STARTTAG && $token['name'] === 'col') { - /* Insert a col element for the token. Immediately pop the current - node off the stack of open elements. */ - $this->insertElement($token); - array_pop($this->stack); - - /* An end tag whose tag name is "colgroup" */ - } elseif ($token['type'] === HTML5::ENDTAG && - $token['name'] === 'colgroup' - ) { - /* If the current node is the root html element, then this is a - parse error, ignore the token. (innerHTML case) */ - if (end($this->stack)->nodeName === 'html') { - // Ignore - - /* Otherwise, pop the current node (which will be a colgroup - element) from the stack of open elements. Switch the insertion - mode to "in table". */ - } else { - array_pop($this->stack); - $this->mode = self::IN_TABLE; - } - - /* An end tag whose tag name is "col" */ - } elseif ($token['type'] === HTML5::ENDTAG && $token['name'] === 'col') { - /* Parse error. Ignore the token. */ - - /* Anything else */ - } else { - /* Act as if an end tag with the tag name "colgroup" had been seen, - and then, if that token wasn't ignored, reprocess the current token. */ - $this->inColumnGroup( - array( - 'name' => 'colgroup', - 'type' => HTML5::ENDTAG - ) - ); - - return $this->inTable($token); - } - } - - private function inTableBody($token) - { - $clear = array('tbody', 'tfoot', 'thead', 'html'); - - /* A start tag whose tag name is "tr" */ - if ($token['type'] === HTML5::STARTTAG && $token['name'] === 'tr') { - /* Clear the stack back to a table body context. */ - $this->clearStackToTableContext($clear); - - /* Insert a tr element for the token, then switch the insertion - mode to "in row". */ - $this->insertElement($token); - $this->mode = self::IN_ROW; - - /* A start tag whose tag name is one of: "th", "td" */ - } elseif ($token['type'] === HTML5::STARTTAG && - ($token['name'] === 'th' || $token['name'] === 'td') - ) { - /* Parse error. Act as if a start tag with the tag name "tr" had - been seen, then reprocess the current token. */ - $this->inTableBody( - array( - 'name' => 'tr', - 'type' => HTML5::STARTTAG, - 'attr' => array() - ) - ); - - return $this->inRow($token); - - /* An end tag whose tag name is one of: "tbody", "tfoot", "thead" */ - } elseif ($token['type'] === HTML5::ENDTAG && - in_array($token['name'], array('tbody', 'tfoot', 'thead')) - ) { - /* If the stack of open elements does not have an element in table - scope with the same tag name as the token, this is a parse error. - Ignore the token. */ - if (!$this->elementInScope($token['name'], true)) { - // Ignore - - /* Otherwise: */ - } else { - /* Clear the stack back to a table body context. */ - $this->clearStackToTableContext($clear); - - /* Pop the current node from the stack of open elements. Switch - the insertion mode to "in table". */ - array_pop($this->stack); - $this->mode = self::IN_TABLE; - } - - /* A start tag whose tag name is one of: "caption", "col", "colgroup", - "tbody", "tfoot", "thead", or an end tag whose tag name is "table" */ - } elseif (($token['type'] === HTML5::STARTTAG && in_array( - $token['name'], - array('caption', 'col', 'colgroup', 'tbody', 'tfoor', 'thead') - )) || - ($token['type'] === HTML5::STARTTAG && $token['name'] === 'table') - ) { - /* If the stack of open elements does not have a tbody, thead, or - tfoot element in table scope, this is a parse error. Ignore the - token. (innerHTML case) */ - if (!$this->elementInScope(array('tbody', 'thead', 'tfoot'), true)) { - // Ignore. - - /* Otherwise: */ - } else { - /* Clear the stack back to a table body context. */ - $this->clearStackToTableContext($clear); - - /* Act as if an end tag with the same tag name as the current - node ("tbody", "tfoot", or "thead") had been seen, then - reprocess the current token. */ - $this->inTableBody( - array( - 'name' => end($this->stack)->nodeName, - 'type' => HTML5::ENDTAG - ) - ); - - return $this->mainPhase($token); - } - - /* An end tag whose tag name is one of: "body", "caption", "col", - "colgroup", "html", "td", "th", "tr" */ - } elseif ($token['type'] === HTML5::ENDTAG && in_array( - $token['name'], - array('body', 'caption', 'col', 'colgroup', 'html', 'td', 'th', 'tr') - ) - ) { - /* Parse error. Ignore the token. */ - - /* Anything else */ - } else { - /* Process the token as if the insertion mode was "in table". */ - $this->inTable($token); - } - } - - private function inRow($token) - { - $clear = array('tr', 'html'); - - /* A start tag whose tag name is one of: "th", "td" */ - if ($token['type'] === HTML5::STARTTAG && - ($token['name'] === 'th' || $token['name'] === 'td') - ) { - /* Clear the stack back to a table row context. */ - $this->clearStackToTableContext($clear); - - /* Insert an HTML element for the token, then switch the insertion - mode to "in cell". */ - $this->insertElement($token); - $this->mode = self::IN_CELL; - - /* Insert a marker at the end of the list of active formatting - elements. */ - $this->a_formatting[] = self::MARKER; - - /* An end tag whose tag name is "tr" */ - } elseif ($token['type'] === HTML5::ENDTAG && $token['name'] === 'tr') { - /* If the stack of open elements does not have an element in table - scope with the same tag name as the token, this is a parse error. - Ignore the token. (innerHTML case) */ - if (!$this->elementInScope($token['name'], true)) { - // Ignore. - - /* Otherwise: */ - } else { - /* Clear the stack back to a table row context. */ - $this->clearStackToTableContext($clear); - - /* Pop the current node (which will be a tr element) from the - stack of open elements. Switch the insertion mode to "in table - body". */ - array_pop($this->stack); - $this->mode = self::IN_TBODY; - } - - /* A start tag whose tag name is one of: "caption", "col", "colgroup", - "tbody", "tfoot", "thead", "tr" or an end tag whose tag name is "table" */ - } elseif ($token['type'] === HTML5::STARTTAG && in_array( - $token['name'], - array('caption', 'col', 'colgroup', 'tbody', 'tfoot', 'thead', 'tr') - ) - ) { - /* Act as if an end tag with the tag name "tr" had been seen, then, - if that token wasn't ignored, reprocess the current token. */ - $this->inRow( - array( - 'name' => 'tr', - 'type' => HTML5::ENDTAG - ) - ); - - return $this->inCell($token); - - /* An end tag whose tag name is one of: "tbody", "tfoot", "thead" */ - } elseif ($token['type'] === HTML5::ENDTAG && - in_array($token['name'], array('tbody', 'tfoot', 'thead')) - ) { - /* If the stack of open elements does not have an element in table - scope with the same tag name as the token, this is a parse error. - Ignore the token. */ - if (!$this->elementInScope($token['name'], true)) { - // Ignore. - - /* Otherwise: */ - } else { - /* Otherwise, act as if an end tag with the tag name "tr" had - been seen, then reprocess the current token. */ - $this->inRow( - array( - 'name' => 'tr', - 'type' => HTML5::ENDTAG - ) - ); - - return $this->inCell($token); - } - - /* An end tag whose tag name is one of: "body", "caption", "col", - "colgroup", "html", "td", "th" */ - } elseif ($token['type'] === HTML5::ENDTAG && in_array( - $token['name'], - array('body', 'caption', 'col', 'colgroup', 'html', 'td', 'th', 'tr') - ) - ) { - /* Parse error. Ignore the token. */ - - /* Anything else */ - } else { - /* Process the token as if the insertion mode was "in table". */ - $this->inTable($token); - } - } - - private function inCell($token) - { - /* An end tag whose tag name is one of: "td", "th" */ - if ($token['type'] === HTML5::ENDTAG && - ($token['name'] === 'td' || $token['name'] === 'th') - ) { - /* If the stack of open elements does not have an element in table - scope with the same tag name as that of the token, then this is a - parse error and the token must be ignored. */ - if (!$this->elementInScope($token['name'], true)) { - // Ignore. - - /* Otherwise: */ - } else { - /* Generate implied end tags, except for elements with the same - tag name as the token. */ - $this->generateImpliedEndTags(array($token['name'])); - - /* Now, if the current node is not an element with the same tag - name as the token, then this is a parse error. */ - // k - - /* Pop elements from this stack until an element with the same - tag name as the token has been popped from the stack. */ - while (true) { - $node = end($this->stack)->nodeName; - array_pop($this->stack); - - if ($node === $token['name']) { - break; - } - } - - /* Clear the list of active formatting elements up to the last - marker. */ - $this->clearTheActiveFormattingElementsUpToTheLastMarker(); - - /* Switch the insertion mode to "in row". (The current node - will be a tr element at this point.) */ - $this->mode = self::IN_ROW; - } - - /* A start tag whose tag name is one of: "caption", "col", "colgroup", - "tbody", "td", "tfoot", "th", "thead", "tr" */ - } elseif ($token['type'] === HTML5::STARTTAG && in_array( - $token['name'], - array( - 'caption', - 'col', - 'colgroup', - 'tbody', - 'td', - 'tfoot', - 'th', - 'thead', - 'tr' - ) - ) - ) { - /* If the stack of open elements does not have a td or th element - in table scope, then this is a parse error; ignore the token. - (innerHTML case) */ - if (!$this->elementInScope(array('td', 'th'), true)) { - // Ignore. - - /* Otherwise, close the cell (see below) and reprocess the current - token. */ - } else { - $this->closeCell(); - return $this->inRow($token); - } - - /* A start tag whose tag name is one of: "caption", "col", "colgroup", - "tbody", "td", "tfoot", "th", "thead", "tr" */ - } elseif ($token['type'] === HTML5::STARTTAG && in_array( - $token['name'], - array( - 'caption', - 'col', - 'colgroup', - 'tbody', - 'td', - 'tfoot', - 'th', - 'thead', - 'tr' - ) - ) - ) { - /* If the stack of open elements does not have a td or th element - in table scope, then this is a parse error; ignore the token. - (innerHTML case) */ - if (!$this->elementInScope(array('td', 'th'), true)) { - // Ignore. - - /* Otherwise, close the cell (see below) and reprocess the current - token. */ - } else { - $this->closeCell(); - return $this->inRow($token); - } - - /* An end tag whose tag name is one of: "body", "caption", "col", - "colgroup", "html" */ - } elseif ($token['type'] === HTML5::ENDTAG && in_array( - $token['name'], - array('body', 'caption', 'col', 'colgroup', 'html') - ) - ) { - /* Parse error. Ignore the token. */ - - /* An end tag whose tag name is one of: "table", "tbody", "tfoot", - "thead", "tr" */ - } elseif ($token['type'] === HTML5::ENDTAG && in_array( - $token['name'], - array('table', 'tbody', 'tfoot', 'thead', 'tr') - ) - ) { - /* If the stack of open elements does not have an element in table - scope with the same tag name as that of the token (which can only - happen for "tbody", "tfoot" and "thead", or, in the innerHTML case), - then this is a parse error and the token must be ignored. */ - if (!$this->elementInScope($token['name'], true)) { - // Ignore. - - /* Otherwise, close the cell (see below) and reprocess the current - token. */ - } else { - $this->closeCell(); - return $this->inRow($token); - } - - /* Anything else */ - } else { - /* Process the token as if the insertion mode was "in body". */ - $this->inBody($token); - } - } - - private function inSelect($token) - { - /* Handle the token as follows: */ - - /* A character token */ - if ($token['type'] === HTML5::CHARACTR) { - /* Append the token's character to the current node. */ - $this->insertText($token['data']); - - /* A comment token */ - } elseif ($token['type'] === HTML5::COMMENT) { - /* Append a Comment node to the current node with the data - attribute set to the data given in the comment token. */ - $this->insertComment($token['data']); - - /* A start tag token whose tag name is "option" */ - } elseif ($token['type'] === HTML5::STARTTAG && - $token['name'] === 'option' - ) { - /* If the current node is an option element, act as if an end tag - with the tag name "option" had been seen. */ - if (end($this->stack)->nodeName === 'option') { - $this->inSelect( - array( - 'name' => 'option', - 'type' => HTML5::ENDTAG - ) - ); - } - - /* Insert an HTML element for the token. */ - $this->insertElement($token); - - /* A start tag token whose tag name is "optgroup" */ - } elseif ($token['type'] === HTML5::STARTTAG && - $token['name'] === 'optgroup' - ) { - /* If the current node is an option element, act as if an end tag - with the tag name "option" had been seen. */ - if (end($this->stack)->nodeName === 'option') { - $this->inSelect( - array( - 'name' => 'option', - 'type' => HTML5::ENDTAG - ) - ); - } - - /* If the current node is an optgroup element, act as if an end tag - with the tag name "optgroup" had been seen. */ - if (end($this->stack)->nodeName === 'optgroup') { - $this->inSelect( - array( - 'name' => 'optgroup', - 'type' => HTML5::ENDTAG - ) - ); - } - - /* Insert an HTML element for the token. */ - $this->insertElement($token); - - /* An end tag token whose tag name is "optgroup" */ - } elseif ($token['type'] === HTML5::ENDTAG && - $token['name'] === 'optgroup' - ) { - /* First, if the current node is an option element, and the node - immediately before it in the stack of open elements is an optgroup - element, then act as if an end tag with the tag name "option" had - been seen. */ - $elements_in_stack = count($this->stack); - - if ($this->stack[$elements_in_stack - 1]->nodeName === 'option' && - $this->stack[$elements_in_stack - 2]->nodeName === 'optgroup' - ) { - $this->inSelect( - array( - 'name' => 'option', - 'type' => HTML5::ENDTAG - ) - ); - } - - /* If the current node is an optgroup element, then pop that node - from the stack of open elements. Otherwise, this is a parse error, - ignore the token. */ - if ($this->stack[$elements_in_stack - 1] === 'optgroup') { - array_pop($this->stack); - } - - /* An end tag token whose tag name is "option" */ - } elseif ($token['type'] === HTML5::ENDTAG && - $token['name'] === 'option' - ) { - /* If the current node is an option element, then pop that node - from the stack of open elements. Otherwise, this is a parse error, - ignore the token. */ - if (end($this->stack)->nodeName === 'option') { - array_pop($this->stack); - } - - /* An end tag whose tag name is "select" */ - } elseif ($token['type'] === HTML5::ENDTAG && - $token['name'] === 'select' - ) { - /* If the stack of open elements does not have an element in table - scope with the same tag name as the token, this is a parse error. - Ignore the token. (innerHTML case) */ - if (!$this->elementInScope($token['name'], true)) { - // w/e - - /* Otherwise: */ - } else { - /* Pop elements from the stack of open elements until a select - element has been popped from the stack. */ - while (true) { - $current = end($this->stack)->nodeName; - array_pop($this->stack); - - if ($current === 'select') { - break; - } - } - - /* Reset the insertion mode appropriately. */ - $this->resetInsertionMode(); - } - - /* A start tag whose tag name is "select" */ - } elseif ($token['name'] === 'select' && - $token['type'] === HTML5::STARTTAG - ) { - /* Parse error. Act as if the token had been an end tag with the - tag name "select" instead. */ - $this->inSelect( - array( - 'name' => 'select', - 'type' => HTML5::ENDTAG - ) - ); - - /* An end tag whose tag name is one of: "caption", "table", "tbody", - "tfoot", "thead", "tr", "td", "th" */ - } elseif (in_array( - $token['name'], - array( - 'caption', - 'table', - 'tbody', - 'tfoot', - 'thead', - 'tr', - 'td', - 'th' - ) - ) && $token['type'] === HTML5::ENDTAG - ) { - /* Parse error. */ - // w/e - - /* If the stack of open elements has an element in table scope with - the same tag name as that of the token, then act as if an end tag - with the tag name "select" had been seen, and reprocess the token. - Otherwise, ignore the token. */ - if ($this->elementInScope($token['name'], true)) { - $this->inSelect( - array( - 'name' => 'select', - 'type' => HTML5::ENDTAG - ) - ); - - $this->mainPhase($token); - } - - /* Anything else */ - } else { - /* Parse error. Ignore the token. */ - } - } - - private function afterBody($token) - { - /* Handle the token as follows: */ - - /* A character token that is one of one of U+0009 CHARACTER TABULATION, - U+000A LINE FEED (LF), U+000B LINE TABULATION, U+000C FORM FEED (FF), - or U+0020 SPACE */ - if ($token['type'] === HTML5::CHARACTR && - preg_match('/^[\t\n\x0b\x0c ]+$/', $token['data']) - ) { - /* Process the token as it would be processed if the insertion mode - was "in body". */ - $this->inBody($token); - - /* A comment token */ - } elseif ($token['type'] === HTML5::COMMENT) { - /* Append a Comment node to the first element in the stack of open - elements (the html element), with the data attribute set to the - data given in the comment token. */ - $comment = $this->dom->createComment($token['data']); - $this->stack[0]->appendChild($comment); - - /* An end tag with the tag name "html" */ - } elseif ($token['type'] === HTML5::ENDTAG && $token['name'] === 'html') { - /* If the parser was originally created in order to handle the - setting of an element's innerHTML attribute, this is a parse error; - ignore the token. (The element will be an html element in this - case.) (innerHTML case) */ - - /* Otherwise, switch to the trailing end phase. */ - $this->phase = self::END_PHASE; - - /* Anything else */ - } else { - /* Parse error. Set the insertion mode to "in body" and reprocess - the token. */ - $this->mode = self::IN_BODY; - return $this->inBody($token); - } - } - - private function inFrameset($token) - { - /* Handle the token as follows: */ - - /* A character token that is one of one of U+0009 CHARACTER TABULATION, - U+000A LINE FEED (LF), U+000B LINE TABULATION, U+000C FORM FEED (FF), - U+000D CARRIAGE RETURN (CR), or U+0020 SPACE */ - if ($token['type'] === HTML5::CHARACTR && - preg_match('/^[\t\n\x0b\x0c ]+$/', $token['data']) - ) { - /* Append the character to the current node. */ - $this->insertText($token['data']); - - /* A comment token */ - } elseif ($token['type'] === HTML5::COMMENT) { - /* Append a Comment node to the current node with the data - attribute set to the data given in the comment token. */ - $this->insertComment($token['data']); - - /* A start tag with the tag name "frameset" */ - } elseif ($token['name'] === 'frameset' && - $token['type'] === HTML5::STARTTAG - ) { - $this->insertElement($token); - - /* An end tag with the tag name "frameset" */ - } elseif ($token['name'] === 'frameset' && - $token['type'] === HTML5::ENDTAG - ) { - /* If the current node is the root html element, then this is a - parse error; ignore the token. (innerHTML case) */ - if (end($this->stack)->nodeName === 'html') { - // Ignore - - } else { - /* Otherwise, pop the current node from the stack of open - elements. */ - array_pop($this->stack); - - /* If the parser was not originally created in order to handle - the setting of an element's innerHTML attribute (innerHTML case), - and the current node is no longer a frameset element, then change - the insertion mode to "after frameset". */ - $this->mode = self::AFTR_FRAME; - } - - /* A start tag with the tag name "frame" */ - } elseif ($token['name'] === 'frame' && - $token['type'] === HTML5::STARTTAG - ) { - /* Insert an HTML element for the token. */ - $this->insertElement($token); - - /* Immediately pop the current node off the stack of open elements. */ - array_pop($this->stack); - - /* A start tag with the tag name "noframes" */ - } elseif ($token['name'] === 'noframes' && - $token['type'] === HTML5::STARTTAG - ) { - /* Process the token as if the insertion mode had been "in body". */ - $this->inBody($token); - - /* Anything else */ - } else { - /* Parse error. Ignore the token. */ - } - } - - private function afterFrameset($token) - { - /* Handle the token as follows: */ - - /* A character token that is one of one of U+0009 CHARACTER TABULATION, - U+000A LINE FEED (LF), U+000B LINE TABULATION, U+000C FORM FEED (FF), - U+000D CARRIAGE RETURN (CR), or U+0020 SPACE */ - if ($token['type'] === HTML5::CHARACTR && - preg_match('/^[\t\n\x0b\x0c ]+$/', $token['data']) - ) { - /* Append the character to the current node. */ - $this->insertText($token['data']); - - /* A comment token */ - } elseif ($token['type'] === HTML5::COMMENT) { - /* Append a Comment node to the current node with the data - attribute set to the data given in the comment token. */ - $this->insertComment($token['data']); - - /* An end tag with the tag name "html" */ - } elseif ($token['name'] === 'html' && - $token['type'] === HTML5::ENDTAG - ) { - /* Switch to the trailing end phase. */ - $this->phase = self::END_PHASE; - - /* A start tag with the tag name "noframes" */ - } elseif ($token['name'] === 'noframes' && - $token['type'] === HTML5::STARTTAG - ) { - /* Process the token as if the insertion mode had been "in body". */ - $this->inBody($token); - - /* Anything else */ - } else { - /* Parse error. Ignore the token. */ - } - } - - private function trailingEndPhase($token) - { - /* After the main phase, as each token is emitted from the tokenisation - stage, it must be processed as described in this section. */ - - /* A DOCTYPE token */ - if ($token['type'] === HTML5::DOCTYPE) { - // Parse error. Ignore the token. - - /* A comment token */ - } elseif ($token['type'] === HTML5::COMMENT) { - /* Append a Comment node to the Document object with the data - attribute set to the data given in the comment token. */ - $comment = $this->dom->createComment($token['data']); - $this->dom->appendChild($comment); - - /* A character token that is one of one of U+0009 CHARACTER TABULATION, - U+000A LINE FEED (LF), U+000B LINE TABULATION, U+000C FORM FEED (FF), - or U+0020 SPACE */ - } elseif ($token['type'] === HTML5::CHARACTR && - preg_match('/^[\t\n\x0b\x0c ]+$/', $token['data']) - ) { - /* Process the token as it would be processed in the main phase. */ - $this->mainPhase($token); - - /* A character token that is not one of U+0009 CHARACTER TABULATION, - U+000A LINE FEED (LF), U+000B LINE TABULATION, U+000C FORM FEED (FF), - or U+0020 SPACE. Or a start tag token. Or an end tag token. */ - } elseif (($token['type'] === HTML5::CHARACTR && - preg_match('/^[\t\n\x0b\x0c ]+$/', $token['data'])) || - $token['type'] === HTML5::STARTTAG || $token['type'] === HTML5::ENDTAG - ) { - /* Parse error. Switch back to the main phase and reprocess the - token. */ - $this->phase = self::MAIN_PHASE; - return $this->mainPhase($token); - - /* An end-of-file token */ - } elseif ($token['type'] === HTML5::EOF) { - /* OMG DONE!! */ - } - } - - private function insertElement($token, $append = true, $check = false) - { - // Proprietary workaround for libxml2's limitations with tag names - if ($check) { - // Slightly modified HTML5 tag-name modification, - // removing anything that's not an ASCII letter, digit, or hyphen - $token['name'] = preg_replace('/[^a-z0-9-]/i', '', $token['name']); - // Remove leading hyphens and numbers - $token['name'] = ltrim($token['name'], '-0..9'); - // In theory, this should ever be needed, but just in case - if ($token['name'] === '') { - $token['name'] = 'span'; - } // arbitrary generic choice - } - - $el = $this->dom->createElement($token['name']); - - foreach ($token['attr'] as $attr) { - if (!$el->hasAttribute($attr['name'])) { - $el->setAttribute($attr['name'], $attr['value']); - } - } - - $this->appendToRealParent($el); - $this->stack[] = $el; - - return $el; - } - - private function insertText($data) - { - $text = $this->dom->createTextNode($data); - $this->appendToRealParent($text); - } - - private function insertComment($data) - { - $comment = $this->dom->createComment($data); - $this->appendToRealParent($comment); - } - - private function appendToRealParent($node) - { - if ($this->foster_parent === null) { - end($this->stack)->appendChild($node); - - } elseif ($this->foster_parent !== null) { - /* If the foster parent element is the parent element of the - last table element in the stack of open elements, then the new - node must be inserted immediately before the last table element - in the stack of open elements in the foster parent element; - otherwise, the new node must be appended to the foster parent - element. */ - for ($n = count($this->stack) - 1; $n >= 0; $n--) { - if ($this->stack[$n]->nodeName === 'table' && - $this->stack[$n]->parentNode !== null - ) { - $table = $this->stack[$n]; - break; - } - } - - if (isset($table) && $this->foster_parent->isSameNode($table->parentNode)) { - $this->foster_parent->insertBefore($node, $table); - } else { - $this->foster_parent->appendChild($node); - } - - $this->foster_parent = null; - } - } - - private function elementInScope($el, $table = false) - { - if (is_array($el)) { - foreach ($el as $element) { - if ($this->elementInScope($element, $table)) { - return true; - } - } - - return false; - } - - $leng = count($this->stack); - - for ($n = 0; $n < $leng; $n++) { - /* 1. Initialise node to be the current node (the bottommost node of - the stack). */ - $node = $this->stack[$leng - 1 - $n]; - - if ($node->tagName === $el) { - /* 2. If node is the target node, terminate in a match state. */ - return true; - - } elseif ($node->tagName === 'table') { - /* 3. Otherwise, if node is a table element, terminate in a failure - state. */ - return false; - - } elseif ($table === true && in_array( - $node->tagName, - array( - 'caption', - 'td', - 'th', - 'button', - 'marquee', - 'object' - ) - ) - ) { - /* 4. Otherwise, if the algorithm is the "has an element in scope" - variant (rather than the "has an element in table scope" variant), - and node is one of the following, terminate in a failure state. */ - return false; - - } elseif ($node === $node->ownerDocument->documentElement) { - /* 5. Otherwise, if node is an html element (root element), terminate - in a failure state. (This can only happen if the node is the topmost - node of the stack of open elements, and prevents the next step from - being invoked if there are no more elements in the stack.) */ - return false; - } - - /* Otherwise, set node to the previous entry in the stack of open - elements and return to step 2. (This will never fail, since the loop - will always terminate in the previous step if the top of the stack - is reached.) */ - } - } - - private function reconstructActiveFormattingElements() - { - /* 1. If there are no entries in the list of active formatting elements, - then there is nothing to reconstruct; stop this algorithm. */ - $formatting_elements = count($this->a_formatting); - - if ($formatting_elements === 0) { - return false; - } - - /* 3. Let entry be the last (most recently added) element in the list - of active formatting elements. */ - $entry = end($this->a_formatting); - - /* 2. If the last (most recently added) entry in the list of active - formatting elements is a marker, or if it is an element that is in the - stack of open elements, then there is nothing to reconstruct; stop this - algorithm. */ - if ($entry === self::MARKER || in_array($entry, $this->stack, true)) { - return false; - } - - for ($a = $formatting_elements - 1; $a >= 0; true) { - /* 4. If there are no entries before entry in the list of active - formatting elements, then jump to step 8. */ - if ($a === 0) { - $step_seven = false; - break; - } - - /* 5. Let entry be the entry one earlier than entry in the list of - active formatting elements. */ - $a--; - $entry = $this->a_formatting[$a]; - - /* 6. If entry is neither a marker nor an element that is also in - thetack of open elements, go to step 4. */ - if ($entry === self::MARKER || in_array($entry, $this->stack, true)) { - break; - } - } - - while (true) { - /* 7. Let entry be the element one later than entry in the list of - active formatting elements. */ - if (isset($step_seven) && $step_seven === true) { - $a++; - $entry = $this->a_formatting[$a]; - } - - /* 8. Perform a shallow clone of the element entry to obtain clone. */ - $clone = $entry->cloneNode(); - - /* 9. Append clone to the current node and push it onto the stack - of open elements so that it is the new current node. */ - end($this->stack)->appendChild($clone); - $this->stack[] = $clone; - - /* 10. Replace the entry for entry in the list with an entry for - clone. */ - $this->a_formatting[$a] = $clone; - - /* 11. If the entry for clone in the list of active formatting - elements is not the last entry in the list, return to step 7. */ - if (end($this->a_formatting) !== $clone) { - $step_seven = true; - } else { - break; - } - } - } - - private function clearTheActiveFormattingElementsUpToTheLastMarker() - { - /* When the steps below require the UA to clear the list of active - formatting elements up to the last marker, the UA must perform the - following steps: */ - - while (true) { - /* 1. Let entry be the last (most recently added) entry in the list - of active formatting elements. */ - $entry = end($this->a_formatting); - - /* 2. Remove entry from the list of active formatting elements. */ - array_pop($this->a_formatting); - - /* 3. If entry was a marker, then stop the algorithm at this point. - The list has been cleared up to the last marker. */ - if ($entry === self::MARKER) { - break; - } - } - } - - private function generateImpliedEndTags($exclude = array()) - { - /* When the steps below require the UA to generate implied end tags, - then, if the current node is a dd element, a dt element, an li element, - a p element, a td element, a th element, or a tr element, the UA must - act as if an end tag with the respective tag name had been seen and - then generate implied end tags again. */ - $node = end($this->stack); - $elements = array_diff(array('dd', 'dt', 'li', 'p', 'td', 'th', 'tr'), $exclude); - - while (in_array(end($this->stack)->nodeName, $elements)) { - array_pop($this->stack); - } - } - - private function getElementCategory($node) - { - $name = $node->tagName; - if (in_array($name, $this->special)) { - return self::SPECIAL; - } elseif (in_array($name, $this->scoping)) { - return self::SCOPING; - } elseif (in_array($name, $this->formatting)) { - return self::FORMATTING; - } else { - return self::PHRASING; - } - } - - private function clearStackToTableContext($elements) - { - /* When the steps above require the UA to clear the stack back to a - table context, it means that the UA must, while the current node is not - a table element or an html element, pop elements from the stack of open - elements. If this causes any elements to be popped from the stack, then - this is a parse error. */ - while (true) { - $node = end($this->stack)->nodeName; - - if (in_array($node, $elements)) { - break; - } else { - array_pop($this->stack); - } - } - } - - private function resetInsertionMode() - { - /* 1. Let last be false. */ - $last = false; - $leng = count($this->stack); - - for ($n = $leng - 1; $n >= 0; $n--) { - /* 2. Let node be the last node in the stack of open elements. */ - $node = $this->stack[$n]; - - /* 3. If node is the first node in the stack of open elements, then - set last to true. If the element whose innerHTML attribute is being - set is neither a td element nor a th element, then set node to the - element whose innerHTML attribute is being set. (innerHTML case) */ - if ($this->stack[0]->isSameNode($node)) { - $last = true; - } - - /* 4. If node is a select element, then switch the insertion mode to - "in select" and abort these steps. (innerHTML case) */ - if ($node->nodeName === 'select') { - $this->mode = self::IN_SELECT; - break; - - /* 5. If node is a td or th element, then switch the insertion mode - to "in cell" and abort these steps. */ - } elseif ($node->nodeName === 'td' || $node->nodeName === 'th') { - $this->mode = self::IN_CELL; - break; - - /* 6. If node is a tr element, then switch the insertion mode to - "in row" and abort these steps. */ - } elseif ($node->nodeName === 'tr') { - $this->mode = self::IN_ROW; - break; - - /* 7. If node is a tbody, thead, or tfoot element, then switch the - insertion mode to "in table body" and abort these steps. */ - } elseif (in_array($node->nodeName, array('tbody', 'thead', 'tfoot'))) { - $this->mode = self::IN_TBODY; - break; - - /* 8. If node is a caption element, then switch the insertion mode - to "in caption" and abort these steps. */ - } elseif ($node->nodeName === 'caption') { - $this->mode = self::IN_CAPTION; - break; - - /* 9. If node is a colgroup element, then switch the insertion mode - to "in column group" and abort these steps. (innerHTML case) */ - } elseif ($node->nodeName === 'colgroup') { - $this->mode = self::IN_CGROUP; - break; - - /* 10. If node is a table element, then switch the insertion mode - to "in table" and abort these steps. */ - } elseif ($node->nodeName === 'table') { - $this->mode = self::IN_TABLE; - break; - - /* 11. If node is a head element, then switch the insertion mode - to "in body" ("in body"! not "in head"!) and abort these steps. - (innerHTML case) */ - } elseif ($node->nodeName === 'head') { - $this->mode = self::IN_BODY; - break; - - /* 12. If node is a body element, then switch the insertion mode to - "in body" and abort these steps. */ - } elseif ($node->nodeName === 'body') { - $this->mode = self::IN_BODY; - break; - - /* 13. If node is a frameset element, then switch the insertion - mode to "in frameset" and abort these steps. (innerHTML case) */ - } elseif ($node->nodeName === 'frameset') { - $this->mode = self::IN_FRAME; - break; - - /* 14. If node is an html element, then: if the head element - pointer is null, switch the insertion mode to "before head", - otherwise, switch the insertion mode to "after head". In either - case, abort these steps. (innerHTML case) */ - } elseif ($node->nodeName === 'html') { - $this->mode = ($this->head_pointer === null) - ? self::BEFOR_HEAD - : self::AFTER_HEAD; - - break; - - /* 15. If last is true, then set the insertion mode to "in body" - and abort these steps. (innerHTML case) */ - } elseif ($last) { - $this->mode = self::IN_BODY; - break; - } - } - } - - private function closeCell() - { - /* If the stack of open elements has a td or th element in table scope, - then act as if an end tag token with that tag name had been seen. */ - foreach (array('td', 'th') as $cell) { - if ($this->elementInScope($cell, true)) { - $this->inCell( - array( - 'name' => $cell, - 'type' => HTML5::ENDTAG - ) - ); - - break; - } - } - } - - public function save() - { - return $this->dom; - } -} +normalize($html, $config, $context); + $new_html = $this->wrapHTML($new_html, $config, $context); + try { + $parser = new HTML5($new_html); + $doc = $parser->save(); + } catch (DOMException $e) { + // Uh oh, it failed. Punt to DirectLex. + $lexer = new HTMLPurifier_Lexer_DirectLex(); + $context->register('PH5PError', $e); // save the error, so we can detect it + return $lexer->tokenizeHTML($html, $config, $context); // use original HTML + } + $tokens = array(); + $this->tokenizeDOM( + $doc->getElementsByTagName('html')->item(0)-> // + getElementsByTagName('body')->item(0) // + , + $tokens + ); + return $tokens; + } +} + +/* + +Copyright 2007 Jeroen van der Meer + +Permission is hereby granted, free of charge, to any person obtaining a +copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be included +in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +*/ + +class HTML5 +{ + private $data; + private $char; + private $EOF; + private $state; + private $tree; + private $token; + private $content_model; + private $escape = false; + private $entities = array( + 'AElig;', + 'AElig', + 'AMP;', + 'AMP', + 'Aacute;', + 'Aacute', + 'Acirc;', + 'Acirc', + 'Agrave;', + 'Agrave', + 'Alpha;', + 'Aring;', + 'Aring', + 'Atilde;', + 'Atilde', + 'Auml;', + 'Auml', + 'Beta;', + 'COPY;', + 'COPY', + 'Ccedil;', + 'Ccedil', + 'Chi;', + 'Dagger;', + 'Delta;', + 'ETH;', + 'ETH', + 'Eacute;', + 'Eacute', + 'Ecirc;', + 'Ecirc', + 'Egrave;', + 'Egrave', + 'Epsilon;', + 'Eta;', + 'Euml;', + 'Euml', + 'GT;', + 'GT', + 'Gamma;', + 'Iacute;', + 'Iacute', + 'Icirc;', + 'Icirc', + 'Igrave;', + 'Igrave', + 'Iota;', + 'Iuml;', + 'Iuml', + 'Kappa;', + 'LT;', + 'LT', + 'Lambda;', + 'Mu;', + 'Ntilde;', + 'Ntilde', + 'Nu;', + 'OElig;', + 'Oacute;', + 'Oacute', + 'Ocirc;', + 'Ocirc', + 'Ograve;', + 'Ograve', + 'Omega;', + 'Omicron;', + 'Oslash;', + 'Oslash', + 'Otilde;', + 'Otilde', + 'Ouml;', + 'Ouml', + 'Phi;', + 'Pi;', + 'Prime;', + 'Psi;', + 'QUOT;', + 'QUOT', + 'REG;', + 'REG', + 'Rho;', + 'Scaron;', + 'Sigma;', + 'THORN;', + 'THORN', + 'TRADE;', + 'Tau;', + 'Theta;', + 'Uacute;', + 'Uacute', + 'Ucirc;', + 'Ucirc', + 'Ugrave;', + 'Ugrave', + 'Upsilon;', + 'Uuml;', + 'Uuml', + 'Xi;', + 'Yacute;', + 'Yacute', + 'Yuml;', + 'Zeta;', + 'aacute;', + 'aacute', + 'acirc;', + 'acirc', + 'acute;', + 'acute', + 'aelig;', + 'aelig', + 'agrave;', + 'agrave', + 'alefsym;', + 'alpha;', + 'amp;', + 'amp', + 'and;', + 'ang;', + 'apos;', + 'aring;', + 'aring', + 'asymp;', + 'atilde;', + 'atilde', + 'auml;', + 'auml', + 'bdquo;', + 'beta;', + 'brvbar;', + 'brvbar', + 'bull;', + 'cap;', + 'ccedil;', + 'ccedil', + 'cedil;', + 'cedil', + 'cent;', + 'cent', + 'chi;', + 'circ;', + 'clubs;', + 'cong;', + 'copy;', + 'copy', + 'crarr;', + 'cup;', + 'curren;', + 'curren', + 'dArr;', + 'dagger;', + 'darr;', + 'deg;', + 'deg', + 'delta;', + 'diams;', + 'divide;', + 'divide', + 'eacute;', + 'eacute', + 'ecirc;', + 'ecirc', + 'egrave;', + 'egrave', + 'empty;', + 'emsp;', + 'ensp;', + 'epsilon;', + 'equiv;', + 'eta;', + 'eth;', + 'eth', + 'euml;', + 'euml', + 'euro;', + 'exist;', + 'fnof;', + 'forall;', + 'frac12;', + 'frac12', + 'frac14;', + 'frac14', + 'frac34;', + 'frac34', + 'frasl;', + 'gamma;', + 'ge;', + 'gt;', + 'gt', + 'hArr;', + 'harr;', + 'hearts;', + 'hellip;', + 'iacute;', + 'iacute', + 'icirc;', + 'icirc', + 'iexcl;', + 'iexcl', + 'igrave;', + 'igrave', + 'image;', + 'infin;', + 'int;', + 'iota;', + 'iquest;', + 'iquest', + 'isin;', + 'iuml;', + 'iuml', + 'kappa;', + 'lArr;', + 'lambda;', + 'lang;', + 'laquo;', + 'laquo', + 'larr;', + 'lceil;', + 'ldquo;', + 'le;', + 'lfloor;', + 'lowast;', + 'loz;', + 'lrm;', + 'lsaquo;', + 'lsquo;', + 'lt;', + 'lt', + 'macr;', + 'macr', + 'mdash;', + 'micro;', + 'micro', + 'middot;', + 'middot', + 'minus;', + 'mu;', + 'nabla;', + 'nbsp;', + 'nbsp', + 'ndash;', + 'ne;', + 'ni;', + 'not;', + 'not', + 'notin;', + 'nsub;', + 'ntilde;', + 'ntilde', + 'nu;', + 'oacute;', + 'oacute', + 'ocirc;', + 'ocirc', + 'oelig;', + 'ograve;', + 'ograve', + 'oline;', + 'omega;', + 'omicron;', + 'oplus;', + 'or;', + 'ordf;', + 'ordf', + 'ordm;', + 'ordm', + 'oslash;', + 'oslash', + 'otilde;', + 'otilde', + 'otimes;', + 'ouml;', + 'ouml', + 'para;', + 'para', + 'part;', + 'permil;', + 'perp;', + 'phi;', + 'pi;', + 'piv;', + 'plusmn;', + 'plusmn', + 'pound;', + 'pound', + 'prime;', + 'prod;', + 'prop;', + 'psi;', + 'quot;', + 'quot', + 'rArr;', + 'radic;', + 'rang;', + 'raquo;', + 'raquo', + 'rarr;', + 'rceil;', + 'rdquo;', + 'real;', + 'reg;', + 'reg', + 'rfloor;', + 'rho;', + 'rlm;', + 'rsaquo;', + 'rsquo;', + 'sbquo;', + 'scaron;', + 'sdot;', + 'sect;', + 'sect', + 'shy;', + 'shy', + 'sigma;', + 'sigmaf;', + 'sim;', + 'spades;', + 'sub;', + 'sube;', + 'sum;', + 'sup1;', + 'sup1', + 'sup2;', + 'sup2', + 'sup3;', + 'sup3', + 'sup;', + 'supe;', + 'szlig;', + 'szlig', + 'tau;', + 'there4;', + 'theta;', + 'thetasym;', + 'thinsp;', + 'thorn;', + 'thorn', + 'tilde;', + 'times;', + 'times', + 'trade;', + 'uArr;', + 'uacute;', + 'uacute', + 'uarr;', + 'ucirc;', + 'ucirc', + 'ugrave;', + 'ugrave', + 'uml;', + 'uml', + 'upsih;', + 'upsilon;', + 'uuml;', + 'uuml', + 'weierp;', + 'xi;', + 'yacute;', + 'yacute', + 'yen;', + 'yen', + 'yuml;', + 'yuml', + 'zeta;', + 'zwj;', + 'zwnj;' + ); + + const PCDATA = 0; + const RCDATA = 1; + const CDATA = 2; + const PLAINTEXT = 3; + + const DOCTYPE = 0; + const STARTTAG = 1; + const ENDTAG = 2; + const COMMENT = 3; + const CHARACTR = 4; + const EOF = 5; + + public function __construct($data) + { + $this->data = $data; + $this->char = -1; + $this->EOF = strlen($data); + $this->tree = new HTML5TreeConstructer; + $this->content_model = self::PCDATA; + + $this->state = 'data'; + + while ($this->state !== null) { + $this->{$this->state . 'State'}(); + } + } + + public function save() + { + return $this->tree->save(); + } + + private function char() + { + return ($this->char < $this->EOF) + ? $this->data[$this->char] + : false; + } + + private function character($s, $l = 0) + { + if ($s + $l < $this->EOF) { + if ($l === 0) { + return $this->data[$s]; + } else { + return substr($this->data, $s, $l); + } + } + } + + private function characters($char_class, $start) + { + return preg_replace('#^([' . $char_class . ']+).*#s', '\\1', substr($this->data, $start)); + } + + private function dataState() + { + // Consume the next input character + $this->char++; + $char = $this->char(); + + if ($char === '&' && ($this->content_model === self::PCDATA || $this->content_model === self::RCDATA)) { + /* U+0026 AMPERSAND (&) + When the content model flag is set to one of the PCDATA or RCDATA + states: switch to the entity data state. Otherwise: treat it as per + the "anything else" entry below. */ + $this->state = 'entityData'; + + } elseif ($char === '-') { + /* If the content model flag is set to either the RCDATA state or + the CDATA state, and the escape flag is false, and there are at + least three characters before this one in the input stream, and the + last four characters in the input stream, including this one, are + U+003C LESS-THAN SIGN, U+0021 EXCLAMATION MARK, U+002D HYPHEN-MINUS, + and U+002D HYPHEN-MINUS (""), + set the escape flag to false. */ + if (($this->content_model === self::RCDATA || + $this->content_model === self::CDATA) && $this->escape === true && + $this->character($this->char, 3) === '-->' + ) { + $this->escape = false; + } + + /* In any case, emit the input character as a character token. + Stay in the data state. */ + $this->emitToken( + array( + 'type' => self::CHARACTR, + 'data' => $char + ) + ); + + } elseif ($this->char === $this->EOF) { + /* EOF + Emit an end-of-file token. */ + $this->EOF(); + + } elseif ($this->content_model === self::PLAINTEXT) { + /* When the content model flag is set to the PLAINTEXT state + THIS DIFFERS GREATLY FROM THE SPEC: Get the remaining characters of + the text and emit it as a character token. */ + $this->emitToken( + array( + 'type' => self::CHARACTR, + 'data' => substr($this->data, $this->char) + ) + ); + + $this->EOF(); + + } else { + /* Anything else + THIS DIFFERS GREATLY FROM THE SPEC: Get as many character that + otherwise would also be treated as a character token and emit it + as a single character token. Stay in the data state. */ + $len = strcspn($this->data, '<&', $this->char); + $char = substr($this->data, $this->char, $len); + $this->char += $len - 1; + + $this->emitToken( + array( + 'type' => self::CHARACTR, + 'data' => $char + ) + ); + + $this->state = 'data'; + } + } + + private function entityDataState() + { + // Attempt to consume an entity. + $entity = $this->entity(); + + // If nothing is returned, emit a U+0026 AMPERSAND character token. + // Otherwise, emit the character token that was returned. + $char = (!$entity) ? '&' : $entity; + $this->emitToken( + array( + 'type' => self::CHARACTR, + 'data' => $char + ) + ); + + // Finally, switch to the data state. + $this->state = 'data'; + } + + private function tagOpenState() + { + switch ($this->content_model) { + case self::RCDATA: + case self::CDATA: + /* If the next input character is a U+002F SOLIDUS (/) character, + consume it and switch to the close tag open state. If the next + input character is not a U+002F SOLIDUS (/) character, emit a + U+003C LESS-THAN SIGN character token and switch to the data + state to process the next input character. */ + if ($this->character($this->char + 1) === '/') { + $this->char++; + $this->state = 'closeTagOpen'; + + } else { + $this->emitToken( + array( + 'type' => self::CHARACTR, + 'data' => '<' + ) + ); + + $this->state = 'data'; + } + break; + + case self::PCDATA: + // If the content model flag is set to the PCDATA state + // Consume the next input character: + $this->char++; + $char = $this->char(); + + if ($char === '!') { + /* U+0021 EXCLAMATION MARK (!) + Switch to the markup declaration open state. */ + $this->state = 'markupDeclarationOpen'; + + } elseif ($char === '/') { + /* U+002F SOLIDUS (/) + Switch to the close tag open state. */ + $this->state = 'closeTagOpen'; + + } elseif (preg_match('/^[A-Za-z]$/', $char)) { + /* U+0041 LATIN LETTER A through to U+005A LATIN LETTER Z + Create a new start tag token, set its tag name to the lowercase + version of the input character (add 0x0020 to the character's code + point), then switch to the tag name state. (Don't emit the token + yet; further details will be filled in before it is emitted.) */ + $this->token = array( + 'name' => strtolower($char), + 'type' => self::STARTTAG, + 'attr' => array() + ); + + $this->state = 'tagName'; + + } elseif ($char === '>') { + /* U+003E GREATER-THAN SIGN (>) + Parse error. Emit a U+003C LESS-THAN SIGN character token and a + U+003E GREATER-THAN SIGN character token. Switch to the data state. */ + $this->emitToken( + array( + 'type' => self::CHARACTR, + 'data' => '<>' + ) + ); + + $this->state = 'data'; + + } elseif ($char === '?') { + /* U+003F QUESTION MARK (?) + Parse error. Switch to the bogus comment state. */ + $this->state = 'bogusComment'; + + } else { + /* Anything else + Parse error. Emit a U+003C LESS-THAN SIGN character token and + reconsume the current input character in the data state. */ + $this->emitToken( + array( + 'type' => self::CHARACTR, + 'data' => '<' + ) + ); + + $this->char--; + $this->state = 'data'; + } + break; + } + } + + private function closeTagOpenState() + { + $next_node = strtolower($this->characters('A-Za-z', $this->char + 1)); + $the_same = count($this->tree->stack) > 0 && $next_node === end($this->tree->stack)->nodeName; + + if (($this->content_model === self::RCDATA || $this->content_model === self::CDATA) && + (!$the_same || ($the_same && (!preg_match( + '/[\t\n\x0b\x0c >\/]/', + $this->character($this->char + 1 + strlen($next_node)) + ) || $this->EOF === $this->char))) + ) { + /* If the content model flag is set to the RCDATA or CDATA states then + examine the next few characters. If they do not match the tag name of + the last start tag token emitted (case insensitively), or if they do but + they are not immediately followed by one of the following characters: + * U+0009 CHARACTER TABULATION + * U+000A LINE FEED (LF) + * U+000B LINE TABULATION + * U+000C FORM FEED (FF) + * U+0020 SPACE + * U+003E GREATER-THAN SIGN (>) + * U+002F SOLIDUS (/) + * EOF + ...then there is a parse error. Emit a U+003C LESS-THAN SIGN character + token, a U+002F SOLIDUS character token, and switch to the data state + to process the next input character. */ + $this->emitToken( + array( + 'type' => self::CHARACTR, + 'data' => 'state = 'data'; + + } else { + /* Otherwise, if the content model flag is set to the PCDATA state, + or if the next few characters do match that tag name, consume the + next input character: */ + $this->char++; + $char = $this->char(); + + if (preg_match('/^[A-Za-z]$/', $char)) { + /* U+0041 LATIN LETTER A through to U+005A LATIN LETTER Z + Create a new end tag token, set its tag name to the lowercase version + of the input character (add 0x0020 to the character's code point), then + switch to the tag name state. (Don't emit the token yet; further details + will be filled in before it is emitted.) */ + $this->token = array( + 'name' => strtolower($char), + 'type' => self::ENDTAG + ); + + $this->state = 'tagName'; + + } elseif ($char === '>') { + /* U+003E GREATER-THAN SIGN (>) + Parse error. Switch to the data state. */ + $this->state = 'data'; + + } elseif ($this->char === $this->EOF) { + /* EOF + Parse error. Emit a U+003C LESS-THAN SIGN character token and a U+002F + SOLIDUS character token. Reconsume the EOF character in the data state. */ + $this->emitToken( + array( + 'type' => self::CHARACTR, + 'data' => 'char--; + $this->state = 'data'; + + } else { + /* Parse error. Switch to the bogus comment state. */ + $this->state = 'bogusComment'; + } + } + } + + private function tagNameState() + { + // Consume the next input character: + $this->char++; + $char = $this->character($this->char); + + if (preg_match('/^[\t\n\x0b\x0c ]$/', $char)) { + /* U+0009 CHARACTER TABULATION + U+000A LINE FEED (LF) + U+000B LINE TABULATION + U+000C FORM FEED (FF) + U+0020 SPACE + Switch to the before attribute name state. */ + $this->state = 'beforeAttributeName'; + + } elseif ($char === '>') { + /* U+003E GREATER-THAN SIGN (>) + Emit the current tag token. Switch to the data state. */ + $this->emitToken($this->token); + $this->state = 'data'; + + } elseif ($this->char === $this->EOF) { + /* EOF + Parse error. Emit the current tag token. Reconsume the EOF + character in the data state. */ + $this->emitToken($this->token); + + $this->char--; + $this->state = 'data'; + + } elseif ($char === '/') { + /* U+002F SOLIDUS (/) + Parse error unless this is a permitted slash. Switch to the before + attribute name state. */ + $this->state = 'beforeAttributeName'; + + } else { + /* Anything else + Append the current input character to the current tag token's tag name. + Stay in the tag name state. */ + $this->token['name'] .= strtolower($char); + $this->state = 'tagName'; + } + } + + private function beforeAttributeNameState() + { + // Consume the next input character: + $this->char++; + $char = $this->character($this->char); + + if (preg_match('/^[\t\n\x0b\x0c ]$/', $char)) { + /* U+0009 CHARACTER TABULATION + U+000A LINE FEED (LF) + U+000B LINE TABULATION + U+000C FORM FEED (FF) + U+0020 SPACE + Stay in the before attribute name state. */ + $this->state = 'beforeAttributeName'; + + } elseif ($char === '>') { + /* U+003E GREATER-THAN SIGN (>) + Emit the current tag token. Switch to the data state. */ + $this->emitToken($this->token); + $this->state = 'data'; + + } elseif ($char === '/') { + /* U+002F SOLIDUS (/) + Parse error unless this is a permitted slash. Stay in the before + attribute name state. */ + $this->state = 'beforeAttributeName'; + + } elseif ($this->char === $this->EOF) { + /* EOF + Parse error. Emit the current tag token. Reconsume the EOF + character in the data state. */ + $this->emitToken($this->token); + + $this->char--; + $this->state = 'data'; + + } else { + /* Anything else + Start a new attribute in the current tag token. Set that attribute's + name to the current input character, and its value to the empty string. + Switch to the attribute name state. */ + $this->token['attr'][] = array( + 'name' => strtolower($char), + 'value' => null + ); + + $this->state = 'attributeName'; + } + } + + private function attributeNameState() + { + // Consume the next input character: + $this->char++; + $char = $this->character($this->char); + + if (preg_match('/^[\t\n\x0b\x0c ]$/', $char)) { + /* U+0009 CHARACTER TABULATION + U+000A LINE FEED (LF) + U+000B LINE TABULATION + U+000C FORM FEED (FF) + U+0020 SPACE + Stay in the before attribute name state. */ + $this->state = 'afterAttributeName'; + + } elseif ($char === '=') { + /* U+003D EQUALS SIGN (=) + Switch to the before attribute value state. */ + $this->state = 'beforeAttributeValue'; + + } elseif ($char === '>') { + /* U+003E GREATER-THAN SIGN (>) + Emit the current tag token. Switch to the data state. */ + $this->emitToken($this->token); + $this->state = 'data'; + + } elseif ($char === '/' && $this->character($this->char + 1) !== '>') { + /* U+002F SOLIDUS (/) + Parse error unless this is a permitted slash. Switch to the before + attribute name state. */ + $this->state = 'beforeAttributeName'; + + } elseif ($this->char === $this->EOF) { + /* EOF + Parse error. Emit the current tag token. Reconsume the EOF + character in the data state. */ + $this->emitToken($this->token); + + $this->char--; + $this->state = 'data'; + + } else { + /* Anything else + Append the current input character to the current attribute's name. + Stay in the attribute name state. */ + $last = count($this->token['attr']) - 1; + $this->token['attr'][$last]['name'] .= strtolower($char); + + $this->state = 'attributeName'; + } + } + + private function afterAttributeNameState() + { + // Consume the next input character: + $this->char++; + $char = $this->character($this->char); + + if (preg_match('/^[\t\n\x0b\x0c ]$/', $char)) { + /* U+0009 CHARACTER TABULATION + U+000A LINE FEED (LF) + U+000B LINE TABULATION + U+000C FORM FEED (FF) + U+0020 SPACE + Stay in the after attribute name state. */ + $this->state = 'afterAttributeName'; + + } elseif ($char === '=') { + /* U+003D EQUALS SIGN (=) + Switch to the before attribute value state. */ + $this->state = 'beforeAttributeValue'; + + } elseif ($char === '>') { + /* U+003E GREATER-THAN SIGN (>) + Emit the current tag token. Switch to the data state. */ + $this->emitToken($this->token); + $this->state = 'data'; + + } elseif ($char === '/' && $this->character($this->char + 1) !== '>') { + /* U+002F SOLIDUS (/) + Parse error unless this is a permitted slash. Switch to the + before attribute name state. */ + $this->state = 'beforeAttributeName'; + + } elseif ($this->char === $this->EOF) { + /* EOF + Parse error. Emit the current tag token. Reconsume the EOF + character in the data state. */ + $this->emitToken($this->token); + + $this->char--; + $this->state = 'data'; + + } else { + /* Anything else + Start a new attribute in the current tag token. Set that attribute's + name to the current input character, and its value to the empty string. + Switch to the attribute name state. */ + $this->token['attr'][] = array( + 'name' => strtolower($char), + 'value' => null + ); + + $this->state = 'attributeName'; + } + } + + private function beforeAttributeValueState() + { + // Consume the next input character: + $this->char++; + $char = $this->character($this->char); + + if (preg_match('/^[\t\n\x0b\x0c ]$/', $char)) { + /* U+0009 CHARACTER TABULATION + U+000A LINE FEED (LF) + U+000B LINE TABULATION + U+000C FORM FEED (FF) + U+0020 SPACE + Stay in the before attribute value state. */ + $this->state = 'beforeAttributeValue'; + + } elseif ($char === '"') { + /* U+0022 QUOTATION MARK (") + Switch to the attribute value (double-quoted) state. */ + $this->state = 'attributeValueDoubleQuoted'; + + } elseif ($char === '&') { + /* U+0026 AMPERSAND (&) + Switch to the attribute value (unquoted) state and reconsume + this input character. */ + $this->char--; + $this->state = 'attributeValueUnquoted'; + + } elseif ($char === '\'') { + /* U+0027 APOSTROPHE (') + Switch to the attribute value (single-quoted) state. */ + $this->state = 'attributeValueSingleQuoted'; + + } elseif ($char === '>') { + /* U+003E GREATER-THAN SIGN (>) + Emit the current tag token. Switch to the data state. */ + $this->emitToken($this->token); + $this->state = 'data'; + + } else { + /* Anything else + Append the current input character to the current attribute's value. + Switch to the attribute value (unquoted) state. */ + $last = count($this->token['attr']) - 1; + $this->token['attr'][$last]['value'] .= $char; + + $this->state = 'attributeValueUnquoted'; + } + } + + private function attributeValueDoubleQuotedState() + { + // Consume the next input character: + $this->char++; + $char = $this->character($this->char); + + if ($char === '"') { + /* U+0022 QUOTATION MARK (") + Switch to the before attribute name state. */ + $this->state = 'beforeAttributeName'; + + } elseif ($char === '&') { + /* U+0026 AMPERSAND (&) + Switch to the entity in attribute value state. */ + $this->entityInAttributeValueState('double'); + + } elseif ($this->char === $this->EOF) { + /* EOF + Parse error. Emit the current tag token. Reconsume the character + in the data state. */ + $this->emitToken($this->token); + + $this->char--; + $this->state = 'data'; + + } else { + /* Anything else + Append the current input character to the current attribute's value. + Stay in the attribute value (double-quoted) state. */ + $last = count($this->token['attr']) - 1; + $this->token['attr'][$last]['value'] .= $char; + + $this->state = 'attributeValueDoubleQuoted'; + } + } + + private function attributeValueSingleQuotedState() + { + // Consume the next input character: + $this->char++; + $char = $this->character($this->char); + + if ($char === '\'') { + /* U+0022 QUOTATION MARK (') + Switch to the before attribute name state. */ + $this->state = 'beforeAttributeName'; + + } elseif ($char === '&') { + /* U+0026 AMPERSAND (&) + Switch to the entity in attribute value state. */ + $this->entityInAttributeValueState('single'); + + } elseif ($this->char === $this->EOF) { + /* EOF + Parse error. Emit the current tag token. Reconsume the character + in the data state. */ + $this->emitToken($this->token); + + $this->char--; + $this->state = 'data'; + + } else { + /* Anything else + Append the current input character to the current attribute's value. + Stay in the attribute value (single-quoted) state. */ + $last = count($this->token['attr']) - 1; + $this->token['attr'][$last]['value'] .= $char; + + $this->state = 'attributeValueSingleQuoted'; + } + } + + private function attributeValueUnquotedState() + { + // Consume the next input character: + $this->char++; + $char = $this->character($this->char); + + if (preg_match('/^[\t\n\x0b\x0c ]$/', $char)) { + /* U+0009 CHARACTER TABULATION + U+000A LINE FEED (LF) + U+000B LINE TABULATION + U+000C FORM FEED (FF) + U+0020 SPACE + Switch to the before attribute name state. */ + $this->state = 'beforeAttributeName'; + + } elseif ($char === '&') { + /* U+0026 AMPERSAND (&) + Switch to the entity in attribute value state. */ + $this->entityInAttributeValueState(); + + } elseif ($char === '>') { + /* U+003E GREATER-THAN SIGN (>) + Emit the current tag token. Switch to the data state. */ + $this->emitToken($this->token); + $this->state = 'data'; + + } else { + /* Anything else + Append the current input character to the current attribute's value. + Stay in the attribute value (unquoted) state. */ + $last = count($this->token['attr']) - 1; + $this->token['attr'][$last]['value'] .= $char; + + $this->state = 'attributeValueUnquoted'; + } + } + + private function entityInAttributeValueState() + { + // Attempt to consume an entity. + $entity = $this->entity(); + + // If nothing is returned, append a U+0026 AMPERSAND character to the + // current attribute's value. Otherwise, emit the character token that + // was returned. + $char = (!$entity) + ? '&' + : $entity; + + $last = count($this->token['attr']) - 1; + $this->token['attr'][$last]['value'] .= $char; + } + + private function bogusCommentState() + { + /* Consume every character up to the first U+003E GREATER-THAN SIGN + character (>) or the end of the file (EOF), whichever comes first. Emit + a comment token whose data is the concatenation of all the characters + starting from and including the character that caused the state machine + to switch into the bogus comment state, up to and including the last + consumed character before the U+003E character, if any, or up to the + end of the file otherwise. (If the comment was started by the end of + the file (EOF), the token is empty.) */ + $data = $this->characters('^>', $this->char); + $this->emitToken( + array( + 'data' => $data, + 'type' => self::COMMENT + ) + ); + + $this->char += strlen($data); + + /* Switch to the data state. */ + $this->state = 'data'; + + /* If the end of the file was reached, reconsume the EOF character. */ + if ($this->char === $this->EOF) { + $this->char = $this->EOF - 1; + } + } + + private function markupDeclarationOpenState() + { + /* If the next two characters are both U+002D HYPHEN-MINUS (-) + characters, consume those two characters, create a comment token whose + data is the empty string, and switch to the comment state. */ + if ($this->character($this->char + 1, 2) === '--') { + $this->char += 2; + $this->state = 'comment'; + $this->token = array( + 'data' => null, + 'type' => self::COMMENT + ); + + /* Otherwise if the next seven chacacters are a case-insensitive match + for the word "DOCTYPE", then consume those characters and switch to the + DOCTYPE state. */ + } elseif (strtolower($this->character($this->char + 1, 7)) === 'doctype') { + $this->char += 7; + $this->state = 'doctype'; + + /* Otherwise, is is a parse error. Switch to the bogus comment state. + The next character that is consumed, if any, is the first character + that will be in the comment. */ + } else { + $this->char++; + $this->state = 'bogusComment'; + } + } + + private function commentState() + { + /* Consume the next input character: */ + $this->char++; + $char = $this->char(); + + /* U+002D HYPHEN-MINUS (-) */ + if ($char === '-') { + /* Switch to the comment dash state */ + $this->state = 'commentDash'; + + /* EOF */ + } elseif ($this->char === $this->EOF) { + /* Parse error. Emit the comment token. Reconsume the EOF character + in the data state. */ + $this->emitToken($this->token); + $this->char--; + $this->state = 'data'; + + /* Anything else */ + } else { + /* Append the input character to the comment token's data. Stay in + the comment state. */ + $this->token['data'] .= $char; + } + } + + private function commentDashState() + { + /* Consume the next input character: */ + $this->char++; + $char = $this->char(); + + /* U+002D HYPHEN-MINUS (-) */ + if ($char === '-') { + /* Switch to the comment end state */ + $this->state = 'commentEnd'; + + /* EOF */ + } elseif ($this->char === $this->EOF) { + /* Parse error. Emit the comment token. Reconsume the EOF character + in the data state. */ + $this->emitToken($this->token); + $this->char--; + $this->state = 'data'; + + /* Anything else */ + } else { + /* Append a U+002D HYPHEN-MINUS (-) character and the input + character to the comment token's data. Switch to the comment state. */ + $this->token['data'] .= '-' . $char; + $this->state = 'comment'; + } + } + + private function commentEndState() + { + /* Consume the next input character: */ + $this->char++; + $char = $this->char(); + + if ($char === '>') { + $this->emitToken($this->token); + $this->state = 'data'; + + } elseif ($char === '-') { + $this->token['data'] .= '-'; + + } elseif ($this->char === $this->EOF) { + $this->emitToken($this->token); + $this->char--; + $this->state = 'data'; + + } else { + $this->token['data'] .= '--' . $char; + $this->state = 'comment'; + } + } + + private function doctypeState() + { + /* Consume the next input character: */ + $this->char++; + $char = $this->char(); + + if (preg_match('/^[\t\n\x0b\x0c ]$/', $char)) { + $this->state = 'beforeDoctypeName'; + + } else { + $this->char--; + $this->state = 'beforeDoctypeName'; + } + } + + private function beforeDoctypeNameState() + { + /* Consume the next input character: */ + $this->char++; + $char = $this->char(); + + if (preg_match('/^[\t\n\x0b\x0c ]$/', $char)) { + // Stay in the before DOCTYPE name state. + + } elseif (preg_match('/^[a-z]$/', $char)) { + $this->token = array( + 'name' => strtoupper($char), + 'type' => self::DOCTYPE, + 'error' => true + ); + + $this->state = 'doctypeName'; + + } elseif ($char === '>') { + $this->emitToken( + array( + 'name' => null, + 'type' => self::DOCTYPE, + 'error' => true + ) + ); + + $this->state = 'data'; + + } elseif ($this->char === $this->EOF) { + $this->emitToken( + array( + 'name' => null, + 'type' => self::DOCTYPE, + 'error' => true + ) + ); + + $this->char--; + $this->state = 'data'; + + } else { + $this->token = array( + 'name' => $char, + 'type' => self::DOCTYPE, + 'error' => true + ); + + $this->state = 'doctypeName'; + } + } + + private function doctypeNameState() + { + /* Consume the next input character: */ + $this->char++; + $char = $this->char(); + + if (preg_match('/^[\t\n\x0b\x0c ]$/', $char)) { + $this->state = 'AfterDoctypeName'; + + } elseif ($char === '>') { + $this->emitToken($this->token); + $this->state = 'data'; + + } elseif (preg_match('/^[a-z]$/', $char)) { + $this->token['name'] .= strtoupper($char); + + } elseif ($this->char === $this->EOF) { + $this->emitToken($this->token); + $this->char--; + $this->state = 'data'; + + } else { + $this->token['name'] .= $char; + } + + $this->token['error'] = ($this->token['name'] === 'HTML') + ? false + : true; + } + + private function afterDoctypeNameState() + { + /* Consume the next input character: */ + $this->char++; + $char = $this->char(); + + if (preg_match('/^[\t\n\x0b\x0c ]$/', $char)) { + // Stay in the DOCTYPE name state. + + } elseif ($char === '>') { + $this->emitToken($this->token); + $this->state = 'data'; + + } elseif ($this->char === $this->EOF) { + $this->emitToken($this->token); + $this->char--; + $this->state = 'data'; + + } else { + $this->token['error'] = true; + $this->state = 'bogusDoctype'; + } + } + + private function bogusDoctypeState() + { + /* Consume the next input character: */ + $this->char++; + $char = $this->char(); + + if ($char === '>') { + $this->emitToken($this->token); + $this->state = 'data'; + + } elseif ($this->char === $this->EOF) { + $this->emitToken($this->token); + $this->char--; + $this->state = 'data'; + + } else { + // Stay in the bogus DOCTYPE state. + } + } + + private function entity() + { + $start = $this->char; + + // This section defines how to consume an entity. This definition is + // used when parsing entities in text and in attributes. + + // The behaviour depends on the identity of the next character (the + // one immediately after the U+0026 AMPERSAND character): + + switch ($this->character($this->char + 1)) { + // U+0023 NUMBER SIGN (#) + case '#': + + // The behaviour further depends on the character after the + // U+0023 NUMBER SIGN: + switch ($this->character($this->char + 1)) { + // U+0078 LATIN SMALL LETTER X + // U+0058 LATIN CAPITAL LETTER X + case 'x': + case 'X': + // Follow the steps below, but using the range of + // characters U+0030 DIGIT ZERO through to U+0039 DIGIT + // NINE, U+0061 LATIN SMALL LETTER A through to U+0066 + // LATIN SMALL LETTER F, and U+0041 LATIN CAPITAL LETTER + // A, through to U+0046 LATIN CAPITAL LETTER F (in other + // words, 0-9, A-F, a-f). + $char = 1; + $char_class = '0-9A-Fa-f'; + break; + + // Anything else + default: + // Follow the steps below, but using the range of + // characters U+0030 DIGIT ZERO through to U+0039 DIGIT + // NINE (i.e. just 0-9). + $char = 0; + $char_class = '0-9'; + break; + } + + // Consume as many characters as match the range of characters + // given above. + $this->char++; + $e_name = $this->characters($char_class, $this->char + $char + 1); + $entity = $this->character($start, $this->char); + $cond = strlen($e_name) > 0; + + // The rest of the parsing happens bellow. + break; + + // Anything else + default: + // Consume the maximum number of characters possible, with the + // consumed characters case-sensitively matching one of the + // identifiers in the first column of the entities table. + $e_name = $this->characters('0-9A-Za-z;', $this->char + 1); + $len = strlen($e_name); + + for ($c = 1; $c <= $len; $c++) { + $id = substr($e_name, 0, $c); + $this->char++; + + if (in_array($id, $this->entities)) { + if ($e_name[$c - 1] !== ';') { + if ($c < $len && $e_name[$c] == ';') { + $this->char++; // consume extra semicolon + } + } + $entity = $id; + break; + } + } + + $cond = isset($entity); + // The rest of the parsing happens bellow. + break; + } + + if (!$cond) { + // If no match can be made, then this is a parse error. No + // characters are consumed, and nothing is returned. + $this->char = $start; + return false; + } + + // Return a character token for the character corresponding to the + // entity name (as given by the second column of the entities table). + return html_entity_decode('&' . $entity . ';', ENT_QUOTES, 'UTF-8'); + } + + private function emitToken($token) + { + $emit = $this->tree->emitToken($token); + + if (is_int($emit)) { + $this->content_model = $emit; + + } elseif ($token['type'] === self::ENDTAG) { + $this->content_model = self::PCDATA; + } + } + + private function EOF() + { + $this->state = null; + $this->tree->emitToken( + array( + 'type' => self::EOF + ) + ); + } +} + +class HTML5TreeConstructer +{ + public $stack = array(); + + private $phase; + private $mode; + private $dom; + private $foster_parent = null; + private $a_formatting = array(); + + private $head_pointer = null; + private $form_pointer = null; + + private $scoping = array('button', 'caption', 'html', 'marquee', 'object', 'table', 'td', 'th'); + private $formatting = array( + 'a', + 'b', + 'big', + 'em', + 'font', + 'i', + 'nobr', + 's', + 'small', + 'strike', + 'strong', + 'tt', + 'u' + ); + private $special = array( + 'address', + 'area', + 'base', + 'basefont', + 'bgsound', + 'blockquote', + 'body', + 'br', + 'center', + 'col', + 'colgroup', + 'dd', + 'dir', + 'div', + 'dl', + 'dt', + 'embed', + 'fieldset', + 'form', + 'frame', + 'frameset', + 'h1', + 'h2', + 'h3', + 'h4', + 'h5', + 'h6', + 'head', + 'hr', + 'iframe', + 'image', + 'img', + 'input', + 'isindex', + 'li', + 'link', + 'listing', + 'menu', + 'meta', + 'noembed', + 'noframes', + 'noscript', + 'ol', + 'optgroup', + 'option', + 'p', + 'param', + 'plaintext', + 'pre', + 'script', + 'select', + 'spacer', + 'style', + 'tbody', + 'textarea', + 'tfoot', + 'thead', + 'title', + 'tr', + 'ul', + 'wbr' + ); + + // The different phases. + const INIT_PHASE = 0; + const ROOT_PHASE = 1; + const MAIN_PHASE = 2; + const END_PHASE = 3; + + // The different insertion modes for the main phase. + const BEFOR_HEAD = 0; + const IN_HEAD = 1; + const AFTER_HEAD = 2; + const IN_BODY = 3; + const IN_TABLE = 4; + const IN_CAPTION = 5; + const IN_CGROUP = 6; + const IN_TBODY = 7; + const IN_ROW = 8; + const IN_CELL = 9; + const IN_SELECT = 10; + const AFTER_BODY = 11; + const IN_FRAME = 12; + const AFTR_FRAME = 13; + + // The different types of elements. + const SPECIAL = 0; + const SCOPING = 1; + const FORMATTING = 2; + const PHRASING = 3; + + const MARKER = 0; + + public function __construct() + { + $this->phase = self::INIT_PHASE; + $this->mode = self::BEFOR_HEAD; + $this->dom = new DOMDocument; + + $this->dom->encoding = 'UTF-8'; + $this->dom->preserveWhiteSpace = true; + $this->dom->substituteEntities = true; + $this->dom->strictErrorChecking = false; + } + + // Process tag tokens + public function emitToken($token) + { + switch ($this->phase) { + case self::INIT_PHASE: + return $this->initPhase($token); + break; + case self::ROOT_PHASE: + return $this->rootElementPhase($token); + break; + case self::MAIN_PHASE: + return $this->mainPhase($token); + break; + case self::END_PHASE : + return $this->trailingEndPhase($token); + break; + } + } + + private function initPhase($token) + { + /* Initially, the tree construction stage must handle each token + emitted from the tokenisation stage as follows: */ + + /* A DOCTYPE token that is marked as being in error + A comment token + A start tag token + An end tag token + A character token that is not one of one of U+0009 CHARACTER TABULATION, + U+000A LINE FEED (LF), U+000B LINE TABULATION, U+000C FORM FEED (FF), + or U+0020 SPACE + An end-of-file token */ + if ((isset($token['error']) && $token['error']) || + $token['type'] === HTML5::COMMENT || + $token['type'] === HTML5::STARTTAG || + $token['type'] === HTML5::ENDTAG || + $token['type'] === HTML5::EOF || + ($token['type'] === HTML5::CHARACTR && isset($token['data']) && + !preg_match('/^[\t\n\x0b\x0c ]+$/', $token['data'])) + ) { + /* This specification does not define how to handle this case. In + particular, user agents may ignore the entirety of this specification + altogether for such documents, and instead invoke special parse modes + with a greater emphasis on backwards compatibility. */ + + $this->phase = self::ROOT_PHASE; + return $this->rootElementPhase($token); + + /* A DOCTYPE token marked as being correct */ + } elseif (isset($token['error']) && !$token['error']) { + /* Append a DocumentType node to the Document node, with the name + attribute set to the name given in the DOCTYPE token (which will be + "HTML"), and the other attributes specific to DocumentType objects + set to null, empty lists, or the empty string as appropriate. */ + $doctype = new DOMDocumentType(null, null, 'HTML'); + + /* Then, switch to the root element phase of the tree construction + stage. */ + $this->phase = self::ROOT_PHASE; + + /* A character token that is one of one of U+0009 CHARACTER TABULATION, + U+000A LINE FEED (LF), U+000B LINE TABULATION, U+000C FORM FEED (FF), + or U+0020 SPACE */ + } elseif (isset($token['data']) && preg_match( + '/^[\t\n\x0b\x0c ]+$/', + $token['data'] + ) + ) { + /* Append that character to the Document node. */ + $text = $this->dom->createTextNode($token['data']); + $this->dom->appendChild($text); + } + } + + private function rootElementPhase($token) + { + /* After the initial phase, as each token is emitted from the tokenisation + stage, it must be processed as described in this section. */ + + /* A DOCTYPE token */ + if ($token['type'] === HTML5::DOCTYPE) { + // Parse error. Ignore the token. + + /* A comment token */ + } elseif ($token['type'] === HTML5::COMMENT) { + /* Append a Comment node to the Document object with the data + attribute set to the data given in the comment token. */ + $comment = $this->dom->createComment($token['data']); + $this->dom->appendChild($comment); + + /* A character token that is one of one of U+0009 CHARACTER TABULATION, + U+000A LINE FEED (LF), U+000B LINE TABULATION, U+000C FORM FEED (FF), + or U+0020 SPACE */ + } elseif ($token['type'] === HTML5::CHARACTR && + preg_match('/^[\t\n\x0b\x0c ]+$/', $token['data']) + ) { + /* Append that character to the Document node. */ + $text = $this->dom->createTextNode($token['data']); + $this->dom->appendChild($text); + + /* A character token that is not one of U+0009 CHARACTER TABULATION, + U+000A LINE FEED (LF), U+000B LINE TABULATION, U+000C FORM FEED + (FF), or U+0020 SPACE + A start tag token + An end tag token + An end-of-file token */ + } elseif (($token['type'] === HTML5::CHARACTR && + !preg_match('/^[\t\n\x0b\x0c ]+$/', $token['data'])) || + $token['type'] === HTML5::STARTTAG || + $token['type'] === HTML5::ENDTAG || + $token['type'] === HTML5::EOF + ) { + /* Create an HTMLElement node with the tag name html, in the HTML + namespace. Append it to the Document object. Switch to the main + phase and reprocess the current token. */ + $html = $this->dom->createElement('html'); + $this->dom->appendChild($html); + $this->stack[] = $html; + + $this->phase = self::MAIN_PHASE; + return $this->mainPhase($token); + } + } + + private function mainPhase($token) + { + /* Tokens in the main phase must be handled as follows: */ + + /* A DOCTYPE token */ + if ($token['type'] === HTML5::DOCTYPE) { + // Parse error. Ignore the token. + + /* A start tag token with the tag name "html" */ + } elseif ($token['type'] === HTML5::STARTTAG && $token['name'] === 'html') { + /* If this start tag token was not the first start tag token, then + it is a parse error. */ + + /* For each attribute on the token, check to see if the attribute + is already present on the top element of the stack of open elements. + If it is not, add the attribute and its corresponding value to that + element. */ + foreach ($token['attr'] as $attr) { + if (!$this->stack[0]->hasAttribute($attr['name'])) { + $this->stack[0]->setAttribute($attr['name'], $attr['value']); + } + } + + /* An end-of-file token */ + } elseif ($token['type'] === HTML5::EOF) { + /* Generate implied end tags. */ + $this->generateImpliedEndTags(); + + /* Anything else. */ + } else { + /* Depends on the insertion mode: */ + switch ($this->mode) { + case self::BEFOR_HEAD: + return $this->beforeHead($token); + break; + case self::IN_HEAD: + return $this->inHead($token); + break; + case self::AFTER_HEAD: + return $this->afterHead($token); + break; + case self::IN_BODY: + return $this->inBody($token); + break; + case self::IN_TABLE: + return $this->inTable($token); + break; + case self::IN_CAPTION: + return $this->inCaption($token); + break; + case self::IN_CGROUP: + return $this->inColumnGroup($token); + break; + case self::IN_TBODY: + return $this->inTableBody($token); + break; + case self::IN_ROW: + return $this->inRow($token); + break; + case self::IN_CELL: + return $this->inCell($token); + break; + case self::IN_SELECT: + return $this->inSelect($token); + break; + case self::AFTER_BODY: + return $this->afterBody($token); + break; + case self::IN_FRAME: + return $this->inFrameset($token); + break; + case self::AFTR_FRAME: + return $this->afterFrameset($token); + break; + case self::END_PHASE: + return $this->trailingEndPhase($token); + break; + } + } + } + + private function beforeHead($token) + { + /* Handle the token as follows: */ + + /* A character token that is one of one of U+0009 CHARACTER TABULATION, + U+000A LINE FEED (LF), U+000B LINE TABULATION, U+000C FORM FEED (FF), + or U+0020 SPACE */ + if ($token['type'] === HTML5::CHARACTR && + preg_match('/^[\t\n\x0b\x0c ]+$/', $token['data']) + ) { + /* Append the character to the current node. */ + $this->insertText($token['data']); + + /* A comment token */ + } elseif ($token['type'] === HTML5::COMMENT) { + /* Append a Comment node to the current node with the data attribute + set to the data given in the comment token. */ + $this->insertComment($token['data']); + + /* A start tag token with the tag name "head" */ + } elseif ($token['type'] === HTML5::STARTTAG && $token['name'] === 'head') { + /* Create an element for the token, append the new element to the + current node and push it onto the stack of open elements. */ + $element = $this->insertElement($token); + + /* Set the head element pointer to this new element node. */ + $this->head_pointer = $element; + + /* Change the insertion mode to "in head". */ + $this->mode = self::IN_HEAD; + + /* A start tag token whose tag name is one of: "base", "link", "meta", + "script", "style", "title". Or an end tag with the tag name "html". + Or a character token that is not one of U+0009 CHARACTER TABULATION, + U+000A LINE FEED (LF), U+000B LINE TABULATION, U+000C FORM FEED (FF), + or U+0020 SPACE. Or any other start tag token */ + } elseif ($token['type'] === HTML5::STARTTAG || + ($token['type'] === HTML5::ENDTAG && $token['name'] === 'html') || + ($token['type'] === HTML5::CHARACTR && !preg_match( + '/^[\t\n\x0b\x0c ]$/', + $token['data'] + )) + ) { + /* Act as if a start tag token with the tag name "head" and no + attributes had been seen, then reprocess the current token. */ + $this->beforeHead( + array( + 'name' => 'head', + 'type' => HTML5::STARTTAG, + 'attr' => array() + ) + ); + + return $this->inHead($token); + + /* Any other end tag */ + } elseif ($token['type'] === HTML5::ENDTAG) { + /* Parse error. Ignore the token. */ + } + } + + private function inHead($token) + { + /* Handle the token as follows: */ + + /* A character token that is one of one of U+0009 CHARACTER TABULATION, + U+000A LINE FEED (LF), U+000B LINE TABULATION, U+000C FORM FEED (FF), + or U+0020 SPACE. + + THIS DIFFERS FROM THE SPEC: If the current node is either a title, style + or script element, append the character to the current node regardless + of its content. */ + if (($token['type'] === HTML5::CHARACTR && + preg_match('/^[\t\n\x0b\x0c ]+$/', $token['data'])) || ( + $token['type'] === HTML5::CHARACTR && in_array( + end($this->stack)->nodeName, + array('title', 'style', 'script') + )) + ) { + /* Append the character to the current node. */ + $this->insertText($token['data']); + + /* A comment token */ + } elseif ($token['type'] === HTML5::COMMENT) { + /* Append a Comment node to the current node with the data attribute + set to the data given in the comment token. */ + $this->insertComment($token['data']); + + } elseif ($token['type'] === HTML5::ENDTAG && + in_array($token['name'], array('title', 'style', 'script')) + ) { + array_pop($this->stack); + return HTML5::PCDATA; + + /* A start tag with the tag name "title" */ + } elseif ($token['type'] === HTML5::STARTTAG && $token['name'] === 'title') { + /* Create an element for the token and append the new element to the + node pointed to by the head element pointer, or, if that is null + (innerHTML case), to the current node. */ + if ($this->head_pointer !== null) { + $element = $this->insertElement($token, false); + $this->head_pointer->appendChild($element); + + } else { + $element = $this->insertElement($token); + } + + /* Switch the tokeniser's content model flag to the RCDATA state. */ + return HTML5::RCDATA; + + /* A start tag with the tag name "style" */ + } elseif ($token['type'] === HTML5::STARTTAG && $token['name'] === 'style') { + /* Create an element for the token and append the new element to the + node pointed to by the head element pointer, or, if that is null + (innerHTML case), to the current node. */ + if ($this->head_pointer !== null) { + $element = $this->insertElement($token, false); + $this->head_pointer->appendChild($element); + + } else { + $this->insertElement($token); + } + + /* Switch the tokeniser's content model flag to the CDATA state. */ + return HTML5::CDATA; + + /* A start tag with the tag name "script" */ + } elseif ($token['type'] === HTML5::STARTTAG && $token['name'] === 'script') { + /* Create an element for the token. */ + $element = $this->insertElement($token, false); + $this->head_pointer->appendChild($element); + + /* Switch the tokeniser's content model flag to the CDATA state. */ + return HTML5::CDATA; + + /* A start tag with the tag name "base", "link", or "meta" */ + } elseif ($token['type'] === HTML5::STARTTAG && in_array( + $token['name'], + array('base', 'link', 'meta') + ) + ) { + /* Create an element for the token and append the new element to the + node pointed to by the head element pointer, or, if that is null + (innerHTML case), to the current node. */ + if ($this->head_pointer !== null) { + $element = $this->insertElement($token, false); + $this->head_pointer->appendChild($element); + array_pop($this->stack); + + } else { + $this->insertElement($token); + } + + /* An end tag with the tag name "head" */ + } elseif ($token['type'] === HTML5::ENDTAG && $token['name'] === 'head') { + /* If the current node is a head element, pop the current node off + the stack of open elements. */ + if ($this->head_pointer->isSameNode(end($this->stack))) { + array_pop($this->stack); + + /* Otherwise, this is a parse error. */ + } else { + // k + } + + /* Change the insertion mode to "after head". */ + $this->mode = self::AFTER_HEAD; + + /* A start tag with the tag name "head" or an end tag except "html". */ + } elseif (($token['type'] === HTML5::STARTTAG && $token['name'] === 'head') || + ($token['type'] === HTML5::ENDTAG && $token['name'] !== 'html') + ) { + // Parse error. Ignore the token. + + /* Anything else */ + } else { + /* If the current node is a head element, act as if an end tag + token with the tag name "head" had been seen. */ + if ($this->head_pointer->isSameNode(end($this->stack))) { + $this->inHead( + array( + 'name' => 'head', + 'type' => HTML5::ENDTAG + ) + ); + + /* Otherwise, change the insertion mode to "after head". */ + } else { + $this->mode = self::AFTER_HEAD; + } + + /* Then, reprocess the current token. */ + return $this->afterHead($token); + } + } + + private function afterHead($token) + { + /* Handle the token as follows: */ + + /* A character token that is one of one of U+0009 CHARACTER TABULATION, + U+000A LINE FEED (LF), U+000B LINE TABULATION, U+000C FORM FEED (FF), + or U+0020 SPACE */ + if ($token['type'] === HTML5::CHARACTR && + preg_match('/^[\t\n\x0b\x0c ]+$/', $token['data']) + ) { + /* Append the character to the current node. */ + $this->insertText($token['data']); + + /* A comment token */ + } elseif ($token['type'] === HTML5::COMMENT) { + /* Append a Comment node to the current node with the data attribute + set to the data given in the comment token. */ + $this->insertComment($token['data']); + + /* A start tag token with the tag name "body" */ + } elseif ($token['type'] === HTML5::STARTTAG && $token['name'] === 'body') { + /* Insert a body element for the token. */ + $this->insertElement($token); + + /* Change the insertion mode to "in body". */ + $this->mode = self::IN_BODY; + + /* A start tag token with the tag name "frameset" */ + } elseif ($token['type'] === HTML5::STARTTAG && $token['name'] === 'frameset') { + /* Insert a frameset element for the token. */ + $this->insertElement($token); + + /* Change the insertion mode to "in frameset". */ + $this->mode = self::IN_FRAME; + + /* A start tag token whose tag name is one of: "base", "link", "meta", + "script", "style", "title" */ + } elseif ($token['type'] === HTML5::STARTTAG && in_array( + $token['name'], + array('base', 'link', 'meta', 'script', 'style', 'title') + ) + ) { + /* Parse error. Switch the insertion mode back to "in head" and + reprocess the token. */ + $this->mode = self::IN_HEAD; + return $this->inHead($token); + + /* Anything else */ + } else { + /* Act as if a start tag token with the tag name "body" and no + attributes had been seen, and then reprocess the current token. */ + $this->afterHead( + array( + 'name' => 'body', + 'type' => HTML5::STARTTAG, + 'attr' => array() + ) + ); + + return $this->inBody($token); + } + } + + private function inBody($token) + { + /* Handle the token as follows: */ + + switch ($token['type']) { + /* A character token */ + case HTML5::CHARACTR: + /* Reconstruct the active formatting elements, if any. */ + $this->reconstructActiveFormattingElements(); + + /* Append the token's character to the current node. */ + $this->insertText($token['data']); + break; + + /* A comment token */ + case HTML5::COMMENT: + /* Append a Comment node to the current node with the data + attribute set to the data given in the comment token. */ + $this->insertComment($token['data']); + break; + + case HTML5::STARTTAG: + switch ($token['name']) { + /* A start tag token whose tag name is one of: "script", + "style" */ + case 'script': + case 'style': + /* Process the token as if the insertion mode had been "in + head". */ + return $this->inHead($token); + break; + + /* A start tag token whose tag name is one of: "base", "link", + "meta", "title" */ + case 'base': + case 'link': + case 'meta': + case 'title': + /* Parse error. Process the token as if the insertion mode + had been "in head". */ + return $this->inHead($token); + break; + + /* A start tag token with the tag name "body" */ + case 'body': + /* Parse error. If the second element on the stack of open + elements is not a body element, or, if the stack of open + elements has only one node on it, then ignore the token. + (innerHTML case) */ + if (count($this->stack) === 1 || $this->stack[1]->nodeName !== 'body') { + // Ignore + + /* Otherwise, for each attribute on the token, check to see + if the attribute is already present on the body element (the + second element) on the stack of open elements. If it is not, + add the attribute and its corresponding value to that + element. */ + } else { + foreach ($token['attr'] as $attr) { + if (!$this->stack[1]->hasAttribute($attr['name'])) { + $this->stack[1]->setAttribute($attr['name'], $attr['value']); + } + } + } + break; + + /* A start tag whose tag name is one of: "address", + "blockquote", "center", "dir", "div", "dl", "fieldset", + "listing", "menu", "ol", "p", "ul" */ + case 'address': + case 'blockquote': + case 'center': + case 'dir': + case 'div': + case 'dl': + case 'fieldset': + case 'listing': + case 'menu': + case 'ol': + case 'p': + case 'ul': + /* If the stack of open elements has a p element in scope, + then act as if an end tag with the tag name p had been + seen. */ + if ($this->elementInScope('p')) { + $this->emitToken( + array( + 'name' => 'p', + 'type' => HTML5::ENDTAG + ) + ); + } + + /* Insert an HTML element for the token. */ + $this->insertElement($token); + break; + + /* A start tag whose tag name is "form" */ + case 'form': + /* If the form element pointer is not null, ignore the + token with a parse error. */ + if ($this->form_pointer !== null) { + // Ignore. + + /* Otherwise: */ + } else { + /* If the stack of open elements has a p element in + scope, then act as if an end tag with the tag name p + had been seen. */ + if ($this->elementInScope('p')) { + $this->emitToken( + array( + 'name' => 'p', + 'type' => HTML5::ENDTAG + ) + ); + } + + /* Insert an HTML element for the token, and set the + form element pointer to point to the element created. */ + $element = $this->insertElement($token); + $this->form_pointer = $element; + } + break; + + /* A start tag whose tag name is "li", "dd" or "dt" */ + case 'li': + case 'dd': + case 'dt': + /* If the stack of open elements has a p element in scope, + then act as if an end tag with the tag name p had been + seen. */ + if ($this->elementInScope('p')) { + $this->emitToken( + array( + 'name' => 'p', + 'type' => HTML5::ENDTAG + ) + ); + } + + $stack_length = count($this->stack) - 1; + + for ($n = $stack_length; 0 <= $n; $n--) { + /* 1. Initialise node to be the current node (the + bottommost node of the stack). */ + $stop = false; + $node = $this->stack[$n]; + $cat = $this->getElementCategory($node->tagName); + + /* 2. If node is an li, dd or dt element, then pop all + the nodes from the current node up to node, including + node, then stop this algorithm. */ + if ($token['name'] === $node->tagName || ($token['name'] !== 'li' + && ($node->tagName === 'dd' || $node->tagName === 'dt')) + ) { + for ($x = $stack_length; $x >= $n; $x--) { + array_pop($this->stack); + } + + break; + } + + /* 3. If node is not in the formatting category, and is + not in the phrasing category, and is not an address or + div element, then stop this algorithm. */ + if ($cat !== self::FORMATTING && $cat !== self::PHRASING && + $node->tagName !== 'address' && $node->tagName !== 'div' + ) { + break; + } + } + + /* Finally, insert an HTML element with the same tag + name as the token's. */ + $this->insertElement($token); + break; + + /* A start tag token whose tag name is "plaintext" */ + case 'plaintext': + /* If the stack of open elements has a p element in scope, + then act as if an end tag with the tag name p had been + seen. */ + if ($this->elementInScope('p')) { + $this->emitToken( + array( + 'name' => 'p', + 'type' => HTML5::ENDTAG + ) + ); + } + + /* Insert an HTML element for the token. */ + $this->insertElement($token); + + return HTML5::PLAINTEXT; + break; + + /* A start tag whose tag name is one of: "h1", "h2", "h3", "h4", + "h5", "h6" */ + case 'h1': + case 'h2': + case 'h3': + case 'h4': + case 'h5': + case 'h6': + /* If the stack of open elements has a p element in scope, + then act as if an end tag with the tag name p had been seen. */ + if ($this->elementInScope('p')) { + $this->emitToken( + array( + 'name' => 'p', + 'type' => HTML5::ENDTAG + ) + ); + } + + /* If the stack of open elements has in scope an element whose + tag name is one of "h1", "h2", "h3", "h4", "h5", or "h6", then + this is a parse error; pop elements from the stack until an + element with one of those tag names has been popped from the + stack. */ + while ($this->elementInScope(array('h1', 'h2', 'h3', 'h4', 'h5', 'h6'))) { + array_pop($this->stack); + } + + /* Insert an HTML element for the token. */ + $this->insertElement($token); + break; + + /* A start tag whose tag name is "a" */ + case 'a': + /* If the list of active formatting elements contains + an element whose tag name is "a" between the end of the + list and the last marker on the list (or the start of + the list if there is no marker on the list), then this + is a parse error; act as if an end tag with the tag name + "a" had been seen, then remove that element from the list + of active formatting elements and the stack of open + elements if the end tag didn't already remove it (it + might not have if the element is not in table scope). */ + $leng = count($this->a_formatting); + + for ($n = $leng - 1; $n >= 0; $n--) { + if ($this->a_formatting[$n] === self::MARKER) { + break; + + } elseif ($this->a_formatting[$n]->nodeName === 'a') { + $this->emitToken( + array( + 'name' => 'a', + 'type' => HTML5::ENDTAG + ) + ); + break; + } + } + + /* Reconstruct the active formatting elements, if any. */ + $this->reconstructActiveFormattingElements(); + + /* Insert an HTML element for the token. */ + $el = $this->insertElement($token); + + /* Add that element to the list of active formatting + elements. */ + $this->a_formatting[] = $el; + break; + + /* A start tag whose tag name is one of: "b", "big", "em", "font", + "i", "nobr", "s", "small", "strike", "strong", "tt", "u" */ + case 'b': + case 'big': + case 'em': + case 'font': + case 'i': + case 'nobr': + case 's': + case 'small': + case 'strike': + case 'strong': + case 'tt': + case 'u': + /* Reconstruct the active formatting elements, if any. */ + $this->reconstructActiveFormattingElements(); + + /* Insert an HTML element for the token. */ + $el = $this->insertElement($token); + + /* Add that element to the list of active formatting + elements. */ + $this->a_formatting[] = $el; + break; + + /* A start tag token whose tag name is "button" */ + case 'button': + /* If the stack of open elements has a button element in scope, + then this is a parse error; act as if an end tag with the tag + name "button" had been seen, then reprocess the token. (We don't + do that. Unnecessary.) */ + if ($this->elementInScope('button')) { + $this->inBody( + array( + 'name' => 'button', + 'type' => HTML5::ENDTAG + ) + ); + } + + /* Reconstruct the active formatting elements, if any. */ + $this->reconstructActiveFormattingElements(); + + /* Insert an HTML element for the token. */ + $this->insertElement($token); + + /* Insert a marker at the end of the list of active + formatting elements. */ + $this->a_formatting[] = self::MARKER; + break; + + /* A start tag token whose tag name is one of: "marquee", "object" */ + case 'marquee': + case 'object': + /* Reconstruct the active formatting elements, if any. */ + $this->reconstructActiveFormattingElements(); + + /* Insert an HTML element for the token. */ + $this->insertElement($token); + + /* Insert a marker at the end of the list of active + formatting elements. */ + $this->a_formatting[] = self::MARKER; + break; + + /* A start tag token whose tag name is "xmp" */ + case 'xmp': + /* Reconstruct the active formatting elements, if any. */ + $this->reconstructActiveFormattingElements(); + + /* Insert an HTML element for the token. */ + $this->insertElement($token); + + /* Switch the content model flag to the CDATA state. */ + return HTML5::CDATA; + break; + + /* A start tag whose tag name is "table" */ + case 'table': + /* If the stack of open elements has a p element in scope, + then act as if an end tag with the tag name p had been seen. */ + if ($this->elementInScope('p')) { + $this->emitToken( + array( + 'name' => 'p', + 'type' => HTML5::ENDTAG + ) + ); + } + + /* Insert an HTML element for the token. */ + $this->insertElement($token); + + /* Change the insertion mode to "in table". */ + $this->mode = self::IN_TABLE; + break; + + /* A start tag whose tag name is one of: "area", "basefont", + "bgsound", "br", "embed", "img", "param", "spacer", "wbr" */ + case 'area': + case 'basefont': + case 'bgsound': + case 'br': + case 'embed': + case 'img': + case 'param': + case 'spacer': + case 'wbr': + /* Reconstruct the active formatting elements, if any. */ + $this->reconstructActiveFormattingElements(); + + /* Insert an HTML element for the token. */ + $this->insertElement($token); + + /* Immediately pop the current node off the stack of open elements. */ + array_pop($this->stack); + break; + + /* A start tag whose tag name is "hr" */ + case 'hr': + /* If the stack of open elements has a p element in scope, + then act as if an end tag with the tag name p had been seen. */ + if ($this->elementInScope('p')) { + $this->emitToken( + array( + 'name' => 'p', + 'type' => HTML5::ENDTAG + ) + ); + } + + /* Insert an HTML element for the token. */ + $this->insertElement($token); + + /* Immediately pop the current node off the stack of open elements. */ + array_pop($this->stack); + break; + + /* A start tag whose tag name is "image" */ + case 'image': + /* Parse error. Change the token's tag name to "img" and + reprocess it. (Don't ask.) */ + $token['name'] = 'img'; + return $this->inBody($token); + break; + + /* A start tag whose tag name is "input" */ + case 'input': + /* Reconstruct the active formatting elements, if any. */ + $this->reconstructActiveFormattingElements(); + + /* Insert an input element for the token. */ + $element = $this->insertElement($token, false); + + /* If the form element pointer is not null, then associate the + input element with the form element pointed to by the form + element pointer. */ + $this->form_pointer !== null + ? $this->form_pointer->appendChild($element) + : end($this->stack)->appendChild($element); + + /* Pop that input element off the stack of open elements. */ + array_pop($this->stack); + break; + + /* A start tag whose tag name is "isindex" */ + case 'isindex': + /* Parse error. */ + // w/e + + /* If the form element pointer is not null, + then ignore the token. */ + if ($this->form_pointer === null) { + /* Act as if a start tag token with the tag name "form" had + been seen. */ + $this->inBody( + array( + 'name' => 'body', + 'type' => HTML5::STARTTAG, + 'attr' => array() + ) + ); + + /* Act as if a start tag token with the tag name "hr" had + been seen. */ + $this->inBody( + array( + 'name' => 'hr', + 'type' => HTML5::STARTTAG, + 'attr' => array() + ) + ); + + /* Act as if a start tag token with the tag name "p" had + been seen. */ + $this->inBody( + array( + 'name' => 'p', + 'type' => HTML5::STARTTAG, + 'attr' => array() + ) + ); + + /* Act as if a start tag token with the tag name "label" + had been seen. */ + $this->inBody( + array( + 'name' => 'label', + 'type' => HTML5::STARTTAG, + 'attr' => array() + ) + ); + + /* Act as if a stream of character tokens had been seen. */ + $this->insertText( + 'This is a searchable index. ' . + 'Insert your search keywords here: ' + ); + + /* Act as if a start tag token with the tag name "input" + had been seen, with all the attributes from the "isindex" + token, except with the "name" attribute set to the value + "isindex" (ignoring any explicit "name" attribute). */ + $attr = $token['attr']; + $attr[] = array('name' => 'name', 'value' => 'isindex'); + + $this->inBody( + array( + 'name' => 'input', + 'type' => HTML5::STARTTAG, + 'attr' => $attr + ) + ); + + /* Act as if a stream of character tokens had been seen + (see below for what they should say). */ + $this->insertText( + 'This is a searchable index. ' . + 'Insert your search keywords here: ' + ); + + /* Act as if an end tag token with the tag name "label" + had been seen. */ + $this->inBody( + array( + 'name' => 'label', + 'type' => HTML5::ENDTAG + ) + ); + + /* Act as if an end tag token with the tag name "p" had + been seen. */ + $this->inBody( + array( + 'name' => 'p', + 'type' => HTML5::ENDTAG + ) + ); + + /* Act as if a start tag token with the tag name "hr" had + been seen. */ + $this->inBody( + array( + 'name' => 'hr', + 'type' => HTML5::ENDTAG + ) + ); + + /* Act as if an end tag token with the tag name "form" had + been seen. */ + $this->inBody( + array( + 'name' => 'form', + 'type' => HTML5::ENDTAG + ) + ); + } + break; + + /* A start tag whose tag name is "textarea" */ + case 'textarea': + $this->insertElement($token); + + /* Switch the tokeniser's content model flag to the + RCDATA state. */ + return HTML5::RCDATA; + break; + + /* A start tag whose tag name is one of: "iframe", "noembed", + "noframes" */ + case 'iframe': + case 'noembed': + case 'noframes': + $this->insertElement($token); + + /* Switch the tokeniser's content model flag to the CDATA state. */ + return HTML5::CDATA; + break; + + /* A start tag whose tag name is "select" */ + case 'select': + /* Reconstruct the active formatting elements, if any. */ + $this->reconstructActiveFormattingElements(); + + /* Insert an HTML element for the token. */ + $this->insertElement($token); + + /* Change the insertion mode to "in select". */ + $this->mode = self::IN_SELECT; + break; + + /* A start or end tag whose tag name is one of: "caption", "col", + "colgroup", "frame", "frameset", "head", "option", "optgroup", + "tbody", "td", "tfoot", "th", "thead", "tr". */ + case 'caption': + case 'col': + case 'colgroup': + case 'frame': + case 'frameset': + case 'head': + case 'option': + case 'optgroup': + case 'tbody': + case 'td': + case 'tfoot': + case 'th': + case 'thead': + case 'tr': + // Parse error. Ignore the token. + break; + + /* A start or end tag whose tag name is one of: "event-source", + "section", "nav", "article", "aside", "header", "footer", + "datagrid", "command" */ + case 'event-source': + case 'section': + case 'nav': + case 'article': + case 'aside': + case 'header': + case 'footer': + case 'datagrid': + case 'command': + // Work in progress! + break; + + /* A start tag token not covered by the previous entries */ + default: + /* Reconstruct the active formatting elements, if any. */ + $this->reconstructActiveFormattingElements(); + + $this->insertElement($token, true, true); + break; + } + break; + + case HTML5::ENDTAG: + switch ($token['name']) { + /* An end tag with the tag name "body" */ + case 'body': + /* If the second element in the stack of open elements is + not a body element, this is a parse error. Ignore the token. + (innerHTML case) */ + if (count($this->stack) < 2 || $this->stack[1]->nodeName !== 'body') { + // Ignore. + + /* If the current node is not the body element, then this + is a parse error. */ + } elseif (end($this->stack)->nodeName !== 'body') { + // Parse error. + } + + /* Change the insertion mode to "after body". */ + $this->mode = self::AFTER_BODY; + break; + + /* An end tag with the tag name "html" */ + case 'html': + /* Act as if an end tag with tag name "body" had been seen, + then, if that token wasn't ignored, reprocess the current + token. */ + $this->inBody( + array( + 'name' => 'body', + 'type' => HTML5::ENDTAG + ) + ); + + return $this->afterBody($token); + break; + + /* An end tag whose tag name is one of: "address", "blockquote", + "center", "dir", "div", "dl", "fieldset", "listing", "menu", + "ol", "pre", "ul" */ + case 'address': + case 'blockquote': + case 'center': + case 'dir': + case 'div': + case 'dl': + case 'fieldset': + case 'listing': + case 'menu': + case 'ol': + case 'pre': + case 'ul': + /* If the stack of open elements has an element in scope + with the same tag name as that of the token, then generate + implied end tags. */ + if ($this->elementInScope($token['name'])) { + $this->generateImpliedEndTags(); + + /* Now, if the current node is not an element with + the same tag name as that of the token, then this + is a parse error. */ + // w/e + + /* If the stack of open elements has an element in + scope with the same tag name as that of the token, + then pop elements from this stack until an element + with that tag name has been popped from the stack. */ + for ($n = count($this->stack) - 1; $n >= 0; $n--) { + if ($this->stack[$n]->nodeName === $token['name']) { + $n = -1; + } + + array_pop($this->stack); + } + } + break; + + /* An end tag whose tag name is "form" */ + case 'form': + /* If the stack of open elements has an element in scope + with the same tag name as that of the token, then generate + implied end tags. */ + if ($this->elementInScope($token['name'])) { + $this->generateImpliedEndTags(); + + } + + if (end($this->stack)->nodeName !== $token['name']) { + /* Now, if the current node is not an element with the + same tag name as that of the token, then this is a parse + error. */ + // w/e + + } else { + /* Otherwise, if the current node is an element with + the same tag name as that of the token pop that element + from the stack. */ + array_pop($this->stack); + } + + /* In any case, set the form element pointer to null. */ + $this->form_pointer = null; + break; + + /* An end tag whose tag name is "p" */ + case 'p': + /* If the stack of open elements has a p element in scope, + then generate implied end tags, except for p elements. */ + if ($this->elementInScope('p')) { + $this->generateImpliedEndTags(array('p')); + + /* If the current node is not a p element, then this is + a parse error. */ + // k + + /* If the stack of open elements has a p element in + scope, then pop elements from this stack until the stack + no longer has a p element in scope. */ + for ($n = count($this->stack) - 1; $n >= 0; $n--) { + if ($this->elementInScope('p')) { + array_pop($this->stack); + + } else { + break; + } + } + } + break; + + /* An end tag whose tag name is "dd", "dt", or "li" */ + case 'dd': + case 'dt': + case 'li': + /* If the stack of open elements has an element in scope + whose tag name matches the tag name of the token, then + generate implied end tags, except for elements with the + same tag name as the token. */ + if ($this->elementInScope($token['name'])) { + $this->generateImpliedEndTags(array($token['name'])); + + /* If the current node is not an element with the same + tag name as the token, then this is a parse error. */ + // w/e + + /* If the stack of open elements has an element in scope + whose tag name matches the tag name of the token, then + pop elements from this stack until an element with that + tag name has been popped from the stack. */ + for ($n = count($this->stack) - 1; $n >= 0; $n--) { + if ($this->stack[$n]->nodeName === $token['name']) { + $n = -1; + } + + array_pop($this->stack); + } + } + break; + + /* An end tag whose tag name is one of: "h1", "h2", "h3", "h4", + "h5", "h6" */ + case 'h1': + case 'h2': + case 'h3': + case 'h4': + case 'h5': + case 'h6': + $elements = array('h1', 'h2', 'h3', 'h4', 'h5', 'h6'); + + /* If the stack of open elements has in scope an element whose + tag name is one of "h1", "h2", "h3", "h4", "h5", or "h6", then + generate implied end tags. */ + if ($this->elementInScope($elements)) { + $this->generateImpliedEndTags(); + + /* Now, if the current node is not an element with the same + tag name as that of the token, then this is a parse error. */ + // w/e + + /* If the stack of open elements has in scope an element + whose tag name is one of "h1", "h2", "h3", "h4", "h5", or + "h6", then pop elements from the stack until an element + with one of those tag names has been popped from the stack. */ + while ($this->elementInScope($elements)) { + array_pop($this->stack); + } + } + break; + + /* An end tag whose tag name is one of: "a", "b", "big", "em", + "font", "i", "nobr", "s", "small", "strike", "strong", "tt", "u" */ + case 'a': + case 'b': + case 'big': + case 'em': + case 'font': + case 'i': + case 'nobr': + case 's': + case 'small': + case 'strike': + case 'strong': + case 'tt': + case 'u': + /* 1. Let the formatting element be the last element in + the list of active formatting elements that: + * is between the end of the list and the last scope + marker in the list, if any, or the start of the list + otherwise, and + * has the same tag name as the token. + */ + while (true) { + for ($a = count($this->a_formatting) - 1; $a >= 0; $a--) { + if ($this->a_formatting[$a] === self::MARKER) { + break; + + } elseif ($this->a_formatting[$a]->tagName === $token['name']) { + $formatting_element = $this->a_formatting[$a]; + $in_stack = in_array($formatting_element, $this->stack, true); + $fe_af_pos = $a; + break; + } + } + + /* If there is no such node, or, if that node is + also in the stack of open elements but the element + is not in scope, then this is a parse error. Abort + these steps. The token is ignored. */ + if (!isset($formatting_element) || ($in_stack && + !$this->elementInScope($token['name'])) + ) { + break; + + /* Otherwise, if there is such a node, but that node + is not in the stack of open elements, then this is a + parse error; remove the element from the list, and + abort these steps. */ + } elseif (isset($formatting_element) && !$in_stack) { + unset($this->a_formatting[$fe_af_pos]); + $this->a_formatting = array_merge($this->a_formatting); + break; + } + + /* 2. Let the furthest block be the topmost node in the + stack of open elements that is lower in the stack + than the formatting element, and is not an element in + the phrasing or formatting categories. There might + not be one. */ + $fe_s_pos = array_search($formatting_element, $this->stack, true); + $length = count($this->stack); + + for ($s = $fe_s_pos + 1; $s < $length; $s++) { + $category = $this->getElementCategory($this->stack[$s]->nodeName); + + if ($category !== self::PHRASING && $category !== self::FORMATTING) { + $furthest_block = $this->stack[$s]; + } + } + + /* 3. If there is no furthest block, then the UA must + skip the subsequent steps and instead just pop all + the nodes from the bottom of the stack of open + elements, from the current node up to the formatting + element, and remove the formatting element from the + list of active formatting elements. */ + if (!isset($furthest_block)) { + for ($n = $length - 1; $n >= $fe_s_pos; $n--) { + array_pop($this->stack); + } + + unset($this->a_formatting[$fe_af_pos]); + $this->a_formatting = array_merge($this->a_formatting); + break; + } + + /* 4. Let the common ancestor be the element + immediately above the formatting element in the stack + of open elements. */ + $common_ancestor = $this->stack[$fe_s_pos - 1]; + + /* 5. If the furthest block has a parent node, then + remove the furthest block from its parent node. */ + if ($furthest_block->parentNode !== null) { + $furthest_block->parentNode->removeChild($furthest_block); + } + + /* 6. Let a bookmark note the position of the + formatting element in the list of active formatting + elements relative to the elements on either side + of it in the list. */ + $bookmark = $fe_af_pos; + + /* 7. Let node and last node be the furthest block. + Follow these steps: */ + $node = $furthest_block; + $last_node = $furthest_block; + + while (true) { + for ($n = array_search($node, $this->stack, true) - 1; $n >= 0; $n--) { + /* 7.1 Let node be the element immediately + prior to node in the stack of open elements. */ + $node = $this->stack[$n]; + + /* 7.2 If node is not in the list of active + formatting elements, then remove node from + the stack of open elements and then go back + to step 1. */ + if (!in_array($node, $this->a_formatting, true)) { + unset($this->stack[$n]); + $this->stack = array_merge($this->stack); + + } else { + break; + } + } + + /* 7.3 Otherwise, if node is the formatting + element, then go to the next step in the overall + algorithm. */ + if ($node === $formatting_element) { + break; + + /* 7.4 Otherwise, if last node is the furthest + block, then move the aforementioned bookmark to + be immediately after the node in the list of + active formatting elements. */ + } elseif ($last_node === $furthest_block) { + $bookmark = array_search($node, $this->a_formatting, true) + 1; + } + + /* 7.5 If node has any children, perform a + shallow clone of node, replace the entry for + node in the list of active formatting elements + with an entry for the clone, replace the entry + for node in the stack of open elements with an + entry for the clone, and let node be the clone. */ + if ($node->hasChildNodes()) { + $clone = $node->cloneNode(); + $s_pos = array_search($node, $this->stack, true); + $a_pos = array_search($node, $this->a_formatting, true); + + $this->stack[$s_pos] = $clone; + $this->a_formatting[$a_pos] = $clone; + $node = $clone; + } + + /* 7.6 Insert last node into node, first removing + it from its previous parent node if any. */ + if ($last_node->parentNode !== null) { + $last_node->parentNode->removeChild($last_node); + } + + $node->appendChild($last_node); + + /* 7.7 Let last node be node. */ + $last_node = $node; + } + + /* 8. Insert whatever last node ended up being in + the previous step into the common ancestor node, + first removing it from its previous parent node if + any. */ + if ($last_node->parentNode !== null) { + $last_node->parentNode->removeChild($last_node); + } + + $common_ancestor->appendChild($last_node); + + /* 9. Perform a shallow clone of the formatting + element. */ + $clone = $formatting_element->cloneNode(); + + /* 10. Take all of the child nodes of the furthest + block and append them to the clone created in the + last step. */ + while ($furthest_block->hasChildNodes()) { + $child = $furthest_block->firstChild; + $furthest_block->removeChild($child); + $clone->appendChild($child); + } + + /* 11. Append that clone to the furthest block. */ + $furthest_block->appendChild($clone); + + /* 12. Remove the formatting element from the list + of active formatting elements, and insert the clone + into the list of active formatting elements at the + position of the aforementioned bookmark. */ + $fe_af_pos = array_search($formatting_element, $this->a_formatting, true); + unset($this->a_formatting[$fe_af_pos]); + $this->a_formatting = array_merge($this->a_formatting); + + $af_part1 = array_slice($this->a_formatting, 0, $bookmark - 1); + $af_part2 = array_slice($this->a_formatting, $bookmark, count($this->a_formatting)); + $this->a_formatting = array_merge($af_part1, array($clone), $af_part2); + + /* 13. Remove the formatting element from the stack + of open elements, and insert the clone into the stack + of open elements immediately after (i.e. in a more + deeply nested position than) the position of the + furthest block in that stack. */ + $fe_s_pos = array_search($formatting_element, $this->stack, true); + $fb_s_pos = array_search($furthest_block, $this->stack, true); + unset($this->stack[$fe_s_pos]); + + $s_part1 = array_slice($this->stack, 0, $fb_s_pos); + $s_part2 = array_slice($this->stack, $fb_s_pos + 1, count($this->stack)); + $this->stack = array_merge($s_part1, array($clone), $s_part2); + + /* 14. Jump back to step 1 in this series of steps. */ + unset($formatting_element, $fe_af_pos, $fe_s_pos, $furthest_block); + } + break; + + /* An end tag token whose tag name is one of: "button", + "marquee", "object" */ + case 'button': + case 'marquee': + case 'object': + /* If the stack of open elements has an element in scope whose + tag name matches the tag name of the token, then generate implied + tags. */ + if ($this->elementInScope($token['name'])) { + $this->generateImpliedEndTags(); + + /* Now, if the current node is not an element with the same + tag name as the token, then this is a parse error. */ + // k + + /* Now, if the stack of open elements has an element in scope + whose tag name matches the tag name of the token, then pop + elements from the stack until that element has been popped from + the stack, and clear the list of active formatting elements up + to the last marker. */ + for ($n = count($this->stack) - 1; $n >= 0; $n--) { + if ($this->stack[$n]->nodeName === $token['name']) { + $n = -1; + } + + array_pop($this->stack); + } + + $marker = end(array_keys($this->a_formatting, self::MARKER, true)); + + for ($n = count($this->a_formatting) - 1; $n > $marker; $n--) { + array_pop($this->a_formatting); + } + } + break; + + /* Or an end tag whose tag name is one of: "area", "basefont", + "bgsound", "br", "embed", "hr", "iframe", "image", "img", + "input", "isindex", "noembed", "noframes", "param", "select", + "spacer", "table", "textarea", "wbr" */ + case 'area': + case 'basefont': + case 'bgsound': + case 'br': + case 'embed': + case 'hr': + case 'iframe': + case 'image': + case 'img': + case 'input': + case 'isindex': + case 'noembed': + case 'noframes': + case 'param': + case 'select': + case 'spacer': + case 'table': + case 'textarea': + case 'wbr': + // Parse error. Ignore the token. + break; + + /* An end tag token not covered by the previous entries */ + default: + for ($n = count($this->stack) - 1; $n >= 0; $n--) { + /* Initialise node to be the current node (the bottommost + node of the stack). */ + $node = end($this->stack); + + /* If node has the same tag name as the end tag token, + then: */ + if ($token['name'] === $node->nodeName) { + /* Generate implied end tags. */ + $this->generateImpliedEndTags(); + + /* If the tag name of the end tag token does not + match the tag name of the current node, this is a + parse error. */ + // k + + /* Pop all the nodes from the current node up to + node, including node, then stop this algorithm. */ + for ($x = count($this->stack) - $n; $x >= $n; $x--) { + array_pop($this->stack); + } + + } else { + $category = $this->getElementCategory($node); + + if ($category !== self::SPECIAL && $category !== self::SCOPING) { + /* Otherwise, if node is in neither the formatting + category nor the phrasing category, then this is a + parse error. Stop this algorithm. The end tag token + is ignored. */ + return false; + } + } + } + break; + } + break; + } + } + + private function inTable($token) + { + $clear = array('html', 'table'); + + /* A character token that is one of one of U+0009 CHARACTER TABULATION, + U+000A LINE FEED (LF), U+000B LINE TABULATION, U+000C FORM FEED (FF), + or U+0020 SPACE */ + if ($token['type'] === HTML5::CHARACTR && + preg_match('/^[\t\n\x0b\x0c ]+$/', $token['data']) + ) { + /* Append the character to the current node. */ + $text = $this->dom->createTextNode($token['data']); + end($this->stack)->appendChild($text); + + /* A comment token */ + } elseif ($token['type'] === HTML5::COMMENT) { + /* Append a Comment node to the current node with the data + attribute set to the data given in the comment token. */ + $comment = $this->dom->createComment($token['data']); + end($this->stack)->appendChild($comment); + + /* A start tag whose tag name is "caption" */ + } elseif ($token['type'] === HTML5::STARTTAG && + $token['name'] === 'caption' + ) { + /* Clear the stack back to a table context. */ + $this->clearStackToTableContext($clear); + + /* Insert a marker at the end of the list of active + formatting elements. */ + $this->a_formatting[] = self::MARKER; + + /* Insert an HTML element for the token, then switch the + insertion mode to "in caption". */ + $this->insertElement($token); + $this->mode = self::IN_CAPTION; + + /* A start tag whose tag name is "colgroup" */ + } elseif ($token['type'] === HTML5::STARTTAG && + $token['name'] === 'colgroup' + ) { + /* Clear the stack back to a table context. */ + $this->clearStackToTableContext($clear); + + /* Insert an HTML element for the token, then switch the + insertion mode to "in column group". */ + $this->insertElement($token); + $this->mode = self::IN_CGROUP; + + /* A start tag whose tag name is "col" */ + } elseif ($token['type'] === HTML5::STARTTAG && + $token['name'] === 'col' + ) { + $this->inTable( + array( + 'name' => 'colgroup', + 'type' => HTML5::STARTTAG, + 'attr' => array() + ) + ); + + $this->inColumnGroup($token); + + /* A start tag whose tag name is one of: "tbody", "tfoot", "thead" */ + } elseif ($token['type'] === HTML5::STARTTAG && in_array( + $token['name'], + array('tbody', 'tfoot', 'thead') + ) + ) { + /* Clear the stack back to a table context. */ + $this->clearStackToTableContext($clear); + + /* Insert an HTML element for the token, then switch the insertion + mode to "in table body". */ + $this->insertElement($token); + $this->mode = self::IN_TBODY; + + /* A start tag whose tag name is one of: "td", "th", "tr" */ + } elseif ($token['type'] === HTML5::STARTTAG && + in_array($token['name'], array('td', 'th', 'tr')) + ) { + /* Act as if a start tag token with the tag name "tbody" had been + seen, then reprocess the current token. */ + $this->inTable( + array( + 'name' => 'tbody', + 'type' => HTML5::STARTTAG, + 'attr' => array() + ) + ); + + return $this->inTableBody($token); + + /* A start tag whose tag name is "table" */ + } elseif ($token['type'] === HTML5::STARTTAG && + $token['name'] === 'table' + ) { + /* Parse error. Act as if an end tag token with the tag name "table" + had been seen, then, if that token wasn't ignored, reprocess the + current token. */ + $this->inTable( + array( + 'name' => 'table', + 'type' => HTML5::ENDTAG + ) + ); + + return $this->mainPhase($token); + + /* An end tag whose tag name is "table" */ + } elseif ($token['type'] === HTML5::ENDTAG && + $token['name'] === 'table' + ) { + /* If the stack of open elements does not have an element in table + scope with the same tag name as the token, this is a parse error. + Ignore the token. (innerHTML case) */ + if (!$this->elementInScope($token['name'], true)) { + return false; + + /* Otherwise: */ + } else { + /* Generate implied end tags. */ + $this->generateImpliedEndTags(); + + /* Now, if the current node is not a table element, then this + is a parse error. */ + // w/e + + /* Pop elements from this stack until a table element has been + popped from the stack. */ + while (true) { + $current = end($this->stack)->nodeName; + array_pop($this->stack); + + if ($current === 'table') { + break; + } + } + + /* Reset the insertion mode appropriately. */ + $this->resetInsertionMode(); + } + + /* An end tag whose tag name is one of: "body", "caption", "col", + "colgroup", "html", "tbody", "td", "tfoot", "th", "thead", "tr" */ + } elseif ($token['type'] === HTML5::ENDTAG && in_array( + $token['name'], + array( + 'body', + 'caption', + 'col', + 'colgroup', + 'html', + 'tbody', + 'td', + 'tfoot', + 'th', + 'thead', + 'tr' + ) + ) + ) { + // Parse error. Ignore the token. + + /* Anything else */ + } else { + /* Parse error. Process the token as if the insertion mode was "in + body", with the following exception: */ + + /* If the current node is a table, tbody, tfoot, thead, or tr + element, then, whenever a node would be inserted into the current + node, it must instead be inserted into the foster parent element. */ + if (in_array( + end($this->stack)->nodeName, + array('table', 'tbody', 'tfoot', 'thead', 'tr') + ) + ) { + /* The foster parent element is the parent element of the last + table element in the stack of open elements, if there is a + table element and it has such a parent element. If there is no + table element in the stack of open elements (innerHTML case), + then the foster parent element is the first element in the + stack of open elements (the html element). Otherwise, if there + is a table element in the stack of open elements, but the last + table element in the stack of open elements has no parent, or + its parent node is not an element, then the foster parent + element is the element before the last table element in the + stack of open elements. */ + for ($n = count($this->stack) - 1; $n >= 0; $n--) { + if ($this->stack[$n]->nodeName === 'table') { + $table = $this->stack[$n]; + break; + } + } + + if (isset($table) && $table->parentNode !== null) { + $this->foster_parent = $table->parentNode; + + } elseif (!isset($table)) { + $this->foster_parent = $this->stack[0]; + + } elseif (isset($table) && ($table->parentNode === null || + $table->parentNode->nodeType !== XML_ELEMENT_NODE) + ) { + $this->foster_parent = $this->stack[$n - 1]; + } + } + + $this->inBody($token); + } + } + + private function inCaption($token) + { + /* An end tag whose tag name is "caption" */ + if ($token['type'] === HTML5::ENDTAG && $token['name'] === 'caption') { + /* If the stack of open elements does not have an element in table + scope with the same tag name as the token, this is a parse error. + Ignore the token. (innerHTML case) */ + if (!$this->elementInScope($token['name'], true)) { + // Ignore + + /* Otherwise: */ + } else { + /* Generate implied end tags. */ + $this->generateImpliedEndTags(); + + /* Now, if the current node is not a caption element, then this + is a parse error. */ + // w/e + + /* Pop elements from this stack until a caption element has + been popped from the stack. */ + while (true) { + $node = end($this->stack)->nodeName; + array_pop($this->stack); + + if ($node === 'caption') { + break; + } + } + + /* Clear the list of active formatting elements up to the last + marker. */ + $this->clearTheActiveFormattingElementsUpToTheLastMarker(); + + /* Switch the insertion mode to "in table". */ + $this->mode = self::IN_TABLE; + } + + /* A start tag whose tag name is one of: "caption", "col", "colgroup", + "tbody", "td", "tfoot", "th", "thead", "tr", or an end tag whose tag + name is "table" */ + } elseif (($token['type'] === HTML5::STARTTAG && in_array( + $token['name'], + array( + 'caption', + 'col', + 'colgroup', + 'tbody', + 'td', + 'tfoot', + 'th', + 'thead', + 'tr' + ) + )) || ($token['type'] === HTML5::ENDTAG && + $token['name'] === 'table') + ) { + /* Parse error. Act as if an end tag with the tag name "caption" + had been seen, then, if that token wasn't ignored, reprocess the + current token. */ + $this->inCaption( + array( + 'name' => 'caption', + 'type' => HTML5::ENDTAG + ) + ); + + return $this->inTable($token); + + /* An end tag whose tag name is one of: "body", "col", "colgroup", + "html", "tbody", "td", "tfoot", "th", "thead", "tr" */ + } elseif ($token['type'] === HTML5::ENDTAG && in_array( + $token['name'], + array( + 'body', + 'col', + 'colgroup', + 'html', + 'tbody', + 'tfoot', + 'th', + 'thead', + 'tr' + ) + ) + ) { + // Parse error. Ignore the token. + + /* Anything else */ + } else { + /* Process the token as if the insertion mode was "in body". */ + $this->inBody($token); + } + } + + private function inColumnGroup($token) + { + /* A character token that is one of one of U+0009 CHARACTER TABULATION, + U+000A LINE FEED (LF), U+000B LINE TABULATION, U+000C FORM FEED (FF), + or U+0020 SPACE */ + if ($token['type'] === HTML5::CHARACTR && + preg_match('/^[\t\n\x0b\x0c ]+$/', $token['data']) + ) { + /* Append the character to the current node. */ + $text = $this->dom->createTextNode($token['data']); + end($this->stack)->appendChild($text); + + /* A comment token */ + } elseif ($token['type'] === HTML5::COMMENT) { + /* Append a Comment node to the current node with the data + attribute set to the data given in the comment token. */ + $comment = $this->dom->createComment($token['data']); + end($this->stack)->appendChild($comment); + + /* A start tag whose tag name is "col" */ + } elseif ($token['type'] === HTML5::STARTTAG && $token['name'] === 'col') { + /* Insert a col element for the token. Immediately pop the current + node off the stack of open elements. */ + $this->insertElement($token); + array_pop($this->stack); + + /* An end tag whose tag name is "colgroup" */ + } elseif ($token['type'] === HTML5::ENDTAG && + $token['name'] === 'colgroup' + ) { + /* If the current node is the root html element, then this is a + parse error, ignore the token. (innerHTML case) */ + if (end($this->stack)->nodeName === 'html') { + // Ignore + + /* Otherwise, pop the current node (which will be a colgroup + element) from the stack of open elements. Switch the insertion + mode to "in table". */ + } else { + array_pop($this->stack); + $this->mode = self::IN_TABLE; + } + + /* An end tag whose tag name is "col" */ + } elseif ($token['type'] === HTML5::ENDTAG && $token['name'] === 'col') { + /* Parse error. Ignore the token. */ + + /* Anything else */ + } else { + /* Act as if an end tag with the tag name "colgroup" had been seen, + and then, if that token wasn't ignored, reprocess the current token. */ + $this->inColumnGroup( + array( + 'name' => 'colgroup', + 'type' => HTML5::ENDTAG + ) + ); + + return $this->inTable($token); + } + } + + private function inTableBody($token) + { + $clear = array('tbody', 'tfoot', 'thead', 'html'); + + /* A start tag whose tag name is "tr" */ + if ($token['type'] === HTML5::STARTTAG && $token['name'] === 'tr') { + /* Clear the stack back to a table body context. */ + $this->clearStackToTableContext($clear); + + /* Insert a tr element for the token, then switch the insertion + mode to "in row". */ + $this->insertElement($token); + $this->mode = self::IN_ROW; + + /* A start tag whose tag name is one of: "th", "td" */ + } elseif ($token['type'] === HTML5::STARTTAG && + ($token['name'] === 'th' || $token['name'] === 'td') + ) { + /* Parse error. Act as if a start tag with the tag name "tr" had + been seen, then reprocess the current token. */ + $this->inTableBody( + array( + 'name' => 'tr', + 'type' => HTML5::STARTTAG, + 'attr' => array() + ) + ); + + return $this->inRow($token); + + /* An end tag whose tag name is one of: "tbody", "tfoot", "thead" */ + } elseif ($token['type'] === HTML5::ENDTAG && + in_array($token['name'], array('tbody', 'tfoot', 'thead')) + ) { + /* If the stack of open elements does not have an element in table + scope with the same tag name as the token, this is a parse error. + Ignore the token. */ + if (!$this->elementInScope($token['name'], true)) { + // Ignore + + /* Otherwise: */ + } else { + /* Clear the stack back to a table body context. */ + $this->clearStackToTableContext($clear); + + /* Pop the current node from the stack of open elements. Switch + the insertion mode to "in table". */ + array_pop($this->stack); + $this->mode = self::IN_TABLE; + } + + /* A start tag whose tag name is one of: "caption", "col", "colgroup", + "tbody", "tfoot", "thead", or an end tag whose tag name is "table" */ + } elseif (($token['type'] === HTML5::STARTTAG && in_array( + $token['name'], + array('caption', 'col', 'colgroup', 'tbody', 'tfoor', 'thead') + )) || + ($token['type'] === HTML5::STARTTAG && $token['name'] === 'table') + ) { + /* If the stack of open elements does not have a tbody, thead, or + tfoot element in table scope, this is a parse error. Ignore the + token. (innerHTML case) */ + if (!$this->elementInScope(array('tbody', 'thead', 'tfoot'), true)) { + // Ignore. + + /* Otherwise: */ + } else { + /* Clear the stack back to a table body context. */ + $this->clearStackToTableContext($clear); + + /* Act as if an end tag with the same tag name as the current + node ("tbody", "tfoot", or "thead") had been seen, then + reprocess the current token. */ + $this->inTableBody( + array( + 'name' => end($this->stack)->nodeName, + 'type' => HTML5::ENDTAG + ) + ); + + return $this->mainPhase($token); + } + + /* An end tag whose tag name is one of: "body", "caption", "col", + "colgroup", "html", "td", "th", "tr" */ + } elseif ($token['type'] === HTML5::ENDTAG && in_array( + $token['name'], + array('body', 'caption', 'col', 'colgroup', 'html', 'td', 'th', 'tr') + ) + ) { + /* Parse error. Ignore the token. */ + + /* Anything else */ + } else { + /* Process the token as if the insertion mode was "in table". */ + $this->inTable($token); + } + } + + private function inRow($token) + { + $clear = array('tr', 'html'); + + /* A start tag whose tag name is one of: "th", "td" */ + if ($token['type'] === HTML5::STARTTAG && + ($token['name'] === 'th' || $token['name'] === 'td') + ) { + /* Clear the stack back to a table row context. */ + $this->clearStackToTableContext($clear); + + /* Insert an HTML element for the token, then switch the insertion + mode to "in cell". */ + $this->insertElement($token); + $this->mode = self::IN_CELL; + + /* Insert a marker at the end of the list of active formatting + elements. */ + $this->a_formatting[] = self::MARKER; + + /* An end tag whose tag name is "tr" */ + } elseif ($token['type'] === HTML5::ENDTAG && $token['name'] === 'tr') { + /* If the stack of open elements does not have an element in table + scope with the same tag name as the token, this is a parse error. + Ignore the token. (innerHTML case) */ + if (!$this->elementInScope($token['name'], true)) { + // Ignore. + + /* Otherwise: */ + } else { + /* Clear the stack back to a table row context. */ + $this->clearStackToTableContext($clear); + + /* Pop the current node (which will be a tr element) from the + stack of open elements. Switch the insertion mode to "in table + body". */ + array_pop($this->stack); + $this->mode = self::IN_TBODY; + } + + /* A start tag whose tag name is one of: "caption", "col", "colgroup", + "tbody", "tfoot", "thead", "tr" or an end tag whose tag name is "table" */ + } elseif ($token['type'] === HTML5::STARTTAG && in_array( + $token['name'], + array('caption', 'col', 'colgroup', 'tbody', 'tfoot', 'thead', 'tr') + ) + ) { + /* Act as if an end tag with the tag name "tr" had been seen, then, + if that token wasn't ignored, reprocess the current token. */ + $this->inRow( + array( + 'name' => 'tr', + 'type' => HTML5::ENDTAG + ) + ); + + return $this->inCell($token); + + /* An end tag whose tag name is one of: "tbody", "tfoot", "thead" */ + } elseif ($token['type'] === HTML5::ENDTAG && + in_array($token['name'], array('tbody', 'tfoot', 'thead')) + ) { + /* If the stack of open elements does not have an element in table + scope with the same tag name as the token, this is a parse error. + Ignore the token. */ + if (!$this->elementInScope($token['name'], true)) { + // Ignore. + + /* Otherwise: */ + } else { + /* Otherwise, act as if an end tag with the tag name "tr" had + been seen, then reprocess the current token. */ + $this->inRow( + array( + 'name' => 'tr', + 'type' => HTML5::ENDTAG + ) + ); + + return $this->inCell($token); + } + + /* An end tag whose tag name is one of: "body", "caption", "col", + "colgroup", "html", "td", "th" */ + } elseif ($token['type'] === HTML5::ENDTAG && in_array( + $token['name'], + array('body', 'caption', 'col', 'colgroup', 'html', 'td', 'th', 'tr') + ) + ) { + /* Parse error. Ignore the token. */ + + /* Anything else */ + } else { + /* Process the token as if the insertion mode was "in table". */ + $this->inTable($token); + } + } + + private function inCell($token) + { + /* An end tag whose tag name is one of: "td", "th" */ + if ($token['type'] === HTML5::ENDTAG && + ($token['name'] === 'td' || $token['name'] === 'th') + ) { + /* If the stack of open elements does not have an element in table + scope with the same tag name as that of the token, then this is a + parse error and the token must be ignored. */ + if (!$this->elementInScope($token['name'], true)) { + // Ignore. + + /* Otherwise: */ + } else { + /* Generate implied end tags, except for elements with the same + tag name as the token. */ + $this->generateImpliedEndTags(array($token['name'])); + + /* Now, if the current node is not an element with the same tag + name as the token, then this is a parse error. */ + // k + + /* Pop elements from this stack until an element with the same + tag name as the token has been popped from the stack. */ + while (true) { + $node = end($this->stack)->nodeName; + array_pop($this->stack); + + if ($node === $token['name']) { + break; + } + } + + /* Clear the list of active formatting elements up to the last + marker. */ + $this->clearTheActiveFormattingElementsUpToTheLastMarker(); + + /* Switch the insertion mode to "in row". (The current node + will be a tr element at this point.) */ + $this->mode = self::IN_ROW; + } + + /* A start tag whose tag name is one of: "caption", "col", "colgroup", + "tbody", "td", "tfoot", "th", "thead", "tr" */ + } elseif ($token['type'] === HTML5::STARTTAG && in_array( + $token['name'], + array( + 'caption', + 'col', + 'colgroup', + 'tbody', + 'td', + 'tfoot', + 'th', + 'thead', + 'tr' + ) + ) + ) { + /* If the stack of open elements does not have a td or th element + in table scope, then this is a parse error; ignore the token. + (innerHTML case) */ + if (!$this->elementInScope(array('td', 'th'), true)) { + // Ignore. + + /* Otherwise, close the cell (see below) and reprocess the current + token. */ + } else { + $this->closeCell(); + return $this->inRow($token); + } + + /* A start tag whose tag name is one of: "caption", "col", "colgroup", + "tbody", "td", "tfoot", "th", "thead", "tr" */ + } elseif ($token['type'] === HTML5::STARTTAG && in_array( + $token['name'], + array( + 'caption', + 'col', + 'colgroup', + 'tbody', + 'td', + 'tfoot', + 'th', + 'thead', + 'tr' + ) + ) + ) { + /* If the stack of open elements does not have a td or th element + in table scope, then this is a parse error; ignore the token. + (innerHTML case) */ + if (!$this->elementInScope(array('td', 'th'), true)) { + // Ignore. + + /* Otherwise, close the cell (see below) and reprocess the current + token. */ + } else { + $this->closeCell(); + return $this->inRow($token); + } + + /* An end tag whose tag name is one of: "body", "caption", "col", + "colgroup", "html" */ + } elseif ($token['type'] === HTML5::ENDTAG && in_array( + $token['name'], + array('body', 'caption', 'col', 'colgroup', 'html') + ) + ) { + /* Parse error. Ignore the token. */ + + /* An end tag whose tag name is one of: "table", "tbody", "tfoot", + "thead", "tr" */ + } elseif ($token['type'] === HTML5::ENDTAG && in_array( + $token['name'], + array('table', 'tbody', 'tfoot', 'thead', 'tr') + ) + ) { + /* If the stack of open elements does not have an element in table + scope with the same tag name as that of the token (which can only + happen for "tbody", "tfoot" and "thead", or, in the innerHTML case), + then this is a parse error and the token must be ignored. */ + if (!$this->elementInScope($token['name'], true)) { + // Ignore. + + /* Otherwise, close the cell (see below) and reprocess the current + token. */ + } else { + $this->closeCell(); + return $this->inRow($token); + } + + /* Anything else */ + } else { + /* Process the token as if the insertion mode was "in body". */ + $this->inBody($token); + } + } + + private function inSelect($token) + { + /* Handle the token as follows: */ + + /* A character token */ + if ($token['type'] === HTML5::CHARACTR) { + /* Append the token's character to the current node. */ + $this->insertText($token['data']); + + /* A comment token */ + } elseif ($token['type'] === HTML5::COMMENT) { + /* Append a Comment node to the current node with the data + attribute set to the data given in the comment token. */ + $this->insertComment($token['data']); + + /* A start tag token whose tag name is "option" */ + } elseif ($token['type'] === HTML5::STARTTAG && + $token['name'] === 'option' + ) { + /* If the current node is an option element, act as if an end tag + with the tag name "option" had been seen. */ + if (end($this->stack)->nodeName === 'option') { + $this->inSelect( + array( + 'name' => 'option', + 'type' => HTML5::ENDTAG + ) + ); + } + + /* Insert an HTML element for the token. */ + $this->insertElement($token); + + /* A start tag token whose tag name is "optgroup" */ + } elseif ($token['type'] === HTML5::STARTTAG && + $token['name'] === 'optgroup' + ) { + /* If the current node is an option element, act as if an end tag + with the tag name "option" had been seen. */ + if (end($this->stack)->nodeName === 'option') { + $this->inSelect( + array( + 'name' => 'option', + 'type' => HTML5::ENDTAG + ) + ); + } + + /* If the current node is an optgroup element, act as if an end tag + with the tag name "optgroup" had been seen. */ + if (end($this->stack)->nodeName === 'optgroup') { + $this->inSelect( + array( + 'name' => 'optgroup', + 'type' => HTML5::ENDTAG + ) + ); + } + + /* Insert an HTML element for the token. */ + $this->insertElement($token); + + /* An end tag token whose tag name is "optgroup" */ + } elseif ($token['type'] === HTML5::ENDTAG && + $token['name'] === 'optgroup' + ) { + /* First, if the current node is an option element, and the node + immediately before it in the stack of open elements is an optgroup + element, then act as if an end tag with the tag name "option" had + been seen. */ + $elements_in_stack = count($this->stack); + + if ($this->stack[$elements_in_stack - 1]->nodeName === 'option' && + $this->stack[$elements_in_stack - 2]->nodeName === 'optgroup' + ) { + $this->inSelect( + array( + 'name' => 'option', + 'type' => HTML5::ENDTAG + ) + ); + } + + /* If the current node is an optgroup element, then pop that node + from the stack of open elements. Otherwise, this is a parse error, + ignore the token. */ + if ($this->stack[$elements_in_stack - 1] === 'optgroup') { + array_pop($this->stack); + } + + /* An end tag token whose tag name is "option" */ + } elseif ($token['type'] === HTML5::ENDTAG && + $token['name'] === 'option' + ) { + /* If the current node is an option element, then pop that node + from the stack of open elements. Otherwise, this is a parse error, + ignore the token. */ + if (end($this->stack)->nodeName === 'option') { + array_pop($this->stack); + } + + /* An end tag whose tag name is "select" */ + } elseif ($token['type'] === HTML5::ENDTAG && + $token['name'] === 'select' + ) { + /* If the stack of open elements does not have an element in table + scope with the same tag name as the token, this is a parse error. + Ignore the token. (innerHTML case) */ + if (!$this->elementInScope($token['name'], true)) { + // w/e + + /* Otherwise: */ + } else { + /* Pop elements from the stack of open elements until a select + element has been popped from the stack. */ + while (true) { + $current = end($this->stack)->nodeName; + array_pop($this->stack); + + if ($current === 'select') { + break; + } + } + + /* Reset the insertion mode appropriately. */ + $this->resetInsertionMode(); + } + + /* A start tag whose tag name is "select" */ + } elseif ($token['name'] === 'select' && + $token['type'] === HTML5::STARTTAG + ) { + /* Parse error. Act as if the token had been an end tag with the + tag name "select" instead. */ + $this->inSelect( + array( + 'name' => 'select', + 'type' => HTML5::ENDTAG + ) + ); + + /* An end tag whose tag name is one of: "caption", "table", "tbody", + "tfoot", "thead", "tr", "td", "th" */ + } elseif (in_array( + $token['name'], + array( + 'caption', + 'table', + 'tbody', + 'tfoot', + 'thead', + 'tr', + 'td', + 'th' + ) + ) && $token['type'] === HTML5::ENDTAG + ) { + /* Parse error. */ + // w/e + + /* If the stack of open elements has an element in table scope with + the same tag name as that of the token, then act as if an end tag + with the tag name "select" had been seen, and reprocess the token. + Otherwise, ignore the token. */ + if ($this->elementInScope($token['name'], true)) { + $this->inSelect( + array( + 'name' => 'select', + 'type' => HTML5::ENDTAG + ) + ); + + $this->mainPhase($token); + } + + /* Anything else */ + } else { + /* Parse error. Ignore the token. */ + } + } + + private function afterBody($token) + { + /* Handle the token as follows: */ + + /* A character token that is one of one of U+0009 CHARACTER TABULATION, + U+000A LINE FEED (LF), U+000B LINE TABULATION, U+000C FORM FEED (FF), + or U+0020 SPACE */ + if ($token['type'] === HTML5::CHARACTR && + preg_match('/^[\t\n\x0b\x0c ]+$/', $token['data']) + ) { + /* Process the token as it would be processed if the insertion mode + was "in body". */ + $this->inBody($token); + + /* A comment token */ + } elseif ($token['type'] === HTML5::COMMENT) { + /* Append a Comment node to the first element in the stack of open + elements (the html element), with the data attribute set to the + data given in the comment token. */ + $comment = $this->dom->createComment($token['data']); + $this->stack[0]->appendChild($comment); + + /* An end tag with the tag name "html" */ + } elseif ($token['type'] === HTML5::ENDTAG && $token['name'] === 'html') { + /* If the parser was originally created in order to handle the + setting of an element's innerHTML attribute, this is a parse error; + ignore the token. (The element will be an html element in this + case.) (innerHTML case) */ + + /* Otherwise, switch to the trailing end phase. */ + $this->phase = self::END_PHASE; + + /* Anything else */ + } else { + /* Parse error. Set the insertion mode to "in body" and reprocess + the token. */ + $this->mode = self::IN_BODY; + return $this->inBody($token); + } + } + + private function inFrameset($token) + { + /* Handle the token as follows: */ + + /* A character token that is one of one of U+0009 CHARACTER TABULATION, + U+000A LINE FEED (LF), U+000B LINE TABULATION, U+000C FORM FEED (FF), + U+000D CARRIAGE RETURN (CR), or U+0020 SPACE */ + if ($token['type'] === HTML5::CHARACTR && + preg_match('/^[\t\n\x0b\x0c ]+$/', $token['data']) + ) { + /* Append the character to the current node. */ + $this->insertText($token['data']); + + /* A comment token */ + } elseif ($token['type'] === HTML5::COMMENT) { + /* Append a Comment node to the current node with the data + attribute set to the data given in the comment token. */ + $this->insertComment($token['data']); + + /* A start tag with the tag name "frameset" */ + } elseif ($token['name'] === 'frameset' && + $token['type'] === HTML5::STARTTAG + ) { + $this->insertElement($token); + + /* An end tag with the tag name "frameset" */ + } elseif ($token['name'] === 'frameset' && + $token['type'] === HTML5::ENDTAG + ) { + /* If the current node is the root html element, then this is a + parse error; ignore the token. (innerHTML case) */ + if (end($this->stack)->nodeName === 'html') { + // Ignore + + } else { + /* Otherwise, pop the current node from the stack of open + elements. */ + array_pop($this->stack); + + /* If the parser was not originally created in order to handle + the setting of an element's innerHTML attribute (innerHTML case), + and the current node is no longer a frameset element, then change + the insertion mode to "after frameset". */ + $this->mode = self::AFTR_FRAME; + } + + /* A start tag with the tag name "frame" */ + } elseif ($token['name'] === 'frame' && + $token['type'] === HTML5::STARTTAG + ) { + /* Insert an HTML element for the token. */ + $this->insertElement($token); + + /* Immediately pop the current node off the stack of open elements. */ + array_pop($this->stack); + + /* A start tag with the tag name "noframes" */ + } elseif ($token['name'] === 'noframes' && + $token['type'] === HTML5::STARTTAG + ) { + /* Process the token as if the insertion mode had been "in body". */ + $this->inBody($token); + + /* Anything else */ + } else { + /* Parse error. Ignore the token. */ + } + } + + private function afterFrameset($token) + { + /* Handle the token as follows: */ + + /* A character token that is one of one of U+0009 CHARACTER TABULATION, + U+000A LINE FEED (LF), U+000B LINE TABULATION, U+000C FORM FEED (FF), + U+000D CARRIAGE RETURN (CR), or U+0020 SPACE */ + if ($token['type'] === HTML5::CHARACTR && + preg_match('/^[\t\n\x0b\x0c ]+$/', $token['data']) + ) { + /* Append the character to the current node. */ + $this->insertText($token['data']); + + /* A comment token */ + } elseif ($token['type'] === HTML5::COMMENT) { + /* Append a Comment node to the current node with the data + attribute set to the data given in the comment token. */ + $this->insertComment($token['data']); + + /* An end tag with the tag name "html" */ + } elseif ($token['name'] === 'html' && + $token['type'] === HTML5::ENDTAG + ) { + /* Switch to the trailing end phase. */ + $this->phase = self::END_PHASE; + + /* A start tag with the tag name "noframes" */ + } elseif ($token['name'] === 'noframes' && + $token['type'] === HTML5::STARTTAG + ) { + /* Process the token as if the insertion mode had been "in body". */ + $this->inBody($token); + + /* Anything else */ + } else { + /* Parse error. Ignore the token. */ + } + } + + private function trailingEndPhase($token) + { + /* After the main phase, as each token is emitted from the tokenisation + stage, it must be processed as described in this section. */ + + /* A DOCTYPE token */ + if ($token['type'] === HTML5::DOCTYPE) { + // Parse error. Ignore the token. + + /* A comment token */ + } elseif ($token['type'] === HTML5::COMMENT) { + /* Append a Comment node to the Document object with the data + attribute set to the data given in the comment token. */ + $comment = $this->dom->createComment($token['data']); + $this->dom->appendChild($comment); + + /* A character token that is one of one of U+0009 CHARACTER TABULATION, + U+000A LINE FEED (LF), U+000B LINE TABULATION, U+000C FORM FEED (FF), + or U+0020 SPACE */ + } elseif ($token['type'] === HTML5::CHARACTR && + preg_match('/^[\t\n\x0b\x0c ]+$/', $token['data']) + ) { + /* Process the token as it would be processed in the main phase. */ + $this->mainPhase($token); + + /* A character token that is not one of U+0009 CHARACTER TABULATION, + U+000A LINE FEED (LF), U+000B LINE TABULATION, U+000C FORM FEED (FF), + or U+0020 SPACE. Or a start tag token. Or an end tag token. */ + } elseif (($token['type'] === HTML5::CHARACTR && + preg_match('/^[\t\n\x0b\x0c ]+$/', $token['data'])) || + $token['type'] === HTML5::STARTTAG || $token['type'] === HTML5::ENDTAG + ) { + /* Parse error. Switch back to the main phase and reprocess the + token. */ + $this->phase = self::MAIN_PHASE; + return $this->mainPhase($token); + + /* An end-of-file token */ + } elseif ($token['type'] === HTML5::EOF) { + /* OMG DONE!! */ + } + } + + private function insertElement($token, $append = true, $check = false) + { + // Proprietary workaround for libxml2's limitations with tag names + if ($check) { + // Slightly modified HTML5 tag-name modification, + // removing anything that's not an ASCII letter, digit, or hyphen + $token['name'] = preg_replace('/[^a-z0-9-]/i', '', $token['name']); + // Remove leading hyphens and numbers + $token['name'] = ltrim($token['name'], '-0..9'); + // In theory, this should ever be needed, but just in case + if ($token['name'] === '') { + $token['name'] = 'span'; + } // arbitrary generic choice + } + + $el = $this->dom->createElement($token['name']); + + foreach ($token['attr'] as $attr) { + if (!$el->hasAttribute($attr['name'])) { + $el->setAttribute($attr['name'], $attr['value']); + } + } + + $this->appendToRealParent($el); + $this->stack[] = $el; + + return $el; + } + + private function insertText($data) + { + $text = $this->dom->createTextNode($data); + $this->appendToRealParent($text); + } + + private function insertComment($data) + { + $comment = $this->dom->createComment($data); + $this->appendToRealParent($comment); + } + + private function appendToRealParent($node) + { + if ($this->foster_parent === null) { + end($this->stack)->appendChild($node); + + } elseif ($this->foster_parent !== null) { + /* If the foster parent element is the parent element of the + last table element in the stack of open elements, then the new + node must be inserted immediately before the last table element + in the stack of open elements in the foster parent element; + otherwise, the new node must be appended to the foster parent + element. */ + for ($n = count($this->stack) - 1; $n >= 0; $n--) { + if ($this->stack[$n]->nodeName === 'table' && + $this->stack[$n]->parentNode !== null + ) { + $table = $this->stack[$n]; + break; + } + } + + if (isset($table) && $this->foster_parent->isSameNode($table->parentNode)) { + $this->foster_parent->insertBefore($node, $table); + } else { + $this->foster_parent->appendChild($node); + } + + $this->foster_parent = null; + } + } + + private function elementInScope($el, $table = false) + { + if (is_array($el)) { + foreach ($el as $element) { + if ($this->elementInScope($element, $table)) { + return true; + } + } + + return false; + } + + $leng = count($this->stack); + + for ($n = 0; $n < $leng; $n++) { + /* 1. Initialise node to be the current node (the bottommost node of + the stack). */ + $node = $this->stack[$leng - 1 - $n]; + + if ($node->tagName === $el) { + /* 2. If node is the target node, terminate in a match state. */ + return true; + + } elseif ($node->tagName === 'table') { + /* 3. Otherwise, if node is a table element, terminate in a failure + state. */ + return false; + + } elseif ($table === true && in_array( + $node->tagName, + array( + 'caption', + 'td', + 'th', + 'button', + 'marquee', + 'object' + ) + ) + ) { + /* 4. Otherwise, if the algorithm is the "has an element in scope" + variant (rather than the "has an element in table scope" variant), + and node is one of the following, terminate in a failure state. */ + return false; + + } elseif ($node === $node->ownerDocument->documentElement) { + /* 5. Otherwise, if node is an html element (root element), terminate + in a failure state. (This can only happen if the node is the topmost + node of the stack of open elements, and prevents the next step from + being invoked if there are no more elements in the stack.) */ + return false; + } + + /* Otherwise, set node to the previous entry in the stack of open + elements and return to step 2. (This will never fail, since the loop + will always terminate in the previous step if the top of the stack + is reached.) */ + } + } + + private function reconstructActiveFormattingElements() + { + /* 1. If there are no entries in the list of active formatting elements, + then there is nothing to reconstruct; stop this algorithm. */ + $formatting_elements = count($this->a_formatting); + + if ($formatting_elements === 0) { + return false; + } + + /* 3. Let entry be the last (most recently added) element in the list + of active formatting elements. */ + $entry = end($this->a_formatting); + + /* 2. If the last (most recently added) entry in the list of active + formatting elements is a marker, or if it is an element that is in the + stack of open elements, then there is nothing to reconstruct; stop this + algorithm. */ + if ($entry === self::MARKER || in_array($entry, $this->stack, true)) { + return false; + } + + for ($a = $formatting_elements - 1; $a >= 0; true) { + /* 4. If there are no entries before entry in the list of active + formatting elements, then jump to step 8. */ + if ($a === 0) { + $step_seven = false; + break; + } + + /* 5. Let entry be the entry one earlier than entry in the list of + active formatting elements. */ + $a--; + $entry = $this->a_formatting[$a]; + + /* 6. If entry is neither a marker nor an element that is also in + thetack of open elements, go to step 4. */ + if ($entry === self::MARKER || in_array($entry, $this->stack, true)) { + break; + } + } + + while (true) { + /* 7. Let entry be the element one later than entry in the list of + active formatting elements. */ + if (isset($step_seven) && $step_seven === true) { + $a++; + $entry = $this->a_formatting[$a]; + } + + /* 8. Perform a shallow clone of the element entry to obtain clone. */ + $clone = $entry->cloneNode(); + + /* 9. Append clone to the current node and push it onto the stack + of open elements so that it is the new current node. */ + end($this->stack)->appendChild($clone); + $this->stack[] = $clone; + + /* 10. Replace the entry for entry in the list with an entry for + clone. */ + $this->a_formatting[$a] = $clone; + + /* 11. If the entry for clone in the list of active formatting + elements is not the last entry in the list, return to step 7. */ + if (end($this->a_formatting) !== $clone) { + $step_seven = true; + } else { + break; + } + } + } + + private function clearTheActiveFormattingElementsUpToTheLastMarker() + { + /* When the steps below require the UA to clear the list of active + formatting elements up to the last marker, the UA must perform the + following steps: */ + + while (true) { + /* 1. Let entry be the last (most recently added) entry in the list + of active formatting elements. */ + $entry = end($this->a_formatting); + + /* 2. Remove entry from the list of active formatting elements. */ + array_pop($this->a_formatting); + + /* 3. If entry was a marker, then stop the algorithm at this point. + The list has been cleared up to the last marker. */ + if ($entry === self::MARKER) { + break; + } + } + } + + private function generateImpliedEndTags($exclude = array()) + { + /* When the steps below require the UA to generate implied end tags, + then, if the current node is a dd element, a dt element, an li element, + a p element, a td element, a th element, or a tr element, the UA must + act as if an end tag with the respective tag name had been seen and + then generate implied end tags again. */ + $node = end($this->stack); + $elements = array_diff(array('dd', 'dt', 'li', 'p', 'td', 'th', 'tr'), $exclude); + + while (in_array(end($this->stack)->nodeName, $elements)) { + array_pop($this->stack); + } + } + + private function getElementCategory($node) + { + $name = $node->tagName; + if (in_array($name, $this->special)) { + return self::SPECIAL; + } elseif (in_array($name, $this->scoping)) { + return self::SCOPING; + } elseif (in_array($name, $this->formatting)) { + return self::FORMATTING; + } else { + return self::PHRASING; + } + } + + private function clearStackToTableContext($elements) + { + /* When the steps above require the UA to clear the stack back to a + table context, it means that the UA must, while the current node is not + a table element or an html element, pop elements from the stack of open + elements. If this causes any elements to be popped from the stack, then + this is a parse error. */ + while (true) { + $node = end($this->stack)->nodeName; + + if (in_array($node, $elements)) { + break; + } else { + array_pop($this->stack); + } + } + } + + private function resetInsertionMode() + { + /* 1. Let last be false. */ + $last = false; + $leng = count($this->stack); + + for ($n = $leng - 1; $n >= 0; $n--) { + /* 2. Let node be the last node in the stack of open elements. */ + $node = $this->stack[$n]; + + /* 3. If node is the first node in the stack of open elements, then + set last to true. If the element whose innerHTML attribute is being + set is neither a td element nor a th element, then set node to the + element whose innerHTML attribute is being set. (innerHTML case) */ + if ($this->stack[0]->isSameNode($node)) { + $last = true; + } + + /* 4. If node is a select element, then switch the insertion mode to + "in select" and abort these steps. (innerHTML case) */ + if ($node->nodeName === 'select') { + $this->mode = self::IN_SELECT; + break; + + /* 5. If node is a td or th element, then switch the insertion mode + to "in cell" and abort these steps. */ + } elseif ($node->nodeName === 'td' || $node->nodeName === 'th') { + $this->mode = self::IN_CELL; + break; + + /* 6. If node is a tr element, then switch the insertion mode to + "in row" and abort these steps. */ + } elseif ($node->nodeName === 'tr') { + $this->mode = self::IN_ROW; + break; + + /* 7. If node is a tbody, thead, or tfoot element, then switch the + insertion mode to "in table body" and abort these steps. */ + } elseif (in_array($node->nodeName, array('tbody', 'thead', 'tfoot'))) { + $this->mode = self::IN_TBODY; + break; + + /* 8. If node is a caption element, then switch the insertion mode + to "in caption" and abort these steps. */ + } elseif ($node->nodeName === 'caption') { + $this->mode = self::IN_CAPTION; + break; + + /* 9. If node is a colgroup element, then switch the insertion mode + to "in column group" and abort these steps. (innerHTML case) */ + } elseif ($node->nodeName === 'colgroup') { + $this->mode = self::IN_CGROUP; + break; + + /* 10. If node is a table element, then switch the insertion mode + to "in table" and abort these steps. */ + } elseif ($node->nodeName === 'table') { + $this->mode = self::IN_TABLE; + break; + + /* 11. If node is a head element, then switch the insertion mode + to "in body" ("in body"! not "in head"!) and abort these steps. + (innerHTML case) */ + } elseif ($node->nodeName === 'head') { + $this->mode = self::IN_BODY; + break; + + /* 12. If node is a body element, then switch the insertion mode to + "in body" and abort these steps. */ + } elseif ($node->nodeName === 'body') { + $this->mode = self::IN_BODY; + break; + + /* 13. If node is a frameset element, then switch the insertion + mode to "in frameset" and abort these steps. (innerHTML case) */ + } elseif ($node->nodeName === 'frameset') { + $this->mode = self::IN_FRAME; + break; + + /* 14. If node is an html element, then: if the head element + pointer is null, switch the insertion mode to "before head", + otherwise, switch the insertion mode to "after head". In either + case, abort these steps. (innerHTML case) */ + } elseif ($node->nodeName === 'html') { + $this->mode = ($this->head_pointer === null) + ? self::BEFOR_HEAD + : self::AFTER_HEAD; + + break; + + /* 15. If last is true, then set the insertion mode to "in body" + and abort these steps. (innerHTML case) */ + } elseif ($last) { + $this->mode = self::IN_BODY; + break; + } + } + } + + private function closeCell() + { + /* If the stack of open elements has a td or th element in table scope, + then act as if an end tag token with that tag name had been seen. */ + foreach (array('td', 'th') as $cell) { + if ($this->elementInScope($cell, true)) { + $this->inCell( + array( + 'name' => $cell, + 'type' => HTML5::ENDTAG + ) + ); + + break; + } + } + } + + public function save() + { + return $this->dom; + } +} diff --git a/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/Node.php b/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/Node.php similarity index 96% rename from plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/Node.php rename to plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/Node.php index d7dcf62..3995fec 100755 --- a/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/Node.php +++ b/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/Node.php @@ -1,49 +1,49 @@ -data = $data; - $this->line = $line; - $this->col = $col; - } - - public function toTokenPair() { - return array(new HTMLPurifier_Token_Comment($this->data, $this->line, $this->col), null); - } -} +data = $data; + $this->line = $line; + $this->col = $col; + } + + public function toTokenPair() { + return array(new HTMLPurifier_Token_Comment($this->data, $this->line, $this->col), null); + } +} diff --git a/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/Node/Element.php b/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/Node/Element.php similarity index 96% rename from plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/Node/Element.php rename to plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/Node/Element.php index 7db4d02..6cbf56d 100755 --- a/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/Node/Element.php +++ b/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/Node/Element.php @@ -1,59 +1,59 @@ - form or the form, i.e. - * is it a pair of start/end tokens or an empty token. - * @bool - */ - public $empty = false; - - public $endCol = null, $endLine = null, $endArmor = array(); - - public function __construct($name, $attr = array(), $line = null, $col = null, $armor = array()) { - $this->name = $name; - $this->attr = $attr; - $this->line = $line; - $this->col = $col; - $this->armor = $armor; - } - - public function toTokenPair() { - // XXX inefficiency here, normalization is not necessary - if ($this->empty) { - return array(new HTMLPurifier_Token_Empty($this->name, $this->attr, $this->line, $this->col, $this->armor), null); - } else { - $start = new HTMLPurifier_Token_Start($this->name, $this->attr, $this->line, $this->col, $this->armor); - $end = new HTMLPurifier_Token_End($this->name, array(), $this->endLine, $this->endCol, $this->endArmor); - //$end->start = $start; - return array($start, $end); - } - } -} - + form or the form, i.e. + * is it a pair of start/end tokens or an empty token. + * @bool + */ + public $empty = false; + + public $endCol = null, $endLine = null, $endArmor = array(); + + public function __construct($name, $attr = array(), $line = null, $col = null, $armor = array()) { + $this->name = $name; + $this->attr = $attr; + $this->line = $line; + $this->col = $col; + $this->armor = $armor; + } + + public function toTokenPair() { + // XXX inefficiency here, normalization is not necessary + if ($this->empty) { + return array(new HTMLPurifier_Token_Empty($this->name, $this->attr, $this->line, $this->col, $this->armor), null); + } else { + $start = new HTMLPurifier_Token_Start($this->name, $this->attr, $this->line, $this->col, $this->armor); + $end = new HTMLPurifier_Token_End($this->name, array(), $this->endLine, $this->endCol, $this->endArmor); + //$end->start = $start; + return array($start, $end); + } + } +} + diff --git a/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/Node/Text.php b/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/Node/Text.php similarity index 96% rename from plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/Node/Text.php rename to plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/Node/Text.php index f51d861..aec9166 100755 --- a/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/Node/Text.php +++ b/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/Node/Text.php @@ -1,54 +1,54 @@ -data = $data; - $this->is_whitespace = $is_whitespace; - $this->line = $line; - $this->col = $col; - } - - public function toTokenPair() { - return array(new HTMLPurifier_Token_Text($this->data, $this->line, $this->col), null); - } -} - -// vim: et sw=4 sts=4 +data = $data; + $this->is_whitespace = $is_whitespace; + $this->line = $line; + $this->col = $col; + } + + public function toTokenPair() { + return array(new HTMLPurifier_Token_Text($this->data, $this->line, $this->col), null); + } +} + +// vim: et sw=4 sts=4 diff --git a/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/PercentEncoder.php b/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/PercentEncoder.php similarity index 96% rename from plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/PercentEncoder.php rename to plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/PercentEncoder.php index fb9fd1f..18c8bbb 100755 --- a/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/PercentEncoder.php +++ b/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/PercentEncoder.php @@ -1,111 +1,111 @@ -preserve[$i] = true; - } - for ($i = 65; $i <= 90; $i++) { // upper-case - $this->preserve[$i] = true; - } - for ($i = 97; $i <= 122; $i++) { // lower-case - $this->preserve[$i] = true; - } - $this->preserve[45] = true; // Dash - - $this->preserve[46] = true; // Period . - $this->preserve[95] = true; // Underscore _ - $this->preserve[126]= true; // Tilde ~ - - // extra letters not to escape - if ($preserve !== false) { - for ($i = 0, $c = strlen($preserve); $i < $c; $i++) { - $this->preserve[ord($preserve[$i])] = true; - } - } - } - - /** - * Our replacement for urlencode, it encodes all non-reserved characters, - * as well as any extra characters that were instructed to be preserved. - * @note - * Assumes that the string has already been normalized, making any - * and all percent escape sequences valid. Percents will not be - * re-escaped, regardless of their status in $preserve - * @param string $string String to be encoded - * @return string Encoded string. - */ - public function encode($string) - { - $ret = ''; - for ($i = 0, $c = strlen($string); $i < $c; $i++) { - if ($string[$i] !== '%' && !isset($this->preserve[$int = ord($string[$i])])) { - $ret .= '%' . sprintf('%02X', $int); - } else { - $ret .= $string[$i]; - } - } - return $ret; - } - - /** - * Fix up percent-encoding by decoding unreserved characters and normalizing. - * @warning This function is affected by $preserve, even though the - * usual desired behavior is for this not to preserve those - * characters. Be careful when reusing instances of PercentEncoder! - * @param string $string String to normalize - * @return string - */ - public function normalize($string) - { - if ($string == '') { - return ''; - } - $parts = explode('%', $string); - $ret = array_shift($parts); - foreach ($parts as $part) { - $length = strlen($part); - if ($length < 2) { - $ret .= '%25' . $part; - continue; - } - $encoding = substr($part, 0, 2); - $text = substr($part, 2); - if (!ctype_xdigit($encoding)) { - $ret .= '%25' . $part; - continue; - } - $int = hexdec($encoding); - if (isset($this->preserve[$int])) { - $ret .= chr($int) . $text; - continue; - } - $encoding = strtoupper($encoding); - $ret .= '%' . $encoding . $text; - } - return $ret; - } -} - -// vim: et sw=4 sts=4 +preserve[$i] = true; + } + for ($i = 65; $i <= 90; $i++) { // upper-case + $this->preserve[$i] = true; + } + for ($i = 97; $i <= 122; $i++) { // lower-case + $this->preserve[$i] = true; + } + $this->preserve[45] = true; // Dash - + $this->preserve[46] = true; // Period . + $this->preserve[95] = true; // Underscore _ + $this->preserve[126]= true; // Tilde ~ + + // extra letters not to escape + if ($preserve !== false) { + for ($i = 0, $c = strlen($preserve); $i < $c; $i++) { + $this->preserve[ord($preserve[$i])] = true; + } + } + } + + /** + * Our replacement for urlencode, it encodes all non-reserved characters, + * as well as any extra characters that were instructed to be preserved. + * @note + * Assumes that the string has already been normalized, making any + * and all percent escape sequences valid. Percents will not be + * re-escaped, regardless of their status in $preserve + * @param string $string String to be encoded + * @return string Encoded string. + */ + public function encode($string) + { + $ret = ''; + for ($i = 0, $c = strlen($string); $i < $c; $i++) { + if ($string[$i] !== '%' && !isset($this->preserve[$int = ord($string[$i])])) { + $ret .= '%' . sprintf('%02X', $int); + } else { + $ret .= $string[$i]; + } + } + return $ret; + } + + /** + * Fix up percent-encoding by decoding unreserved characters and normalizing. + * @warning This function is affected by $preserve, even though the + * usual desired behavior is for this not to preserve those + * characters. Be careful when reusing instances of PercentEncoder! + * @param string $string String to normalize + * @return string + */ + public function normalize($string) + { + if ($string == '') { + return ''; + } + $parts = explode('%', $string); + $ret = array_shift($parts); + foreach ($parts as $part) { + $length = strlen($part); + if ($length < 2) { + $ret .= '%25' . $part; + continue; + } + $encoding = substr($part, 0, 2); + $text = substr($part, 2); + if (!ctype_xdigit($encoding)) { + $ret .= '%25' . $part; + continue; + } + $int = hexdec($encoding); + if (isset($this->preserve[$int])) { + $ret .= chr($int) . $text; + continue; + } + $encoding = strtoupper($encoding); + $ret .= '%' . $encoding . $text; + } + return $ret; + } +} + +// vim: et sw=4 sts=4 diff --git a/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/Printer.php b/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/Printer.php similarity index 96% rename from plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/Printer.php rename to plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/Printer.php index 16acd41..549e4ce 100755 --- a/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/Printer.php +++ b/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/Printer.php @@ -1,218 +1,218 @@ -getAll(); - $context = new HTMLPurifier_Context(); - $this->generator = new HTMLPurifier_Generator($config, $context); - } - - /** - * Main function that renders object or aspect of that object - * @note Parameters vary depending on printer - */ - // function render() {} - - /** - * Returns a start tag - * @param string $tag Tag name - * @param array $attr Attribute array - * @return string - */ - protected function start($tag, $attr = array()) - { - return $this->generator->generateFromToken( - new HTMLPurifier_Token_Start($tag, $attr ? $attr : array()) - ); - } - - /** - * Returns an end tag - * @param string $tag Tag name - * @return string - */ - protected function end($tag) - { - return $this->generator->generateFromToken( - new HTMLPurifier_Token_End($tag) - ); - } - - /** - * Prints a complete element with content inside - * @param string $tag Tag name - * @param string $contents Element contents - * @param array $attr Tag attributes - * @param bool $escape whether or not to escape contents - * @return string - */ - protected function element($tag, $contents, $attr = array(), $escape = true) - { - return $this->start($tag, $attr) . - ($escape ? $this->escape($contents) : $contents) . - $this->end($tag); - } - - /** - * @param string $tag - * @param array $attr - * @return string - */ - protected function elementEmpty($tag, $attr = array()) - { - return $this->generator->generateFromToken( - new HTMLPurifier_Token_Empty($tag, $attr) - ); - } - - /** - * @param string $text - * @return string - */ - protected function text($text) - { - return $this->generator->generateFromToken( - new HTMLPurifier_Token_Text($text) - ); - } - - /** - * Prints a simple key/value row in a table. - * @param string $name Key - * @param mixed $value Value - * @return string - */ - protected function row($name, $value) - { - if (is_bool($value)) { - $value = $value ? 'On' : 'Off'; - } - return - $this->start('tr') . "\n" . - $this->element('th', $name) . "\n" . - $this->element('td', $value) . "\n" . - $this->end('tr'); - } - - /** - * Escapes a string for HTML output. - * @param string $string String to escape - * @return string - */ - protected function escape($string) - { - $string = HTMLPurifier_Encoder::cleanUTF8($string); - $string = htmlspecialchars($string, ENT_COMPAT, 'UTF-8'); - return $string; - } - - /** - * Takes a list of strings and turns them into a single list - * @param string[] $array List of strings - * @param bool $polite Bool whether or not to add an end before the last - * @return string - */ - protected function listify($array, $polite = false) - { - if (empty($array)) { - return 'None'; - } - $ret = ''; - $i = count($array); - foreach ($array as $value) { - $i--; - $ret .= $value; - if ($i > 0 && !($polite && $i == 1)) { - $ret .= ', '; - } - if ($polite && $i == 1) { - $ret .= 'and '; - } - } - return $ret; - } - - /** - * Retrieves the class of an object without prefixes, as well as metadata - * @param object $obj Object to determine class of - * @param string $sec_prefix Further prefix to remove - * @return string - */ - protected function getClass($obj, $sec_prefix = '') - { - static $five = null; - if ($five === null) { - $five = version_compare(PHP_VERSION, '5', '>='); - } - $prefix = 'HTMLPurifier_' . $sec_prefix; - if (!$five) { - $prefix = strtolower($prefix); - } - $class = str_replace($prefix, '', get_class($obj)); - $lclass = strtolower($class); - $class .= '('; - switch ($lclass) { - case 'enum': - $values = array(); - foreach ($obj->valid_values as $value => $bool) { - $values[] = $value; - } - $class .= implode(', ', $values); - break; - case 'css_composite': - $values = array(); - foreach ($obj->defs as $def) { - $values[] = $this->getClass($def, $sec_prefix); - } - $class .= implode(', ', $values); - break; - case 'css_multiple': - $class .= $this->getClass($obj->single, $sec_prefix) . ', '; - $class .= $obj->max; - break; - case 'css_denyelementdecorator': - $class .= $this->getClass($obj->def, $sec_prefix) . ', '; - $class .= $obj->element; - break; - case 'css_importantdecorator': - $class .= $this->getClass($obj->def, $sec_prefix); - if ($obj->allow) { - $class .= ', !important'; - } - break; - } - $class .= ')'; - return $class; - } -} - -// vim: et sw=4 sts=4 +getAll(); + $context = new HTMLPurifier_Context(); + $this->generator = new HTMLPurifier_Generator($config, $context); + } + + /** + * Main function that renders object or aspect of that object + * @note Parameters vary depending on printer + */ + // function render() {} + + /** + * Returns a start tag + * @param string $tag Tag name + * @param array $attr Attribute array + * @return string + */ + protected function start($tag, $attr = array()) + { + return $this->generator->generateFromToken( + new HTMLPurifier_Token_Start($tag, $attr ? $attr : array()) + ); + } + + /** + * Returns an end tag + * @param string $tag Tag name + * @return string + */ + protected function end($tag) + { + return $this->generator->generateFromToken( + new HTMLPurifier_Token_End($tag) + ); + } + + /** + * Prints a complete element with content inside + * @param string $tag Tag name + * @param string $contents Element contents + * @param array $attr Tag attributes + * @param bool $escape whether or not to escape contents + * @return string + */ + protected function element($tag, $contents, $attr = array(), $escape = true) + { + return $this->start($tag, $attr) . + ($escape ? $this->escape($contents) : $contents) . + $this->end($tag); + } + + /** + * @param string $tag + * @param array $attr + * @return string + */ + protected function elementEmpty($tag, $attr = array()) + { + return $this->generator->generateFromToken( + new HTMLPurifier_Token_Empty($tag, $attr) + ); + } + + /** + * @param string $text + * @return string + */ + protected function text($text) + { + return $this->generator->generateFromToken( + new HTMLPurifier_Token_Text($text) + ); + } + + /** + * Prints a simple key/value row in a table. + * @param string $name Key + * @param mixed $value Value + * @return string + */ + protected function row($name, $value) + { + if (is_bool($value)) { + $value = $value ? 'On' : 'Off'; + } + return + $this->start('tr') . "\n" . + $this->element('th', $name) . "\n" . + $this->element('td', $value) . "\n" . + $this->end('tr'); + } + + /** + * Escapes a string for HTML output. + * @param string $string String to escape + * @return string + */ + protected function escape($string) + { + $string = HTMLPurifier_Encoder::cleanUTF8($string); + $string = htmlspecialchars($string, ENT_COMPAT, 'UTF-8'); + return $string; + } + + /** + * Takes a list of strings and turns them into a single list + * @param string[] $array List of strings + * @param bool $polite Bool whether or not to add an end before the last + * @return string + */ + protected function listify($array, $polite = false) + { + if (empty($array)) { + return 'None'; + } + $ret = ''; + $i = count($array); + foreach ($array as $value) { + $i--; + $ret .= $value; + if ($i > 0 && !($polite && $i == 1)) { + $ret .= ', '; + } + if ($polite && $i == 1) { + $ret .= 'and '; + } + } + return $ret; + } + + /** + * Retrieves the class of an object without prefixes, as well as metadata + * @param object $obj Object to determine class of + * @param string $sec_prefix Further prefix to remove + * @return string + */ + protected function getClass($obj, $sec_prefix = '') + { + static $five = null; + if ($five === null) { + $five = version_compare(PHP_VERSION, '5', '>='); + } + $prefix = 'HTMLPurifier_' . $sec_prefix; + if (!$five) { + $prefix = strtolower($prefix); + } + $class = str_replace($prefix, '', get_class($obj)); + $lclass = strtolower($class); + $class .= '('; + switch ($lclass) { + case 'enum': + $values = array(); + foreach ($obj->valid_values as $value => $bool) { + $values[] = $value; + } + $class .= implode(', ', $values); + break; + case 'css_composite': + $values = array(); + foreach ($obj->defs as $def) { + $values[] = $this->getClass($def, $sec_prefix); + } + $class .= implode(', ', $values); + break; + case 'css_multiple': + $class .= $this->getClass($obj->single, $sec_prefix) . ', '; + $class .= $obj->max; + break; + case 'css_denyelementdecorator': + $class .= $this->getClass($obj->def, $sec_prefix) . ', '; + $class .= $obj->element; + break; + case 'css_importantdecorator': + $class .= $this->getClass($obj->def, $sec_prefix); + if ($obj->allow) { + $class .= ', !important'; + } + break; + } + $class .= ')'; + return $class; + } +} + +// vim: et sw=4 sts=4 diff --git a/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/Printer/CSSDefinition.php b/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/Printer/CSSDefinition.php similarity index 96% rename from plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/Printer/CSSDefinition.php rename to plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/Printer/CSSDefinition.php index afc8c18..29505fe 100755 --- a/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/Printer/CSSDefinition.php +++ b/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/Printer/CSSDefinition.php @@ -1,44 +1,44 @@ -def = $config->getCSSDefinition(); - $ret = ''; - - $ret .= $this->start('div', array('class' => 'HTMLPurifier_Printer')); - $ret .= $this->start('table'); - - $ret .= $this->element('caption', 'Properties ($info)'); - - $ret .= $this->start('thead'); - $ret .= $this->start('tr'); - $ret .= $this->element('th', 'Property', array('class' => 'heavy')); - $ret .= $this->element('th', 'Definition', array('class' => 'heavy', 'style' => 'width:auto;')); - $ret .= $this->end('tr'); - $ret .= $this->end('thead'); - - ksort($this->def->info); - foreach ($this->def->info as $property => $obj) { - $name = $this->getClass($obj, 'AttrDef_'); - $ret .= $this->row($property, $name); - } - - $ret .= $this->end('table'); - $ret .= $this->end('div'); - - return $ret; - } -} - -// vim: et sw=4 sts=4 +def = $config->getCSSDefinition(); + $ret = ''; + + $ret .= $this->start('div', array('class' => 'HTMLPurifier_Printer')); + $ret .= $this->start('table'); + + $ret .= $this->element('caption', 'Properties ($info)'); + + $ret .= $this->start('thead'); + $ret .= $this->start('tr'); + $ret .= $this->element('th', 'Property', array('class' => 'heavy')); + $ret .= $this->element('th', 'Definition', array('class' => 'heavy', 'style' => 'width:auto;')); + $ret .= $this->end('tr'); + $ret .= $this->end('thead'); + + ksort($this->def->info); + foreach ($this->def->info as $property => $obj) { + $name = $this->getClass($obj, 'AttrDef_'); + $ret .= $this->row($property, $name); + } + + $ret .= $this->end('table'); + $ret .= $this->end('div'); + + return $ret; + } +} + +// vim: et sw=4 sts=4 diff --git a/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/Printer/ConfigForm.css b/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/Printer/ConfigForm.css similarity index 96% rename from plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/Printer/ConfigForm.css rename to plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/Printer/ConfigForm.css index 7af30fc..3ff1a88 100755 --- a/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/Printer/ConfigForm.css +++ b/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/Printer/ConfigForm.css @@ -1,10 +1,10 @@ - -.hp-config {} - -.hp-config tbody th {text-align:right; padding-right:0.5em;} -.hp-config thead, .hp-config .namespace {background:#3C578C; color:#FFF;} -.hp-config .namespace th {text-align:center;} -.hp-config .verbose {display:none;} -.hp-config .controls {text-align:center;} - -/* vim: et sw=4 sts=4 */ + +.hp-config {} + +.hp-config tbody th {text-align:right; padding-right:0.5em;} +.hp-config thead, .hp-config .namespace {background:#3C578C; color:#FFF;} +.hp-config .namespace th {text-align:center;} +.hp-config .verbose {display:none;} +.hp-config .controls {text-align:center;} + +/* vim: et sw=4 sts=4 */ diff --git a/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/Printer/ConfigForm.js b/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/Printer/ConfigForm.js similarity index 96% rename from plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/Printer/ConfigForm.js rename to plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/Printer/ConfigForm.js index 83e0655..cba00c9 100755 --- a/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/Printer/ConfigForm.js +++ b/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/Printer/ConfigForm.js @@ -1,5 +1,5 @@ -function toggleWriteability(id_of_patient, checked) { - document.getElementById(id_of_patient).disabled = checked; -} - -// vim: et sw=4 sts=4 +function toggleWriteability(id_of_patient, checked) { + document.getElementById(id_of_patient).disabled = checked; +} + +// vim: et sw=4 sts=4 diff --git a/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/Printer/ConfigForm.php b/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/Printer/ConfigForm.php similarity index 97% rename from plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/Printer/ConfigForm.php rename to plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/Printer/ConfigForm.php index 660960f..65a7779 100755 --- a/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/Printer/ConfigForm.php +++ b/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/Printer/ConfigForm.php @@ -1,447 +1,451 @@ -docURL = $doc_url; - $this->name = $name; - $this->compress = $compress; - // initialize sub-printers - $this->fields[0] = new HTMLPurifier_Printer_ConfigForm_default(); - $this->fields[HTMLPurifier_VarParser::BOOL] = new HTMLPurifier_Printer_ConfigForm_bool(); - } - - /** - * Sets default column and row size for textareas in sub-printers - * @param $cols Integer columns of textarea, null to use default - * @param $rows Integer rows of textarea, null to use default - */ - public function setTextareaDimensions($cols = null, $rows = null) - { - if ($cols) { - $this->fields['default']->cols = $cols; - } - if ($rows) { - $this->fields['default']->rows = $rows; - } - } - - /** - * Retrieves styling, in case it is not accessible by webserver - */ - public static function getCSS() - { - return file_get_contents(HTMLPURIFIER_PREFIX . '/HTMLPurifier/Printer/ConfigForm.css'); - } - - /** - * Retrieves JavaScript, in case it is not accessible by webserver - */ - public static function getJavaScript() - { - return file_get_contents(HTMLPURIFIER_PREFIX . '/HTMLPurifier/Printer/ConfigForm.js'); - } - - /** - * Returns HTML output for a configuration form - * @param HTMLPurifier_Config|array $config Configuration object of current form state, or an array - * where [0] has an HTML namespace and [1] is being rendered. - * @param array|bool $allowed Optional namespace(s) and directives to restrict form to. - * @param bool $render_controls - * @return string - */ - public function render($config, $allowed = true, $render_controls = true) - { - if (is_array($config) && isset($config[0])) { - $gen_config = $config[0]; - $config = $config[1]; - } else { - $gen_config = $config; - } - - $this->config = $config; - $this->genConfig = $gen_config; - $this->prepareGenerator($gen_config); - - $allowed = HTMLPurifier_Config::getAllowedDirectivesForForm($allowed, $config->def); - $all = array(); - foreach ($allowed as $key) { - list($ns, $directive) = $key; - $all[$ns][$directive] = $config->get($ns . '.' . $directive); - } - - $ret = ''; - $ret .= $this->start('table', array('class' => 'hp-config')); - $ret .= $this->start('thead'); - $ret .= $this->start('tr'); - $ret .= $this->element('th', 'Directive', array('class' => 'hp-directive')); - $ret .= $this->element('th', 'Value', array('class' => 'hp-value')); - $ret .= $this->end('tr'); - $ret .= $this->end('thead'); - foreach ($all as $ns => $directives) { - $ret .= $this->renderNamespace($ns, $directives); - } - if ($render_controls) { - $ret .= $this->start('tbody'); - $ret .= $this->start('tr'); - $ret .= $this->start('td', array('colspan' => 2, 'class' => 'controls')); - $ret .= $this->elementEmpty('input', array('type' => 'submit', 'value' => 'Submit')); - $ret .= '[Reset]'; - $ret .= $this->end('td'); - $ret .= $this->end('tr'); - $ret .= $this->end('tbody'); - } - $ret .= $this->end('table'); - return $ret; - } - - /** - * Renders a single namespace - * @param $ns String namespace name - * @param array $directives array of directives to values - * @return string - */ - protected function renderNamespace($ns, $directives) - { - $ret = ''; - $ret .= $this->start('tbody', array('class' => 'namespace')); - $ret .= $this->start('tr'); - $ret .= $this->element('th', $ns, array('colspan' => 2)); - $ret .= $this->end('tr'); - $ret .= $this->end('tbody'); - $ret .= $this->start('tbody'); - foreach ($directives as $directive => $value) { - $ret .= $this->start('tr'); - $ret .= $this->start('th'); - if ($this->docURL) { - $url = str_replace('%s', urlencode("$ns.$directive"), $this->docURL); - $ret .= $this->start('a', array('href' => $url)); - } - $attr = array('for' => "{$this->name}:$ns.$directive"); - - // crop directive name if it's too long - if (!$this->compress || (strlen($directive) < $this->compress)) { - $directive_disp = $directive; - } else { - $directive_disp = substr($directive, 0, $this->compress - 2) . '...'; - $attr['title'] = $directive; - } - - $ret .= $this->element( - 'label', - $directive_disp, - // component printers must create an element with this id - $attr - ); - if ($this->docURL) { - $ret .= $this->end('a'); - } - $ret .= $this->end('th'); - - $ret .= $this->start('td'); - $def = $this->config->def->info["$ns.$directive"]; - if (is_int($def)) { - $allow_null = $def < 0; - $type = abs($def); - } else { - $type = $def->type; - $allow_null = isset($def->allow_null); - } - if (!isset($this->fields[$type])) { - $type = 0; - } // default - $type_obj = $this->fields[$type]; - if ($allow_null) { - $type_obj = new HTMLPurifier_Printer_ConfigForm_NullDecorator($type_obj); - } - $ret .= $type_obj->render($ns, $directive, $value, $this->name, array($this->genConfig, $this->config)); - $ret .= $this->end('td'); - $ret .= $this->end('tr'); - } - $ret .= $this->end('tbody'); - return $ret; - } - -} - -/** - * Printer decorator for directives that accept null - */ -class HTMLPurifier_Printer_ConfigForm_NullDecorator extends HTMLPurifier_Printer -{ - /** - * Printer being decorated - * @type HTMLPurifier_Printer - */ - protected $obj; - - /** - * @param HTMLPurifier_Printer $obj Printer to decorate - */ - public function __construct($obj) - { - parent::__construct(); - $this->obj = $obj; - } - - /** - * @param string $ns - * @param string $directive - * @param string $value - * @param string $name - * @param HTMLPurifier_Config|array $config - * @return string - */ - public function render($ns, $directive, $value, $name, $config) - { - if (is_array($config) && isset($config[0])) { - $gen_config = $config[0]; - $config = $config[1]; - } else { - $gen_config = $config; - } - $this->prepareGenerator($gen_config); - - $ret = ''; - $ret .= $this->start('label', array('for' => "$name:Null_$ns.$directive")); - $ret .= $this->element('span', "$ns.$directive:", array('class' => 'verbose')); - $ret .= $this->text(' Null/Disabled'); - $ret .= $this->end('label'); - $attr = array( - 'type' => 'checkbox', - 'value' => '1', - 'class' => 'null-toggle', - 'name' => "$name" . "[Null_$ns.$directive]", - 'id' => "$name:Null_$ns.$directive", - 'onclick' => "toggleWriteability('$name:$ns.$directive',checked)" // INLINE JAVASCRIPT!!!! - ); - if ($this->obj instanceof HTMLPurifier_Printer_ConfigForm_bool) { - // modify inline javascript slightly - $attr['onclick'] = - "toggleWriteability('$name:Yes_$ns.$directive',checked);" . - "toggleWriteability('$name:No_$ns.$directive',checked)"; - } - if ($value === null) { - $attr['checked'] = 'checked'; - } - $ret .= $this->elementEmpty('input', $attr); - $ret .= $this->text(' or '); - $ret .= $this->elementEmpty('br'); - $ret .= $this->obj->render($ns, $directive, $value, $name, array($gen_config, $config)); - return $ret; - } -} - -/** - * Swiss-army knife configuration form field printer - */ -class HTMLPurifier_Printer_ConfigForm_default extends HTMLPurifier_Printer -{ - /** - * @type int - */ - public $cols = 18; - - /** - * @type int - */ - public $rows = 5; - - /** - * @param string $ns - * @param string $directive - * @param string $value - * @param string $name - * @param HTMLPurifier_Config|array $config - * @return string - */ - public function render($ns, $directive, $value, $name, $config) - { - if (is_array($config) && isset($config[0])) { - $gen_config = $config[0]; - $config = $config[1]; - } else { - $gen_config = $config; - } - $this->prepareGenerator($gen_config); - // this should probably be split up a little - $ret = ''; - $def = $config->def->info["$ns.$directive"]; - if (is_int($def)) { - $type = abs($def); - } else { - $type = $def->type; - } - if (is_array($value)) { - switch ($type) { - case HTMLPurifier_VarParser::LOOKUP: - $array = $value; - $value = array(); - foreach ($array as $val => $b) { - $value[] = $val; - } - //TODO does this need a break? - case HTMLPurifier_VarParser::ALIST: - $value = implode(PHP_EOL, $value); - break; - case HTMLPurifier_VarParser::HASH: - $nvalue = ''; - foreach ($value as $i => $v) { - $nvalue .= "$i:$v" . PHP_EOL; - } - $value = $nvalue; - break; - default: - $value = ''; - } - } - if ($type === HTMLPurifier_VarParser::MIXED) { - return 'Not supported'; - $value = serialize($value); - } - $attr = array( - 'name' => "$name" . "[$ns.$directive]", - 'id' => "$name:$ns.$directive" - ); - if ($value === null) { - $attr['disabled'] = 'disabled'; - } - if (isset($def->allowed)) { - $ret .= $this->start('select', $attr); - foreach ($def->allowed as $val => $b) { - $attr = array(); - if ($value == $val) { - $attr['selected'] = 'selected'; - } - $ret .= $this->element('option', $val, $attr); - } - $ret .= $this->end('select'); - } elseif ($type === HTMLPurifier_VarParser::TEXT || - $type === HTMLPurifier_VarParser::ITEXT || - $type === HTMLPurifier_VarParser::ALIST || - $type === HTMLPurifier_VarParser::HASH || - $type === HTMLPurifier_VarParser::LOOKUP) { - $attr['cols'] = $this->cols; - $attr['rows'] = $this->rows; - $ret .= $this->start('textarea', $attr); - $ret .= $this->text($value); - $ret .= $this->end('textarea'); - } else { - $attr['value'] = $value; - $attr['type'] = 'text'; - $ret .= $this->elementEmpty('input', $attr); - } - return $ret; - } -} - -/** - * Bool form field printer - */ -class HTMLPurifier_Printer_ConfigForm_bool extends HTMLPurifier_Printer -{ - /** - * @param string $ns - * @param string $directive - * @param string $value - * @param string $name - * @param HTMLPurifier_Config|array $config - * @return string - */ - public function render($ns, $directive, $value, $name, $config) - { - if (is_array($config) && isset($config[0])) { - $gen_config = $config[0]; - $config = $config[1]; - } else { - $gen_config = $config; - } - $this->prepareGenerator($gen_config); - $ret = ''; - $ret .= $this->start('div', array('id' => "$name:$ns.$directive")); - - $ret .= $this->start('label', array('for' => "$name:Yes_$ns.$directive")); - $ret .= $this->element('span', "$ns.$directive:", array('class' => 'verbose')); - $ret .= $this->text(' Yes'); - $ret .= $this->end('label'); - - $attr = array( - 'type' => 'radio', - 'name' => "$name" . "[$ns.$directive]", - 'id' => "$name:Yes_$ns.$directive", - 'value' => '1' - ); - if ($value === true) { - $attr['checked'] = 'checked'; - } - if ($value === null) { - $attr['disabled'] = 'disabled'; - } - $ret .= $this->elementEmpty('input', $attr); - - $ret .= $this->start('label', array('for' => "$name:No_$ns.$directive")); - $ret .= $this->element('span', "$ns.$directive:", array('class' => 'verbose')); - $ret .= $this->text(' No'); - $ret .= $this->end('label'); - - $attr = array( - 'type' => 'radio', - 'name' => "$name" . "[$ns.$directive]", - 'id' => "$name:No_$ns.$directive", - 'value' => '0' - ); - if ($value === false) { - $attr['checked'] = 'checked'; - } - if ($value === null) { - $attr['disabled'] = 'disabled'; - } - $ret .= $this->elementEmpty('input', $attr); - - $ret .= $this->end('div'); - - return $ret; - } -} - -// vim: et sw=4 sts=4 +docURL = $doc_url; + $this->name = $name; + $this->compress = $compress; + // initialize sub-printers + $this->fields[0] = new HTMLPurifier_Printer_ConfigForm_default(); + $this->fields[HTMLPurifier_VarParser::BOOL] = new HTMLPurifier_Printer_ConfigForm_bool(); + } + + /** + * Sets default column and row size for textareas in sub-printers + * @param $cols Integer columns of textarea, null to use default + * @param $rows Integer rows of textarea, null to use default + */ + public function setTextareaDimensions($cols = null, $rows = null) + { + if ($cols) { + $this->fields['default']->cols = $cols; + } + if ($rows) { + $this->fields['default']->rows = $rows; + } + } + + /** + * Retrieves styling, in case it is not accessible by webserver + */ + public static function getCSS() + { + return file_get_contents(HTMLPURIFIER_PREFIX . '/HTMLPurifier/Printer/ConfigForm.css'); + } + + /** + * Retrieves JavaScript, in case it is not accessible by webserver + */ + public static function getJavaScript() + { + return file_get_contents(HTMLPURIFIER_PREFIX . '/HTMLPurifier/Printer/ConfigForm.js'); + } + + /** + * Returns HTML output for a configuration form + * @param HTMLPurifier_Config|array $config Configuration object of current form state, or an array + * where [0] has an HTML namespace and [1] is being rendered. + * @param array|bool $allowed Optional namespace(s) and directives to restrict form to. + * @param bool $render_controls + * @return string + */ + public function render($config, $allowed = true, $render_controls = true) + { + if (is_array($config) && isset($config[0])) { + $gen_config = $config[0]; + $config = $config[1]; + } else { + $gen_config = $config; + } + + $this->config = $config; + $this->genConfig = $gen_config; + $this->prepareGenerator($gen_config); + + $allowed = HTMLPurifier_Config::getAllowedDirectivesForForm($allowed, $config->def); + $all = array(); + foreach ($allowed as $key) { + list($ns, $directive) = $key; + $all[$ns][$directive] = $config->get($ns . '.' . $directive); + } + + $ret = ''; + $ret .= $this->start('table', array('class' => 'hp-config')); + $ret .= $this->start('thead'); + $ret .= $this->start('tr'); + $ret .= $this->element('th', 'Directive', array('class' => 'hp-directive')); + $ret .= $this->element('th', 'Value', array('class' => 'hp-value')); + $ret .= $this->end('tr'); + $ret .= $this->end('thead'); + foreach ($all as $ns => $directives) { + $ret .= $this->renderNamespace($ns, $directives); + } + if ($render_controls) { + $ret .= $this->start('tbody'); + $ret .= $this->start('tr'); + $ret .= $this->start('td', array('colspan' => 2, 'class' => 'controls')); + $ret .= $this->elementEmpty('input', array('type' => 'submit', 'value' => 'Submit')); + $ret .= '[Reset]'; + $ret .= $this->end('td'); + $ret .= $this->end('tr'); + $ret .= $this->end('tbody'); + } + $ret .= $this->end('table'); + return $ret; + } + + /** + * Renders a single namespace + * @param $ns String namespace name + * @param array $directives array of directives to values + * @return string + */ + protected function renderNamespace($ns, $directives) + { + $ret = ''; + $ret .= $this->start('tbody', array('class' => 'namespace')); + $ret .= $this->start('tr'); + $ret .= $this->element('th', $ns, array('colspan' => 2)); + $ret .= $this->end('tr'); + $ret .= $this->end('tbody'); + $ret .= $this->start('tbody'); + foreach ($directives as $directive => $value) { + $ret .= $this->start('tr'); + $ret .= $this->start('th'); + if ($this->docURL) { + $url = str_replace('%s', urlencode("$ns.$directive"), $this->docURL); + $ret .= $this->start('a', array('href' => $url)); + } + $attr = array('for' => "{$this->name}:$ns.$directive"); + + // crop directive name if it's too long + if (!$this->compress || (strlen($directive) < $this->compress)) { + $directive_disp = $directive; + } else { + $directive_disp = substr($directive, 0, $this->compress - 2) . '...'; + $attr['title'] = $directive; + } + + $ret .= $this->element( + 'label', + $directive_disp, + // component printers must create an element with this id + $attr + ); + if ($this->docURL) { + $ret .= $this->end('a'); + } + $ret .= $this->end('th'); + + $ret .= $this->start('td'); + $def = $this->config->def->info["$ns.$directive"]; + if (is_int($def)) { + $allow_null = $def < 0; + $type = abs($def); + } else { + $type = $def->type; + $allow_null = isset($def->allow_null); + } + if (!isset($this->fields[$type])) { + $type = 0; + } // default + $type_obj = $this->fields[$type]; + if ($allow_null) { + $type_obj = new HTMLPurifier_Printer_ConfigForm_NullDecorator($type_obj); + } + $ret .= $type_obj->render($ns, $directive, $value, $this->name, array($this->genConfig, $this->config)); + $ret .= $this->end('td'); + $ret .= $this->end('tr'); + } + $ret .= $this->end('tbody'); + return $ret; + } + +} + +/** + * Printer decorator for directives that accept null + */ +class HTMLPurifier_Printer_ConfigForm_NullDecorator extends HTMLPurifier_Printer +{ + /** + * Printer being decorated + * @type HTMLPurifier_Printer + */ + protected $obj; + + /** + * @param HTMLPurifier_Printer $obj Printer to decorate + */ + public function __construct($obj) + { + parent::__construct(); + $this->obj = $obj; + } + + /** + * @param string $ns + * @param string $directive + * @param string $value + * @param string $name + * @param HTMLPurifier_Config|array $config + * @return string + */ + public function render($ns, $directive, $value, $name, $config) + { + if (is_array($config) && isset($config[0])) { + $gen_config = $config[0]; + $config = $config[1]; + } else { + $gen_config = $config; + } + $this->prepareGenerator($gen_config); + + $ret = ''; + $ret .= $this->start('label', array('for' => "$name:Null_$ns.$directive")); + $ret .= $this->element('span', "$ns.$directive:", array('class' => 'verbose')); + $ret .= $this->text(' Null/Disabled'); + $ret .= $this->end('label'); + $attr = array( + 'type' => 'checkbox', + 'value' => '1', + 'class' => 'null-toggle', + 'name' => "$name" . "[Null_$ns.$directive]", + 'id' => "$name:Null_$ns.$directive", + 'onclick' => "toggleWriteability('$name:$ns.$directive',checked)" // INLINE JAVASCRIPT!!!! + ); + if ($this->obj instanceof HTMLPurifier_Printer_ConfigForm_bool) { + // modify inline javascript slightly + $attr['onclick'] = + "toggleWriteability('$name:Yes_$ns.$directive',checked);" . + "toggleWriteability('$name:No_$ns.$directive',checked)"; + } + if ($value === null) { + $attr['checked'] = 'checked'; + } + $ret .= $this->elementEmpty('input', $attr); + $ret .= $this->text(' or '); + $ret .= $this->elementEmpty('br'); + $ret .= $this->obj->render($ns, $directive, $value, $name, array($gen_config, $config)); + return $ret; + } +} + +/** + * Swiss-army knife configuration form field printer + */ +class HTMLPurifier_Printer_ConfigForm_default extends HTMLPurifier_Printer +{ + /** + * @type int + */ + public $cols = 18; + + /** + * @type int + */ + public $rows = 5; + + /** + * @param string $ns + * @param string $directive + * @param string $value + * @param string $name + * @param HTMLPurifier_Config|array $config + * @return string + */ + public function render($ns, $directive, $value, $name, $config) + { + if (is_array($config) && isset($config[0])) { + $gen_config = $config[0]; + $config = $config[1]; + } else { + $gen_config = $config; + } + $this->prepareGenerator($gen_config); + // this should probably be split up a little + $ret = ''; + $def = $config->def->info["$ns.$directive"]; + if (is_int($def)) { + $type = abs($def); + } else { + $type = $def->type; + } + if (is_array($value)) { + switch ($type) { + case HTMLPurifier_VarParser::LOOKUP: + $array = $value; + $value = array(); + foreach ($array as $val => $b) { + $value[] = $val; + } + //TODO does this need a break? + case HTMLPurifier_VarParser::ALIST: + $value = implode(PHP_EOL, $value); + break; + case HTMLPurifier_VarParser::HASH: + $nvalue = ''; + foreach ($value as $i => $v) { + if (is_array($v)) { + // HACK + $v = implode(";", $v); + } + $nvalue .= "$i:$v" . PHP_EOL; + } + $value = $nvalue; + break; + default: + $value = ''; + } + } + if ($type === HTMLPurifier_VarParser::MIXED) { + return 'Not supported'; + $value = serialize($value); + } + $attr = array( + 'name' => "$name" . "[$ns.$directive]", + 'id' => "$name:$ns.$directive" + ); + if ($value === null) { + $attr['disabled'] = 'disabled'; + } + if (isset($def->allowed)) { + $ret .= $this->start('select', $attr); + foreach ($def->allowed as $val => $b) { + $attr = array(); + if ($value == $val) { + $attr['selected'] = 'selected'; + } + $ret .= $this->element('option', $val, $attr); + } + $ret .= $this->end('select'); + } elseif ($type === HTMLPurifier_VarParser::TEXT || + $type === HTMLPurifier_VarParser::ITEXT || + $type === HTMLPurifier_VarParser::ALIST || + $type === HTMLPurifier_VarParser::HASH || + $type === HTMLPurifier_VarParser::LOOKUP) { + $attr['cols'] = $this->cols; + $attr['rows'] = $this->rows; + $ret .= $this->start('textarea', $attr); + $ret .= $this->text($value); + $ret .= $this->end('textarea'); + } else { + $attr['value'] = $value; + $attr['type'] = 'text'; + $ret .= $this->elementEmpty('input', $attr); + } + return $ret; + } +} + +/** + * Bool form field printer + */ +class HTMLPurifier_Printer_ConfigForm_bool extends HTMLPurifier_Printer +{ + /** + * @param string $ns + * @param string $directive + * @param string $value + * @param string $name + * @param HTMLPurifier_Config|array $config + * @return string + */ + public function render($ns, $directive, $value, $name, $config) + { + if (is_array($config) && isset($config[0])) { + $gen_config = $config[0]; + $config = $config[1]; + } else { + $gen_config = $config; + } + $this->prepareGenerator($gen_config); + $ret = ''; + $ret .= $this->start('div', array('id' => "$name:$ns.$directive")); + + $ret .= $this->start('label', array('for' => "$name:Yes_$ns.$directive")); + $ret .= $this->element('span', "$ns.$directive:", array('class' => 'verbose')); + $ret .= $this->text(' Yes'); + $ret .= $this->end('label'); + + $attr = array( + 'type' => 'radio', + 'name' => "$name" . "[$ns.$directive]", + 'id' => "$name:Yes_$ns.$directive", + 'value' => '1' + ); + if ($value === true) { + $attr['checked'] = 'checked'; + } + if ($value === null) { + $attr['disabled'] = 'disabled'; + } + $ret .= $this->elementEmpty('input', $attr); + + $ret .= $this->start('label', array('for' => "$name:No_$ns.$directive")); + $ret .= $this->element('span', "$ns.$directive:", array('class' => 'verbose')); + $ret .= $this->text(' No'); + $ret .= $this->end('label'); + + $attr = array( + 'type' => 'radio', + 'name' => "$name" . "[$ns.$directive]", + 'id' => "$name:No_$ns.$directive", + 'value' => '0' + ); + if ($value === false) { + $attr['checked'] = 'checked'; + } + if ($value === null) { + $attr['disabled'] = 'disabled'; + } + $ret .= $this->elementEmpty('input', $attr); + + $ret .= $this->end('div'); + + return $ret; + } +} + +// vim: et sw=4 sts=4 diff --git a/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/Printer/HTMLDefinition.php b/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/Printer/HTMLDefinition.php similarity index 97% rename from plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/Printer/HTMLDefinition.php rename to plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/Printer/HTMLDefinition.php index 679d19b..5f2f2f8 100755 --- a/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/Printer/HTMLDefinition.php +++ b/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/Printer/HTMLDefinition.php @@ -1,324 +1,324 @@ -config =& $config; - - $this->def = $config->getHTMLDefinition(); - - $ret .= $this->start('div', array('class' => 'HTMLPurifier_Printer')); - - $ret .= $this->renderDoctype(); - $ret .= $this->renderEnvironment(); - $ret .= $this->renderContentSets(); - $ret .= $this->renderInfo(); - - $ret .= $this->end('div'); - - return $ret; - } - - /** - * Renders the Doctype table - * @return string - */ - protected function renderDoctype() - { - $doctype = $this->def->doctype; - $ret = ''; - $ret .= $this->start('table'); - $ret .= $this->element('caption', 'Doctype'); - $ret .= $this->row('Name', $doctype->name); - $ret .= $this->row('XML', $doctype->xml ? 'Yes' : 'No'); - $ret .= $this->row('Default Modules', implode($doctype->modules, ', ')); - $ret .= $this->row('Default Tidy Modules', implode($doctype->tidyModules, ', ')); - $ret .= $this->end('table'); - return $ret; - } - - - /** - * Renders environment table, which is miscellaneous info - * @return string - */ - protected function renderEnvironment() - { - $def = $this->def; - - $ret = ''; - - $ret .= $this->start('table'); - $ret .= $this->element('caption', 'Environment'); - - $ret .= $this->row('Parent of fragment', $def->info_parent); - $ret .= $this->renderChildren($def->info_parent_def->child); - $ret .= $this->row('Block wrap name', $def->info_block_wrapper); - - $ret .= $this->start('tr'); - $ret .= $this->element('th', 'Global attributes'); - $ret .= $this->element('td', $this->listifyAttr($def->info_global_attr), null, 0); - $ret .= $this->end('tr'); - - $ret .= $this->start('tr'); - $ret .= $this->element('th', 'Tag transforms'); - $list = array(); - foreach ($def->info_tag_transform as $old => $new) { - $new = $this->getClass($new, 'TagTransform_'); - $list[] = "<$old> with $new"; - } - $ret .= $this->element('td', $this->listify($list)); - $ret .= $this->end('tr'); - - $ret .= $this->start('tr'); - $ret .= $this->element('th', 'Pre-AttrTransform'); - $ret .= $this->element('td', $this->listifyObjectList($def->info_attr_transform_pre)); - $ret .= $this->end('tr'); - - $ret .= $this->start('tr'); - $ret .= $this->element('th', 'Post-AttrTransform'); - $ret .= $this->element('td', $this->listifyObjectList($def->info_attr_transform_post)); - $ret .= $this->end('tr'); - - $ret .= $this->end('table'); - return $ret; - } - - /** - * Renders the Content Sets table - * @return string - */ - protected function renderContentSets() - { - $ret = ''; - $ret .= $this->start('table'); - $ret .= $this->element('caption', 'Content Sets'); - foreach ($this->def->info_content_sets as $name => $lookup) { - $ret .= $this->heavyHeader($name); - $ret .= $this->start('tr'); - $ret .= $this->element('td', $this->listifyTagLookup($lookup)); - $ret .= $this->end('tr'); - } - $ret .= $this->end('table'); - return $ret; - } - - /** - * Renders the Elements ($info) table - * @return string - */ - protected function renderInfo() - { - $ret = ''; - $ret .= $this->start('table'); - $ret .= $this->element('caption', 'Elements ($info)'); - ksort($this->def->info); - $ret .= $this->heavyHeader('Allowed tags', 2); - $ret .= $this->start('tr'); - $ret .= $this->element('td', $this->listifyTagLookup($this->def->info), array('colspan' => 2)); - $ret .= $this->end('tr'); - foreach ($this->def->info as $name => $def) { - $ret .= $this->start('tr'); - $ret .= $this->element('th', "<$name>", array('class' => 'heavy', 'colspan' => 2)); - $ret .= $this->end('tr'); - $ret .= $this->start('tr'); - $ret .= $this->element('th', 'Inline content'); - $ret .= $this->element('td', $def->descendants_are_inline ? 'Yes' : 'No'); - $ret .= $this->end('tr'); - if (!empty($def->excludes)) { - $ret .= $this->start('tr'); - $ret .= $this->element('th', 'Excludes'); - $ret .= $this->element('td', $this->listifyTagLookup($def->excludes)); - $ret .= $this->end('tr'); - } - if (!empty($def->attr_transform_pre)) { - $ret .= $this->start('tr'); - $ret .= $this->element('th', 'Pre-AttrTransform'); - $ret .= $this->element('td', $this->listifyObjectList($def->attr_transform_pre)); - $ret .= $this->end('tr'); - } - if (!empty($def->attr_transform_post)) { - $ret .= $this->start('tr'); - $ret .= $this->element('th', 'Post-AttrTransform'); - $ret .= $this->element('td', $this->listifyObjectList($def->attr_transform_post)); - $ret .= $this->end('tr'); - } - if (!empty($def->auto_close)) { - $ret .= $this->start('tr'); - $ret .= $this->element('th', 'Auto closed by'); - $ret .= $this->element('td', $this->listifyTagLookup($def->auto_close)); - $ret .= $this->end('tr'); - } - $ret .= $this->start('tr'); - $ret .= $this->element('th', 'Allowed attributes'); - $ret .= $this->element('td', $this->listifyAttr($def->attr), array(), 0); - $ret .= $this->end('tr'); - - if (!empty($def->required_attr)) { - $ret .= $this->row('Required attributes', $this->listify($def->required_attr)); - } - - $ret .= $this->renderChildren($def->child); - } - $ret .= $this->end('table'); - return $ret; - } - - /** - * Renders a row describing the allowed children of an element - * @param HTMLPurifier_ChildDef $def HTMLPurifier_ChildDef of pertinent element - * @return string - */ - protected function renderChildren($def) - { - $context = new HTMLPurifier_Context(); - $ret = ''; - $ret .= $this->start('tr'); - $elements = array(); - $attr = array(); - if (isset($def->elements)) { - if ($def->type == 'strictblockquote') { - $def->validateChildren(array(), $this->config, $context); - } - $elements = $def->elements; - } - if ($def->type == 'chameleon') { - $attr['rowspan'] = 2; - } elseif ($def->type == 'empty') { - $elements = array(); - } elseif ($def->type == 'table') { - $elements = array_flip( - array( - 'col', - 'caption', - 'colgroup', - 'thead', - 'tfoot', - 'tbody', - 'tr' - ) - ); - } - $ret .= $this->element('th', 'Allowed children', $attr); - - if ($def->type == 'chameleon') { - - $ret .= $this->element( - 'td', - 'Block: ' . - $this->escape($this->listifyTagLookup($def->block->elements)), - null, - 0 - ); - $ret .= $this->end('tr'); - $ret .= $this->start('tr'); - $ret .= $this->element( - 'td', - 'Inline: ' . - $this->escape($this->listifyTagLookup($def->inline->elements)), - null, - 0 - ); - - } elseif ($def->type == 'custom') { - - $ret .= $this->element( - 'td', - '' . ucfirst($def->type) . ': ' . - $def->dtd_regex - ); - - } else { - $ret .= $this->element( - 'td', - '' . ucfirst($def->type) . ': ' . - $this->escape($this->listifyTagLookup($elements)), - null, - 0 - ); - } - $ret .= $this->end('tr'); - return $ret; - } - - /** - * Listifies a tag lookup table. - * @param array $array Tag lookup array in form of array('tagname' => true) - * @return string - */ - protected function listifyTagLookup($array) - { - ksort($array); - $list = array(); - foreach ($array as $name => $discard) { - if ($name !== '#PCDATA' && !isset($this->def->info[$name])) { - continue; - } - $list[] = $name; - } - return $this->listify($list); - } - - /** - * Listifies a list of objects by retrieving class names and internal state - * @param array $array List of objects - * @return string - * @todo Also add information about internal state - */ - protected function listifyObjectList($array) - { - ksort($array); - $list = array(); - foreach ($array as $obj) { - $list[] = $this->getClass($obj, 'AttrTransform_'); - } - return $this->listify($list); - } - - /** - * Listifies a hash of attributes to AttrDef classes - * @param array $array Array hash in form of array('attrname' => HTMLPurifier_AttrDef) - * @return string - */ - protected function listifyAttr($array) - { - ksort($array); - $list = array(); - foreach ($array as $name => $obj) { - if ($obj === false) { - continue; - } - $list[] = "$name = " . $this->getClass($obj, 'AttrDef_') . ''; - } - return $this->listify($list); - } - - /** - * Creates a heavy header row - * @param string $text - * @param int $num - * @return string - */ - protected function heavyHeader($text, $num = 1) - { - $ret = ''; - $ret .= $this->start('tr'); - $ret .= $this->element('th', $text, array('colspan' => $num, 'class' => 'heavy')); - $ret .= $this->end('tr'); - return $ret; - } -} - -// vim: et sw=4 sts=4 +config =& $config; + + $this->def = $config->getHTMLDefinition(); + + $ret .= $this->start('div', array('class' => 'HTMLPurifier_Printer')); + + $ret .= $this->renderDoctype(); + $ret .= $this->renderEnvironment(); + $ret .= $this->renderContentSets(); + $ret .= $this->renderInfo(); + + $ret .= $this->end('div'); + + return $ret; + } + + /** + * Renders the Doctype table + * @return string + */ + protected function renderDoctype() + { + $doctype = $this->def->doctype; + $ret = ''; + $ret .= $this->start('table'); + $ret .= $this->element('caption', 'Doctype'); + $ret .= $this->row('Name', $doctype->name); + $ret .= $this->row('XML', $doctype->xml ? 'Yes' : 'No'); + $ret .= $this->row('Default Modules', implode($doctype->modules, ', ')); + $ret .= $this->row('Default Tidy Modules', implode($doctype->tidyModules, ', ')); + $ret .= $this->end('table'); + return $ret; + } + + + /** + * Renders environment table, which is miscellaneous info + * @return string + */ + protected function renderEnvironment() + { + $def = $this->def; + + $ret = ''; + + $ret .= $this->start('table'); + $ret .= $this->element('caption', 'Environment'); + + $ret .= $this->row('Parent of fragment', $def->info_parent); + $ret .= $this->renderChildren($def->info_parent_def->child); + $ret .= $this->row('Block wrap name', $def->info_block_wrapper); + + $ret .= $this->start('tr'); + $ret .= $this->element('th', 'Global attributes'); + $ret .= $this->element('td', $this->listifyAttr($def->info_global_attr), null, 0); + $ret .= $this->end('tr'); + + $ret .= $this->start('tr'); + $ret .= $this->element('th', 'Tag transforms'); + $list = array(); + foreach ($def->info_tag_transform as $old => $new) { + $new = $this->getClass($new, 'TagTransform_'); + $list[] = "<$old> with $new"; + } + $ret .= $this->element('td', $this->listify($list)); + $ret .= $this->end('tr'); + + $ret .= $this->start('tr'); + $ret .= $this->element('th', 'Pre-AttrTransform'); + $ret .= $this->element('td', $this->listifyObjectList($def->info_attr_transform_pre)); + $ret .= $this->end('tr'); + + $ret .= $this->start('tr'); + $ret .= $this->element('th', 'Post-AttrTransform'); + $ret .= $this->element('td', $this->listifyObjectList($def->info_attr_transform_post)); + $ret .= $this->end('tr'); + + $ret .= $this->end('table'); + return $ret; + } + + /** + * Renders the Content Sets table + * @return string + */ + protected function renderContentSets() + { + $ret = ''; + $ret .= $this->start('table'); + $ret .= $this->element('caption', 'Content Sets'); + foreach ($this->def->info_content_sets as $name => $lookup) { + $ret .= $this->heavyHeader($name); + $ret .= $this->start('tr'); + $ret .= $this->element('td', $this->listifyTagLookup($lookup)); + $ret .= $this->end('tr'); + } + $ret .= $this->end('table'); + return $ret; + } + + /** + * Renders the Elements ($info) table + * @return string + */ + protected function renderInfo() + { + $ret = ''; + $ret .= $this->start('table'); + $ret .= $this->element('caption', 'Elements ($info)'); + ksort($this->def->info); + $ret .= $this->heavyHeader('Allowed tags', 2); + $ret .= $this->start('tr'); + $ret .= $this->element('td', $this->listifyTagLookup($this->def->info), array('colspan' => 2)); + $ret .= $this->end('tr'); + foreach ($this->def->info as $name => $def) { + $ret .= $this->start('tr'); + $ret .= $this->element('th', "<$name>", array('class' => 'heavy', 'colspan' => 2)); + $ret .= $this->end('tr'); + $ret .= $this->start('tr'); + $ret .= $this->element('th', 'Inline content'); + $ret .= $this->element('td', $def->descendants_are_inline ? 'Yes' : 'No'); + $ret .= $this->end('tr'); + if (!empty($def->excludes)) { + $ret .= $this->start('tr'); + $ret .= $this->element('th', 'Excludes'); + $ret .= $this->element('td', $this->listifyTagLookup($def->excludes)); + $ret .= $this->end('tr'); + } + if (!empty($def->attr_transform_pre)) { + $ret .= $this->start('tr'); + $ret .= $this->element('th', 'Pre-AttrTransform'); + $ret .= $this->element('td', $this->listifyObjectList($def->attr_transform_pre)); + $ret .= $this->end('tr'); + } + if (!empty($def->attr_transform_post)) { + $ret .= $this->start('tr'); + $ret .= $this->element('th', 'Post-AttrTransform'); + $ret .= $this->element('td', $this->listifyObjectList($def->attr_transform_post)); + $ret .= $this->end('tr'); + } + if (!empty($def->auto_close)) { + $ret .= $this->start('tr'); + $ret .= $this->element('th', 'Auto closed by'); + $ret .= $this->element('td', $this->listifyTagLookup($def->auto_close)); + $ret .= $this->end('tr'); + } + $ret .= $this->start('tr'); + $ret .= $this->element('th', 'Allowed attributes'); + $ret .= $this->element('td', $this->listifyAttr($def->attr), array(), 0); + $ret .= $this->end('tr'); + + if (!empty($def->required_attr)) { + $ret .= $this->row('Required attributes', $this->listify($def->required_attr)); + } + + $ret .= $this->renderChildren($def->child); + } + $ret .= $this->end('table'); + return $ret; + } + + /** + * Renders a row describing the allowed children of an element + * @param HTMLPurifier_ChildDef $def HTMLPurifier_ChildDef of pertinent element + * @return string + */ + protected function renderChildren($def) + { + $context = new HTMLPurifier_Context(); + $ret = ''; + $ret .= $this->start('tr'); + $elements = array(); + $attr = array(); + if (isset($def->elements)) { + if ($def->type == 'strictblockquote') { + $def->validateChildren(array(), $this->config, $context); + } + $elements = $def->elements; + } + if ($def->type == 'chameleon') { + $attr['rowspan'] = 2; + } elseif ($def->type == 'empty') { + $elements = array(); + } elseif ($def->type == 'table') { + $elements = array_flip( + array( + 'col', + 'caption', + 'colgroup', + 'thead', + 'tfoot', + 'tbody', + 'tr' + ) + ); + } + $ret .= $this->element('th', 'Allowed children', $attr); + + if ($def->type == 'chameleon') { + + $ret .= $this->element( + 'td', + 'Block: ' . + $this->escape($this->listifyTagLookup($def->block->elements)), + null, + 0 + ); + $ret .= $this->end('tr'); + $ret .= $this->start('tr'); + $ret .= $this->element( + 'td', + 'Inline: ' . + $this->escape($this->listifyTagLookup($def->inline->elements)), + null, + 0 + ); + + } elseif ($def->type == 'custom') { + + $ret .= $this->element( + 'td', + '' . ucfirst($def->type) . ': ' . + $def->dtd_regex + ); + + } else { + $ret .= $this->element( + 'td', + '' . ucfirst($def->type) . ': ' . + $this->escape($this->listifyTagLookup($elements)), + null, + 0 + ); + } + $ret .= $this->end('tr'); + return $ret; + } + + /** + * Listifies a tag lookup table. + * @param array $array Tag lookup array in form of array('tagname' => true) + * @return string + */ + protected function listifyTagLookup($array) + { + ksort($array); + $list = array(); + foreach ($array as $name => $discard) { + if ($name !== '#PCDATA' && !isset($this->def->info[$name])) { + continue; + } + $list[] = $name; + } + return $this->listify($list); + } + + /** + * Listifies a list of objects by retrieving class names and internal state + * @param array $array List of objects + * @return string + * @todo Also add information about internal state + */ + protected function listifyObjectList($array) + { + ksort($array); + $list = array(); + foreach ($array as $obj) { + $list[] = $this->getClass($obj, 'AttrTransform_'); + } + return $this->listify($list); + } + + /** + * Listifies a hash of attributes to AttrDef classes + * @param array $array Array hash in form of array('attrname' => HTMLPurifier_AttrDef) + * @return string + */ + protected function listifyAttr($array) + { + ksort($array); + $list = array(); + foreach ($array as $name => $obj) { + if ($obj === false) { + continue; + } + $list[] = "$name = " . $this->getClass($obj, 'AttrDef_') . ''; + } + return $this->listify($list); + } + + /** + * Creates a heavy header row + * @param string $text + * @param int $num + * @return string + */ + protected function heavyHeader($text, $num = 1) + { + $ret = ''; + $ret .= $this->start('tr'); + $ret .= $this->element('th', $text, array('colspan' => $num, 'class' => 'heavy')); + $ret .= $this->end('tr'); + return $ret; + } +} + +// vim: et sw=4 sts=4 diff --git a/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/PropertyList.php b/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/PropertyList.php similarity index 95% rename from plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/PropertyList.php rename to plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/PropertyList.php index d27fd53..189348f 100755 --- a/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/PropertyList.php +++ b/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/PropertyList.php @@ -1,122 +1,122 @@ -parent = $parent; - } - - /** - * Recursively retrieves the value for a key - * @param string $name - * @throws HTMLPurifier_Exception - */ - public function get($name) - { - if ($this->has($name)) { - return $this->data[$name]; - } - // possible performance bottleneck, convert to iterative if necessary - if ($this->parent) { - return $this->parent->get($name); - } - throw new HTMLPurifier_Exception("Key '$name' not found"); - } - - /** - * Sets the value of a key, for this plist - * @param string $name - * @param mixed $value - */ - public function set($name, $value) - { - $this->data[$name] = $value; - } - - /** - * Returns true if a given key exists - * @param string $name - * @return bool - */ - public function has($name) - { - return array_key_exists($name, $this->data); - } - - /** - * Resets a value to the value of it's parent, usually the default. If - * no value is specified, the entire plist is reset. - * @param string $name - */ - public function reset($name = null) - { - if ($name == null) { - $this->data = array(); - } else { - unset($this->data[$name]); - } - } - - /** - * Squashes this property list and all of its property lists into a single - * array, and returns the array. This value is cached by default. - * @param bool $force If true, ignores the cache and regenerates the array. - * @return array - */ - public function squash($force = false) - { - if ($this->cache !== null && !$force) { - return $this->cache; - } - if ($this->parent) { - return $this->cache = array_merge($this->parent->squash($force), $this->data); - } else { - return $this->cache = $this->data; - } - } - - /** - * Returns the parent plist. - * @return HTMLPurifier_PropertyList - */ - public function getParent() - { - return $this->parent; - } - - /** - * Sets the parent plist. - * @param HTMLPurifier_PropertyList $plist Parent plist - */ - public function setParent($plist) - { - $this->parent = $plist; - } -} - -// vim: et sw=4 sts=4 +parent = $parent; + } + + /** + * Recursively retrieves the value for a key + * @param string $name + * @throws HTMLPurifier_Exception + */ + public function get($name) + { + if ($this->has($name)) { + return $this->data[$name]; + } + // possible performance bottleneck, convert to iterative if necessary + if ($this->parent) { + return $this->parent->get($name); + } + throw new HTMLPurifier_Exception("Key '$name' not found"); + } + + /** + * Sets the value of a key, for this plist + * @param string $name + * @param mixed $value + */ + public function set($name, $value) + { + $this->data[$name] = $value; + } + + /** + * Returns true if a given key exists + * @param string $name + * @return bool + */ + public function has($name) + { + return array_key_exists($name, $this->data); + } + + /** + * Resets a value to the value of it's parent, usually the default. If + * no value is specified, the entire plist is reset. + * @param string $name + */ + public function reset($name = null) + { + if ($name == null) { + $this->data = array(); + } else { + unset($this->data[$name]); + } + } + + /** + * Squashes this property list and all of its property lists into a single + * array, and returns the array. This value is cached by default. + * @param bool $force If true, ignores the cache and regenerates the array. + * @return array + */ + public function squash($force = false) + { + if ($this->cache !== null && !$force) { + return $this->cache; + } + if ($this->parent) { + return $this->cache = array_merge($this->parent->squash($force), $this->data); + } else { + return $this->cache = $this->data; + } + } + + /** + * Returns the parent plist. + * @return HTMLPurifier_PropertyList + */ + public function getParent() + { + return $this->parent; + } + + /** + * Sets the parent plist. + * @param HTMLPurifier_PropertyList $plist Parent plist + */ + public function setParent($plist) + { + $this->parent = $plist; + } +} + +// vim: et sw=4 sts=4 diff --git a/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/PropertyListIterator.php b/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/PropertyListIterator.php similarity index 95% rename from plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/PropertyListIterator.php rename to plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/PropertyListIterator.php index 1e707e2..15b330e 100755 --- a/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/PropertyListIterator.php +++ b/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/PropertyListIterator.php @@ -1,42 +1,42 @@ -l = strlen($filter); - $this->filter = $filter; - } - - /** - * @return bool - */ - public function accept() - { - $key = $this->getInnerIterator()->key(); - if (strncmp($key, $this->filter, $this->l) !== 0) { - return false; - } - return true; - } -} - -// vim: et sw=4 sts=4 +l = strlen($filter); + $this->filter = $filter; + } + + /** + * @return bool + */ + public function accept() + { + $key = $this->getInnerIterator()->key(); + if (strncmp($key, $this->filter, $this->l) !== 0) { + return false; + } + return true; + } +} + +// vim: et sw=4 sts=4 diff --git a/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/Queue.php b/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/Queue.php similarity index 96% rename from plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/Queue.php rename to plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/Queue.php index a75894d..f58db90 100755 --- a/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/Queue.php +++ b/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/Queue.php @@ -1,56 +1,56 @@ -input = $input; - $this->output = array(); - } - - /** - * Shifts an element off the front of the queue. - */ - public function shift() { - if (empty($this->output)) { - $this->output = array_reverse($this->input); - $this->input = array(); - } - if (empty($this->output)) { - return NULL; - } - return array_pop($this->output); - } - - /** - * Pushes an element onto the front of the queue. - */ - public function push($x) { - array_push($this->input, $x); - } - - /** - * Checks if it's empty. - */ - public function isEmpty() { - return empty($this->input) && empty($this->output); - } -} +input = $input; + $this->output = array(); + } + + /** + * Shifts an element off the front of the queue. + */ + public function shift() { + if (empty($this->output)) { + $this->output = array_reverse($this->input); + $this->input = array(); + } + if (empty($this->output)) { + return NULL; + } + return array_pop($this->output); + } + + /** + * Pushes an element onto the front of the queue. + */ + public function push($x) { + array_push($this->input, $x); + } + + /** + * Checks if it's empty. + */ + public function isEmpty() { + return empty($this->input) && empty($this->output); + } +} diff --git a/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/Strategy.php b/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/Strategy.php similarity index 96% rename from plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/Strategy.php rename to plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/Strategy.php index 291eb83..e1ff3b7 100755 --- a/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/Strategy.php +++ b/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/Strategy.php @@ -1,26 +1,26 @@ -strategies as $strategy) { - $tokens = $strategy->execute($tokens, $config, $context); - } - return $tokens; - } -} - -// vim: et sw=4 sts=4 +strategies as $strategy) { + $tokens = $strategy->execute($tokens, $config, $context); + } + return $tokens; + } +} + +// vim: et sw=4 sts=4 diff --git a/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/Strategy/Core.php b/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/Strategy/Core.php similarity index 96% rename from plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/Strategy/Core.php rename to plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/Strategy/Core.php index 0775215..4414c17 100755 --- a/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/Strategy/Core.php +++ b/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/Strategy/Core.php @@ -1,17 +1,17 @@ -strategies[] = new HTMLPurifier_Strategy_RemoveForeignElements(); - $this->strategies[] = new HTMLPurifier_Strategy_MakeWellFormed(); - $this->strategies[] = new HTMLPurifier_Strategy_FixNesting(); - $this->strategies[] = new HTMLPurifier_Strategy_ValidateAttributes(); - } -} - -// vim: et sw=4 sts=4 +strategies[] = new HTMLPurifier_Strategy_RemoveForeignElements(); + $this->strategies[] = new HTMLPurifier_Strategy_MakeWellFormed(); + $this->strategies[] = new HTMLPurifier_Strategy_FixNesting(); + $this->strategies[] = new HTMLPurifier_Strategy_ValidateAttributes(); + } +} + +// vim: et sw=4 sts=4 diff --git a/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/Strategy/FixNesting.php b/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/Strategy/FixNesting.php similarity index 97% rename from plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/Strategy/FixNesting.php rename to plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/Strategy/FixNesting.php index 8b1eb20..6fa673d 100755 --- a/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/Strategy/FixNesting.php +++ b/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/Strategy/FixNesting.php @@ -1,181 +1,181 @@ -getHTMLDefinition(); - - $excludes_enabled = !$config->get('Core.DisableExcludes'); - - // setup the context variable 'IsInline', for chameleon processing - // is 'false' when we are not inline, 'true' when it must always - // be inline, and an integer when it is inline for a certain - // branch of the document tree - $is_inline = $definition->info_parent_def->descendants_are_inline; - $context->register('IsInline', $is_inline); - - // setup error collector - $e =& $context->get('ErrorCollector', true); - - //####################################################################// - // Loop initialization - - // stack that contains all elements that are excluded - // it is organized by parent elements, similar to $stack, - // but it is only populated when an element with exclusions is - // processed, i.e. there won't be empty exclusions. - $exclude_stack = array($definition->info_parent_def->excludes); - - // variable that contains the start token while we are processing - // nodes. This enables error reporting to do its job - $node = $top_node; - // dummy token - list($token, $d) = $node->toTokenPair(); - $context->register('CurrentNode', $node); - $context->register('CurrentToken', $token); - - //####################################################################// - // Loop - - // We need to implement a post-order traversal iteratively, to - // avoid running into stack space limits. This is pretty tricky - // to reason about, so we just manually stack-ify the recursive - // variant: - // - // function f($node) { - // foreach ($node->children as $child) { - // f($child); - // } - // validate($node); - // } - // - // Thus, we will represent a stack frame as array($node, - // $is_inline, stack of children) - // e.g. array_reverse($node->children) - already processed - // children. - - $parent_def = $definition->info_parent_def; - $stack = array( - array($top_node, - $parent_def->descendants_are_inline, - $parent_def->excludes, // exclusions - 0) - ); - - while (!empty($stack)) { - list($node, $is_inline, $excludes, $ix) = array_pop($stack); - // recursive call - $go = false; - $def = empty($stack) ? $definition->info_parent_def : $definition->info[$node->name]; - while (isset($node->children[$ix])) { - $child = $node->children[$ix++]; - if ($child instanceof HTMLPurifier_Node_Element) { - $go = true; - $stack[] = array($node, $is_inline, $excludes, $ix); - $stack[] = array($child, - // ToDo: I don't think it matters if it's def or - // child_def, but double check this... - $is_inline || $def->descendants_are_inline, - empty($def->excludes) ? $excludes - : array_merge($excludes, $def->excludes), - 0); - break; - } - }; - if ($go) continue; - list($token, $d) = $node->toTokenPair(); - // base case - if ($excludes_enabled && isset($excludes[$node->name])) { - $node->dead = true; - if ($e) $e->send(E_ERROR, 'Strategy_FixNesting: Node excluded'); - } else { - // XXX I suppose it would be slightly more efficient to - // avoid the allocation here and have children - // strategies handle it - $children = array(); - foreach ($node->children as $child) { - if (!$child->dead) $children[] = $child; - } - $result = $def->child->validateChildren($children, $config, $context); - if ($result === true) { - // nop - $node->children = $children; - } elseif ($result === false) { - $node->dead = true; - if ($e) $e->send(E_ERROR, 'Strategy_FixNesting: Node removed'); - } else { - $node->children = $result; - if ($e) { - // XXX This will miss mutations of internal nodes. Perhaps defer to the child validators - if (empty($result) && !empty($children)) { - $e->send(E_ERROR, 'Strategy_FixNesting: Node contents removed'); - } else if ($result != $children) { - $e->send(E_WARNING, 'Strategy_FixNesting: Node reorganized'); - } - } - } - } - } - - //####################################################################// - // Post-processing - - // remove context variables - $context->destroy('IsInline'); - $context->destroy('CurrentNode'); - $context->destroy('CurrentToken'); - - //####################################################################// - // Return - - return HTMLPurifier_Arborize::flatten($node, $config, $context); - } -} - -// vim: et sw=4 sts=4 +getHTMLDefinition(); + + $excludes_enabled = !$config->get('Core.DisableExcludes'); + + // setup the context variable 'IsInline', for chameleon processing + // is 'false' when we are not inline, 'true' when it must always + // be inline, and an integer when it is inline for a certain + // branch of the document tree + $is_inline = $definition->info_parent_def->descendants_are_inline; + $context->register('IsInline', $is_inline); + + // setup error collector + $e =& $context->get('ErrorCollector', true); + + //####################################################################// + // Loop initialization + + // stack that contains all elements that are excluded + // it is organized by parent elements, similar to $stack, + // but it is only populated when an element with exclusions is + // processed, i.e. there won't be empty exclusions. + $exclude_stack = array($definition->info_parent_def->excludes); + + // variable that contains the start token while we are processing + // nodes. This enables error reporting to do its job + $node = $top_node; + // dummy token + list($token, $d) = $node->toTokenPair(); + $context->register('CurrentNode', $node); + $context->register('CurrentToken', $token); + + //####################################################################// + // Loop + + // We need to implement a post-order traversal iteratively, to + // avoid running into stack space limits. This is pretty tricky + // to reason about, so we just manually stack-ify the recursive + // variant: + // + // function f($node) { + // foreach ($node->children as $child) { + // f($child); + // } + // validate($node); + // } + // + // Thus, we will represent a stack frame as array($node, + // $is_inline, stack of children) + // e.g. array_reverse($node->children) - already processed + // children. + + $parent_def = $definition->info_parent_def; + $stack = array( + array($top_node, + $parent_def->descendants_are_inline, + $parent_def->excludes, // exclusions + 0) + ); + + while (!empty($stack)) { + list($node, $is_inline, $excludes, $ix) = array_pop($stack); + // recursive call + $go = false; + $def = empty($stack) ? $definition->info_parent_def : $definition->info[$node->name]; + while (isset($node->children[$ix])) { + $child = $node->children[$ix++]; + if ($child instanceof HTMLPurifier_Node_Element) { + $go = true; + $stack[] = array($node, $is_inline, $excludes, $ix); + $stack[] = array($child, + // ToDo: I don't think it matters if it's def or + // child_def, but double check this... + $is_inline || $def->descendants_are_inline, + empty($def->excludes) ? $excludes + : array_merge($excludes, $def->excludes), + 0); + break; + } + }; + if ($go) continue; + list($token, $d) = $node->toTokenPair(); + // base case + if ($excludes_enabled && isset($excludes[$node->name])) { + $node->dead = true; + if ($e) $e->send(E_ERROR, 'Strategy_FixNesting: Node excluded'); + } else { + // XXX I suppose it would be slightly more efficient to + // avoid the allocation here and have children + // strategies handle it + $children = array(); + foreach ($node->children as $child) { + if (!$child->dead) $children[] = $child; + } + $result = $def->child->validateChildren($children, $config, $context); + if ($result === true) { + // nop + $node->children = $children; + } elseif ($result === false) { + $node->dead = true; + if ($e) $e->send(E_ERROR, 'Strategy_FixNesting: Node removed'); + } else { + $node->children = $result; + if ($e) { + // XXX This will miss mutations of internal nodes. Perhaps defer to the child validators + if (empty($result) && !empty($children)) { + $e->send(E_ERROR, 'Strategy_FixNesting: Node contents removed'); + } else if ($result != $children) { + $e->send(E_WARNING, 'Strategy_FixNesting: Node reorganized'); + } + } + } + } + } + + //####################################################################// + // Post-processing + + // remove context variables + $context->destroy('IsInline'); + $context->destroy('CurrentNode'); + $context->destroy('CurrentToken'); + + //####################################################################// + // Return + + return HTMLPurifier_Arborize::flatten($node, $config, $context); + } +} + +// vim: et sw=4 sts=4 diff --git a/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/Strategy/MakeWellFormed.php b/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/Strategy/MakeWellFormed.php similarity index 97% rename from plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/Strategy/MakeWellFormed.php rename to plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/Strategy/MakeWellFormed.php index 2c792fe..e389e00 100755 --- a/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.6.0/library/HTMLPurifier/Strategy/MakeWellFormed.php +++ b/plugins/wordpress-mobile-pack/libs/htmlpurifier-4.8.0/library/HTMLPurifier/Strategy/MakeWellFormed.php @@ -1,600 +1,600 @@ -getHTMLDefinition(); - - // local variables - $generator = new HTMLPurifier_Generator($config, $context); - $escape_invalid_tags = $config->get('Core.EscapeInvalidTags'); - // used for autoclose early abortion - $global_parent_allowed_elements = $definition->info_parent_def->child->getAllowedElements($config); - $e = $context->get('ErrorCollector', true); - $i = false; // injector index - list($zipper, $token) = HTMLPurifier_Zipper::fromArray($tokens); - if ($token === NULL) { - return array(); - } - $reprocess = false; // whether or not to reprocess the same token - $stack = array(); - - // member variables - $this->stack =& $stack; - $this->tokens =& $tokens; - $this->token =& $token; - $this->zipper =& $zipper; - $this->config = $config; - $this->context = $context; - - // context variables - $context->register('CurrentNesting', $stack); - $context->register('InputZipper', $zipper); - $context->register('CurrentToken', $token); - - // -- begin INJECTOR -- - - $this->injectors = array(); - - $injectors = $config->getBatch('AutoFormat'); - $def_injectors = $definition->info_injector; - $custom_injectors = $injectors['Custom']; - unset($injectors['Custom']); // special case - foreach ($injectors as $injector => $b) { - // XXX: Fix with a legitimate lookup table of enabled filters - if (strpos($injector, '.') !== false) { - continue; - } - $injector = "HTMLPurifier_Injector_$injector"; - if (!$b) { - continue; - } - $this->injectors[] = new $injector; - } - foreach ($def_injectors as $injector) { - // assumed to be objects - $this->injectors[] = $injector; - } - foreach ($custom_injectors as $injector) { - if (!$injector) { - continue; - } - if (is_string($injector)) { - $injector = "HTMLPurifier_Injector_$injector"; - $injector = new $injector; - } - $this->injectors[] = $injector; - } - - // give the injectors references to the definition and context - // variables for performance reasons - foreach ($this->injectors as $ix => $injector) { - $error = $injector->prepare($config, $context); - if (!$error) { - continue; - } - array_splice($this->injectors, $ix, 1); // rm the injector - trigger_error("Cannot enable {$injector->name} injector because $error is not allowed", E_USER_WARNING); - } - - // -- end INJECTOR -- - - // a note on reprocessing: - // In order to reduce code duplication, whenever some code needs - // to make HTML changes in order to make things "correct", the - // new HTML gets sent through the purifier, regardless of its - // status. This means that if we add a start token, because it - // was totally necessary, we don't have to update nesting; we just - // punt ($reprocess = true; continue;) and it does that for us. - - // isset is in loop because $tokens size changes during loop exec - for (;; - // only increment if we don't need to reprocess - $reprocess ? $reprocess = false : $token = $zipper->next($token)) { - - // check for a rewind - if (is_int($i)) { - // possibility: disable rewinding if the current token has a - // rewind set on it already. This would offer protection from - // infinite loop, but might hinder some advanced rewinding. - $rewind_offset = $this->injectors[$i]->getRewindOffset(); - if (is_int($rewind_offset)) { - for ($j = 0; $j < $rewind_offset; $j++) { - if (empty($zipper->front)) break; - $token = $zipper->prev($token); - // indicate that other injectors should not process this token, - // but we need to reprocess it - unset($token->skip[$i]); - $token->rewind = $i; - if ($token instanceof HTMLPurifier_Token_Start) { - array_pop($this->stack); - } elseif ($token instanceof HTMLPurifier_Token_End) { - $this->stack[] = $token->start; - } - } - } - $i = false; - } - - // handle case of document end - if ($token === NULL) { - // kill processing if stack is empty - if (empty($this->stack)) { - break; - } - - // peek - $top_nesting = array_pop($this->stack); - $this->stack[] = $top_nesting; - - // send error [TagClosedSuppress] - if ($e && !isset($top_nesting->armor['MakeWellFormed_TagClosedError'])) { - $e->send(E_NOTICE, 'Strategy_MakeWellFormed: Tag closed by document end', $top_nesting); - } - - // append, don't splice, since this is the end - $token = new HTMLPurifier_Token_End($top_nesting->name); - - // punt! - $reprocess = true; - continue; - } - - //echo '
      '; printZipper($zipper, $token);//printTokens($this->stack); - //flush(); - - // quick-check: if it's not a tag, no need to process - if (empty($token->is_tag)) { - if ($token instanceof HTMLPurifier_Token_Text) { - foreach ($this->injectors as $i => $injector) { - if (isset($token->skip[$i])) { - continue; - } - if ($token->rewind !== null && $token->rewind !== $i) { - continue; - } - // XXX fuckup - $r = $token; - $injector->handleText($r); - $token = $this->processToken($r, $i); - $reprocess = true; - break; - } - } - // another possibility is a comment - continue; - } - - if (isset($definition->info[$token->name])) { - $type = $definition->info[$token->name]->child->type; - } else { - $type = false; // Type is unknown, treat accordingly - } - - // quick tag checks: anything that's *not* an end tag - $ok = false; - if ($type === 'empty' && $token instanceof HTMLPurifier_Token_Start) { - // claims to be a start tag but is empty - $token = new HTMLPurifier_Token_Empty( - $token->name, - $token->attr, - $token->line, - $token->col, - $token->armor - ); - $ok = true; - } elseif ($type && $type !== 'empty' && $token instanceof HTMLPurifier_Token_Empty) { - // claims to be empty but really is a start tag - // NB: this assignment is required - $old_token = $token; - $token = new HTMLPurifier_Token_End($token->name); - $token = $this->insertBefore( - new HTMLPurifier_Token_Start($old_token->name, $old_token->attr, $old_token->line, $old_token->col, $old_token->armor) - ); - // punt (since we had to modify the input stream in a non-trivial way) - $reprocess = true; - continue; - } elseif ($token instanceof HTMLPurifier_Token_Empty) { - // real empty token - $ok = true; - } elseif ($token instanceof HTMLPurifier_Token_Start) { - // start tag - - // ...unless they also have to close their parent - if (!empty($this->stack)) { - - // Performance note: you might think that it's rather - // inefficient, recalculating the autoclose information - // for every tag that a token closes (since when we - // do an autoclose, we push a new token into the - // stream and then /process/ that, before - // re-processing this token.) But this is - // necessary, because an injector can make an - // arbitrary transformations to the autoclosing - // tokens we introduce, so things may have changed - // in the meantime. Also, doing the inefficient thing is - // "easy" to reason about (for certain perverse definitions - // of "easy") - - $parent = array_pop($this->stack); - $this->stack[] = $parent; - - $parent_def = null; - $parent_elements = null; - $autoclose = false; - if (isset($definition->info[$parent->name])) { - $parent_def = $definition->info[$parent->name]; - $parent_elements = $parent_def->child->getAllowedElements($config); - $autoclose = !isset($parent_elements[$token->name]); - } - - if ($autoclose && $definition->info[$token->name]->wrap) { - // Check if an element can be wrapped by another - // element to make it valid in a context (for - // example,