From 546606b208476c49daca830ee8a3c88d353c23f7 Mon Sep 17 00:00:00 2001 From: Kijin Sung Date: Wed, 6 Jan 2016 19:21:31 +0900 Subject: [PATCH] Initial import of composer dependencies (--no-dev) --- .gitignore | 2 - classes/security/Purifier.class.php | 5 - composer.json | 35 +- composer.lock | 369 ++ package.json | 26 - vendor/autoload.php | 7 + vendor/bin/minifycss | 1 + vendor/bin/minifyjs | 1 + vendor/composer/ClassLoader.php | 413 ++ vendor/composer/LICENSE | 19 + vendor/composer/autoload_classmap.php | 300 ++ vendor/composer/autoload_files.php | 11 + vendor/composer/autoload_namespaces.php | 13 + vendor/composer/autoload_psr4.php | 11 + vendor/composer/autoload_real.php | 59 + vendor/composer/installed.json | 355 ++ vendor/defuse/php-encryption/.travis.yml | 22 + vendor/defuse/php-encryption/Crypto.php | 677 ++++ vendor/defuse/php-encryption/README.md | 79 + vendor/defuse/php-encryption/benchmark.php | 42 + vendor/defuse/php-encryption/composer.json | 20 + vendor/defuse/php-encryption/example.php | 36 + vendor/defuse/php-encryption/test.sh | 30 + .../defuse/php-encryption/tests/runtime.php | 32 + .../ezyang}/htmlpurifier/CREDITS | 0 vendor/ezyang/htmlpurifier/INSTALL | 374 ++ vendor/ezyang/htmlpurifier/INSTALL.fr.utf8 | 60 + .../ezyang}/htmlpurifier/LICENSE | 0 vendor/ezyang/htmlpurifier/NEWS | 1094 +++++ vendor/ezyang/htmlpurifier/README | 24 + vendor/ezyang/htmlpurifier/TODO | 150 + .../ezyang}/htmlpurifier/VERSION | 0 vendor/ezyang/htmlpurifier/WHATSNEW | 4 + vendor/ezyang/htmlpurifier/WYSIWYG | 20 + vendor/ezyang/htmlpurifier/composer.json | 22 + .../extras/ConfigDoc/HTMLXSLTProcessor.php | 91 + vendor/ezyang/htmlpurifier/extras/FSTools.php | 164 + .../htmlpurifier/extras/FSTools/File.php | 141 + .../extras/HTMLPurifierExtras.auto.php | 11 + .../extras/HTMLPurifierExtras.autoload.php | 26 + .../extras/HTMLPurifierExtras.php | 31 + vendor/ezyang/htmlpurifier/extras/README | 32 + .../library/HTMLPurifier.auto.php | 0 .../library/HTMLPurifier.autoload.php | 0 .../library/HTMLPurifier.composer.php | 0 .../library/HTMLPurifier.func.php | 0 .../library/HTMLPurifier.includes.php | 0 .../library/HTMLPurifier.kses.php | 0 .../library/HTMLPurifier.path.php | 0 .../htmlpurifier/library/HTMLPurifier.php | 0 .../library/HTMLPurifier.safe-includes.php | 0 .../library/HTMLPurifier/Arborize.php | 0 .../library/HTMLPurifier/AttrCollections.php | 0 .../library/HTMLPurifier/AttrDef.php | 0 .../library/HTMLPurifier/AttrDef/CSS.php | 0 .../HTMLPurifier/AttrDef/CSS/AlphaValue.php | 0 .../HTMLPurifier/AttrDef/CSS/Background.php | 0 .../AttrDef/CSS/BackgroundPosition.php | 0 .../HTMLPurifier/AttrDef/CSS/Border.php | 0 .../HTMLPurifier/AttrDef/CSS/Color.php | 0 .../HTMLPurifier/AttrDef/CSS/Composite.php | 0 .../AttrDef/CSS/DenyElementDecorator.php | 0 .../HTMLPurifier/AttrDef/CSS/Filter.php | 0 .../library/HTMLPurifier/AttrDef/CSS/Font.php | 0 .../HTMLPurifier/AttrDef/CSS/FontFamily.php | 0 .../HTMLPurifier/AttrDef/CSS/Ident.php | 0 .../AttrDef/CSS/ImportantDecorator.php | 0 .../HTMLPurifier/AttrDef/CSS/Length.php | 0 .../HTMLPurifier/AttrDef/CSS/ListStyle.php | 0 .../HTMLPurifier/AttrDef/CSS/Multiple.php | 0 .../HTMLPurifier/AttrDef/CSS/Number.php | 0 .../HTMLPurifier/AttrDef/CSS/Percentage.php | 0 .../AttrDef/CSS/TextDecoration.php | 0 .../library/HTMLPurifier/AttrDef/CSS/URI.php | 0 .../library/HTMLPurifier/AttrDef/Clone.php | 0 .../library/HTMLPurifier/AttrDef/Enum.php | 0 .../HTMLPurifier/AttrDef/HTML/Bool.php | 0 .../HTMLPurifier/AttrDef/HTML/Class.php | 0 .../HTMLPurifier/AttrDef/HTML/Color.php | 0 .../HTMLPurifier/AttrDef/HTML/FrameTarget.php | 0 .../library/HTMLPurifier/AttrDef/HTML/ID.php | 0 .../HTMLPurifier/AttrDef/HTML/Length.php | 0 .../HTMLPurifier/AttrDef/HTML/LinkTypes.php | 0 .../HTMLPurifier/AttrDef/HTML/MultiLength.php | 0 .../HTMLPurifier/AttrDef/HTML/Nmtokens.php | 0 .../HTMLPurifier/AttrDef/HTML/Pixels.php | 0 .../library/HTMLPurifier/AttrDef/Integer.php | 0 .../library/HTMLPurifier/AttrDef/Lang.php | 0 .../library/HTMLPurifier/AttrDef/Switch.php | 0 .../library/HTMLPurifier/AttrDef/Text.php | 0 .../library/HTMLPurifier/AttrDef/URI.php | 0 .../HTMLPurifier/AttrDef/URI/Email.php | 0 .../AttrDef/URI/Email/SimpleCheck.php | 0 .../library/HTMLPurifier/AttrDef/URI/Host.php | 0 .../library/HTMLPurifier/AttrDef/URI/IPv4.php | 0 .../library/HTMLPurifier/AttrDef/URI/IPv6.php | 0 .../library/HTMLPurifier/AttrTransform.php | 0 .../HTMLPurifier/AttrTransform/Background.php | 0 .../HTMLPurifier/AttrTransform/BdoDir.php | 0 .../HTMLPurifier/AttrTransform/BgColor.php | 0 .../HTMLPurifier/AttrTransform/BoolToCSS.php | 0 .../HTMLPurifier/AttrTransform/Border.php | 0 .../HTMLPurifier/AttrTransform/EnumToCSS.php | 0 .../AttrTransform/ImgRequired.php | 0 .../HTMLPurifier/AttrTransform/ImgSpace.php | 0 .../HTMLPurifier/AttrTransform/Input.php | 0 .../HTMLPurifier/AttrTransform/Lang.php | 0 .../HTMLPurifier/AttrTransform/Length.php | 0 .../HTMLPurifier/AttrTransform/Name.php | 0 .../HTMLPurifier/AttrTransform/NameSync.php | 0 .../HTMLPurifier/AttrTransform/Nofollow.php | 0 .../HTMLPurifier/AttrTransform/SafeEmbed.php | 0 .../HTMLPurifier/AttrTransform/SafeObject.php | 0 .../HTMLPurifier/AttrTransform/SafeParam.php | 0 .../AttrTransform/ScriptRequired.php | 0 .../AttrTransform/TargetBlank.php | 0 .../HTMLPurifier/AttrTransform/Textarea.php | 0 .../library/HTMLPurifier/AttrTypes.php | 0 .../library/HTMLPurifier/AttrValidator.php | 0 .../library/HTMLPurifier/Bootstrap.php | 0 .../library/HTMLPurifier/CSSDefinition.php | 0 .../library/HTMLPurifier/ChildDef.php | 0 .../HTMLPurifier/ChildDef/Chameleon.php | 0 .../library/HTMLPurifier/ChildDef/Custom.php | 0 .../library/HTMLPurifier/ChildDef/Empty.php | 0 .../library/HTMLPurifier/ChildDef/List.php | 0 .../HTMLPurifier/ChildDef/Optional.php | 0 .../HTMLPurifier/ChildDef/Required.php | 0 .../ChildDef/StrictBlockquote.php | 0 .../library/HTMLPurifier/ChildDef/Table.php | 0 .../library/HTMLPurifier/Config.php | 0 .../library/HTMLPurifier/ConfigSchema.php | 0 .../ConfigSchema/Builder/ConfigSchema.php | 0 .../HTMLPurifier/ConfigSchema/Builder/Xml.php | 0 .../HTMLPurifier/ConfigSchema/Exception.php | 0 .../HTMLPurifier/ConfigSchema/Interchange.php | 0 .../ConfigSchema/Interchange/Directive.php | 0 .../ConfigSchema/Interchange/Id.php | 0 .../ConfigSchema/InterchangeBuilder.php | 0 .../HTMLPurifier/ConfigSchema/Validator.php | 0 .../ConfigSchema/ValidatorAtom.php | 0 .../HTMLPurifier/ConfigSchema/schema.ser | Bin .../schema/Attr.AllowedClasses.txt | 0 .../schema/Attr.AllowedFrameTargets.txt | 0 .../ConfigSchema/schema/Attr.AllowedRel.txt | 0 .../ConfigSchema/schema/Attr.AllowedRev.txt | 0 .../schema/Attr.ClassUseCDATA.txt | 0 .../schema/Attr.DefaultImageAlt.txt | 0 .../schema/Attr.DefaultInvalidImage.txt | 0 .../schema/Attr.DefaultInvalidImageAlt.txt | 0 .../schema/Attr.DefaultTextDir.txt | 0 .../ConfigSchema/schema/Attr.EnableID.txt | 0 .../schema/Attr.ForbiddenClasses.txt | 0 .../ConfigSchema/schema/Attr.IDBlacklist.txt | 0 .../schema/Attr.IDBlacklistRegexp.txt | 0 .../ConfigSchema/schema/Attr.IDPrefix.txt | 0 .../schema/Attr.IDPrefixLocal.txt | 0 .../schema/AutoFormat.AutoParagraph.txt | 0 .../ConfigSchema/schema/AutoFormat.Custom.txt | 0 .../schema/AutoFormat.DisplayLinkURI.txt | 0 .../schema/AutoFormat.Linkify.txt | 0 .../AutoFormat.PurifierLinkify.DocURL.txt | 0 .../schema/AutoFormat.PurifierLinkify.txt | 0 .../AutoFormat.RemoveEmpty.Predicate.txt | 0 ...rmat.RemoveEmpty.RemoveNbsp.Exceptions.txt | 0 .../AutoFormat.RemoveEmpty.RemoveNbsp.txt | 0 .../schema/AutoFormat.RemoveEmpty.txt | 0 ...utoFormat.RemoveSpansWithoutAttributes.txt | 0 .../schema/CSS.AllowImportant.txt | 0 .../ConfigSchema/schema/CSS.AllowTricky.txt | 0 .../ConfigSchema/schema/CSS.AllowedFonts.txt | 0 .../schema/CSS.AllowedProperties.txt | 0 .../ConfigSchema/schema/CSS.DefinitionRev.txt | 0 .../schema/CSS.ForbiddenProperties.txt | 0 .../ConfigSchema/schema/CSS.MaxImgLength.txt | 0 .../ConfigSchema/schema/CSS.Proprietary.txt | 0 .../ConfigSchema/schema/CSS.Trusted.txt | 0 .../schema/Cache.DefinitionImpl.txt | 0 .../schema/Cache.SerializerPath.txt | 0 .../schema/Cache.SerializerPermissions.txt | 0 .../schema/Core.AggressivelyFixLt.txt | 0 .../schema/Core.AllowHostnameUnderscore.txt | 0 .../schema/Core.CollectErrors.txt | 0 .../schema/Core.ColorKeywords.txt | 0 .../schema/Core.ConvertDocumentToFragment.txt | 0 .../Core.DirectLexLineNumberSyncInterval.txt | 0 .../schema/Core.DisableExcludes.txt | 0 .../ConfigSchema/schema/Core.EnableIDNA.txt | 0 .../ConfigSchema/schema/Core.Encoding.txt | 0 .../schema/Core.EscapeInvalidChildren.txt | 0 .../schema/Core.EscapeInvalidTags.txt | 0 .../schema/Core.EscapeNonASCIICharacters.txt | 0 .../schema/Core.HiddenElements.txt | 0 .../ConfigSchema/schema/Core.Language.txt | 0 .../ConfigSchema/schema/Core.LexerImpl.txt | 0 .../schema/Core.MaintainLineNumbers.txt | 0 .../schema/Core.NormalizeNewlines.txt | 0 .../schema/Core.RemoveInvalidImg.txt | 0 .../Core.RemoveProcessingInstructions.txt | 0 .../schema/Core.RemoveScriptContents.txt | 0 .../ConfigSchema/schema/Filter.Custom.txt | 0 .../Filter.ExtractStyleBlocks.Escaping.txt | 0 .../Filter.ExtractStyleBlocks.Scope.txt | 0 .../Filter.ExtractStyleBlocks.TidyImpl.txt | 0 .../schema/Filter.ExtractStyleBlocks.txt | 0 .../ConfigSchema/schema/Filter.YouTube.txt | 0 .../ConfigSchema/schema/HTML.Allowed.txt | 0 .../schema/HTML.AllowedAttributes.txt | 0 .../schema/HTML.AllowedComments.txt | 0 .../schema/HTML.AllowedCommentsRegexp.txt | 0 .../schema/HTML.AllowedElements.txt | 0 .../schema/HTML.AllowedModules.txt | 0 .../schema/HTML.Attr.Name.UseCDATA.txt | 0 .../ConfigSchema/schema/HTML.BlockWrapper.txt | 0 .../ConfigSchema/schema/HTML.CoreModules.txt | 0 .../schema/HTML.CustomDoctype.txt | 0 .../ConfigSchema/schema/HTML.DefinitionID.txt | 0 .../schema/HTML.DefinitionRev.txt | 0 .../ConfigSchema/schema/HTML.Doctype.txt | 0 .../schema/HTML.FlashAllowFullScreen.txt | 0 .../schema/HTML.ForbiddenAttributes.txt | 0 .../schema/HTML.ForbiddenElements.txt | 0 .../ConfigSchema/schema/HTML.MaxImgLength.txt | 0 .../ConfigSchema/schema/HTML.Nofollow.txt | 0 .../ConfigSchema/schema/HTML.Parent.txt | 0 .../ConfigSchema/schema/HTML.Proprietary.txt | 0 .../ConfigSchema/schema/HTML.SafeEmbed.txt | 0 .../ConfigSchema/schema/HTML.SafeIframe.txt | 0 .../ConfigSchema/schema/HTML.SafeObject.txt | 0 .../schema/HTML.SafeScripting.txt | 0 .../ConfigSchema/schema/HTML.Strict.txt | 0 .../ConfigSchema/schema/HTML.TargetBlank.txt | 0 .../ConfigSchema/schema/HTML.TidyAdd.txt | 0 .../ConfigSchema/schema/HTML.TidyLevel.txt | 0 .../ConfigSchema/schema/HTML.TidyRemove.txt | 0 .../ConfigSchema/schema/HTML.Trusted.txt | 0 .../ConfigSchema/schema/HTML.XHTML.txt | 0 .../schema/Output.CommentScriptContents.txt | 0 .../schema/Output.FixInnerHTML.txt | 0 .../schema/Output.FlashCompat.txt | 0 .../ConfigSchema/schema/Output.Newline.txt | 0 .../ConfigSchema/schema/Output.SortAttr.txt | 0 .../ConfigSchema/schema/Output.TidyFormat.txt | 0 .../ConfigSchema/schema/Test.ForceNoIconv.txt | 0 .../schema/URI.AllowedSchemes.txt | 0 .../ConfigSchema/schema/URI.Base.txt | 0 .../ConfigSchema/schema/URI.DefaultScheme.txt | 0 .../ConfigSchema/schema/URI.DefinitionID.txt | 0 .../ConfigSchema/schema/URI.DefinitionRev.txt | 0 .../ConfigSchema/schema/URI.Disable.txt | 0 .../schema/URI.DisableExternal.txt | 0 .../schema/URI.DisableExternalResources.txt | 0 .../schema/URI.DisableResources.txt | 0 .../ConfigSchema/schema/URI.Host.txt | 0 .../ConfigSchema/schema/URI.HostBlacklist.txt | 0 .../ConfigSchema/schema/URI.MakeAbsolute.txt | 0 .../ConfigSchema/schema/URI.Munge.txt | 0 .../schema/URI.MungeResources.txt | 0 .../schema/URI.MungeSecretKey.txt | 0 .../schema/URI.OverrideAllowedSchemes.txt | 0 .../schema/URI.SafeIframeRegexp.txt | 0 .../HTMLPurifier/ConfigSchema/schema/info.ini | 0 .../library/HTMLPurifier/ContentSets.php | 0 .../library/HTMLPurifier/Context.php | 0 .../library/HTMLPurifier/Definition.php | 0 .../library/HTMLPurifier/DefinitionCache.php | 0 .../DefinitionCache/Decorator.php | 0 .../DefinitionCache/Decorator/Cleanup.php | 0 .../DefinitionCache/Decorator/Memory.php | 0 .../DefinitionCache/Decorator/Template.php.in | 0 .../HTMLPurifier/DefinitionCache/Null.php | 0 .../DefinitionCache/Serializer.php | 2 +- .../DefinitionCache/Serializer/README | 0 .../HTMLPurifier/DefinitionCacheFactory.php | 0 .../library/HTMLPurifier/Doctype.php | 0 .../library/HTMLPurifier/DoctypeRegistry.php | 0 .../library/HTMLPurifier/ElementDef.php | 0 .../library/HTMLPurifier/Encoder.php | 0 .../library/HTMLPurifier/EntityLookup.php | 0 .../HTMLPurifier/EntityLookup/entities.ser | 0 .../library/HTMLPurifier/EntityParser.php | 0 .../library/HTMLPurifier/ErrorCollector.php | 0 .../library/HTMLPurifier/ErrorStruct.php | 0 .../library/HTMLPurifier/Exception.php | 0 .../library/HTMLPurifier/Filter.php | 0 .../Filter/ExtractStyleBlocks.php | 0 .../library/HTMLPurifier/Filter/YouTube.php | 0 .../library/HTMLPurifier/Generator.php | 0 .../library/HTMLPurifier/HTMLDefinition.php | 0 .../library/HTMLPurifier/HTMLModule.php | 0 .../library/HTMLPurifier/HTMLModule/Bdo.php | 0 .../HTMLModule/CommonAttributes.php | 0 .../library/HTMLPurifier/HTMLModule/Edit.php | 0 .../library/HTMLPurifier/HTMLModule/Forms.php | 0 .../HTMLPurifier/HTMLModule/Hypertext.php | 0 .../HTMLPurifier/HTMLModule/Iframe.php | 0 .../library/HTMLPurifier/HTMLModule/Image.php | 0 .../HTMLPurifier/HTMLModule/Legacy.php | 0 .../library/HTMLPurifier/HTMLModule/List.php | 0 .../library/HTMLPurifier/HTMLModule/Name.php | 0 .../HTMLPurifier/HTMLModule/Nofollow.php | 0 .../HTMLModule/NonXMLCommonAttributes.php | 0 .../HTMLPurifier/HTMLModule/Object.php | 0 .../HTMLPurifier/HTMLModule/Presentation.php | 0 .../HTMLPurifier/HTMLModule/Proprietary.php | 0 .../library/HTMLPurifier/HTMLModule/Ruby.php | 0 .../HTMLPurifier/HTMLModule/SafeEmbed.php | 0 .../HTMLPurifier/HTMLModule/SafeObject.php | 0 .../HTMLPurifier/HTMLModule/SafeScripting.php | 0 .../HTMLPurifier/HTMLModule/Scripting.php | 0 .../HTMLModule/StyleAttribute.php | 0 .../HTMLPurifier/HTMLModule/Tables.php | 0 .../HTMLPurifier/HTMLModule/Target.php | 0 .../HTMLPurifier/HTMLModule/TargetBlank.php | 0 .../library/HTMLPurifier/HTMLModule/Text.php | 0 .../library/HTMLPurifier/HTMLModule/Tidy.php | 0 .../HTMLPurifier/HTMLModule/Tidy/Name.php | 0 .../HTMLModule/Tidy/Proprietary.php | 0 .../HTMLPurifier/HTMLModule/Tidy/Strict.php | 0 .../HTMLModule/Tidy/Transitional.php | 0 .../HTMLPurifier/HTMLModule/Tidy/XHTML.php | 0 .../HTMLModule/Tidy/XHTMLAndHTML4.php | 0 .../HTMLModule/XMLCommonAttributes.php | 0 .../HTMLPurifier/HTMLModuleManager.php | 0 .../library/HTMLPurifier/IDAccumulator.php | 0 .../library/HTMLPurifier/Injector.php | 0 .../HTMLPurifier/Injector/AutoParagraph.php | 0 .../HTMLPurifier/Injector/DisplayLinkURI.php | 0 .../library/HTMLPurifier/Injector/Linkify.php | 0 .../HTMLPurifier/Injector/PurifierLinkify.php | 0 .../HTMLPurifier/Injector/RemoveEmpty.php | 0 .../Injector/RemoveSpansWithoutAttributes.php | 0 .../HTMLPurifier/Injector/SafeObject.php | 0 .../library/HTMLPurifier/Language.php | 0 .../Language/classes/en-x-test.php | 0 .../Language/messages/en-x-test.php | 0 .../Language/messages/en-x-testmini.php | 0 .../HTMLPurifier/Language/messages/en.php | 0 .../library/HTMLPurifier/LanguageFactory.php | 0 .../library/HTMLPurifier/Length.php | 0 .../library/HTMLPurifier/Lexer.php | 0 .../library/HTMLPurifier/Lexer/DOMLex.php | 0 .../library/HTMLPurifier/Lexer/DirectLex.php | 0 .../library/HTMLPurifier/Lexer/PH5P.php | 0 .../library/HTMLPurifier/Node.php | 0 .../library/HTMLPurifier/Node/Comment.php | 0 .../library/HTMLPurifier/Node/Element.php | 0 .../library/HTMLPurifier/Node/Text.php | 0 .../library/HTMLPurifier/PercentEncoder.php | 0 .../library/HTMLPurifier/Printer.php | 0 .../HTMLPurifier/Printer/CSSDefinition.php | 0 .../HTMLPurifier/Printer/ConfigForm.css | 0 .../HTMLPurifier/Printer/ConfigForm.js | 0 .../HTMLPurifier/Printer/ConfigForm.php | 0 .../HTMLPurifier/Printer/HTMLDefinition.php | 0 .../library/HTMLPurifier/PropertyList.php | 0 .../HTMLPurifier/PropertyListIterator.php | 0 .../library/HTMLPurifier/Queue.php | 0 .../library/HTMLPurifier/Strategy.php | 0 .../HTMLPurifier/Strategy/Composite.php | 0 .../library/HTMLPurifier/Strategy/Core.php | 0 .../HTMLPurifier/Strategy/FixNesting.php | 0 .../HTMLPurifier/Strategy/MakeWellFormed.php | 0 .../Strategy/RemoveForeignElements.php | 0 .../Strategy/ValidateAttributes.php | 0 .../library/HTMLPurifier/StringHash.php | 0 .../library/HTMLPurifier/StringHashParser.php | 0 .../library/HTMLPurifier/TagTransform.php | 0 .../HTMLPurifier/TagTransform/Font.php | 0 .../HTMLPurifier/TagTransform/Simple.php | 0 .../library/HTMLPurifier/Token.php | 0 .../library/HTMLPurifier/Token/Comment.php | 0 .../library/HTMLPurifier/Token/Empty.php | 0 .../library/HTMLPurifier/Token/End.php | 0 .../library/HTMLPurifier/Token/Start.php | 0 .../library/HTMLPurifier/Token/Tag.php | 0 .../library/HTMLPurifier/Token/Text.php | 0 .../library/HTMLPurifier/TokenFactory.php | 0 .../htmlpurifier/library/HTMLPurifier/URI.php | 0 .../library/HTMLPurifier/URIDefinition.php | 0 .../library/HTMLPurifier/URIFilter.php | 0 .../URIFilter/DisableExternal.php | 0 .../URIFilter/DisableExternalResources.php | 0 .../URIFilter/DisableResources.php | 0 .../HTMLPurifier/URIFilter/HostBlacklist.php | 0 .../HTMLPurifier/URIFilter/MakeAbsolute.php | 0 .../library/HTMLPurifier/URIFilter/Munge.php | 0 .../HTMLPurifier/URIFilter/SafeIframe.php | 0 .../library/HTMLPurifier/URIParser.php | 0 .../library/HTMLPurifier/URIScheme.php | 0 .../library/HTMLPurifier/URIScheme/data.php | 2 +- .../library/HTMLPurifier/URIScheme/file.php | 0 .../library/HTMLPurifier/URIScheme/ftp.php | 0 .../library/HTMLPurifier/URIScheme/http.php | 0 .../library/HTMLPurifier/URIScheme/https.php | 0 .../library/HTMLPurifier/URIScheme/mailto.php | 0 .../library/HTMLPurifier/URIScheme/news.php | 0 .../library/HTMLPurifier/URIScheme/nntp.php | 0 .../HTMLPurifier/URISchemeRegistry.php | 0 .../library/HTMLPurifier/UnitConverter.php | 0 .../library/HTMLPurifier/VarParser.php | 0 .../HTMLPurifier/VarParser/Flexible.php | 0 .../library/HTMLPurifier/VarParser/Native.php | 0 .../HTMLPurifier/VarParserException.php | 0 .../library/HTMLPurifier/Zipper.php | 0 vendor/ezyang/htmlpurifier/package.php | 61 + vendor/ezyang/htmlpurifier/phpdoc.ini | 102 + vendor/ezyang/htmlpurifier/plugins/modx.txt | 112 + .../htmlpurifier/plugins/phorum/.gitignore | 2 + .../htmlpurifier/plugins/phorum/Changelog | 27 + .../htmlpurifier/plugins/phorum/INSTALL | 84 + .../ezyang/htmlpurifier/plugins/phorum/README | 45 + .../plugins/phorum/config.default.php | 57 + .../plugins/phorum/htmlpurifier.php | 316 ++ .../htmlpurifier/plugins/phorum/info.txt | 18 + .../plugins/phorum/init-config.php | 30 + .../plugins/phorum/migrate.bbcode.php | 31 + .../htmlpurifier/plugins/phorum/settings.php | 64 + .../plugins/phorum/settings/form.php | 95 + .../phorum/settings/migrate-sigs-form.php | 22 + .../plugins/phorum/settings/migrate-sigs.php | 79 + .../plugins/phorum/settings/save.php | 29 + .../ezyang/htmlpurifier/release1-update.php | 110 + vendor/ezyang/htmlpurifier/release2-tag.php | 22 + .../htmlpurifier/test-settings.sample.php | 76 + vendor/matthiasmullie/minify/.coveralls.yml | 3 + vendor/matthiasmullie/minify/LICENSE | 18 + vendor/matthiasmullie/minify/bin/minifycss | 45 + vendor/matthiasmullie/minify/bin/minifyjs | 45 + vendor/matthiasmullie/minify/composer.json | 35 + .../minify/data/js/keywords_after.txt | 7 + .../minify/data/js/keywords_before.txt | 27 + .../minify/data/js/keywords_reserved.txt | 47 + .../minify/data/js/operators_after.txt | 45 + .../minify/data/js/operators_before.txt | 43 + vendor/matthiasmullie/minify/src/CSS.php | 573 +++ .../matthiasmullie/minify/src/Exception.php | 10 + vendor/matthiasmullie/minify/src/JS.php | 490 +++ vendor/matthiasmullie/minify/src/Minify.php | 382 ++ .../path-converter/.coveralls.yml | 3 + vendor/matthiasmullie/path-converter/LICENSE | 18 + .../path-converter/composer.json | 29 + .../path-converter/src/Converter.php | 186 + vendor/michelf/php-markdown/License.md | 36 + .../php-markdown/Michelf/Markdown.inc.php | 10 + .../michelf/php-markdown/Michelf/Markdown.php | 1609 ++++++++ .../Michelf/MarkdownExtra.inc.php | 11 + .../php-markdown/Michelf/MarkdownExtra.php | 1614 ++++++++ .../Michelf/MarkdownInterface.inc.php | 9 + .../Michelf/MarkdownInterface.php | 34 + vendor/michelf/php-markdown/Readme.md | 327 ++ vendor/michelf/php-markdown/Readme.php | 31 + vendor/michelf/php-markdown/composer.json | 31 + vendor/rmccue/requests/.coveralls.yml | 4 + vendor/rmccue/requests/.travis.yml | 19 + vendor/rmccue/requests/CHANGELOG.md | 56 + vendor/rmccue/requests/LICENSE | 49 + vendor/rmccue/requests/README.md | 146 + .../requests/bin/create_pear_package.php | 55 + vendor/rmccue/requests/composer.json | 23 + vendor/rmccue/requests/docs/README.md | 28 + .../requests/docs/authentication-custom.md | 44 + vendor/rmccue/requests/docs/authentication.md | 31 + vendor/rmccue/requests/docs/goals.md | 29 + vendor/rmccue/requests/docs/hooks.md | 92 + vendor/rmccue/requests/docs/proxy.md | 23 + vendor/rmccue/requests/docs/usage-advanced.md | 74 + vendor/rmccue/requests/docs/usage.md | 154 + vendor/rmccue/requests/docs/why-requests.md | 192 + .../rmccue/requests/examples/basic-auth.php | 16 + vendor/rmccue/requests/examples/get.php | 13 + vendor/rmccue/requests/examples/multiple.php | 45 + vendor/rmccue/requests/examples/post.php | 13 + vendor/rmccue/requests/examples/proxy.php | 18 + vendor/rmccue/requests/examples/session.php | 24 + vendor/rmccue/requests/library/Requests.php | 863 ++++ .../rmccue/requests/library/Requests/Auth.php | 33 + .../requests/library/Requests/Auth/Basic.php | 88 + .../requests/library/Requests/Cookie.php | 171 + .../requests/library/Requests/Cookie/Jar.php | 146 + .../requests/library/Requests/Exception.php | 62 + .../library/Requests/Exception/HTTP.php | 67 + .../library/Requests/Exception/HTTP/400.php | 27 + .../library/Requests/Exception/HTTP/401.php | 27 + .../library/Requests/Exception/HTTP/402.php | 27 + .../library/Requests/Exception/HTTP/403.php | 27 + .../library/Requests/Exception/HTTP/404.php | 27 + .../library/Requests/Exception/HTTP/405.php | 27 + .../library/Requests/Exception/HTTP/406.php | 27 + .../library/Requests/Exception/HTTP/407.php | 27 + .../library/Requests/Exception/HTTP/408.php | 27 + .../library/Requests/Exception/HTTP/409.php | 27 + .../library/Requests/Exception/HTTP/410.php | 27 + .../library/Requests/Exception/HTTP/411.php | 27 + .../library/Requests/Exception/HTTP/412.php | 27 + .../library/Requests/Exception/HTTP/413.php | 27 + .../library/Requests/Exception/HTTP/414.php | 27 + .../library/Requests/Exception/HTTP/415.php | 27 + .../library/Requests/Exception/HTTP/416.php | 27 + .../library/Requests/Exception/HTTP/417.php | 27 + .../library/Requests/Exception/HTTP/418.php | 29 + .../library/Requests/Exception/HTTP/428.php | 29 + .../library/Requests/Exception/HTTP/429.php | 29 + .../library/Requests/Exception/HTTP/431.php | 29 + .../library/Requests/Exception/HTTP/500.php | 27 + .../library/Requests/Exception/HTTP/501.php | 27 + .../library/Requests/Exception/HTTP/502.php | 27 + .../library/Requests/Exception/HTTP/503.php | 27 + .../library/Requests/Exception/HTTP/504.php | 27 + .../library/Requests/Exception/HTTP/505.php | 27 + .../library/Requests/Exception/HTTP/511.php | 29 + .../Requests/Exception/HTTP/Unknown.php | 44 + .../requests/library/Requests/Hooker.php | 33 + .../requests/library/Requests/Hooks.php | 61 + .../requests/library/Requests/IDNAEncoder.php | 390 ++ .../rmccue/requests/library/Requests/IPv6.php | 221 + .../rmccue/requests/library/Requests/IRI.php | 1220 ++++++ .../requests/library/Requests/Proxy.php | 35 + .../requests/library/Requests/Proxy/HTTP.php | 150 + .../requests/library/Requests/Response.php | 95 + .../library/Requests/Response/Headers.php | 95 + .../rmccue/requests/library/Requests/SSL.php | 151 + .../requests/library/Requests/Session.php | 253 ++ .../requests/library/Requests/Transport.php | 41 + .../library/Requests/Transport/cURL.php | 351 ++ .../library/Requests/Transport/cacert.pem | 3554 +++++++++++++++++ .../library/Requests/Transport/fsockopen.php | 394 ++ .../Utility/CaseInsensitiveDictionary.php | 91 + .../Requests/Utility/FilteredIterator.php | 38 + vendor/rmccue/requests/package.xml.tpl | 60 + vendor/rmccue/requests/tests/Auth/Basic.php | 87 + .../rmccue/requests/tests/ChunkedEncoding.php | 68 + vendor/rmccue/requests/tests/Cookies.php | 174 + vendor/rmccue/requests/tests/Encoding.php | 94 + vendor/rmccue/requests/tests/IDNAEncoder.php | 102 + vendor/rmccue/requests/tests/IRI.php | 418 ++ vendor/rmccue/requests/tests/Requests.php | 140 + .../requests/tests/Response/Headers.php | 55 + vendor/rmccue/requests/tests/SSL.php | 108 + vendor/rmccue/requests/tests/Session.php | 86 + .../rmccue/requests/tests/Transport/Base.php | 683 ++++ .../rmccue/requests/tests/Transport/cURL.php | 5 + .../requests/tests/Transport/fsockopen.php | 5 + vendor/rmccue/requests/tests/bootstrap.php | 124 + vendor/rmccue/requests/tests/phpunit.xml.dist | 35 + .../php-simple-html-dom-parser/README.md | 38 + .../Src/Sunra/PhpSimple/HtmlDomParser.php | 20 + .../simplehtmldom_1_5/app/.svn/all-wcprops | 17 + .../simplehtmldom_1_5/app/.svn/entries | 99 + .../app/.svn/text-base/google.htm.svn-base | 891 +++++ .../app/.svn/text-base/index.php.svn-base | 144 + .../simplehtmldom_1_5/app/google.htm | 891 +++++ .../PhpSimple/simplehtmldom_1_5/app/index.php | 144 + .../simplehtmldom_1_5/app/js/.svn/all-wcprops | 29 + .../simplehtmldom_1_5/app/js/.svn/entries | 167 + .../app/js/.svn/text-base/jquery.js.svn-base | 3363 ++++++++++++++++ .../text-base/jquery.treeview.css.svn-base | 68 + .../text-base/jquery.treeview.js.svn-base | 251 ++ .../app/js/.svn/text-base/screen.css.svn-base | 24 + .../app/js/images/.svn/all-wcprops | 17 + .../app/js/images/.svn/entries | 96 + .../treeview-default-line.gif.svn-base | 5 + .../prop-base/treeview-default.gif.svn-base | 5 + .../treeview-default-line.gif.svn-base | Bin 0 -> 1993 bytes .../text-base/treeview-default.gif.svn-base | Bin 0 -> 1222 bytes .../app/js/images/treeview-default-line.gif | Bin 0 -> 1993 bytes .../app/js/images/treeview-default.gif | Bin 0 -> 1222 bytes .../simplehtmldom_1_5/app/js/jquery.js | 3363 ++++++++++++++++ .../app/js/jquery.treeview.css | 68 + .../app/js/jquery.treeview.js | 251 ++ .../simplehtmldom_1_5/app/js/screen.css | 24 + .../simplehtmldom_1_5/change_log.txt | 109 + .../example/.svn/all-wcprops | 41 + .../simplehtmldom_1_5/example/.svn/entries | 235 ++ .../prop-base/example_callback.php.svn-base | 13 + .../example_extract_html.php.svn-base | 13 + .../example_advanced_selector.php.svn-base | 54 + .../example_basic_selector.php.svn-base | 37 + .../text-base/example_callback.php.svn-base | 28 + .../example_extract_html.php.svn-base | 5 + .../example_modify_contents.php.svn-base | 18 + .../simple_html_dom_utility.php.svn-base | 35 + .../example/example_advanced_selector.php | 54 + .../example/example_basic_selector.php | 37 + .../example/example_callback.php | 28 + .../example/example_extract_html.php | 5 + .../example/example_modify_contents.php | 18 + .../example/scraping/.svn/all-wcprops | 23 + .../example/scraping/.svn/entries | 130 + .../example_scraping_digg.php.svn-base | 13 + .../example_scraping_imdb.php.svn-base | 13 + .../example_scraping_slashdot.php.svn-base | 13 + .../example_scraping_digg.php.svn-base | 44 + .../example_scraping_imdb.php.svn-base | 51 + .../example_scraping_slashdot.php.svn-base | 35 + .../scraping/example_scraping_digg.php | 44 + .../scraping/example_scraping_imdb.php | 51 + .../scraping/example_scraping_slashdot.php | 35 + .../example/simple_html_dom_utility.php | 35 + .../simplehtmldom_1_5/manual/.svn/all-wcprops | 23 + .../simplehtmldom_1_5/manual/.svn/entries | 139 + .../manual/.svn/prop-base/manual.htm.svn-base | 5 + .../.svn/prop-base/manual_api.htm.svn-base | 5 + .../.svn/prop-base/manual_faq.htm.svn-base | 5 + .../manual/.svn/text-base/manual.htm.svn-base | 448 +++ .../.svn/text-base/manual_api.htm.svn-base | 320 ++ .../.svn/text-base/manual_faq.htm.svn-base | 91 + .../manual/css/.svn/all-wcprops | 17 + .../simplehtmldom_1_5/manual/css/.svn/entries | 96 + .../css/.svn/text-base/default.css.svn-base | 113 + .../css/.svn/text-base/ui.tabs.css.svn-base | 116 + .../simplehtmldom_1_5/manual/css/default.css | 113 + .../simplehtmldom_1_5/manual/css/ui.tabs.css | 116 + .../manual/img/.svn/all-wcprops | 11 + .../simplehtmldom_1_5/manual/img/.svn/entries | 62 + .../img/.svn/prop-base/tab.png.svn-base | 5 + .../img/.svn/text-base/tab.png.svn-base | Bin 0 -> 734 bytes .../simplehtmldom_1_5/manual/img/tab.png | Bin 0 -> 734 bytes .../manual/js/.svn/all-wcprops | 17 + .../simplehtmldom_1_5/manual/js/.svn/entries | 96 + .../text-base/jquery-1.2.3.pack.js.svn-base | 11 + .../.svn/text-base/ui.tabs.pack.js.svn-base | 10 + .../manual/js/jquery-1.2.3.pack.js | 11 + .../manual/js/ui.tabs.pack.js | 10 + .../simplehtmldom_1_5/manual/manual.htm | 448 +++ .../simplehtmldom_1_5/manual/manual_api.htm | 320 ++ .../simplehtmldom_1_5/manual/manual_faq.htm | 91 + .../simplehtmldom_1_5/simple_html_dom.php | 1721 ++++++++ .../testcase/.svn/all-wcprops | 95 + .../simplehtmldom_1_5/testcase/.svn/entries | 544 +++ .../.svn/prop-base/all_test.php.svn-base | 5 + .../prop-base/callback_testcase.php.svn-base | 13 + .../.svn/prop-base/dom_testcase.php.svn-base | 5 + .../prop-base/element_testcase.php.svn-base | 5 + .../prop-base/invalid_testcase.php.svn-base | 5 + .../prop-base/jquery-1.2.3.pack.js.svn-base | 5 + .../.svn/prop-base/mass_test.php.svn-base | 5 + .../.svn/prop-base/memory_test.php.svn-base | 5 + .../.svn/prop-base/misc_testcase.php.svn-base | 5 + .../prop-base/performance_test.php.svn-base | 13 + .../prop-base/selector_testcase.php.svn-base | 5 + .../.svn/prop-base/slick_test.php.svn-base | 5 + .../.svn/prop-base/slickspeed.htm.svn-base | 5 + .../.svn/prop-base/std_testcase.php.svn-base | 5 + .../prop-base/strip_testcase.php.svn-base | 5 + .../.svn/text-base/all_test.php.svn-base | 24 + .../text-base/callback_testcase.php.svn-base | 74 + .../.svn/text-base/dom_testcase.php.svn-base | 386 ++ .../text-base/element_testcase.php.svn-base | 247 ++ .../text-base/invalid_testcase.php.svn-base | 658 +++ .../text-base/jquery-1.2.3.pack.js.svn-base | 11 + .../.svn/text-base/mass_test.php.svn-base | 68 + .../.svn/text-base/memory_test.php.svn-base | 121 + .../.svn/text-base/misc_testcase.php.svn-base | 60 + .../text-base/performance_test.php.svn-base | 40 + .../text-base/selector_testcase.php.svn-base | 742 ++++ .../.svn/text-base/slick_test.php.svn-base | 27 + .../.svn/text-base/slickspeed.htm.svn-base | 2888 ++++++++++++++ .../.svn/text-base/std_testcase.php.svn-base | 243 ++ .../text-base/strip_testcase.php.svn-base | 137 + .../simplehtmldom_1_5/testcase/all_test.php | 24 + .../testcase/callback_testcase.php | 74 + .../testcase/dom_testcase.php | 386 ++ .../testcase/element_testcase.php | 247 ++ .../testcase/html/.svn/all-wcprops | 5 + .../testcase/html/.svn/entries | 28 + .../testcase/invalid_testcase.php | 658 +++ .../testcase/jquery-1.2.3.pack.js | 11 + .../simplehtmldom_1_5/testcase/mass_test.php | 68 + .../testcase/memory_test.php | 121 + .../testcase/misc_testcase.php | 60 + .../testcase/performance_test.php | 40 + .../testcase/reader/.svn/all-wcprops | 35 + .../testcase/reader/.svn/dir-prop-base | 5 + .../testcase/reader/.svn/entries | 198 + .../.svn/prop-base/all_test.php.svn-base | 13 + .../prop-base/element_testcase.php.svn-base | 13 + .../.svn/prop-base/memory_test.php.svn-base | 13 + .../prop-base/performance_test.php.svn-base | 13 + .../prop-base/selector_testcase.php.svn-base | 13 + .../.svn/text-base/all_test.php.svn-base | 12 + .../text-base/element_testcase.php.svn-base | 243 ++ .../.svn/text-base/memory_test.php.svn-base | 103 + .../text-base/performance_test.php.svn-base | 38 + .../text-base/selector_testcase.php.svn-base | 584 +++ .../testcase/reader/all_test.php | 12 + .../testcase/reader/element_testcase.php | 243 ++ .../testcase/reader/memory_test.php | 103 + .../testcase/reader/performance_test.php | 38 + .../testcase/reader/selector_testcase.php | 584 +++ .../testcase/selector_testcase.php | 742 ++++ .../simplehtmldom_1_5/testcase/slick_test.php | 27 + .../simplehtmldom_1_5/testcase/slickspeed.htm | 2888 ++++++++++++++ .../testcase/std_testcase.php | 243 ++ .../testcase/strip_testcase.php | 137 + .../php-simple-html-dom-parser/composer.json | 24 + 696 files changed, 54815 insertions(+), 44 deletions(-) create mode 100644 composer.lock delete mode 100644 package.json create mode 100644 vendor/autoload.php create mode 120000 vendor/bin/minifycss create mode 120000 vendor/bin/minifyjs create mode 100644 vendor/composer/ClassLoader.php create mode 100644 vendor/composer/LICENSE create mode 100644 vendor/composer/autoload_classmap.php create mode 100644 vendor/composer/autoload_files.php create mode 100644 vendor/composer/autoload_namespaces.php create mode 100644 vendor/composer/autoload_psr4.php create mode 100644 vendor/composer/autoload_real.php create mode 100644 vendor/composer/installed.json create mode 100644 vendor/defuse/php-encryption/.travis.yml create mode 100755 vendor/defuse/php-encryption/Crypto.php create mode 100644 vendor/defuse/php-encryption/README.md create mode 100644 vendor/defuse/php-encryption/benchmark.php create mode 100644 vendor/defuse/php-encryption/composer.json create mode 100644 vendor/defuse/php-encryption/example.php create mode 100755 vendor/defuse/php-encryption/test.sh create mode 100644 vendor/defuse/php-encryption/tests/runtime.php rename {classes/security => vendor/ezyang}/htmlpurifier/CREDITS (100%) create mode 100644 vendor/ezyang/htmlpurifier/INSTALL create mode 100644 vendor/ezyang/htmlpurifier/INSTALL.fr.utf8 rename {classes/security => vendor/ezyang}/htmlpurifier/LICENSE (100%) create mode 100644 vendor/ezyang/htmlpurifier/NEWS create mode 100644 vendor/ezyang/htmlpurifier/README create mode 100644 vendor/ezyang/htmlpurifier/TODO rename {classes/security => vendor/ezyang}/htmlpurifier/VERSION (100%) create mode 100644 vendor/ezyang/htmlpurifier/WHATSNEW create mode 100644 vendor/ezyang/htmlpurifier/WYSIWYG create mode 100644 vendor/ezyang/htmlpurifier/composer.json create mode 100644 vendor/ezyang/htmlpurifier/extras/ConfigDoc/HTMLXSLTProcessor.php create mode 100644 vendor/ezyang/htmlpurifier/extras/FSTools.php create mode 100644 vendor/ezyang/htmlpurifier/extras/FSTools/File.php create mode 100644 vendor/ezyang/htmlpurifier/extras/HTMLPurifierExtras.auto.php create mode 100644 vendor/ezyang/htmlpurifier/extras/HTMLPurifierExtras.autoload.php create mode 100644 vendor/ezyang/htmlpurifier/extras/HTMLPurifierExtras.php create mode 100644 vendor/ezyang/htmlpurifier/extras/README rename {classes/security => vendor/ezyang}/htmlpurifier/library/HTMLPurifier.auto.php (100%) rename {classes/security => vendor/ezyang}/htmlpurifier/library/HTMLPurifier.autoload.php (100%) rename {classes/security => vendor/ezyang}/htmlpurifier/library/HTMLPurifier.composer.php (100%) rename {classes/security => vendor/ezyang}/htmlpurifier/library/HTMLPurifier.func.php (100%) rename {classes/security => vendor/ezyang}/htmlpurifier/library/HTMLPurifier.includes.php (100%) rename {classes/security => vendor/ezyang}/htmlpurifier/library/HTMLPurifier.kses.php (100%) rename {classes/security => vendor/ezyang}/htmlpurifier/library/HTMLPurifier.path.php (100%) rename {classes/security => vendor/ezyang}/htmlpurifier/library/HTMLPurifier.php (100%) rename {classes/security => vendor/ezyang}/htmlpurifier/library/HTMLPurifier.safe-includes.php (100%) rename {classes/security => vendor/ezyang}/htmlpurifier/library/HTMLPurifier/Arborize.php (100%) rename {classes/security => vendor/ezyang}/htmlpurifier/library/HTMLPurifier/AttrCollections.php (100%) rename {classes/security => vendor/ezyang}/htmlpurifier/library/HTMLPurifier/AttrDef.php (100%) rename {classes/security => vendor/ezyang}/htmlpurifier/library/HTMLPurifier/AttrDef/CSS.php (100%) rename {classes/security => vendor/ezyang}/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/AlphaValue.php (100%) rename {classes/security => vendor/ezyang}/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/Background.php (100%) rename {classes/security => vendor/ezyang}/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/BackgroundPosition.php (100%) rename {classes/security => vendor/ezyang}/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/Border.php (100%) rename {classes/security => vendor/ezyang}/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/Color.php (100%) rename {classes/security => vendor/ezyang}/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/Composite.php (100%) rename {classes/security => vendor/ezyang}/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/DenyElementDecorator.php (100%) rename {classes/security => vendor/ezyang}/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/Filter.php (100%) rename {classes/security => vendor/ezyang}/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/Font.php (100%) rename {classes/security => vendor/ezyang}/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/FontFamily.php (100%) rename {classes/security => vendor/ezyang}/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/Ident.php (100%) rename {classes/security => vendor/ezyang}/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/ImportantDecorator.php (100%) rename {classes/security => vendor/ezyang}/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/Length.php (100%) rename {classes/security => vendor/ezyang}/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/ListStyle.php (100%) rename {classes/security => vendor/ezyang}/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/Multiple.php (100%) rename {classes/security => vendor/ezyang}/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/Number.php (100%) rename {classes/security => vendor/ezyang}/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/Percentage.php (100%) rename {classes/security => vendor/ezyang}/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/TextDecoration.php (100%) rename {classes/security => vendor/ezyang}/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/URI.php (100%) rename {classes/security => vendor/ezyang}/htmlpurifier/library/HTMLPurifier/AttrDef/Clone.php (100%) rename {classes/security => vendor/ezyang}/htmlpurifier/library/HTMLPurifier/AttrDef/Enum.php (100%) rename {classes/security => vendor/ezyang}/htmlpurifier/library/HTMLPurifier/AttrDef/HTML/Bool.php (100%) rename {classes/security => vendor/ezyang}/htmlpurifier/library/HTMLPurifier/AttrDef/HTML/Class.php (100%) rename {classes/security => vendor/ezyang}/htmlpurifier/library/HTMLPurifier/AttrDef/HTML/Color.php (100%) rename {classes/security => vendor/ezyang}/htmlpurifier/library/HTMLPurifier/AttrDef/HTML/FrameTarget.php (100%) rename {classes/security => vendor/ezyang}/htmlpurifier/library/HTMLPurifier/AttrDef/HTML/ID.php (100%) rename {classes/security => vendor/ezyang}/htmlpurifier/library/HTMLPurifier/AttrDef/HTML/Length.php (100%) rename {classes/security => vendor/ezyang}/htmlpurifier/library/HTMLPurifier/AttrDef/HTML/LinkTypes.php (100%) rename {classes/security => vendor/ezyang}/htmlpurifier/library/HTMLPurifier/AttrDef/HTML/MultiLength.php (100%) rename {classes/security => vendor/ezyang}/htmlpurifier/library/HTMLPurifier/AttrDef/HTML/Nmtokens.php (100%) rename {classes/security => vendor/ezyang}/htmlpurifier/library/HTMLPurifier/AttrDef/HTML/Pixels.php (100%) rename {classes/security => vendor/ezyang}/htmlpurifier/library/HTMLPurifier/AttrDef/Integer.php (100%) rename {classes/security => vendor/ezyang}/htmlpurifier/library/HTMLPurifier/AttrDef/Lang.php (100%) rename {classes/security => vendor/ezyang}/htmlpurifier/library/HTMLPurifier/AttrDef/Switch.php (100%) rename {classes/security => vendor/ezyang}/htmlpurifier/library/HTMLPurifier/AttrDef/Text.php (100%) rename {classes/security => vendor/ezyang}/htmlpurifier/library/HTMLPurifier/AttrDef/URI.php (100%) rename {classes/security => vendor/ezyang}/htmlpurifier/library/HTMLPurifier/AttrDef/URI/Email.php (100%) rename {classes/security => vendor/ezyang}/htmlpurifier/library/HTMLPurifier/AttrDef/URI/Email/SimpleCheck.php (100%) rename {classes/security => vendor/ezyang}/htmlpurifier/library/HTMLPurifier/AttrDef/URI/Host.php (100%) rename {classes/security => vendor/ezyang}/htmlpurifier/library/HTMLPurifier/AttrDef/URI/IPv4.php (100%) rename {classes/security => vendor/ezyang}/htmlpurifier/library/HTMLPurifier/AttrDef/URI/IPv6.php (100%) rename {classes/security => vendor/ezyang}/htmlpurifier/library/HTMLPurifier/AttrTransform.php (100%) rename {classes/security => vendor/ezyang}/htmlpurifier/library/HTMLPurifier/AttrTransform/Background.php (100%) rename {classes/security => vendor/ezyang}/htmlpurifier/library/HTMLPurifier/AttrTransform/BdoDir.php (100%) rename {classes/security => vendor/ezyang}/htmlpurifier/library/HTMLPurifier/AttrTransform/BgColor.php (100%) rename {classes/security => vendor/ezyang}/htmlpurifier/library/HTMLPurifier/AttrTransform/BoolToCSS.php (100%) rename {classes/security => vendor/ezyang}/htmlpurifier/library/HTMLPurifier/AttrTransform/Border.php (100%) rename {classes/security => vendor/ezyang}/htmlpurifier/library/HTMLPurifier/AttrTransform/EnumToCSS.php (100%) rename {classes/security => vendor/ezyang}/htmlpurifier/library/HTMLPurifier/AttrTransform/ImgRequired.php (100%) rename {classes/security => vendor/ezyang}/htmlpurifier/library/HTMLPurifier/AttrTransform/ImgSpace.php (100%) rename {classes/security => vendor/ezyang}/htmlpurifier/library/HTMLPurifier/AttrTransform/Input.php (100%) rename {classes/security => vendor/ezyang}/htmlpurifier/library/HTMLPurifier/AttrTransform/Lang.php (100%) rename {classes/security => vendor/ezyang}/htmlpurifier/library/HTMLPurifier/AttrTransform/Length.php (100%) rename {classes/security => vendor/ezyang}/htmlpurifier/library/HTMLPurifier/AttrTransform/Name.php (100%) rename {classes/security => vendor/ezyang}/htmlpurifier/library/HTMLPurifier/AttrTransform/NameSync.php (100%) rename {classes/security => vendor/ezyang}/htmlpurifier/library/HTMLPurifier/AttrTransform/Nofollow.php (100%) rename {classes/security => vendor/ezyang}/htmlpurifier/library/HTMLPurifier/AttrTransform/SafeEmbed.php (100%) rename {classes/security => vendor/ezyang}/htmlpurifier/library/HTMLPurifier/AttrTransform/SafeObject.php (100%) rename {classes/security => vendor/ezyang}/htmlpurifier/library/HTMLPurifier/AttrTransform/SafeParam.php (100%) rename {classes/security => vendor/ezyang}/htmlpurifier/library/HTMLPurifier/AttrTransform/ScriptRequired.php (100%) rename {classes/security => vendor/ezyang}/htmlpurifier/library/HTMLPurifier/AttrTransform/TargetBlank.php (100%) rename {classes/security => vendor/ezyang}/htmlpurifier/library/HTMLPurifier/AttrTransform/Textarea.php (100%) rename {classes/security => vendor/ezyang}/htmlpurifier/library/HTMLPurifier/AttrTypes.php (100%) rename {classes/security => vendor/ezyang}/htmlpurifier/library/HTMLPurifier/AttrValidator.php (100%) rename {classes/security => vendor/ezyang}/htmlpurifier/library/HTMLPurifier/Bootstrap.php (100%) rename {classes/security => vendor/ezyang}/htmlpurifier/library/HTMLPurifier/CSSDefinition.php (100%) rename {classes/security => vendor/ezyang}/htmlpurifier/library/HTMLPurifier/ChildDef.php (100%) rename {classes/security => vendor/ezyang}/htmlpurifier/library/HTMLPurifier/ChildDef/Chameleon.php (100%) rename {classes/security => vendor/ezyang}/htmlpurifier/library/HTMLPurifier/ChildDef/Custom.php (100%) rename {classes/security => vendor/ezyang}/htmlpurifier/library/HTMLPurifier/ChildDef/Empty.php (100%) rename {classes/security => vendor/ezyang}/htmlpurifier/library/HTMLPurifier/ChildDef/List.php (100%) rename {classes/security => vendor/ezyang}/htmlpurifier/library/HTMLPurifier/ChildDef/Optional.php (100%) rename {classes/security => vendor/ezyang}/htmlpurifier/library/HTMLPurifier/ChildDef/Required.php (100%) rename {classes/security => vendor/ezyang}/htmlpurifier/library/HTMLPurifier/ChildDef/StrictBlockquote.php (100%) rename {classes/security => vendor/ezyang}/htmlpurifier/library/HTMLPurifier/ChildDef/Table.php (100%) rename {classes/security => vendor/ezyang}/htmlpurifier/library/HTMLPurifier/Config.php (100%) rename {classes/security => vendor/ezyang}/htmlpurifier/library/HTMLPurifier/ConfigSchema.php (100%) rename {classes/security => vendor/ezyang}/htmlpurifier/library/HTMLPurifier/ConfigSchema/Builder/ConfigSchema.php (100%) rename {classes/security => vendor/ezyang}/htmlpurifier/library/HTMLPurifier/ConfigSchema/Builder/Xml.php (100%) rename {classes/security => vendor/ezyang}/htmlpurifier/library/HTMLPurifier/ConfigSchema/Exception.php (100%) rename {classes/security => vendor/ezyang}/htmlpurifier/library/HTMLPurifier/ConfigSchema/Interchange.php (100%) rename {classes/security => vendor/ezyang}/htmlpurifier/library/HTMLPurifier/ConfigSchema/Interchange/Directive.php (100%) rename {classes/security => vendor/ezyang}/htmlpurifier/library/HTMLPurifier/ConfigSchema/Interchange/Id.php (100%) rename {classes/security => vendor/ezyang}/htmlpurifier/library/HTMLPurifier/ConfigSchema/InterchangeBuilder.php (100%) rename {classes/security => vendor/ezyang}/htmlpurifier/library/HTMLPurifier/ConfigSchema/Validator.php (100%) rename {classes/security => vendor/ezyang}/htmlpurifier/library/HTMLPurifier/ConfigSchema/ValidatorAtom.php (100%) rename {classes/security => vendor/ezyang}/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema.ser (100%) rename {classes/security => vendor/ezyang}/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Attr.AllowedClasses.txt (100%) rename {classes/security => vendor/ezyang}/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Attr.AllowedFrameTargets.txt (100%) rename {classes/security => vendor/ezyang}/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Attr.AllowedRel.txt (100%) rename {classes/security => vendor/ezyang}/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Attr.AllowedRev.txt (100%) rename {classes/security => vendor/ezyang}/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Attr.ClassUseCDATA.txt (100%) rename {classes/security => vendor/ezyang}/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Attr.DefaultImageAlt.txt (100%) rename {classes/security => vendor/ezyang}/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Attr.DefaultInvalidImage.txt (100%) rename {classes/security => vendor/ezyang}/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Attr.DefaultInvalidImageAlt.txt (100%) rename {classes/security => vendor/ezyang}/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Attr.DefaultTextDir.txt (100%) rename {classes/security => vendor/ezyang}/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Attr.EnableID.txt (100%) rename {classes/security => vendor/ezyang}/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Attr.ForbiddenClasses.txt (100%) rename {classes/security => vendor/ezyang}/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Attr.IDBlacklist.txt (100%) rename {classes/security => vendor/ezyang}/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Attr.IDBlacklistRegexp.txt (100%) rename {classes/security => vendor/ezyang}/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Attr.IDPrefix.txt (100%) rename {classes/security => vendor/ezyang}/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Attr.IDPrefixLocal.txt (100%) rename {classes/security => vendor/ezyang}/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/AutoFormat.AutoParagraph.txt (100%) rename {classes/security => vendor/ezyang}/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/AutoFormat.Custom.txt (100%) rename {classes/security => vendor/ezyang}/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/AutoFormat.DisplayLinkURI.txt (100%) rename {classes/security => vendor/ezyang}/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/AutoFormat.Linkify.txt (100%) rename {classes/security => vendor/ezyang}/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/AutoFormat.PurifierLinkify.DocURL.txt (100%) rename {classes/security => vendor/ezyang}/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/AutoFormat.PurifierLinkify.txt (100%) rename {classes/security => vendor/ezyang}/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/AutoFormat.RemoveEmpty.Predicate.txt (100%) rename {classes/security => vendor/ezyang}/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/AutoFormat.RemoveEmpty.RemoveNbsp.Exceptions.txt (100%) rename {classes/security => vendor/ezyang}/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/AutoFormat.RemoveEmpty.RemoveNbsp.txt (100%) rename {classes/security => vendor/ezyang}/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/AutoFormat.RemoveEmpty.txt (100%) rename {classes/security => vendor/ezyang}/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/AutoFormat.RemoveSpansWithoutAttributes.txt (100%) rename {classes/security => vendor/ezyang}/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/CSS.AllowImportant.txt (100%) rename {classes/security => vendor/ezyang}/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/CSS.AllowTricky.txt (100%) rename {classes/security => vendor/ezyang}/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/CSS.AllowedFonts.txt (100%) rename {classes/security => vendor/ezyang}/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/CSS.AllowedProperties.txt (100%) rename {classes/security => vendor/ezyang}/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/CSS.DefinitionRev.txt (100%) rename {classes/security => vendor/ezyang}/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/CSS.ForbiddenProperties.txt (100%) rename {classes/security => vendor/ezyang}/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/CSS.MaxImgLength.txt (100%) rename {classes/security => vendor/ezyang}/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/CSS.Proprietary.txt (100%) rename {classes/security => vendor/ezyang}/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/CSS.Trusted.txt (100%) rename {classes/security => vendor/ezyang}/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Cache.DefinitionImpl.txt (100%) rename {classes/security => vendor/ezyang}/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Cache.SerializerPath.txt (100%) rename {classes/security => vendor/ezyang}/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Cache.SerializerPermissions.txt (100%) rename {classes/security => vendor/ezyang}/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Core.AggressivelyFixLt.txt (100%) rename {classes/security => vendor/ezyang}/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Core.AllowHostnameUnderscore.txt (100%) rename {classes/security => vendor/ezyang}/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Core.CollectErrors.txt (100%) rename {classes/security => vendor/ezyang}/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Core.ColorKeywords.txt (100%) rename {classes/security => vendor/ezyang}/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Core.ConvertDocumentToFragment.txt (100%) rename {classes/security => vendor/ezyang}/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Core.DirectLexLineNumberSyncInterval.txt (100%) rename {classes/security => vendor/ezyang}/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Core.DisableExcludes.txt (100%) rename {classes/security => vendor/ezyang}/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Core.EnableIDNA.txt (100%) rename {classes/security => vendor/ezyang}/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Core.Encoding.txt (100%) rename {classes/security => vendor/ezyang}/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Core.EscapeInvalidChildren.txt (100%) rename {classes/security => vendor/ezyang}/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Core.EscapeInvalidTags.txt (100%) rename {classes/security => vendor/ezyang}/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Core.EscapeNonASCIICharacters.txt (100%) rename {classes/security => vendor/ezyang}/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Core.HiddenElements.txt (100%) rename {classes/security => vendor/ezyang}/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Core.Language.txt (100%) rename {classes/security => vendor/ezyang}/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Core.LexerImpl.txt (100%) rename {classes/security => vendor/ezyang}/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Core.MaintainLineNumbers.txt (100%) rename {classes/security => vendor/ezyang}/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Core.NormalizeNewlines.txt (100%) rename {classes/security => vendor/ezyang}/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Core.RemoveInvalidImg.txt (100%) rename {classes/security => vendor/ezyang}/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Core.RemoveProcessingInstructions.txt (100%) rename {classes/security => vendor/ezyang}/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Core.RemoveScriptContents.txt (100%) rename {classes/security => vendor/ezyang}/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Filter.Custom.txt (100%) rename {classes/security => vendor/ezyang}/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Filter.ExtractStyleBlocks.Escaping.txt (100%) rename {classes/security => vendor/ezyang}/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Filter.ExtractStyleBlocks.Scope.txt (100%) rename {classes/security => vendor/ezyang}/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Filter.ExtractStyleBlocks.TidyImpl.txt (100%) rename {classes/security => vendor/ezyang}/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Filter.ExtractStyleBlocks.txt (100%) rename {classes/security => vendor/ezyang}/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Filter.YouTube.txt (100%) rename {classes/security => vendor/ezyang}/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/HTML.Allowed.txt (100%) rename {classes/security => vendor/ezyang}/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/HTML.AllowedAttributes.txt (100%) rename {classes/security => vendor/ezyang}/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/HTML.AllowedComments.txt (100%) rename {classes/security => vendor/ezyang}/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/HTML.AllowedCommentsRegexp.txt (100%) rename {classes/security => vendor/ezyang}/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/HTML.AllowedElements.txt (100%) rename {classes/security => vendor/ezyang}/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/HTML.AllowedModules.txt (100%) rename {classes/security => vendor/ezyang}/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/HTML.Attr.Name.UseCDATA.txt (100%) rename {classes/security => vendor/ezyang}/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/HTML.BlockWrapper.txt (100%) rename {classes/security => vendor/ezyang}/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/HTML.CoreModules.txt (100%) rename {classes/security => vendor/ezyang}/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/HTML.CustomDoctype.txt (100%) rename {classes/security => vendor/ezyang}/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/HTML.DefinitionID.txt (100%) rename {classes/security => vendor/ezyang}/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/HTML.DefinitionRev.txt (100%) rename {classes/security => vendor/ezyang}/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/HTML.Doctype.txt (100%) rename {classes/security => vendor/ezyang}/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/HTML.FlashAllowFullScreen.txt (100%) rename {classes/security => vendor/ezyang}/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/HTML.ForbiddenAttributes.txt (100%) rename {classes/security => vendor/ezyang}/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/HTML.ForbiddenElements.txt (100%) rename {classes/security => vendor/ezyang}/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/HTML.MaxImgLength.txt (100%) rename {classes/security => vendor/ezyang}/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/HTML.Nofollow.txt (100%) rename {classes/security => vendor/ezyang}/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/HTML.Parent.txt (100%) rename {classes/security => vendor/ezyang}/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/HTML.Proprietary.txt (100%) rename {classes/security => vendor/ezyang}/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/HTML.SafeEmbed.txt (100%) rename {classes/security => vendor/ezyang}/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/HTML.SafeIframe.txt (100%) rename {classes/security => vendor/ezyang}/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/HTML.SafeObject.txt (100%) rename {classes/security => vendor/ezyang}/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/HTML.SafeScripting.txt (100%) rename {classes/security => vendor/ezyang}/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/HTML.Strict.txt (100%) rename {classes/security => vendor/ezyang}/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/HTML.TargetBlank.txt (100%) rename {classes/security => vendor/ezyang}/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/HTML.TidyAdd.txt (100%) rename {classes/security => vendor/ezyang}/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/HTML.TidyLevel.txt (100%) rename {classes/security => vendor/ezyang}/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/HTML.TidyRemove.txt (100%) rename {classes/security => vendor/ezyang}/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/HTML.Trusted.txt (100%) rename {classes/security => vendor/ezyang}/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/HTML.XHTML.txt (100%) rename {classes/security => vendor/ezyang}/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Output.CommentScriptContents.txt (100%) rename {classes/security => vendor/ezyang}/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Output.FixInnerHTML.txt (100%) rename {classes/security => vendor/ezyang}/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Output.FlashCompat.txt (100%) rename {classes/security => vendor/ezyang}/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Output.Newline.txt (100%) rename {classes/security => vendor/ezyang}/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Output.SortAttr.txt (100%) rename {classes/security => vendor/ezyang}/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Output.TidyFormat.txt (100%) rename {classes/security => vendor/ezyang}/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Test.ForceNoIconv.txt (100%) rename {classes/security => vendor/ezyang}/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/URI.AllowedSchemes.txt (100%) rename {classes/security => vendor/ezyang}/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/URI.Base.txt (100%) rename {classes/security => vendor/ezyang}/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/URI.DefaultScheme.txt (100%) rename {classes/security => vendor/ezyang}/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/URI.DefinitionID.txt (100%) rename {classes/security => vendor/ezyang}/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/URI.DefinitionRev.txt (100%) rename {classes/security => vendor/ezyang}/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/URI.Disable.txt (100%) rename {classes/security => vendor/ezyang}/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/URI.DisableExternal.txt (100%) rename {classes/security => vendor/ezyang}/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/URI.DisableExternalResources.txt (100%) rename {classes/security => vendor/ezyang}/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/URI.DisableResources.txt (100%) rename {classes/security => vendor/ezyang}/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/URI.Host.txt (100%) rename {classes/security => vendor/ezyang}/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/URI.HostBlacklist.txt (100%) rename {classes/security => vendor/ezyang}/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/URI.MakeAbsolute.txt (100%) rename {classes/security => vendor/ezyang}/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/URI.Munge.txt (100%) rename {classes/security => vendor/ezyang}/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/URI.MungeResources.txt (100%) rename {classes/security => vendor/ezyang}/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/URI.MungeSecretKey.txt (100%) rename {classes/security => vendor/ezyang}/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/URI.OverrideAllowedSchemes.txt (100%) rename {classes/security => vendor/ezyang}/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/URI.SafeIframeRegexp.txt (100%) rename {classes/security => vendor/ezyang}/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/info.ini (100%) rename {classes/security => vendor/ezyang}/htmlpurifier/library/HTMLPurifier/ContentSets.php (100%) rename {classes/security => vendor/ezyang}/htmlpurifier/library/HTMLPurifier/Context.php (100%) rename {classes/security => vendor/ezyang}/htmlpurifier/library/HTMLPurifier/Definition.php (100%) rename {classes/security => vendor/ezyang}/htmlpurifier/library/HTMLPurifier/DefinitionCache.php (100%) rename {classes/security => vendor/ezyang}/htmlpurifier/library/HTMLPurifier/DefinitionCache/Decorator.php (100%) rename {classes/security => vendor/ezyang}/htmlpurifier/library/HTMLPurifier/DefinitionCache/Decorator/Cleanup.php (100%) rename {classes/security => vendor/ezyang}/htmlpurifier/library/HTMLPurifier/DefinitionCache/Decorator/Memory.php (100%) rename {classes/security => vendor/ezyang}/htmlpurifier/library/HTMLPurifier/DefinitionCache/Decorator/Template.php.in (100%) rename {classes/security => vendor/ezyang}/htmlpurifier/library/HTMLPurifier/DefinitionCache/Null.php (100%) rename {classes/security => vendor/ezyang}/htmlpurifier/library/HTMLPurifier/DefinitionCache/Serializer.php (99%) rename {classes/security => vendor/ezyang}/htmlpurifier/library/HTMLPurifier/DefinitionCache/Serializer/README (100%) rename {classes/security => vendor/ezyang}/htmlpurifier/library/HTMLPurifier/DefinitionCacheFactory.php (100%) rename {classes/security => vendor/ezyang}/htmlpurifier/library/HTMLPurifier/Doctype.php (100%) rename {classes/security => vendor/ezyang}/htmlpurifier/library/HTMLPurifier/DoctypeRegistry.php (100%) rename {classes/security => vendor/ezyang}/htmlpurifier/library/HTMLPurifier/ElementDef.php (100%) rename {classes/security => vendor/ezyang}/htmlpurifier/library/HTMLPurifier/Encoder.php (100%) rename {classes/security => vendor/ezyang}/htmlpurifier/library/HTMLPurifier/EntityLookup.php (100%) rename {classes/security => vendor/ezyang}/htmlpurifier/library/HTMLPurifier/EntityLookup/entities.ser (100%) rename {classes/security => vendor/ezyang}/htmlpurifier/library/HTMLPurifier/EntityParser.php (100%) rename {classes/security => vendor/ezyang}/htmlpurifier/library/HTMLPurifier/ErrorCollector.php (100%) rename {classes/security => vendor/ezyang}/htmlpurifier/library/HTMLPurifier/ErrorStruct.php (100%) rename {classes/security => vendor/ezyang}/htmlpurifier/library/HTMLPurifier/Exception.php (100%) rename {classes/security => vendor/ezyang}/htmlpurifier/library/HTMLPurifier/Filter.php (100%) rename {classes/security => vendor/ezyang}/htmlpurifier/library/HTMLPurifier/Filter/ExtractStyleBlocks.php (100%) rename {classes/security => vendor/ezyang}/htmlpurifier/library/HTMLPurifier/Filter/YouTube.php (100%) rename {classes/security => vendor/ezyang}/htmlpurifier/library/HTMLPurifier/Generator.php (100%) rename {classes/security => vendor/ezyang}/htmlpurifier/library/HTMLPurifier/HTMLDefinition.php (100%) rename {classes/security => vendor/ezyang}/htmlpurifier/library/HTMLPurifier/HTMLModule.php (100%) rename {classes/security => vendor/ezyang}/htmlpurifier/library/HTMLPurifier/HTMLModule/Bdo.php (100%) rename {classes/security => vendor/ezyang}/htmlpurifier/library/HTMLPurifier/HTMLModule/CommonAttributes.php (100%) rename {classes/security => vendor/ezyang}/htmlpurifier/library/HTMLPurifier/HTMLModule/Edit.php (100%) rename {classes/security => vendor/ezyang}/htmlpurifier/library/HTMLPurifier/HTMLModule/Forms.php (100%) rename {classes/security => vendor/ezyang}/htmlpurifier/library/HTMLPurifier/HTMLModule/Hypertext.php (100%) rename {classes/security => vendor/ezyang}/htmlpurifier/library/HTMLPurifier/HTMLModule/Iframe.php (100%) rename {classes/security => vendor/ezyang}/htmlpurifier/library/HTMLPurifier/HTMLModule/Image.php (100%) rename {classes/security => vendor/ezyang}/htmlpurifier/library/HTMLPurifier/HTMLModule/Legacy.php (100%) rename {classes/security => vendor/ezyang}/htmlpurifier/library/HTMLPurifier/HTMLModule/List.php (100%) rename {classes/security => vendor/ezyang}/htmlpurifier/library/HTMLPurifier/HTMLModule/Name.php (100%) rename {classes/security => vendor/ezyang}/htmlpurifier/library/HTMLPurifier/HTMLModule/Nofollow.php (100%) rename {classes/security => vendor/ezyang}/htmlpurifier/library/HTMLPurifier/HTMLModule/NonXMLCommonAttributes.php (100%) rename {classes/security => vendor/ezyang}/htmlpurifier/library/HTMLPurifier/HTMLModule/Object.php (100%) rename {classes/security => vendor/ezyang}/htmlpurifier/library/HTMLPurifier/HTMLModule/Presentation.php (100%) rename {classes/security => vendor/ezyang}/htmlpurifier/library/HTMLPurifier/HTMLModule/Proprietary.php (100%) rename {classes/security => vendor/ezyang}/htmlpurifier/library/HTMLPurifier/HTMLModule/Ruby.php (100%) rename {classes/security => vendor/ezyang}/htmlpurifier/library/HTMLPurifier/HTMLModule/SafeEmbed.php (100%) rename {classes/security => vendor/ezyang}/htmlpurifier/library/HTMLPurifier/HTMLModule/SafeObject.php (100%) rename {classes/security => vendor/ezyang}/htmlpurifier/library/HTMLPurifier/HTMLModule/SafeScripting.php (100%) rename {classes/security => vendor/ezyang}/htmlpurifier/library/HTMLPurifier/HTMLModule/Scripting.php (100%) rename {classes/security => vendor/ezyang}/htmlpurifier/library/HTMLPurifier/HTMLModule/StyleAttribute.php (100%) rename {classes/security => vendor/ezyang}/htmlpurifier/library/HTMLPurifier/HTMLModule/Tables.php (100%) rename {classes/security => vendor/ezyang}/htmlpurifier/library/HTMLPurifier/HTMLModule/Target.php (100%) rename {classes/security => vendor/ezyang}/htmlpurifier/library/HTMLPurifier/HTMLModule/TargetBlank.php (100%) rename {classes/security => vendor/ezyang}/htmlpurifier/library/HTMLPurifier/HTMLModule/Text.php (100%) rename {classes/security => vendor/ezyang}/htmlpurifier/library/HTMLPurifier/HTMLModule/Tidy.php (100%) rename {classes/security => vendor/ezyang}/htmlpurifier/library/HTMLPurifier/HTMLModule/Tidy/Name.php (100%) rename {classes/security => vendor/ezyang}/htmlpurifier/library/HTMLPurifier/HTMLModule/Tidy/Proprietary.php (100%) rename {classes/security => vendor/ezyang}/htmlpurifier/library/HTMLPurifier/HTMLModule/Tidy/Strict.php (100%) rename {classes/security => vendor/ezyang}/htmlpurifier/library/HTMLPurifier/HTMLModule/Tidy/Transitional.php (100%) rename {classes/security => vendor/ezyang}/htmlpurifier/library/HTMLPurifier/HTMLModule/Tidy/XHTML.php (100%) rename {classes/security => vendor/ezyang}/htmlpurifier/library/HTMLPurifier/HTMLModule/Tidy/XHTMLAndHTML4.php (100%) rename {classes/security => vendor/ezyang}/htmlpurifier/library/HTMLPurifier/HTMLModule/XMLCommonAttributes.php (100%) rename {classes/security => vendor/ezyang}/htmlpurifier/library/HTMLPurifier/HTMLModuleManager.php (100%) rename {classes/security => vendor/ezyang}/htmlpurifier/library/HTMLPurifier/IDAccumulator.php (100%) rename {classes/security => vendor/ezyang}/htmlpurifier/library/HTMLPurifier/Injector.php (100%) rename {classes/security => vendor/ezyang}/htmlpurifier/library/HTMLPurifier/Injector/AutoParagraph.php (100%) rename {classes/security => vendor/ezyang}/htmlpurifier/library/HTMLPurifier/Injector/DisplayLinkURI.php (100%) rename {classes/security => vendor/ezyang}/htmlpurifier/library/HTMLPurifier/Injector/Linkify.php (100%) rename {classes/security => vendor/ezyang}/htmlpurifier/library/HTMLPurifier/Injector/PurifierLinkify.php (100%) rename {classes/security => vendor/ezyang}/htmlpurifier/library/HTMLPurifier/Injector/RemoveEmpty.php (100%) rename {classes/security => vendor/ezyang}/htmlpurifier/library/HTMLPurifier/Injector/RemoveSpansWithoutAttributes.php (100%) rename {classes/security => vendor/ezyang}/htmlpurifier/library/HTMLPurifier/Injector/SafeObject.php (100%) rename {classes/security => vendor/ezyang}/htmlpurifier/library/HTMLPurifier/Language.php (100%) rename {classes/security => vendor/ezyang}/htmlpurifier/library/HTMLPurifier/Language/classes/en-x-test.php (100%) rename {classes/security => vendor/ezyang}/htmlpurifier/library/HTMLPurifier/Language/messages/en-x-test.php (100%) rename {classes/security => vendor/ezyang}/htmlpurifier/library/HTMLPurifier/Language/messages/en-x-testmini.php (100%) rename {classes/security => vendor/ezyang}/htmlpurifier/library/HTMLPurifier/Language/messages/en.php (100%) rename {classes/security => vendor/ezyang}/htmlpurifier/library/HTMLPurifier/LanguageFactory.php (100%) rename {classes/security => vendor/ezyang}/htmlpurifier/library/HTMLPurifier/Length.php (100%) rename {classes/security => vendor/ezyang}/htmlpurifier/library/HTMLPurifier/Lexer.php (100%) rename {classes/security => vendor/ezyang}/htmlpurifier/library/HTMLPurifier/Lexer/DOMLex.php (100%) rename {classes/security => vendor/ezyang}/htmlpurifier/library/HTMLPurifier/Lexer/DirectLex.php (100%) rename {classes/security => vendor/ezyang}/htmlpurifier/library/HTMLPurifier/Lexer/PH5P.php (100%) rename {classes/security => vendor/ezyang}/htmlpurifier/library/HTMLPurifier/Node.php (100%) rename {classes/security => vendor/ezyang}/htmlpurifier/library/HTMLPurifier/Node/Comment.php (100%) rename {classes/security => vendor/ezyang}/htmlpurifier/library/HTMLPurifier/Node/Element.php (100%) rename {classes/security => vendor/ezyang}/htmlpurifier/library/HTMLPurifier/Node/Text.php (100%) rename {classes/security => vendor/ezyang}/htmlpurifier/library/HTMLPurifier/PercentEncoder.php (100%) rename {classes/security => vendor/ezyang}/htmlpurifier/library/HTMLPurifier/Printer.php (100%) rename {classes/security => vendor/ezyang}/htmlpurifier/library/HTMLPurifier/Printer/CSSDefinition.php (100%) rename {classes/security => vendor/ezyang}/htmlpurifier/library/HTMLPurifier/Printer/ConfigForm.css (100%) rename {classes/security => vendor/ezyang}/htmlpurifier/library/HTMLPurifier/Printer/ConfigForm.js (100%) rename {classes/security => vendor/ezyang}/htmlpurifier/library/HTMLPurifier/Printer/ConfigForm.php (100%) rename {classes/security => vendor/ezyang}/htmlpurifier/library/HTMLPurifier/Printer/HTMLDefinition.php (100%) rename {classes/security => vendor/ezyang}/htmlpurifier/library/HTMLPurifier/PropertyList.php (100%) rename {classes/security => vendor/ezyang}/htmlpurifier/library/HTMLPurifier/PropertyListIterator.php (100%) rename {classes/security => vendor/ezyang}/htmlpurifier/library/HTMLPurifier/Queue.php (100%) rename {classes/security => vendor/ezyang}/htmlpurifier/library/HTMLPurifier/Strategy.php (100%) rename {classes/security => vendor/ezyang}/htmlpurifier/library/HTMLPurifier/Strategy/Composite.php (100%) rename {classes/security => vendor/ezyang}/htmlpurifier/library/HTMLPurifier/Strategy/Core.php (100%) rename {classes/security => vendor/ezyang}/htmlpurifier/library/HTMLPurifier/Strategy/FixNesting.php (100%) rename {classes/security => vendor/ezyang}/htmlpurifier/library/HTMLPurifier/Strategy/MakeWellFormed.php (100%) rename {classes/security => vendor/ezyang}/htmlpurifier/library/HTMLPurifier/Strategy/RemoveForeignElements.php (100%) rename {classes/security => vendor/ezyang}/htmlpurifier/library/HTMLPurifier/Strategy/ValidateAttributes.php (100%) rename {classes/security => vendor/ezyang}/htmlpurifier/library/HTMLPurifier/StringHash.php (100%) rename {classes/security => vendor/ezyang}/htmlpurifier/library/HTMLPurifier/StringHashParser.php (100%) rename {classes/security => vendor/ezyang}/htmlpurifier/library/HTMLPurifier/TagTransform.php (100%) rename {classes/security => vendor/ezyang}/htmlpurifier/library/HTMLPurifier/TagTransform/Font.php (100%) rename {classes/security => vendor/ezyang}/htmlpurifier/library/HTMLPurifier/TagTransform/Simple.php (100%) rename {classes/security => vendor/ezyang}/htmlpurifier/library/HTMLPurifier/Token.php (100%) rename {classes/security => vendor/ezyang}/htmlpurifier/library/HTMLPurifier/Token/Comment.php (100%) rename {classes/security => vendor/ezyang}/htmlpurifier/library/HTMLPurifier/Token/Empty.php (100%) rename {classes/security => vendor/ezyang}/htmlpurifier/library/HTMLPurifier/Token/End.php (100%) rename {classes/security => vendor/ezyang}/htmlpurifier/library/HTMLPurifier/Token/Start.php (100%) rename {classes/security => vendor/ezyang}/htmlpurifier/library/HTMLPurifier/Token/Tag.php (100%) rename {classes/security => vendor/ezyang}/htmlpurifier/library/HTMLPurifier/Token/Text.php (100%) rename {classes/security => vendor/ezyang}/htmlpurifier/library/HTMLPurifier/TokenFactory.php (100%) rename {classes/security => vendor/ezyang}/htmlpurifier/library/HTMLPurifier/URI.php (100%) rename {classes/security => vendor/ezyang}/htmlpurifier/library/HTMLPurifier/URIDefinition.php (100%) rename {classes/security => vendor/ezyang}/htmlpurifier/library/HTMLPurifier/URIFilter.php (100%) rename {classes/security => vendor/ezyang}/htmlpurifier/library/HTMLPurifier/URIFilter/DisableExternal.php (100%) rename {classes/security => vendor/ezyang}/htmlpurifier/library/HTMLPurifier/URIFilter/DisableExternalResources.php (100%) rename {classes/security => vendor/ezyang}/htmlpurifier/library/HTMLPurifier/URIFilter/DisableResources.php (100%) rename {classes/security => vendor/ezyang}/htmlpurifier/library/HTMLPurifier/URIFilter/HostBlacklist.php (100%) rename {classes/security => vendor/ezyang}/htmlpurifier/library/HTMLPurifier/URIFilter/MakeAbsolute.php (100%) rename {classes/security => vendor/ezyang}/htmlpurifier/library/HTMLPurifier/URIFilter/Munge.php (100%) rename {classes/security => vendor/ezyang}/htmlpurifier/library/HTMLPurifier/URIFilter/SafeIframe.php (100%) rename {classes/security => vendor/ezyang}/htmlpurifier/library/HTMLPurifier/URIParser.php (100%) rename {classes/security => vendor/ezyang}/htmlpurifier/library/HTMLPurifier/URIScheme.php (100%) rename {classes/security => vendor/ezyang}/htmlpurifier/library/HTMLPurifier/URIScheme/data.php (98%) rename {classes/security => vendor/ezyang}/htmlpurifier/library/HTMLPurifier/URIScheme/file.php (100%) rename {classes/security => vendor/ezyang}/htmlpurifier/library/HTMLPurifier/URIScheme/ftp.php (100%) rename {classes/security => vendor/ezyang}/htmlpurifier/library/HTMLPurifier/URIScheme/http.php (100%) rename {classes/security => vendor/ezyang}/htmlpurifier/library/HTMLPurifier/URIScheme/https.php (100%) rename {classes/security => vendor/ezyang}/htmlpurifier/library/HTMLPurifier/URIScheme/mailto.php (100%) rename {classes/security => vendor/ezyang}/htmlpurifier/library/HTMLPurifier/URIScheme/news.php (100%) rename {classes/security => vendor/ezyang}/htmlpurifier/library/HTMLPurifier/URIScheme/nntp.php (100%) rename {classes/security => vendor/ezyang}/htmlpurifier/library/HTMLPurifier/URISchemeRegistry.php (100%) rename {classes/security => vendor/ezyang}/htmlpurifier/library/HTMLPurifier/UnitConverter.php (100%) rename {classes/security => vendor/ezyang}/htmlpurifier/library/HTMLPurifier/VarParser.php (100%) rename {classes/security => vendor/ezyang}/htmlpurifier/library/HTMLPurifier/VarParser/Flexible.php (100%) rename {classes/security => vendor/ezyang}/htmlpurifier/library/HTMLPurifier/VarParser/Native.php (100%) rename {classes/security => vendor/ezyang}/htmlpurifier/library/HTMLPurifier/VarParserException.php (100%) rename {classes/security => vendor/ezyang}/htmlpurifier/library/HTMLPurifier/Zipper.php (100%) create mode 100644 vendor/ezyang/htmlpurifier/package.php create mode 100644 vendor/ezyang/htmlpurifier/phpdoc.ini create mode 100644 vendor/ezyang/htmlpurifier/plugins/modx.txt create mode 100644 vendor/ezyang/htmlpurifier/plugins/phorum/.gitignore create mode 100644 vendor/ezyang/htmlpurifier/plugins/phorum/Changelog create mode 100644 vendor/ezyang/htmlpurifier/plugins/phorum/INSTALL create mode 100644 vendor/ezyang/htmlpurifier/plugins/phorum/README create mode 100644 vendor/ezyang/htmlpurifier/plugins/phorum/config.default.php create mode 100644 vendor/ezyang/htmlpurifier/plugins/phorum/htmlpurifier.php create mode 100644 vendor/ezyang/htmlpurifier/plugins/phorum/info.txt create mode 100644 vendor/ezyang/htmlpurifier/plugins/phorum/init-config.php create mode 100644 vendor/ezyang/htmlpurifier/plugins/phorum/migrate.bbcode.php create mode 100644 vendor/ezyang/htmlpurifier/plugins/phorum/settings.php create mode 100644 vendor/ezyang/htmlpurifier/plugins/phorum/settings/form.php create mode 100644 vendor/ezyang/htmlpurifier/plugins/phorum/settings/migrate-sigs-form.php create mode 100644 vendor/ezyang/htmlpurifier/plugins/phorum/settings/migrate-sigs.php create mode 100644 vendor/ezyang/htmlpurifier/plugins/phorum/settings/save.php create mode 100644 vendor/ezyang/htmlpurifier/release1-update.php create mode 100644 vendor/ezyang/htmlpurifier/release2-tag.php create mode 100644 vendor/ezyang/htmlpurifier/test-settings.sample.php create mode 100644 vendor/matthiasmullie/minify/.coveralls.yml create mode 100644 vendor/matthiasmullie/minify/LICENSE create mode 100755 vendor/matthiasmullie/minify/bin/minifycss create mode 100755 vendor/matthiasmullie/minify/bin/minifyjs create mode 100644 vendor/matthiasmullie/minify/composer.json create mode 100644 vendor/matthiasmullie/minify/data/js/keywords_after.txt create mode 100644 vendor/matthiasmullie/minify/data/js/keywords_before.txt create mode 100644 vendor/matthiasmullie/minify/data/js/keywords_reserved.txt create mode 100644 vendor/matthiasmullie/minify/data/js/operators_after.txt create mode 100644 vendor/matthiasmullie/minify/data/js/operators_before.txt create mode 100644 vendor/matthiasmullie/minify/src/CSS.php create mode 100644 vendor/matthiasmullie/minify/src/Exception.php create mode 100644 vendor/matthiasmullie/minify/src/JS.php create mode 100644 vendor/matthiasmullie/minify/src/Minify.php create mode 100644 vendor/matthiasmullie/path-converter/.coveralls.yml create mode 100644 vendor/matthiasmullie/path-converter/LICENSE create mode 100644 vendor/matthiasmullie/path-converter/composer.json create mode 100644 vendor/matthiasmullie/path-converter/src/Converter.php create mode 100644 vendor/michelf/php-markdown/License.md create mode 100644 vendor/michelf/php-markdown/Michelf/Markdown.inc.php create mode 100644 vendor/michelf/php-markdown/Michelf/Markdown.php create mode 100644 vendor/michelf/php-markdown/Michelf/MarkdownExtra.inc.php create mode 100644 vendor/michelf/php-markdown/Michelf/MarkdownExtra.php create mode 100644 vendor/michelf/php-markdown/Michelf/MarkdownInterface.inc.php create mode 100644 vendor/michelf/php-markdown/Michelf/MarkdownInterface.php create mode 100644 vendor/michelf/php-markdown/Readme.md create mode 100644 vendor/michelf/php-markdown/Readme.php create mode 100644 vendor/michelf/php-markdown/composer.json create mode 100755 vendor/rmccue/requests/.coveralls.yml create mode 100755 vendor/rmccue/requests/.travis.yml create mode 100755 vendor/rmccue/requests/CHANGELOG.md create mode 100755 vendor/rmccue/requests/LICENSE create mode 100755 vendor/rmccue/requests/README.md create mode 100755 vendor/rmccue/requests/bin/create_pear_package.php create mode 100644 vendor/rmccue/requests/composer.json create mode 100755 vendor/rmccue/requests/docs/README.md create mode 100755 vendor/rmccue/requests/docs/authentication-custom.md create mode 100755 vendor/rmccue/requests/docs/authentication.md create mode 100755 vendor/rmccue/requests/docs/goals.md create mode 100755 vendor/rmccue/requests/docs/hooks.md create mode 100644 vendor/rmccue/requests/docs/proxy.md create mode 100755 vendor/rmccue/requests/docs/usage-advanced.md create mode 100755 vendor/rmccue/requests/docs/usage.md create mode 100755 vendor/rmccue/requests/docs/why-requests.md create mode 100755 vendor/rmccue/requests/examples/basic-auth.php create mode 100755 vendor/rmccue/requests/examples/get.php create mode 100755 vendor/rmccue/requests/examples/multiple.php create mode 100755 vendor/rmccue/requests/examples/post.php create mode 100644 vendor/rmccue/requests/examples/proxy.php create mode 100755 vendor/rmccue/requests/examples/session.php create mode 100755 vendor/rmccue/requests/library/Requests.php create mode 100755 vendor/rmccue/requests/library/Requests/Auth.php create mode 100755 vendor/rmccue/requests/library/Requests/Auth/Basic.php create mode 100644 vendor/rmccue/requests/library/Requests/Cookie.php create mode 100644 vendor/rmccue/requests/library/Requests/Cookie/Jar.php create mode 100755 vendor/rmccue/requests/library/Requests/Exception.php create mode 100755 vendor/rmccue/requests/library/Requests/Exception/HTTP.php create mode 100755 vendor/rmccue/requests/library/Requests/Exception/HTTP/400.php create mode 100755 vendor/rmccue/requests/library/Requests/Exception/HTTP/401.php create mode 100755 vendor/rmccue/requests/library/Requests/Exception/HTTP/402.php create mode 100755 vendor/rmccue/requests/library/Requests/Exception/HTTP/403.php create mode 100755 vendor/rmccue/requests/library/Requests/Exception/HTTP/404.php create mode 100755 vendor/rmccue/requests/library/Requests/Exception/HTTP/405.php create mode 100755 vendor/rmccue/requests/library/Requests/Exception/HTTP/406.php create mode 100755 vendor/rmccue/requests/library/Requests/Exception/HTTP/407.php create mode 100755 vendor/rmccue/requests/library/Requests/Exception/HTTP/408.php create mode 100755 vendor/rmccue/requests/library/Requests/Exception/HTTP/409.php create mode 100755 vendor/rmccue/requests/library/Requests/Exception/HTTP/410.php create mode 100755 vendor/rmccue/requests/library/Requests/Exception/HTTP/411.php create mode 100755 vendor/rmccue/requests/library/Requests/Exception/HTTP/412.php create mode 100755 vendor/rmccue/requests/library/Requests/Exception/HTTP/413.php create mode 100755 vendor/rmccue/requests/library/Requests/Exception/HTTP/414.php create mode 100755 vendor/rmccue/requests/library/Requests/Exception/HTTP/415.php create mode 100755 vendor/rmccue/requests/library/Requests/Exception/HTTP/416.php create mode 100755 vendor/rmccue/requests/library/Requests/Exception/HTTP/417.php create mode 100755 vendor/rmccue/requests/library/Requests/Exception/HTTP/418.php create mode 100755 vendor/rmccue/requests/library/Requests/Exception/HTTP/428.php create mode 100755 vendor/rmccue/requests/library/Requests/Exception/HTTP/429.php create mode 100755 vendor/rmccue/requests/library/Requests/Exception/HTTP/431.php create mode 100755 vendor/rmccue/requests/library/Requests/Exception/HTTP/500.php create mode 100755 vendor/rmccue/requests/library/Requests/Exception/HTTP/501.php create mode 100755 vendor/rmccue/requests/library/Requests/Exception/HTTP/502.php create mode 100755 vendor/rmccue/requests/library/Requests/Exception/HTTP/503.php create mode 100755 vendor/rmccue/requests/library/Requests/Exception/HTTP/504.php create mode 100755 vendor/rmccue/requests/library/Requests/Exception/HTTP/505.php create mode 100755 vendor/rmccue/requests/library/Requests/Exception/HTTP/511.php create mode 100755 vendor/rmccue/requests/library/Requests/Exception/HTTP/Unknown.php create mode 100755 vendor/rmccue/requests/library/Requests/Hooker.php create mode 100755 vendor/rmccue/requests/library/Requests/Hooks.php create mode 100755 vendor/rmccue/requests/library/Requests/IDNAEncoder.php create mode 100755 vendor/rmccue/requests/library/Requests/IPv6.php create mode 100755 vendor/rmccue/requests/library/Requests/IRI.php create mode 100644 vendor/rmccue/requests/library/Requests/Proxy.php create mode 100644 vendor/rmccue/requests/library/Requests/Proxy/HTTP.php create mode 100755 vendor/rmccue/requests/library/Requests/Response.php create mode 100755 vendor/rmccue/requests/library/Requests/Response/Headers.php create mode 100755 vendor/rmccue/requests/library/Requests/SSL.php create mode 100755 vendor/rmccue/requests/library/Requests/Session.php create mode 100755 vendor/rmccue/requests/library/Requests/Transport.php create mode 100755 vendor/rmccue/requests/library/Requests/Transport/cURL.php create mode 100755 vendor/rmccue/requests/library/Requests/Transport/cacert.pem create mode 100755 vendor/rmccue/requests/library/Requests/Transport/fsockopen.php create mode 100644 vendor/rmccue/requests/library/Requests/Utility/CaseInsensitiveDictionary.php create mode 100644 vendor/rmccue/requests/library/Requests/Utility/FilteredIterator.php create mode 100755 vendor/rmccue/requests/package.xml.tpl create mode 100755 vendor/rmccue/requests/tests/Auth/Basic.php create mode 100755 vendor/rmccue/requests/tests/ChunkedEncoding.php create mode 100755 vendor/rmccue/requests/tests/Cookies.php create mode 100644 vendor/rmccue/requests/tests/Encoding.php create mode 100755 vendor/rmccue/requests/tests/IDNAEncoder.php create mode 100755 vendor/rmccue/requests/tests/IRI.php create mode 100755 vendor/rmccue/requests/tests/Requests.php create mode 100755 vendor/rmccue/requests/tests/Response/Headers.php create mode 100755 vendor/rmccue/requests/tests/SSL.php create mode 100755 vendor/rmccue/requests/tests/Session.php create mode 100755 vendor/rmccue/requests/tests/Transport/Base.php create mode 100755 vendor/rmccue/requests/tests/Transport/cURL.php create mode 100755 vendor/rmccue/requests/tests/Transport/fsockopen.php create mode 100755 vendor/rmccue/requests/tests/bootstrap.php create mode 100755 vendor/rmccue/requests/tests/phpunit.xml.dist create mode 100644 vendor/sunra/php-simple-html-dom-parser/README.md create mode 100644 vendor/sunra/php-simple-html-dom-parser/Src/Sunra/PhpSimple/HtmlDomParser.php create mode 100644 vendor/sunra/php-simple-html-dom-parser/Src/Sunra/PhpSimple/simplehtmldom_1_5/app/.svn/all-wcprops create mode 100644 vendor/sunra/php-simple-html-dom-parser/Src/Sunra/PhpSimple/simplehtmldom_1_5/app/.svn/entries create mode 100644 vendor/sunra/php-simple-html-dom-parser/Src/Sunra/PhpSimple/simplehtmldom_1_5/app/.svn/text-base/google.htm.svn-base create mode 100644 vendor/sunra/php-simple-html-dom-parser/Src/Sunra/PhpSimple/simplehtmldom_1_5/app/.svn/text-base/index.php.svn-base create mode 100644 vendor/sunra/php-simple-html-dom-parser/Src/Sunra/PhpSimple/simplehtmldom_1_5/app/google.htm create mode 100644 vendor/sunra/php-simple-html-dom-parser/Src/Sunra/PhpSimple/simplehtmldom_1_5/app/index.php create mode 100644 vendor/sunra/php-simple-html-dom-parser/Src/Sunra/PhpSimple/simplehtmldom_1_5/app/js/.svn/all-wcprops create mode 100644 vendor/sunra/php-simple-html-dom-parser/Src/Sunra/PhpSimple/simplehtmldom_1_5/app/js/.svn/entries create mode 100644 vendor/sunra/php-simple-html-dom-parser/Src/Sunra/PhpSimple/simplehtmldom_1_5/app/js/.svn/text-base/jquery.js.svn-base create mode 100644 vendor/sunra/php-simple-html-dom-parser/Src/Sunra/PhpSimple/simplehtmldom_1_5/app/js/.svn/text-base/jquery.treeview.css.svn-base create mode 100644 vendor/sunra/php-simple-html-dom-parser/Src/Sunra/PhpSimple/simplehtmldom_1_5/app/js/.svn/text-base/jquery.treeview.js.svn-base create mode 100644 vendor/sunra/php-simple-html-dom-parser/Src/Sunra/PhpSimple/simplehtmldom_1_5/app/js/.svn/text-base/screen.css.svn-base create mode 100644 vendor/sunra/php-simple-html-dom-parser/Src/Sunra/PhpSimple/simplehtmldom_1_5/app/js/images/.svn/all-wcprops create mode 100644 vendor/sunra/php-simple-html-dom-parser/Src/Sunra/PhpSimple/simplehtmldom_1_5/app/js/images/.svn/entries create mode 100644 vendor/sunra/php-simple-html-dom-parser/Src/Sunra/PhpSimple/simplehtmldom_1_5/app/js/images/.svn/prop-base/treeview-default-line.gif.svn-base create mode 100644 vendor/sunra/php-simple-html-dom-parser/Src/Sunra/PhpSimple/simplehtmldom_1_5/app/js/images/.svn/prop-base/treeview-default.gif.svn-base create mode 100644 vendor/sunra/php-simple-html-dom-parser/Src/Sunra/PhpSimple/simplehtmldom_1_5/app/js/images/.svn/text-base/treeview-default-line.gif.svn-base create mode 100644 vendor/sunra/php-simple-html-dom-parser/Src/Sunra/PhpSimple/simplehtmldom_1_5/app/js/images/.svn/text-base/treeview-default.gif.svn-base create mode 100644 vendor/sunra/php-simple-html-dom-parser/Src/Sunra/PhpSimple/simplehtmldom_1_5/app/js/images/treeview-default-line.gif create mode 100644 vendor/sunra/php-simple-html-dom-parser/Src/Sunra/PhpSimple/simplehtmldom_1_5/app/js/images/treeview-default.gif create mode 100644 vendor/sunra/php-simple-html-dom-parser/Src/Sunra/PhpSimple/simplehtmldom_1_5/app/js/jquery.js create mode 100644 vendor/sunra/php-simple-html-dom-parser/Src/Sunra/PhpSimple/simplehtmldom_1_5/app/js/jquery.treeview.css create mode 100644 vendor/sunra/php-simple-html-dom-parser/Src/Sunra/PhpSimple/simplehtmldom_1_5/app/js/jquery.treeview.js create mode 100644 vendor/sunra/php-simple-html-dom-parser/Src/Sunra/PhpSimple/simplehtmldom_1_5/app/js/screen.css create mode 100644 vendor/sunra/php-simple-html-dom-parser/Src/Sunra/PhpSimple/simplehtmldom_1_5/change_log.txt create mode 100644 vendor/sunra/php-simple-html-dom-parser/Src/Sunra/PhpSimple/simplehtmldom_1_5/example/.svn/all-wcprops create mode 100644 vendor/sunra/php-simple-html-dom-parser/Src/Sunra/PhpSimple/simplehtmldom_1_5/example/.svn/entries create mode 100644 vendor/sunra/php-simple-html-dom-parser/Src/Sunra/PhpSimple/simplehtmldom_1_5/example/.svn/prop-base/example_callback.php.svn-base create mode 100644 vendor/sunra/php-simple-html-dom-parser/Src/Sunra/PhpSimple/simplehtmldom_1_5/example/.svn/prop-base/example_extract_html.php.svn-base create mode 100644 vendor/sunra/php-simple-html-dom-parser/Src/Sunra/PhpSimple/simplehtmldom_1_5/example/.svn/text-base/example_advanced_selector.php.svn-base create mode 100644 vendor/sunra/php-simple-html-dom-parser/Src/Sunra/PhpSimple/simplehtmldom_1_5/example/.svn/text-base/example_basic_selector.php.svn-base create mode 100644 vendor/sunra/php-simple-html-dom-parser/Src/Sunra/PhpSimple/simplehtmldom_1_5/example/.svn/text-base/example_callback.php.svn-base create mode 100644 vendor/sunra/php-simple-html-dom-parser/Src/Sunra/PhpSimple/simplehtmldom_1_5/example/.svn/text-base/example_extract_html.php.svn-base create mode 100644 vendor/sunra/php-simple-html-dom-parser/Src/Sunra/PhpSimple/simplehtmldom_1_5/example/.svn/text-base/example_modify_contents.php.svn-base create mode 100644 vendor/sunra/php-simple-html-dom-parser/Src/Sunra/PhpSimple/simplehtmldom_1_5/example/.svn/text-base/simple_html_dom_utility.php.svn-base create mode 100644 vendor/sunra/php-simple-html-dom-parser/Src/Sunra/PhpSimple/simplehtmldom_1_5/example/example_advanced_selector.php create mode 100644 vendor/sunra/php-simple-html-dom-parser/Src/Sunra/PhpSimple/simplehtmldom_1_5/example/example_basic_selector.php create mode 100644 vendor/sunra/php-simple-html-dom-parser/Src/Sunra/PhpSimple/simplehtmldom_1_5/example/example_callback.php create mode 100644 vendor/sunra/php-simple-html-dom-parser/Src/Sunra/PhpSimple/simplehtmldom_1_5/example/example_extract_html.php create mode 100644 vendor/sunra/php-simple-html-dom-parser/Src/Sunra/PhpSimple/simplehtmldom_1_5/example/example_modify_contents.php create mode 100644 vendor/sunra/php-simple-html-dom-parser/Src/Sunra/PhpSimple/simplehtmldom_1_5/example/scraping/.svn/all-wcprops create mode 100644 vendor/sunra/php-simple-html-dom-parser/Src/Sunra/PhpSimple/simplehtmldom_1_5/example/scraping/.svn/entries create mode 100644 vendor/sunra/php-simple-html-dom-parser/Src/Sunra/PhpSimple/simplehtmldom_1_5/example/scraping/.svn/prop-base/example_scraping_digg.php.svn-base create mode 100644 vendor/sunra/php-simple-html-dom-parser/Src/Sunra/PhpSimple/simplehtmldom_1_5/example/scraping/.svn/prop-base/example_scraping_imdb.php.svn-base create mode 100644 vendor/sunra/php-simple-html-dom-parser/Src/Sunra/PhpSimple/simplehtmldom_1_5/example/scraping/.svn/prop-base/example_scraping_slashdot.php.svn-base create mode 100644 vendor/sunra/php-simple-html-dom-parser/Src/Sunra/PhpSimple/simplehtmldom_1_5/example/scraping/.svn/text-base/example_scraping_digg.php.svn-base create mode 100644 vendor/sunra/php-simple-html-dom-parser/Src/Sunra/PhpSimple/simplehtmldom_1_5/example/scraping/.svn/text-base/example_scraping_imdb.php.svn-base create mode 100644 vendor/sunra/php-simple-html-dom-parser/Src/Sunra/PhpSimple/simplehtmldom_1_5/example/scraping/.svn/text-base/example_scraping_slashdot.php.svn-base create mode 100644 vendor/sunra/php-simple-html-dom-parser/Src/Sunra/PhpSimple/simplehtmldom_1_5/example/scraping/example_scraping_digg.php create mode 100644 vendor/sunra/php-simple-html-dom-parser/Src/Sunra/PhpSimple/simplehtmldom_1_5/example/scraping/example_scraping_imdb.php create mode 100644 vendor/sunra/php-simple-html-dom-parser/Src/Sunra/PhpSimple/simplehtmldom_1_5/example/scraping/example_scraping_slashdot.php create mode 100644 vendor/sunra/php-simple-html-dom-parser/Src/Sunra/PhpSimple/simplehtmldom_1_5/example/simple_html_dom_utility.php create mode 100644 vendor/sunra/php-simple-html-dom-parser/Src/Sunra/PhpSimple/simplehtmldom_1_5/manual/.svn/all-wcprops create mode 100644 vendor/sunra/php-simple-html-dom-parser/Src/Sunra/PhpSimple/simplehtmldom_1_5/manual/.svn/entries create mode 100644 vendor/sunra/php-simple-html-dom-parser/Src/Sunra/PhpSimple/simplehtmldom_1_5/manual/.svn/prop-base/manual.htm.svn-base create mode 100644 vendor/sunra/php-simple-html-dom-parser/Src/Sunra/PhpSimple/simplehtmldom_1_5/manual/.svn/prop-base/manual_api.htm.svn-base create mode 100644 vendor/sunra/php-simple-html-dom-parser/Src/Sunra/PhpSimple/simplehtmldom_1_5/manual/.svn/prop-base/manual_faq.htm.svn-base create mode 100644 vendor/sunra/php-simple-html-dom-parser/Src/Sunra/PhpSimple/simplehtmldom_1_5/manual/.svn/text-base/manual.htm.svn-base create mode 100644 vendor/sunra/php-simple-html-dom-parser/Src/Sunra/PhpSimple/simplehtmldom_1_5/manual/.svn/text-base/manual_api.htm.svn-base create mode 100644 vendor/sunra/php-simple-html-dom-parser/Src/Sunra/PhpSimple/simplehtmldom_1_5/manual/.svn/text-base/manual_faq.htm.svn-base create mode 100644 vendor/sunra/php-simple-html-dom-parser/Src/Sunra/PhpSimple/simplehtmldom_1_5/manual/css/.svn/all-wcprops create mode 100644 vendor/sunra/php-simple-html-dom-parser/Src/Sunra/PhpSimple/simplehtmldom_1_5/manual/css/.svn/entries create mode 100644 vendor/sunra/php-simple-html-dom-parser/Src/Sunra/PhpSimple/simplehtmldom_1_5/manual/css/.svn/text-base/default.css.svn-base create mode 100644 vendor/sunra/php-simple-html-dom-parser/Src/Sunra/PhpSimple/simplehtmldom_1_5/manual/css/.svn/text-base/ui.tabs.css.svn-base create mode 100644 vendor/sunra/php-simple-html-dom-parser/Src/Sunra/PhpSimple/simplehtmldom_1_5/manual/css/default.css create mode 100644 vendor/sunra/php-simple-html-dom-parser/Src/Sunra/PhpSimple/simplehtmldom_1_5/manual/css/ui.tabs.css create mode 100644 vendor/sunra/php-simple-html-dom-parser/Src/Sunra/PhpSimple/simplehtmldom_1_5/manual/img/.svn/all-wcprops create mode 100644 vendor/sunra/php-simple-html-dom-parser/Src/Sunra/PhpSimple/simplehtmldom_1_5/manual/img/.svn/entries create mode 100644 vendor/sunra/php-simple-html-dom-parser/Src/Sunra/PhpSimple/simplehtmldom_1_5/manual/img/.svn/prop-base/tab.png.svn-base create mode 100644 vendor/sunra/php-simple-html-dom-parser/Src/Sunra/PhpSimple/simplehtmldom_1_5/manual/img/.svn/text-base/tab.png.svn-base create mode 100644 vendor/sunra/php-simple-html-dom-parser/Src/Sunra/PhpSimple/simplehtmldom_1_5/manual/img/tab.png create mode 100644 vendor/sunra/php-simple-html-dom-parser/Src/Sunra/PhpSimple/simplehtmldom_1_5/manual/js/.svn/all-wcprops create mode 100644 vendor/sunra/php-simple-html-dom-parser/Src/Sunra/PhpSimple/simplehtmldom_1_5/manual/js/.svn/entries create mode 100644 vendor/sunra/php-simple-html-dom-parser/Src/Sunra/PhpSimple/simplehtmldom_1_5/manual/js/.svn/text-base/jquery-1.2.3.pack.js.svn-base create mode 100644 vendor/sunra/php-simple-html-dom-parser/Src/Sunra/PhpSimple/simplehtmldom_1_5/manual/js/.svn/text-base/ui.tabs.pack.js.svn-base create mode 100644 vendor/sunra/php-simple-html-dom-parser/Src/Sunra/PhpSimple/simplehtmldom_1_5/manual/js/jquery-1.2.3.pack.js create mode 100644 vendor/sunra/php-simple-html-dom-parser/Src/Sunra/PhpSimple/simplehtmldom_1_5/manual/js/ui.tabs.pack.js create mode 100644 vendor/sunra/php-simple-html-dom-parser/Src/Sunra/PhpSimple/simplehtmldom_1_5/manual/manual.htm create mode 100644 vendor/sunra/php-simple-html-dom-parser/Src/Sunra/PhpSimple/simplehtmldom_1_5/manual/manual_api.htm create mode 100644 vendor/sunra/php-simple-html-dom-parser/Src/Sunra/PhpSimple/simplehtmldom_1_5/manual/manual_faq.htm create mode 100644 vendor/sunra/php-simple-html-dom-parser/Src/Sunra/PhpSimple/simplehtmldom_1_5/simple_html_dom.php create mode 100644 vendor/sunra/php-simple-html-dom-parser/Src/Sunra/PhpSimple/simplehtmldom_1_5/testcase/.svn/all-wcprops create mode 100644 vendor/sunra/php-simple-html-dom-parser/Src/Sunra/PhpSimple/simplehtmldom_1_5/testcase/.svn/entries create mode 100644 vendor/sunra/php-simple-html-dom-parser/Src/Sunra/PhpSimple/simplehtmldom_1_5/testcase/.svn/prop-base/all_test.php.svn-base create mode 100644 vendor/sunra/php-simple-html-dom-parser/Src/Sunra/PhpSimple/simplehtmldom_1_5/testcase/.svn/prop-base/callback_testcase.php.svn-base create mode 100644 vendor/sunra/php-simple-html-dom-parser/Src/Sunra/PhpSimple/simplehtmldom_1_5/testcase/.svn/prop-base/dom_testcase.php.svn-base create mode 100644 vendor/sunra/php-simple-html-dom-parser/Src/Sunra/PhpSimple/simplehtmldom_1_5/testcase/.svn/prop-base/element_testcase.php.svn-base create mode 100644 vendor/sunra/php-simple-html-dom-parser/Src/Sunra/PhpSimple/simplehtmldom_1_5/testcase/.svn/prop-base/invalid_testcase.php.svn-base create mode 100644 vendor/sunra/php-simple-html-dom-parser/Src/Sunra/PhpSimple/simplehtmldom_1_5/testcase/.svn/prop-base/jquery-1.2.3.pack.js.svn-base create mode 100644 vendor/sunra/php-simple-html-dom-parser/Src/Sunra/PhpSimple/simplehtmldom_1_5/testcase/.svn/prop-base/mass_test.php.svn-base create mode 100644 vendor/sunra/php-simple-html-dom-parser/Src/Sunra/PhpSimple/simplehtmldom_1_5/testcase/.svn/prop-base/memory_test.php.svn-base create mode 100644 vendor/sunra/php-simple-html-dom-parser/Src/Sunra/PhpSimple/simplehtmldom_1_5/testcase/.svn/prop-base/misc_testcase.php.svn-base create mode 100644 vendor/sunra/php-simple-html-dom-parser/Src/Sunra/PhpSimple/simplehtmldom_1_5/testcase/.svn/prop-base/performance_test.php.svn-base create mode 100644 vendor/sunra/php-simple-html-dom-parser/Src/Sunra/PhpSimple/simplehtmldom_1_5/testcase/.svn/prop-base/selector_testcase.php.svn-base create mode 100644 vendor/sunra/php-simple-html-dom-parser/Src/Sunra/PhpSimple/simplehtmldom_1_5/testcase/.svn/prop-base/slick_test.php.svn-base create mode 100644 vendor/sunra/php-simple-html-dom-parser/Src/Sunra/PhpSimple/simplehtmldom_1_5/testcase/.svn/prop-base/slickspeed.htm.svn-base create mode 100644 vendor/sunra/php-simple-html-dom-parser/Src/Sunra/PhpSimple/simplehtmldom_1_5/testcase/.svn/prop-base/std_testcase.php.svn-base create mode 100644 vendor/sunra/php-simple-html-dom-parser/Src/Sunra/PhpSimple/simplehtmldom_1_5/testcase/.svn/prop-base/strip_testcase.php.svn-base create mode 100644 vendor/sunra/php-simple-html-dom-parser/Src/Sunra/PhpSimple/simplehtmldom_1_5/testcase/.svn/text-base/all_test.php.svn-base create mode 100644 vendor/sunra/php-simple-html-dom-parser/Src/Sunra/PhpSimple/simplehtmldom_1_5/testcase/.svn/text-base/callback_testcase.php.svn-base create mode 100644 vendor/sunra/php-simple-html-dom-parser/Src/Sunra/PhpSimple/simplehtmldom_1_5/testcase/.svn/text-base/dom_testcase.php.svn-base create mode 100644 vendor/sunra/php-simple-html-dom-parser/Src/Sunra/PhpSimple/simplehtmldom_1_5/testcase/.svn/text-base/element_testcase.php.svn-base create mode 100644 vendor/sunra/php-simple-html-dom-parser/Src/Sunra/PhpSimple/simplehtmldom_1_5/testcase/.svn/text-base/invalid_testcase.php.svn-base create mode 100644 vendor/sunra/php-simple-html-dom-parser/Src/Sunra/PhpSimple/simplehtmldom_1_5/testcase/.svn/text-base/jquery-1.2.3.pack.js.svn-base create mode 100644 vendor/sunra/php-simple-html-dom-parser/Src/Sunra/PhpSimple/simplehtmldom_1_5/testcase/.svn/text-base/mass_test.php.svn-base create mode 100644 vendor/sunra/php-simple-html-dom-parser/Src/Sunra/PhpSimple/simplehtmldom_1_5/testcase/.svn/text-base/memory_test.php.svn-base create mode 100644 vendor/sunra/php-simple-html-dom-parser/Src/Sunra/PhpSimple/simplehtmldom_1_5/testcase/.svn/text-base/misc_testcase.php.svn-base create mode 100644 vendor/sunra/php-simple-html-dom-parser/Src/Sunra/PhpSimple/simplehtmldom_1_5/testcase/.svn/text-base/performance_test.php.svn-base create mode 100644 vendor/sunra/php-simple-html-dom-parser/Src/Sunra/PhpSimple/simplehtmldom_1_5/testcase/.svn/text-base/selector_testcase.php.svn-base create mode 100644 vendor/sunra/php-simple-html-dom-parser/Src/Sunra/PhpSimple/simplehtmldom_1_5/testcase/.svn/text-base/slick_test.php.svn-base create mode 100644 vendor/sunra/php-simple-html-dom-parser/Src/Sunra/PhpSimple/simplehtmldom_1_5/testcase/.svn/text-base/slickspeed.htm.svn-base create mode 100644 vendor/sunra/php-simple-html-dom-parser/Src/Sunra/PhpSimple/simplehtmldom_1_5/testcase/.svn/text-base/std_testcase.php.svn-base create mode 100644 vendor/sunra/php-simple-html-dom-parser/Src/Sunra/PhpSimple/simplehtmldom_1_5/testcase/.svn/text-base/strip_testcase.php.svn-base create mode 100644 vendor/sunra/php-simple-html-dom-parser/Src/Sunra/PhpSimple/simplehtmldom_1_5/testcase/all_test.php create mode 100644 vendor/sunra/php-simple-html-dom-parser/Src/Sunra/PhpSimple/simplehtmldom_1_5/testcase/callback_testcase.php create mode 100644 vendor/sunra/php-simple-html-dom-parser/Src/Sunra/PhpSimple/simplehtmldom_1_5/testcase/dom_testcase.php create mode 100644 vendor/sunra/php-simple-html-dom-parser/Src/Sunra/PhpSimple/simplehtmldom_1_5/testcase/element_testcase.php create mode 100644 vendor/sunra/php-simple-html-dom-parser/Src/Sunra/PhpSimple/simplehtmldom_1_5/testcase/html/.svn/all-wcprops create mode 100644 vendor/sunra/php-simple-html-dom-parser/Src/Sunra/PhpSimple/simplehtmldom_1_5/testcase/html/.svn/entries create mode 100644 vendor/sunra/php-simple-html-dom-parser/Src/Sunra/PhpSimple/simplehtmldom_1_5/testcase/invalid_testcase.php create mode 100644 vendor/sunra/php-simple-html-dom-parser/Src/Sunra/PhpSimple/simplehtmldom_1_5/testcase/jquery-1.2.3.pack.js create mode 100644 vendor/sunra/php-simple-html-dom-parser/Src/Sunra/PhpSimple/simplehtmldom_1_5/testcase/mass_test.php create mode 100644 vendor/sunra/php-simple-html-dom-parser/Src/Sunra/PhpSimple/simplehtmldom_1_5/testcase/memory_test.php create mode 100644 vendor/sunra/php-simple-html-dom-parser/Src/Sunra/PhpSimple/simplehtmldom_1_5/testcase/misc_testcase.php create mode 100644 vendor/sunra/php-simple-html-dom-parser/Src/Sunra/PhpSimple/simplehtmldom_1_5/testcase/performance_test.php create mode 100644 vendor/sunra/php-simple-html-dom-parser/Src/Sunra/PhpSimple/simplehtmldom_1_5/testcase/reader/.svn/all-wcprops create mode 100644 vendor/sunra/php-simple-html-dom-parser/Src/Sunra/PhpSimple/simplehtmldom_1_5/testcase/reader/.svn/dir-prop-base create mode 100644 vendor/sunra/php-simple-html-dom-parser/Src/Sunra/PhpSimple/simplehtmldom_1_5/testcase/reader/.svn/entries create mode 100644 vendor/sunra/php-simple-html-dom-parser/Src/Sunra/PhpSimple/simplehtmldom_1_5/testcase/reader/.svn/prop-base/all_test.php.svn-base create mode 100644 vendor/sunra/php-simple-html-dom-parser/Src/Sunra/PhpSimple/simplehtmldom_1_5/testcase/reader/.svn/prop-base/element_testcase.php.svn-base create mode 100644 vendor/sunra/php-simple-html-dom-parser/Src/Sunra/PhpSimple/simplehtmldom_1_5/testcase/reader/.svn/prop-base/memory_test.php.svn-base create mode 100644 vendor/sunra/php-simple-html-dom-parser/Src/Sunra/PhpSimple/simplehtmldom_1_5/testcase/reader/.svn/prop-base/performance_test.php.svn-base create mode 100644 vendor/sunra/php-simple-html-dom-parser/Src/Sunra/PhpSimple/simplehtmldom_1_5/testcase/reader/.svn/prop-base/selector_testcase.php.svn-base create mode 100644 vendor/sunra/php-simple-html-dom-parser/Src/Sunra/PhpSimple/simplehtmldom_1_5/testcase/reader/.svn/text-base/all_test.php.svn-base create mode 100644 vendor/sunra/php-simple-html-dom-parser/Src/Sunra/PhpSimple/simplehtmldom_1_5/testcase/reader/.svn/text-base/element_testcase.php.svn-base create mode 100644 vendor/sunra/php-simple-html-dom-parser/Src/Sunra/PhpSimple/simplehtmldom_1_5/testcase/reader/.svn/text-base/memory_test.php.svn-base create mode 100644 vendor/sunra/php-simple-html-dom-parser/Src/Sunra/PhpSimple/simplehtmldom_1_5/testcase/reader/.svn/text-base/performance_test.php.svn-base create mode 100644 vendor/sunra/php-simple-html-dom-parser/Src/Sunra/PhpSimple/simplehtmldom_1_5/testcase/reader/.svn/text-base/selector_testcase.php.svn-base create mode 100644 vendor/sunra/php-simple-html-dom-parser/Src/Sunra/PhpSimple/simplehtmldom_1_5/testcase/reader/all_test.php create mode 100644 vendor/sunra/php-simple-html-dom-parser/Src/Sunra/PhpSimple/simplehtmldom_1_5/testcase/reader/element_testcase.php create mode 100644 vendor/sunra/php-simple-html-dom-parser/Src/Sunra/PhpSimple/simplehtmldom_1_5/testcase/reader/memory_test.php create mode 100644 vendor/sunra/php-simple-html-dom-parser/Src/Sunra/PhpSimple/simplehtmldom_1_5/testcase/reader/performance_test.php create mode 100644 vendor/sunra/php-simple-html-dom-parser/Src/Sunra/PhpSimple/simplehtmldom_1_5/testcase/reader/selector_testcase.php create mode 100644 vendor/sunra/php-simple-html-dom-parser/Src/Sunra/PhpSimple/simplehtmldom_1_5/testcase/selector_testcase.php create mode 100644 vendor/sunra/php-simple-html-dom-parser/Src/Sunra/PhpSimple/simplehtmldom_1_5/testcase/slick_test.php create mode 100644 vendor/sunra/php-simple-html-dom-parser/Src/Sunra/PhpSimple/simplehtmldom_1_5/testcase/slickspeed.htm create mode 100644 vendor/sunra/php-simple-html-dom-parser/Src/Sunra/PhpSimple/simplehtmldom_1_5/testcase/std_testcase.php create mode 100644 vendor/sunra/php-simple-html-dom-parser/Src/Sunra/PhpSimple/simplehtmldom_1_5/testcase/strip_testcase.php create mode 100644 vendor/sunra/php-simple-html-dom-parser/composer.json diff --git a/.gitignore b/.gitignore index f7ac9d6a7..e135e191b 100644 --- a/.gitignore +++ b/.gitignore @@ -11,9 +11,7 @@ codeception.yml /node_modules/ /bower_components/ -/vendor/ composer.phar -composer.lock .idea *.sublime-workspace diff --git a/classes/security/Purifier.class.php b/classes/security/Purifier.class.php index 5a5cf6953..34a52b352 100644 --- a/classes/security/Purifier.class.php +++ b/classes/security/Purifier.class.php @@ -12,11 +12,6 @@ class Purifier public function __construct() { $this->_checkCacheDir(); - - // purifier setting - require_once _XE_PATH_ . 'classes/security/htmlpurifier/library/HTMLPurifier.auto.php'; - require_once 'HTMLPurifier.func.php'; - $this->_setConfig(); } diff --git a/composer.json b/composer.json index 94cc491b3..1628de44f 100644 --- a/composer.json +++ b/composer.json @@ -1,18 +1,35 @@ { - "name": "xpressengine/xe-core", - "license": "GNU LGPL", + "name": "xetown/xe-core", + "description": "XpressEngine XETOWN Remix", + "homepage": "https://www.xetown.com/", + "license": "LGPL-2.1", + "type": "project", "authors": [ - { - "name": "NAVER", - "email": "developers@xpressengine.com" - } + { "name": "NAVER", "email": "developers@xpressengine.com" }, + { "name": "XETOWN Contributors" } ], "require": { - "php": ">=5.4.0" + "php": ">=5.3.0", + "ext-curl": "*", + "ext-gd": "*", + "ext-iconv": "*", + "ext-json": "*", + "ext-mbstring": "*", + "ext-mcrypt": "*", + "ext-openssl": "*", + "ext-pcre": "*", + "ext-xml": "*", + "defuse/php-encryption": "1.2.1", + "ezyang/htmlpurifier": "4.7.*", + "matthiasmullie/minify": "1.3.*", + "michelf/php-markdown": "1.5.*", + "rmccue/requests": "1.6.*", + "sunra/php-simple-html-dom-parser": "1.5.*" }, "require-dev": { - "codeception/codeception": "~2.0", - "codeception/verify": "0.2.*", + "php": ">=5.4.0", + "codeception/codeception": "2.1.*", + "codeception/verify": "0.3.*", "codeception/specify": "0.4.*" } } diff --git a/composer.lock b/composer.lock new file mode 100644 index 000000000..2f55bbc70 --- /dev/null +++ b/composer.lock @@ -0,0 +1,369 @@ +{ + "_readme": [ + "This file locks the dependencies of your project to a known state", + "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", + "This file is @generated automatically" + ], + "hash": "8649ea9e0951fe7dd685f9bb14e4a17d", + "content-hash": "0276b439721108d097fff978f7ee1c93", + "packages": [ + { + "name": "defuse/php-encryption", + "version": "v1.2.1", + "source": { + "type": "git", + "url": "https://github.com/defuse/php-encryption.git", + "reference": "b87737b2eec06b13f025cabea847338fa203d1b4" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/defuse/php-encryption/zipball/b87737b2eec06b13f025cabea847338fa203d1b4", + "reference": "b87737b2eec06b13f025cabea847338fa203d1b4", + "shasum": "" + }, + "require": { + "ext-mcrypt": "*", + "ext-openssl": "*", + "php": ">=5.4.0" + }, + "type": "library", + "autoload": { + "files": [ + "Crypto.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Taylor Hornby", + "email": "havoc@defuse.ca" + } + ], + "description": "Secure PHP Encryption Library", + "keywords": [ + "aes", + "cipher", + "encryption", + "mcrypt", + "security" + ], + "time": "2015-03-14 20:27:45" + }, + { + "name": "ezyang/htmlpurifier", + "version": "v4.7.0", + "source": { + "type": "git", + "url": "https://github.com/ezyang/htmlpurifier.git", + "reference": "ae1828d955112356f7677c465f94f7deb7d27a40" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/ezyang/htmlpurifier/zipball/ae1828d955112356f7677c465f94f7deb7d27a40", + "reference": "ae1828d955112356f7677c465f94f7deb7d27a40", + "shasum": "" + }, + "require": { + "php": ">=5.2" + }, + "type": "library", + "autoload": { + "psr-0": { + "HTMLPurifier": "library/" + }, + "files": [ + "library/HTMLPurifier.composer.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "LGPL" + ], + "authors": [ + { + "name": "Edward Z. Yang", + "email": "admin@htmlpurifier.org", + "homepage": "http://ezyang.com" + } + ], + "description": "Standards compliant HTML filter written in PHP", + "homepage": "http://htmlpurifier.org/", + "keywords": [ + "html" + ], + "time": "2015-08-05 01:03:42" + }, + { + "name": "matthiasmullie/minify", + "version": "1.3.30", + "source": { + "type": "git", + "url": "https://github.com/matthiasmullie/minify.git", + "reference": "0cd5108683e7376e795555ced56229c4c16597aa" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/matthiasmullie/minify/zipball/0cd5108683e7376e795555ced56229c4c16597aa", + "reference": "0cd5108683e7376e795555ced56229c4c16597aa", + "shasum": "" + }, + "require": { + "ext-pcre": "*", + "matthiasmullie/path-converter": "~1.0", + "php": ">=5.3.0" + }, + "require-dev": { + "matthiasmullie/scrapbook": "~1.0", + "phpunit/phpunit": "~4.8", + "satooshi/php-coveralls": "~1.0" + }, + "bin": [ + "bin/minifycss", + "bin/minifyjs" + ], + "type": "library", + "autoload": { + "psr-4": { + "MatthiasMullie\\Minify\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Matthias Mullie", + "email": "minify@mullie.eu", + "homepage": "http://www.mullie.eu", + "role": "Developer" + } + ], + "description": "CSS & JS minifier", + "homepage": "http://www.minifier.org", + "keywords": [ + "JS", + "css", + "javascript", + "minifier", + "minify" + ], + "time": "2016-01-05 07:43:18" + }, + { + "name": "matthiasmullie/path-converter", + "version": "1.0.6", + "source": { + "type": "git", + "url": "https://github.com/matthiasmullie/path-converter.git", + "reference": "9f83d0c398dbe70f45f5840d95ffad73d5efd35f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/matthiasmullie/path-converter/zipball/9f83d0c398dbe70f45f5840d95ffad73d5efd35f", + "reference": "9f83d0c398dbe70f45f5840d95ffad73d5efd35f", + "shasum": "" + }, + "require": { + "ext-pcre": "*", + "php": ">=5.3.0" + }, + "require-dev": { + "phpunit/phpunit": "~4.8", + "satooshi/php-coveralls": "~1.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "MatthiasMullie\\PathConverter\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Matthias Mullie", + "email": "pathconverter@mullie.eu", + "homepage": "http://www.mullie.eu", + "role": "Developer" + } + ], + "description": "Relative path converter", + "homepage": "http://github.com/matthiasmullie/path-converter", + "keywords": [ + "converter", + "path", + "paths", + "relative" + ], + "time": "2016-01-05 07:45:30" + }, + { + "name": "michelf/php-markdown", + "version": "1.5.0", + "source": { + "type": "git", + "url": "https://github.com/michelf/php-markdown.git", + "reference": "e1aabe18173231ebcefc90e615565742fc1c7fd9" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/michelf/php-markdown/zipball/e1aabe18173231ebcefc90e615565742fc1c7fd9", + "reference": "e1aabe18173231ebcefc90e615565742fc1c7fd9", + "shasum": "" + }, + "require": { + "php": ">=5.3.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-lib": "1.4.x-dev" + } + }, + "autoload": { + "psr-0": { + "Michelf": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "John Gruber", + "homepage": "http://daringfireball.net/" + }, + { + "name": "Michel Fortin", + "email": "michel.fortin@michelf.ca", + "homepage": "https://michelf.ca/", + "role": "Developer" + } + ], + "description": "PHP Markdown", + "homepage": "https://michelf.ca/projects/php-markdown/", + "keywords": [ + "markdown" + ], + "time": "2015-03-01 12:03:08" + }, + { + "name": "rmccue/requests", + "version": "v1.6.1", + "source": { + "type": "git", + "url": "https://github.com/rmccue/Requests.git", + "reference": "6aac485666c2955077d77b796bbdd25f0013a4ea" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/rmccue/Requests/zipball/6aac485666c2955077d77b796bbdd25f0013a4ea", + "reference": "6aac485666c2955077d77b796bbdd25f0013a4ea", + "shasum": "" + }, + "require": { + "php": ">=5.2" + }, + "require-dev": { + "satooshi/php-coveralls": "dev-master" + }, + "type": "library", + "autoload": { + "psr-0": { + "Requests": "library/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "ISC" + ], + "authors": [ + { + "name": "Ryan McCue", + "homepage": "http://ryanmccue.info" + } + ], + "description": "A HTTP library written in PHP, for human beings.", + "homepage": "http://github.com/rmccue/Requests", + "keywords": [ + "curl", + "fsockopen", + "http", + "idna", + "ipv6", + "iri", + "sockets" + ], + "time": "2014-05-18 04:59:02" + }, + { + "name": "sunra/php-simple-html-dom-parser", + "version": "v1.5.0", + "source": { + "type": "git", + "url": "https://github.com/sunra/php-simple-html-dom-parser.git", + "reference": "a0b80ace086c7e09085669205e1b3c2c9c7a453c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sunra/php-simple-html-dom-parser/zipball/a0b80ace086c7e09085669205e1b3c2c9c7a453c", + "reference": "a0b80ace086c7e09085669205e1b3c2c9c7a453c", + "shasum": "" + }, + "require": { + "php": ">=5.3.2" + }, + "type": "library", + "autoload": { + "psr-0": { + "Sunra\\PhpSimple\\HtmlDomParser": "Src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "sunra", + "email": "sunra@yandex.ru", + "homepage": "http://github.com/sunra" + } + ], + "description": "Composer adaptation of: A HTML DOM parser written in PHP5+ let you manipulate HTML in a very easy way! Require PHP 5+. Supports invalid HTML. Find tags on an HTML page with selectors just like jQuery. Extract contents from HTML in a single line.", + "homepage": "https://github.com/sunra/php-simple-html-dom-parser", + "keywords": [ + "dom", + "html", + "parser" + ], + "time": "2013-05-04 14:32:03" + } + ], + "packages-dev": null, + "aliases": [], + "minimum-stability": "stable", + "stability-flags": [], + "prefer-stable": false, + "prefer-lowest": false, + "platform": { + "php": ">=5.3.0", + "ext-curl": "*", + "ext-gd": "*", + "ext-iconv": "*", + "ext-json": "*", + "ext-mbstring": "*", + "ext-mcrypt": "*", + "ext-openssl": "*", + "ext-pcre": "*", + "ext-xml": "*" + }, + "platform-dev": [] +} diff --git a/package.json b/package.json deleted file mode 100644 index 3f2bd26c2..000000000 --- a/package.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "name": "XpressEngine", - "author": "NAVER", - "license": "GNU LGPL", - "repository": { - "type": "git", - "url": "git://github.com/xpressengine/xe-core.git" - }, - "bugs": { - "url": "https://github.com/xpressengine/xe-core/issues" - }, - "devDependencies": { - "grunt": "^0.4.5", - "grunt-contrib-clean": "^0.5.0", - "grunt-contrib-concat": "^0.3.0", - "grunt-contrib-csslint": "~0.3.0", - "grunt-contrib-cssmin": "^0.7.0", - "grunt-contrib-jshint": "~0.10.0", - "grunt-contrib-uglify": "^0.4.1", - "grunt-phplint": "~0.0.3" - }, - "main": "Gruntfile.js", - "scripts": { - "test": "grunt" - } -} diff --git a/vendor/autoload.php b/vendor/autoload.php new file mode 100644 index 000000000..564d3443f --- /dev/null +++ b/vendor/autoload.php @@ -0,0 +1,7 @@ + + * Jordi Boggiano + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Composer\Autoload; + +/** + * ClassLoader implements a PSR-0, PSR-4 and classmap class loader. + * + * $loader = new \Composer\Autoload\ClassLoader(); + * + * // register classes with namespaces + * $loader->add('Symfony\Component', __DIR__.'/component'); + * $loader->add('Symfony', __DIR__.'/framework'); + * + * // activate the autoloader + * $loader->register(); + * + * // to enable searching the include path (eg. for PEAR packages) + * $loader->setUseIncludePath(true); + * + * In this example, if you try to use a class in the Symfony\Component + * namespace or one of its children (Symfony\Component\Console for instance), + * the autoloader will first look for the class under the component/ + * directory, and it will then fallback to the framework/ directory if not + * found before giving up. + * + * This class is loosely based on the Symfony UniversalClassLoader. + * + * @author Fabien Potencier + * @author Jordi Boggiano + * @see http://www.php-fig.org/psr/psr-0/ + * @see http://www.php-fig.org/psr/psr-4/ + */ +class ClassLoader +{ + // PSR-4 + private $prefixLengthsPsr4 = array(); + private $prefixDirsPsr4 = array(); + private $fallbackDirsPsr4 = array(); + + // PSR-0 + private $prefixesPsr0 = array(); + private $fallbackDirsPsr0 = array(); + + private $useIncludePath = false; + private $classMap = array(); + + private $classMapAuthoritative = false; + + public function getPrefixes() + { + if (!empty($this->prefixesPsr0)) { + return call_user_func_array('array_merge', $this->prefixesPsr0); + } + + return array(); + } + + public function getPrefixesPsr4() + { + return $this->prefixDirsPsr4; + } + + public function getFallbackDirs() + { + return $this->fallbackDirsPsr0; + } + + public function getFallbackDirsPsr4() + { + return $this->fallbackDirsPsr4; + } + + public function getClassMap() + { + return $this->classMap; + } + + /** + * @param array $classMap Class to filename map + */ + public function addClassMap(array $classMap) + { + if ($this->classMap) { + $this->classMap = array_merge($this->classMap, $classMap); + } else { + $this->classMap = $classMap; + } + } + + /** + * Registers a set of PSR-0 directories for a given prefix, either + * appending or prepending to the ones previously set for this prefix. + * + * @param string $prefix The prefix + * @param array|string $paths The PSR-0 root directories + * @param bool $prepend Whether to prepend the directories + */ + public function add($prefix, $paths, $prepend = false) + { + if (!$prefix) { + if ($prepend) { + $this->fallbackDirsPsr0 = array_merge( + (array) $paths, + $this->fallbackDirsPsr0 + ); + } else { + $this->fallbackDirsPsr0 = array_merge( + $this->fallbackDirsPsr0, + (array) $paths + ); + } + + return; + } + + $first = $prefix[0]; + if (!isset($this->prefixesPsr0[$first][$prefix])) { + $this->prefixesPsr0[$first][$prefix] = (array) $paths; + + return; + } + if ($prepend) { + $this->prefixesPsr0[$first][$prefix] = array_merge( + (array) $paths, + $this->prefixesPsr0[$first][$prefix] + ); + } else { + $this->prefixesPsr0[$first][$prefix] = array_merge( + $this->prefixesPsr0[$first][$prefix], + (array) $paths + ); + } + } + + /** + * Registers a set of PSR-4 directories for a given namespace, either + * appending or prepending to the ones previously set for this namespace. + * + * @param string $prefix The prefix/namespace, with trailing '\\' + * @param array|string $paths The PSR-0 base directories + * @param bool $prepend Whether to prepend the directories + * + * @throws \InvalidArgumentException + */ + public function addPsr4($prefix, $paths, $prepend = false) + { + if (!$prefix) { + // Register directories for the root namespace. + if ($prepend) { + $this->fallbackDirsPsr4 = array_merge( + (array) $paths, + $this->fallbackDirsPsr4 + ); + } else { + $this->fallbackDirsPsr4 = array_merge( + $this->fallbackDirsPsr4, + (array) $paths + ); + } + } elseif (!isset($this->prefixDirsPsr4[$prefix])) { + // Register directories for a new namespace. + $length = strlen($prefix); + if ('\\' !== $prefix[$length - 1]) { + throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator."); + } + $this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length; + $this->prefixDirsPsr4[$prefix] = (array) $paths; + } elseif ($prepend) { + // Prepend directories for an already registered namespace. + $this->prefixDirsPsr4[$prefix] = array_merge( + (array) $paths, + $this->prefixDirsPsr4[$prefix] + ); + } else { + // Append directories for an already registered namespace. + $this->prefixDirsPsr4[$prefix] = array_merge( + $this->prefixDirsPsr4[$prefix], + (array) $paths + ); + } + } + + /** + * Registers a set of PSR-0 directories for a given prefix, + * replacing any others previously set for this prefix. + * + * @param string $prefix The prefix + * @param array|string $paths The PSR-0 base directories + */ + public function set($prefix, $paths) + { + if (!$prefix) { + $this->fallbackDirsPsr0 = (array) $paths; + } else { + $this->prefixesPsr0[$prefix[0]][$prefix] = (array) $paths; + } + } + + /** + * Registers a set of PSR-4 directories for a given namespace, + * replacing any others previously set for this namespace. + * + * @param string $prefix The prefix/namespace, with trailing '\\' + * @param array|string $paths The PSR-4 base directories + * + * @throws \InvalidArgumentException + */ + public function setPsr4($prefix, $paths) + { + if (!$prefix) { + $this->fallbackDirsPsr4 = (array) $paths; + } else { + $length = strlen($prefix); + if ('\\' !== $prefix[$length - 1]) { + throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator."); + } + $this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length; + $this->prefixDirsPsr4[$prefix] = (array) $paths; + } + } + + /** + * Turns on searching the include path for class files. + * + * @param bool $useIncludePath + */ + public function setUseIncludePath($useIncludePath) + { + $this->useIncludePath = $useIncludePath; + } + + /** + * Can be used to check if the autoloader uses the include path to check + * for classes. + * + * @return bool + */ + public function getUseIncludePath() + { + return $this->useIncludePath; + } + + /** + * Turns off searching the prefix and fallback directories for classes + * that have not been registered with the class map. + * + * @param bool $classMapAuthoritative + */ + public function setClassMapAuthoritative($classMapAuthoritative) + { + $this->classMapAuthoritative = $classMapAuthoritative; + } + + /** + * Should class lookup fail if not found in the current class map? + * + * @return bool + */ + public function isClassMapAuthoritative() + { + return $this->classMapAuthoritative; + } + + /** + * Registers this instance as an autoloader. + * + * @param bool $prepend Whether to prepend the autoloader or not + */ + public function register($prepend = false) + { + spl_autoload_register(array($this, 'loadClass'), true, $prepend); + } + + /** + * Unregisters this instance as an autoloader. + */ + public function unregister() + { + spl_autoload_unregister(array($this, 'loadClass')); + } + + /** + * Loads the given class or interface. + * + * @param string $class The name of the class + * @return bool|null True if loaded, null otherwise + */ + public function loadClass($class) + { + if ($file = $this->findFile($class)) { + includeFile($file); + + return true; + } + } + + /** + * Finds the path to the file where the class is defined. + * + * @param string $class The name of the class + * + * @return string|false The path if found, false otherwise + */ + public function findFile($class) + { + // work around for PHP 5.3.0 - 5.3.2 https://bugs.php.net/50731 + if ('\\' == $class[0]) { + $class = substr($class, 1); + } + + // class map lookup + if (isset($this->classMap[$class])) { + return $this->classMap[$class]; + } + if ($this->classMapAuthoritative) { + return false; + } + + $file = $this->findFileWithExtension($class, '.php'); + + // Search for Hack files if we are running on HHVM + if ($file === null && defined('HHVM_VERSION')) { + $file = $this->findFileWithExtension($class, '.hh'); + } + + if ($file === null) { + // Remember that this class does not exist. + return $this->classMap[$class] = false; + } + + return $file; + } + + private function findFileWithExtension($class, $ext) + { + // PSR-4 lookup + $logicalPathPsr4 = strtr($class, '\\', DIRECTORY_SEPARATOR) . $ext; + + $first = $class[0]; + if (isset($this->prefixLengthsPsr4[$first])) { + foreach ($this->prefixLengthsPsr4[$first] as $prefix => $length) { + if (0 === strpos($class, $prefix)) { + foreach ($this->prefixDirsPsr4[$prefix] as $dir) { + if (file_exists($file = $dir . DIRECTORY_SEPARATOR . substr($logicalPathPsr4, $length))) { + return $file; + } + } + } + } + } + + // PSR-4 fallback dirs + foreach ($this->fallbackDirsPsr4 as $dir) { + if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr4)) { + return $file; + } + } + + // PSR-0 lookup + if (false !== $pos = strrpos($class, '\\')) { + // namespaced class name + $logicalPathPsr0 = substr($logicalPathPsr4, 0, $pos + 1) + . strtr(substr($logicalPathPsr4, $pos + 1), '_', DIRECTORY_SEPARATOR); + } else { + // PEAR-like class name + $logicalPathPsr0 = strtr($class, '_', DIRECTORY_SEPARATOR) . $ext; + } + + if (isset($this->prefixesPsr0[$first])) { + foreach ($this->prefixesPsr0[$first] as $prefix => $dirs) { + if (0 === strpos($class, $prefix)) { + foreach ($dirs as $dir) { + if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr0)) { + return $file; + } + } + } + } + } + + // PSR-0 fallback dirs + foreach ($this->fallbackDirsPsr0 as $dir) { + if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr0)) { + return $file; + } + } + + // PSR-0 include paths. + if ($this->useIncludePath && $file = stream_resolve_include_path($logicalPathPsr0)) { + return $file; + } + } +} + +/** + * Scope isolated include. + * + * Prevents access to $this/self from included files. + */ +function includeFile($file) +{ + include $file; +} diff --git a/vendor/composer/LICENSE b/vendor/composer/LICENSE new file mode 100644 index 000000000..cc78956f0 --- /dev/null +++ b/vendor/composer/LICENSE @@ -0,0 +1,19 @@ +Copyright (c) 2015 Nils Adermann, Jordi Boggiano + +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. diff --git a/vendor/composer/autoload_classmap.php b/vendor/composer/autoload_classmap.php new file mode 100644 index 000000000..16cbeb808 --- /dev/null +++ b/vendor/composer/autoload_classmap.php @@ -0,0 +1,300 @@ + $vendorDir . '/ezyang/htmlpurifier/library/HTMLPurifier.php', + 'HTMLPurifier_Arborize' => $vendorDir . '/ezyang/htmlpurifier/library/HTMLPurifier/Arborize.php', + 'HTMLPurifier_AttrCollections' => $vendorDir . '/ezyang/htmlpurifier/library/HTMLPurifier/AttrCollections.php', + 'HTMLPurifier_AttrDef' => $vendorDir . '/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef.php', + 'HTMLPurifier_AttrDef_CSS' => $vendorDir . '/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/CSS.php', + 'HTMLPurifier_AttrDef_CSS_AlphaValue' => $vendorDir . '/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/AlphaValue.php', + 'HTMLPurifier_AttrDef_CSS_Background' => $vendorDir . '/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/Background.php', + 'HTMLPurifier_AttrDef_CSS_BackgroundPosition' => $vendorDir . '/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/BackgroundPosition.php', + 'HTMLPurifier_AttrDef_CSS_Border' => $vendorDir . '/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/Border.php', + 'HTMLPurifier_AttrDef_CSS_Color' => $vendorDir . '/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/Color.php', + 'HTMLPurifier_AttrDef_CSS_Composite' => $vendorDir . '/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/Composite.php', + 'HTMLPurifier_AttrDef_CSS_DenyElementDecorator' => $vendorDir . '/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/DenyElementDecorator.php', + 'HTMLPurifier_AttrDef_CSS_Filter' => $vendorDir . '/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/Filter.php', + 'HTMLPurifier_AttrDef_CSS_Font' => $vendorDir . '/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/Font.php', + 'HTMLPurifier_AttrDef_CSS_FontFamily' => $vendorDir . '/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/FontFamily.php', + 'HTMLPurifier_AttrDef_CSS_Ident' => $vendorDir . '/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/Ident.php', + 'HTMLPurifier_AttrDef_CSS_ImportantDecorator' => $vendorDir . '/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/ImportantDecorator.php', + 'HTMLPurifier_AttrDef_CSS_Length' => $vendorDir . '/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/Length.php', + 'HTMLPurifier_AttrDef_CSS_ListStyle' => $vendorDir . '/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/ListStyle.php', + 'HTMLPurifier_AttrDef_CSS_Multiple' => $vendorDir . '/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/Multiple.php', + 'HTMLPurifier_AttrDef_CSS_Number' => $vendorDir . '/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/Number.php', + 'HTMLPurifier_AttrDef_CSS_Percentage' => $vendorDir . '/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/Percentage.php', + 'HTMLPurifier_AttrDef_CSS_TextDecoration' => $vendorDir . '/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/TextDecoration.php', + 'HTMLPurifier_AttrDef_CSS_URI' => $vendorDir . '/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/URI.php', + 'HTMLPurifier_AttrDef_Clone' => $vendorDir . '/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/Clone.php', + 'HTMLPurifier_AttrDef_Enum' => $vendorDir . '/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/Enum.php', + 'HTMLPurifier_AttrDef_HTML_Bool' => $vendorDir . '/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/HTML/Bool.php', + 'HTMLPurifier_AttrDef_HTML_Class' => $vendorDir . '/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/HTML/Class.php', + 'HTMLPurifier_AttrDef_HTML_Color' => $vendorDir . '/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/HTML/Color.php', + 'HTMLPurifier_AttrDef_HTML_FrameTarget' => $vendorDir . '/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/HTML/FrameTarget.php', + 'HTMLPurifier_AttrDef_HTML_ID' => $vendorDir . '/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/HTML/ID.php', + 'HTMLPurifier_AttrDef_HTML_Length' => $vendorDir . '/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/HTML/Length.php', + 'HTMLPurifier_AttrDef_HTML_LinkTypes' => $vendorDir . '/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/HTML/LinkTypes.php', + 'HTMLPurifier_AttrDef_HTML_MultiLength' => $vendorDir . '/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/HTML/MultiLength.php', + 'HTMLPurifier_AttrDef_HTML_Nmtokens' => $vendorDir . '/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/HTML/Nmtokens.php', + 'HTMLPurifier_AttrDef_HTML_Pixels' => $vendorDir . '/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/HTML/Pixels.php', + 'HTMLPurifier_AttrDef_Integer' => $vendorDir . '/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/Integer.php', + 'HTMLPurifier_AttrDef_Lang' => $vendorDir . '/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/Lang.php', + 'HTMLPurifier_AttrDef_Switch' => $vendorDir . '/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/Switch.php', + 'HTMLPurifier_AttrDef_Text' => $vendorDir . '/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/Text.php', + 'HTMLPurifier_AttrDef_URI' => $vendorDir . '/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/URI.php', + 'HTMLPurifier_AttrDef_URI_Email' => $vendorDir . '/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/URI/Email.php', + 'HTMLPurifier_AttrDef_URI_Email_SimpleCheck' => $vendorDir . '/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/URI/Email/SimpleCheck.php', + 'HTMLPurifier_AttrDef_URI_Host' => $vendorDir . '/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/URI/Host.php', + 'HTMLPurifier_AttrDef_URI_IPv4' => $vendorDir . '/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/URI/IPv4.php', + 'HTMLPurifier_AttrDef_URI_IPv6' => $vendorDir . '/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/URI/IPv6.php', + 'HTMLPurifier_AttrTransform' => $vendorDir . '/ezyang/htmlpurifier/library/HTMLPurifier/AttrTransform.php', + 'HTMLPurifier_AttrTransform_Background' => $vendorDir . '/ezyang/htmlpurifier/library/HTMLPurifier/AttrTransform/Background.php', + 'HTMLPurifier_AttrTransform_BdoDir' => $vendorDir . '/ezyang/htmlpurifier/library/HTMLPurifier/AttrTransform/BdoDir.php', + 'HTMLPurifier_AttrTransform_BgColor' => $vendorDir . '/ezyang/htmlpurifier/library/HTMLPurifier/AttrTransform/BgColor.php', + 'HTMLPurifier_AttrTransform_BoolToCSS' => $vendorDir . '/ezyang/htmlpurifier/library/HTMLPurifier/AttrTransform/BoolToCSS.php', + 'HTMLPurifier_AttrTransform_Border' => $vendorDir . '/ezyang/htmlpurifier/library/HTMLPurifier/AttrTransform/Border.php', + 'HTMLPurifier_AttrTransform_EnumToCSS' => $vendorDir . '/ezyang/htmlpurifier/library/HTMLPurifier/AttrTransform/EnumToCSS.php', + 'HTMLPurifier_AttrTransform_ImgRequired' => $vendorDir . '/ezyang/htmlpurifier/library/HTMLPurifier/AttrTransform/ImgRequired.php', + 'HTMLPurifier_AttrTransform_ImgSpace' => $vendorDir . '/ezyang/htmlpurifier/library/HTMLPurifier/AttrTransform/ImgSpace.php', + 'HTMLPurifier_AttrTransform_Input' => $vendorDir . '/ezyang/htmlpurifier/library/HTMLPurifier/AttrTransform/Input.php', + 'HTMLPurifier_AttrTransform_Lang' => $vendorDir . '/ezyang/htmlpurifier/library/HTMLPurifier/AttrTransform/Lang.php', + 'HTMLPurifier_AttrTransform_Length' => $vendorDir . '/ezyang/htmlpurifier/library/HTMLPurifier/AttrTransform/Length.php', + 'HTMLPurifier_AttrTransform_Name' => $vendorDir . '/ezyang/htmlpurifier/library/HTMLPurifier/AttrTransform/Name.php', + 'HTMLPurifier_AttrTransform_NameSync' => $vendorDir . '/ezyang/htmlpurifier/library/HTMLPurifier/AttrTransform/NameSync.php', + 'HTMLPurifier_AttrTransform_Nofollow' => $vendorDir . '/ezyang/htmlpurifier/library/HTMLPurifier/AttrTransform/Nofollow.php', + 'HTMLPurifier_AttrTransform_SafeEmbed' => $vendorDir . '/ezyang/htmlpurifier/library/HTMLPurifier/AttrTransform/SafeEmbed.php', + 'HTMLPurifier_AttrTransform_SafeObject' => $vendorDir . '/ezyang/htmlpurifier/library/HTMLPurifier/AttrTransform/SafeObject.php', + 'HTMLPurifier_AttrTransform_SafeParam' => $vendorDir . '/ezyang/htmlpurifier/library/HTMLPurifier/AttrTransform/SafeParam.php', + 'HTMLPurifier_AttrTransform_ScriptRequired' => $vendorDir . '/ezyang/htmlpurifier/library/HTMLPurifier/AttrTransform/ScriptRequired.php', + 'HTMLPurifier_AttrTransform_TargetBlank' => $vendorDir . '/ezyang/htmlpurifier/library/HTMLPurifier/AttrTransform/TargetBlank.php', + 'HTMLPurifier_AttrTransform_Textarea' => $vendorDir . '/ezyang/htmlpurifier/library/HTMLPurifier/AttrTransform/Textarea.php', + 'HTMLPurifier_AttrTypes' => $vendorDir . '/ezyang/htmlpurifier/library/HTMLPurifier/AttrTypes.php', + 'HTMLPurifier_AttrValidator' => $vendorDir . '/ezyang/htmlpurifier/library/HTMLPurifier/AttrValidator.php', + 'HTMLPurifier_Bootstrap' => $vendorDir . '/ezyang/htmlpurifier/library/HTMLPurifier/Bootstrap.php', + 'HTMLPurifier_CSSDefinition' => $vendorDir . '/ezyang/htmlpurifier/library/HTMLPurifier/CSSDefinition.php', + 'HTMLPurifier_ChildDef' => $vendorDir . '/ezyang/htmlpurifier/library/HTMLPurifier/ChildDef.php', + 'HTMLPurifier_ChildDef_Chameleon' => $vendorDir . '/ezyang/htmlpurifier/library/HTMLPurifier/ChildDef/Chameleon.php', + 'HTMLPurifier_ChildDef_Custom' => $vendorDir . '/ezyang/htmlpurifier/library/HTMLPurifier/ChildDef/Custom.php', + 'HTMLPurifier_ChildDef_Empty' => $vendorDir . '/ezyang/htmlpurifier/library/HTMLPurifier/ChildDef/Empty.php', + 'HTMLPurifier_ChildDef_List' => $vendorDir . '/ezyang/htmlpurifier/library/HTMLPurifier/ChildDef/List.php', + 'HTMLPurifier_ChildDef_Optional' => $vendorDir . '/ezyang/htmlpurifier/library/HTMLPurifier/ChildDef/Optional.php', + 'HTMLPurifier_ChildDef_Required' => $vendorDir . '/ezyang/htmlpurifier/library/HTMLPurifier/ChildDef/Required.php', + 'HTMLPurifier_ChildDef_StrictBlockquote' => $vendorDir . '/ezyang/htmlpurifier/library/HTMLPurifier/ChildDef/StrictBlockquote.php', + 'HTMLPurifier_ChildDef_Table' => $vendorDir . '/ezyang/htmlpurifier/library/HTMLPurifier/ChildDef/Table.php', + 'HTMLPurifier_Config' => $vendorDir . '/ezyang/htmlpurifier/library/HTMLPurifier/Config.php', + 'HTMLPurifier_ConfigSchema' => $vendorDir . '/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema.php', + 'HTMLPurifier_ConfigSchema_Builder_ConfigSchema' => $vendorDir . '/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/Builder/ConfigSchema.php', + 'HTMLPurifier_ConfigSchema_Builder_Xml' => $vendorDir . '/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/Builder/Xml.php', + 'HTMLPurifier_ConfigSchema_Exception' => $vendorDir . '/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/Exception.php', + 'HTMLPurifier_ConfigSchema_Interchange' => $vendorDir . '/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/Interchange.php', + 'HTMLPurifier_ConfigSchema_InterchangeBuilder' => $vendorDir . '/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/InterchangeBuilder.php', + 'HTMLPurifier_ConfigSchema_Interchange_Directive' => $vendorDir . '/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/Interchange/Directive.php', + 'HTMLPurifier_ConfigSchema_Interchange_Id' => $vendorDir . '/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/Interchange/Id.php', + 'HTMLPurifier_ConfigSchema_Validator' => $vendorDir . '/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/Validator.php', + 'HTMLPurifier_ConfigSchema_ValidatorAtom' => $vendorDir . '/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/ValidatorAtom.php', + 'HTMLPurifier_ContentSets' => $vendorDir . '/ezyang/htmlpurifier/library/HTMLPurifier/ContentSets.php', + 'HTMLPurifier_Context' => $vendorDir . '/ezyang/htmlpurifier/library/HTMLPurifier/Context.php', + 'HTMLPurifier_Definition' => $vendorDir . '/ezyang/htmlpurifier/library/HTMLPurifier/Definition.php', + 'HTMLPurifier_DefinitionCache' => $vendorDir . '/ezyang/htmlpurifier/library/HTMLPurifier/DefinitionCache.php', + 'HTMLPurifier_DefinitionCacheFactory' => $vendorDir . '/ezyang/htmlpurifier/library/HTMLPurifier/DefinitionCacheFactory.php', + 'HTMLPurifier_DefinitionCache_Decorator' => $vendorDir . '/ezyang/htmlpurifier/library/HTMLPurifier/DefinitionCache/Decorator.php', + 'HTMLPurifier_DefinitionCache_Decorator_Cleanup' => $vendorDir . '/ezyang/htmlpurifier/library/HTMLPurifier/DefinitionCache/Decorator/Cleanup.php', + 'HTMLPurifier_DefinitionCache_Decorator_Memory' => $vendorDir . '/ezyang/htmlpurifier/library/HTMLPurifier/DefinitionCache/Decorator/Memory.php', + 'HTMLPurifier_DefinitionCache_Null' => $vendorDir . '/ezyang/htmlpurifier/library/HTMLPurifier/DefinitionCache/Null.php', + 'HTMLPurifier_DefinitionCache_Serializer' => $vendorDir . '/ezyang/htmlpurifier/library/HTMLPurifier/DefinitionCache/Serializer.php', + 'HTMLPurifier_Doctype' => $vendorDir . '/ezyang/htmlpurifier/library/HTMLPurifier/Doctype.php', + 'HTMLPurifier_DoctypeRegistry' => $vendorDir . '/ezyang/htmlpurifier/library/HTMLPurifier/DoctypeRegistry.php', + 'HTMLPurifier_ElementDef' => $vendorDir . '/ezyang/htmlpurifier/library/HTMLPurifier/ElementDef.php', + 'HTMLPurifier_Encoder' => $vendorDir . '/ezyang/htmlpurifier/library/HTMLPurifier/Encoder.php', + 'HTMLPurifier_EntityLookup' => $vendorDir . '/ezyang/htmlpurifier/library/HTMLPurifier/EntityLookup.php', + 'HTMLPurifier_EntityParser' => $vendorDir . '/ezyang/htmlpurifier/library/HTMLPurifier/EntityParser.php', + 'HTMLPurifier_ErrorCollector' => $vendorDir . '/ezyang/htmlpurifier/library/HTMLPurifier/ErrorCollector.php', + 'HTMLPurifier_ErrorStruct' => $vendorDir . '/ezyang/htmlpurifier/library/HTMLPurifier/ErrorStruct.php', + 'HTMLPurifier_Exception' => $vendorDir . '/ezyang/htmlpurifier/library/HTMLPurifier/Exception.php', + 'HTMLPurifier_Filter' => $vendorDir . '/ezyang/htmlpurifier/library/HTMLPurifier/Filter.php', + 'HTMLPurifier_Filter_ExtractStyleBlocks' => $vendorDir . '/ezyang/htmlpurifier/library/HTMLPurifier/Filter/ExtractStyleBlocks.php', + 'HTMLPurifier_Filter_YouTube' => $vendorDir . '/ezyang/htmlpurifier/library/HTMLPurifier/Filter/YouTube.php', + 'HTMLPurifier_Generator' => $vendorDir . '/ezyang/htmlpurifier/library/HTMLPurifier/Generator.php', + 'HTMLPurifier_HTMLDefinition' => $vendorDir . '/ezyang/htmlpurifier/library/HTMLPurifier/HTMLDefinition.php', + 'HTMLPurifier_HTMLModule' => $vendorDir . '/ezyang/htmlpurifier/library/HTMLPurifier/HTMLModule.php', + 'HTMLPurifier_HTMLModuleManager' => $vendorDir . '/ezyang/htmlpurifier/library/HTMLPurifier/HTMLModuleManager.php', + 'HTMLPurifier_HTMLModule_Bdo' => $vendorDir . '/ezyang/htmlpurifier/library/HTMLPurifier/HTMLModule/Bdo.php', + 'HTMLPurifier_HTMLModule_CommonAttributes' => $vendorDir . '/ezyang/htmlpurifier/library/HTMLPurifier/HTMLModule/CommonAttributes.php', + 'HTMLPurifier_HTMLModule_Edit' => $vendorDir . '/ezyang/htmlpurifier/library/HTMLPurifier/HTMLModule/Edit.php', + 'HTMLPurifier_HTMLModule_Forms' => $vendorDir . '/ezyang/htmlpurifier/library/HTMLPurifier/HTMLModule/Forms.php', + 'HTMLPurifier_HTMLModule_Hypertext' => $vendorDir . '/ezyang/htmlpurifier/library/HTMLPurifier/HTMLModule/Hypertext.php', + 'HTMLPurifier_HTMLModule_Iframe' => $vendorDir . '/ezyang/htmlpurifier/library/HTMLPurifier/HTMLModule/Iframe.php', + 'HTMLPurifier_HTMLModule_Image' => $vendorDir . '/ezyang/htmlpurifier/library/HTMLPurifier/HTMLModule/Image.php', + 'HTMLPurifier_HTMLModule_Legacy' => $vendorDir . '/ezyang/htmlpurifier/library/HTMLPurifier/HTMLModule/Legacy.php', + 'HTMLPurifier_HTMLModule_List' => $vendorDir . '/ezyang/htmlpurifier/library/HTMLPurifier/HTMLModule/List.php', + 'HTMLPurifier_HTMLModule_Name' => $vendorDir . '/ezyang/htmlpurifier/library/HTMLPurifier/HTMLModule/Name.php', + 'HTMLPurifier_HTMLModule_Nofollow' => $vendorDir . '/ezyang/htmlpurifier/library/HTMLPurifier/HTMLModule/Nofollow.php', + 'HTMLPurifier_HTMLModule_NonXMLCommonAttributes' => $vendorDir . '/ezyang/htmlpurifier/library/HTMLPurifier/HTMLModule/NonXMLCommonAttributes.php', + 'HTMLPurifier_HTMLModule_Object' => $vendorDir . '/ezyang/htmlpurifier/library/HTMLPurifier/HTMLModule/Object.php', + 'HTMLPurifier_HTMLModule_Presentation' => $vendorDir . '/ezyang/htmlpurifier/library/HTMLPurifier/HTMLModule/Presentation.php', + 'HTMLPurifier_HTMLModule_Proprietary' => $vendorDir . '/ezyang/htmlpurifier/library/HTMLPurifier/HTMLModule/Proprietary.php', + 'HTMLPurifier_HTMLModule_Ruby' => $vendorDir . '/ezyang/htmlpurifier/library/HTMLPurifier/HTMLModule/Ruby.php', + 'HTMLPurifier_HTMLModule_SafeEmbed' => $vendorDir . '/ezyang/htmlpurifier/library/HTMLPurifier/HTMLModule/SafeEmbed.php', + 'HTMLPurifier_HTMLModule_SafeObject' => $vendorDir . '/ezyang/htmlpurifier/library/HTMLPurifier/HTMLModule/SafeObject.php', + 'HTMLPurifier_HTMLModule_SafeScripting' => $vendorDir . '/ezyang/htmlpurifier/library/HTMLPurifier/HTMLModule/SafeScripting.php', + 'HTMLPurifier_HTMLModule_Scripting' => $vendorDir . '/ezyang/htmlpurifier/library/HTMLPurifier/HTMLModule/Scripting.php', + 'HTMLPurifier_HTMLModule_StyleAttribute' => $vendorDir . '/ezyang/htmlpurifier/library/HTMLPurifier/HTMLModule/StyleAttribute.php', + 'HTMLPurifier_HTMLModule_Tables' => $vendorDir . '/ezyang/htmlpurifier/library/HTMLPurifier/HTMLModule/Tables.php', + 'HTMLPurifier_HTMLModule_Target' => $vendorDir . '/ezyang/htmlpurifier/library/HTMLPurifier/HTMLModule/Target.php', + 'HTMLPurifier_HTMLModule_TargetBlank' => $vendorDir . '/ezyang/htmlpurifier/library/HTMLPurifier/HTMLModule/TargetBlank.php', + 'HTMLPurifier_HTMLModule_Text' => $vendorDir . '/ezyang/htmlpurifier/library/HTMLPurifier/HTMLModule/Text.php', + 'HTMLPurifier_HTMLModule_Tidy' => $vendorDir . '/ezyang/htmlpurifier/library/HTMLPurifier/HTMLModule/Tidy.php', + 'HTMLPurifier_HTMLModule_Tidy_Name' => $vendorDir . '/ezyang/htmlpurifier/library/HTMLPurifier/HTMLModule/Tidy/Name.php', + 'HTMLPurifier_HTMLModule_Tidy_Proprietary' => $vendorDir . '/ezyang/htmlpurifier/library/HTMLPurifier/HTMLModule/Tidy/Proprietary.php', + 'HTMLPurifier_HTMLModule_Tidy_Strict' => $vendorDir . '/ezyang/htmlpurifier/library/HTMLPurifier/HTMLModule/Tidy/Strict.php', + 'HTMLPurifier_HTMLModule_Tidy_Transitional' => $vendorDir . '/ezyang/htmlpurifier/library/HTMLPurifier/HTMLModule/Tidy/Transitional.php', + 'HTMLPurifier_HTMLModule_Tidy_XHTML' => $vendorDir . '/ezyang/htmlpurifier/library/HTMLPurifier/HTMLModule/Tidy/XHTML.php', + 'HTMLPurifier_HTMLModule_Tidy_XHTMLAndHTML4' => $vendorDir . '/ezyang/htmlpurifier/library/HTMLPurifier/HTMLModule/Tidy/XHTMLAndHTML4.php', + 'HTMLPurifier_HTMLModule_XMLCommonAttributes' => $vendorDir . '/ezyang/htmlpurifier/library/HTMLPurifier/HTMLModule/XMLCommonAttributes.php', + 'HTMLPurifier_IDAccumulator' => $vendorDir . '/ezyang/htmlpurifier/library/HTMLPurifier/IDAccumulator.php', + 'HTMLPurifier_Injector' => $vendorDir . '/ezyang/htmlpurifier/library/HTMLPurifier/Injector.php', + 'HTMLPurifier_Injector_AutoParagraph' => $vendorDir . '/ezyang/htmlpurifier/library/HTMLPurifier/Injector/AutoParagraph.php', + 'HTMLPurifier_Injector_DisplayLinkURI' => $vendorDir . '/ezyang/htmlpurifier/library/HTMLPurifier/Injector/DisplayLinkURI.php', + 'HTMLPurifier_Injector_Linkify' => $vendorDir . '/ezyang/htmlpurifier/library/HTMLPurifier/Injector/Linkify.php', + 'HTMLPurifier_Injector_PurifierLinkify' => $vendorDir . '/ezyang/htmlpurifier/library/HTMLPurifier/Injector/PurifierLinkify.php', + 'HTMLPurifier_Injector_RemoveEmpty' => $vendorDir . '/ezyang/htmlpurifier/library/HTMLPurifier/Injector/RemoveEmpty.php', + 'HTMLPurifier_Injector_RemoveSpansWithoutAttributes' => $vendorDir . '/ezyang/htmlpurifier/library/HTMLPurifier/Injector/RemoveSpansWithoutAttributes.php', + 'HTMLPurifier_Injector_SafeObject' => $vendorDir . '/ezyang/htmlpurifier/library/HTMLPurifier/Injector/SafeObject.php', + 'HTMLPurifier_Language' => $vendorDir . '/ezyang/htmlpurifier/library/HTMLPurifier/Language.php', + 'HTMLPurifier_LanguageFactory' => $vendorDir . '/ezyang/htmlpurifier/library/HTMLPurifier/LanguageFactory.php', + 'HTMLPurifier_Language_en_x_test' => $vendorDir . '/ezyang/htmlpurifier/library/HTMLPurifier/Language/classes/en-x-test.php', + 'HTMLPurifier_Length' => $vendorDir . '/ezyang/htmlpurifier/library/HTMLPurifier/Length.php', + 'HTMLPurifier_Lexer' => $vendorDir . '/ezyang/htmlpurifier/library/HTMLPurifier/Lexer.php', + 'HTMLPurifier_Lexer_DOMLex' => $vendorDir . '/ezyang/htmlpurifier/library/HTMLPurifier/Lexer/DOMLex.php', + 'HTMLPurifier_Lexer_DirectLex' => $vendorDir . '/ezyang/htmlpurifier/library/HTMLPurifier/Lexer/DirectLex.php', + 'HTMLPurifier_Lexer_PH5P' => $vendorDir . '/ezyang/htmlpurifier/library/HTMLPurifier/Lexer/PH5P.php', + 'HTMLPurifier_Node' => $vendorDir . '/ezyang/htmlpurifier/library/HTMLPurifier/Node.php', + 'HTMLPurifier_Node_Comment' => $vendorDir . '/ezyang/htmlpurifier/library/HTMLPurifier/Node/Comment.php', + 'HTMLPurifier_Node_Element' => $vendorDir . '/ezyang/htmlpurifier/library/HTMLPurifier/Node/Element.php', + 'HTMLPurifier_Node_Text' => $vendorDir . '/ezyang/htmlpurifier/library/HTMLPurifier/Node/Text.php', + 'HTMLPurifier_PercentEncoder' => $vendorDir . '/ezyang/htmlpurifier/library/HTMLPurifier/PercentEncoder.php', + 'HTMLPurifier_Printer' => $vendorDir . '/ezyang/htmlpurifier/library/HTMLPurifier/Printer.php', + 'HTMLPurifier_Printer_CSSDefinition' => $vendorDir . '/ezyang/htmlpurifier/library/HTMLPurifier/Printer/CSSDefinition.php', + 'HTMLPurifier_Printer_ConfigForm' => $vendorDir . '/ezyang/htmlpurifier/library/HTMLPurifier/Printer/ConfigForm.php', + 'HTMLPurifier_Printer_ConfigForm_NullDecorator' => $vendorDir . '/ezyang/htmlpurifier/library/HTMLPurifier/Printer/ConfigForm.php', + 'HTMLPurifier_Printer_ConfigForm_bool' => $vendorDir . '/ezyang/htmlpurifier/library/HTMLPurifier/Printer/ConfigForm.php', + 'HTMLPurifier_Printer_ConfigForm_default' => $vendorDir . '/ezyang/htmlpurifier/library/HTMLPurifier/Printer/ConfigForm.php', + 'HTMLPurifier_Printer_HTMLDefinition' => $vendorDir . '/ezyang/htmlpurifier/library/HTMLPurifier/Printer/HTMLDefinition.php', + 'HTMLPurifier_PropertyList' => $vendorDir . '/ezyang/htmlpurifier/library/HTMLPurifier/PropertyList.php', + 'HTMLPurifier_PropertyListIterator' => $vendorDir . '/ezyang/htmlpurifier/library/HTMLPurifier/PropertyListIterator.php', + 'HTMLPurifier_Queue' => $vendorDir . '/ezyang/htmlpurifier/library/HTMLPurifier/Queue.php', + 'HTMLPurifier_Strategy' => $vendorDir . '/ezyang/htmlpurifier/library/HTMLPurifier/Strategy.php', + 'HTMLPurifier_Strategy_Composite' => $vendorDir . '/ezyang/htmlpurifier/library/HTMLPurifier/Strategy/Composite.php', + 'HTMLPurifier_Strategy_Core' => $vendorDir . '/ezyang/htmlpurifier/library/HTMLPurifier/Strategy/Core.php', + 'HTMLPurifier_Strategy_FixNesting' => $vendorDir . '/ezyang/htmlpurifier/library/HTMLPurifier/Strategy/FixNesting.php', + 'HTMLPurifier_Strategy_MakeWellFormed' => $vendorDir . '/ezyang/htmlpurifier/library/HTMLPurifier/Strategy/MakeWellFormed.php', + 'HTMLPurifier_Strategy_RemoveForeignElements' => $vendorDir . '/ezyang/htmlpurifier/library/HTMLPurifier/Strategy/RemoveForeignElements.php', + 'HTMLPurifier_Strategy_ValidateAttributes' => $vendorDir . '/ezyang/htmlpurifier/library/HTMLPurifier/Strategy/ValidateAttributes.php', + 'HTMLPurifier_StringHash' => $vendorDir . '/ezyang/htmlpurifier/library/HTMLPurifier/StringHash.php', + 'HTMLPurifier_StringHashParser' => $vendorDir . '/ezyang/htmlpurifier/library/HTMLPurifier/StringHashParser.php', + 'HTMLPurifier_TagTransform' => $vendorDir . '/ezyang/htmlpurifier/library/HTMLPurifier/TagTransform.php', + 'HTMLPurifier_TagTransform_Font' => $vendorDir . '/ezyang/htmlpurifier/library/HTMLPurifier/TagTransform/Font.php', + 'HTMLPurifier_TagTransform_Simple' => $vendorDir . '/ezyang/htmlpurifier/library/HTMLPurifier/TagTransform/Simple.php', + 'HTMLPurifier_Token' => $vendorDir . '/ezyang/htmlpurifier/library/HTMLPurifier/Token.php', + 'HTMLPurifier_TokenFactory' => $vendorDir . '/ezyang/htmlpurifier/library/HTMLPurifier/TokenFactory.php', + 'HTMLPurifier_Token_Comment' => $vendorDir . '/ezyang/htmlpurifier/library/HTMLPurifier/Token/Comment.php', + 'HTMLPurifier_Token_Empty' => $vendorDir . '/ezyang/htmlpurifier/library/HTMLPurifier/Token/Empty.php', + 'HTMLPurifier_Token_End' => $vendorDir . '/ezyang/htmlpurifier/library/HTMLPurifier/Token/End.php', + 'HTMLPurifier_Token_Start' => $vendorDir . '/ezyang/htmlpurifier/library/HTMLPurifier/Token/Start.php', + 'HTMLPurifier_Token_Tag' => $vendorDir . '/ezyang/htmlpurifier/library/HTMLPurifier/Token/Tag.php', + 'HTMLPurifier_Token_Text' => $vendorDir . '/ezyang/htmlpurifier/library/HTMLPurifier/Token/Text.php', + 'HTMLPurifier_URI' => $vendorDir . '/ezyang/htmlpurifier/library/HTMLPurifier/URI.php', + 'HTMLPurifier_URIDefinition' => $vendorDir . '/ezyang/htmlpurifier/library/HTMLPurifier/URIDefinition.php', + 'HTMLPurifier_URIFilter' => $vendorDir . '/ezyang/htmlpurifier/library/HTMLPurifier/URIFilter.php', + 'HTMLPurifier_URIFilter_DisableExternal' => $vendorDir . '/ezyang/htmlpurifier/library/HTMLPurifier/URIFilter/DisableExternal.php', + 'HTMLPurifier_URIFilter_DisableExternalResources' => $vendorDir . '/ezyang/htmlpurifier/library/HTMLPurifier/URIFilter/DisableExternalResources.php', + 'HTMLPurifier_URIFilter_DisableResources' => $vendorDir . '/ezyang/htmlpurifier/library/HTMLPurifier/URIFilter/DisableResources.php', + 'HTMLPurifier_URIFilter_HostBlacklist' => $vendorDir . '/ezyang/htmlpurifier/library/HTMLPurifier/URIFilter/HostBlacklist.php', + 'HTMLPurifier_URIFilter_MakeAbsolute' => $vendorDir . '/ezyang/htmlpurifier/library/HTMLPurifier/URIFilter/MakeAbsolute.php', + 'HTMLPurifier_URIFilter_Munge' => $vendorDir . '/ezyang/htmlpurifier/library/HTMLPurifier/URIFilter/Munge.php', + 'HTMLPurifier_URIFilter_SafeIframe' => $vendorDir . '/ezyang/htmlpurifier/library/HTMLPurifier/URIFilter/SafeIframe.php', + 'HTMLPurifier_URIParser' => $vendorDir . '/ezyang/htmlpurifier/library/HTMLPurifier/URIParser.php', + 'HTMLPurifier_URIScheme' => $vendorDir . '/ezyang/htmlpurifier/library/HTMLPurifier/URIScheme.php', + 'HTMLPurifier_URISchemeRegistry' => $vendorDir . '/ezyang/htmlpurifier/library/HTMLPurifier/URISchemeRegistry.php', + 'HTMLPurifier_URIScheme_data' => $vendorDir . '/ezyang/htmlpurifier/library/HTMLPurifier/URIScheme/data.php', + 'HTMLPurifier_URIScheme_file' => $vendorDir . '/ezyang/htmlpurifier/library/HTMLPurifier/URIScheme/file.php', + 'HTMLPurifier_URIScheme_ftp' => $vendorDir . '/ezyang/htmlpurifier/library/HTMLPurifier/URIScheme/ftp.php', + 'HTMLPurifier_URIScheme_http' => $vendorDir . '/ezyang/htmlpurifier/library/HTMLPurifier/URIScheme/http.php', + 'HTMLPurifier_URIScheme_https' => $vendorDir . '/ezyang/htmlpurifier/library/HTMLPurifier/URIScheme/https.php', + 'HTMLPurifier_URIScheme_mailto' => $vendorDir . '/ezyang/htmlpurifier/library/HTMLPurifier/URIScheme/mailto.php', + 'HTMLPurifier_URIScheme_news' => $vendorDir . '/ezyang/htmlpurifier/library/HTMLPurifier/URIScheme/news.php', + 'HTMLPurifier_URIScheme_nntp' => $vendorDir . '/ezyang/htmlpurifier/library/HTMLPurifier/URIScheme/nntp.php', + 'HTMLPurifier_UnitConverter' => $vendorDir . '/ezyang/htmlpurifier/library/HTMLPurifier/UnitConverter.php', + 'HTMLPurifier_VarParser' => $vendorDir . '/ezyang/htmlpurifier/library/HTMLPurifier/VarParser.php', + 'HTMLPurifier_VarParserException' => $vendorDir . '/ezyang/htmlpurifier/library/HTMLPurifier/VarParserException.php', + 'HTMLPurifier_VarParser_Flexible' => $vendorDir . '/ezyang/htmlpurifier/library/HTMLPurifier/VarParser/Flexible.php', + 'HTMLPurifier_VarParser_Native' => $vendorDir . '/ezyang/htmlpurifier/library/HTMLPurifier/VarParser/Native.php', + 'HTMLPurifier_Zipper' => $vendorDir . '/ezyang/htmlpurifier/library/HTMLPurifier/Zipper.php', + 'MatthiasMullie\\Minify\\CSS' => $vendorDir . '/matthiasmullie/minify/src/CSS.php', + 'MatthiasMullie\\Minify\\Exception' => $vendorDir . '/matthiasmullie/minify/src/Exception.php', + 'MatthiasMullie\\Minify\\JS' => $vendorDir . '/matthiasmullie/minify/src/JS.php', + 'MatthiasMullie\\Minify\\Minify' => $vendorDir . '/matthiasmullie/minify/src/Minify.php', + 'MatthiasMullie\\PathConverter\\Converter' => $vendorDir . '/matthiasmullie/path-converter/src/Converter.php', + 'Michelf\\Markdown' => $vendorDir . '/michelf/php-markdown/Michelf/Markdown.php', + 'Michelf\\MarkdownExtra' => $vendorDir . '/michelf/php-markdown/Michelf/MarkdownExtra.php', + 'Michelf\\MarkdownInterface' => $vendorDir . '/michelf/php-markdown/Michelf/MarkdownInterface.php', + 'Requests' => $vendorDir . '/rmccue/requests/library/Requests.php', + 'Requests_Auth' => $vendorDir . '/rmccue/requests/library/Requests/Auth.php', + 'Requests_Auth_Basic' => $vendorDir . '/rmccue/requests/library/Requests/Auth/Basic.php', + 'Requests_Cookie' => $vendorDir . '/rmccue/requests/library/Requests/Cookie.php', + 'Requests_Cookie_Jar' => $vendorDir . '/rmccue/requests/library/Requests/Cookie/Jar.php', + 'Requests_Exception' => $vendorDir . '/rmccue/requests/library/Requests/Exception.php', + 'Requests_Exception_HTTP' => $vendorDir . '/rmccue/requests/library/Requests/Exception/HTTP.php', + 'Requests_Exception_HTTP_400' => $vendorDir . '/rmccue/requests/library/Requests/Exception/HTTP/400.php', + 'Requests_Exception_HTTP_401' => $vendorDir . '/rmccue/requests/library/Requests/Exception/HTTP/401.php', + 'Requests_Exception_HTTP_402' => $vendorDir . '/rmccue/requests/library/Requests/Exception/HTTP/402.php', + 'Requests_Exception_HTTP_403' => $vendorDir . '/rmccue/requests/library/Requests/Exception/HTTP/403.php', + 'Requests_Exception_HTTP_404' => $vendorDir . '/rmccue/requests/library/Requests/Exception/HTTP/404.php', + 'Requests_Exception_HTTP_405' => $vendorDir . '/rmccue/requests/library/Requests/Exception/HTTP/405.php', + 'Requests_Exception_HTTP_406' => $vendorDir . '/rmccue/requests/library/Requests/Exception/HTTP/406.php', + 'Requests_Exception_HTTP_407' => $vendorDir . '/rmccue/requests/library/Requests/Exception/HTTP/407.php', + 'Requests_Exception_HTTP_408' => $vendorDir . '/rmccue/requests/library/Requests/Exception/HTTP/408.php', + 'Requests_Exception_HTTP_409' => $vendorDir . '/rmccue/requests/library/Requests/Exception/HTTP/409.php', + 'Requests_Exception_HTTP_410' => $vendorDir . '/rmccue/requests/library/Requests/Exception/HTTP/410.php', + 'Requests_Exception_HTTP_411' => $vendorDir . '/rmccue/requests/library/Requests/Exception/HTTP/411.php', + 'Requests_Exception_HTTP_412' => $vendorDir . '/rmccue/requests/library/Requests/Exception/HTTP/412.php', + 'Requests_Exception_HTTP_413' => $vendorDir . '/rmccue/requests/library/Requests/Exception/HTTP/413.php', + 'Requests_Exception_HTTP_414' => $vendorDir . '/rmccue/requests/library/Requests/Exception/HTTP/414.php', + 'Requests_Exception_HTTP_415' => $vendorDir . '/rmccue/requests/library/Requests/Exception/HTTP/415.php', + 'Requests_Exception_HTTP_416' => $vendorDir . '/rmccue/requests/library/Requests/Exception/HTTP/416.php', + 'Requests_Exception_HTTP_417' => $vendorDir . '/rmccue/requests/library/Requests/Exception/HTTP/417.php', + 'Requests_Exception_HTTP_418' => $vendorDir . '/rmccue/requests/library/Requests/Exception/HTTP/418.php', + 'Requests_Exception_HTTP_428' => $vendorDir . '/rmccue/requests/library/Requests/Exception/HTTP/428.php', + 'Requests_Exception_HTTP_429' => $vendorDir . '/rmccue/requests/library/Requests/Exception/HTTP/429.php', + 'Requests_Exception_HTTP_431' => $vendorDir . '/rmccue/requests/library/Requests/Exception/HTTP/431.php', + 'Requests_Exception_HTTP_500' => $vendorDir . '/rmccue/requests/library/Requests/Exception/HTTP/500.php', + 'Requests_Exception_HTTP_501' => $vendorDir . '/rmccue/requests/library/Requests/Exception/HTTP/501.php', + 'Requests_Exception_HTTP_502' => $vendorDir . '/rmccue/requests/library/Requests/Exception/HTTP/502.php', + 'Requests_Exception_HTTP_503' => $vendorDir . '/rmccue/requests/library/Requests/Exception/HTTP/503.php', + 'Requests_Exception_HTTP_504' => $vendorDir . '/rmccue/requests/library/Requests/Exception/HTTP/504.php', + 'Requests_Exception_HTTP_505' => $vendorDir . '/rmccue/requests/library/Requests/Exception/HTTP/505.php', + 'Requests_Exception_HTTP_511' => $vendorDir . '/rmccue/requests/library/Requests/Exception/HTTP/511.php', + 'Requests_Exception_HTTP_Unknown' => $vendorDir . '/rmccue/requests/library/Requests/Exception/HTTP/Unknown.php', + 'Requests_Hooker' => $vendorDir . '/rmccue/requests/library/Requests/Hooker.php', + 'Requests_Hooks' => $vendorDir . '/rmccue/requests/library/Requests/Hooks.php', + 'Requests_IDNAEncoder' => $vendorDir . '/rmccue/requests/library/Requests/IDNAEncoder.php', + 'Requests_IPv6' => $vendorDir . '/rmccue/requests/library/Requests/IPv6.php', + 'Requests_IRI' => $vendorDir . '/rmccue/requests/library/Requests/IRI.php', + 'Requests_Proxy' => $vendorDir . '/rmccue/requests/library/Requests/Proxy.php', + 'Requests_Proxy_HTTP' => $vendorDir . '/rmccue/requests/library/Requests/Proxy/HTTP.php', + 'Requests_Response' => $vendorDir . '/rmccue/requests/library/Requests/Response.php', + 'Requests_Response_Headers' => $vendorDir . '/rmccue/requests/library/Requests/Response/Headers.php', + 'Requests_SSL' => $vendorDir . '/rmccue/requests/library/Requests/SSL.php', + 'Requests_Session' => $vendorDir . '/rmccue/requests/library/Requests/Session.php', + 'Requests_Transport' => $vendorDir . '/rmccue/requests/library/Requests/Transport.php', + 'Requests_Transport_cURL' => $vendorDir . '/rmccue/requests/library/Requests/Transport/cURL.php', + 'Requests_Transport_fsockopen' => $vendorDir . '/rmccue/requests/library/Requests/Transport/fsockopen.php', + 'Requests_Utility_CaseInsensitiveDictionary' => $vendorDir . '/rmccue/requests/library/Requests/Utility/CaseInsensitiveDictionary.php', + 'Requests_Utility_FilteredIterator' => $vendorDir . '/rmccue/requests/library/Requests/Utility/FilteredIterator.php', + 'Sunra\\PhpSimple\\HtmlDomParser' => $vendorDir . '/sunra/php-simple-html-dom-parser/Src/Sunra/PhpSimple/HtmlDomParser.php', +); diff --git a/vendor/composer/autoload_files.php b/vendor/composer/autoload_files.php new file mode 100644 index 000000000..460d3107e --- /dev/null +++ b/vendor/composer/autoload_files.php @@ -0,0 +1,11 @@ + $vendorDir . '/defuse/php-encryption/Crypto.php', + '2cffec82183ee1cea088009cef9a6fc3' => $vendorDir . '/ezyang/htmlpurifier/library/HTMLPurifier.composer.php', +); diff --git a/vendor/composer/autoload_namespaces.php b/vendor/composer/autoload_namespaces.php new file mode 100644 index 000000000..0ba8d72dc --- /dev/null +++ b/vendor/composer/autoload_namespaces.php @@ -0,0 +1,13 @@ + array($vendorDir . '/sunra/php-simple-html-dom-parser/Src'), + 'Requests' => array($vendorDir . '/rmccue/requests/library'), + 'Michelf' => array($vendorDir . '/michelf/php-markdown'), + 'HTMLPurifier' => array($vendorDir . '/ezyang/htmlpurifier/library'), +); diff --git a/vendor/composer/autoload_psr4.php b/vendor/composer/autoload_psr4.php new file mode 100644 index 000000000..b7014d645 --- /dev/null +++ b/vendor/composer/autoload_psr4.php @@ -0,0 +1,11 @@ + array($vendorDir . '/matthiasmullie/path-converter/src'), + 'MatthiasMullie\\Minify\\' => array($vendorDir . '/matthiasmullie/minify/src'), +); diff --git a/vendor/composer/autoload_real.php b/vendor/composer/autoload_real.php new file mode 100644 index 000000000..d8899d992 --- /dev/null +++ b/vendor/composer/autoload_real.php @@ -0,0 +1,59 @@ + $path) { + $loader->set($namespace, $path); + } + + $map = require __DIR__ . '/autoload_psr4.php'; + foreach ($map as $namespace => $path) { + $loader->setPsr4($namespace, $path); + } + + $classMap = require __DIR__ . '/autoload_classmap.php'; + if ($classMap) { + $loader->addClassMap($classMap); + } + + $loader->register(true); + + $includeFiles = require __DIR__ . '/autoload_files.php'; + foreach ($includeFiles as $fileIdentifier => $file) { + composerRequire1e37ff09eb6590c7436f139ffd9070de($fileIdentifier, $file); + } + + return $loader; + } +} + +function composerRequire1e37ff09eb6590c7436f139ffd9070de($fileIdentifier, $file) +{ + if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) { + require $file; + + $GLOBALS['__composer_autoload_files'][$fileIdentifier] = true; + } +} diff --git a/vendor/composer/installed.json b/vendor/composer/installed.json new file mode 100644 index 000000000..ff3f05c5b --- /dev/null +++ b/vendor/composer/installed.json @@ -0,0 +1,355 @@ +[ + { + "name": "defuse/php-encryption", + "version": "v1.2.1", + "version_normalized": "1.2.1.0", + "source": { + "type": "git", + "url": "https://github.com/defuse/php-encryption.git", + "reference": "b87737b2eec06b13f025cabea847338fa203d1b4" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/defuse/php-encryption/zipball/b87737b2eec06b13f025cabea847338fa203d1b4", + "reference": "b87737b2eec06b13f025cabea847338fa203d1b4", + "shasum": "" + }, + "require": { + "ext-mcrypt": "*", + "ext-openssl": "*", + "php": ">=5.4.0" + }, + "time": "2015-03-14 20:27:45", + "type": "library", + "installation-source": "dist", + "autoload": { + "files": [ + "Crypto.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Taylor Hornby", + "email": "havoc@defuse.ca" + } + ], + "description": "Secure PHP Encryption Library", + "keywords": [ + "aes", + "cipher", + "encryption", + "mcrypt", + "security" + ] + }, + { + "name": "ezyang/htmlpurifier", + "version": "v4.7.0", + "version_normalized": "4.7.0.0", + "source": { + "type": "git", + "url": "https://github.com/ezyang/htmlpurifier.git", + "reference": "ae1828d955112356f7677c465f94f7deb7d27a40" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/ezyang/htmlpurifier/zipball/ae1828d955112356f7677c465f94f7deb7d27a40", + "reference": "ae1828d955112356f7677c465f94f7deb7d27a40", + "shasum": "" + }, + "require": { + "php": ">=5.2" + }, + "time": "2015-08-05 01:03:42", + "type": "library", + "installation-source": "dist", + "autoload": { + "psr-0": { + "HTMLPurifier": "library/" + }, + "files": [ + "library/HTMLPurifier.composer.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "LGPL" + ], + "authors": [ + { + "name": "Edward Z. Yang", + "email": "admin@htmlpurifier.org", + "homepage": "http://ezyang.com" + } + ], + "description": "Standards compliant HTML filter written in PHP", + "homepage": "http://htmlpurifier.org/", + "keywords": [ + "html" + ] + }, + { + "name": "michelf/php-markdown", + "version": "1.5.0", + "version_normalized": "1.5.0.0", + "source": { + "type": "git", + "url": "https://github.com/michelf/php-markdown.git", + "reference": "e1aabe18173231ebcefc90e615565742fc1c7fd9" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/michelf/php-markdown/zipball/e1aabe18173231ebcefc90e615565742fc1c7fd9", + "reference": "e1aabe18173231ebcefc90e615565742fc1c7fd9", + "shasum": "" + }, + "require": { + "php": ">=5.3.0" + }, + "time": "2015-03-01 12:03:08", + "type": "library", + "extra": { + "branch-alias": { + "dev-lib": "1.4.x-dev" + } + }, + "installation-source": "dist", + "autoload": { + "psr-0": { + "Michelf": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "John Gruber", + "homepage": "http://daringfireball.net/" + }, + { + "name": "Michel Fortin", + "email": "michel.fortin@michelf.ca", + "homepage": "https://michelf.ca/", + "role": "Developer" + } + ], + "description": "PHP Markdown", + "homepage": "https://michelf.ca/projects/php-markdown/", + "keywords": [ + "markdown" + ] + }, + { + "name": "sunra/php-simple-html-dom-parser", + "version": "v1.5.0", + "version_normalized": "1.5.0.0", + "source": { + "type": "git", + "url": "https://github.com/sunra/php-simple-html-dom-parser.git", + "reference": "a0b80ace086c7e09085669205e1b3c2c9c7a453c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sunra/php-simple-html-dom-parser/zipball/a0b80ace086c7e09085669205e1b3c2c9c7a453c", + "reference": "a0b80ace086c7e09085669205e1b3c2c9c7a453c", + "shasum": "" + }, + "require": { + "php": ">=5.3.2" + }, + "time": "2013-05-04 14:32:03", + "type": "library", + "installation-source": "dist", + "autoload": { + "psr-0": { + "Sunra\\PhpSimple\\HtmlDomParser": "Src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "sunra", + "email": "sunra@yandex.ru", + "homepage": "http://github.com/sunra" + } + ], + "description": "Composer adaptation of: A HTML DOM parser written in PHP5+ let you manipulate HTML in a very easy way! Require PHP 5+. Supports invalid HTML. Find tags on an HTML page with selectors just like jQuery. Extract contents from HTML in a single line.", + "homepage": "https://github.com/sunra/php-simple-html-dom-parser", + "keywords": [ + "dom", + "html", + "parser" + ] + }, + { + "name": "matthiasmullie/path-converter", + "version": "1.0.6", + "version_normalized": "1.0.6.0", + "source": { + "type": "git", + "url": "https://github.com/matthiasmullie/path-converter.git", + "reference": "9f83d0c398dbe70f45f5840d95ffad73d5efd35f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/matthiasmullie/path-converter/zipball/9f83d0c398dbe70f45f5840d95ffad73d5efd35f", + "reference": "9f83d0c398dbe70f45f5840d95ffad73d5efd35f", + "shasum": "" + }, + "require": { + "ext-pcre": "*", + "php": ">=5.3.0" + }, + "require-dev": { + "phpunit/phpunit": "~4.8", + "satooshi/php-coveralls": "~1.0" + }, + "time": "2016-01-05 07:45:30", + "type": "library", + "installation-source": "dist", + "autoload": { + "psr-4": { + "MatthiasMullie\\PathConverter\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Matthias Mullie", + "email": "pathconverter@mullie.eu", + "homepage": "http://www.mullie.eu", + "role": "Developer" + } + ], + "description": "Relative path converter", + "homepage": "http://github.com/matthiasmullie/path-converter", + "keywords": [ + "converter", + "path", + "paths", + "relative" + ] + }, + { + "name": "matthiasmullie/minify", + "version": "1.3.30", + "version_normalized": "1.3.30.0", + "source": { + "type": "git", + "url": "https://github.com/matthiasmullie/minify.git", + "reference": "0cd5108683e7376e795555ced56229c4c16597aa" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/matthiasmullie/minify/zipball/0cd5108683e7376e795555ced56229c4c16597aa", + "reference": "0cd5108683e7376e795555ced56229c4c16597aa", + "shasum": "" + }, + "require": { + "ext-pcre": "*", + "matthiasmullie/path-converter": "~1.0", + "php": ">=5.3.0" + }, + "require-dev": { + "matthiasmullie/scrapbook": "~1.0", + "phpunit/phpunit": "~4.8", + "satooshi/php-coveralls": "~1.0" + }, + "time": "2016-01-05 07:43:18", + "bin": [ + "bin/minifycss", + "bin/minifyjs" + ], + "type": "library", + "installation-source": "dist", + "autoload": { + "psr-4": { + "MatthiasMullie\\Minify\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Matthias Mullie", + "email": "minify@mullie.eu", + "homepage": "http://www.mullie.eu", + "role": "Developer" + } + ], + "description": "CSS & JS minifier", + "homepage": "http://www.minifier.org", + "keywords": [ + "JS", + "css", + "javascript", + "minifier", + "minify" + ] + }, + { + "name": "rmccue/requests", + "version": "v1.6.1", + "version_normalized": "1.6.1.0", + "source": { + "type": "git", + "url": "https://github.com/rmccue/Requests.git", + "reference": "6aac485666c2955077d77b796bbdd25f0013a4ea" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/rmccue/Requests/zipball/6aac485666c2955077d77b796bbdd25f0013a4ea", + "reference": "6aac485666c2955077d77b796bbdd25f0013a4ea", + "shasum": "" + }, + "require": { + "php": ">=5.2" + }, + "require-dev": { + "satooshi/php-coveralls": "dev-master" + }, + "time": "2014-05-18 04:59:02", + "type": "library", + "installation-source": "dist", + "autoload": { + "psr-0": { + "Requests": "library/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "ISC" + ], + "authors": [ + { + "name": "Ryan McCue", + "homepage": "http://ryanmccue.info" + } + ], + "description": "A HTTP library written in PHP, for human beings.", + "homepage": "http://github.com/rmccue/Requests", + "keywords": [ + "curl", + "fsockopen", + "http", + "idna", + "ipv6", + "iri", + "sockets" + ] + } +] diff --git a/vendor/defuse/php-encryption/.travis.yml b/vendor/defuse/php-encryption/.travis.yml new file mode 100644 index 000000000..20ec31c20 --- /dev/null +++ b/vendor/defuse/php-encryption/.travis.yml @@ -0,0 +1,22 @@ +language: php +php: + - "5.6" + - "5.5" + - "5.4" + - "5.3" + - "5.2" +# Versions below here are not installed on travis-ci +# - "5.1" +# - "5.0" +# - "4.4" +# - "4.3" +# - "4.2" +# - "4.1" +# - "4.0" + +matrix: + allow_failures: + - php: "5.3" + - php: "5.2" + +script: ./test.sh diff --git a/vendor/defuse/php-encryption/Crypto.php b/vendor/defuse/php-encryption/Crypto.php new file mode 100755 index 000000000..60b5a62cc --- /dev/null +++ b/vendor/defuse/php-encryption/Crypto.php @@ -0,0 +1,677 @@ + 255 * $digest_length) { + throw new CannotPerformOperationException(); + } + + // "if [salt] not provided, is set to a string of HashLen zeroes." + if (is_null($salt)) { + $salt = str_repeat("\x00", $digest_length); + } + + // HKDF-Extract: + // PRK = HMAC-Hash(salt, IKM) + // The salt is the HMAC key. + $prk = hash_hmac($hash, $ikm, $salt, true); + + // HKDF-Expand: + + // This check is useless, but it serves as a reminder to the spec. + if (self::our_strlen($prk) < $digest_length) { + throw new CannotPerformOperationException(); + } + + // T(0) = '' + $t = ''; + $last_block = ''; + for ($block_index = 1; self::our_strlen($t) < $length; $block_index++) { + // T(i) = HMAC-Hash(PRK, T(i-1) | info | 0x??) + $last_block = hash_hmac( + $hash, + $last_block . $info . chr($block_index), + $prk, + true + ); + // T = T(1) | T(2) | T(3) | ... | T(N) + $t .= $last_block; + } + + // ORM = first L octets of T + $orm = self::our_substr($t, 0, $length); + if ($orm === FALSE) { + throw new CannotPerformOperationException(); + } + return $orm; + } + + private static function VerifyHMAC($correct_hmac, $message, $key) + { + $message_hmac = hash_hmac(self::HASH_FUNCTION, $message, $key, true); + + // We can't just compare the strings with '==', since it would make + // timing attacks possible. We could use the XOR-OR constant-time + // comparison algorithm, but I'm not sure if that's good enough way up + // here in an interpreted language. So we use the method of HMACing the + // strings we want to compare with a random key, then comparing those. + + // NOTE: This leaks information when the strings are not the same + // length, but they should always be the same length here. Enforce it: + if (self::our_strlen($correct_hmac) !== self::our_strlen($message_hmac)) { + throw new CannotPerformOperationException(); + } + + $blind = self::CreateNewRandomKey(); + $message_compare = hash_hmac(self::HASH_FUNCTION, $message_hmac, $blind); + $correct_compare = hash_hmac(self::HASH_FUNCTION, $correct_hmac, $blind); + return $correct_compare === $message_compare; + } + + private static function TestEncryptDecrypt() + { + $key = self::CreateNewRandomKey(); + $data = "EnCrYpT EvErYThInG\x00\x00"; + + // Make sure encrypting then decrypting doesn't change the message. + $ciphertext = self::Encrypt($data, $key); + try { + $decrypted = self::Decrypt($ciphertext, $key); + } catch (InvalidCiphertextException $ex) { + // It's important to catch this and change it into a + // CryptoTestFailedException, otherwise a test failure could trick + // the user into thinking it's just an invalid ciphertext! + throw new CryptoTestFailedException(); + } + if($decrypted !== $data) + { + throw new CryptoTestFailedException(); + } + + // Modifying the ciphertext: Appending a string. + try { + self::Decrypt($ciphertext . "a", $key); + throw new CryptoTestFailedException(); + } catch (InvalidCiphertextException $e) { /* expected */ } + + // Modifying the ciphertext: Changing an IV byte. + try { + $ciphertext[0] = chr((ord($ciphertext[0]) + 1) % 256); + self::Decrypt($ciphertext, $key); + throw new CryptoTestFailedException(); + } catch (InvalidCiphertextException $e) { /* expected */ } + + // Decrypting with the wrong key. + $key = self::CreateNewRandomKey(); + $data = "abcdef"; + $ciphertext = self::Encrypt($data, $key); + $wrong_key = self::CreateNewRandomKey(); + try { + self::Decrypt($ciphertext, $wrong_key); + throw new CryptoTestFailedException(); + } catch (InvalidCiphertextException $e) { /* expected */ } + + // Ciphertext too small (shorter than HMAC). + $key = self::CreateNewRandomKey(); + $ciphertext = str_repeat("A", self::MAC_BYTE_SIZE - 1); + try { + self::Decrypt($ciphertext, $key); + throw new CryptoTestFailedException(); + } catch (InvalidCiphertextException $e) { /* expected */ } + } + + private static function HKDFTestVector() + { + // HKDF test vectors from RFC 5869 + + // Test Case 1 + $ikm = str_repeat("\x0b", 22); + $salt = self::hexToBytes("000102030405060708090a0b0c"); + $info = self::hexToBytes("f0f1f2f3f4f5f6f7f8f9"); + $length = 42; + $okm = self::hexToBytes( + "3cb25f25faacd57a90434f64d0362f2a" . + "2d2d0a90cf1a5a4c5db02d56ecc4c5bf" . + "34007208d5b887185865" + ); + $computed_okm = self::HKDF("sha256", $ikm, $length, $info, $salt); + if ($computed_okm !== $okm) { + throw new CryptoTestFailedException(); + } + + // Test Case 7 + $ikm = str_repeat("\x0c", 22); + $length = 42; + $okm = self::hexToBytes( + "2c91117204d745f3500d636a62f64f0a" . + "b3bae548aa53d423b0d1f27ebba6f5e5" . + "673a081d70cce7acfc48" + ); + $computed_okm = self::HKDF("sha1", $ikm, $length); + if ($computed_okm !== $okm) { + throw new CryptoTestFailedException(); + } + + } + + private static function HMACTestVector() + { + // HMAC test vector From RFC 4231 (Test Case 1) + $key = str_repeat("\x0b", 20); + $data = "Hi There"; + $correct = "b0344c61d8db38535ca8afceaf0bf12b881dc200c9833da726e9376c2e32cff7"; + if (hash_hmac(self::HASH_FUNCTION, $data, $key) != $correct) { + throw new CryptoTestFailedException(); + } + } + + private static function AESTestVector() + { + // AES CBC mode test vector from NIST SP 800-38A + $key = self::hexToBytes("2b7e151628aed2a6abf7158809cf4f3c"); + $iv = self::hexToBytes("000102030405060708090a0b0c0d0e0f"); + $plaintext = self::hexToBytes( + "6bc1bee22e409f96e93d7e117393172a" . + "ae2d8a571e03ac9c9eb76fac45af8e51" . + "30c81c46a35ce411e5fbc1191a0a52ef" . + "f69f2445df4f9b17ad2b417be66c3710" + ); + $ciphertext = self::hexToBytes( + "7649abac8119b246cee98e9b12e9197d" . + "5086cb9b507219ee95db113a917678b2" . + "73bed6b8e3c1743b7116e69e22229516" . + "3ff1caa1681fac09120eca307586e1a7" . + /* Block due to padding. Not from NIST test vector. + Padding Block: 10101010101010101010101010101010 + Ciphertext: 3ff1caa1681fac09120eca307586e1a7 + (+) 2fe1dab1780fbc19021eda206596f1b7 + AES 8cb82807230e1321d3fae00d18cc2012 + + */ + "8cb82807230e1321d3fae00d18cc2012" + ); + + $computed_ciphertext = self::PlainEncrypt($plaintext, $key, $iv); + if ($computed_ciphertext !== $ciphertext) { + throw new CryptoTestFailedException(); + } + + $computed_plaintext = self::PlainDecrypt($ciphertext, $key, $iv); + if ($computed_plaintext !== $plaintext) { + throw new CryptoTestFailedException(); + } + } + + /* WARNING: Do not call this function on secrets. It creates side channels. */ + private static function hexToBytes($hex_string) + { + return pack("H*", $hex_string); + } + + private static function EnsureConstantExists($name) + { + if (!defined($name)) { + throw new CannotPerformOperationException(); + } + } + + private static function EnsureFunctionExists($name) + { + if (!function_exists($name)) { + throw new CannotPerformOperationException(); + } + } + + /* + * We need these strlen() and substr() functions because when + * 'mbstring.func_overload' is set in php.ini, the standard strlen() and + * substr() are replaced by mb_strlen() and mb_substr(). + */ + + private static function our_strlen($str) + { + if (function_exists('mb_strlen')) { + $length = mb_strlen($str, '8bit'); + if ($length === FALSE) { + throw new CannotPerformOperationException(); + } + return $length; + } else { + return strlen($str); + } + } + + private static function our_substr($str, $start, $length = NULL) + { + if (function_exists('mb_substr')) + { + // mb_substr($str, 0, NULL, '8bit') returns an empty string on PHP + // 5.3, so we have to find the length ourselves. + if (!isset($length)) { + if ($start >= 0) { + $length = self::our_strlen($str) - $start; + } else { + $length = -$start; + } + } + + return mb_substr($str, $start, $length, '8bit'); + } + + // Unlike mb_substr(), substr() doesn't accept NULL for length + if (isset($length)) { + return substr($str, $start, $length); + } else { + return substr($str, $start); + } + } + +} + +/* + * We want to catch all uncaught exceptions that come from the Crypto class, + * since by default, PHP will leak the key in the stack trace from an uncaught + * exception. This is a really ugly hack, but I think it's justified. + * + * Everything up to handler() getting called should be reliable, so this should + * reliably suppress the stack traces. The rest is just a bonus so that we don't + * make it impossible to debug other exceptions. + * + * This bit of code was adapted from: http://stackoverflow.com/a/7939492 + */ + +class CryptoExceptionHandler +{ + private $rethrow = NULL; + + public function __construct() + { + set_exception_handler(array($this, "handler")); + } + + public function handler($ex) + { + if ( + $ex instanceof InvalidCiphertextException || + $ex instanceof CannotPerformOperationException || + $ex instanceof CryptoTestFailedException + ) { + echo "FATAL ERROR: Uncaught crypto exception. Suppresssing output.\n"; + } else { + /* Re-throw the exception in the destructor. */ + $this->rethrow = $ex; + } + } + + public function __destruct() { + if ($this->rethrow) { + throw $this->rethrow; + } + } +} + +$crypto_exception_handler_object_dont_touch_me = new CryptoExceptionHandler(); + diff --git a/vendor/defuse/php-encryption/README.md b/vendor/defuse/php-encryption/README.md new file mode 100644 index 000000000..292ecf957 --- /dev/null +++ b/vendor/defuse/php-encryption/README.md @@ -0,0 +1,79 @@ +php-encryption +=============== + +This is a class for doing symmetric encryption in PHP. **Requires PHP 5.4 or newer.** + +[![Build Status](https://travis-ci.org/defuse/php-encryption.svg?branch=master)](https://travis-ci.org/defuse/php-encryption) + +Implementation +-------------- + +Messages are encrypted with AES-128 in CBC mode and are authenticated with +HMAC-SHA256 (Encrypt-then-Mac). PKCS7 padding is used to pad the message to +a multiple of the block size. HKDF is used to split the user-provided key into +two keys: one for encryption, and the other for authentication. It is +implemented using the `openssl_` and `hash_hmac` functions. + +Warning +-------- + +This is new code, and it hasn't received much review by experts. I have spent +many hours making it as secure as possible (extensive runtime tests, secure +coding practices), and auditing it for problems, but I may have missed some +issues. So be careful. Don't trust it with your life. Check out the open GitHub +issues for a list of known issues. If you find a problem with this library, +please report it by opening a GitHub issue. + +That said, you're probably much better off using this library than any other +encryption library written in PHP. + +Philosophy +----------- + +This library was created after noticing how much insecure PHP encryption code +there is. I once did a Google search for "php encryption" and found insecure +code or advice on 9 of the top 10 results. + +Encryption is becoming an essential component of modern websites. This library +aims to fulfil a subset of that need: Authenticated symmetric encryption of +short strings, given a random key. + +This library is developed around several core values: + +- Rule #1: Security is prioritized over everything else. + + > Whenever there is a conflict between security and some other property, + > security will be favored. For example, the library has runtime tests, + > which make it slower, but will hopefully stop it from encrypting stuff + > if the platform it's running on is broken. + +- Rule #2: It should be difficult to misuse the library. + + > We assume the developers using this library have no experience with + > cryptography. We only assume that they know that the "key" is something + > you need to encrypt and decrypt the messages, and that it must be + > protected. Whenever possible, the library should refuse to encrypt or + > decrypt messages when it is not being used correctly. + +- Rule #3: The library aims only to be compatible with itself. + + > Other PHP encryption libraries try to support every possible type of + > encryption, even the insecure ones (e.g. ECB mode). Because there are so + > many options, inexperienced developers must make decisions between + > things like "CBC" mode and "ECB" mode, knowing nothing about either one, + > which inevitably creates vulnerabilities. + + > This library will only support one secure mode. A developer using this + > library will call "encrypt" and "decrypt" not caring about how they are + > implemented. + +- Rule #4: The library should consist of a single PHP file and nothing more. + + > Some PHP encryption libraries, like libsodium-php [1], are not + > straightforward to install and cannot packaged with "just download and + > extract" applications. This library will always be just one PHP file + > that you can put in your source tree and require(). + +References: + + [1] https://github.com/jedisct1/libsodium-php diff --git a/vendor/defuse/php-encryption/benchmark.php b/vendor/defuse/php-encryption/benchmark.php new file mode 100644 index 000000000..3da61a628 --- /dev/null +++ b/vendor/defuse/php-encryption/benchmark.php @@ -0,0 +1,42 @@ + diff --git a/vendor/defuse/php-encryption/composer.json b/vendor/defuse/php-encryption/composer.json new file mode 100644 index 000000000..6856b9c72 --- /dev/null +++ b/vendor/defuse/php-encryption/composer.json @@ -0,0 +1,20 @@ +{ + "name": "defuse/php-encryption", + "description": "Secure PHP Encryption Library", + "license": "MIT", + "keywords": ["security", "encryption", "AES", "mcrypt", "cipher"], + "authors": [ + { + "name": "Taylor Hornby", + "email": "havoc@defuse.ca" + } + ], + "autoload": { + "files": ["Crypto.php"] + }, + "require": { + "php": ">=5.4.0", + "ext-openssl": "*", + "ext-mcrypt": "*" + } +} diff --git a/vendor/defuse/php-encryption/example.php b/vendor/defuse/php-encryption/example.php new file mode 100644 index 000000000..10e73f915 --- /dev/null +++ b/vendor/defuse/php-encryption/example.php @@ -0,0 +1,36 @@ + diff --git a/vendor/defuse/php-encryption/test.sh b/vendor/defuse/php-encryption/test.sh new file mode 100755 index 000000000..d1691e7c6 --- /dev/null +++ b/vendor/defuse/php-encryption/test.sh @@ -0,0 +1,30 @@ +#!/bin/bash + +echo "Normal" +echo "--------------------------------------------------" +php -d mbstring.func_overload=0 tests/runtime.php +if [ $? -ne 0 ]; then + echo "FAIL." + exit 1 +fi +echo "--------------------------------------------------" + +echo "" + +echo "Multibyte" +echo "--------------------------------------------------" +php -d mbstring.func_overload=7 tests/runtime.php +if [ $? -ne 0 ]; then + echo "FAIL." + exit 1 +fi +echo "--------------------------------------------------" + +echo "" + +if [ -z "$(php Crypto.php)" ]; then + echo "PASS: Crypto.php output is empty." +else + echo "FAIL: Crypto.php output is not empty." + exit 1 +fi diff --git a/vendor/defuse/php-encryption/tests/runtime.php b/vendor/defuse/php-encryption/tests/runtime.php new file mode 100644 index 000000000..76565c58e --- /dev/null +++ b/vendor/defuse/php-encryption/tests/runtime.php @@ -0,0 +1,32 @@ + diff --git a/classes/security/htmlpurifier/CREDITS b/vendor/ezyang/htmlpurifier/CREDITS similarity index 100% rename from classes/security/htmlpurifier/CREDITS rename to vendor/ezyang/htmlpurifier/CREDITS diff --git a/vendor/ezyang/htmlpurifier/INSTALL b/vendor/ezyang/htmlpurifier/INSTALL new file mode 100644 index 000000000..677c04aa0 --- /dev/null +++ b/vendor/ezyang/htmlpurifier/INSTALL @@ -0,0 +1,374 @@ + +Install + How to install HTML Purifier + +HTML Purifier is designed to run out of the box, so actually using the +library is extremely easy. (Although... if you were looking for a +step-by-step installation GUI, you've downloaded the wrong software!) + +While the impatient can get going immediately with some of the sample +code at the bottom of this library, it's well worth reading this entire +document--most of the other documentation assumes that you are familiar +with these contents. + + +--------------------------------------------------------------------------- +1. Compatibility + +HTML Purifier is PHP 5 only, and is actively tested from PHP 5.0.5 and +up. It has no core dependencies with other libraries. PHP +4 support was deprecated on December 31, 2007 with HTML Purifier 3.0.0. +HTML Purifier is not compatible with zend.ze1_compatibility_mode. + +These optional extensions can enhance the capabilities of HTML Purifier: + + * iconv : Converts text to and from non-UTF-8 encodings + * bcmath : Used for unit conversion and imagecrash protection + * tidy : Used for pretty-printing HTML + +These optional libraries can enhance the capabilities of HTML Purifier: + + * CSSTidy : Clean CSS stylesheets using %Core.ExtractStyleBlocks + * Net_IDNA2 (PEAR) : IRI support using %Core.EnableIDNA + +--------------------------------------------------------------------------- +2. Reconnaissance + +A big plus of HTML Purifier is its inerrant support of standards, so +your web-pages should be standards-compliant. (They should also use +semantic markup, but that's another issue altogether, one HTML Purifier +cannot fix without reading your mind.) + +HTML Purifier can process these doctypes: + +* XHTML 1.0 Transitional (default) +* XHTML 1.0 Strict +* HTML 4.01 Transitional +* HTML 4.01 Strict +* XHTML 1.1 + +...and these character encodings: + +* UTF-8 (default) +* Any encoding iconv supports (with crippled internationalization support) + +These defaults reflect what my choices would be if I were authoring an +HTML document, however, what you choose depends on the nature of your +codebase. If you don't know what doctype you are using, you can determine +the doctype from this identifier at the top of your source code: + + + +...and the character encoding from this code: + + + +If the character encoding declaration is missing, STOP NOW, and +read 'docs/enduser-utf8.html' (web accessible at +http://htmlpurifier.org/docs/enduser-utf8.html). In fact, even if it is +present, read this document anyway, as many websites specify their +document's character encoding incorrectly. + + +--------------------------------------------------------------------------- +3. Including the library + +The procedure is quite simple: + + require_once '/path/to/library/HTMLPurifier.auto.php'; + +This will setup an autoloader, so the library's files are only included +when you use them. + +Only the contents in the library/ folder are necessary, so you can remove +everything else when using HTML Purifier in a production environment. + +If you installed HTML Purifier via PEAR, all you need to do is: + + require_once 'HTMLPurifier.auto.php'; + +Please note that the usual PEAR practice of including just the classes you +want will not work with HTML Purifier's autoloading scheme. + +Advanced users, read on; other users can skip to section 4. + +Autoload compatibility +---------------------- + + HTML Purifier attempts to be as smart as possible when registering an + autoloader, but there are some cases where you will need to change + your own code to accomodate HTML Purifier. These are those cases: + + PHP VERSION IS LESS THAN 5.1.2, AND YOU'VE DEFINED __autoload + Because spl_autoload_register() doesn't exist in early versions + of PHP 5, HTML Purifier has no way of adding itself to the autoload + stack. Modify your __autoload function to test + HTMLPurifier_Bootstrap::autoload($class) + + For example, suppose your autoload function looks like this: + + function __autoload($class) { + require str_replace('_', '/', $class) . '.php'; + return true; + } + + A modified version with HTML Purifier would look like this: + + function __autoload($class) { + if (HTMLPurifier_Bootstrap::autoload($class)) return true; + require str_replace('_', '/', $class) . '.php'; + return true; + } + + Note that there *is* some custom behavior in our autoloader; the + original autoloader in our example would work for 99% of the time, + but would fail when including language files. + + AN __autoload FUNCTION IS DECLARED AFTER OUR AUTOLOADER IS REGISTERED + spl_autoload_register() has the curious behavior of disabling + the existing __autoload() handler. Users need to explicitly + spl_autoload_register('__autoload'). Because we use SPL when it + is available, __autoload() will ALWAYS be disabled. If __autoload() + is declared before HTML Purifier is loaded, this is not a problem: + HTML Purifier will register the function for you. But if it is + declared afterwards, it will mysteriously not work. This + snippet of code (after your autoloader is defined) will fix it: + + spl_autoload_register('__autoload') + + Users should also be on guard if they use a version of PHP previous + to 5.1.2 without an autoloader--HTML Purifier will define __autoload() + for you, which can collide with an autoloader that was added by *you* + later. + + +For better performance +---------------------- + + Opcode caches, which greatly speed up PHP initialization for scripts + with large amounts of code (HTML Purifier included), don't like + autoloaders. We offer an include file that includes all of HTML Purifier's + files in one go in an opcode cache friendly manner: + + // If /path/to/library isn't already in your include path, uncomment + // the below line: + // require '/path/to/library/HTMLPurifier.path.php'; + + require 'HTMLPurifier.includes.php'; + + Optional components still need to be included--you'll know if you try to + use a feature and you get a class doesn't exists error! The autoloader + can be used in conjunction with this approach to catch classes that are + missing. Simply add this afterwards: + + require 'HTMLPurifier.autoload.php'; + +Standalone version +------------------ + + HTML Purifier has a standalone distribution; you can also generate + a standalone file from the full version by running the script + maintenance/generate-standalone.php . The standalone version has the + benefit of having most of its code in one file, so parsing is much + faster and the library is easier to manage. + + If HTMLPurifier.standalone.php exists in the library directory, you + can use it like this: + + require '/path/to/HTMLPurifier.standalone.php'; + + This is equivalent to including HTMLPurifier.includes.php, except that + the contents of standalone/ will be added to your path. To override this + behavior, specify a new HTMLPURIFIER_PREFIX where standalone files can + be found (usually, this will be one directory up, the "true" library + directory in full distributions). Don't forget to set your path too! + + The autoloader can be added to the end to ensure the classes are + loaded when necessary; otherwise you can manually include them. + To use the autoloader, use this: + + require 'HTMLPurifier.autoload.php'; + +For advanced users +------------------ + + HTMLPurifier.auto.php performs a number of operations that can be done + individually. These are: + + HTMLPurifier.path.php + Puts /path/to/library in the include path. For high performance, + this should be done in php.ini. + + HTMLPurifier.autoload.php + Registers our autoload handler HTMLPurifier_Bootstrap::autoload($class). + + You can do these operations by yourself--in fact, you must modify your own + autoload handler if you are using a version of PHP earlier than PHP 5.1.2 + (See "Autoload compatibility" above). + + +--------------------------------------------------------------------------- +4. Configuration + +HTML Purifier is designed to run out-of-the-box, but occasionally HTML +Purifier needs to be told what to do. If you answer no to any of these +questions, read on; otherwise, you can skip to the next section (or, if you're +into configuring things just for the heck of it, skip to 4.3). + +* Am I using UTF-8? +* Am I using XHTML 1.0 Transitional? + +If you answered no to any of these questions, instantiate a configuration +object and read on: + + $config = HTMLPurifier_Config::createDefault(); + + +4.1. Setting a different character encoding + +You really shouldn't use any other encoding except UTF-8, especially if you +plan to support multilingual websites (read section three for more details). +However, switching to UTF-8 is not always immediately feasible, so we can +adapt. + +HTML Purifier uses iconv to support other character encodings, as such, +any encoding that iconv supports +HTML Purifier supports with this code: + + $config->set('Core.Encoding', /* put your encoding here */); + +An example usage for Latin-1 websites (the most common encoding for English +websites): + + $config->set('Core.Encoding', 'ISO-8859-1'); + +Note that HTML Purifier's support for non-Unicode encodings is crippled by the +fact that any character not supported by that encoding will be silently +dropped, EVEN if it is ampersand escaped. If you want to work around +this, you are welcome to read docs/enduser-utf8.html for a fix, +but please be cognizant of the issues the "solution" creates (for this +reason, I do not include the solution in this document). + + +4.2. Setting a different doctype + +For those of you using HTML 4.01 Transitional, you can disable +XHTML output like this: + + $config->set('HTML.Doctype', 'HTML 4.01 Transitional'); + +Other supported doctypes include: + + * HTML 4.01 Strict + * HTML 4.01 Transitional + * XHTML 1.0 Strict + * XHTML 1.0 Transitional + * XHTML 1.1 + + +4.3. Other settings + +There are more configuration directives which can be read about +here: They're a bit boring, +but they can help out for those of you who like to exert maximum control over +your code. Some of the more interesting ones are configurable at the +demo and are well worth looking into +for your own system. + +For example, you can fine tune allowed elements and attributes, convert +relative URLs to absolute ones, and even autoparagraph input text! These +are, respectively, %HTML.Allowed, %URI.MakeAbsolute and %URI.Base, and +%AutoFormat.AutoParagraph. The %Namespace.Directive naming convention +translates to: + + $config->set('Namespace.Directive', $value); + +E.g. + + $config->set('HTML.Allowed', 'p,b,a[href],i'); + $config->set('URI.Base', 'http://www.example.com'); + $config->set('URI.MakeAbsolute', true); + $config->set('AutoFormat.AutoParagraph', true); + + +--------------------------------------------------------------------------- +5. Caching + +HTML Purifier generates some cache files (generally one or two) to speed up +its execution. For maximum performance, make sure that +library/HTMLPurifier/DefinitionCache/Serializer is writeable by the webserver. + +If you are in the library/ folder of HTML Purifier, you can set the +appropriate permissions using: + + chmod -R 0755 HTMLPurifier/DefinitionCache/Serializer + +If the above command doesn't work, you may need to assign write permissions +to all. This may be necessary if your webserver runs as nobody, but is +not recommended since it means any other user can write files in the +directory. Use: + + chmod -R 0777 HTMLPurifier/DefinitionCache/Serializer + +You can also chmod files via your FTP client; this option +is usually accessible by right clicking the corresponding directory and +then selecting "chmod" or "file permissions". + +Starting with 2.0.1, HTML Purifier will generate friendly error messages +that will tell you exactly what you have to chmod the directory to, if in doubt, +follow its advice. + +If you are unable or unwilling to give write permissions to the cache +directory, you can either disable the cache (and suffer a performance +hit): + + $config->set('Core.DefinitionCache', null); + +Or move the cache directory somewhere else (no trailing slash): + + $config->set('Cache.SerializerPath', '/home/user/absolute/path'); + + +--------------------------------------------------------------------------- +6. Using the code + +The interface is mind-numbingly simple: + + $purifier = new HTMLPurifier($config); + $clean_html = $purifier->purify( $dirty_html ); + +That's it! For more examples, check out docs/examples/ (they aren't very +different though). Also, docs/enduser-slow.html gives advice on what to +do if HTML Purifier is slowing down your application. + + +--------------------------------------------------------------------------- +7. Quick install + +First, make sure library/HTMLPurifier/DefinitionCache/Serializer is +writable by the webserver (see Section 5: Caching above for details). +If your website is in UTF-8 and XHTML Transitional, use this code: + +purify($dirty_html); +?> + +If your website is in a different encoding or doctype, use this code: + +set('Core.Encoding', 'ISO-8859-1'); // replace with your encoding + $config->set('HTML.Doctype', 'HTML 4.01 Transitional'); // replace with your doctype + $purifier = new HTMLPurifier($config); + + $clean_html = $purifier->purify($dirty_html); +?> + + vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/INSTALL.fr.utf8 b/vendor/ezyang/htmlpurifier/INSTALL.fr.utf8 new file mode 100644 index 000000000..06e628cc9 --- /dev/null +++ b/vendor/ezyang/htmlpurifier/INSTALL.fr.utf8 @@ -0,0 +1,60 @@ + +Installation + Comment installer HTML Purifier + +Attention : Ce document est encodé en UTF-8, si les lettres avec des accents +ne s'affichent pas, prenez un meilleur éditeur de texte. + +L'installation de HTML Purifier est très simple, parce qu'il n'a pas besoin +de configuration. Pour les utilisateurs impatients, le code se trouve dans le +pied de page, mais je recommande de lire le document. + +1. Compatibilité + +HTML Purifier fonctionne avec PHP 5. PHP 5.0.5 est la dernière version testée. +Il ne dépend pas d'autres librairies. + +Les extensions optionnelles sont iconv (généralement déjà installée) et tidy +(répendue aussi). Si vous utilisez UTF-8 et que vous ne voulez pas l'indentation, +vous pouvez utiliser HTML Purifier sans ces extensions. + + +2. Inclure la librairie + +Quand vous devez l'utilisez, incluez le : + + require_once('/path/to/library/HTMLPurifier.auto.php'); + +Ne pas l'inclure si ce n'est pas nécessaire, car HTML Purifier est lourd. + +HTML Purifier utilise "autoload". Si vous avez défini la fonction __autoload, +vous devez ajouter cette fonction : + + spl_autoload_register('__autoload') + +Plus d'informations dans le document "INSTALL". + +3. Installation rapide + +Si votre site Web est en UTF-8 et XHTML Transitional, utilisez : + +purify($html_a_purifier); +?> + +Sinon, utilisez : + +set('Core', 'Encoding', 'ISO-8859-1'); //Remplacez par votre + encodage + $config->set('Core', 'XHTML', true); //Remplacer par false si HTML 4.01 + $purificateur = new HTMLPurifier($config); + $html_propre = $purificateur->purify($html_a_purifier); +?> + + + vim: et sw=4 sts=4 diff --git a/classes/security/htmlpurifier/LICENSE b/vendor/ezyang/htmlpurifier/LICENSE similarity index 100% rename from classes/security/htmlpurifier/LICENSE rename to vendor/ezyang/htmlpurifier/LICENSE diff --git a/vendor/ezyang/htmlpurifier/NEWS b/vendor/ezyang/htmlpurifier/NEWS new file mode 100644 index 000000000..a9124af1a --- /dev/null +++ b/vendor/ezyang/htmlpurifier/NEWS @@ -0,0 +1,1094 @@ +NEWS ( CHANGELOG and HISTORY ) HTMLPurifier +||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| + += KEY ==================== + # Breaks back-compat + ! Feature + - Bugfix + + Sub-comment + . Internal change +========================== + +4.7.0, released 2015-08-04 +# opacity is now considered a "tricky" CSS property rather than a + proprietary one. +! %AutoFormat.RemoveEmpty.Predicate for specifying exactly when + an element should be considered "empty" (maybe preserve if it + has attributes), and modify iframe support so that the iframe + is removed if it is missing a src attribute. Thanks meeva for + reporting. +- Don't truncate upon encountering when using DOMLex. Thanks + Myrto Christina for finally convincing me to fix this. +- Update YouTube filter for new code. +- Fix parsing of rgb() values with spaces in them for 'border' + attribute. +- Don't remove foo="" attributes if foo is a boolean attribute. Thanks + valME for reporting. + +4.6.0, released 2013-11-30 +# Secure URI munge hashing algorithm has changed to hash_hmac("sha256", $url, $secret). + Please update any verification scripts you may have. +# URI parsing algorithm was made more strict, so only prefixes which + looks like schemes will actually be schemes. Thanks + Michael Gusev for fixing. +# %Core.EscapeInvalidChildren is no longer supported, and no longer does + anything. +! New directive %Core.AllowHostnameUnderscore which allows underscores + in hostnames. +- Eliminate quadratic behavior in DOMLex by using a proper queue. + Thanks Ole Laursen for noticing this. +- Rewritten MakeWellFormed/FixNesting implementation eliminates quadratic + behavior in the rest of the purificaiton pipeline. Thanks Chedburn + Networks for sponsoring this work. +- Made Linkify URL parser a bit less permissive, so that non-breaking + spaces and commas are not included as part of URL. Thanks nAS for fixing. +- Fix some bad interactions with %HTML.Allowed and injectors. Thanks + David Hirtz for reporting. +- Fix infinite loop in DirectLex. Thanks Ashar Javed (@soaj1664ashar) + for reporting. + +4.5.0, released 2013-02-17 +# Fix bug where stacked attribute transforms clobber each other; + this also means it's no longer possible to override attribute + transforms in later modules. No internal code was using this + but this may break some clients. +# We now use SHA-1 to identify cached definitions, instead of MD5. +! Support display:inline-block +! Support for more white-space CSS values. +! Permit underscores in font families +! Support for page-break-* CSS3 properties when proprietary properties + are enabled. +! New directive %Core.DisableExcludes; can be set to 'true' to turn off + SGML excludes checking. If HTML Purifier is removing too much text + and you don't care about full standards compliance, try setting this to + 'true'. +- Use prepend for SPL autoloading on PHP 5.3 and later. +- Fix bug with nofollow transform when pre-existing rel exists. +- Fix bug where background:url() always gets lower-cased + (but not background-image:url()) +- Fix bug with non lower-case color names in HTML +- Fix bug where data URI validation doesn't remove temporary files. + Thanks Javier Marín Ros for reporting. +- Don't remove certain empty tags on RemoveEmpty. + +4.4.0, released 2012-01-18 +# Removed PEARSax3 handler. +# URI.Munge now munges URIs inside the same host that go from https + to http. Reported by Neike Taika-Tessaro. +# Core.EscapeNonASCIICharacters now always transforms entities to + entities, even if target encoding is UTF-8. +# Tighten up selector validation in ExtractStyleBlocks. + Non-syntactically valid selectors are now rejected, along with + some of the more obscure ones such as attribute selectors, the + :lang pseudoselector, and anything not in CSS2.1. Furthermore, + ID and class selectors now work properly with the relevant + configuration attributes. Also, mute errors when parsing CSS + with CSS Tidy. Reported by Mario Heiderich and Norman Hippert. +! Added support for 'scope' attribute on tables. +! Added %HTML.TargetBlank, which adds target="blank" to all outgoing links. +! Properly handle sub-lists directly nested inside of lists in + a standards compliant way, by moving them into the preceding
  • +! Added %HTML.AllowedComments and %HTML.AllowedCommentsRegexp for + limited allowed comments in untrusted situations. +! Implement iframes, and allow them to be used in untrusted mode with + %HTML.SafeIframe and %URI.SafeIframeRegexp. Thanks Bradley M. Froehle + for submitting an initial version of the patch. +! The Forms module now works properly for transitional doctypes. +! Added support for internationalized domain names. You need the PEAR + Net_IDNA2 module to be in your path; if it is installed, ensure the + class can be loaded and then set %Core.EnableIDNA to true. +- Color keywords are now case insensitive. Thanks Yzmir Ramirez + for reporting. +- Explicitly initialize anonModule variable to null. +- Do not duplicate nofollow if already present. Thanks 178 + for reporting. +- Do not add nofollow if hostname matches our current host. Thanks 178 + for reporting, and Neike Taika-Tessaro for helping diagnose. +- Do not unset parser variable; this fixes intermittent serialization + problems. Thanks Neike Taika-Tessaro for reporting, bill + <10010tiger@gmail.com> for diagnosing. +- Fix iconv truncation bug, where non-UTF-8 target encodings see + output truncated after around 8000 characters. Thanks Jörg Ludwig + for reporting. +- Fix broken table content model for XHTML1.1 (and also earlier + versions, although the W3C validator doesn't catch those violations). + Thanks GlitchMr for reporting. + +4.3.0, released 2011-03-27 +# Fixed broken caching of customized raw definitions, but requires an + API change. The old API still works but will emit a warning, + see http://htmlpurifier.org/docs/enduser-customize.html#optimized + for how to upgrade your code. +# Protect against Internet Explorer innerHTML behavior by specially + treating attributes with backticks but no angled brackets, quotes or + spaces. This constitutes a slight semantic change, which can be + reverted using %Output.FixInnerHTML. Reported by Neike Taika-Tessaro + and Mario Heiderich. +# Protect against cssText/innerHTML by restricting allowed characters + used in fonts further than mandated by the specification and encoding + some extra special characters in URLs. Reported by Neike + Taika-Tessaro and Mario Heiderich. +! Added %HTML.Nofollow to add rel="nofollow" to external links. +! More types of SPL autoloaders allowed on later versions of PHP. +! Implementations for position, top, left, right, bottom, z-index + when %CSS.Trusted is on. +! Add %Cache.SerializerPermissions option for custom serializer + directory/file permissions +! Fix longstanding bug in Flash support for non-IE browsers, and + allow more wmode attributes. +! Add %CSS.AllowedFonts to restrict permissible font names. +- Switch to an iterative traversal of the DOM, which prevents us + from running out of stack space for deeply nested documents. + Thanks Maxim Krizhanovsky for contributing a patch. +- Make removal of conditional IE comments ungreedy; thanks Bernd + for reporting. +- Escape CDATA before removing Internet Explorer comments. +- Fix removal of id attributes under certain conditions by ensuring + armor attributes are preserved when recreating tags. +- Check if schema.ser was corrupted. +- Check if zend.ze1_compatibility_mode is on, and error out if it is. + This safety check is only done for HTMLPurifier.auto.php; if you + are using standalone or the specialized includes files, you're + expected to know what you're doing. +- Stop repeatedly writing the cache file after I'm done customizing a + raw definition. Reported by ajh. +- Switch to using require_once in the Bootstrap to work around bad + interaction with Zend Debugger and APC. Reported by Antonio Parraga. +- Fix URI handling when hostname is missing but scheme is present. + Reported by Neike Taika-Tessaro. +- Fix missing numeric entities on DirectLex; thanks Neike Taika-Tessaro + for reporting. +- Fix harmless notice from indexing into empty string. Thanks Matthijs + Kooijman for reporting. +- Don't autoclose no parent elements are able to support the element + that triggered the autoclose. In particular fixes strange behavior + of stray
  • tags. Thanks pkuliga@gmail.com for reporting and + Neike Taika-Tessaro for debugging assistance. + +4.2.0, released 2010-09-15 +! Added %Core.RemoveProcessingInstructions, which lets you remove + statements. +! Added %URI.DisableResources functionality; the directive originally + did nothing. Thanks David Rothstein for reporting. +! Add documentation about configuration directive types. +! Add %CSS.ForbiddenProperties configuration directive. +! Add %HTML.FlashAllowFullScreen to permit embedded Flash objects + to utilize full-screen mode. +! Add optional support for the file URI scheme, enable + by explicitly setting %URI.AllowedSchemes. +! Add %Core.NormalizeNewlines options to allow turning off newline + normalization. +- Fix improper handling of Internet Explorer conditional comments + by parser. Thanks zmonteca for reporting. +- Fix missing attributes bug when running on Mac Snow Leopard and APC. + Thanks sidepodcast for the fix. +- Warn if an element is allowed, but an attribute it requires is + not allowed. + +4.1.1, released 2010-05-31 +- Fix undefined index warnings in maintenance scripts. +- Fix bug in DirectLex for parsing elements with a single attribute + with entities. +- Rewrite CSS output logic for font-family and url(). Thanks Mario + Heiderich for reporting and Takeshi + Terada for suggesting the fix. +- Emit an error for CollectErrors if a body is extracted +- Fix bug where in background-position for center keyword handling. +- Fix infinite loop when a wrapper element is inserted in a context + where it's not allowed. Thanks Lars for reporting. +- Remove +x bit and shebang from index.php; only supported mode is to + explicitly call it with php. +- Make test script less chatty when log_errors is on. + +4.1.0, released 2010-04-26 +! Support proprietary height attribute on table element +! Support YouTube slideshows that contain /cp/ in their URL. +! Support for data: URI scheme; not enabled by default, add it using + %URI.AllowedSchemes +! Support flashvars when using %HTML.SafeObject and %HTML.SafeEmbed. +! Support for Internet Explorer compatibility with %HTML.SafeObject + using %Output.FlashCompat. +! Handle
        properly, by inserting the necessary
      1. tag. +- Always quote the insides of url(...) in CSS. + +4.0.0, released 2009-07-07 +# APIs for ConfigSchema subsystem have substantially changed. See + docs/dev-config-bcbreaks.txt for details; in essence, anything that + had both namespace and directive now have a single unified key. +# Some configuration directives were renamed, specifically: + %AutoFormatParam.PurifierLinkifyDocURL -> %AutoFormat.PurifierLinkify.DocURL + %FilterParam.ExtractStyleBlocksEscaping -> %Filter.ExtractStyleBlocks.Escaping + %FilterParam.ExtractStyleBlocksScope -> %Filter.ExtractStyleBlocks.Scope + %FilterParam.ExtractStyleBlocksTidyImpl -> %Filter.ExtractStyleBlocks.TidyImpl + As usual, the old directive names will still work, but will throw E_NOTICE + errors. +# The allowed values for class have been relaxed to allow all of CDATA for + doctypes that are not XHTML 1.1 or XHTML 2.0. For old behavior, set + %Attr.ClassUseCDATA to false. +# Instead of appending the content model to an old content model, a blank + element will replace the old content model. You can use #SUPER to get + the old content model. +! More robust support for name="" and id="" +! HTMLPurifier_Config::inherit($config) allows you to inherit one + configuration, and have changes to that configuration be propagated + to all of its children. +! Implement %HTML.Attr.Name.UseCDATA, which relaxes validation rules on + the name attribute when set. Use with care. Thanks Ian Cook for + sponsoring. +! Implement %AutoFormat.RemoveEmpty.RemoveNbsp, which removes empty + tags that contain non-breaking spaces as well other whitespace. You + can also modify which tags should have   maintained with + %AutoFormat.RemoveEmpty.RemoveNbsp.Exceptions. +! Implement %Attr.AllowedClasses, which allows administrators to restrict + classes users can use to a specified finite set of classes, and + %Attr.ForbiddenClasses, which is the logical inverse. +! You can now maintain your own configuration schema directories by + creating a config-schema.php file or passing an extra argument. Check + docs/dev-config-schema.html for more details. +! Added HTMLPurifier_Config->serialize() method, which lets you save away + your configuration in a compact serial file, which you can unserialize + and use directly without having to go through the overhead of setup. +- Fix bug where URIDefinition would not get cleared if it's directives got + changed. +- Fix fatal error in HTMLPurifier_Encoder on certain platforms (probably NetBSD 5.0) +- Fix bug in Linkify autoformatter involving http://foo +- Make %URI.Munge not apply to links that have the same host as your host. +- Prevent stray tag from truncating output, if a second + is present. +. Created script maintenance/rename-config.php for renaming a configuration + directive while maintaining its alias. This script does not change source code. +. Implement namespace locking for definition construction, to prevent + bugs where a directive is used for definition construction but is not + used to construct the cache hash. + +3.3.0, released 2009-02-16 +! Implement CSS property 'overflow' when %CSS.AllowTricky is true. +! Implement generic property list classess +- Fix bug with testEncodingSupportsASCII() algorithm when iconv() implementation + does not do the "right thing" with characters not supported in the output + set. +- Spellcheck UTF-8: The Secret To Character Encoding +- Fix improper removal of the contents of elements with only whitespace. Thanks + Eric Wald for reporting. +- Fix broken test suite in versions of PHP without spl_autoload_register() +- Fix degenerate case with YouTube filter involving double hyphens. + Thanks Pierre Attar for reporting. +- Fix YouTube rendering problem on certain versions of Firefox. +- Fix CSSDefinition Printer problems with decorators +- Add text parameter to unit tests, forces text output +. Add verbose mode to command line test runner, use (--verbose) +. Turn on unit tests for UnitConverter +. Fix missing version number in configuration %Attr.DefaultImageAlt (added 3.2.0) +. Fix newline errors that caused spurious failures when CRLF HTML Purifier was + tested on Linux. +. Removed trailing whitespace from all text files, see + remote-trailing-whitespace.php maintenance script. +. Convert configuration to use property list backend. + +3.2.0, released 2008-10-31 +# Using %Core.CollectErrors forces line number/column tracking on, whereas + previously you could theoretically turn it off. +# HTMLPurifier_Injector->notifyEnd() is formally deprecated. Please + use handleEnd() instead. +! %Output.AttrSort for when you need your attributes in alphabetical order to + deal with a bug in FCKEditor. Requested by frank farmer. +! Enable HTML comments when %HTML.Trusted is on. Requested by Waldo Jaquith. +! Proper support for name attribute. It is now allowed and equivalent to the id + attribute in a and img tags, and is only converted to id when %HTML.TidyLevel + is heavy (for all doctypes). +! %AutoFormat.RemoveEmpty to remove some empty tags from documents. Please don't + use on hand-written HTML. +! Add error-cases for unsupported elements in MakeWellFormed. This enables + the strategy to be used, standalone, on untrusted input. +! %Core.AggressivelyFixLt is on by default. This causes more sensible + processing of left angled brackets in smileys and other whatnot. +! Test scripts now have a 'type' parameter, which lets you say 'htmlpurifier', + 'phpt', 'vtest', etc. in order to only execute those tests. This supercedes + the --only-phpt parameter, although for backwards-compatibility the flag + will still work. +! AutoParagraph auto-formatter will now preserve double-newlines upon output. + Users who are not performing inbound filtering, this may seem a little + useless, but as a bonus, the test suite and handling of edge cases is also + improved. +! Experimental implementation of forms for %HTML.Trusted +! Track column numbers when maintain line numbers is on +! Proprietary 'background' attribute on table-related elements converted into + corresponding CSS. Thanks Fusemail for sponsoring this feature! +! Add forward(), forwardUntilEndToken(), backward() and current() to Injector + supertype. +! HTMLPurifier_Injector->handleEnd() permits modification to end tokens. The + time of operation varies slightly from notifyEnd() as *all* end tokens are + processed by the injector before they are subject to the well-formedness rules. +! %Attr.DefaultImageAlt allows overriding default behavior of setting alt to + basename of image when not present. +! %AutoFormat.DisplayLinkURI neuters tags into plain text URLs. +- Fix two bugs in %URI.MakeAbsolute; one involving empty paths in base URLs, + the other involving an undefined $is_folder error. +- Throw error when %Core.Encoding is set to a spurious value. Previously, + this errored silently and returned false. +- Redirected stderr to stdout for flush error output. +- %URI.DisableExternal will now use the host in %URI.Base if %URI.Host is not + available. +- Do not re-munge URL if the output URL has the same host as the input URL. + Requested by Chris. +- Fix error in documentation regarding %Filter.ExtractStyleBlocks +- Prevent ]]> from triggering %Core.ConvertDocumentToFragment +- Fix bug with inline elements in blockquotes conflicting with strict doctype +- Detect if HTML support is disabled for DOM by checking for loadHTML() method. +- Fix bug where dots and double-dots in absolute URLs without hostname were + not collapsed by URIFilter_MakeAbsolute. +- Fix bug with anonymous modules operating on SafeEmbed or SafeObject elements + by reordering their addition. +- Will now throw exception on many error conditions during lexer creation; also + throw an exception when MaintainLineNumbers is true, but a non-tracksLineNumbers + is being used. +- Detect if domxml extension is loaded, and use DirectLEx accordingly. +- Improve handling of big numbers with floating point arithmetic in UnitConverter. + Reported by David Morton. +. Strategy_MakeWellFormed now operates in-place, saving memory and allowing + for more interesting filter-backtracking +. New HTMLPurifier_Injector->rewind() functionality, allows injectors to rewind + index to reprocess tokens. +. StringHashParser now allows for multiline sections with "empty" content; + previously the section would remain undefined. +. Added --quick option to multitest.php, which tests only the most recent + release for each series. +. Added --distro option to multitest.php, which accepts either 'normal' or + 'standalone'. This supercedes --exclude-normal and --exclude-standalone + +3.1.1, released 2008-06-19 +# %URI.Munge now, by default, does not munge resources (for example, ) + In order to enable this again, please set %URI.MungeResources to true. +! More robust imagecrash protection with height/width CSS with %CSS.MaxImgLength, + and height/width HTML with %HTML.MaxImgLength. +! %URI.MungeSecretKey for secure URI munging. Thanks Chris + for sponsoring this feature. Check out the corresponding documentation + for details. (Att Nightly testers: The API for this feature changed before + the general release. Namely, rename your directives %URI.SecureMungeSecretKey => + %URI.MungeSecretKey and and %URI.SecureMunge => %URI.Munge) +! Implemented post URI filtering. Set member variable $post to true to set + a URIFilter as such. +! Allow modules to define injectors via $info_injector. Injectors are + automatically disabled if injector's needed elements are not found. +! Support for "safe" objects added, use %HTML.SafeObject and %HTML.SafeEmbed. + Thanks Chris for sponsoring. If you've been using ad hoc code from the + forums, PLEASE use this instead. +! Added substitutions for %e, %n, %a and %p in %URI.Munge (in order, + embedded, tag name, attribute name, CSS property name). See %URI.Munge + for more details. Requested by Jochem Blok. +- Disable percent height/width attributes for img. +- AttrValidator operations are now atomic; updates to attributes are not + manifest in token until end of operations. This prevents naughty internal + code from directly modifying CurrentToken when they're not supposed to. + This semantics change was requested by frank farmer. +- Percent encoding checks enabled for URI query and fragment +- Fix stray backslashes in font-family; CSS Unicode character escapes are + now properly resolved (although *only* in font-family). Thanks Takeshi Terada + for reporting. +- Improve parseCDATA algorithm to take into account newline normalization +- Account for browser confusion between Yen character and backslash in + Shift_JIS encoding. This fix generalizes to any other encoding which is not + a strict superset of printable ASCII. Thanks Takeshi Terada for reporting. +- Fix missing configuration parameter in Generator calls. Thanks vs for the + partial patch. +- Improved adherence to Unicode by checking for non-character codepoints. + Thanks Geoffrey Sneddon for reporting. This may result in degraded + performance for extremely large inputs. +- Allow CSS property-value pair ''text-decoration: none''. Thanks Jochem Blok + for reporting. +. Added HTMLPurifier_UnitConverter and HTMLPurifier_Length for convenient + handling of CSS-style lengths. HTMLPurifier_AttrDef_CSS_Length now uses + this class. +. API of HTMLPurifier_AttrDef_CSS_Length changed from __construct($disable_negative) + to __construct($min, $max). __construct(true) is equivalent to + __construct('0'). +. Added HTMLPurifier_AttrDef_Switch class +. Rename HTMLPurifier_HTMLModule_Tidy->construct() to setup() and bubble method + up inheritance hierarchy to HTMLPurifier_HTMLModule. All HTMLModules + get this called with the configuration object. All modules now + use this rather than __construct(), although legacy code using constructors + will still work--the new format, however, lets modules access the + configuration object for HTML namespace dependant tweaks. +. AttrDef_HTML_Pixels now takes a single construction parameter, pixels. +. ConfigSchema data-structure heavily optimized; on average it uses a third + the memory it did previously. The interface has changed accordingly, + consult changes to HTMLPurifier_Config for details. +. Variable parsing types now are magic integers instead of strings +. Added benchmark for ConfigSchema +. HTMLPurifier_Generator requires $config and $context parameters. If you + don't know what they should be, use HTMLPurifier_Config::createDefault() + and new HTMLPurifier_Context(). +. Printers now properly distinguish between output configuration, and + target configuration. This is not applicable to scripts using + the Printers for HTML Purifier related tasks. +. HTML/CSS Printers must be primed with prepareGenerator($gen_config), otherwise + fatal errors will ensue. +. URIFilter->prepare can return false in order to abort loading of the filter +. Factory for AttrDef_URI implemented, URI#embedded to indicate URI that embeds + an external resource. +. %URI.Munge functionality factored out into a post-filter class. +. Added CurrentCSSProperty context variable during CSS validation + +3.1.0, released 2008-05-18 +# Unnecessary references to objects (vestiges of PHP4) removed from method + signatures. The following methods do not need references when assigning from + them and will result in E_STRICT errors if you try: + + HTMLPurifier_Config->get*Definition() [* = HTML, CSS] + + HTMLPurifier_ConfigSchema::instance() + + HTMLPurifier_DefinitionCacheFactory::instance() + + HTMLPurifier_DefinitionCacheFactory->create() + + HTMLPurifier_DoctypeRegistry->register() + + HTMLPurifier_DoctypeRegistry->get() + + HTMLPurifier_HTMLModule->addElement() + + HTMLPurifier_HTMLModule->addBlankElement() + + HTMLPurifier_LanguageFactory::instance() +# Printer_ConfigForm's get*() functions were static-ified +# %HTML.ForbiddenAttributes requires attribute declarations to be in the + form of tag@attr, NOT tag.attr (which will throw an error and won't do + anything). This is for forwards compatibility with XML; you'd do best + to migrate an %HTML.AllowedAttributes directives to this syntax too. +! Allow index to be false for config from form creation +! Added HTMLPurifier::VERSION constant +! Commas, not dashes, used for serializer IDs. This change is forwards-compatible + and allows for version numbers like "3.1.0-dev". +! %HTML.Allowed deals gracefully with whitespace anywhere, anytime! +! HTML Purifier's URI handling is a lot more robust, with much stricter + validation checks and better percent encoding handling. Thanks Gareth Heyes + for indicating security vulnerabilities from lax percent encoding. +! Bootstrap autoloader deals more robustly with classes that don't exist, + preventing class_exists($class, true) from barfing. +- InterchangeBuilder now alphabetizes its lists +- Validation error in configdoc output fixed +- Iconv and other encoding errors muted even with custom error handlers that + do not honor error_reporting +- Add protection against imagecrash attack with CSS height/width +- HTMLPurifier::instance() created for consistency, is equivalent to getInstance() +- Fixed and revamped broken ConfigForm smoketest +- Bug with bool/null fields in Printer_ConfigForm fixed +- Bug with global forbidden attributes fixed +- Improved error messages for allowed and forbidden HTML elements and attributes +- Missing (or null) in configdoc documentation restored +- If DOM throws and exception during parsing with PH5P (occurs in newer versions + of DOM), HTML Purifier punts to DirectLex +- Fatal error with unserialization of ScriptRequired +- Created directories are now chmod'ed properly +- Fixed bug with fallback languages in LanguageFactory +- Standalone testing setup properly with autoload +. Out-of-date documentation revised +. UTF-8 encoding check optimization as suggested by Diego +. HTMLPurifier_Error removed in favor of exceptions +. More copy() function removed; should use clone instead +. More extensive unit tests for HTMLDefinition +. assertPurification moved to central harness +. HTMLPurifier_Generator accepts $config and $context parameters during + instantiation, not runtime +. Double-quotes outside of attribute values are now unescaped + +3.1.0rc1, released 2008-04-22 +# Autoload support added. Internal require_once's removed in favor of an + explicit require list or autoloading. To use HTML Purifier, + you must now either use HTMLPurifier.auto.php + or HTMLPurifier.includes.php; setting the include path and including + HTMLPurifier.php is insufficient--in such cases include HTMLPurifier.autoload.php + as well to register our autoload handler (or modify your autoload function + to check HTMLPurifier_Bootstrap::getPath($class)). You can also use + HTMLPurifier.safe-includes.php for a less performance friendly but more + user-friendly library load. +# HTMLPurifier_ConfigSchema static functions are officially deprecated. Schema + information is stored in the ConfigSchema directory, and the + maintenance/generate-schema-cache.php generates the schema.ser file, which + is now instantiated. Support for userland schema changes coming soon! +# HTMLPurifier_Config will now throw E_USER_NOTICE when you use a directive + alias; to get rid of these errors just modify your configuration to use + the new directive name. +# HTMLPurifier->addFilter is deprecated; built-in filters can now be + enabled using %Filter.$filter_name or by setting your own filters using + %Filter.Custom +# Directive-level safety properties superceded in favor of module-level + safety. Internal method HTMLModule->addElement() has changed, although + the externally visible HTMLDefinition->addElement has *not* changed. +! Extra utility classes for testing and non-library operations can + be found in extras/. Specifically, these are FSTools and ConfigDoc. + You may find a use for these in your own project, but right now they + are highly experimental and volatile. +! Integration with PHPT allows for automated smoketests +! Limited support for proprietary HTML elements, namely , sponsored + by Chris. You can enable them with %HTML.Proprietary if your client + demands them. +! Support for !important CSS cascade modifier. By default, this will be stripped + from CSS, but you can enable it using %CSS.AllowImportant +! Support for display and visibility CSS properties added, set %CSS.AllowTricky + to true to use them. +! HTML Purifier now has its own Exception hierarchy under HTMLPurifier_Exception. + Developer error (not enduser error) can cause these to be triggered. +! Experimental kses() wrapper introduced with HTMLPurifier.kses.php +! Finally %CSS.AllowedProperties for tweaking allowed CSS properties without + mucking around with HTMLPurifier_CSSDefinition +! ConfigDoc output has been enhanced with version and deprecation info. +! %HTML.ForbiddenAttributes and %HTML.ForbiddenElements implemented. +- Autoclose now operates iteratively, i.e.
        now has + both span tags closed. +- Various HTMLPurifier_Config convenience functions now accept another parameter + $schema which defines what HTMLPurifier_ConfigSchema to use besides the + global default. +- Fix bug with trusted script handling in libxml versions later than 2.6.28. +- Fix bug in ExtractStyleBlocks with comments in style tags +- Fix bug in comment parsing for DirectLex +- Flush output now displayed when in command line mode for unit tester +- Fix bug with rgb(0, 1, 2) color syntax with spaces inside shorthand syntax +- HTMLPurifier_HTMLDefinition->addAttribute can now be called multiple times + on the same element without emitting errors. +- Fixed fatal error in PH5P lexer with invalid tag names +. Plugins now get their own changelogs according to project conventions. +. Convert tokens to use instanceof, reducing memory footprint and + improving comparison speed. +. Dry runs now supported in SimpleTest; testing facilities improved +. Bootstrap class added for handling autoloading functionality +. Implemented recursive glob at FSTools->globr +. ConfigSchema now has instance methods for all corresponding define* + static methods. +. A couple of new historical maintenance scripts were added. +. HTMLPurifier/HTMLModule/Tidy/XHTMLAndHTML4.php split into two files +. tests/index.php can now be run from any directory. +. HTMLPurifier_Token subclasses split into seperate files +. HTMLPURIFIER_PREFIX now is defined in Bootstrap.php, NOT HTMLPurifier.php +. HTMLPURIFIER_PREFIX can now be defined outside of HTML Purifier +. New --php=php flag added, allows PHP executable to be specified (command + line only!) +. htmlpurifier_add_test() preferred method to translate test files in to + classes, because it handles PHPT files too. +. Debugger class is deprecated and will be removed soon. +. Command line argument parsing for testing scripts revamped, now --opt value + format is supported. +. Smoketests now cleanup after magic quotes +. Generator now can output comments (however, comments are still stripped + from HTML Purifier output) +. HTMLPurifier_ConfigSchema->validate() deprecated in favor of + HTMLPurifier_VarParser->parse() +. Integers auto-cast into float type by VarParser. +. HTMLPURIFIER_STRICT removed; no validation is performed on runtime, only + during cache generation +. Reordered script calls in maintenance/flush.php +. Command line scripts now honor exit codes +. When --flush fails in unit testers, abort tests and print message +. Improved documentation in docs/dev-flush.html about the maintenance scripts +. copy() methods removed in favor of clone keyword + +3.0.0, released 2008-01-06 +# HTML Purifier is PHP 5 only! The 2.1.x branch will be maintained + until PHP 4 is completely deprecated, but no new features will be added + to it. + + Visibility declarations added + + Constructor methods renamed to __construct() + + PHP4 reference cruft removed (in progress) +! CSS properties are now case-insensitive +! DefinitionCacheFactory now can register new implementations +! New HTMLPurifier_Filter_ExtractStyleBlocks for extracting '; + $js = $htmlpurifier_form->getJavaScript(); + echo ''; + + $frm->show(); +} + +function phorum_htmlpurifier_show_config_info() +{ + global $PHORUM; + + // update mod_htmlpurifier for housekeeping + phorum_htmlpurifier_commit_settings(); + + // politely tell user how to edit settings manually +?> +
        How to edit settings for HTML Purifier module
        +

        + A config.php file exists in your mods/htmlpurifier/ + directory. This file contains your custom configuration: in order to + change it, please navigate to that file and edit it accordingly. + You can also set $GLOBALS['PHORUM']['mod_htmlpurifier']['wysiwyg'] + or $GLOBALS['PHORUM']['mod_htmlpurifier']['suppress_message'] +

        +

        + To use the web interface, delete config.php (or rename it to + config.php.bak). +

        +

        + Warning: Changing HTML Purifier's configuration will invalidate + the cache. Expect to see a flurry of database activity after you change + any of these settings. +

        +hidden("module", "modsettings"); + $frm->hidden("mod", "htmlpurifier"); + $frm->hidden("migrate-sigs", "1"); + $frm->addbreak("Migrate user signatures to HTML"); + $frm->addMessage('This operation will migrate your users signatures + to HTML. This process is irreversible and must only be performed once. + Type in yes in the confirmation field to migrate.'); + if (!file_exists(dirname(__FILE__) . '/../migrate.php')) { + $frm->addMessage('Migration file does not exist, cannot migrate signatures. + Please check migrate.bbcode.php on how to create an appropriate file.'); + } else { + $frm->addrow('Confirm:', $frm->text_box("confirmation", "")); + } + $frm->show(); +} + +// vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/plugins/phorum/settings/migrate-sigs.php b/vendor/ezyang/htmlpurifier/plugins/phorum/settings/migrate-sigs.php new file mode 100644 index 000000000..5ea9cd0b8 --- /dev/null +++ b/vendor/ezyang/htmlpurifier/plugins/phorum/settings/migrate-sigs.php @@ -0,0 +1,79 @@ +$PHORUM["mod_htmlpurifier"])); + $offset = 1; + } elseif (!empty($_GET['migrate-sigs']) && $PHORUM['mod_htmlpurifier']['migrate-sigs']) { + $offset = (int) $_GET['migrate-sigs']; + } + return $offset; +} + +function phorum_htmlpurifier_migrate_sigs($offset) +{ + global $PHORUM; + + if(!$offset) return; // bail out quick if $offset == 0 + + // theoretically, we could get rid of this multi-request + // doo-hickery if safe mode is off + @set_time_limit(0); // attempt to let this run + $increment = $PHORUM['mod_htmlpurifier']['migrate-sigs-increment']; + + require_once(dirname(__FILE__) . '/../migrate.php'); + // migrate signatures + // do this in batches so we don't run out of time/space + $end = $offset + $increment; + $user_ids = array(); + for ($i = $offset; $i < $end; $i++) { + $user_ids[] = $i; + } + $userinfos = phorum_db_user_get_fields($user_ids, 'signature'); + foreach ($userinfos as $i => $user) { + if (empty($user['signature'])) continue; + $sig = $user['signature']; + // perform standard Phorum processing on the sig + $sig = str_replace(array("&","<",">"), array("&","<",">"), $sig); + $sig = preg_replace("/<((http|https|ftp):\/\/[a-z0-9;\/\?:@=\&\$\-_\.\+!*'\(\),~%]+?)>/i", "$1", $sig); + // prepare fake data to pass to migration function + $fake_data = array(array("author"=>"", "email"=>"", "subject"=>"", 'body' => $sig)); + list($fake_message) = phorum_htmlpurifier_migrate($fake_data); + $user['signature'] = $fake_message['body']; + if (!phorum_api_user_save($user)) { + exit('Error while saving user data'); + } + } + unset($userinfos); // free up memory + + // query for highest ID in database + $type = $PHORUM['DBCONFIG']['type']; + $sql = "select MAX(user_id) from {$PHORUM['user_table']}"; + $row = phorum_db_interact(DB_RETURN_ROW, $sql); + $top_id = (int) $row[0]; + + $offset += $increment; + if ($offset > $top_id) { // test for end condition + echo 'Migration finished'; + $PHORUM['mod_htmlpurifier']['migrate-sigs'] = false; + phorum_htmlpurifier_commit_settings(); + return true; + } + $host = $_SERVER['HTTP_HOST']; + $uri = rtrim(dirname($_SERVER['PHP_SELF']), '/\\'); + $extra = 'admin.php?module=modsettings&mod=htmlpurifier&migrate-sigs=' . $offset; + // relies on output buffering to work + header("Location: http://$host$uri/$extra"); + exit; + +} + +// vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/plugins/phorum/settings/save.php b/vendor/ezyang/htmlpurifier/plugins/phorum/settings/save.php new file mode 100644 index 000000000..2aefaf83a --- /dev/null +++ b/vendor/ezyang/htmlpurifier/plugins/phorum/settings/save.php @@ -0,0 +1,29 @@ +mods/htmlpurifier/config.php already exists. To change + settings, edit that file. To use the web form, delete that file.
        "; + } else { + $config = phorum_htmlpurifier_get_config(true); + if (!isset($_POST['reset'])) $config->mergeArrayFromForm($_POST, 'config', $PHORUM['mod_htmlpurifier']['directives']); + $PHORUM['mod_htmlpurifier']['config'] = $config->getAll(); + } + $PHORUM['mod_htmlpurifier']['wysiwyg'] = !empty($_POST['wysiwyg']); + $PHORUM['mod_htmlpurifier']['suppress_message'] = !empty($_POST['suppress_message']); + if(!phorum_htmlpurifier_commit_settings()){ + $error="Database error while updating settings."; + } else { + echo "Settings Updated
        "; + } +} + +function phorum_htmlpurifier_commit_settings() +{ + global $PHORUM; + return phorum_db_update_settings(array("mod_htmlpurifier"=>$PHORUM["mod_htmlpurifier"])); +} + +// vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/release1-update.php b/vendor/ezyang/htmlpurifier/release1-update.php new file mode 100644 index 000000000..834d38567 --- /dev/null +++ b/vendor/ezyang/htmlpurifier/release1-update.php @@ -0,0 +1,110 @@ + 1) { + echo 'More than one release declaration in NEWS replaced' . PHP_EOL; + exit; + } + file_put_contents('NEWS', $news_c); +} + +// ...in Doxyfile +$doxyfile_c = preg_replace( + '/(?<=PROJECT_NUMBER {9}= )[^\s]+/m', // brittle + $version, + file_get_contents('Doxyfile'), + 1, $c +); +if (!$c) { + echo 'Could not update Doxyfile, missing PROJECT_NUMBER.' . PHP_EOL; + exit; +} +file_put_contents('Doxyfile', $doxyfile_c); + +// ...in HTMLPurifier.php +$htmlpurifier_c = file_get_contents('library/HTMLPurifier.php'); +$htmlpurifier_c = preg_replace( + '/HTML Purifier .+? - /', + "HTML Purifier $version - ", + $htmlpurifier_c, + 1, $c +); +if (!$c) { + echo 'Could not update HTMLPurifier.php, missing HTML Purifier [version] header.' . PHP_EOL; + exit; +} +$htmlpurifier_c = preg_replace( + '/public \$version = \'.+?\';/', + "public \$version = '$version';", + $htmlpurifier_c, + 1, $c +); +if (!$c) { + echo 'Could not update HTMLPurifier.php, missing public $version.' . PHP_EOL; + exit; +} +$htmlpurifier_c = preg_replace( + '/const VERSION = \'.+?\';/', + "const VERSION = '$version';", + $htmlpurifier_c, + 1, $c +); +if (!$c) { + echo 'Could not update HTMLPurifier.php, missing const $version.' . PHP_EOL; + exit; +} +file_put_contents('library/HTMLPurifier.php', $htmlpurifier_c); + +$config_c = file_get_contents('library/HTMLPurifier/Config.php'); +$config_c = preg_replace( + '/public \$version = \'.+?\';/', + "public \$version = '$version';", + $config_c, + 1, $c +); +if (!$c) { + echo 'Could not update Config.php, missing public $version.' . PHP_EOL; + exit; +} +file_put_contents('library/HTMLPurifier/Config.php', $config_c); + +passthru('php maintenance/flush.php'); + +if ($is_dev) echo "Review changes, write something in WHATSNEW and FOCUS, and then commit with log 'Release $version.'" . PHP_EOL; +else echo "Numbers updated to dev, no other modifications necessary!"; + +// vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/release2-tag.php b/vendor/ezyang/htmlpurifier/release2-tag.php new file mode 100644 index 000000000..25e5300d8 --- /dev/null +++ b/vendor/ezyang/htmlpurifier/release2-tag.php @@ -0,0 +1,22 @@ +minify(); +} catch (Exception $e) { + fwrite(STDERR, $e->getMessage(), PHP_EOL); + exit(1); +} diff --git a/vendor/matthiasmullie/minify/bin/minifyjs b/vendor/matthiasmullie/minify/bin/minifyjs new file mode 100755 index 000000000..4cbe63ff8 --- /dev/null +++ b/vendor/matthiasmullie/minify/bin/minifyjs @@ -0,0 +1,45 @@ +#!/usr/bin/env php +minify(); +} catch (Exception $e) { + fwrite(STDERR, $e->getMessage(), PHP_EOL); + exit(1); +} diff --git a/vendor/matthiasmullie/minify/composer.json b/vendor/matthiasmullie/minify/composer.json new file mode 100644 index 000000000..8f81f24a9 --- /dev/null +++ b/vendor/matthiasmullie/minify/composer.json @@ -0,0 +1,35 @@ +{ + "name": "matthiasmullie/minify", + "type": "library", + "description": "CSS & JS minifier", + "keywords": ["minify", "minifier", "css", "js", "javascript"], + "homepage": "http://www.minifier.org", + "license": "MIT", + "authors": [ + { + "name": "Matthias Mullie", + "homepage": "http://www.mullie.eu", + "email": "minify@mullie.eu", + "role": "Developer" + } + ], + "require": { + "php": ">=5.3.0", + "ext-pcre": "*", + "matthiasmullie/path-converter": "~1.0" + }, + "require-dev": { + "matthiasmullie/scrapbook": "~1.0", + "phpunit/phpunit": "~4.8", + "satooshi/php-coveralls": "~1.0" + }, + "autoload": { + "psr-4": { + "MatthiasMullie\\Minify\\": "src/" + } + }, + "bin": [ + "bin/minifycss", + "bin/minifyjs" + ] +} diff --git a/vendor/matthiasmullie/minify/data/js/keywords_after.txt b/vendor/matthiasmullie/minify/data/js/keywords_after.txt new file mode 100644 index 000000000..5c8cba7f3 --- /dev/null +++ b/vendor/matthiasmullie/minify/data/js/keywords_after.txt @@ -0,0 +1,7 @@ +in +public +extends +private +protected +implements +instanceof \ No newline at end of file diff --git a/vendor/matthiasmullie/minify/data/js/keywords_before.txt b/vendor/matthiasmullie/minify/data/js/keywords_before.txt new file mode 100644 index 000000000..40b4ec00c --- /dev/null +++ b/vendor/matthiasmullie/minify/data/js/keywords_before.txt @@ -0,0 +1,27 @@ +do +in +let +new +var +case +else +enum +void +with +class +const +yield +delete +export +import +public +static +typeof +extends +package +private +continue +function +protected +implements +instanceof \ No newline at end of file diff --git a/vendor/matthiasmullie/minify/data/js/keywords_reserved.txt b/vendor/matthiasmullie/minify/data/js/keywords_reserved.txt new file mode 100644 index 000000000..fa6cd0440 --- /dev/null +++ b/vendor/matthiasmullie/minify/data/js/keywords_reserved.txt @@ -0,0 +1,47 @@ +do +if +in +for +let +new +try +var +case +else +enum +eval +null +this +true +void +with +break +catch +class +const +false +super +throw +while +yield +delete +export +import +public +return +static +switch +typeof +default +extends +finally +package +private +continue +debugger +function +arguments +interface +protected +implements +instanceof diff --git a/vendor/matthiasmullie/minify/data/js/operators_after.txt b/vendor/matthiasmullie/minify/data/js/operators_after.txt new file mode 100644 index 000000000..2c110849a --- /dev/null +++ b/vendor/matthiasmullie/minify/data/js/operators_after.txt @@ -0,0 +1,45 @@ ++ +- +* +/ +% += ++= +-= +*= +/= +%= +<<= +>>= +>>>= +&= +^= +|= +& +| +^ +~ +<< +>> +>>> +== +=== +!= +!== +> +< +>= +<= +&& +|| +. +[ +] +? +: +, +; +( +) +{ +} \ No newline at end of file diff --git a/vendor/matthiasmullie/minify/data/js/operators_before.txt b/vendor/matthiasmullie/minify/data/js/operators_before.txt new file mode 100644 index 000000000..ff50d8703 --- /dev/null +++ b/vendor/matthiasmullie/minify/data/js/operators_before.txt @@ -0,0 +1,43 @@ ++ +- +* +/ +% += ++= +-= +*= +/= +%= +<<= +>>= +>>>= +&= +^= +|= +& +| +^ +~ +<< +>> +>>> +== +=== +!= +!== +> +< +>= +<= +&& +|| +! +. +[ +? +: +, +; +( +{ diff --git a/vendor/matthiasmullie/minify/src/CSS.php b/vendor/matthiasmullie/minify/src/CSS.php new file mode 100644 index 000000000..86cc2bc59 --- /dev/null +++ b/vendor/matthiasmullie/minify/src/CSS.php @@ -0,0 +1,573 @@ + + * @author Tijs Verkoyen + * @copyright Copyright (c) 2012, Matthias Mullie. All rights reserved. + * @license MIT License + */ +class CSS extends Minify +{ + /** + * @var int + */ + protected $maxImportSize = 5; + + /** + * @var string[] + */ + protected $importExtensions = array( + 'gif' => 'data:image/gif', + 'png' => 'data:image/png', + 'jpe' => 'data:image/jpeg', + 'jpg' => 'data:image/jpeg', + 'jpeg' => 'data:image/jpeg', + 'svg' => 'data:image/svg+xml', + 'woff' => 'data:application/x-font-woff', + 'tif' => 'image/tiff', + 'tiff' => 'image/tiff', + 'xbm' => 'image/x-xbitmap', + ); + + /** + * Set the maximum size if files to be imported. + * + * Files larger than this size (in kB) will not be imported into the CSS. + * Importing files into the CSS as data-uri will save you some connections, + * but we should only import relatively small decorative images so that our + * CSS file doesn't get too bulky. + * + * @param int $size Size in kB + */ + public function setMaxImportSize($size) + { + $this->maxImportSize = $size; + } + + /** + * Set the type of extensions to be imported into the CSS (to save network + * connections). + * Keys of the array should be the file extensions & respective values + * should be the data type. + * + * @param string[] $extensions Array of file extensions + */ + public function setImportExtensions(array $extensions) + { + $this->importExtensions = $extensions; + } + + /** + * Move any import statements to the top. + * + * @param $content string Nearly finished CSS content + * + * @return string + */ + protected function moveImportsToTop($content) + { + if (preg_match_all('/@import[^;]+;/', $content, $matches)) { + + // remove from content + foreach ($matches[0] as $import) { + $content = str_replace($import, '', $content); + } + + // add to top + $content = implode('', $matches[0]).$content; + }; + + return $content; + } + + /** + * Combine CSS from import statements. + * + * @import's will be loaded and their content merged into the original file, + * to save HTTP requests. + * + * @param string $source The file to combine imports for. + * @param string $content The CSS content to combine imports for. + * + * @return string + */ + protected function combineImports($source, $content) + { + $importRegexes = array( + // @import url(xxx) + '/ + # import statement + @import + + # whitespace + \s+ + + # open url() + url\( + + # (optional) open path enclosure + (?P["\']?) + + # fetch path + (?P + + # do not fetch data uris or external sources + (?!( + ["\']? + (data|https?): + )) + + .+? + ) + + # (optional) close path enclosure + (?P=quotes) + + # close url() + \) + + # (optional) trailing whitespace + \s* + + # (optional) media statement(s) + (?P[^;]*) + + # (optional) trailing whitespace + \s* + + # (optional) closing semi-colon + ;? + + /ix', + + // @import 'xxx' + '/ + + # import statement + @import + + # whitespace + \s+ + + # open path enclosure + (?P["\']) + + # fetch path + (?P + + # do not fetch data uris or external sources + (?!( + ["\']? + (data|https?): + )) + + .+? + ) + + # close path enclosure + (?P=quotes) + + # (optional) trailing whitespace + \s* + + # (optional) media statement(s) + (?P[^;]*) + + # (optional) trailing whitespace + \s* + + # (optional) closing semi-colon + ;? + + /ix', + ); + + // find all relative imports in css + $matches = array(); + foreach ($importRegexes as $importRegex) { + if (preg_match_all($importRegex, $content, $regexMatches, PREG_SET_ORDER)) { + $matches = array_merge($matches, $regexMatches); + } + } + + $search = array(); + $replace = array(); + + // loop the matches + foreach ($matches as $match) { + // get the path for the file that will be imported + $importPath = dirname($source).'/'.$match['path']; + + // only replace the import with the content if we can grab the + // content of the file + if (strlen($importPath) < PHP_MAXPATHLEN && file_exists($importPath) && is_file($importPath)) { + // grab referenced file & minify it (which may include importing + // yet other @import statements recursively) + $minifier = new static($importPath); + $importContent = $minifier->execute($source); + + // check if this is only valid for certain media + if ($match['media']) { + $importContent = '@media '.$match['media'].'{'.$importContent.'}'; + } + + // add to replacement array + $search[] = $match[0]; + $replace[] = $importContent; + } + } + + // replace the import statements + $content = str_replace($search, $replace, $content); + + return $content; + } + + /** + * Import files into the CSS, base64-ized. + * + * @url(image.jpg) images will be loaded and their content merged into the + * original file, to save HTTP requests. + * + * @param string $source The file to import files for. + * @param string $content The CSS content to import files for. + * + * @return string + */ + protected function importFiles($source, $content) + { + $extensions = array_keys($this->importExtensions); + $regex = '/url\((["\']?)((?!["\']?data:).*?\.('.implode('|', $extensions).'))\\1\)/i'; + if ($extensions && preg_match_all($regex, $content, $matches, PREG_SET_ORDER)) { + $search = array(); + $replace = array(); + + // loop the matches + foreach ($matches as $match) { + // get the path for the file that will be imported + $path = $match[2]; + $path = dirname($source).'/'.$path; + $extension = $match[3]; + + // only replace the import with the content if we're able to get + // the content of the file, and it's relatively small + $import = file_exists($path); + $import = $import && is_file($path); + $import = $import && filesize($path) <= $this->maxImportSize * 1024; + if (!$import) { + continue; + } + + // grab content && base64-ize + $importContent = $this->load($path); + $importContent = base64_encode($importContent); + + // build replacement + $search[] = $match[0]; + $replace[] = 'url('.$this->importExtensions[$extension].';base64,'.$importContent.')'; + } + + // replace the import statements + $content = str_replace($search, $replace, $content); + } + + return $content; + } + + /** + * Minify the data. + * Perform CSS optimizations. + * + * @param string[optional] $path Path to write the data to. + * + * @return string The minified data. + */ + public function execute($path = null) + { + $content = ''; + + // loop files + foreach ($this->data as $source => $css) { + /* + * Let's first take out strings & comments, since we can't just remove + * whitespace anywhere. If whitespace occurs inside a string, we should + * leave it alone. E.g.: + * p { content: "a test" } + */ + $this->extractStrings(); + $this->stripComments(); + $css = $this->replace($css); + + $css = $this->stripWhitespace($css); + $css = $this->shortenHex($css); + $css = $this->shortenZeroes($css); + $css = $this->stripEmptyTags($css); + + // restore the string we've extracted earlier + $css = $this->restoreExtractedData($css); + + /* + * If we'll save to a new path, we'll have to fix the relative paths + * to be relative no longer to the source file, but to the new path. + * If we don't write to a file, fall back to same path so no + * conversion happens (because we still want it to go through most + * of the move code...) + */ + $source = $source ?: ''; + $converter = new Converter($source, $path ?: $source); + $css = $this->move($converter, $css); + + // if no target path is given, relative paths were not converted, so + // they'll still be relative to the source file then + $css = $this->importFiles($path ?: $source, $css); + $css = $this->combineImports($path ?: $source, $css); + + // combine css + $content .= $css; + } + + $content = $this->moveImportsToTop($content); + + return $content; + } + + /** + * Moving a css file should update all relative urls. + * Relative references (e.g. ../images/image.gif) in a certain css file, + * will have to be updated when a file is being saved at another location + * (e.g. ../../images/image.gif, if the new CSS file is 1 folder deeper). + * + * @param Converter $converter Relative path converter + * @param string $content The CSS content to update relative urls for. + * + * @return string + */ + protected function move(Converter $converter, $content) + { + /* + * Relative path references will usually be enclosed by url(). @import + * is an exception, where url() is not necessary around the path (but is + * allowed). + * This *could* be 1 regular expression, where both regular expressions + * in this array are on different sides of a |. But we're using named + * patterns in both regexes, the same name on both regexes. This is only + * possible with a (?J) modifier, but that only works after a fairly + * recent PCRE version. That's why I'm doing 2 separate regular + * expressions & combining the matches after executing of both. + */ + $relativeRegexes = array( + // url(xxx) + '/ + # open url() + url\( + + \s* + + # open path enclosure + (?P["\'])? + + # fetch path + (?P + + # do not fetch data uris or external sources + (?!( + \s? + ["\']? + (data|https?): + )) + + .+? + ) + + # close path enclosure + (?(quotes)(?P=quotes)) + + \s* + + # close url() + \) + + /ix', + + // @import "xxx" + '/ + # import statement + @import + + # whitespace + \s+ + + # we don\'t have to check for @import url(), because the + # condition above will already catch these + + # open path enclosure + (?P["\']) + + # fetch path + (?P + + # do not fetch data uris or external sources + (?!( + ["\']? + (data|https?): + )) + + .+? + ) + + # close path enclosure + (?P=quotes) + + /ix', + ); + + // find all relative urls in css + $matches = array(); + foreach ($relativeRegexes as $relativeRegex) { + if (preg_match_all($relativeRegex, $content, $regexMatches, PREG_SET_ORDER)) { + $matches = array_merge($matches, $regexMatches); + } + } + + $search = array(); + $replace = array(); + + // loop all urls + foreach ($matches as $match) { + // determine if it's a url() or an @import match + $type = (strpos($match[0], '@import') === 0 ? 'import' : 'url'); + + // fix relative url + $url = $converter->convert($match['path']); + + // build replacement + $search[] = $match[0]; + if ($type == 'url') { + $replace[] = 'url('.$url.')'; + } elseif ($type == 'import') { + $replace[] = '@import "'.$url.'"'; + } + } + + // replace urls + $content = str_replace($search, $replace, $content); + + return $content; + } + + /** + * Shorthand hex color codes. + * #FF0000 -> #F00. + * + * @param string $content The CSS content to shorten the hex color codes for. + * + * @return string + */ + protected function shortenHex($content) + { + $content = preg_replace('/(? 0) + // NOTE: it should be safe to remove all units for a 0 value, but in + // practice, Webkit (especially Safari) seems to stumble over at least + // 0%, potentially other units as well. Only stripping 'px' for now. + // @see https://github.com/matthiasmullie/minify/issues/60 + $content = preg_replace('/'.$before.'(-?0*(\.0+)?)(?<=0)px'.$after.'/', '\\1', $content); + + // strip 0-digits (.0 -> 0) + $content = preg_replace('/'.$before.'\.0+'.$units.'?'.$after.'/', '0\\1', $content); + // strip trailing 0: 50.10 -> 50.1, 50.10px -> 50.1px + $content = preg_replace('/'.$before.'(-?[0-9]+\.[0-9]+)0+'.$units.'?'.$after.'/', '\\1\\2', $content); + // strip trailing 0: 50.00 -> 50, 50.00px -> 50px + $content = preg_replace('/'.$before.'(-?[0-9]+)\.0+'.$units.'?'.$after.'/', '\\1\\2', $content); + // strip leading 0: 0.1 -> .1, 01.1 -> 1.1 + $content = preg_replace('/'.$before.'(-?)0+([0-9]*\.[0-9]+)'.$units.'?'.$after.'/', '\\1\\2\\3', $content); + + // strip negative zeroes (-0 -> 0) & truncate zeroes (00 -> 0) + $content = preg_replace('/'.$before.'-?0+'.$units.'?'.$after.'/', '0\\1', $content); + + return $content; + } + + /** + * Strip comments from source code. + * + * @param string $content + * @return string + */ + protected function stripEmptyTags($content) + { + return preg_replace('/(^|\})[^\{]+\{\s*\}/', '\\1', $content); + } + + /** + * Strip comments from source code. + */ + protected function stripComments() + { + $this->registerPattern('/\/\*.*?\*\//s', ''); + } + + /** + * Strip whitespace. + * + * @param string $content The CSS content to strip the whitespace for. + * + * @return string + */ + protected function stripWhitespace($content) + { + // remove leading & trailing whitespace + $content = preg_replace('/^\s*/m', '', $content); + $content = preg_replace('/\s*$/m', '', $content); + + // replace newlines with a single space + $content = preg_replace('/\s+/', ' ', $content); + + // remove whitespace around meta characters + // inspired by stackoverflow.com/questions/15195750/minify-compress-css-with-regex + $content = preg_replace('/\s*([\*$~^|]?+=|[{};,>~]|!important\b)\s*/', '$1', $content); + $content = preg_replace('/([\[(:])\s+/', '$1', $content); + $content = preg_replace('/\s+([\]\)])/', '$1', $content); + $content = preg_replace('/\s+(:)(?![^\}]*\{)/', '$1', $content); + + // whitespace around + and - can only be stripped in selectors, like + // :nth-child(3+2n), not in things like calc(3px + 2px) or shorthands + // like 3px -2px + $content = preg_replace('/\s*([+-])\s*(?=[^}]*{)/', '$1', $content); + + // remove semicolon/whitespace followed by closing bracket + $content = str_replace(';}', '}', $content); + + return trim($content); + } +} diff --git a/vendor/matthiasmullie/minify/src/Exception.php b/vendor/matthiasmullie/minify/src/Exception.php new file mode 100644 index 000000000..5f2af0dea --- /dev/null +++ b/vendor/matthiasmullie/minify/src/Exception.php @@ -0,0 +1,10 @@ + + */ +class Exception extends \Exception +{ +} diff --git a/vendor/matthiasmullie/minify/src/JS.php b/vendor/matthiasmullie/minify/src/JS.php new file mode 100644 index 000000000..f0bd4fbcf --- /dev/null +++ b/vendor/matthiasmullie/minify/src/JS.php @@ -0,0 +1,490 @@ + + * @author Tijs Verkoyen + * @copyright Copyright (c) 2012, Matthias Mullie. All rights reserved. + * @license MIT License + */ +class JS extends Minify +{ + /** + * Var-matching regex based on http://stackoverflow.com/a/9337047/802993. + * + * Note that regular expressions using that bit must have the PCRE_UTF8 + * pattern modifier (/u) set. + * + * @var string + */ + const REGEX_VARIABLE = '\b[$A-Z\_a-z\xaa\xb5\xba\xc0-\xd6\xd8-\xf6\xf8-\x{02c1}\x{02c6}-\x{02d1}\x{02e0}-\x{02e4}\x{02ec}\x{02ee}\x{0370}-\x{0374}\x{0376}\x{0377}\x{037a}-\x{037d}\x{0386}\x{0388}-\x{038a}\x{038c}\x{038e}-\x{03a1}\x{03a3}-\x{03f5}\x{03f7}-\x{0481}\x{048a}-\x{0527}\x{0531}-\x{0556}\x{0559}\x{0561}-\x{0587}\x{05d0}-\x{05ea}\x{05f0}-\x{05f2}\x{0620}-\x{064a}\x{066e}\x{066f}\x{0671}-\x{06d3}\x{06d5}\x{06e5}\x{06e6}\x{06ee}\x{06ef}\x{06fa}-\x{06fc}\x{06ff}\x{0710}\x{0712}-\x{072f}\x{074d}-\x{07a5}\x{07b1}\x{07ca}-\x{07ea}\x{07f4}\x{07f5}\x{07fa}\x{0800}-\x{0815}\x{081a}\x{0824}\x{0828}\x{0840}-\x{0858}\x{08a0}\x{08a2}-\x{08ac}\x{0904}-\x{0939}\x{093d}\x{0950}\x{0958}-\x{0961}\x{0971}-\x{0977}\x{0979}-\x{097f}\x{0985}-\x{098c}\x{098f}\x{0990}\x{0993}-\x{09a8}\x{09aa}-\x{09b0}\x{09b2}\x{09b6}-\x{09b9}\x{09bd}\x{09ce}\x{09dc}\x{09dd}\x{09df}-\x{09e1}\x{09f0}\x{09f1}\x{0a05}-\x{0a0a}\x{0a0f}\x{0a10}\x{0a13}-\x{0a28}\x{0a2a}-\x{0a30}\x{0a32}\x{0a33}\x{0a35}\x{0a36}\x{0a38}\x{0a39}\x{0a59}-\x{0a5c}\x{0a5e}\x{0a72}-\x{0a74}\x{0a85}-\x{0a8d}\x{0a8f}-\x{0a91}\x{0a93}-\x{0aa8}\x{0aaa}-\x{0ab0}\x{0ab2}\x{0ab3}\x{0ab5}-\x{0ab9}\x{0abd}\x{0ad0}\x{0ae0}\x{0ae1}\x{0b05}-\x{0b0c}\x{0b0f}\x{0b10}\x{0b13}-\x{0b28}\x{0b2a}-\x{0b30}\x{0b32}\x{0b33}\x{0b35}-\x{0b39}\x{0b3d}\x{0b5c}\x{0b5d}\x{0b5f}-\x{0b61}\x{0b71}\x{0b83}\x{0b85}-\x{0b8a}\x{0b8e}-\x{0b90}\x{0b92}-\x{0b95}\x{0b99}\x{0b9a}\x{0b9c}\x{0b9e}\x{0b9f}\x{0ba3}\x{0ba4}\x{0ba8}-\x{0baa}\x{0bae}-\x{0bb9}\x{0bd0}\x{0c05}-\x{0c0c}\x{0c0e}-\x{0c10}\x{0c12}-\x{0c28}\x{0c2a}-\x{0c33}\x{0c35}-\x{0c39}\x{0c3d}\x{0c58}\x{0c59}\x{0c60}\x{0c61}\x{0c85}-\x{0c8c}\x{0c8e}-\x{0c90}\x{0c92}-\x{0ca8}\x{0caa}-\x{0cb3}\x{0cb5}-\x{0cb9}\x{0cbd}\x{0cde}\x{0ce0}\x{0ce1}\x{0cf1}\x{0cf2}\x{0d05}-\x{0d0c}\x{0d0e}-\x{0d10}\x{0d12}-\x{0d3a}\x{0d3d}\x{0d4e}\x{0d60}\x{0d61}\x{0d7a}-\x{0d7f}\x{0d85}-\x{0d96}\x{0d9a}-\x{0db1}\x{0db3}-\x{0dbb}\x{0dbd}\x{0dc0}-\x{0dc6}\x{0e01}-\x{0e30}\x{0e32}\x{0e33}\x{0e40}-\x{0e46}\x{0e81}\x{0e82}\x{0e84}\x{0e87}\x{0e88}\x{0e8a}\x{0e8d}\x{0e94}-\x{0e97}\x{0e99}-\x{0e9f}\x{0ea1}-\x{0ea3}\x{0ea5}\x{0ea7}\x{0eaa}\x{0eab}\x{0ead}-\x{0eb0}\x{0eb2}\x{0eb3}\x{0ebd}\x{0ec0}-\x{0ec4}\x{0ec6}\x{0edc}-\x{0edf}\x{0f00}\x{0f40}-\x{0f47}\x{0f49}-\x{0f6c}\x{0f88}-\x{0f8c}\x{1000}-\x{102a}\x{103f}\x{1050}-\x{1055}\x{105a}-\x{105d}\x{1061}\x{1065}\x{1066}\x{106e}-\x{1070}\x{1075}-\x{1081}\x{108e}\x{10a0}-\x{10c5}\x{10c7}\x{10cd}\x{10d0}-\x{10fa}\x{10fc}-\x{1248}\x{124a}-\x{124d}\x{1250}-\x{1256}\x{1258}\x{125a}-\x{125d}\x{1260}-\x{1288}\x{128a}-\x{128d}\x{1290}-\x{12b0}\x{12b2}-\x{12b5}\x{12b8}-\x{12be}\x{12c0}\x{12c2}-\x{12c5}\x{12c8}-\x{12d6}\x{12d8}-\x{1310}\x{1312}-\x{1315}\x{1318}-\x{135a}\x{1380}-\x{138f}\x{13a0}-\x{13f4}\x{1401}-\x{166c}\x{166f}-\x{167f}\x{1681}-\x{169a}\x{16a0}-\x{16ea}\x{16ee}-\x{16f0}\x{1700}-\x{170c}\x{170e}-\x{1711}\x{1720}-\x{1731}\x{1740}-\x{1751}\x{1760}-\x{176c}\x{176e}-\x{1770}\x{1780}-\x{17b3}\x{17d7}\x{17dc}\x{1820}-\x{1877}\x{1880}-\x{18a8}\x{18aa}\x{18b0}-\x{18f5}\x{1900}-\x{191c}\x{1950}-\x{196d}\x{1970}-\x{1974}\x{1980}-\x{19ab}\x{19c1}-\x{19c7}\x{1a00}-\x{1a16}\x{1a20}-\x{1a54}\x{1aa7}\x{1b05}-\x{1b33}\x{1b45}-\x{1b4b}\x{1b83}-\x{1ba0}\x{1bae}\x{1baf}\x{1bba}-\x{1be5}\x{1c00}-\x{1c23}\x{1c4d}-\x{1c4f}\x{1c5a}-\x{1c7d}\x{1ce9}-\x{1cec}\x{1cee}-\x{1cf1}\x{1cf5}\x{1cf6}\x{1d00}-\x{1dbf}\x{1e00}-\x{1f15}\x{1f18}-\x{1f1d}\x{1f20}-\x{1f45}\x{1f48}-\x{1f4d}\x{1f50}-\x{1f57}\x{1f59}\x{1f5b}\x{1f5d}\x{1f5f}-\x{1f7d}\x{1f80}-\x{1fb4}\x{1fb6}-\x{1fbc}\x{1fbe}\x{1fc2}-\x{1fc4}\x{1fc6}-\x{1fcc}\x{1fd0}-\x{1fd3}\x{1fd6}-\x{1fdb}\x{1fe0}-\x{1fec}\x{1ff2}-\x{1ff4}\x{1ff6}-\x{1ffc}\x{2071}\x{207f}\x{2090}-\x{209c}\x{2102}\x{2107}\x{210a}-\x{2113}\x{2115}\x{2119}-\x{211d}\x{2124}\x{2126}\x{2128}\x{212a}-\x{212d}\x{212f}-\x{2139}\x{213c}-\x{213f}\x{2145}-\x{2149}\x{214e}\x{2160}-\x{2188}\x{2c00}-\x{2c2e}\x{2c30}-\x{2c5e}\x{2c60}-\x{2ce4}\x{2ceb}-\x{2cee}\x{2cf2}\x{2cf3}\x{2d00}-\x{2d25}\x{2d27}\x{2d2d}\x{2d30}-\x{2d67}\x{2d6f}\x{2d80}-\x{2d96}\x{2da0}-\x{2da6}\x{2da8}-\x{2dae}\x{2db0}-\x{2db6}\x{2db8}-\x{2dbe}\x{2dc0}-\x{2dc6}\x{2dc8}-\x{2dce}\x{2dd0}-\x{2dd6}\x{2dd8}-\x{2dde}\x{2e2f}\x{3005}-\x{3007}\x{3021}-\x{3029}\x{3031}-\x{3035}\x{3038}-\x{303c}\x{3041}-\x{3096}\x{309d}-\x{309f}\x{30a1}-\x{30fa}\x{30fc}-\x{30ff}\x{3105}-\x{312d}\x{3131}-\x{318e}\x{31a0}-\x{31ba}\x{31f0}-\x{31ff}\x{3400}-\x{4db5}\x{4e00}-\x{9fcc}\x{a000}-\x{a48c}\x{a4d0}-\x{a4fd}\x{a500}-\x{a60c}\x{a610}-\x{a61f}\x{a62a}\x{a62b}\x{a640}-\x{a66e}\x{a67f}-\x{a697}\x{a6a0}-\x{a6ef}\x{a717}-\x{a71f}\x{a722}-\x{a788}\x{a78b}-\x{a78e}\x{a790}-\x{a793}\x{a7a0}-\x{a7aa}\x{a7f8}-\x{a801}\x{a803}-\x{a805}\x{a807}-\x{a80a}\x{a80c}-\x{a822}\x{a840}-\x{a873}\x{a882}-\x{a8b3}\x{a8f2}-\x{a8f7}\x{a8fb}\x{a90a}-\x{a925}\x{a930}-\x{a946}\x{a960}-\x{a97c}\x{a984}-\x{a9b2}\x{a9cf}\x{aa00}-\x{aa28}\x{aa40}-\x{aa42}\x{aa44}-\x{aa4b}\x{aa60}-\x{aa76}\x{aa7a}\x{aa80}-\x{aaaf}\x{aab1}\x{aab5}\x{aab6}\x{aab9}-\x{aabd}\x{aac0}\x{aac2}\x{aadb}-\x{aadd}\x{aae0}-\x{aaea}\x{aaf2}-\x{aaf4}\x{ab01}-\x{ab06}\x{ab09}-\x{ab0e}\x{ab11}-\x{ab16}\x{ab20}-\x{ab26}\x{ab28}-\x{ab2e}\x{abc0}-\x{abe2}\x{ac00}-\x{d7a3}\x{d7b0}-\x{d7c6}\x{d7cb}-\x{d7fb}\x{f900}-\x{fa6d}\x{fa70}-\x{fad9}\x{fb00}-\x{fb06}\x{fb13}-\x{fb17}\x{fb1d}\x{fb1f}-\x{fb28}\x{fb2a}-\x{fb36}\x{fb38}-\x{fb3c}\x{fb3e}\x{fb40}\x{fb41}\x{fb43}\x{fb44}\x{fb46}-\x{fbb1}\x{fbd3}-\x{fd3d}\x{fd50}-\x{fd8f}\x{fd92}-\x{fdc7}\x{fdf0}-\x{fdfb}\x{fe70}-\x{fe74}\x{fe76}-\x{fefc}\x{ff21}-\x{ff3a}\x{ff41}-\x{ff5a}\x{ff66}-\x{ffbe}\x{ffc2}-\x{ffc7}\x{ffca}-\x{ffcf}\x{ffd2}-\x{ffd7}\x{ffda}-\x{ffdc}][$A-Z\_a-z\xaa\xb5\xba\xc0-\xd6\xd8-\xf6\xf8-\x{02c1}\x{02c6}-\x{02d1}\x{02e0}-\x{02e4}\x{02ec}\x{02ee}\x{0370}-\x{0374}\x{0376}\x{0377}\x{037a}-\x{037d}\x{0386}\x{0388}-\x{038a}\x{038c}\x{038e}-\x{03a1}\x{03a3}-\x{03f5}\x{03f7}-\x{0481}\x{048a}-\x{0527}\x{0531}-\x{0556}\x{0559}\x{0561}-\x{0587}\x{05d0}-\x{05ea}\x{05f0}-\x{05f2}\x{0620}-\x{064a}\x{066e}\x{066f}\x{0671}-\x{06d3}\x{06d5}\x{06e5}\x{06e6}\x{06ee}\x{06ef}\x{06fa}-\x{06fc}\x{06ff}\x{0710}\x{0712}-\x{072f}\x{074d}-\x{07a5}\x{07b1}\x{07ca}-\x{07ea}\x{07f4}\x{07f5}\x{07fa}\x{0800}-\x{0815}\x{081a}\x{0824}\x{0828}\x{0840}-\x{0858}\x{08a0}\x{08a2}-\x{08ac}\x{0904}-\x{0939}\x{093d}\x{0950}\x{0958}-\x{0961}\x{0971}-\x{0977}\x{0979}-\x{097f}\x{0985}-\x{098c}\x{098f}\x{0990}\x{0993}-\x{09a8}\x{09aa}-\x{09b0}\x{09b2}\x{09b6}-\x{09b9}\x{09bd}\x{09ce}\x{09dc}\x{09dd}\x{09df}-\x{09e1}\x{09f0}\x{09f1}\x{0a05}-\x{0a0a}\x{0a0f}\x{0a10}\x{0a13}-\x{0a28}\x{0a2a}-\x{0a30}\x{0a32}\x{0a33}\x{0a35}\x{0a36}\x{0a38}\x{0a39}\x{0a59}-\x{0a5c}\x{0a5e}\x{0a72}-\x{0a74}\x{0a85}-\x{0a8d}\x{0a8f}-\x{0a91}\x{0a93}-\x{0aa8}\x{0aaa}-\x{0ab0}\x{0ab2}\x{0ab3}\x{0ab5}-\x{0ab9}\x{0abd}\x{0ad0}\x{0ae0}\x{0ae1}\x{0b05}-\x{0b0c}\x{0b0f}\x{0b10}\x{0b13}-\x{0b28}\x{0b2a}-\x{0b30}\x{0b32}\x{0b33}\x{0b35}-\x{0b39}\x{0b3d}\x{0b5c}\x{0b5d}\x{0b5f}-\x{0b61}\x{0b71}\x{0b83}\x{0b85}-\x{0b8a}\x{0b8e}-\x{0b90}\x{0b92}-\x{0b95}\x{0b99}\x{0b9a}\x{0b9c}\x{0b9e}\x{0b9f}\x{0ba3}\x{0ba4}\x{0ba8}-\x{0baa}\x{0bae}-\x{0bb9}\x{0bd0}\x{0c05}-\x{0c0c}\x{0c0e}-\x{0c10}\x{0c12}-\x{0c28}\x{0c2a}-\x{0c33}\x{0c35}-\x{0c39}\x{0c3d}\x{0c58}\x{0c59}\x{0c60}\x{0c61}\x{0c85}-\x{0c8c}\x{0c8e}-\x{0c90}\x{0c92}-\x{0ca8}\x{0caa}-\x{0cb3}\x{0cb5}-\x{0cb9}\x{0cbd}\x{0cde}\x{0ce0}\x{0ce1}\x{0cf1}\x{0cf2}\x{0d05}-\x{0d0c}\x{0d0e}-\x{0d10}\x{0d12}-\x{0d3a}\x{0d3d}\x{0d4e}\x{0d60}\x{0d61}\x{0d7a}-\x{0d7f}\x{0d85}-\x{0d96}\x{0d9a}-\x{0db1}\x{0db3}-\x{0dbb}\x{0dbd}\x{0dc0}-\x{0dc6}\x{0e01}-\x{0e30}\x{0e32}\x{0e33}\x{0e40}-\x{0e46}\x{0e81}\x{0e82}\x{0e84}\x{0e87}\x{0e88}\x{0e8a}\x{0e8d}\x{0e94}-\x{0e97}\x{0e99}-\x{0e9f}\x{0ea1}-\x{0ea3}\x{0ea5}\x{0ea7}\x{0eaa}\x{0eab}\x{0ead}-\x{0eb0}\x{0eb2}\x{0eb3}\x{0ebd}\x{0ec0}-\x{0ec4}\x{0ec6}\x{0edc}-\x{0edf}\x{0f00}\x{0f40}-\x{0f47}\x{0f49}-\x{0f6c}\x{0f88}-\x{0f8c}\x{1000}-\x{102a}\x{103f}\x{1050}-\x{1055}\x{105a}-\x{105d}\x{1061}\x{1065}\x{1066}\x{106e}-\x{1070}\x{1075}-\x{1081}\x{108e}\x{10a0}-\x{10c5}\x{10c7}\x{10cd}\x{10d0}-\x{10fa}\x{10fc}-\x{1248}\x{124a}-\x{124d}\x{1250}-\x{1256}\x{1258}\x{125a}-\x{125d}\x{1260}-\x{1288}\x{128a}-\x{128d}\x{1290}-\x{12b0}\x{12b2}-\x{12b5}\x{12b8}-\x{12be}\x{12c0}\x{12c2}-\x{12c5}\x{12c8}-\x{12d6}\x{12d8}-\x{1310}\x{1312}-\x{1315}\x{1318}-\x{135a}\x{1380}-\x{138f}\x{13a0}-\x{13f4}\x{1401}-\x{166c}\x{166f}-\x{167f}\x{1681}-\x{169a}\x{16a0}-\x{16ea}\x{16ee}-\x{16f0}\x{1700}-\x{170c}\x{170e}-\x{1711}\x{1720}-\x{1731}\x{1740}-\x{1751}\x{1760}-\x{176c}\x{176e}-\x{1770}\x{1780}-\x{17b3}\x{17d7}\x{17dc}\x{1820}-\x{1877}\x{1880}-\x{18a8}\x{18aa}\x{18b0}-\x{18f5}\x{1900}-\x{191c}\x{1950}-\x{196d}\x{1970}-\x{1974}\x{1980}-\x{19ab}\x{19c1}-\x{19c7}\x{1a00}-\x{1a16}\x{1a20}-\x{1a54}\x{1aa7}\x{1b05}-\x{1b33}\x{1b45}-\x{1b4b}\x{1b83}-\x{1ba0}\x{1bae}\x{1baf}\x{1bba}-\x{1be5}\x{1c00}-\x{1c23}\x{1c4d}-\x{1c4f}\x{1c5a}-\x{1c7d}\x{1ce9}-\x{1cec}\x{1cee}-\x{1cf1}\x{1cf5}\x{1cf6}\x{1d00}-\x{1dbf}\x{1e00}-\x{1f15}\x{1f18}-\x{1f1d}\x{1f20}-\x{1f45}\x{1f48}-\x{1f4d}\x{1f50}-\x{1f57}\x{1f59}\x{1f5b}\x{1f5d}\x{1f5f}-\x{1f7d}\x{1f80}-\x{1fb4}\x{1fb6}-\x{1fbc}\x{1fbe}\x{1fc2}-\x{1fc4}\x{1fc6}-\x{1fcc}\x{1fd0}-\x{1fd3}\x{1fd6}-\x{1fdb}\x{1fe0}-\x{1fec}\x{1ff2}-\x{1ff4}\x{1ff6}-\x{1ffc}\x{2071}\x{207f}\x{2090}-\x{209c}\x{2102}\x{2107}\x{210a}-\x{2113}\x{2115}\x{2119}-\x{211d}\x{2124}\x{2126}\x{2128}\x{212a}-\x{212d}\x{212f}-\x{2139}\x{213c}-\x{213f}\x{2145}-\x{2149}\x{214e}\x{2160}-\x{2188}\x{2c00}-\x{2c2e}\x{2c30}-\x{2c5e}\x{2c60}-\x{2ce4}\x{2ceb}-\x{2cee}\x{2cf2}\x{2cf3}\x{2d00}-\x{2d25}\x{2d27}\x{2d2d}\x{2d30}-\x{2d67}\x{2d6f}\x{2d80}-\x{2d96}\x{2da0}-\x{2da6}\x{2da8}-\x{2dae}\x{2db0}-\x{2db6}\x{2db8}-\x{2dbe}\x{2dc0}-\x{2dc6}\x{2dc8}-\x{2dce}\x{2dd0}-\x{2dd6}\x{2dd8}-\x{2dde}\x{2e2f}\x{3005}-\x{3007}\x{3021}-\x{3029}\x{3031}-\x{3035}\x{3038}-\x{303c}\x{3041}-\x{3096}\x{309d}-\x{309f}\x{30a1}-\x{30fa}\x{30fc}-\x{30ff}\x{3105}-\x{312d}\x{3131}-\x{318e}\x{31a0}-\x{31ba}\x{31f0}-\x{31ff}\x{3400}-\x{4db5}\x{4e00}-\x{9fcc}\x{a000}-\x{a48c}\x{a4d0}-\x{a4fd}\x{a500}-\x{a60c}\x{a610}-\x{a61f}\x{a62a}\x{a62b}\x{a640}-\x{a66e}\x{a67f}-\x{a697}\x{a6a0}-\x{a6ef}\x{a717}-\x{a71f}\x{a722}-\x{a788}\x{a78b}-\x{a78e}\x{a790}-\x{a793}\x{a7a0}-\x{a7aa}\x{a7f8}-\x{a801}\x{a803}-\x{a805}\x{a807}-\x{a80a}\x{a80c}-\x{a822}\x{a840}-\x{a873}\x{a882}-\x{a8b3}\x{a8f2}-\x{a8f7}\x{a8fb}\x{a90a}-\x{a925}\x{a930}-\x{a946}\x{a960}-\x{a97c}\x{a984}-\x{a9b2}\x{a9cf}\x{aa00}-\x{aa28}\x{aa40}-\x{aa42}\x{aa44}-\x{aa4b}\x{aa60}-\x{aa76}\x{aa7a}\x{aa80}-\x{aaaf}\x{aab1}\x{aab5}\x{aab6}\x{aab9}-\x{aabd}\x{aac0}\x{aac2}\x{aadb}-\x{aadd}\x{aae0}-\x{aaea}\x{aaf2}-\x{aaf4}\x{ab01}-\x{ab06}\x{ab09}-\x{ab0e}\x{ab11}-\x{ab16}\x{ab20}-\x{ab26}\x{ab28}-\x{ab2e}\x{abc0}-\x{abe2}\x{ac00}-\x{d7a3}\x{d7b0}-\x{d7c6}\x{d7cb}-\x{d7fb}\x{f900}-\x{fa6d}\x{fa70}-\x{fad9}\x{fb00}-\x{fb06}\x{fb13}-\x{fb17}\x{fb1d}\x{fb1f}-\x{fb28}\x{fb2a}-\x{fb36}\x{fb38}-\x{fb3c}\x{fb3e}\x{fb40}\x{fb41}\x{fb43}\x{fb44}\x{fb46}-\x{fbb1}\x{fbd3}-\x{fd3d}\x{fd50}-\x{fd8f}\x{fd92}-\x{fdc7}\x{fdf0}-\x{fdfb}\x{fe70}-\x{fe74}\x{fe76}-\x{fefc}\x{ff21}-\x{ff3a}\x{ff41}-\x{ff5a}\x{ff66}-\x{ffbe}\x{ffc2}-\x{ffc7}\x{ffca}-\x{ffcf}\x{ffd2}-\x{ffd7}\x{ffda}-\x{ffdc}0-9\x{0300}-\x{036f}\x{0483}-\x{0487}\x{0591}-\x{05bd}\x{05bf}\x{05c1}\x{05c2}\x{05c4}\x{05c5}\x{05c7}\x{0610}-\x{061a}\x{064b}-\x{0669}\x{0670}\x{06d6}-\x{06dc}\x{06df}-\x{06e4}\x{06e7}\x{06e8}\x{06ea}-\x{06ed}\x{06f0}-\x{06f9}\x{0711}\x{0730}-\x{074a}\x{07a6}-\x{07b0}\x{07c0}-\x{07c9}\x{07eb}-\x{07f3}\x{0816}-\x{0819}\x{081b}-\x{0823}\x{0825}-\x{0827}\x{0829}-\x{082d}\x{0859}-\x{085b}\x{08e4}-\x{08fe}\x{0900}-\x{0903}\x{093a}-\x{093c}\x{093e}-\x{094f}\x{0951}-\x{0957}\x{0962}\x{0963}\x{0966}-\x{096f}\x{0981}-\x{0983}\x{09bc}\x{09be}-\x{09c4}\x{09c7}\x{09c8}\x{09cb}-\x{09cd}\x{09d7}\x{09e2}\x{09e3}\x{09e6}-\x{09ef}\x{0a01}-\x{0a03}\x{0a3c}\x{0a3e}-\x{0a42}\x{0a47}\x{0a48}\x{0a4b}-\x{0a4d}\x{0a51}\x{0a66}-\x{0a71}\x{0a75}\x{0a81}-\x{0a83}\x{0abc}\x{0abe}-\x{0ac5}\x{0ac7}-\x{0ac9}\x{0acb}-\x{0acd}\x{0ae2}\x{0ae3}\x{0ae6}-\x{0aef}\x{0b01}-\x{0b03}\x{0b3c}\x{0b3e}-\x{0b44}\x{0b47}\x{0b48}\x{0b4b}-\x{0b4d}\x{0b56}\x{0b57}\x{0b62}\x{0b63}\x{0b66}-\x{0b6f}\x{0b82}\x{0bbe}-\x{0bc2}\x{0bc6}-\x{0bc8}\x{0bca}-\x{0bcd}\x{0bd7}\x{0be6}-\x{0bef}\x{0c01}-\x{0c03}\x{0c3e}-\x{0c44}\x{0c46}-\x{0c48}\x{0c4a}-\x{0c4d}\x{0c55}\x{0c56}\x{0c62}\x{0c63}\x{0c66}-\x{0c6f}\x{0c82}\x{0c83}\x{0cbc}\x{0cbe}-\x{0cc4}\x{0cc6}-\x{0cc8}\x{0cca}-\x{0ccd}\x{0cd5}\x{0cd6}\x{0ce2}\x{0ce3}\x{0ce6}-\x{0cef}\x{0d02}\x{0d03}\x{0d3e}-\x{0d44}\x{0d46}-\x{0d48}\x{0d4a}-\x{0d4d}\x{0d57}\x{0d62}\x{0d63}\x{0d66}-\x{0d6f}\x{0d82}\x{0d83}\x{0dca}\x{0dcf}-\x{0dd4}\x{0dd6}\x{0dd8}-\x{0ddf}\x{0df2}\x{0df3}\x{0e31}\x{0e34}-\x{0e3a}\x{0e47}-\x{0e4e}\x{0e50}-\x{0e59}\x{0eb1}\x{0eb4}-\x{0eb9}\x{0ebb}\x{0ebc}\x{0ec8}-\x{0ecd}\x{0ed0}-\x{0ed9}\x{0f18}\x{0f19}\x{0f20}-\x{0f29}\x{0f35}\x{0f37}\x{0f39}\x{0f3e}\x{0f3f}\x{0f71}-\x{0f84}\x{0f86}\x{0f87}\x{0f8d}-\x{0f97}\x{0f99}-\x{0fbc}\x{0fc6}\x{102b}-\x{103e}\x{1040}-\x{1049}\x{1056}-\x{1059}\x{105e}-\x{1060}\x{1062}-\x{1064}\x{1067}-\x{106d}\x{1071}-\x{1074}\x{1082}-\x{108d}\x{108f}-\x{109d}\x{135d}-\x{135f}\x{1712}-\x{1714}\x{1732}-\x{1734}\x{1752}\x{1753}\x{1772}\x{1773}\x{17b4}-\x{17d3}\x{17dd}\x{17e0}-\x{17e9}\x{180b}-\x{180d}\x{1810}-\x{1819}\x{18a9}\x{1920}-\x{192b}\x{1930}-\x{193b}\x{1946}-\x{194f}\x{19b0}-\x{19c0}\x{19c8}\x{19c9}\x{19d0}-\x{19d9}\x{1a17}-\x{1a1b}\x{1a55}-\x{1a5e}\x{1a60}-\x{1a7c}\x{1a7f}-\x{1a89}\x{1a90}-\x{1a99}\x{1b00}-\x{1b04}\x{1b34}-\x{1b44}\x{1b50}-\x{1b59}\x{1b6b}-\x{1b73}\x{1b80}-\x{1b82}\x{1ba1}-\x{1bad}\x{1bb0}-\x{1bb9}\x{1be6}-\x{1bf3}\x{1c24}-\x{1c37}\x{1c40}-\x{1c49}\x{1c50}-\x{1c59}\x{1cd0}-\x{1cd2}\x{1cd4}-\x{1ce8}\x{1ced}\x{1cf2}-\x{1cf4}\x{1dc0}-\x{1de6}\x{1dfc}-\x{1dff}\x{200c}\x{200d}\x{203f}\x{2040}\x{2054}\x{20d0}-\x{20dc}\x{20e1}\x{20e5}-\x{20f0}\x{2cef}-\x{2cf1}\x{2d7f}\x{2de0}-\x{2dff}\x{302a}-\x{302f}\x{3099}\x{309a}\x{a620}-\x{a629}\x{a66f}\x{a674}-\x{a67d}\x{a69f}\x{a6f0}\x{a6f1}\x{a802}\x{a806}\x{a80b}\x{a823}-\x{a827}\x{a880}\x{a881}\x{a8b4}-\x{a8c4}\x{a8d0}-\x{a8d9}\x{a8e0}-\x{a8f1}\x{a900}-\x{a909}\x{a926}-\x{a92d}\x{a947}-\x{a953}\x{a980}-\x{a983}\x{a9b3}-\x{a9c0}\x{a9d0}-\x{a9d9}\x{aa29}-\x{aa36}\x{aa43}\x{aa4c}\x{aa4d}\x{aa50}-\x{aa59}\x{aa7b}\x{aab0}\x{aab2}-\x{aab4}\x{aab7}\x{aab8}\x{aabe}\x{aabf}\x{aac1}\x{aaeb}-\x{aaef}\x{aaf5}\x{aaf6}\x{abe3}-\x{abea}\x{abec}\x{abed}\x{abf0}-\x{abf9}\x{fb1e}\x{fe00}-\x{fe0f}\x{fe20}-\x{fe26}\x{fe33}\x{fe34}\x{fe4d}-\x{fe4f}\x{ff10}-\x{ff19}\x{ff3f}]*\b'; + + /** + * Full list of JavaScript reserved words. + * Will be loaded from /data/js/keywords_reserved.txt. + * + * @see https://mathiasbynens.be/notes/reserved-keywords + * + * @var string[] + */ + protected $keywordsReserved = array(); + + /** + * List of JavaScript reserved words that accept a + * after them. Some end of lines are not the end of a statement, like with + * these keywords. + * + * E.g.: we shouldn't insert a ; after this else + * else + * console.log('this is quite fine') + * + * Will be loaded from /data/js/keywords_before.txt + * + * @var string[] + */ + protected $keywordsBefore = array(); + + /** + * List of JavaScript reserved words that accept a + * before them. Some end of lines are not the end of a statement, like when + * continued by one of these keywords on the newline. + * + * E.g.: we shouldn't insert a ; before this instanceof + * variable + * instanceof String + * + * Will be loaded from /data/js/keywords_after.txt + * + * @var string[] + */ + protected $keywordsAfter = array(); + + /** + * List of JavaScript operators that accept a after + * them. Some end of lines are not the end of a statement, like with these + * operators. + * + * Note: Most operators are fine, we've only removed !, ++ and --. + * There can't be a newline separating ! and whatever it is negating. + * ++ & -- have to be joined with the value they're in-/decrementing. + * + * Will be loaded from /data/js/operators_before.txt + * + * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Expressions_and_Operators + * + * @var string[] + */ + protected $operatorsBefore = array(); + + /** + * List of JavaScript operators that accept a before + * them. Some end of lines are not the end of a statement, like when + * continued by one of these operators on the newline. + * + * Note: Most operators are fine, we've only removed ), ], ++ and --. + * ++ & -- have to be joined with the value they're in-/decrementing. + * ) & ] are "special" in that they have lots or usecases. () for example + * is used for function calls, for grouping, in if () and for (), ... + * + * Will be loaded from /data/js/operators_after.txt + * + * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Expressions_and_Operators + * + * @var string[] + */ + protected $operatorsAfter = array(); + + /** + * {@inheritdoc} + */ + public function __construct() + { + call_user_func_array(array('parent', '__construct'), func_get_args()); + + $dataDir = __DIR__.'/../data/js/'; + $options = FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES; + $this->keywordsReserved = file($dataDir.'keywords_reserved.txt', $options); + $this->keywordsBefore = file($dataDir.'keywords_before.txt', $options); + $this->keywordsAfter = file($dataDir.'keywords_after.txt', $options); + $this->operatorsBefore = file($dataDir.'operators_before.txt', $options); + $this->operatorsAfter = file($dataDir.'operators_after.txt', $options); + } + + /** + * Minify the data. + * Perform JS optimizations. + * + * @param string[optional] $path Path to write the data to. + * + * @return string The minified data. + */ + public function execute($path = null) + { + $content = ''; + + // loop files + foreach ($this->data as $source => $js) { + /* + * Combine js: separating the scripts by a ; + * I'm also adding a newline: it will be eaten when whitespace is + * stripped, but we need to make sure we're not just appending + * a new script right after a previous script that ended with a + * singe-line comment on the last line (in which case it would also + * be seen as part of that comment) + */ + $content .= $js."\n;"; + } + + /* + * Let's first take out strings, comments and regular expressions. + * All of these can contain JS code-like characters, and we should make + * sure any further magic ignores anything inside of these. + * + * Consider this example, where we should not strip any whitespace: + * var str = "a test"; + * + * Comments will be removed altogether, strings and regular expressions + * will be replaced by placeholder text, which we'll restore later. + */ + $this->extractStrings('\'"`'); + $this->stripComments(); + $this->extractRegex(); + $content = $this->replace($content); + + $content = $this->stripWhitespace($content); + $content = $this->propertyNotation($content); + $content = $this->shortenBools($content); + + /* + * Earlier, we extracted strings & regular expressions and replaced them + * with placeholder text. This will restore them. + */ + $content = $this->restoreExtractedData($content); + + return $content; + } + + /** + * Strip comments from source code. + */ + protected function stripComments() + { + // single-line comments + $this->registerPattern('/\/\/.*$/m', ''); + + // multi-line comments + $this->registerPattern('/\/\*.*?\*\//s', ''); + } + + /** + * JS can have /-delimited regular expressions, like: /ab+c/.match(string). + * + * The content inside the regex can contain characters that may be confused + * for JS code: e.g. it could contain whitespace it needs to match & we + * don't want to strip whitespace in there. + * + * The regex can be pretty simple: we don't have to care about comments, + * (which also use slashes) because stripComments() will have stripped those + * already. + * + * This method will replace all string content with simple REGEX# + * placeholder text, so we've rid all regular expressions from characters + * that may be misinterpreted. Original regex content will be saved in + * $this->extracted and after doing all other minifying, we can restore the + * original content via restoreRegex() + */ + protected function extractRegex() + { + // PHP only supports $this inside anonymous functions since 5.4 + $minifier = $this; + $callback = function ($match) use ($minifier) { + $count = count($minifier->extracted); + $placeholder = '/'.$count.'/'; + $minifier->extracted[$placeholder] = $match[1]; + + return $placeholder; + }; + + // it's a regex if we can find an opening and (not escaped) closing /, + // include \n because it may be there for a reason + // (https://github.com/matthiasmullie/minify/issues/56) + $pattern = '(\/.*?(?registerPattern('/^\s*\K'.$pattern.'/', $callback); + // * following another operator, it's not division, but regex + $operators = $this->getOperatorsForRegex($this->operatorsBefore, '/'); + $operators += $this->getKeywordsForRegex($this->keywordsReserved, '/'); + $this->registerPattern('/(?:'.implode('|', $operators).')\s*\K'.$pattern.'/', $callback); + } + + /** + * Strip whitespace. + * + * We won't strip *all* whitespace, but as much as possible. The thing that + * we'll preserve are newlines we're unsure about. + * JavaScript doesn't require statements to be terminated with a semicolon. + * It will automatically fix missing semicolons with ASI (automatic semi- + * colon insertion) at the end of line causing errors (without semicolon.) + * + * Because it's sometimes hard to tell if a newline is part of a statement + * that should be terminated or not, we'll just leave some of them alone. + * + * @param string $content The content to strip the whitespace for. + * + * @return string + */ + protected function stripWhitespace($content) + { + // uniform line endings, make them all line feed + $content = str_replace(array("\r\n", "\r"), "\n", $content); + + // collapse all non-line feed whitespace into a single space + $content = preg_replace('/[^\S\n]+/', ' ', $content); + + // strip leading & trailing whitespace + $content = str_replace(array(" \n", "\n "), "\n", $content); + + // collapse consecutive line feeds into just 1 + $content = preg_replace('/\n+/', "\n", $content); + + $before = $this->getOperatorsForRegex($this->operatorsBefore, '/'); + $after = $this->getOperatorsForRegex($this->operatorsAfter, '/'); + $operators = $before + $after; + + // strip whitespace that ends in (or next line begin with) an operator + // that allows statements to be broken up over multiple lines + unset($before['+'], $before['-'], $after['+'], $after['-']); + $content = preg_replace('/('.implode('|', $before).')\s+/', '\\1', $content); + $content = preg_replace('/\s+('.implode('|', $after).')/', '\\1', $content); + + // make sure + and - can't be mistaken for, or joined into ++ and -- + $content = preg_replace('/(?getKeywordsForRegex($this->keywordsBefore, '/'); + $after = $this->getKeywordsForRegex($this->keywordsAfter, '/'); + $content = preg_replace('/(^|[;\}\s])\K('.implode('|', $before).')\s+/', '\\2 ', $content); + $content = preg_replace('/\s+('.implode('|', $after).')(?=([;\{\s]|$))/', ' \\1', $content); + + /* + * Get rid of double semicolons, except where they can be used like: + * "for(v=1,_=b;;)", "for(v=1;;v++)" or "for(;;ja||(ja=true))". + * I'll safeguard these double semicolons inside for-loops by + * temporarily replacing them with an invalid condition: they won't have + * a double semicolon and will be easy to spot to restore afterwards. + */ + $content = preg_replace('/\bfor\(([^;]*);;([^;]*)\)/', 'for(\\1;-;\\2)', $content); + $content = preg_replace('/;+/', ';', $content); + $content = preg_replace('/\bfor\(([^;]*);-;([^;]*)\)/', 'for(\\1;;\\2)', $content); + + /* + * Next, we'll be removing all semicolons where ASI kicks in. + * for-loops however, can have an empty body (ending in only a + * semicolon), like: `for(i=1;i<3;i++);` + * Here, nothing happens during the loop; it's just used to keep + * increasing `i`. With that ; omitted, the next line would be expected + * to be the for-loop's body... + * I'm going to double that semicolon (if any) so after the next line, + * which strips semicolons here & there, we're still left with this one. + */ + $content = preg_replace('/(for\([^;]*;[^;]*;[^;\{]*\));(\}|$)/s', '\\1;;\\2', $content); + + /* + * We also can't strip empty else-statements. Even though they're + * useless and probably shouldn't be in the code in the first place, we + * shouldn't be stripping the `;` that follows it as it breaks the code. + * We can just remove those useless else-statements completely. + * + * @see https://github.com/matthiasmullie/minify/issues/91 + */ + $content = preg_replace('/else;/s', '', $content); + + /* + * We also don't really want to terminate statements followed by closing + * curly braces (which we've ignored completely up until now) or end-of- + * script: ASI will kick in here & we're all about minifying. + * Semicolons at beginning of the file don't make any sense either. + */ + $content = preg_replace('/;(\}|$)/s', '\\1', $content); + $content = ltrim($content, ';'); + + // get rid of remaining whitespace af beginning/end + return trim($content); + } + + /** + * We'll strip whitespace around certain operators with regular expressions. + * This will prepare the given array by escaping all characters. + * + * @param string[] $operators + * @param string $delimiter + * + * @return string[] + */ + protected function getOperatorsForRegex(array $operators, $delimiter = '/') + { + // escape operators for use in regex + $delimiter = array_fill(0, count($operators), $delimiter); + $escaped = array_map('preg_quote', $operators, $delimiter); + + $operators = array_combine($operators, $escaped); + + // ignore + & - for now, they'll get special treatment + unset($operators['+'], $operators['-']); + + // dot can not just immediately follow a number; it can be confused for + // decimal point, or calling a method on it, e.g. 42 .toString() + $operators['.'] = '(?%&|'); + $operators['='] = '(?keywordsReserved; + $callback = function ($match) use ($minifier, $keywords) { + $property = trim($minifier->extracted[$match[1]], '\'"'); + + /* + * Check if the property is a reserved keyword. In this context (as + * property of an object literal/array) it shouldn't matter, but IE8 + * freaks out with "Expected identifier". + */ + if (in_array($property, $keywords)) { + return $match[0]; + } + + /* + * See if the property is in a variable-like format (e.g. + * array['key-here'] can't be replaced by array.key-here since '-' + * is not a valid character there. + */ + if (!preg_match('/^'.$minifier::REGEX_VARIABLE.'$/u', $property)) { + return $match[0]; + } + + return '.'.$property; + }; + + /* + * Figure out if previous character is a variable name (of the array + * we want to use property notation on) - this is to make sure + * standalone ['value'] arrays aren't confused for keys-of-an-array. + * We can (and only have to) check the last character, because PHP's + * regex implementation doesn't allow un-fixed-length lookbehind + * assertions. + */ + preg_match('/(\[[^\]]+\])[^\]]*$/', static::REGEX_VARIABLE, $previousChar); + $previousChar = $previousChar[1]; + + /* + * Make sure word preceding the ['value'] is not a keyword, e.g. + * return['x']. Because -again- PHP's regex implementation doesn't allow + * un-fixed-length lookbehind assertions, I'm just going to do a lot of + * separate lookbehind assertions, one for each keyword. + */ + $keywords = $this->getKeywordsForRegex($keywords); + $keywords = '(? + * @copyright Copyright (c) 2012, Matthias Mullie. All rights reserved. + * @license MIT License + */ +abstract class Minify +{ + /** + * The data to be minified. + * + * @var string[] + */ + protected $data = array(); + + /** + * Array of patterns to match. + * + * @var string[] + */ + protected $patterns = array(); + + /** + * This array will hold content of strings and regular expressions that have + * been extracted from the JS source code, so we can reliably match "code", + * without having to worry about potential "code-like" characters inside. + * + * @var string[] + */ + public $extracted = array(); + + /** + * Init the minify class - optionally, code may be passed along already. + */ + public function __construct(/* $data = null, ... */) + { + // it's possible to add the source through the constructor as well ;) + if (func_num_args()) { + call_user_func_array(array($this, 'add'), func_get_args()); + } + } + + /** + * Add a file or straight-up code to be minified. + * + * @param string $data + */ + public function add($data /* $data = null, ... */) + { + // bogus "usage" of parameter $data: scrutinizer warns this variable is + // not used (we're using func_get_args instead to support overloading), + // but it still needs to be defined because it makes no sense to have + // this function without argument :) + $args = array($data) + func_get_args(); + + // this method can be overloaded + foreach ($args as $data) { + // redefine var + $data = (string) $data; + + // load data + $value = $this->load($data); + $key = ($data != $value) ? $data : count($this->data); + + // store data + $this->data[$key] = $value; + } + } + + /** + * Load data. + * + * @param string $data Either a path to a file or the content itself. + * + * @return string + */ + protected function load($data) + { + // check if the data is a file + if (strlen($data) < PHP_MAXPATHLEN && file_exists($data) && is_file($data)) { + $data = file_get_contents($data); + + // strip BOM, if any + if (substr($data, 0, 3) == "\xef\xbb\xbf") { + $data = substr($data, 3); + } + } + + return $data; + } + + /** + * Save to file. + * + * @param string $content The minified data. + * @param string $path The path to save the minified data to. + * + * @throws Exception + */ + protected function save($content, $path) + { + // create file & open for writing + if (($handler = @fopen($path, 'w')) === false) { + throw new Exception('The file "'.$path.'" could not be opened. Check if PHP has enough permissions.'); + } + + // write to file + if (@fwrite($handler, $content) === false) { + throw new Exception('The file "'.$path.'" could not be written to. Check if PHP has enough permissions.'); + } + + // close the file + @fclose($handler); + } + + /** + * Minify the data & (optionally) saves it to a file. + * + * @param string[optional] $path Path to write the data to. + * + * @return string The minified data. + */ + public function minify($path = null) + { + $content = $this->execute($path); + + // save to path + if ($path !== null) { + $this->save($content, $path); + } + + return $content; + } + + /** + * Minify & gzip the data & (optionally) saves it to a file. + * + * @param string[optional] $path Path to write the data to. + * @param int[optional] $level Compression level, from 0 to 9. + * + * @return string The minified & gzipped data. + */ + public function gzip($path = null, $level = 9) + { + $content = $this->execute($path); + $content = gzencode($content, $level, FORCE_GZIP); + + // save to path + if ($path !== null) { + $this->save($content, $path); + } + + return $content; + } + + /** + * Minify the data & write it to a CacheItemInterface object. + * + * @param CacheItemInterface $item Cache item to write the data to. + * + * @return CacheItemInterface Cache item with the minifier data. + */ + public function cache(CacheItemInterface $item) + { + $content = $this->execute(); + $item->set($content); + + return $item; + } + + /** + * Minify the data. + * + * @param string[optional] $path Path to write the data to. + * + * @return string The minified data. + */ + abstract public function execute($path = null); + + /** + * Register a pattern to execute against the source content. + * + * @param string $pattern PCRE pattern. + * @param string|callable $replacement Replacement value for matched pattern. + * + * @throws Exception + */ + protected function registerPattern($pattern, $replacement = '') + { + // study the pattern, we'll execute it more than once + $pattern .= 'S'; + + $this->patterns[] = array($pattern, $replacement); + } + + /** + * We can't "just" run some regular expressions against JavaScript: it's a + * complex language. E.g. having an occurrence of // xyz would be a comment, + * unless it's used within a string. Of you could have something that looks + * like a 'string', but inside a comment. + * The only way to accurately replace these pieces is to traverse the JS one + * character at a time and try to find whatever starts first. + * + * @param string $content The content to replace patterns in. + * + * @return string The (manipulated) content. + */ + protected function replace($content) + { + $processed = ''; + $positions = array_fill(0, count($this->patterns), -1); + $matches = array(); + + while ($content) { + // find first match for all patterns + foreach ($this->patterns as $i => $pattern) { + list($pattern, $replacement) = $pattern; + + // no need to re-run matches that are still in the part of the + // content that hasn't been processed + if ($positions[$i] >= 0) { + continue; + } + + $match = null; + if (preg_match($pattern, $content, $match)) { + $matches[$i] = $match; + + // we'll store the match position as well; that way, we + // don't have to redo all preg_matches after changing only + // the first (we'll still know where those others are) + $positions[$i] = strpos($content, $match[0]); + } else { + // if the pattern couldn't be matched, there's no point in + // executing it again in later runs on this same content; + // ignore this one until we reach end of content + unset($matches[$i]); + $positions[$i] = strlen($content); + } + } + + // no more matches to find: everything's been processed, break out + if (!$matches) { + $processed .= $content; + break; + } + + // see which of the patterns actually found the first thing (we'll + // only want to execute that one, since we're unsure if what the + // other found was not inside what the first found) + $discardLength = min($positions); + $firstPattern = array_search($discardLength, $positions); + $match = $matches[$firstPattern][0]; + + // execute the pattern that matches earliest in the content string + list($pattern, $replacement) = $this->patterns[$firstPattern]; + $replacement = $this->replacePattern($pattern, $replacement, $content); + + // figure out which part of the string was unmatched; that's the + // part we'll execute the patterns on again next + $content = substr($content, $discardLength); + $unmatched = (string) substr($content, strpos($content, $match) + strlen($match)); + + // move the replaced part to $processed and prepare $content to + // again match batch of patterns against + $processed .= substr($replacement, 0, strlen($replacement) - strlen($unmatched)); + $content = $unmatched; + + // first match has been replaced & that content is to be left alone, + // the next matches will start after this replacement, so we should + // fix their offsets + foreach ($positions as $i => $position) { + $positions[$i] -= $discardLength + strlen($match); + } + } + + return $processed; + } + + /** + * This is where a pattern is matched against $content and the matches + * are replaced by their respective value. + * This function will be called plenty of times, where $content will always + * move up 1 character. + * + * @param string $pattern Pattern to match. + * @param string|callable $replacement Replacement value. + * @param string $content Content to match pattern against. + * + * @return string + */ + protected function replacePattern($pattern, $replacement, $content) + { + if (is_callable($replacement)) { + return preg_replace_callback($pattern, $replacement, $content, 1, $count); + } else { + return preg_replace($pattern, $replacement, $content, 1, $count); + } + } + + /** + * Strings are a pattern we need to match, in order to ignore potential + * code-like content inside them, but we just want all of the string + * content to remain untouched. + * + * This method will replace all string content with simple STRING# + * placeholder text, so we've rid all strings from characters that may be + * misinterpreted. Original string content will be saved in $this->extracted + * and after doing all other minifying, we can restore the original content + * via restoreStrings() + * + * @param string[optional] $chars + */ + protected function extractStrings($chars = '\'"') + { + // PHP only supports $this inside anonymous functions since 5.4 + $minifier = $this; + $callback = function ($match) use ($minifier) { + if (!$match[1]) { + /* + * Empty strings need no placeholder; they can't be confused for + * anything else anyway. + * But we still needed to match them, for the extraction routine + * to skip over this particular string. + */ + return $match[0]; + } + + $count = count($minifier->extracted); + $placeholder = $match[1].$count.$match[1]; + $minifier->extracted[$placeholder] = $match[1].$match[2].$match[1]; + + return $placeholder; + }; + + /* + * The \\ messiness explained: + * * Don't count ' or " as end-of-string if it's escaped (has backslash + * in front of it) + * * Unless... that backslash itself is escaped (another leading slash), + * in which case it's no longer escaping the ' or " + * * So there can be either no backslash, or an even number + * * multiply all of that times 4, to account for the escaping that has + * to be done to pass the backslash into the PHP string without it being + * considered as escape-char (times 2) and to get it in the regex, + * escaped (times 2) + */ + $this->registerPattern('/(['.$chars.'])(.*?(?extracted. + * + * @param string $content + * + * @return string + */ + protected function restoreExtractedData($content) + { + if (!$this->extracted) { + // nothing was extracted, nothing to restore + return $content; + } + + $content = strtr($content, $this->extracted); + + $this->extracted = array(); + + return $content; + } +} diff --git a/vendor/matthiasmullie/path-converter/.coveralls.yml b/vendor/matthiasmullie/path-converter/.coveralls.yml new file mode 100644 index 000000000..09bbb257d --- /dev/null +++ b/vendor/matthiasmullie/path-converter/.coveralls.yml @@ -0,0 +1,3 @@ +src_dir: src +coverage_clover: build/logs/clover.xml +json_path: build/logs/coveralls-upload.json diff --git a/vendor/matthiasmullie/path-converter/LICENSE b/vendor/matthiasmullie/path-converter/LICENSE new file mode 100644 index 000000000..491295ad3 --- /dev/null +++ b/vendor/matthiasmullie/path-converter/LICENSE @@ -0,0 +1,18 @@ +Copyright (c) 2015 Matthias Mullie + +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. diff --git a/vendor/matthiasmullie/path-converter/composer.json b/vendor/matthiasmullie/path-converter/composer.json new file mode 100644 index 000000000..4018ef3b3 --- /dev/null +++ b/vendor/matthiasmullie/path-converter/composer.json @@ -0,0 +1,29 @@ +{ + "name": "matthiasmullie/path-converter", + "type": "library", + "description": "Relative path converter", + "keywords": ["relative", "path", "converter", "paths"], + "homepage": "http://github.com/matthiasmullie/path-converter", + "license": "MIT", + "authors": [ + { + "name": "Matthias Mullie", + "homepage": "http://www.mullie.eu", + "email": "pathconverter@mullie.eu", + "role": "Developer" + } + ], + "require": { + "php": ">=5.3.0", + "ext-pcre": "*" + }, + "require-dev": { + "phpunit/phpunit": "~4.8", + "satooshi/php-coveralls": "~1.0" + }, + "autoload": { + "psr-4": { + "MatthiasMullie\\PathConverter\\": "src/" + } + } +} diff --git a/vendor/matthiasmullie/path-converter/src/Converter.php b/vendor/matthiasmullie/path-converter/src/Converter.php new file mode 100644 index 000000000..ae3d158d2 --- /dev/null +++ b/vendor/matthiasmullie/path-converter/src/Converter.php @@ -0,0 +1,186 @@ + + * + * @copyright Copyright (c) 2015, Matthias Mullie. All rights reserved. + * @license MIT License + */ +class Converter +{ + /** + * @var string + */ + protected $from; + + /** + * @var string + */ + protected $to; + + /** + * @param string $from The original base path (directory, not file!) + * @param string $to The new base path (directory, not file!) + */ + public function __construct($from, $to) + { + $shared = $this->shared($from, $to); + if ($shared === '') { + // when both paths have nothing in common, one of them is probably + // absolute while the other is relative + // attempt to resolve path, or assume it's fine if it doesn't exist + $from = realpath($from) ?: $from; + $to = realpath($to) ?: $to; + } + + $from = $this->normalize($from); + $to = $this->normalize($to); + + $from = $this->dirname($from); + $to = $this->dirname($to); + + $this->from = $from; + $this->to = $to; + } + + /** + * Normalize path. + * + * @param string $path + * @return string + */ + protected function normalize($path) + { + // deal with different operating systems' directory structure + $path = rtrim(str_replace(DIRECTORY_SEPARATOR, '/', $path), '/'); + + /* + * Example: + * /home/forkcms/frontend/cache/compiled_templates/../../core/layout/css/../images/img.gif + * to + * /home/forkcms/frontend/core/layout/images/img.gif + */ + do { + $path = preg_replace('/[^\/]+(? $chunk) { + if (isset($path2[$i]) && $path1[$i] == $path2[$i]) { + $shared[] = $chunk; + } else { + break; + } + } + + return implode('/', $shared); + } + + /** + * Convert paths relative from 1 file to another. + * + * E.g. + * ../images/img.gif relative to /home/forkcms/frontend/core/layout/css + * should become: + * ../../core/layout/images/img.gif relative to + * /home/forkcms/frontend/cache/minified_css + * + * @param string $path The relative path that needs to be converted. + * @return string The new relative path. + */ + public function convert($path) + { + // quit early if conversion makes no sense + if ($this->from === $this->to) { + return $path; + } + + $path = $this->normalize($path); + // if we're not dealing with a relative path, just return absolute + if (strpos($path, '/') === 0) { + return $path; + } + + // normalize paths + $path = $this->normalize($this->from.'/'.$path); + + // strip shared ancestor paths + $shared = $this->shared($path, $this->to); + $path = mb_substr($path, mb_strlen($shared)); + $to = mb_substr($this->to, mb_strlen($shared)); + + // add .. for every directory that needs to be traversed to new path + $to = str_repeat('../', mb_substr_count($to, '/')); + + return $to.ltrim($path, '/'); + } + + /** + * Attempt to get the directory name from a path. + * + * @param string $path + * @return string + */ + public function dirname($path) + { + if (is_file($path)) { + return dirname($path); + } + + if (is_dir($path)) { + return rtrim($path, '/'); + } + + // no known file/dir, start making assumptions + + // ends in / = dir + if (mb_substr($path, -1) === '/') { + return rtrim($path, '/'); + } + + // has a dot in the name, likely a file + if (preg_match('/.*\..*$/', basename($path)) !== 0) { + return dirname($path); + } + + // you're on your own here! + return $path; + } +} diff --git a/vendor/michelf/php-markdown/License.md b/vendor/michelf/php-markdown/License.md new file mode 100644 index 000000000..bcb5f2a25 --- /dev/null +++ b/vendor/michelf/php-markdown/License.md @@ -0,0 +1,36 @@ +PHP Markdown Lib +Copyright (c) 2004-2015 Michel Fortin + +All rights reserved. + +Based on Markdown +Copyright (c) 2003-2006 John Gruber + +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + +* Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + +* Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + +* Neither the name "Markdown" nor the names of its contributors may + be used to endorse or promote products derived from this software + without specific prior written permission. + +This software is provided by the copyright holders and contributors "as +is" and any express or implied warranties, including, but not limited +to, the implied warranties of merchantability and fitness for a +particular purpose are disclaimed. In no event shall the copyright owner +or contributors be liable for any direct, indirect, incidental, special, +exemplary, or consequential damages (including, but not limited to, +procurement of substitute goods or services; loss of use, data, or +profits; or business interruption) however caused and on any theory of +liability, whether in contract, strict liability, or tort (including +negligence or otherwise) arising in any way out of the use of this +software, even if advised of the possibility of such damage. diff --git a/vendor/michelf/php-markdown/Michelf/Markdown.inc.php b/vendor/michelf/php-markdown/Michelf/Markdown.inc.php new file mode 100644 index 000000000..8c281094c --- /dev/null +++ b/vendor/michelf/php-markdown/Michelf/Markdown.inc.php @@ -0,0 +1,10 @@ + +# +# Original Markdown +# Copyright (c) 2004-2006 John Gruber +# +# +namespace Michelf; + + +# +# Markdown Parser Class +# + +class Markdown implements MarkdownInterface { + + ### Version ### + + const MARKDOWNLIB_VERSION = "1.5.0"; + + ### Simple Function Interface ### + + public static function defaultTransform($text) { + # + # Initialize the parser and return the result of its transform method. + # This will work fine for derived classes too. + # + # Take parser class on which this function was called. + $parser_class = \get_called_class(); + + # try to take parser from the static parser list + static $parser_list; + $parser =& $parser_list[$parser_class]; + + # create the parser it not already set + if (!$parser) + $parser = new $parser_class; + + # Transform text using parser. + return $parser->transform($text); + } + + ### Configuration Variables ### + + # Change to ">" for HTML output. + public $empty_element_suffix = " />"; + public $tab_width = 4; + + # Change to `true` to disallow markup or entities. + public $no_markup = false; + public $no_entities = false; + + # Predefined urls and titles for reference links and images. + public $predef_urls = array(); + public $predef_titles = array(); + + # Optional filter function for URLs + public $url_filter_func = null; + + # Optional header id="" generation callback function. + public $header_id_func = null; + + # Class attribute to toggle "enhanced ordered list" behaviour + # setting this to true will allow ordered lists to start from the index + # number that is defined first. For example: + # 2. List item two + # 3. List item three + # + # becomes + #
          + #
        1. List item two
        2. + #
        3. List item three
        4. + #
        + public $enhanced_ordered_list = false; + + ### Parser Implementation ### + + # Regex to match balanced [brackets]. + # Needed to insert a maximum bracked depth while converting to PHP. + protected $nested_brackets_depth = 6; + protected $nested_brackets_re; + + protected $nested_url_parenthesis_depth = 4; + protected $nested_url_parenthesis_re; + + # Table of hash values for escaped characters: + protected $escape_chars = '\`*_{}[]()>#+-.!'; + protected $escape_chars_re; + + + public function __construct() { + # + # Constructor function. Initialize appropriate member variables. + # + $this->_initDetab(); + $this->prepareItalicsAndBold(); + + $this->nested_brackets_re = + str_repeat('(?>[^\[\]]+|\[', $this->nested_brackets_depth). + str_repeat('\])*', $this->nested_brackets_depth); + + $this->nested_url_parenthesis_re = + str_repeat('(?>[^()\s]+|\(', $this->nested_url_parenthesis_depth). + str_repeat('(?>\)))*', $this->nested_url_parenthesis_depth); + + $this->escape_chars_re = '['.preg_quote($this->escape_chars).']'; + + # Sort document, block, and span gamut in ascendent priority order. + asort($this->document_gamut); + asort($this->block_gamut); + asort($this->span_gamut); + } + + + # Internal hashes used during transformation. + protected $urls = array(); + protected $titles = array(); + protected $html_hashes = array(); + + # Status flag to avoid invalid nesting. + protected $in_anchor = false; + + + protected function setup() { + # + # Called before the transformation process starts to setup parser + # states. + # + # Clear global hashes. + $this->urls = $this->predef_urls; + $this->titles = $this->predef_titles; + $this->html_hashes = array(); + + $this->in_anchor = false; + } + + protected function teardown() { + # + # Called after the transformation process to clear any variable + # which may be taking up memory unnecessarly. + # + $this->urls = array(); + $this->titles = array(); + $this->html_hashes = array(); + } + + + public function transform($text) { + # + # Main function. Performs some preprocessing on the input text + # and pass it through the document gamut. + # + $this->setup(); + + # Remove UTF-8 BOM and marker character in input, if present. + $text = preg_replace('{^\xEF\xBB\xBF|\x1A}', '', $text); + + # Standardize line endings: + # DOS to Unix and Mac to Unix + $text = preg_replace('{\r\n?}', "\n", $text); + + # Make sure $text ends with a couple of newlines: + $text .= "\n\n"; + + # Convert all tabs to spaces. + $text = $this->detab($text); + + # Turn block-level HTML blocks into hash entries + $text = $this->hashHTMLBlocks($text); + + # Strip any lines consisting only of spaces and tabs. + # This makes subsequent regexen easier to write, because we can + # match consecutive blank lines with /\n+/ instead of something + # contorted like /[ ]*\n+/ . + $text = preg_replace('/^[ ]+$/m', '', $text); + + # Run document gamut methods. + foreach ($this->document_gamut as $method => $priority) { + $text = $this->$method($text); + } + + $this->teardown(); + + return $text . "\n"; + } + + protected $document_gamut = array( + # Strip link definitions, store in hashes. + "stripLinkDefinitions" => 20, + + "runBasicBlockGamut" => 30, + ); + + + protected function stripLinkDefinitions($text) { + # + # Strips link definitions from text, stores the URLs and titles in + # hash references. + # + $less_than_tab = $this->tab_width - 1; + + # Link defs are in the form: ^[id]: url "optional title" + $text = preg_replace_callback('{ + ^[ ]{0,'.$less_than_tab.'}\[(.+)\][ ]?: # id = $1 + [ ]* + \n? # maybe *one* newline + [ ]* + (?: + <(.+?)> # url = $2 + | + (\S+?) # url = $3 + ) + [ ]* + \n? # maybe one newline + [ ]* + (?: + (?<=\s) # lookbehind for whitespace + ["(] + (.*?) # title = $4 + [")] + [ ]* + )? # title is optional + (?:\n+|\Z) + }xm', + array($this, '_stripLinkDefinitions_callback'), + $text); + return $text; + } + protected function _stripLinkDefinitions_callback($matches) { + $link_id = strtolower($matches[1]); + $url = $matches[2] == '' ? $matches[3] : $matches[2]; + $this->urls[$link_id] = $url; + $this->titles[$link_id] =& $matches[4]; + return ''; # String that will replace the block + } + + + protected function hashHTMLBlocks($text) { + if ($this->no_markup) return $text; + + $less_than_tab = $this->tab_width - 1; + + # Hashify HTML blocks: + # We only want to do this for block-level HTML tags, such as headers, + # lists, and tables. That's because we still want to wrap

        s around + # "paragraphs" that are wrapped in non-block-level tags, such as anchors, + # phrase emphasis, and spans. The list of tags we're looking for is + # hard-coded: + # + # * List "a" is made of tags which can be both inline or block-level. + # These will be treated block-level when the start tag is alone on + # its line, otherwise they're not matched here and will be taken as + # inline later. + # * List "b" is made of tags which are always block-level; + # + $block_tags_a_re = 'ins|del'; + $block_tags_b_re = 'p|div|h[1-6]|blockquote|pre|table|dl|ol|ul|address|'. + 'script|noscript|style|form|fieldset|iframe|math|svg|'. + 'article|section|nav|aside|hgroup|header|footer|'. + 'figure'; + + # Regular expression for the content of a block tag. + $nested_tags_level = 4; + $attr = ' + (?> # optional tag attributes + \s # starts with whitespace + (?> + [^>"/]+ # text outside quotes + | + /+(?!>) # slash not followed by ">" + | + "[^"]*" # text inside double quotes (tolerate ">") + | + \'[^\']*\' # text inside single quotes (tolerate ">") + )* + )? + '; + $content = + str_repeat(' + (?> + [^<]+ # content without tag + | + <\2 # nested opening tag + '.$attr.' # attributes + (?> + /> + | + >', $nested_tags_level). # end of opening tag + '.*?'. # last level nested tag content + str_repeat(' + # closing nested tag + ) + | + <(?!/\2\s*> # other tags with a different name + ) + )*', + $nested_tags_level); + $content2 = str_replace('\2', '\3', $content); + + # First, look for nested blocks, e.g.: + #

        + #
        + # tags for inner block must be indented. + #
        + #
        + # + # The outermost tags must start at the left margin for this to match, and + # the inner nested divs must be indented. + # We need to do this before the next, more liberal match, because the next + # match will start at the first `
        ` and stop at the first `
        `. + $text = preg_replace_callback('{(?> + (?> + (?<=\n) # Starting on its own line + | # or + \A\n? # the at beginning of the doc + ) + ( # save in $1 + + # Match from `\n` to `\n`, handling nested tags + # in between. + + [ ]{0,'.$less_than_tab.'} + <('.$block_tags_b_re.')# start tag = $2 + '.$attr.'> # attributes followed by > and \n + '.$content.' # content, support nesting + # the matching end tag + [ ]* # trailing spaces/tabs + (?=\n+|\Z) # followed by a newline or end of document + + | # Special version for tags of group a. + + [ ]{0,'.$less_than_tab.'} + <('.$block_tags_a_re.')# start tag = $3 + '.$attr.'>[ ]*\n # attributes followed by > + '.$content2.' # content, support nesting + # the matching end tag + [ ]* # trailing spaces/tabs + (?=\n+|\Z) # followed by a newline or end of document + + | # Special case just for
        . It was easier to make a special + # case than to make the other regex more complicated. + + [ ]{0,'.$less_than_tab.'} + <(hr) # start tag = $2 + '.$attr.' # attributes + /?> # the matching end tag + [ ]* + (?=\n{2,}|\Z) # followed by a blank line or end of document + + | # Special case for standalone HTML comments: + + [ ]{0,'.$less_than_tab.'} + (?s: + + ) + [ ]* + (?=\n{2,}|\Z) # followed by a blank line or end of document + + | # PHP and ASP-style processor instructions ( + ) + [ ]* + (?=\n{2,}|\Z) # followed by a blank line or end of document + + ) + )}Sxmi', + array($this, '_hashHTMLBlocks_callback'), + $text); + + return $text; + } + protected function _hashHTMLBlocks_callback($matches) { + $text = $matches[1]; + $key = $this->hashBlock($text); + return "\n\n$key\n\n"; + } + + + protected function hashPart($text, $boundary = 'X') { + # + # Called whenever a tag must be hashed when a function insert an atomic + # element in the text stream. Passing $text to through this function gives + # a unique text-token which will be reverted back when calling unhash. + # + # The $boundary argument specify what character should be used to surround + # the token. By convension, "B" is used for block elements that needs not + # to be wrapped into paragraph tags at the end, ":" is used for elements + # that are word separators and "X" is used in the general case. + # + # Swap back any tag hash found in $text so we do not have to `unhash` + # multiple times at the end. + $text = $this->unhash($text); + + # Then hash the block. + static $i = 0; + $key = "$boundary\x1A" . ++$i . $boundary; + $this->html_hashes[$key] = $text; + return $key; # String that will replace the tag. + } + + + protected function hashBlock($text) { + # + # Shortcut function for hashPart with block-level boundaries. + # + return $this->hashPart($text, 'B'); + } + + + protected $block_gamut = array( + # + # These are all the transformations that form block-level + # tags like paragraphs, headers, and list items. + # + "doHeaders" => 10, + "doHorizontalRules" => 20, + + "doLists" => 40, + "doCodeBlocks" => 50, + "doBlockQuotes" => 60, + ); + + protected function runBlockGamut($text) { + # + # Run block gamut tranformations. + # + # We need to escape raw HTML in Markdown source before doing anything + # else. This need to be done for each block, and not only at the + # begining in the Markdown function since hashed blocks can be part of + # list items and could have been indented. Indented blocks would have + # been seen as a code block in a previous pass of hashHTMLBlocks. + $text = $this->hashHTMLBlocks($text); + + return $this->runBasicBlockGamut($text); + } + + protected function runBasicBlockGamut($text) { + # + # Run block gamut tranformations, without hashing HTML blocks. This is + # useful when HTML blocks are known to be already hashed, like in the first + # whole-document pass. + # + foreach ($this->block_gamut as $method => $priority) { + $text = $this->$method($text); + } + + # Finally form paragraph and restore hashed blocks. + $text = $this->formParagraphs($text); + + return $text; + } + + + protected function doHorizontalRules($text) { + # Do Horizontal Rules: + return preg_replace( + '{ + ^[ ]{0,3} # Leading space + ([-*_]) # $1: First marker + (?> # Repeated marker group + [ ]{0,2} # Zero, one, or two spaces. + \1 # Marker character + ){2,} # Group repeated at least twice + [ ]* # Tailing spaces + $ # End of line. + }mx', + "\n".$this->hashBlock("empty_element_suffix")."\n", + $text); + } + + + protected $span_gamut = array( + # + # These are all the transformations that occur *within* block-level + # tags like paragraphs, headers, and list items. + # + # Process character escapes, code spans, and inline HTML + # in one shot. + "parseSpan" => -30, + + # Process anchor and image tags. Images must come first, + # because ![foo][f] looks like an anchor. + "doImages" => 10, + "doAnchors" => 20, + + # Make links out of things like `` + # Must come after doAnchors, because you can use < and > + # delimiters in inline links like [this](). + "doAutoLinks" => 30, + "encodeAmpsAndAngles" => 40, + + "doItalicsAndBold" => 50, + "doHardBreaks" => 60, + ); + + protected function runSpanGamut($text) { + # + # Run span gamut tranformations. + # + foreach ($this->span_gamut as $method => $priority) { + $text = $this->$method($text); + } + + return $text; + } + + + protected function doHardBreaks($text) { + # Do hard breaks: + return preg_replace_callback('/ {2,}\n/', + array($this, '_doHardBreaks_callback'), $text); + } + protected function _doHardBreaks_callback($matches) { + return $this->hashPart("empty_element_suffix\n"); + } + + + protected function doAnchors($text) { + # + # Turn Markdown link shortcuts into XHTML tags. + # + if ($this->in_anchor) return $text; + $this->in_anchor = true; + + # + # First, handle reference-style links: [link text] [id] + # + $text = preg_replace_callback('{ + ( # wrap whole match in $1 + \[ + ('.$this->nested_brackets_re.') # link text = $2 + \] + + [ ]? # one optional space + (?:\n[ ]*)? # one optional newline followed by spaces + + \[ + (.*?) # id = $3 + \] + ) + }xs', + array($this, '_doAnchors_reference_callback'), $text); + + # + # Next, inline-style links: [link text](url "optional title") + # + $text = preg_replace_callback('{ + ( # wrap whole match in $1 + \[ + ('.$this->nested_brackets_re.') # link text = $2 + \] + \( # literal paren + [ \n]* + (?: + <(.+?)> # href = $3 + | + ('.$this->nested_url_parenthesis_re.') # href = $4 + ) + [ \n]* + ( # $5 + ([\'"]) # quote char = $6 + (.*?) # Title = $7 + \6 # matching quote + [ \n]* # ignore any spaces/tabs between closing quote and ) + )? # title is optional + \) + ) + }xs', + array($this, '_doAnchors_inline_callback'), $text); + + # + # Last, handle reference-style shortcuts: [link text] + # These must come last in case you've also got [link text][1] + # or [link text](/foo) + # + $text = preg_replace_callback('{ + ( # wrap whole match in $1 + \[ + ([^\[\]]+) # link text = $2; can\'t contain [ or ] + \] + ) + }xs', + array($this, '_doAnchors_reference_callback'), $text); + + $this->in_anchor = false; + return $text; + } + protected function _doAnchors_reference_callback($matches) { + $whole_match = $matches[1]; + $link_text = $matches[2]; + $link_id =& $matches[3]; + + if ($link_id == "") { + # for shortcut links like [this][] or [this]. + $link_id = $link_text; + } + + # lower-case and turn embedded newlines into spaces + $link_id = strtolower($link_id); + $link_id = preg_replace('{[ ]?\n}', ' ', $link_id); + + if (isset($this->urls[$link_id])) { + $url = $this->urls[$link_id]; + $url = $this->encodeURLAttribute($url); + + $result = "titles[$link_id] ) ) { + $title = $this->titles[$link_id]; + $title = $this->encodeAttribute($title); + $result .= " title=\"$title\""; + } + + $link_text = $this->runSpanGamut($link_text); + $result .= ">$link_text"; + $result = $this->hashPart($result); + } + else { + $result = $whole_match; + } + return $result; + } + protected function _doAnchors_inline_callback($matches) { + $whole_match = $matches[1]; + $link_text = $this->runSpanGamut($matches[2]); + $url = $matches[3] == '' ? $matches[4] : $matches[3]; + $title =& $matches[7]; + + // if the URL was of the form it got caught by the HTML + // tag parser and hashed. Need to reverse the process before using the URL. + $unhashed = $this->unhash($url); + if ($unhashed != $url) + $url = preg_replace('/^<(.*)>$/', '\1', $unhashed); + + $url = $this->encodeURLAttribute($url); + + $result = "encodeAttribute($title); + $result .= " title=\"$title\""; + } + + $link_text = $this->runSpanGamut($link_text); + $result .= ">$link_text"; + + return $this->hashPart($result); + } + + + protected function doImages($text) { + # + # Turn Markdown image shortcuts into tags. + # + # + # First, handle reference-style labeled images: ![alt text][id] + # + $text = preg_replace_callback('{ + ( # wrap whole match in $1 + !\[ + ('.$this->nested_brackets_re.') # alt text = $2 + \] + + [ ]? # one optional space + (?:\n[ ]*)? # one optional newline followed by spaces + + \[ + (.*?) # id = $3 + \] + + ) + }xs', + array($this, '_doImages_reference_callback'), $text); + + # + # Next, handle inline images: ![alt text](url "optional title") + # Don't forget: encode * and _ + # + $text = preg_replace_callback('{ + ( # wrap whole match in $1 + !\[ + ('.$this->nested_brackets_re.') # alt text = $2 + \] + \s? # One optional whitespace character + \( # literal paren + [ \n]* + (?: + <(\S*)> # src url = $3 + | + ('.$this->nested_url_parenthesis_re.') # src url = $4 + ) + [ \n]* + ( # $5 + ([\'"]) # quote char = $6 + (.*?) # title = $7 + \6 # matching quote + [ \n]* + )? # title is optional + \) + ) + }xs', + array($this, '_doImages_inline_callback'), $text); + + return $text; + } + protected function _doImages_reference_callback($matches) { + $whole_match = $matches[1]; + $alt_text = $matches[2]; + $link_id = strtolower($matches[3]); + + if ($link_id == "") { + $link_id = strtolower($alt_text); # for shortcut links like ![this][]. + } + + $alt_text = $this->encodeAttribute($alt_text); + if (isset($this->urls[$link_id])) { + $url = $this->encodeURLAttribute($this->urls[$link_id]); + $result = "\"$alt_text\"";titles[$link_id])) { + $title = $this->titles[$link_id]; + $title = $this->encodeAttribute($title); + $result .= " title=\"$title\""; + } + $result .= $this->empty_element_suffix; + $result = $this->hashPart($result); + } + else { + # If there's no such link ID, leave intact: + $result = $whole_match; + } + + return $result; + } + protected function _doImages_inline_callback($matches) { + $whole_match = $matches[1]; + $alt_text = $matches[2]; + $url = $matches[3] == '' ? $matches[4] : $matches[3]; + $title =& $matches[7]; + + $alt_text = $this->encodeAttribute($alt_text); + $url = $this->encodeURLAttribute($url); + $result = "\"$alt_text\"";encodeAttribute($title); + $result .= " title=\"$title\""; # $title already quoted + } + $result .= $this->empty_element_suffix; + + return $this->hashPart($result); + } + + + protected function doHeaders($text) { + # Setext-style headers: + # Header 1 + # ======== + # + # Header 2 + # -------- + # + $text = preg_replace_callback('{ ^(.+?)[ ]*\n(=+|-+)[ ]*\n+ }mx', + array($this, '_doHeaders_callback_setext'), $text); + + # atx-style headers: + # # Header 1 + # ## Header 2 + # ## Header 2 with closing hashes ## + # ... + # ###### Header 6 + # + $text = preg_replace_callback('{ + ^(\#{1,6}) # $1 = string of #\'s + [ ]* + (.+?) # $2 = Header text + [ ]* + \#* # optional closing #\'s (not counted) + \n+ + }xm', + array($this, '_doHeaders_callback_atx'), $text); + + return $text; + } + + protected function _doHeaders_callback_setext($matches) { + # Terrible hack to check we haven't found an empty list item. + if ($matches[2] == '-' && preg_match('{^-(?: |$)}', $matches[1])) + return $matches[0]; + + $level = $matches[2]{0} == '=' ? 1 : 2; + + # id attribute generation + $idAtt = $this->_generateIdFromHeaderValue($matches[1]); + + $block = "".$this->runSpanGamut($matches[1]).""; + return "\n" . $this->hashBlock($block) . "\n\n"; + } + protected function _doHeaders_callback_atx($matches) { + + # id attribute generation + $idAtt = $this->_generateIdFromHeaderValue($matches[2]); + + $level = strlen($matches[1]); + $block = "".$this->runSpanGamut($matches[2]).""; + return "\n" . $this->hashBlock($block) . "\n\n"; + } + + protected function _generateIdFromHeaderValue($headerValue) { + + # if a header_id_func property is set, we can use it to automatically + # generate an id attribute. + # + # This method returns a string in the form id="foo", or an empty string + # otherwise. + if (!is_callable($this->header_id_func)) { + return ""; + } + $idValue = call_user_func($this->header_id_func, $headerValue); + if (!$idValue) return ""; + + return ' id="' . $this->encodeAttribute($idValue) . '"'; + + } + + protected function doLists($text) { + # + # Form HTML ordered (numbered) and unordered (bulleted) lists. + # + $less_than_tab = $this->tab_width - 1; + + # Re-usable patterns to match list item bullets and number markers: + $marker_ul_re = '[*+-]'; + $marker_ol_re = '\d+[\.]'; + + $markers_relist = array( + $marker_ul_re => $marker_ol_re, + $marker_ol_re => $marker_ul_re, + ); + + foreach ($markers_relist as $marker_re => $other_marker_re) { + # Re-usable pattern to match any entirel ul or ol list: + $whole_list_re = ' + ( # $1 = whole list + ( # $2 + ([ ]{0,'.$less_than_tab.'}) # $3 = number of spaces + ('.$marker_re.') # $4 = first list item marker + [ ]+ + ) + (?s:.+?) + ( # $5 + \z + | + \n{2,} + (?=\S) + (?! # Negative lookahead for another list item marker + [ ]* + '.$marker_re.'[ ]+ + ) + | + (?= # Lookahead for another kind of list + \n + \3 # Must have the same indentation + '.$other_marker_re.'[ ]+ + ) + ) + ) + '; // mx + + # We use a different prefix before nested lists than top-level lists. + # See extended comment in _ProcessListItems(). + + if ($this->list_level) { + $text = preg_replace_callback('{ + ^ + '.$whole_list_re.' + }mx', + array($this, '_doLists_callback'), $text); + } + else { + $text = preg_replace_callback('{ + (?:(?<=\n)\n|\A\n?) # Must eat the newline + '.$whole_list_re.' + }mx', + array($this, '_doLists_callback'), $text); + } + } + + return $text; + } + protected function _doLists_callback($matches) { + # Re-usable patterns to match list item bullets and number markers: + $marker_ul_re = '[*+-]'; + $marker_ol_re = '\d+[\.]'; + $marker_any_re = "(?:$marker_ul_re|$marker_ol_re)"; + $marker_ol_start_re = '[0-9]+'; + + $list = $matches[1]; + $list_type = preg_match("/$marker_ul_re/", $matches[4]) ? "ul" : "ol"; + + $marker_any_re = ( $list_type == "ul" ? $marker_ul_re : $marker_ol_re ); + + $list .= "\n"; + $result = $this->processListItems($list, $marker_any_re); + + $ol_start = 1; + if ($this->enhanced_ordered_list) { + # Get the start number for ordered list. + if ($list_type == 'ol') { + $ol_start_array = array(); + $ol_start_check = preg_match("/$marker_ol_start_re/", $matches[4], $ol_start_array); + if ($ol_start_check){ + $ol_start = $ol_start_array[0]; + } + } + } + + if ($ol_start > 1 && $list_type == 'ol'){ + $result = $this->hashBlock("<$list_type start=\"$ol_start\">\n" . $result . ""); + } else { + $result = $this->hashBlock("<$list_type>\n" . $result . ""); + } + return "\n". $result ."\n\n"; + } + + protected $list_level = 0; + + protected function processListItems($list_str, $marker_any_re) { + # + # Process the contents of a single ordered or unordered list, splitting it + # into individual list items. + # + # The $this->list_level global keeps track of when we're inside a list. + # Each time we enter a list, we increment it; when we leave a list, + # we decrement. If it's zero, we're not in a list anymore. + # + # We do this because when we're not inside a list, we want to treat + # something like this: + # + # I recommend upgrading to version + # 8. Oops, now this line is treated + # as a sub-list. + # + # As a single paragraph, despite the fact that the second line starts + # with a digit-period-space sequence. + # + # Whereas when we're inside a list (or sub-list), that line will be + # treated as the start of a sub-list. What a kludge, huh? This is + # an aspect of Markdown's syntax that's hard to parse perfectly + # without resorting to mind-reading. Perhaps the solution is to + # change the syntax rules such that sub-lists must start with a + # starting cardinal number; e.g. "1." or "a.". + + $this->list_level++; + + # trim trailing blank lines: + $list_str = preg_replace("/\n{2,}\\z/", "\n", $list_str); + + $list_str = preg_replace_callback('{ + (\n)? # leading line = $1 + (^[ ]*) # leading whitespace = $2 + ('.$marker_any_re.' # list marker and space = $3 + (?:[ ]+|(?=\n)) # space only required if item is not empty + ) + ((?s:.*?)) # list item text = $4 + (?:(\n+(?=\n))|\n) # tailing blank line = $5 + (?= \n* (\z | \2 ('.$marker_any_re.') (?:[ ]+|(?=\n)))) + }xm', + array($this, '_processListItems_callback'), $list_str); + + $this->list_level--; + return $list_str; + } + protected function _processListItems_callback($matches) { + $item = $matches[4]; + $leading_line =& $matches[1]; + $leading_space =& $matches[2]; + $marker_space = $matches[3]; + $tailing_blank_line =& $matches[5]; + + if ($leading_line || $tailing_blank_line || + preg_match('/\n{2,}/', $item)) + { + # Replace marker with the appropriate whitespace indentation + $item = $leading_space . str_repeat(' ', strlen($marker_space)) . $item; + $item = $this->runBlockGamut($this->outdent($item)."\n"); + } + else { + # Recursion for sub-lists: + $item = $this->doLists($this->outdent($item)); + $item = preg_replace('/\n+$/', '', $item); + $item = $this->runSpanGamut($item); + } + + return "
      2. " . $item . "
      3. \n"; + } + + + protected function doCodeBlocks($text) { + # + # Process Markdown `
        ` blocks.
        +	#
        +		$text = preg_replace_callback('{
        +				(?:\n\n|\A\n?)
        +				(	            # $1 = the code block -- one or more lines, starting with a space/tab
        +				  (?>
        +					[ ]{'.$this->tab_width.'}  # Lines must start with a tab or a tab-width of spaces
        +					.*\n+
        +				  )+
        +				)
        +				((?=^[ ]{0,'.$this->tab_width.'}\S)|\Z)	# Lookahead for non-space at line-start, or end of doc
        +			}xm',
        +			array($this, '_doCodeBlocks_callback'), $text);
        +
        +		return $text;
        +	}
        +	protected function _doCodeBlocks_callback($matches) {
        +		$codeblock = $matches[1];
        +
        +		$codeblock = $this->outdent($codeblock);
        +		$codeblock = htmlspecialchars($codeblock, ENT_NOQUOTES);
        +
        +		# trim leading newlines and trailing newlines
        +		$codeblock = preg_replace('/\A\n+|\n+\z/', '', $codeblock);
        +
        +		$codeblock = "
        $codeblock\n
        "; + return "\n\n".$this->hashBlock($codeblock)."\n\n"; + } + + + protected function makeCodeSpan($code) { + # + # Create a code span markup for $code. Called from handleSpanToken. + # + $code = htmlspecialchars(trim($code), ENT_NOQUOTES); + return $this->hashPart("$code"); + } + + + protected $em_relist = array( + '' => '(?:(? '(? '(? '(?:(? '(? '(? '(?:(? '(? '(?em_relist as $em => $em_re) { + foreach ($this->strong_relist as $strong => $strong_re) { + # Construct list of allowed token expressions. + $token_relist = array(); + if (isset($this->em_strong_relist["$em$strong"])) { + $token_relist[] = $this->em_strong_relist["$em$strong"]; + } + $token_relist[] = $em_re; + $token_relist[] = $strong_re; + + # Construct master expression from list. + $token_re = '{('. implode('|', $token_relist) .')}'; + $this->em_strong_prepared_relist["$em$strong"] = $token_re; + } + } + } + + protected function doItalicsAndBold($text) { + $token_stack = array(''); + $text_stack = array(''); + $em = ''; + $strong = ''; + $tree_char_em = false; + + while (1) { + # + # Get prepared regular expression for seraching emphasis tokens + # in current context. + # + $token_re = $this->em_strong_prepared_relist["$em$strong"]; + + # + # Each loop iteration search for the next emphasis token. + # Each token is then passed to handleSpanToken. + # + $parts = preg_split($token_re, $text, 2, PREG_SPLIT_DELIM_CAPTURE); + $text_stack[0] .= $parts[0]; + $token =& $parts[1]; + $text =& $parts[2]; + + if (empty($token)) { + # Reached end of text span: empty stack without emitting. + # any more emphasis. + while ($token_stack[0]) { + $text_stack[1] .= array_shift($token_stack); + $text_stack[0] .= array_shift($text_stack); + } + break; + } + + $token_len = strlen($token); + if ($tree_char_em) { + # Reached closing marker while inside a three-char emphasis. + if ($token_len == 3) { + # Three-char closing marker, close em and strong. + array_shift($token_stack); + $span = array_shift($text_stack); + $span = $this->runSpanGamut($span); + $span = "$span"; + $text_stack[0] .= $this->hashPart($span); + $em = ''; + $strong = ''; + } else { + # Other closing marker: close one em or strong and + # change current token state to match the other + $token_stack[0] = str_repeat($token{0}, 3-$token_len); + $tag = $token_len == 2 ? "strong" : "em"; + $span = $text_stack[0]; + $span = $this->runSpanGamut($span); + $span = "<$tag>$span"; + $text_stack[0] = $this->hashPart($span); + $$tag = ''; # $$tag stands for $em or $strong + } + $tree_char_em = false; + } else if ($token_len == 3) { + if ($em) { + # Reached closing marker for both em and strong. + # Closing strong marker: + for ($i = 0; $i < 2; ++$i) { + $shifted_token = array_shift($token_stack); + $tag = strlen($shifted_token) == 2 ? "strong" : "em"; + $span = array_shift($text_stack); + $span = $this->runSpanGamut($span); + $span = "<$tag>$span"; + $text_stack[0] .= $this->hashPart($span); + $$tag = ''; # $$tag stands for $em or $strong + } + } else { + # Reached opening three-char emphasis marker. Push on token + # stack; will be handled by the special condition above. + $em = $token{0}; + $strong = "$em$em"; + array_unshift($token_stack, $token); + array_unshift($text_stack, ''); + $tree_char_em = true; + } + } else if ($token_len == 2) { + if ($strong) { + # Unwind any dangling emphasis marker: + if (strlen($token_stack[0]) == 1) { + $text_stack[1] .= array_shift($token_stack); + $text_stack[0] .= array_shift($text_stack); + } + # Closing strong marker: + array_shift($token_stack); + $span = array_shift($text_stack); + $span = $this->runSpanGamut($span); + $span = "$span"; + $text_stack[0] .= $this->hashPart($span); + $strong = ''; + } else { + array_unshift($token_stack, $token); + array_unshift($text_stack, ''); + $strong = $token; + } + } else { + # Here $token_len == 1 + if ($em) { + if (strlen($token_stack[0]) == 1) { + # Closing emphasis marker: + array_shift($token_stack); + $span = array_shift($text_stack); + $span = $this->runSpanGamut($span); + $span = "$span"; + $text_stack[0] .= $this->hashPart($span); + $em = ''; + } else { + $text_stack[0] .= $token; + } + } else { + array_unshift($token_stack, $token); + array_unshift($text_stack, ''); + $em = $token; + } + } + } + return $text_stack[0]; + } + + + protected function doBlockQuotes($text) { + $text = preg_replace_callback('/ + ( # Wrap whole match in $1 + (?> + ^[ ]*>[ ]? # ">" at the start of a line + .+\n # rest of the first line + (.+\n)* # subsequent consecutive lines + \n* # blanks + )+ + ) + /xm', + array($this, '_doBlockQuotes_callback'), $text); + + return $text; + } + protected function _doBlockQuotes_callback($matches) { + $bq = $matches[1]; + # trim one level of quoting - trim whitespace-only lines + $bq = preg_replace('/^[ ]*>[ ]?|^[ ]+$/m', '', $bq); + $bq = $this->runBlockGamut($bq); # recurse + + $bq = preg_replace('/^/m', " ", $bq); + # These leading spaces cause problem with
         content, 
        +		# so we need to fix that:
        +		$bq = preg_replace_callback('{(\s*
        .+?
        )}sx', + array($this, '_doBlockQuotes_callback2'), $bq); + + return "\n". $this->hashBlock("
        \n$bq\n
        ")."\n\n"; + } + protected function _doBlockQuotes_callback2($matches) { + $pre = $matches[1]; + $pre = preg_replace('/^ /m', '', $pre); + return $pre; + } + + + protected function formParagraphs($text) { + # + # Params: + # $text - string to process with html

        tags + # + # Strip leading and trailing lines: + $text = preg_replace('/\A\n+|\n+\z/', '', $text); + + $grafs = preg_split('/\n{2,}/', $text, -1, PREG_SPLIT_NO_EMPTY); + + # + # Wrap

        tags and unhashify HTML blocks + # + foreach ($grafs as $key => $value) { + if (!preg_match('/^B\x1A[0-9]+B$/', $value)) { + # Is a paragraph. + $value = $this->runSpanGamut($value); + $value = preg_replace('/^([ ]*)/', "

        ", $value); + $value .= "

        "; + $grafs[$key] = $this->unhash($value); + } + else { + # Is a block. + # Modify elements of @grafs in-place... + $graf = $value; + $block = $this->html_hashes[$graf]; + $graf = $block; +// if (preg_match('{ +// \A +// ( # $1 =
        tag +//
        ]* +// \b +// markdown\s*=\s* ([\'"]) # $2 = attr quote char +// 1 +// \2 +// [^>]* +// > +// ) +// ( # $3 = contents +// .* +// ) +// (
        ) # $4 = closing tag +// \z +// }xs', $block, $matches)) +// { +// list(, $div_open, , $div_content, $div_close) = $matches; +// +// # We can't call Markdown(), because that resets the hash; +// # that initialization code should be pulled into its own sub, though. +// $div_content = $this->hashHTMLBlocks($div_content); +// +// # Run document gamut methods on the content. +// foreach ($this->document_gamut as $method => $priority) { +// $div_content = $this->$method($div_content); +// } +// +// $div_open = preg_replace( +// '{\smarkdown\s*=\s*([\'"]).+?\1}', '', $div_open); +// +// $graf = $div_open . "\n" . $div_content . "\n" . $div_close; +// } + $grafs[$key] = $graf; + } + } + + return implode("\n\n", $grafs); + } + + + protected function encodeAttribute($text) { + # + # Encode text for a double-quoted HTML attribute. This function + # is *not* suitable for attributes enclosed in single quotes. + # + $text = $this->encodeAmpsAndAngles($text); + $text = str_replace('"', '"', $text); + return $text; + } + + + protected function encodeURLAttribute($url, &$text = null) { + # + # Encode text for a double-quoted HTML attribute containing a URL, + # applying the URL filter if set. Also generates the textual + # representation for the URL (removing mailto: or tel:) storing it in $text. + # This function is *not* suitable for attributes enclosed in single quotes. + # + if ($this->url_filter_func) + $url = call_user_func($this->url_filter_func, $url); + + if (preg_match('{^mailto:}i', $url)) + $url = $this->encodeEntityObfuscatedAttribute($url, $text, 7); + else if (preg_match('{^tel:}i', $url)) + { + $url = $this->encodeAttribute($url); + $text = substr($url, 4); + } + else + { + $url = $this->encodeAttribute($url); + $text = $url; + } + + return $url; + } + + + protected function encodeAmpsAndAngles($text) { + # + # Smart processing for ampersands and angle brackets that need to + # be encoded. Valid character entities are left alone unless the + # no-entities mode is set. + # + if ($this->no_entities) { + $text = str_replace('&', '&', $text); + } else { + # Ampersand-encoding based entirely on Nat Irons's Amputator + # MT plugin: + $text = preg_replace('/&(?!#?[xX]?(?:[0-9a-fA-F]+|\w+);)/', + '&', $text); + } + # Encode remaining <'s + $text = str_replace('<', '<', $text); + + return $text; + } + + + protected function doAutoLinks($text) { + $text = preg_replace_callback('{<((https?|ftp|dict|tel):[^\'">\s]+)>}i', + array($this, '_doAutoLinks_url_callback'), $text); + + # Email addresses: + $text = preg_replace_callback('{ + < + (?:mailto:)? + ( + (?: + [-!#$%&\'*+/=?^_`.{|}~\w\x80-\xFF]+ + | + ".*?" + ) + \@ + (?: + [-a-z0-9\x80-\xFF]+(\.[-a-z0-9\x80-\xFF]+)*\.[a-z]+ + | + \[[\d.a-fA-F:]+\] # IPv4 & IPv6 + ) + ) + > + }xi', + array($this, '_doAutoLinks_email_callback'), $text); + + return $text; + } + protected function _doAutoLinks_url_callback($matches) { + $url = $this->encodeURLAttribute($matches[1], $text); + $link = "$text"; + return $this->hashPart($link); + } + protected function _doAutoLinks_email_callback($matches) { + $addr = $matches[1]; + $url = $this->encodeURLAttribute("mailto:$addr", $text); + $link = "$text"; + return $this->hashPart($link); + } + + + protected function encodeEntityObfuscatedAttribute($text, &$tail = null, $head_length = 0) { + # + # Input: some text to obfuscate, e.g. "mailto:foo@example.com" + # + # Output: the same text but with most characters encoded as either a + # decimal or hex entity, in the hopes of foiling most address + # harvesting spam bots. E.g.: + # + # mailto:foo + # @example.co + # m + # + # Note: the additional output $tail is assigned the same value as the + # ouput, minus the number of characters specified by $head_length. + # + # Based by a filter by Matthew Wickline, posted to BBEdit-Talk. + # With some optimizations by Milian Wolff. Forced encoding of HTML + # attribute special characters by Allan Odgaard. + # + if ($text == "") return $tail = ""; + + $chars = preg_split('/(? $char) { + $ord = ord($char); + # Ignore non-ascii chars. + if ($ord < 128) { + $r = ($seed * (1 + $key)) % 100; # Pseudo-random function. + # roughly 10% raw, 45% hex, 45% dec + # '@' *must* be encoded. I insist. + # '"' and '>' have to be encoded inside the attribute + if ($r > 90 && strpos('@"&>', $char) === false) /* do nothing */; + else if ($r < 45) $chars[$key] = '&#x'.dechex($ord).';'; + else $chars[$key] = '&#'.$ord.';'; + } + } + + $text = implode('', $chars); + $tail = $head_length ? implode('', array_slice($chars, $head_length)) : $text; + + return $text; + } + + + protected function parseSpan($str) { + # + # Take the string $str and parse it into tokens, hashing embeded HTML, + # escaped characters and handling code spans. + # + $output = ''; + + $span_re = '{ + ( + \\\\'.$this->escape_chars_re.' + | + (?no_markup ? '' : ' + | + # comment + | + <\?.*?\?> | <%.*?%> # processing instruction + | + <[!$]?[-a-zA-Z0-9:_]+ # regular tags + (?> + \s + (?>[^"\'>]+|"[^"]*"|\'[^\']*\')* + )? + > + | + <[-a-zA-Z0-9:_]+\s*/> # xml-style empty tag + | + # closing tag + ').' + ) + }xs'; + + while (1) { + # + # Each loop iteration seach for either the next tag, the next + # openning code span marker, or the next escaped character. + # Each token is then passed to handleSpanToken. + # + $parts = preg_split($span_re, $str, 2, PREG_SPLIT_DELIM_CAPTURE); + + # Create token from text preceding tag. + if ($parts[0] != "") { + $output .= $parts[0]; + } + + # Check if we reach the end. + if (isset($parts[1])) { + $output .= $this->handleSpanToken($parts[1], $parts[2]); + $str = $parts[2]; + } + else { + break; + } + } + + return $output; + } + + + protected function handleSpanToken($token, &$str) { + # + # Handle $token provided by parseSpan by determining its nature and + # returning the corresponding value that should replace it. + # + switch ($token{0}) { + case "\\": + return $this->hashPart("&#". ord($token{1}). ";"); + case "`": + # Search for end marker in remaining text. + if (preg_match('/^(.*?[^`])'.preg_quote($token).'(?!`)(.*)$/sm', + $str, $matches)) + { + $str = $matches[2]; + $codespan = $this->makeCodeSpan($matches[1]); + return $this->hashPart($codespan); + } + return $token; // return as text since no ending marker found. + default: + return $this->hashPart($token); + } + } + + + protected function outdent($text) { + # + # Remove one level of line-leading tabs or spaces + # + return preg_replace('/^(\t|[ ]{1,'.$this->tab_width.'})/m', '', $text); + } + + + # String length function for detab. `_initDetab` will create a function to + # hanlde UTF-8 if the default function does not exist. + protected $utf8_strlen = 'mb_strlen'; + + protected function detab($text) { + # + # Replace tabs with the appropriate amount of space. + # + # For each line we separate the line in blocks delemited by + # tab characters. Then we reconstruct every line by adding the + # appropriate number of space between each blocks. + + $text = preg_replace_callback('/^.*\t.*$/m', + array($this, '_detab_callback'), $text); + + return $text; + } + protected function _detab_callback($matches) { + $line = $matches[0]; + $strlen = $this->utf8_strlen; # strlen function for UTF-8. + + # Split in blocks. + $blocks = explode("\t", $line); + # Add each blocks to the line. + $line = $blocks[0]; + unset($blocks[0]); # Do not add first block twice. + foreach ($blocks as $block) { + # Calculate amount of space, insert spaces, insert block. + $amount = $this->tab_width - + $strlen($line, 'UTF-8') % $this->tab_width; + $line .= str_repeat(" ", $amount) . $block; + } + return $line; + } + protected function _initDetab() { + # + # Check for the availability of the function in the `utf8_strlen` property + # (initially `mb_strlen`). If the function is not available, create a + # function that will loosely count the number of UTF-8 characters with a + # regular expression. + # + if (function_exists($this->utf8_strlen)) return; + $this->utf8_strlen = create_function('$text', 'return preg_match_all( + "/[\\\\x00-\\\\xBF]|[\\\\xC0-\\\\xFF][\\\\x80-\\\\xBF]*/", + $text, $m);'); + } + + + protected function unhash($text) { + # + # Swap back in all the tags hashed by _HashHTMLBlocks. + # + return preg_replace_callback('/(.)\x1A[0-9]+\1/', + array($this, '_unhash_callback'), $text); + } + protected function _unhash_callback($matches) { + return $this->html_hashes[$matches[0]]; + } + +} diff --git a/vendor/michelf/php-markdown/Michelf/MarkdownExtra.inc.php b/vendor/michelf/php-markdown/Michelf/MarkdownExtra.inc.php new file mode 100644 index 000000000..e11b1ef97 --- /dev/null +++ b/vendor/michelf/php-markdown/Michelf/MarkdownExtra.inc.php @@ -0,0 +1,11 @@ + +# +# Original Markdown +# Copyright (c) 2004-2006 John Gruber +# +# +namespace Michelf; + + +# +# Markdown Extra Parser Class +# + +class MarkdownExtra extends \Michelf\Markdown { + + ### Configuration Variables ### + + # Prefix for footnote ids. + public $fn_id_prefix = ""; + + # Optional title attribute for footnote links and backlinks. + public $fn_link_title = ""; + public $fn_backlink_title = ""; + + # Optional class attribute for footnote links and backlinks. + public $fn_link_class = "footnote-ref"; + public $fn_backlink_class = "footnote-backref"; + + # Class name for table cell alignment (%% replaced left/center/right) + # For instance: 'go-%%' becomes 'go-left' or 'go-right' or 'go-center' + # If empty, the align attribute is used instead of a class name. + public $table_align_class_tmpl = ''; + + # Optional class prefix for fenced code block. + public $code_class_prefix = ""; + # Class attribute for code blocks goes on the `code` tag; + # setting this to true will put attributes on the `pre` tag instead. + public $code_attr_on_pre = false; + + # Predefined abbreviations. + public $predef_abbr = array(); + + ### Parser Implementation ### + + public function __construct() { + # + # Constructor function. Initialize the parser object. + # + # Add extra escapable characters before parent constructor + # initialize the table. + $this->escape_chars .= ':|'; + + # Insert extra document, block, and span transformations. + # Parent constructor will do the sorting. + $this->document_gamut += array( + "doFencedCodeBlocks" => 5, + "stripFootnotes" => 15, + "stripAbbreviations" => 25, + "appendFootnotes" => 50, + ); + $this->block_gamut += array( + "doFencedCodeBlocks" => 5, + "doTables" => 15, + "doDefLists" => 45, + ); + $this->span_gamut += array( + "doFootnotes" => 5, + "doAbbreviations" => 70, + ); + + $this->enhanced_ordered_list = true; + parent::__construct(); + } + + + # Extra variables used during extra transformations. + protected $footnotes = array(); + protected $footnotes_ordered = array(); + protected $footnotes_ref_count = array(); + protected $footnotes_numbers = array(); + protected $abbr_desciptions = array(); + protected $abbr_word_re = ''; + + # Give the current footnote number. + protected $footnote_counter = 1; + + + protected function setup() { + # + # Setting up Extra-specific variables. + # + parent::setup(); + + $this->footnotes = array(); + $this->footnotes_ordered = array(); + $this->footnotes_ref_count = array(); + $this->footnotes_numbers = array(); + $this->abbr_desciptions = array(); + $this->abbr_word_re = ''; + $this->footnote_counter = 1; + + foreach ($this->predef_abbr as $abbr_word => $abbr_desc) { + if ($this->abbr_word_re) + $this->abbr_word_re .= '|'; + $this->abbr_word_re .= preg_quote($abbr_word); + $this->abbr_desciptions[$abbr_word] = trim($abbr_desc); + } + } + + protected function teardown() { + # + # Clearing Extra-specific variables. + # + $this->footnotes = array(); + $this->footnotes_ordered = array(); + $this->footnotes_ref_count = array(); + $this->footnotes_numbers = array(); + $this->abbr_desciptions = array(); + $this->abbr_word_re = ''; + + parent::teardown(); + } + + + ### Extra Attribute Parser ### + + # Expression to use to catch attributes (includes the braces) + protected $id_class_attr_catch_re = '\{((?:[ ]*[#.a-z][-_:a-zA-Z0-9=]+){1,})[ ]*\}'; + # Expression to use when parsing in a context when no capture is desired + protected $id_class_attr_nocatch_re = '\{(?:[ ]*[#.a-z][-_:a-zA-Z0-9=]+){1,}[ ]*\}'; + + protected function doExtraAttributes($tag_name, $attr, $defaultIdValue = null) { + # + # Parse attributes caught by the $this->id_class_attr_catch_re expression + # and return the HTML-formatted list of attributes. + # + # Currently supported attributes are .class and #id. + # + # In addition, this method also supports supplying a default Id value, + # which will be used to populate the id attribute in case it was not + # overridden. + if (empty($attr) && !$defaultIdValue) return ""; + + # Split on components + preg_match_all('/[#.a-z][-_:a-zA-Z0-9=]+/', $attr, $matches); + $elements = $matches[0]; + + # handle classes and ids (only first id taken into account) + $classes = array(); + $attributes = array(); + $id = false; + foreach ($elements as $element) { + if ($element{0} == '.') { + $classes[] = substr($element, 1); + } else if ($element{0} == '#') { + if ($id === false) $id = substr($element, 1); + } else if (strpos($element, '=') > 0) { + $parts = explode('=', $element, 2); + $attributes[] = $parts[0] . '="' . $parts[1] . '"'; + } + } + + if (!$id) $id = $defaultIdValue; + + # compose attributes as string + $attr_str = ""; + if (!empty($id)) { + $attr_str .= ' id="'.$this->encodeAttribute($id) .'"'; + } + if (!empty($classes)) { + $attr_str .= ' class="'. implode(" ", $classes) . '"'; + } + if (!$this->no_markup && !empty($attributes)) { + $attr_str .= ' '.implode(" ", $attributes); + } + return $attr_str; + } + + + protected function stripLinkDefinitions($text) { + # + # Strips link definitions from text, stores the URLs and titles in + # hash references. + # + $less_than_tab = $this->tab_width - 1; + + # Link defs are in the form: ^[id]: url "optional title" + $text = preg_replace_callback('{ + ^[ ]{0,'.$less_than_tab.'}\[(.+)\][ ]?: # id = $1 + [ ]* + \n? # maybe *one* newline + [ ]* + (?: + <(.+?)> # url = $2 + | + (\S+?) # url = $3 + ) + [ ]* + \n? # maybe one newline + [ ]* + (?: + (?<=\s) # lookbehind for whitespace + ["(] + (.*?) # title = $4 + [")] + [ ]* + )? # title is optional + (?:[ ]* '.$this->id_class_attr_catch_re.' )? # $5 = extra id & class attr + (?:\n+|\Z) + }xm', + array($this, '_stripLinkDefinitions_callback'), + $text); + return $text; + } + protected function _stripLinkDefinitions_callback($matches) { + $link_id = strtolower($matches[1]); + $url = $matches[2] == '' ? $matches[3] : $matches[2]; + $this->urls[$link_id] = $url; + $this->titles[$link_id] =& $matches[4]; + $this->ref_attr[$link_id] = $this->doExtraAttributes("", $dummy =& $matches[5]); + return ''; # String that will replace the block + } + + + ### HTML Block Parser ### + + # Tags that are always treated as block tags: + protected $block_tags_re = 'p|div|h[1-6]|blockquote|pre|table|dl|ol|ul|address|form|fieldset|iframe|hr|legend|article|section|nav|aside|hgroup|header|footer|figcaption|figure'; + + # Tags treated as block tags only if the opening tag is alone on its line: + protected $context_block_tags_re = 'script|noscript|style|ins|del|iframe|object|source|track|param|math|svg|canvas|audio|video'; + + # Tags where markdown="1" default to span mode: + protected $contain_span_tags_re = 'p|h[1-6]|li|dd|dt|td|th|legend|address'; + + # Tags which must not have their contents modified, no matter where + # they appear: + protected $clean_tags_re = 'script|style|math|svg'; + + # Tags that do not need to be closed. + protected $auto_close_tags_re = 'hr|img|param|source|track'; + + + protected function hashHTMLBlocks($text) { + # + # Hashify HTML Blocks and "clean tags". + # + # We only want to do this for block-level HTML tags, such as headers, + # lists, and tables. That's because we still want to wrap

        s around + # "paragraphs" that are wrapped in non-block-level tags, such as anchors, + # phrase emphasis, and spans. The list of tags we're looking for is + # hard-coded. + # + # This works by calling _HashHTMLBlocks_InMarkdown, which then calls + # _HashHTMLBlocks_InHTML when it encounter block tags. When the markdown="1" + # attribute is found within a tag, _HashHTMLBlocks_InHTML calls back + # _HashHTMLBlocks_InMarkdown to handle the Markdown syntax within the tag. + # These two functions are calling each other. It's recursive! + # + if ($this->no_markup) return $text; + + # + # Call the HTML-in-Markdown hasher. + # + list($text, ) = $this->_hashHTMLBlocks_inMarkdown($text); + + return $text; + } + protected function _hashHTMLBlocks_inMarkdown($text, $indent = 0, + $enclosing_tag_re = '', $span = false) + { + # + # Parse markdown text, calling _HashHTMLBlocks_InHTML for block tags. + # + # * $indent is the number of space to be ignored when checking for code + # blocks. This is important because if we don't take the indent into + # account, something like this (which looks right) won't work as expected: + # + #

        + #
        + # Hello World. <-- Is this a Markdown code block or text? + #
        <-- Is this a Markdown code block or a real tag? + #
        + # + # If you don't like this, just don't indent the tag on which + # you apply the markdown="1" attribute. + # + # * If $enclosing_tag_re is not empty, stops at the first unmatched closing + # tag with that name. Nested tags supported. + # + # * If $span is true, text inside must treated as span. So any double + # newline will be replaced by a single newline so that it does not create + # paragraphs. + # + # Returns an array of that form: ( processed text , remaining text ) + # + if ($text === '') return array('', ''); + + # Regex to check for the presense of newlines around a block tag. + $newline_before_re = '/(?:^\n?|\n\n)*$/'; + $newline_after_re = + '{ + ^ # Start of text following the tag. + (?>[ ]*)? # Optional comment. + [ ]*\n # Must be followed by newline. + }xs'; + + # Regex to match any tag. + $block_tag_re = + '{ + ( # $2: Capture whole tag. + # Tag name. + '.$this->block_tags_re.' | + '.$this->context_block_tags_re.' | + '.$this->clean_tags_re.' | + (?!\s)'.$enclosing_tag_re.' + ) + (?: + (?=[\s"\'/a-zA-Z0-9]) # Allowed characters after tag name. + (?> + ".*?" | # Double quotes (can contain `>`) + \'.*?\' | # Single quotes (can contain `>`) + .+? # Anything but quotes and `>`. + )*? + )? + > # End of tag. + | + # HTML Comment + | + <\?.*?\?> | <%.*?%> # Processing instruction + | + # CData Block + '. ( !$span ? ' # If not in span. + | + # Indented code block + (?: ^[ ]*\n | ^ | \n[ ]*\n ) + [ ]{'.($indent+4).'}[^\n]* \n + (?> + (?: [ ]{'.($indent+4).'}[^\n]* | [ ]* ) \n + )* + | + # Fenced code block marker + (?<= ^ | \n ) + [ ]{0,'.($indent+3).'}(?:~{3,}|`{3,}) + [ ]* + (?: + \.?[-_:a-zA-Z0-9]+ # standalone class name + | + '.$this->id_class_attr_nocatch_re.' # extra attributes + )? + [ ]* + (?= \n ) + ' : '' ). ' # End (if not is span). + | + # Code span marker + # Note, this regex needs to go after backtick fenced + # code blocks but it should also be kept outside of the + # "if not in span" condition adding backticks to the parser + `+ + ) + }xs'; + + + $depth = 0; # Current depth inside the tag tree. + $parsed = ""; # Parsed text that will be returned. + + # + # Loop through every tag until we find the closing tag of the parent + # or loop until reaching the end of text if no parent tag specified. + # + do { + # + # Split the text using the first $tag_match pattern found. + # Text before pattern will be first in the array, text after + # pattern will be at the end, and between will be any catches made + # by the pattern. + # + $parts = preg_split($block_tag_re, $text, 2, + PREG_SPLIT_DELIM_CAPTURE); + + # If in Markdown span mode, add a empty-string span-level hash + # after each newline to prevent triggering any block element. + if ($span) { + $void = $this->hashPart("", ':'); + $newline = "$void\n"; + $parts[0] = $void . str_replace("\n", $newline, $parts[0]) . $void; + } + + $parsed .= $parts[0]; # Text before current tag. + + # If end of $text has been reached. Stop loop. + if (count($parts) < 3) { + $text = ""; + break; + } + + $tag = $parts[1]; # Tag to handle. + $text = $parts[2]; # Remaining text after current tag. + $tag_re = preg_quote($tag); # For use in a regular expression. + + # + # Check for: Fenced code block marker. + # Note: need to recheck the whole tag to disambiguate backtick + # fences from code spans + # + if (preg_match('{^\n?([ ]{0,'.($indent+3).'})(~{3,}|`{3,})[ ]*(?:\.?[-_:a-zA-Z0-9]+|'.$this->id_class_attr_nocatch_re.')?[ ]*\n?$}', $tag, $capture)) { + # Fenced code block marker: find matching end marker. + $fence_indent = strlen($capture[1]); # use captured indent in re + $fence_re = $capture[2]; # use captured fence in re + if (preg_match('{^(?>.*\n)*?[ ]{'.($fence_indent).'}'.$fence_re.'[ ]*(?:\n|$)}', $text, + $matches)) + { + # End marker found: pass text unchanged until marker. + $parsed .= $tag . $matches[0]; + $text = substr($text, strlen($matches[0])); + } + else { + # No end marker: just skip it. + $parsed .= $tag; + } + } + # + # Check for: Indented code block. + # + else if ($tag{0} == "\n" || $tag{0} == " ") { + # Indented code block: pass it unchanged, will be handled + # later. + $parsed .= $tag; + } + # + # Check for: Code span marker + # Note: need to check this after backtick fenced code blocks + # + else if ($tag{0} == "`") { + # Find corresponding end marker. + $tag_re = preg_quote($tag); + if (preg_match('{^(?>.+?|\n(?!\n))*?(?block_tags_re.')\b}', $tag) || + ( preg_match('{^<(?:'.$this->context_block_tags_re.')\b}', $tag) && + preg_match($newline_before_re, $parsed) && + preg_match($newline_after_re, $text) ) + ) + { + # Need to parse tag and following text using the HTML parser. + list($block_text, $text) = + $this->_hashHTMLBlocks_inHTML($tag . $text, "hashBlock", true); + + # Make sure it stays outside of any paragraph by adding newlines. + $parsed .= "\n\n$block_text\n\n"; + } + # + # Check for: Clean tag (like script, math) + # HTML Comments, processing instructions. + # + else if (preg_match('{^<(?:'.$this->clean_tags_re.')\b}', $tag) || + $tag{1} == '!' || $tag{1} == '?') + { + # Need to parse tag and following text using the HTML parser. + # (don't check for markdown attribute) + list($block_text, $text) = + $this->_hashHTMLBlocks_inHTML($tag . $text, "hashClean", false); + + $parsed .= $block_text; + } + # + # Check for: Tag with same name as enclosing tag. + # + else if ($enclosing_tag_re !== '' && + # Same name as enclosing tag. + preg_match('{^= 0); + + return array($parsed, $text); + } + protected function _hashHTMLBlocks_inHTML($text, $hash_method, $md_attr) { + # + # Parse HTML, calling _HashHTMLBlocks_InMarkdown for block tags. + # + # * Calls $hash_method to convert any blocks. + # * Stops when the first opening tag closes. + # * $md_attr indicate if the use of the `markdown="1"` attribute is allowed. + # (it is not inside clean tags) + # + # Returns an array of that form: ( processed text , remaining text ) + # + if ($text === '') return array('', ''); + + # Regex to match `markdown` attribute inside of a tag. + $markdown_attr_re = ' + { + \s* # Eat whitespace before the `markdown` attribute + markdown + \s*=\s* + (?> + (["\']) # $1: quote delimiter + (.*?) # $2: attribute value + \1 # matching delimiter + | + ([^\s>]*) # $3: unquoted attribute value + ) + () # $4: make $3 always defined (avoid warnings) + }xs'; + + # Regex to match any tag. + $tag_re = '{ + ( # $2: Capture whole tag. + + ".*?" | # Double quotes (can contain `>`) + \'.*?\' | # Single quotes (can contain `>`) + .+? # Anything but quotes and `>`. + )*? + )? + > # End of tag. + | + # HTML Comment + | + <\?.*?\?> | <%.*?%> # Processing instruction + | + # CData Block + ) + }xs'; + + $original_text = $text; # Save original text in case of faliure. + + $depth = 0; # Current depth inside the tag tree. + $block_text = ""; # Temporary text holder for current text. + $parsed = ""; # Parsed text that will be returned. + + # + # Get the name of the starting tag. + # (This pattern makes $base_tag_name_re safe without quoting.) + # + if (preg_match('/^<([\w:$]*)\b/', $text, $matches)) + $base_tag_name_re = $matches[1]; + + # + # Loop through every tag until we find the corresponding closing tag. + # + do { + # + # Split the text using the first $tag_match pattern found. + # Text before pattern will be first in the array, text after + # pattern will be at the end, and between will be any catches made + # by the pattern. + # + $parts = preg_split($tag_re, $text, 2, PREG_SPLIT_DELIM_CAPTURE); + + if (count($parts) < 3) { + # + # End of $text reached with unbalenced tag(s). + # In that case, we return original text unchanged and pass the + # first character as filtered to prevent an infinite loop in the + # parent function. + # + return array($original_text{0}, substr($original_text, 1)); + } + + $block_text .= $parts[0]; # Text before current tag. + $tag = $parts[1]; # Tag to handle. + $text = $parts[2]; # Remaining text after current tag. + + # + # Check for: Auto-close tag (like
        ) + # Comments and Processing Instructions. + # + if (preg_match('{^auto_close_tags_re.')\b}', $tag) || + $tag{1} == '!' || $tag{1} == '?') + { + # Just add the tag to the block as if it was text. + $block_text .= $tag; + } + else { + # + # Increase/decrease nested tag count. Only do so if + # the tag's name match base tag's. + # + if (preg_match('{^mode = $attr_m[2] . $attr_m[3]; + $span_mode = $this->mode == 'span' || $this->mode != 'block' && + preg_match('{^<(?:'.$this->contain_span_tags_re.')\b}', $tag); + + # Calculate indent before tag. + if (preg_match('/(?:^|\n)( *?)(?! ).*?$/', $block_text, $matches)) { + $strlen = $this->utf8_strlen; + $indent = $strlen($matches[1], 'UTF-8'); + } else { + $indent = 0; + } + + # End preceding block with this tag. + $block_text .= $tag; + $parsed .= $this->$hash_method($block_text); + + # Get enclosing tag name for the ParseMarkdown function. + # (This pattern makes $tag_name_re safe without quoting.) + preg_match('/^<([\w:$]*)\b/', $tag, $matches); + $tag_name_re = $matches[1]; + + # Parse the content using the HTML-in-Markdown parser. + list ($block_text, $text) + = $this->_hashHTMLBlocks_inMarkdown($text, $indent, + $tag_name_re, $span_mode); + + # Outdent markdown text. + if ($indent > 0) { + $block_text = preg_replace("/^[ ]{1,$indent}/m", "", + $block_text); + } + + # Append tag content to parsed text. + if (!$span_mode) $parsed .= "\n\n$block_text\n\n"; + else $parsed .= "$block_text"; + + # Start over with a new block. + $block_text = ""; + } + else $block_text .= $tag; + } + + } while ($depth > 0); + + # + # Hash last block text that wasn't processed inside the loop. + # + $parsed .= $this->$hash_method($block_text); + + return array($parsed, $text); + } + + + protected function hashClean($text) { + # + # Called whenever a tag must be hashed when a function inserts a "clean" tag + # in $text, it passes through this function and is automaticaly escaped, + # blocking invalid nested overlap. + # + return $this->hashPart($text, 'C'); + } + + + protected function doAnchors($text) { + # + # Turn Markdown link shortcuts into XHTML tags. + # + if ($this->in_anchor) return $text; + $this->in_anchor = true; + + # + # First, handle reference-style links: [link text] [id] + # + $text = preg_replace_callback('{ + ( # wrap whole match in $1 + \[ + ('.$this->nested_brackets_re.') # link text = $2 + \] + + [ ]? # one optional space + (?:\n[ ]*)? # one optional newline followed by spaces + + \[ + (.*?) # id = $3 + \] + ) + }xs', + array($this, '_doAnchors_reference_callback'), $text); + + # + # Next, inline-style links: [link text](url "optional title") + # + $text = preg_replace_callback('{ + ( # wrap whole match in $1 + \[ + ('.$this->nested_brackets_re.') # link text = $2 + \] + \( # literal paren + [ \n]* + (?: + <(.+?)> # href = $3 + | + ('.$this->nested_url_parenthesis_re.') # href = $4 + ) + [ \n]* + ( # $5 + ([\'"]) # quote char = $6 + (.*?) # Title = $7 + \6 # matching quote + [ \n]* # ignore any spaces/tabs between closing quote and ) + )? # title is optional + \) + (?:[ ]? '.$this->id_class_attr_catch_re.' )? # $8 = id/class attributes + ) + }xs', + array($this, '_doAnchors_inline_callback'), $text); + + # + # Last, handle reference-style shortcuts: [link text] + # These must come last in case you've also got [link text][1] + # or [link text](/foo) + # + $text = preg_replace_callback('{ + ( # wrap whole match in $1 + \[ + ([^\[\]]+) # link text = $2; can\'t contain [ or ] + \] + ) + }xs', + array($this, '_doAnchors_reference_callback'), $text); + + $this->in_anchor = false; + return $text; + } + protected function _doAnchors_reference_callback($matches) { + $whole_match = $matches[1]; + $link_text = $matches[2]; + $link_id =& $matches[3]; + + if ($link_id == "") { + # for shortcut links like [this][] or [this]. + $link_id = $link_text; + } + + # lower-case and turn embedded newlines into spaces + $link_id = strtolower($link_id); + $link_id = preg_replace('{[ ]?\n}', ' ', $link_id); + + if (isset($this->urls[$link_id])) { + $url = $this->urls[$link_id]; + $url = $this->encodeURLAttribute($url); + + $result = "titles[$link_id] ) ) { + $title = $this->titles[$link_id]; + $title = $this->encodeAttribute($title); + $result .= " title=\"$title\""; + } + if (isset($this->ref_attr[$link_id])) + $result .= $this->ref_attr[$link_id]; + + $link_text = $this->runSpanGamut($link_text); + $result .= ">$link_text"; + $result = $this->hashPart($result); + } + else { + $result = $whole_match; + } + return $result; + } + protected function _doAnchors_inline_callback($matches) { + $whole_match = $matches[1]; + $link_text = $this->runSpanGamut($matches[2]); + $url = $matches[3] == '' ? $matches[4] : $matches[3]; + $title =& $matches[7]; + $attr = $this->doExtraAttributes("a", $dummy =& $matches[8]); + + // if the URL was of the form it got caught by the HTML + // tag parser and hashed. Need to reverse the process before using the URL. + $unhashed = $this->unhash($url); + if ($unhashed != $url) + $url = preg_replace('/^<(.*)>$/', '\1', $unhashed); + + $url = $this->encodeURLAttribute($url); + + $result = "encodeAttribute($title); + $result .= " title=\"$title\""; + } + $result .= $attr; + + $link_text = $this->runSpanGamut($link_text); + $result .= ">$link_text"; + + return $this->hashPart($result); + } + + + protected function doImages($text) { + # + # Turn Markdown image shortcuts into tags. + # + # + # First, handle reference-style labeled images: ![alt text][id] + # + $text = preg_replace_callback('{ + ( # wrap whole match in $1 + !\[ + ('.$this->nested_brackets_re.') # alt text = $2 + \] + + [ ]? # one optional space + (?:\n[ ]*)? # one optional newline followed by spaces + + \[ + (.*?) # id = $3 + \] + + ) + }xs', + array($this, '_doImages_reference_callback'), $text); + + # + # Next, handle inline images: ![alt text](url "optional title") + # Don't forget: encode * and _ + # + $text = preg_replace_callback('{ + ( # wrap whole match in $1 + !\[ + ('.$this->nested_brackets_re.') # alt text = $2 + \] + \s? # One optional whitespace character + \( # literal paren + [ \n]* + (?: + <(\S*)> # src url = $3 + | + ('.$this->nested_url_parenthesis_re.') # src url = $4 + ) + [ \n]* + ( # $5 + ([\'"]) # quote char = $6 + (.*?) # title = $7 + \6 # matching quote + [ \n]* + )? # title is optional + \) + (?:[ ]? '.$this->id_class_attr_catch_re.' )? # $8 = id/class attributes + ) + }xs', + array($this, '_doImages_inline_callback'), $text); + + return $text; + } + protected function _doImages_reference_callback($matches) { + $whole_match = $matches[1]; + $alt_text = $matches[2]; + $link_id = strtolower($matches[3]); + + if ($link_id == "") { + $link_id = strtolower($alt_text); # for shortcut links like ![this][]. + } + + $alt_text = $this->encodeAttribute($alt_text); + if (isset($this->urls[$link_id])) { + $url = $this->encodeURLAttribute($this->urls[$link_id]); + $result = "\"$alt_text\"";titles[$link_id])) { + $title = $this->titles[$link_id]; + $title = $this->encodeAttribute($title); + $result .= " title=\"$title\""; + } + if (isset($this->ref_attr[$link_id])) + $result .= $this->ref_attr[$link_id]; + $result .= $this->empty_element_suffix; + $result = $this->hashPart($result); + } + else { + # If there's no such link ID, leave intact: + $result = $whole_match; + } + + return $result; + } + protected function _doImages_inline_callback($matches) { + $whole_match = $matches[1]; + $alt_text = $matches[2]; + $url = $matches[3] == '' ? $matches[4] : $matches[3]; + $title =& $matches[7]; + $attr = $this->doExtraAttributes("img", $dummy =& $matches[8]); + + $alt_text = $this->encodeAttribute($alt_text); + $url = $this->encodeURLAttribute($url); + $result = "\"$alt_text\"";encodeAttribute($title); + $result .= " title=\"$title\""; # $title already quoted + } + $result .= $attr; + $result .= $this->empty_element_suffix; + + return $this->hashPart($result); + } + + + protected function doHeaders($text) { + # + # Redefined to add id and class attribute support. + # + # Setext-style headers: + # Header 1 {#header1} + # ======== + # + # Header 2 {#header2 .class1 .class2} + # -------- + # + $text = preg_replace_callback( + '{ + (^.+?) # $1: Header text + (?:[ ]+ '.$this->id_class_attr_catch_re.' )? # $3 = id/class attributes + [ ]*\n(=+|-+)[ ]*\n+ # $3: Header footer + }mx', + array($this, '_doHeaders_callback_setext'), $text); + + # atx-style headers: + # # Header 1 {#header1} + # ## Header 2 {#header2} + # ## Header 2 with closing hashes ## {#header3.class1.class2} + # ... + # ###### Header 6 {.class2} + # + $text = preg_replace_callback('{ + ^(\#{1,6}) # $1 = string of #\'s + [ ]* + (.+?) # $2 = Header text + [ ]* + \#* # optional closing #\'s (not counted) + (?:[ ]+ '.$this->id_class_attr_catch_re.' )? # $3 = id/class attributes + [ ]* + \n+ + }xm', + array($this, '_doHeaders_callback_atx'), $text); + + return $text; + } + protected function _doHeaders_callback_setext($matches) { + if ($matches[3] == '-' && preg_match('{^- }', $matches[1])) + return $matches[0]; + + $level = $matches[3]{0} == '=' ? 1 : 2; + + $defaultId = is_callable($this->header_id_func) ? call_user_func($this->header_id_func, $matches[1]) : null; + + $attr = $this->doExtraAttributes("h$level", $dummy =& $matches[2], $defaultId); + $block = "".$this->runSpanGamut($matches[1]).""; + return "\n" . $this->hashBlock($block) . "\n\n"; + } + protected function _doHeaders_callback_atx($matches) { + $level = strlen($matches[1]); + + $defaultId = is_callable($this->header_id_func) ? call_user_func($this->header_id_func, $matches[2]) : null; + $attr = $this->doExtraAttributes("h$level", $dummy =& $matches[3], $defaultId); + $block = "".$this->runSpanGamut($matches[2]).""; + return "\n" . $this->hashBlock($block) . "\n\n"; + } + + + protected function doTables($text) { + # + # Form HTML tables. + # + $less_than_tab = $this->tab_width - 1; + # + # Find tables with leading pipe. + # + # | Header 1 | Header 2 + # | -------- | -------- + # | Cell 1 | Cell 2 + # | Cell 3 | Cell 4 + # + $text = preg_replace_callback(' + { + ^ # Start of a line + [ ]{0,'.$less_than_tab.'} # Allowed whitespace. + [|] # Optional leading pipe (present) + (.+) \n # $1: Header row (at least one pipe) + + [ ]{0,'.$less_than_tab.'} # Allowed whitespace. + [|] ([ ]*[-:]+[-| :]*) \n # $2: Header underline + + ( # $3: Cells + (?> + [ ]* # Allowed whitespace. + [|] .* \n # Row content. + )* + ) + (?=\n|\Z) # Stop at final double newline. + }xm', + array($this, '_doTable_leadingPipe_callback'), $text); + + # + # Find tables without leading pipe. + # + # Header 1 | Header 2 + # -------- | -------- + # Cell 1 | Cell 2 + # Cell 3 | Cell 4 + # + $text = preg_replace_callback(' + { + ^ # Start of a line + [ ]{0,'.$less_than_tab.'} # Allowed whitespace. + (\S.*[|].*) \n # $1: Header row (at least one pipe) + + [ ]{0,'.$less_than_tab.'} # Allowed whitespace. + ([-:]+[ ]*[|][-| :]*) \n # $2: Header underline + + ( # $3: Cells + (?> + .* [|] .* \n # Row content + )* + ) + (?=\n|\Z) # Stop at final double newline. + }xm', + array($this, '_DoTable_callback'), $text); + + return $text; + } + protected function _doTable_leadingPipe_callback($matches) { + $head = $matches[1]; + $underline = $matches[2]; + $content = $matches[3]; + + # Remove leading pipe for each row. + $content = preg_replace('/^ *[|]/m', '', $content); + + return $this->_doTable_callback(array($matches[0], $head, $underline, $content)); + } + protected function _doTable_makeAlignAttr($alignname) + { + if (empty($this->table_align_class_tmpl)) + return " align=\"$alignname\""; + + $classname = str_replace('%%', $alignname, $this->table_align_class_tmpl); + return " class=\"$classname\""; + } + protected function _doTable_callback($matches) { + $head = $matches[1]; + $underline = $matches[2]; + $content = $matches[3]; + + # Remove any tailing pipes for each line. + $head = preg_replace('/[|] *$/m', '', $head); + $underline = preg_replace('/[|] *$/m', '', $underline); + $content = preg_replace('/[|] *$/m', '', $content); + + # Reading alignement from header underline. + $separators = preg_split('/ *[|] */', $underline); + foreach ($separators as $n => $s) { + if (preg_match('/^ *-+: *$/', $s)) + $attr[$n] = $this->_doTable_makeAlignAttr('right'); + else if (preg_match('/^ *:-+: *$/', $s)) + $attr[$n] = $this->_doTable_makeAlignAttr('center'); + else if (preg_match('/^ *:-+ *$/', $s)) + $attr[$n] = $this->_doTable_makeAlignAttr('left'); + else + $attr[$n] = ''; + } + + # Parsing span elements, including code spans, character escapes, + # and inline HTML tags, so that pipes inside those gets ignored. + $head = $this->parseSpan($head); + $headers = preg_split('/ *[|] */', $head); + $col_count = count($headers); + $attr = array_pad($attr, $col_count, ''); + + # Write column headers. + $text = "\n"; + $text .= "\n"; + $text .= "\n"; + foreach ($headers as $n => $header) + $text .= " ".$this->runSpanGamut(trim($header))."\n"; + $text .= "\n"; + $text .= "\n"; + + # Split content by row. + $rows = explode("\n", trim($content, "\n")); + + $text .= "\n"; + foreach ($rows as $row) { + # Parsing span elements, including code spans, character escapes, + # and inline HTML tags, so that pipes inside those gets ignored. + $row = $this->parseSpan($row); + + # Split row by cell. + $row_cells = preg_split('/ *[|] */', $row, $col_count); + $row_cells = array_pad($row_cells, $col_count, ''); + + $text .= "\n"; + foreach ($row_cells as $n => $cell) + $text .= " ".$this->runSpanGamut(trim($cell))."\n"; + $text .= "\n"; + } + $text .= "\n"; + $text .= "
        "; + + return $this->hashBlock($text) . "\n"; + } + + + protected function doDefLists($text) { + # + # Form HTML definition lists. + # + $less_than_tab = $this->tab_width - 1; + + # Re-usable pattern to match any entire dl list: + $whole_list_re = '(?> + ( # $1 = whole list + ( # $2 + [ ]{0,'.$less_than_tab.'} + ((?>.*\S.*\n)+) # $3 = defined term + \n? + [ ]{0,'.$less_than_tab.'}:[ ]+ # colon starting definition + ) + (?s:.+?) + ( # $4 + \z + | + \n{2,} + (?=\S) + (?! # Negative lookahead for another term + [ ]{0,'.$less_than_tab.'} + (?: \S.*\n )+? # defined term + \n? + [ ]{0,'.$less_than_tab.'}:[ ]+ # colon starting definition + ) + (?! # Negative lookahead for another definition + [ ]{0,'.$less_than_tab.'}:[ ]+ # colon starting definition + ) + ) + ) + )'; // mx + + $text = preg_replace_callback('{ + (?>\A\n?|(?<=\n\n)) + '.$whole_list_re.' + }mx', + array($this, '_doDefLists_callback'), $text); + + return $text; + } + protected function _doDefLists_callback($matches) { + # Re-usable patterns to match list item bullets and number markers: + $list = $matches[1]; + + # Turn double returns into triple returns, so that we can make a + # paragraph for the last item in a list, if necessary: + $result = trim($this->processDefListItems($list)); + $result = "
        \n" . $result . "\n
        "; + return $this->hashBlock($result) . "\n\n"; + } + + + protected function processDefListItems($list_str) { + # + # Process the contents of a single definition list, splitting it + # into individual term and definition list items. + # + $less_than_tab = $this->tab_width - 1; + + # trim trailing blank lines: + $list_str = preg_replace("/\n{2,}\\z/", "\n", $list_str); + + # Process definition terms. + $list_str = preg_replace_callback('{ + (?>\A\n?|\n\n+) # leading line + ( # definition terms = $1 + [ ]{0,'.$less_than_tab.'} # leading whitespace + (?!\:[ ]|[ ]) # negative lookahead for a definition + # mark (colon) or more whitespace. + (?> \S.* \n)+? # actual term (not whitespace). + ) + (?=\n?[ ]{0,3}:[ ]) # lookahead for following line feed + # with a definition mark. + }xm', + array($this, '_processDefListItems_callback_dt'), $list_str); + + # Process actual definitions. + $list_str = preg_replace_callback('{ + \n(\n+)? # leading line = $1 + ( # marker space = $2 + [ ]{0,'.$less_than_tab.'} # whitespace before colon + \:[ ]+ # definition mark (colon) + ) + ((?s:.+?)) # definition text = $3 + (?= \n+ # stop at next definition mark, + (?: # next term or end of text + [ ]{0,'.$less_than_tab.'} \:[ ] | +
        | \z + ) + ) + }xm', + array($this, '_processDefListItems_callback_dd'), $list_str); + + return $list_str; + } + protected function _processDefListItems_callback_dt($matches) { + $terms = explode("\n", trim($matches[1])); + $text = ''; + foreach ($terms as $term) { + $term = $this->runSpanGamut(trim($term)); + $text .= "\n
        " . $term . "
        "; + } + return $text . "\n"; + } + protected function _processDefListItems_callback_dd($matches) { + $leading_line = $matches[1]; + $marker_space = $matches[2]; + $def = $matches[3]; + + if ($leading_line || preg_match('/\n{2,}/', $def)) { + # Replace marker with the appropriate whitespace indentation + $def = str_repeat(' ', strlen($marker_space)) . $def; + $def = $this->runBlockGamut($this->outdent($def . "\n\n")); + $def = "\n". $def ."\n"; + } + else { + $def = rtrim($def); + $def = $this->runSpanGamut($this->outdent($def)); + } + + return "\n
        " . $def . "
        \n"; + } + + + protected function doFencedCodeBlocks($text) { + # + # Adding the fenced code block syntax to regular Markdown: + # + # ~~~ + # Code block + # ~~~ + # + $less_than_tab = $this->tab_width; + + $text = preg_replace_callback('{ + (?:\n|\A) + # 1: Opening marker + ( + (?:~{3,}|`{3,}) # 3 or more tildes/backticks. + ) + [ ]* + (?: + \.?([-_:a-zA-Z0-9]+) # 2: standalone class name + | + '.$this->id_class_attr_catch_re.' # 3: Extra attributes + )? + [ ]* \n # Whitespace and newline following marker. + + # 4: Content + ( + (?> + (?!\1 [ ]* \n) # Not a closing marker. + .*\n+ + )+ + ) + + # Closing marker. + \1 [ ]* (?= \n ) + }xm', + array($this, '_doFencedCodeBlocks_callback'), $text); + + return $text; + } + protected function _doFencedCodeBlocks_callback($matches) { + $classname =& $matches[2]; + $attrs =& $matches[3]; + $codeblock = $matches[4]; + $codeblock = htmlspecialchars($codeblock, ENT_NOQUOTES); + $codeblock = preg_replace_callback('/^\n+/', + array($this, '_doFencedCodeBlocks_newlines'), $codeblock); + + if ($classname != "") { + if ($classname{0} == '.') + $classname = substr($classname, 1); + $attr_str = ' class="'.$this->code_class_prefix.$classname.'"'; + } else { + $attr_str = $this->doExtraAttributes($this->code_attr_on_pre ? "pre" : "code", $attrs); + } + $pre_attr_str = $this->code_attr_on_pre ? $attr_str : ''; + $code_attr_str = $this->code_attr_on_pre ? '' : $attr_str; + $codeblock = "$codeblock
        "; + + return "\n\n".$this->hashBlock($codeblock)."\n\n"; + } + protected function _doFencedCodeBlocks_newlines($matches) { + return str_repeat("empty_element_suffix", + strlen($matches[0])); + } + + + # + # Redefining emphasis markers so that emphasis by underscore does not + # work in the middle of a word. + # + protected $em_relist = array( + '' => '(?:(? '(? '(? '(?:(? '(? '(? '(?:(? '(? '(? tags + # + # Strip leading and trailing lines: + $text = preg_replace('/\A\n+|\n+\z/', '', $text); + + $grafs = preg_split('/\n{2,}/', $text, -1, PREG_SPLIT_NO_EMPTY); + + # + # Wrap

        tags and unhashify HTML blocks + # + foreach ($grafs as $key => $value) { + $value = trim($this->runSpanGamut($value)); + + # Check if this should be enclosed in a paragraph. + # Clean tag hashes & block tag hashes are left alone. + $is_p = !preg_match('/^B\x1A[0-9]+B|^C\x1A[0-9]+C$/', $value); + + if ($is_p) { + $value = "

        $value

        "; + } + $grafs[$key] = $value; + } + + # Join grafs in one text, then unhash HTML tags. + $text = implode("\n\n", $grafs); + + # Finish by removing any tag hashes still present in $text. + $text = $this->unhash($text); + + return $text; + } + + + ### Footnotes + + protected function stripFootnotes($text) { + # + # Strips link definitions from text, stores the URLs and titles in + # hash references. + # + $less_than_tab = $this->tab_width - 1; + + # Link defs are in the form: [^id]: url "optional title" + $text = preg_replace_callback('{ + ^[ ]{0,'.$less_than_tab.'}\[\^(.+?)\][ ]?: # note_id = $1 + [ ]* + \n? # maybe *one* newline + ( # text = $2 (no blank lines allowed) + (?: + .+ # actual text + | + \n # newlines but + (?!\[.+?\][ ]?:\s)# negative lookahead for footnote or link definition marker. + (?!\n+[ ]{0,3}\S)# ensure line is not blank and followed + # by non-indented content + )* + ) + }xm', + array($this, '_stripFootnotes_callback'), + $text); + return $text; + } + protected function _stripFootnotes_callback($matches) { + $note_id = $this->fn_id_prefix . $matches[1]; + $this->footnotes[$note_id] = $this->outdent($matches[2]); + return ''; # String that will replace the block + } + + + protected function doFootnotes($text) { + # + # Replace footnote references in $text [^id] with a special text-token + # which will be replaced by the actual footnote marker in appendFootnotes. + # + if (!$this->in_anchor) { + $text = preg_replace('{\[\^(.+?)\]}', "F\x1Afn:\\1\x1A:", $text); + } + return $text; + } + + + protected function appendFootnotes($text) { + # + # Append footnote list to text. + # + $text = preg_replace_callback('{F\x1Afn:(.*?)\x1A:}', + array($this, '_appendFootnotes_callback'), $text); + + if (!empty($this->footnotes_ordered)) { + $text .= "\n\n"; + $text .= "
        \n"; + $text .= "empty_element_suffix ."\n"; + $text .= "
          \n\n"; + + $attr = ""; + if ($this->fn_backlink_class != "") { + $class = $this->fn_backlink_class; + $class = $this->encodeAttribute($class); + $attr .= " class=\"$class\""; + } + if ($this->fn_backlink_title != "") { + $title = $this->fn_backlink_title; + $title = $this->encodeAttribute($title); + $attr .= " title=\"$title\""; + } + $num = 0; + + while (!empty($this->footnotes_ordered)) { + $footnote = reset($this->footnotes_ordered); + $note_id = key($this->footnotes_ordered); + unset($this->footnotes_ordered[$note_id]); + $ref_count = $this->footnotes_ref_count[$note_id]; + unset($this->footnotes_ref_count[$note_id]); + unset($this->footnotes[$note_id]); + + $footnote .= "\n"; # Need to append newline before parsing. + $footnote = $this->runBlockGamut("$footnote\n"); + $footnote = preg_replace_callback('{F\x1Afn:(.*?)\x1A:}', + array($this, '_appendFootnotes_callback'), $footnote); + + $attr = str_replace("%%", ++$num, $attr); + $note_id = $this->encodeAttribute($note_id); + + # Prepare backlink, multiple backlinks if multiple references + $backlink = ""; + for ($ref_num = 2; $ref_num <= $ref_count; ++$ref_num) { + $backlink .= " "; + } + # Add backlink to last paragraph; create new paragraph if needed. + if (preg_match('{

          $}', $footnote)) { + $footnote = substr($footnote, 0, -4) . " $backlink

          "; + } else { + $footnote .= "\n\n

          $backlink

          "; + } + + $text .= "
        1. \n"; + $text .= $footnote . "\n"; + $text .= "
        2. \n\n"; + } + + $text .= "
        \n"; + $text .= "
        "; + } + return $text; + } + protected function _appendFootnotes_callback($matches) { + $node_id = $this->fn_id_prefix . $matches[1]; + + # Create footnote marker only if it has a corresponding footnote *and* + # the footnote hasn't been used by another marker. + if (isset($this->footnotes[$node_id])) { + $num =& $this->footnotes_numbers[$node_id]; + if (!isset($num)) { + # Transfer footnote content to the ordered list and give it its + # number + $this->footnotes_ordered[$node_id] = $this->footnotes[$node_id]; + $this->footnotes_ref_count[$node_id] = 1; + $num = $this->footnote_counter++; + $ref_count_mark = ''; + } else { + $ref_count_mark = $this->footnotes_ref_count[$node_id] += 1; + } + + $attr = ""; + if ($this->fn_link_class != "") { + $class = $this->fn_link_class; + $class = $this->encodeAttribute($class); + $attr .= " class=\"$class\""; + } + if ($this->fn_link_title != "") { + $title = $this->fn_link_title; + $title = $this->encodeAttribute($title); + $attr .= " title=\"$title\""; + } + + $attr = str_replace("%%", $num, $attr); + $node_id = $this->encodeAttribute($node_id); + + return + "". + "$num". + ""; + } + + return "[^".$matches[1]."]"; + } + + + ### Abbreviations ### + + protected function stripAbbreviations($text) { + # + # Strips abbreviations from text, stores titles in hash references. + # + $less_than_tab = $this->tab_width - 1; + + # Link defs are in the form: [id]*: url "optional title" + $text = preg_replace_callback('{ + ^[ ]{0,'.$less_than_tab.'}\*\[(.+?)\][ ]?: # abbr_id = $1 + (.*) # text = $2 (no blank lines allowed) + }xm', + array($this, '_stripAbbreviations_callback'), + $text); + return $text; + } + protected function _stripAbbreviations_callback($matches) { + $abbr_word = $matches[1]; + $abbr_desc = $matches[2]; + if ($this->abbr_word_re) + $this->abbr_word_re .= '|'; + $this->abbr_word_re .= preg_quote($abbr_word); + $this->abbr_desciptions[$abbr_word] = trim($abbr_desc); + return ''; # String that will replace the block + } + + + protected function doAbbreviations($text) { + # + # Find defined abbreviations in text and wrap them in elements. + # + if ($this->abbr_word_re) { + // cannot use the /x modifier because abbr_word_re may + // contain significant spaces: + $text = preg_replace_callback('{'. + '(?abbr_word_re.')'. + '(?![\w\x1A])'. + '}', + array($this, '_doAbbreviations_callback'), $text); + } + return $text; + } + protected function _doAbbreviations_callback($matches) { + $abbr = $matches[0]; + if (isset($this->abbr_desciptions[$abbr])) { + $desc = $this->abbr_desciptions[$abbr]; + if (empty($desc)) { + return $this->hashPart("$abbr"); + } else { + $desc = $this->encodeAttribute($desc); + return $this->hashPart("$abbr"); + } + } else { + return $matches[0]; + } + } +} diff --git a/vendor/michelf/php-markdown/Michelf/MarkdownInterface.inc.php b/vendor/michelf/php-markdown/Michelf/MarkdownInterface.inc.php new file mode 100644 index 000000000..a023ed4e3 --- /dev/null +++ b/vendor/michelf/php-markdown/Michelf/MarkdownInterface.inc.php @@ -0,0 +1,9 @@ + +# +# Original Markdown +# Copyright (c) 2004-2006 John Gruber +# +# +namespace Michelf; + + +# +# Markdown Parser Interface +# + +interface MarkdownInterface { + + # + # Initialize the parser and return the result of its transform method. + # This will work fine for derived classes too. + # + public static function defaultTransform($text); + + # + # Main function. Performs some preprocessing on the input text + # and pass it through the document gamut. + # + public function transform($text); + +} diff --git a/vendor/michelf/php-markdown/Readme.md b/vendor/michelf/php-markdown/Readme.md new file mode 100644 index 000000000..fa7fe5881 --- /dev/null +++ b/vendor/michelf/php-markdown/Readme.md @@ -0,0 +1,327 @@ +PHP Markdown +============ + +PHP Markdown Lib 1.5.0 - 1 Mar 2015 + +by Michel Fortin + + +based on Markdown by John Gruber + + + +Introduction +------------ + +This is a library package that includes the PHP Markdown parser and its +sibling PHP Markdown Extra with additional features. + +Markdown is a text-to-HTML conversion tool for web writers. Markdown +allows you to write using an easy-to-read, easy-to-write plain text +format, then convert it to structurally valid XHTML (or HTML). + +"Markdown" is actually two things: a plain text markup syntax, and a +software tool, originally written in Perl, that converts the plain text +markup to HTML. PHP Markdown is a port to PHP of the original Markdown +program by John Gruber. + +* [Full documentation of the Markdown syntax]() + — Daring Fireball (John Gruber) +* [Markdown Extra syntax additions]() + — Michel Fortin + + +Requirement +----------- + +This library package requires PHP 5.3 or later. + +Note: The older plugin/library hybrid package for PHP Markdown and +PHP Markdown Extra is still maintained and will work with PHP 4.0.5 and later. + +Before PHP 5.3.7, pcre.backtrack_limit defaults to 100 000, which is too small +in many situations. You might need to set it to higher values. Later PHP +releases defaults to 1 000 000, which is usually fine. + + +Usage +----- + +This library package is meant to be used with class autoloading. For autoloading +to work, your project needs have setup a PSR-0-compatible autoloader. See the +included Readme.php file for a minimal autoloader setup. (If you cannot use +autoloading, see below.) + +With class autoloading in place, putting the 'Michelf' folder in your +include path should be enough for this to work: + + use \Michelf\Markdown; + $my_html = Markdown::defaultTransform($my_text); + +Markdown Extra syntax is also available the same way: + + use \Michelf\MarkdownExtra; + $my_html = MarkdownExtra::defaultTransform($my_text); + +If you wish to use PHP Markdown with another text filter function +built to parse HTML, you should filter the text *after* the `transform` +function call. This is an example with [PHP SmartyPants][psp]: + + use \Michelf\Markdown, \Michelf\SmartyPants; + $my_html = Markdown::defaultTransform($my_text); + $my_html = SmartyPants::defaultTransform($my_html); + +All these examples are using the static `defaultTransform` static function +found inside the parser class. If you want to customize the parser +configuration, you can also instantiate it directly and change some +configuration variables: + + use \Michelf\MarkdownExtra; + $parser = new MarkdownExtra; + $parser->fn_id_prefix = "post22-"; + $my_html = $parser->transform($my_text); + +To learn more, see the full list of [configuration variables]. + + [configuration variables]: https://michelf.ca/projects/php-markdown/configuration/ + + +### Usage without an autoloader + +If you cannot use class autoloading, you can still use `include` or `require` +to access the parser. To load the `\Michelf\Markdown` parser, do it this way: + + require_once 'Michelf/Markdown.inc.php'; + +Or, if you need the `\Michelf\MarkdownExtra` parser: + + require_once 'Michelf/MarkdownExtra.inc.php'; + +While the plain `.php` files depend on autoloading to work correctly, using the +`.inc.php` files instead will eagerly load the dependencies that would be +loaded on demand if you were using autoloading. + + +Public API and Versioning Policy +--------------------------------- + +Version numbers are of the form *major*.*minor*.*patch*. + +The public API of PHP Markdown consist of the two parser classes `Markdown` +and `MarkdownExtra`, their constructors, the `transform` and `defaultTransform` +functions and their configuration variables. The public API is stable for +a given major version number. It might get additions when the minor version +number increments. + +**Protected members are not considered public API.** This is unconventional +and deserves an explanation. Incrementing the major version number every time +the underlying implementation of something changes is going to give +nonessential version numbers for the vast majority of people who just use the +parser. Protected members are meant to create parser subclasses that behave in +different ways. Very few people create parser subclasses. I don't want to +discourage it by making everything private, but at the same time I can't +guarantee any stable hook between versions if you use protected members. + +**Syntax changes** will increment the minor number for new features, and the +patch number for small corrections. A *new feature* is something that needs a +change in the syntax documentation. Note that since PHP Markdown Lib includes +two parsers, a syntax change for either of them will increment the minor +number. Also note that there is nothing perfectly backward-compatible with the +Markdown syntax: all inputs are always valid, so new features always replace +something that was previously legal, although generally nonsensical to do. + + +Bugs +---- + +To file bug reports please send email to: + + +Please include with your report: (1) the example input; (2) the output you +expected; (3) the output PHP Markdown actually produced. + +If you have a problem where Markdown gives you an empty result, first check +that the backtrack limit is not too low by running `php --info | grep pcre`. +See Installation and Requirement above for details. + + +Development and Testing +----------------------- + +Pull requests for fixing bugs are welcome. Proposed new features are +going meticulously reviewed -- taking into account backward compatibility, +potential side effects, and future extensibility -- before deciding on +acceptance or rejection. + +If you make a pull request that includes changes to the parser please add +tests for what is being changed to [MDTest][] and make a pull request there +too. + + [MDTest]: https://github.com/michelf/mdtest/ + + +Donations +--------- + +If you wish to make a donation that will help me devote more time to +PHP Markdown, please visit [michelf.ca/donate] or send Bitcoin to +[1HiuX34czvVPPdhXbUAsAu7pZcesniDCGH]. + + [michelf.ca/donate]: https://michelf.ca/donate/#!Thanks%20for%20PHP%20Markdown + [1HiuX34czvVPPdhXbUAsAu7pZcesniDCGH]: bitcoin:1HiuX34czvVPPdhXbUAsAu7pZcesniDCGH + + +Version History +--------------- + +PHP Markdown Lib 1.5.0 (1 Mar 2015) + +* Added the ability start ordered lists with a number different from 1 and + and have that reflected in the HTML output. This can be enabled with + the `enhanced_ordered_lists` configuration variable for the Markdown + parser; it is enabled by default for Markdown Extra. + Credits to Matt Gorle for providing the implementation. + +* Added the ability to insert custom HTML attributes with simple values + everywhere an extra attribute block is allowed (links, images, headers). + The value must be unquoted, cannot contains spaces and is limited to + alphanumeric ASCII characters. + Credits to Peter Droogmans for providing the implementation. + +* Added a `header_id_func` configuration variable which takes a function + that can generate an `id` attribute value from the header text. + Credits to Evert Pot for providing the implementation. + +* Added a `url_filter_func` configuration variable which takes a function + that can rewrite any link or image URL to something different. + + +PHP Markdown Lib 1.4.1 (4 May 2014) + +* The HTML block parser will now treat `
        ` as a block-level element + (as it should) and no longer wrap it in `

        ` or parse it's content with + the as Markdown syntax (although with Extra you can use `markdown="1"` + if you wish to use the Markdown syntax inside it). + +* The content of ` + +

        +
        + + + + + +
        + + + + + + + + + + + + + + + + + + + + + + + + + +
        + + FootballScoresLive logo + + + + + +
        + + For FREE goals to your mobile + Click Here + + + + + +
        + + + +   +
        +
        + +
        + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
        + + Add this page to your favourites + +
        Season Ticket Goal Alerts - coming soon
        Mobile Goal Alerts
        + English Leagues
        English National Team - coming soon
        + + Scottish Leagues
        + + Spanish Leagues
        + + Italian Leagues
        Live Scores
        Football Supermarket - coming soon
        Previous Results
        Future Fixtures
        League Tables - coming soon
        Sponsored Links - coming soon
         
        Personalise
        + +
        + +
        +
        + + + +
        + + + + + + + + + +
        +
        + + + + +
        + +
        +
        +
        + + + + + + + +
        + + English Leagues goal alerts by SMS + + Scottish Leagues goal alerts by SMS + + Spanish Leagues goal alerts by SMS + + Italian Leagues goal alerts by SMS
        +
        +
        +
        +
        +
        +
        + + +
        + +

        Historical Football Archive - Updated Daily!

        +
        +

        Missed the details of your football club's latest performance? + Whether you support Manchester United or Cambridge United, Premiership club or Conference club, + you will find it all here, with our fantastic soccer library of results over the last two weeks. + These pages contain the history & detailed results package for every football game from around the world + from the last 14 match days, including not only every goal scored, but, game results, names of goal scorer, + match results, red cards and plenty more! This service is automatically updated every 24 hours, + simply select a date from the drop down menu :- +

        + + +

        + + + + + + + + + +
        +  SCOTLAND - DIVISION 2
        +
        + + + + + + +
        StartStatMinRPOHome AwayRPOLatest
        + 19:45 + Pst - +   + +   + +   + STRANRAER00PETERHEAD +   + +   + +   + +   + +   +
        +
        + +
        + +
        + + + + + + + + + + +
        +  ENGLAND - FA TROPHY - FIRST ROUND
        +
        + + + + + + +
        StartStatMinRPOHome AwayRPOLatest
        + 19:45 + FT - +   + +   + +   + SWINDON SUPERMARINE10EASTBOURNE BOROUGH +   + +   + +   + + + + 74goalEDENBOROUGH +
        +
        + +
        + +
        + + + + + + + + + + +
        +  EUROPE (UEFA) - UEFA CUP - GROUP STAGE
        +
        + + + + + + + + + + + + + + + + + + + + +
        StartStatMinRPOHome AwayRPOLatest
        + 19:45 + FT - +   + +   + +   + AC MILAN22VfL WOLFSBURG +   + +   + +   + +   + + 81goalSAGLIK +
        + 19:45 + FT - +   + + 1 + +   + AJAX22SLAVIA PRAHA +   + +   + +   + +   + + 90penaltySUAREZ +
        + 19:45 + FT - +   + +   + +   + CLUB BRUGGE01FC COPENHAGEN +   + +   + +   + +   + + 58goalSANTIN +
        + 19:45 + FT - +   + +   + +   + DEP. LA CORUNA10NANCY +   + +   + +   + +   + + 74goalBODIPO +
        + 19:45 + FT - +   + +   + +   + FEYENOORD01LECH POZNAN +   + +   + +   + +   + + 26goalDJURDJEVIC +
        + 19:45 + FT - +   + +   + +   + HAMBURGER SV31ASTON VILLA + 1 + +   + +   + +   + + 84red cardSIDWELL +
        + 19:45 + FT - +   + +   + +   + PORTSMOUTH30HEERENVEEN +   + +   + +   + +   + + 90goalHREIDARSSON +
        + 19:45 + FT - +   + +   + +   + ST ETIENNE22VALENCIA +   + +   + +   + +   + + 72goalZIGIC +
        +
        + +
        + +
        + + + + + + + + + + +
        +  INTERNATIONAL TOURNAMENTS - OMAN FOUR NATIONS TOUR
        +
        + + + + + + + + +
        StartStatMinRPOHome AwayRPOLatest
        + 14:00 + FT - +   + +   + +   + OMAN31CHINA +   + +   + +   + + + + 84goalSALEH +
        + 16:30 + FT - +   + +   + +   + ECUADOR10IRAN + 1 + +   + +   + + + + 90red cardNEJAD +
        +
        + +
        + +
        + + + + + + + + + + +
        +  ITALY - FA CUP - ROUND 16
        +
        + + + + + + + + +
        StartStatMinRPOHome AwayRPOLatest
        + 16:00 + FT - +   + +   + +   + FIORENTINA01TORINO +   + +   + +   + + + + 19goalBIANCHI +
        + 20:00 + FT - +   + +   + +   + ROMA20BOLOGNA +   + +   + +   + + + + 86goalVUCINIC +
        +
        + +
        + +
        + + + + + + + + + + +
        +  ITALY - SERIE C1A
        +
        + + + + + + +
        StartStatMinRPOHome AwayRPOLatest
        + 13:30 + FT - +   + +   + +   + PRO SESTO00LECCO +   + +   + +   + +   + +   +
        +
        + +
        + +
        + + + + + + + + + + +
        +  ITALY - SERIE C2A
        +
        + + + + + + +
        StartStatMinRPOHome AwayRPOLatest
        + 13:30 + FT - +   + +   + +   + MEZZOCORONA13SAMBONIFACESE +   + +   + +   + +   + + 74goal  +
        +
        + +
        + +
        + + + + + + + + + + +
        +  SCOTLAND - FA CUP - THIRD ROUND
        +
        + + + + + + +
        StartStatMinRPOHome AwayRPOLatest
        + 13:30 + FT - +   + +   + +   + LOCHEE UTD11AYR UTD +   + +   + +   + + + + 86goalHAGAN +
        +
        + +
        + +
        + + + + + + + + + + +
        +  WORLD (FIFA) - FIFA CLUB WORLD CHAMPIONSHIP - SEMI
        +
        + + + + + + +
        StartStatMinRPOHome AwayRPOLatest
        + 10:30 + FT - +   + +   + +   + PACHUCA (MEX)02LIGA D.U. QUITO(ECU) +   + +   + +   + + + + 26goalBOLANOS +
        +
        + +
        + +
        + + + + +
        + + + + +
        + View complete archive of FootballScoresLive.com Match Results +
        + +
        + + + + + + + +
        + + + +
        +  |  + Disclaimer |  + Privacy |  + About Us |  + News Archive |  +
        + +
        + + + + + +
        + + \ No newline at end of file diff --git a/vendor/sunra/php-simple-html-dom-parser/Src/Sunra/PhpSimple/simplehtmldom_1_5/app/.svn/text-base/index.php.svn-base b/vendor/sunra/php-simple-html-dom-parser/Src/Sunra/PhpSimple/simplehtmldom_1_5/app/.svn/text-base/index.php.svn-base new file mode 100644 index 000000000..189aa5a15 --- /dev/null +++ b/vendor/sunra/php-simple-html-dom-parser/Src/Sunra/PhpSimple/simplehtmldom_1_5/app/.svn/text-base/index.php.svn-base @@ -0,0 +1,144 @@ +find('html', 0); +if ($l!==null) + $lang = $l->lang; +if ($lang!='') + $lang = 'lang="'.$lang.'"'; + +$charset = $html->find('meta[http-equiv*=content-type]', 0); +$target = array(); +$query = ''; + +if (isset($_REQUEST['query'])) { + $query = $_REQUEST['query']; + $target = $html->find($query); +} + +function stat_dom($dom) { + $count_text = 0; + $count_comm = 0; + $count_elem = 0; + $count_tag_end = 0; + $count_unknown = 0; + + foreach($dom->nodes as $n) { + if ($n->nodetype==HDOM_TYPE_TEXT) + ++$count_text; + if ($n->nodetype==HDOM_TYPE_COMMENT) + ++$count_comm; + if ($n->nodetype==HDOM_TYPE_ELEMENT) + ++$count_elem; + if ($n->nodetype==HDOM_TYPE_ENDTAG) + ++$count_tag_end; + if ($n->nodetype==HDOM_TYPE_UNKNOWN) + ++$count_unknown; + } + + echo 'Total: '. count($dom->nodes). + ', Text: '.$count_text. + ', Commnet: '.$count_comm. + ', Tag: '.$count_elem. + ', End Tag: '.$count_tag_end. + ', Unknown: '.$count_unknown; +} + +function dump_my_html_tree($node, $show_attr=true, $deep=0, $last=true) { + $count = count($node->nodes); + if ($count>0) { + if($last) + echo '\n"; +} +?> + + +> + + '; + else if ($charset) + echo $charset; + else + echo ''; + ?> + Simple HTML DOM Query Test + + + + + + + + +
        +

        Simple HTML DOM Test

        +
        + find: + +
        +
        + HTML STAT ()
        +
        +
        +
          + +
        +
        + + \ No newline at end of file diff --git a/vendor/sunra/php-simple-html-dom-parser/Src/Sunra/PhpSimple/simplehtmldom_1_5/app/google.htm b/vendor/sunra/php-simple-html-dom-parser/Src/Sunra/PhpSimple/simplehtmldom_1_5/app/google.htm new file mode 100644 index 000000000..c705a5ec6 --- /dev/null +++ b/vendor/sunra/php-simple-html-dom-parser/Src/Sunra/PhpSimple/simplehtmldom_1_5/app/google.htm @@ -0,0 +1,891 @@ + + + + + + + FootballScoresLive - Previous Results + + + + + + + + +
        + + + + + +
        + + + + + + + + + + + + + + + + + + + + + + + + + +
        + + FootballScoresLive logo + + + + + +
        + + For FREE goals to your mobile + Click Here + + + + + +
        + + + +   +
        +
        + +
        + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
        + + Add this page to your favourites + +
        Season Ticket Goal Alerts - coming soon
        Mobile Goal Alerts
        + English Leagues
        English National Team - coming soon
        + + Scottish Leagues
        + + Spanish Leagues
        + + Italian Leagues
        Live Scores
        Football Supermarket - coming soon
        Previous Results
        Future Fixtures
        League Tables - coming soon
        Sponsored Links - coming soon
         
        Personalise
        + +
        + +
        +
        + + + +
        + + + + + + + + + +
        +
        + + + + +
        + +
        +
        +
        + + + + + + + +
        + + English Leagues goal alerts by SMS + + Scottish Leagues goal alerts by SMS + + Spanish Leagues goal alerts by SMS + + Italian Leagues goal alerts by SMS
        +
        +
        +
        +
        +
        +
        + + +
        + +

        Historical Football Archive - Updated Daily!

        +
        +

        Missed the details of your football club's latest performance? + Whether you support Manchester United or Cambridge United, Premiership club or Conference club, + you will find it all here, with our fantastic soccer library of results over the last two weeks. + These pages contain the history & detailed results package for every football game from around the world + from the last 14 match days, including not only every goal scored, but, game results, names of goal scorer, + match results, red cards and plenty more! This service is automatically updated every 24 hours, + simply select a date from the drop down menu :- +

        + + +

        + + + + + + + + + +
        +  SCOTLAND - DIVISION 2
        +
        + + + + + + +
        StartStatMinRPOHome AwayRPOLatest
        + 19:45 + Pst - +   + +   + +   + STRANRAER00PETERHEAD +   + +   + +   + +   + +   +
        +
        + +
        + +
        + + + + + + + + + + +
        +  ENGLAND - FA TROPHY - FIRST ROUND
        +
        + + + + + + +
        StartStatMinRPOHome AwayRPOLatest
        + 19:45 + FT - +   + +   + +   + SWINDON SUPERMARINE10EASTBOURNE BOROUGH +   + +   + +   + + + + 74goalEDENBOROUGH +
        +
        + +
        + +
        + + + + + + + + + + +
        +  EUROPE (UEFA) - UEFA CUP - GROUP STAGE
        +
        + + + + + + + + + + + + + + + + + + + + +
        StartStatMinRPOHome AwayRPOLatest
        + 19:45 + FT - +   + +   + +   + AC MILAN22VfL WOLFSBURG +   + +   + +   + +   + + 81goalSAGLIK +
        + 19:45 + FT - +   + + 1 + +   + AJAX22SLAVIA PRAHA +   + +   + +   + +   + + 90penaltySUAREZ +
        + 19:45 + FT - +   + +   + +   + CLUB BRUGGE01FC COPENHAGEN +   + +   + +   + +   + + 58goalSANTIN +
        + 19:45 + FT - +   + +   + +   + DEP. LA CORUNA10NANCY +   + +   + +   + +   + + 74goalBODIPO +
        + 19:45 + FT - +   + +   + +   + FEYENOORD01LECH POZNAN +   + +   + +   + +   + + 26goalDJURDJEVIC +
        + 19:45 + FT - +   + +   + +   + HAMBURGER SV31ASTON VILLA + 1 + +   + +   + +   + + 84red cardSIDWELL +
        + 19:45 + FT - +   + +   + +   + PORTSMOUTH30HEERENVEEN +   + +   + +   + +   + + 90goalHREIDARSSON +
        + 19:45 + FT - +   + +   + +   + ST ETIENNE22VALENCIA +   + +   + +   + +   + + 72goalZIGIC +
        +
        + +
        + +
        + + + + + + + + + + +
        +  INTERNATIONAL TOURNAMENTS - OMAN FOUR NATIONS TOUR
        +
        + + + + + + + + +
        StartStatMinRPOHome AwayRPOLatest
        + 14:00 + FT - +   + +   + +   + OMAN31CHINA +   + +   + +   + + + + 84goalSALEH +
        + 16:30 + FT - +   + +   + +   + ECUADOR10IRAN + 1 + +   + +   + + + + 90red cardNEJAD +
        +
        + +
        + +
        + + + + + + + + + + +
        +  ITALY - FA CUP - ROUND 16
        +
        + + + + + + + + +
        StartStatMinRPOHome AwayRPOLatest
        + 16:00 + FT - +   + +   + +   + FIORENTINA01TORINO +   + +   + +   + + + + 19goalBIANCHI +
        + 20:00 + FT - +   + +   + +   + ROMA20BOLOGNA +   + +   + +   + + + + 86goalVUCINIC +
        +
        + +
        + +
        + + + + + + + + + + +
        +  ITALY - SERIE C1A
        +
        + + + + + + +
        StartStatMinRPOHome AwayRPOLatest
        + 13:30 + FT - +   + +   + +   + PRO SESTO00LECCO +   + +   + +   + +   + +   +
        +
        + +
        + +
        + + + + + + + + + + +
        +  ITALY - SERIE C2A
        +
        + + + + + + +
        StartStatMinRPOHome AwayRPOLatest
        + 13:30 + FT - +   + +   + +   + MEZZOCORONA13SAMBONIFACESE +   + +   + +   + +   + + 74goal  +
        +
        + +
        + +
        + + + + + + + + + + +
        +  SCOTLAND - FA CUP - THIRD ROUND
        +
        + + + + + + +
        StartStatMinRPOHome AwayRPOLatest
        + 13:30 + FT - +   + +   + +   + LOCHEE UTD11AYR UTD +   + +   + +   + + + + 86goalHAGAN +
        +
        + +
        + +
        + + + + + + + + + + +
        +  WORLD (FIFA) - FIFA CLUB WORLD CHAMPIONSHIP - SEMI
        +
        + + + + + + +
        StartStatMinRPOHome AwayRPOLatest
        + 10:30 + FT - +   + +   + +   + PACHUCA (MEX)02LIGA D.U. QUITO(ECU) +   + +   + +   + + + + 26goalBOLANOS +
        +
        + +
        + +
        + + + + +
        + + + + +
        + View complete archive of FootballScoresLive.com Match Results +
        + +
        + + + + + + + +
        + + + +
        +  |  + Disclaimer |  + Privacy |  + About Us |  + News Archive |  +
        + +
        + + + + + +
        + + \ No newline at end of file diff --git a/vendor/sunra/php-simple-html-dom-parser/Src/Sunra/PhpSimple/simplehtmldom_1_5/app/index.php b/vendor/sunra/php-simple-html-dom-parser/Src/Sunra/PhpSimple/simplehtmldom_1_5/app/index.php new file mode 100644 index 000000000..189aa5a15 --- /dev/null +++ b/vendor/sunra/php-simple-html-dom-parser/Src/Sunra/PhpSimple/simplehtmldom_1_5/app/index.php @@ -0,0 +1,144 @@ +find('html', 0); +if ($l!==null) + $lang = $l->lang; +if ($lang!='') + $lang = 'lang="'.$lang.'"'; + +$charset = $html->find('meta[http-equiv*=content-type]', 0); +$target = array(); +$query = ''; + +if (isset($_REQUEST['query'])) { + $query = $_REQUEST['query']; + $target = $html->find($query); +} + +function stat_dom($dom) { + $count_text = 0; + $count_comm = 0; + $count_elem = 0; + $count_tag_end = 0; + $count_unknown = 0; + + foreach($dom->nodes as $n) { + if ($n->nodetype==HDOM_TYPE_TEXT) + ++$count_text; + if ($n->nodetype==HDOM_TYPE_COMMENT) + ++$count_comm; + if ($n->nodetype==HDOM_TYPE_ELEMENT) + ++$count_elem; + if ($n->nodetype==HDOM_TYPE_ENDTAG) + ++$count_tag_end; + if ($n->nodetype==HDOM_TYPE_UNKNOWN) + ++$count_unknown; + } + + echo 'Total: '. count($dom->nodes). + ', Text: '.$count_text. + ', Commnet: '.$count_comm. + ', Tag: '.$count_elem. + ', End Tag: '.$count_tag_end. + ', Unknown: '.$count_unknown; +} + +function dump_my_html_tree($node, $show_attr=true, $deep=0, $last=true) { + $count = count($node->nodes); + if ($count>0) { + if($last) + echo '\n"; +} +?> + + +> + + '; + else if ($charset) + echo $charset; + else + echo ''; + ?> + Simple HTML DOM Query Test + + + + + + + + +
        +

        Simple HTML DOM Test

        +
        + find: + +
        +
        + HTML STAT ()
        +
        +
        +
          + +
        +
        + + \ No newline at end of file diff --git a/vendor/sunra/php-simple-html-dom-parser/Src/Sunra/PhpSimple/simplehtmldom_1_5/app/js/.svn/all-wcprops b/vendor/sunra/php-simple-html-dom-parser/Src/Sunra/PhpSimple/simplehtmldom_1_5/app/js/.svn/all-wcprops new file mode 100644 index 000000000..6c4953426 --- /dev/null +++ b/vendor/sunra/php-simple-html-dom-parser/Src/Sunra/PhpSimple/simplehtmldom_1_5/app/js/.svn/all-wcprops @@ -0,0 +1,29 @@ +K 25 +svn:wc:ra_dav:version-url +V 48 +/svnroot/simplehtmldom/!svn/ver/176/trunk/app/js +END +jquery.treeview.css +K 25 +svn:wc:ra_dav:version-url +V 68 +/svnroot/simplehtmldom/!svn/ver/176/trunk/app/js/jquery.treeview.css +END +jquery.treeview.js +K 25 +svn:wc:ra_dav:version-url +V 67 +/svnroot/simplehtmldom/!svn/ver/176/trunk/app/js/jquery.treeview.js +END +screen.css +K 25 +svn:wc:ra_dav:version-url +V 59 +/svnroot/simplehtmldom/!svn/ver/176/trunk/app/js/screen.css +END +jquery.js +K 25 +svn:wc:ra_dav:version-url +V 58 +/svnroot/simplehtmldom/!svn/ver/176/trunk/app/js/jquery.js +END diff --git a/vendor/sunra/php-simple-html-dom-parser/Src/Sunra/PhpSimple/simplehtmldom_1_5/app/js/.svn/entries b/vendor/sunra/php-simple-html-dom-parser/Src/Sunra/PhpSimple/simplehtmldom_1_5/app/js/.svn/entries new file mode 100644 index 000000000..579d7b7c3 --- /dev/null +++ b/vendor/sunra/php-simple-html-dom-parser/Src/Sunra/PhpSimple/simplehtmldom_1_5/app/js/.svn/entries @@ -0,0 +1,167 @@ +10 + +dir +182 +https://simplehtmldom.svn.sourceforge.net/svnroot/simplehtmldom/trunk/app/js +https://simplehtmldom.svn.sourceforge.net/svnroot/simplehtmldom + + + +2008-12-14T19:02:48.351607Z +176 +me578022 + + + + + + + + + + + + + + +d0e60b4b-9046-0410-940c-b97530268c78 + +jquery.treeview.css +file + + + + +2010-08-17T19:13:52.459235Z +339ab1bbbaefa62f58c1fbf4459a7d0e +2008-12-14T19:02:48.351607Z +176 +me578022 + + + + + + + + + + + + + + + + + + + + + +2589 + +jquery.treeview.js +file + + + + +2010-08-17T19:13:52.460235Z +3f81db67b7a973c8835ef5213e3b93c6 +2008-12-14T19:02:48.351607Z +176 +me578022 + + + + + + + + + + + + + + + + + + + + + +7839 + +images +dir + +screen.css +file + + + + +2010-08-17T19:13:52.463235Z +b8e74072c3d1b740bce61509ce86fe68 +2008-12-14T19:02:48.351607Z +176 +me578022 + + + + + + + + + + + + + + + + + + + + + +623 + +jquery.js +file + + + + +2010-08-17T19:13:52.465235Z +957620aeffb2e5b562591b7a19928ea4 +2008-12-14T19:02:48.351607Z +176 +me578022 + + + + + + + + + + + + + + + + + + + + + +94443 + diff --git a/vendor/sunra/php-simple-html-dom-parser/Src/Sunra/PhpSimple/simplehtmldom_1_5/app/js/.svn/text-base/jquery.js.svn-base b/vendor/sunra/php-simple-html-dom-parser/Src/Sunra/PhpSimple/simplehtmldom_1_5/app/js/.svn/text-base/jquery.js.svn-base new file mode 100644 index 000000000..b660baab4 --- /dev/null +++ b/vendor/sunra/php-simple-html-dom-parser/Src/Sunra/PhpSimple/simplehtmldom_1_5/app/js/.svn/text-base/jquery.js.svn-base @@ -0,0 +1,3363 @@ +(function(){ +/* + * jQuery 1.2.2b2 - New Wave Javascript + * + * Copyright (c) 2007 John Resig (jquery.com) + * Dual licensed under the MIT (MIT-LICENSE.txt) + * and GPL (GPL-LICENSE.txt) licenses. + * + * $Date: 2007-12-20 14:36:56 +0100 (Don, 20 Dez 2007) $ + * $Rev: 4251 $ + */ + +// Map over jQuery in case of overwrite +if ( window.jQuery ) + var _jQuery = window.jQuery; + +var jQuery = window.jQuery = function( selector, context ) { + // The jQuery object is actually just the init constructor 'enhanced' + return new jQuery.prototype.init( selector, context ); +}; + +// Map over the $ in case of overwrite +if ( window.$ ) + var _$ = window.$; + +// Map the jQuery namespace to the '$' one +window.$ = jQuery; + +// A simple way to check for HTML strings or ID strings +// (both of which we optimize for) +var quickExpr = /^[^<]*(<(.|\s)+>)[^>]*$|^#(\w+)$/; + +// Is it a simple selector +var isSimple = /^.[^:#\[\.]*$/; + +jQuery.fn = jQuery.prototype = { + init: function( selector, context ) { + // Make sure that a selection was provided + selector = selector || document; + + // Handle $(DOMElement) + if ( selector.nodeType ) { + this[0] = selector; + this.length = 1; + return this; + + // Handle HTML strings + } else if ( typeof selector == "string" ) { + // Are we dealing with HTML string or an ID? + var match = quickExpr.exec( selector ); + + // Verify a match, and that no context was specified for #id + if ( match && (match[1] || !context) ) { + + // HANDLE: $(html) -> $(array) + if ( match[1] ) + selector = jQuery.clean( [ match[1] ], context ); + + // HANDLE: $("#id") + else { + var elem = document.getElementById( match[3] ); + + // Make sure an element was located + if ( elem ) + // Handle the case where IE and Opera return items + // by name instead of ID + if ( elem.id != match[3] ) + return jQuery().find( selector ); + + // Otherwise, we inject the element directly into the jQuery object + else { + this[0] = elem; + this.length = 1; + return this; + } + + else + selector = []; + } + + // HANDLE: $(expr, [context]) + // (which is just equivalent to: $(content).find(expr) + } else + return new jQuery( context ).find( selector ); + + // HANDLE: $(function) + // Shortcut for document ready + } else if ( jQuery.isFunction( selector ) ) + return new jQuery( document )[ jQuery.fn.ready ? "ready" : "load" ]( selector ); + + return this.setArray( + // HANDLE: $(array) + selector.constructor == Array && selector || + + // HANDLE: $(arraylike) + // Watch for when an array-like object, contains DOM nodes, is passed in as the selector + (selector.jquery || selector.length && selector != window && !selector.nodeType && selector[0] != undefined && selector[0].nodeType) && jQuery.makeArray( selector ) || + + // HANDLE: $(*) + [ selector ] ); + }, + + // The current version of jQuery being used + jquery: "@VERSION", + + // The number of elements contained in the matched element set + size: function() { + return this.length; + }, + + // The number of elements contained in the matched element set + length: 0, + + // Get the Nth element in the matched element set OR + // Get the whole matched element set as a clean array + get: function( num ) { + return num == undefined ? + + // Return a 'clean' array + jQuery.makeArray( this ) : + + // Return just the object + this[ num ]; + }, + + // Take an array of elements and push it onto the stack + // (returning the new matched element set) + pushStack: function( elems ) { + // Build a new jQuery matched element set + var ret = jQuery( elems ); + + // Add the old object onto the stack (as a reference) + ret.prevObject = this; + + // Return the newly-formed element set + return ret; + }, + + // Force the current matched set of elements to become + // the specified array of elements (destroying the stack in the process) + // You should use pushStack() in order to do this, but maintain the stack + setArray: function( elems ) { + // Resetting the length to 0, then using the native Array push + // is a super-fast way to populate an object with array-like properties + this.length = 0; + Array.prototype.push.apply( this, elems ); + + return this; + }, + + // Execute a callback for every element in the matched set. + // (You can seed the arguments with an array of args, but this is + // only used internally.) + each: function( callback, args ) { + return jQuery.each( this, callback, args ); + }, + + // Determine the position of an element within + // the matched set of elements + index: function( elem ) { + var ret = -1; + + // Locate the position of the desired element + this.each(function(i){ + if ( this == elem ) + ret = i; + }); + + return ret; + }, + + attr: function( name, value, type ) { + var options = name; + + // Look for the case where we're accessing a style value + if ( name.constructor == String ) + if ( value == undefined ) + return this.length && jQuery[ type || "attr" ]( this[0], name ) || undefined; + + else { + options = {}; + options[ name ] = value; + } + + // Check to see if we're setting style values + return this.each(function(i){ + // Set all the styles + for ( name in options ) + jQuery.attr( + type ? + this.style : + this, + name, jQuery.prop( this, options[ name ], type, i, name ) + ); + }); + }, + + css: function( key, value ) { + // ignore negative width and height values + if ( (key == 'width' || key == 'height') && parseFloat(value) < 0 ) + value = undefined; + return this.attr( key, value, "curCSS" ); + }, + + text: function( text ) { + if ( typeof text != "object" && text != null ) + return this.empty().append( (this[0] && this[0].ownerDocument || document).createTextNode( text ) ); + + var ret = ""; + + jQuery.each( text || this, function(){ + jQuery.each( this.childNodes, function(){ + if ( this.nodeType != 8 ) + ret += this.nodeType != 1 ? + this.nodeValue : + jQuery.fn.text( [ this ] ); + }); + }); + + return ret; + }, + + wrapAll: function( html ) { + if ( this[0] ) + // The elements to wrap the target around + jQuery( html, this[0].ownerDocument ) + .clone() + .insertBefore( this[0] ) + .map(function(){ + var elem = this; + + while ( elem.firstChild ) + elem = elem.firstChild; + + return elem; + }) + .append(this); + + return this; + }, + + wrapInner: function( html ) { + return this.each(function(){ + jQuery( this ).contents().wrapAll( html ); + }); + }, + + wrap: function( html ) { + return this.each(function(){ + jQuery( this ).wrapAll( html ); + }); + }, + + append: function() { + return this.domManip(arguments, true, false, function(elem){ + if (this.nodeType == 1) + this.appendChild( elem ); + }); + }, + + prepend: function() { + return this.domManip(arguments, true, true, function(elem){ + if (this.nodeType == 1) + this.insertBefore( elem, this.firstChild ); + }); + }, + + before: function() { + return this.domManip(arguments, false, false, function(elem){ + this.parentNode.insertBefore( elem, this ); + }); + }, + + after: function() { + return this.domManip(arguments, false, true, function(elem){ + this.parentNode.insertBefore( elem, this.nextSibling ); + }); + }, + + end: function() { + return this.prevObject || jQuery( [] ); + }, + + find: function( selector ) { + var elems = jQuery.map(this, function(elem){ + return jQuery.find( selector, elem ); + }); + + return this.pushStack( /[^+>] [^+>]/.test( selector ) || selector.indexOf("..") > -1 ? + jQuery.unique( elems ) : + elems ); + }, + + clone: function( events ) { + // Do the clone + var ret = this.map(function(){ + if ( jQuery.browser.msie && !jQuery.isXMLDoc(this) ) { + // IE copies events bound via attachEvent when + // using cloneNode. Calling detachEvent on the + // clone will also remove the events from the orignal + // In order to get around this, we use innerHTML. + // Unfortunately, this means some modifications to + // attributes in IE that are actually only stored + // as properties will not be copied (such as the + // the name attribute on an input). + var clone = this.cloneNode(true), + container = document.createElement("div"), + container2 = document.createElement("div"); + container.appendChild(clone); + container2.innerHTML = container.innerHTML; + return container2.firstChild; + } else + return this.cloneNode(true); + }); + + // Need to set the expando to null on the cloned set if it exists + // removeData doesn't work here, IE removes it from the original as well + // this is primarily for IE but the data expando shouldn't be copied over in any browser + var clone = ret.find("*").andSelf().each(function(){ + if ( this[ expando ] != undefined ) + this[ expando ] = null; + }); + + // Copy the events from the original to the clone + if ( events === true ) + this.find("*").andSelf().each(function(i){ + var events = jQuery.data( this, "events" ); + + for ( var type in events ) + for ( var handler in events[ type ] ) + jQuery.event.add( clone[ i ], type, events[ type ][ handler ], events[ type ][ handler ].data ); + }); + + // Return the cloned set + return ret; + }, + + filter: function( selector ) { + return this.pushStack( + jQuery.isFunction( selector ) && + jQuery.grep(this, function(elem, i){ + return selector.call( elem, i ); + }) || + + jQuery.multiFilter( selector, this ) ); + }, + + not: function( selector ) { + if ( selector.constructor == String ) + // test special case where just one selector is passed in + if ( isSimple.test( selector ) ) + return this.pushStack( jQuery.multiFilter( selector, this, true ) ); + else + selector = jQuery.multiFilter( selector, this ); + + var isArrayLike = selector.length && selector[selector.length - 1] !== undefined && !selector.nodeType; + return this.filter(function() { + return isArrayLike ? jQuery.inArray( this, selector ) < 0 : this != selector; + }); + }, + + add: function( selector ) { + return !selector ? this : this.pushStack( jQuery.merge( + this.get(), + selector.constructor == String ? + jQuery( selector ).get() : + selector.length != undefined && (!selector.nodeName || jQuery.nodeName(selector, "form")) ? + selector : [selector] ) ); + }, + + is: function( selector ) { + return selector ? + jQuery.multiFilter( selector, this ).length > 0 : + false; + }, + + hasClass: function( selector ) { + return this.is( "." + selector ); + }, + + val: function( value ) { + if ( value == undefined ) { + + if ( this.length ) { + var elem = this[0]; + + // We need to handle select boxes special + if ( jQuery.nodeName( elem, "select" ) ) { + var index = elem.selectedIndex, + values = [], + options = elem.options, + one = elem.type == "select-one"; + + // Nothing was selected + if ( index < 0 ) + return null; + + // Loop through all the selected options + for ( var i = one ? index : 0, max = one ? index + 1 : options.length; i < max; i++ ) { + var option = options[ i ]; + + if ( option.selected ) { + // Get the specifc value for the option + value = jQuery.browser.msie && !option.attributes.value.specified ? option.text : option.value; + + // We don't need an array for one selects + if ( one ) + return value; + + // Multi-Selects return an array + values.push( value ); + } + } + + return values; + + // Everything else, we just grab the value + } else + return (this[0].value || "").replace(/\r/g, ""); + + } + + return undefined; + } + + return this.each(function(){ + if ( this.nodeType != 1 ) + return; + + if ( value.constructor == Array && /radio|checkbox/.test( this.type ) ) + this.checked = (jQuery.inArray(this.value, value) >= 0 || + jQuery.inArray(this.name, value) >= 0); + + else if ( jQuery.nodeName( this, "select" ) ) { + var values = value.constructor == Array ? + value : + [ value ]; + + jQuery( "option", this ).each(function(){ + this.selected = (jQuery.inArray( this.value, values ) >= 0 || + jQuery.inArray( this.text, values ) >= 0); + }); + + if ( !values.length ) + this.selectedIndex = -1; + + } else + this.value = value; + }); + }, + + html: function( value ) { + return value == undefined ? + (this.length ? + this[0].innerHTML : + null) : + this.empty().append( value ); + }, + + replaceWith: function( value ) { + return this.after( value ).remove(); + }, + + eq: function( i ) { + return this.slice( i, i + 1 ); + }, + + slice: function() { + return this.pushStack( Array.prototype.slice.apply( this, arguments ) ); + }, + + map: function( callback ) { + return this.pushStack( jQuery.map(this, function(elem, i){ + return callback.call( elem, i, elem ); + })); + }, + + andSelf: function() { + return this.add( this.prevObject ); + }, + + domManip: function( args, table, reverse, callback ) { + var clone = this.length > 1, elems; + + return this.each(function(){ + if ( !elems ) { + elems = jQuery.clean( args, this.ownerDocument ); + + if ( reverse ) + elems.reverse(); + } + + var obj = this; + + if ( table && jQuery.nodeName( this, "table" ) && jQuery.nodeName( elems[0], "tr" ) ) + obj = this.getElementsByTagName("tbody")[0] || this.appendChild( this.ownerDocument.createElement("tbody") ); + + var scripts = jQuery( [] ); + + jQuery.each(elems, function(){ + var elem = clone ? + jQuery( this ).clone( true )[0] : + this; + + // execute all scripts after the elements have been injected + if ( jQuery.nodeName( elem, "script" ) ) { + scripts = scripts.add( elem ); + } else { + // Remove any inner scripts for later evaluation + if ( elem.nodeType == 1 ) + scripts = scripts.add( jQuery( "script", elem ).remove() ); + + // Inject the elements into the document + callback.call( obj, elem ); + } + }); + + scripts.each( evalScript ); + }); + } +}; + +// Give the init function the jQuery prototype for later instantiation +jQuery.prototype.init.prototype = jQuery.prototype; + +function evalScript( i, elem ) { + if ( elem.src ) + jQuery.ajax({ + url: elem.src, + async: false, + dataType: "script" + }); + + else + jQuery.globalEval( elem.text || elem.textContent || elem.innerHTML || "" ); + + if ( elem.parentNode ) + elem.parentNode.removeChild( elem ); +} + +jQuery.extend = jQuery.fn.extend = function() { + // copy reference to target object + var target = arguments[0] || {}, i = 1, length = arguments.length, deep = false, options; + + // Handle a deep copy situation + if ( target.constructor == Boolean ) { + deep = target; + target = arguments[1] || {}; + // skip the boolean and the target + i = 2; + } + + // Handle case when target is a string or something (possible in deep copy) + if ( typeof target != "object" && typeof target != "function" ) + target = {}; + + // extend jQuery itself if only one argument is passed + if ( length == 1 ) { + target = this; + i = 0; + } + + for ( ; i < length; i++ ) + // Only deal with non-null/undefined values + if ( (options = arguments[ i ]) != null ) + // Extend the base object + for ( var name in options ) { + // Prevent never-ending loop + if ( target === options[ name ] ) + continue; + + // Recurse if we're merging object values + if ( deep && options[ name ] && typeof options[ name ] == "object" && target[ name ] && !options[ name ].nodeType ) + target[ name ] = jQuery.extend( target[ name ], options[ name ] ); + + // Don't bring in undefined values + else if ( options[ name ] != undefined ) + target[ name ] = options[ name ]; + + } + + // Return the modified object + return target; +}; + +var expando = "jQuery" + (new Date()).getTime(), uuid = 0, windowData = {}; + +// exclude the following css properties to add px +var exclude = /z-?index|font-?weight|opacity|zoom|line-?height/i; + +jQuery.extend({ + noConflict: function( deep ) { + window.$ = _$; + + if ( deep ) + window.jQuery = _jQuery; + + return jQuery; + }, + + // This may seem like some crazy code, but trust me when I say that this + // is the only cross-browser way to do this. --John + isFunction: function( fn ) { + return !!fn && typeof fn != "string" && !fn.nodeName && + fn.constructor != Array && /function/i.test( fn + "" ); + }, + + // check if an element is in a (or is an) XML document + isXMLDoc: function( elem ) { + return elem.documentElement && !elem.body || + elem.tagName && elem.ownerDocument && !elem.ownerDocument.body; + }, + + // Evalulates a script in a global context + globalEval: function( data ) { + data = jQuery.trim( data ); + + if ( data ) { + // Inspired by code by Andrea Giammarchi + // http://webreflection.blogspot.com/2007/08/global-scope-evaluation-and-dom.html + var head = document.getElementsByTagName("head")[0] || document.documentElement, + script = document.createElement("script"); + + script.type = "text/javascript"; + if ( jQuery.browser.msie ) + script.text = data; + else + script.appendChild( document.createTextNode( data ) ); + + head.appendChild( script ); + head.removeChild( script ); + } + }, + + nodeName: function( elem, name ) { + return elem.nodeName && elem.nodeName.toUpperCase() == name.toUpperCase(); + }, + + cache: {}, + + data: function( elem, name, data ) { + elem = elem == window ? + windowData : + elem; + + var id = elem[ expando ]; + + // Compute a unique ID for the element + if ( !id ) + id = elem[ expando ] = ++uuid; + + // Only generate the data cache if we're + // trying to access or manipulate it + if ( name && !jQuery.cache[ id ] ) + jQuery.cache[ id ] = {}; + + // Prevent overriding the named cache with undefined values + if ( data != undefined ) + jQuery.cache[ id ][ name ] = data; + + // Return the named cache data, or the ID for the element + return name ? + jQuery.cache[ id ][ name ] : + id; + }, + + removeData: function( elem, name ) { + elem = elem == window ? + windowData : + elem; + + var id = elem[ expando ]; + + // If we want to remove a specific section of the element's data + if ( name ) { + if ( jQuery.cache[ id ] ) { + // Remove the section of cache data + delete jQuery.cache[ id ][ name ]; + + // If we've removed all the data, remove the element's cache + name = ""; + + for ( name in jQuery.cache[ id ] ) + break; + + if ( !name ) + jQuery.removeData( elem ); + } + + // Otherwise, we want to remove all of the element's data + } else { + // Clean up the element expando + try { + delete elem[ expando ]; + } catch(e){ + // IE has trouble directly removing the expando + // but it's ok with using removeAttribute + if ( elem.removeAttribute ) + elem.removeAttribute( expando ); + } + + // Completely remove the data cache + delete jQuery.cache[ id ]; + } + }, + + // args is for internal usage only + each: function( object, callback, args ) { + if ( args ) { + if ( object.length == undefined ) + for ( var name in object ) + callback.apply( object[ name ], args ); + else + for ( var i = 0, length = object.length; i < length; i++ ) + if ( callback.apply( object[ i ], args ) === false ) + break; + + // A special, fast, case for the most common use of each + } else { + if ( object.length == undefined ) + for ( var name in object ) + callback.call( object[ name ], name, object[ name ] ); + else + for ( var i = 0, length = object.length, value = object[0]; + i < length && callback.call( value, i, value ) !== false; value = object[++i] ){} + } + + return object; + }, + + prop: function( elem, value, type, i, name ) { + // Handle executable functions + if ( jQuery.isFunction( value ) ) + value = value.call( elem, i ); + + // Handle passing in a number to a CSS property + return value && value.constructor == Number && type == "curCSS" && !exclude.test( name ) ? + value + "px" : + value; + }, + + className: { + // internal only, use addClass("class") + add: function( elem, classNames ) { + jQuery.each((classNames || "").split(/\s+/), function(i, className){ + if ( elem.nodeType == 1 && !jQuery.className.has( elem.className, className ) ) + elem.className += (elem.className ? " " : "") + className; + }); + }, + + // internal only, use removeClass("class") + remove: function( elem, classNames ) { + if (elem.nodeType == 1) + elem.className = classNames != undefined ? + jQuery.grep(elem.className.split(/\s+/), function(className){ + return !jQuery.className.has( classNames, className ); + }).join(" ") : + ""; + }, + + // internal only, use is(".class") + has: function( elem, className ) { + return jQuery.inArray( className, (elem.className || elem).toString().split(/\s+/) ) > -1; + } + }, + + // A method for quickly swapping in/out CSS properties to get correct calculations + swap: function( elem, options, callback ) { + var old = {}; + // Remember the old values, and insert the new ones + for ( var name in options ) { + old[ name ] = elem.style[ name ]; + elem.style[ name ] = options[ name ]; + } + + callback.call( elem ); + + // Revert the old values + for ( var name in options ) + elem.style[ name ] = old[ name ]; + }, + + css: function( elem, name, force ) { + if ( name == "width" || name == "height" ) { + var val, props = { position: "absolute", visibility: "hidden", display:"block" }, which = name == "width" ? [ "Left", "Right" ] : [ "Top", "Bottom" ]; + + function getWH() { + val = name == "width" ? elem.offsetWidth : elem.offsetHeight; + var padding = 0, border = 0; + jQuery.each( which, function() { + padding += parseFloat(jQuery.curCSS( elem, "padding" + this, true)) || 0; + border += parseFloat(jQuery.curCSS( elem, "border" + this + "Width", true)) || 0; + }); + val -= Math.round(padding + border); + } + + if ( jQuery(elem).is(":visible") ) + getWH(); + else + jQuery.swap( elem, props, getWH ); + + return Math.max(0, val); + } + + return jQuery.curCSS( elem, name, force ); + }, + + curCSS: function( elem, name, force ) { + var ret; + + // A helper method for determining if an element's values are broken + function color( elem ) { + if ( !jQuery.browser.safari ) + return false; + + var ret = document.defaultView.getComputedStyle( elem, null ); + return !ret || ret.getPropertyValue("color") == ""; + } + + // We need to handle opacity special in IE + if ( name == "opacity" && jQuery.browser.msie ) { + ret = jQuery.attr( elem.style, "opacity" ); + + return ret == "" ? + "1" : + ret; + } + // Opera sometimes will give the wrong display answer, this fixes it, see #2037 + if ( jQuery.browser.opera && name == "display" ) { + var save = elem.style.display; + elem.style.display = "block"; + elem.style.display = save; + } + + // Make sure we're using the right name for getting the float value + if ( name.match( /float/i ) ) + name = styleFloat; + + if ( !force && elem.style[ name ] ) + ret = elem.style[ name ]; + + else if ( document.defaultView && document.defaultView.getComputedStyle ) { + + // Only "float" is needed here + if ( name.match( /float/i ) ) + name = "float"; + + name = name.replace( /([A-Z])/g, "-$1" ).toLowerCase(); + + var getComputedStyle = document.defaultView.getComputedStyle( elem, null ); + + if ( getComputedStyle && !color( elem ) ) + ret = getComputedStyle.getPropertyValue( name ); + + // If the element isn't reporting its values properly in Safari + // then some display: none elements are involved + else { + var swap = [], stack = []; + + // Locate all of the parent display: none elements + for ( var a = elem; a && color(a); a = a.parentNode ) + stack.unshift(a); + + // Go through and make them visible, but in reverse + // (It would be better if we knew the exact display type that they had) + for ( var i = 0; i < stack.length; i++ ) + if ( color( stack[ i ] ) ) { + swap[ i ] = stack[ i ].style.display; + stack[ i ].style.display = "block"; + } + + // Since we flip the display style, we have to handle that + // one special, otherwise get the value + ret = name == "display" && swap[ stack.length - 1 ] != null ? + "none" : + ( getComputedStyle && getComputedStyle.getPropertyValue( name ) ) || ""; + + // Finally, revert the display styles back + for ( var i = 0; i < swap.length; i++ ) + if ( swap[ i ] != null ) + stack[ i ].style.display = swap[ i ]; + } + + // We should always get a number back from opacity + if ( name == "opacity" && ret == "" ) + ret = "1"; + + } else if ( elem.currentStyle ) { + var camelCase = name.replace(/\-(\w)/g, function(all, letter){ + return letter.toUpperCase(); + }); + + ret = elem.currentStyle[ name ] || elem.currentStyle[ camelCase ]; + + // From the awesome hack by Dean Edwards + // http://erik.eae.net/archives/2007/07/27/18.54.15/#comment-102291 + + // If we're not dealing with a regular pixel number + // but a number that has a weird ending, we need to convert it to pixels + if ( !/^\d+(px)?$/i.test( ret ) && /^\d/.test( ret ) ) { + // Remember the original values + var style = elem.style.left, runtimeStyle = elem.runtimeStyle.left; + + // Put in the new values to get a computed value out + elem.runtimeStyle.left = elem.currentStyle.left; + elem.style.left = ret || 0; + ret = elem.style.pixelLeft + "px"; + + // Revert the changed values + elem.style.left = style; + elem.runtimeStyle.left = runtimeStyle; + } + } + + return ret; + }, + + clean: function( elems, context ) { + var ret = []; + context = context || document; + // !context.createElement fails in IE with an error but returns typeof 'object' + if (typeof context.createElement == 'undefined') + context = context.ownerDocument || context[0] && context[0].ownerDocument || document; + + jQuery.each(elems, function(i, elem){ + if ( !elem ) + return; + + if ( elem.constructor == Number ) + elem = elem.toString(); + + // Convert html string into DOM nodes + if ( typeof elem == "string" ) { + // Fix "XHTML"-style tags in all browsers + elem = elem.replace(/(<(\w+)[^>]*?)\/>/g, function(all, front, tag){ + return tag.match(/^(abbr|br|col|img|input|link|meta|param|hr|area)$/i) ? + all : + front + ">"; + }); + + // Trim whitespace, otherwise indexOf won't work as expected + var tags = jQuery.trim( elem ).toLowerCase(), div = context.createElement("div"); + + var wrap = + // option or optgroup + !tags.indexOf("", "" ] || + + !tags.indexOf("", "" ] || + + tags.match(/^<(thead|tbody|tfoot|colg|cap)/) && + [ 1, "", "
        " ] || + + !tags.indexOf("", "" ] || + + // matched above + (!tags.indexOf("", "" ] || + + !tags.indexOf("", "" ] || + + // IE can't serialize and + + + + +

        PHP Simple HTML DOM Parser Manual

        +
        +

        Index

        + + + +

        Quick Start

        + Top +
        + +
        +
        + // Create DOM from URL or file
        + $html = file_get_html('http://www.google.com/');
        +
        + // Find all images
        + foreach($html->find('img') as $element)
        +       echo $element->src . '<br>';
        +
        +// Find all links
        +foreach($html->find('a') as $element)
        +       echo $element->href . '<br>';
        +
        +
        +
        + // Create DOM from string
        + $html = str_get_html('<div id="hello">Hello</div><div id="world">World</div>');
        +
        +
        + +$html->find('div', 1)->class = 'bar';
        +
        +$html->find('div[id=hello]', 0)->innertext = 'foo';
        +
        + echo $html; // Output: <div id="hello">foo</div><div id="world" class="bar">World</div>
        +
        +
        +

        + // Dump contents (without tags) from HTML
        + echo file_get_html('http://www.google.com/')->plaintext; +
        +
        +
        +
        +
        +
        + // Create DOM from URL
        + $html = file_get_html('http://slashdot.org/');
        +
        + // Find all article blocks
        + foreach($html->find('div.article') as $article) {
        +    $item['title']     = $article->find('div.title', 0)->plaintext;
        +    $item['intro']    = $article->find('div.intro', 0)->plaintext;
        +    $item['details'] = $article->find('div.details', 0)->plaintext;
        +    $articles[] = $item;
        + }
        +
        + print_r($articles); +
        +
        +
        + + +

        How to create HTML DOM object?

        + Top +
        + +
        +
        // Create a DOM object from a string
        + $html = str_get_html('<html><body>Hello!</body></html>');
        +
        + // Create a DOM object from a URL
        + $html = file_get_html('http://www.google.com/');
        +
        + // Create a DOM object from a HTML file
        + $html = file_get_html('test.htm');
        +
        +
        +
        +
        // Create a DOM object
        + $html = new simple_html_dom();
        +
        + // Load HTML from a string
        + $html->load('<html><body>Hello!</body></html>');
        +
        + // Load HTML from a URL
        + $html->load_file('http://www.google.com/');
        +
        + // Load HTML from a HTML file
        + $html->load_file('test.htm');
        +
        +
        + +

        How to find HTML elements?

        + Top +
        + +
        +
        // Find all anchors, returns a array of element objects
        + $ret = $html->find('a');
        +
        + // Find (N)th anchor, returns element object or null if not found (zero based)
        + $ret = $html->find('a', 0);
        +
        + // Find lastest anchor, returns element object or null if not found (zero based)
        +$ret = $html->find('a', -1);
        +
        + // Find all <div> with the id attribute
        +$ret = $html->find('div[id]');
        +
        + // Find all <div> which attribute id=foo
        +$ret = $html->find('div[id=foo]');
        +
        +
        +
        +
        // Find all element which id=foo
        + $ret = $html->find('#foo');
        +
        + // Find all element which class=foo
        + $ret = $html->find('.foo');
        +
        + // Find all element has attribute id
        +$ret = $html->find('*[id]');
        +
        + // Find all anchors and images
        +$ret = $html->find('a, img');
        +
        + // Find all anchors and images with the "title" attribute
        + $ret = $html->find('a[title], img[title]');
        +
        +
        +
        +
        + Supports these operators in attribute selectors:

        + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
        FilterDescription
        [attribute]Matches elements that have the specified attribute.
        [!attribute]Matches elements that don't have the specified attribute.
        [attribute=value]Matches elements that have the specified attribute with a certain value.
        [attribute!=value]Matches elements that don't have the specified attribute with a certain value.
        [attribute^=value]Matches elements that have the specified attribute and it starts with a certain value.
        [attribute$=value]Matches elements that have the specified attribute and it ends with a certain value.
        [attribute*=value]Matches elements that have the specified attribute and it contains a certain value.
        +
        +
        +
        +
        // Find all <li> in <ul>
        + $es = $html->find('ul li');
        +
        + // Find Nested <div> tags
        + $es = $html->find('div div div');
        +
        + // Find all <td> in <table> which class=hello
        + $es = $html->find('table.hello td');
        +
        + // Find all td tags with attribite align=center in table tags
        + $es = $html->find(''table td[align=center]');
        +
        +
        +
        +
        // Find all text blocks
        + $es = $html->find('text');
        +
        + // Find all comment (<!--...-->) blocks
        + $es = $html->find('comment');
        +
        +
        +
        +
        // Find all <li> in <ul>
        + foreach($html->find('ul') as $ul)
        + {
        +       foreach($ul->find('li') as $li)
        +       {
        +             // do something...
        +       }
        + }
        +
        + // Find first <li> in first <ul>
        + $e = $html->find('ul', 0)->find('li', 0);
        +
        +
        +
        + +

        How to access the HTML element's attributes?

        + Top +
        + +
        +
        + // Get a attribute ( If the attribute is non-value attribute (eg. checked, selected...), it will returns true or false)
        + $value = $e->href;
        +
        + // Set a attribute(If the attribute is non-value attribute (eg. checked, selected...), set it's value as true or false)
        + $e->href = 'my link';
        +
        + // Remove a attribute, set it's value as null!
        + $e->href = null;
        +
        + // Determine whether a attribute exist?
        +if(isset($e->href))
        +        echo 'href exist!';
        +
        +
        +
        +
        // Example
        + $html = str_get_html("<div>foo <b>bar</b></div>");
        + $e = $html->find("div", 0);
        +
        + echo $e->tag; // Returns: " div"
        + echo $e->outertext; // Returns: " <div>foo <b>bar</b></div>"
        + echo $e->innertext; // Returns: " foo <b>bar</b>"
        + echo $e->plaintext; // Returns: " foo bar"
        +
        +
        + + + + + + + + + + + + + + + + + + + + + +
        Attribute NameUsage
        $e->tagRead or write the tag name of element.
        $e->outertextRead or write the outer HTML text of element.
        $e->innertextRead or write the inner HTML text of element.
        $e->plaintextRead or write the plain text of element.
        +
        +
        +
        +
        // Extract contents from HTML
        +echo $html->plaintext;
        +
        + + // Wrap a element
        + $e->outertext = '<div class="wrap">' . $e->outertext . '<div>';
        +
        + // Remove a element, set it's outertext as an empty string
        + $e->outertext = '';
        +
        + // Append a element
        +$e->outertext = $e->outertext . '<div>foo<div>';
        +
        +// Insert a element
        +$e->outertext = '<div>foo<div>' . $e->outertext;
        +
        +
        +
        + +

        How to traverse the DOM tree?

        + Top +
        + +
        +
        // If you are not so familiar with HTML DOM, check this link to learn more...
        +
        + // Example
        + echo $html->find("#div1", 0)->children(1)->children(1)->children(2)->id;
        + // or
        + echo $html->getElementById("div1")->childNodes(1)->childNodes(1)->childNodes(2)->getAttribute('id');
        +
        +
        +
        You can also call methods with Camel naming convertions.
        + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
        Method Description
        +
        mixed
        $e->children ( [int $index] )
        Returns the Nth child object if index is set, otherwise return an array of children.
        +
        element
        $e->parent ()
        Returns the parent of element.
        +
        element
        $e->first_child ()
        Returns the first child of element, or null if not found.
        +
        element
        $e->last_child ()
        Returns the last child of element, or null if not found.
        +
        element
        $e->next_sibling ()
        Returns the next sibling of element, or null if not found.
        +
        element
        $e->prev_sibling ()
        Returns the previous sibling of element, or null if not found.
        +
        +
        + +
        + +

        How to dump contents of DOM object?

        + Top +
        + +
        +
        // Dumps the internal DOM tree back into string
        + $str = $html->save();
        +
        + // Dumps the internal DOM tree back into a file
        + $html->save('result.htm');
        +
        +
        +
        // Dumps the internal DOM tree back into string
        + $str = $html;
        +
        + // Print it!
        + echo $html;
        +
        +
        +
        + +

        How to customize the parsing behavior?

        + Top +
        + +
        +
        // Write a function with parameter "$element"
        + function my_callback($element) {
        +         // Hide all <b> tags
        +        if ($element->tag=='b')
        +                 $element->outertext = '';
        + }
        +
        + // Register the callback function with it's function name
        + $html->set_callback('my_callback');
        +
        + // Callback function will be invoked while dumping
        + echo $html; +
        +
        +
        + +

        + Author: S.C. Chen (me578022@gmail.com)
        +Original idea is from Jose Solorzano's HTML Parser for PHP 4.
        +Contributions by: Contributions by: Yousuke Kumakura, Vadim Voituk, Antcs
        +
        +
        + + + \ No newline at end of file diff --git a/vendor/sunra/php-simple-html-dom-parser/Src/Sunra/PhpSimple/simplehtmldom_1_5/manual/.svn/text-base/manual_api.htm.svn-base b/vendor/sunra/php-simple-html-dom-parser/Src/Sunra/PhpSimple/simplehtmldom_1_5/manual/.svn/text-base/manual_api.htm.svn-base new file mode 100644 index 000000000..da793c034 --- /dev/null +++ b/vendor/sunra/php-simple-html-dom-parser/Src/Sunra/PhpSimple/simplehtmldom_1_5/manual/.svn/text-base/manual_api.htm.svn-base @@ -0,0 +1,320 @@ + + + + +PHP Simple HTML DOM Parser: API Reference + + + +

        PHP Simple HTML DOM Parser Manual

        +
        +

        Index

        + + +

        API Reference

        + Top +
        Helper functions + + + + + + + + + + + + + +
        NameDescription
        object str_get_html ( string $content )Creates a DOM object from a string.
        object file_get_html ( string $filename )Creates a DOM object from a file or a URL.
        +
        + DOM methods & properties
        + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
        Name Description
        +
        void
        + __construct ( [string $filename] )
        Constructor, set the filename parameter will automatically load the contents, either text or file/url.
        +
        string
        + plaintext
        Returns the contents extracted from HTML.
        +
        void
        + clear ()
        Clean up memory.
        +
        void
        + load ( string $content )
        Load contents from a string.
        +
        string
        + save ( [string $filename] )
        Dumps the internal DOM tree back into a string. If the $filename is set, result string will save to file.
        +
        void
        + load_file ( string $filename )
        Load contents from a from a file or a URL.
        +
        void
        + set_callback ( string $function_name )
        Set a callback function.
        +
        mixed
        + find ( string $selector [, int $index] )
        Find elements by the CSS selector. Returns the Nth element object if index is set, otherwise return an array of object.
        +
        + Element methods & properties
        + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
        NameDescription
        +
        string
        + [attribute]
        Read or write element's attribure value.
        +
        string
        + tag
        Read or write the tag name of element.
        +
        string
        + outertext
        Read or write the outer HTML text of element.
        +
        string
        + innertext
        Read or write the inner HTML text of element.
        +
        string
        + plaintext
        Read or write the plain text of element.
        +
        mixed
        + find ( string $selector [, int $index] )
        Find children by the CSS selector. Returns the Nth element object if index is set, otherwise, return an array of object.
        +
        + DOM
        traversing
        + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
        NameDescription
        +
        mixed
        + $e->children ( [int $index] )
        Returns the Nth child object if index is set, otherwise return an array of children.
        +
        element
        + $e->parent ()
        Returns the parent of element.
        +
        element
        + $e->first_child ()
        Returns the first child of element, or null if not found.
        +
        element
        + $e->last_child ()
        Returns the last child of element, or null if not found.
        +
        element
        + $e->next_sibling ()
        Returns the next sibling of element, or null if not found.
        +
        element
        + $e->prev_sibling ()
        Returns the previous sibling of element, or null if not found.
        +
        + +

        Camel naming convertions

        + Top +
        You can also call methods with W3C STANDARD camel naming convertions.
        +
        + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
        MethodMapping
        +
        array
        + $e->getAllAttributes ()
        +
        array
        + $e->attr
        +
        string
        + $e->getAttribute ( $name )
        +
        string
        + $e->attribute
        +
        void
        + $e->setAttribute ( $name, $value )
        +
        void
        + $value = $e->attribute
        +
        bool
        + $e->hasAttribute ( $name )
        +
        bool
        + isset($e->attribute)
        +
        void
        + $e->removeAttribute ( $name )
        +
        void
        + $e->attribute = null
        +
        element
        + $e->getElementById ( $id )
        +
        mixed
        + $e->find ( "#$id", 0 )
        +
        mixed
        + $e->getElementsById ( $id [,$index] )
        +
        mixed
        + $e->find ( "#$id" [, int $index] )
        +
        element
        + $e->getElementByTagName ($name )
        +
        mixed
        + $e->find ( $name, 0 )
        +
        mixed
        + $e->getElementsByTagName ( $name [, $index] )
        +
        mixed
        + $e->find ( $name [, int $index] )
        +
        element
        + $e->parentNode ()
        +
        element
        + $e->parent ()
        +
        mixed
        + $e->childNodes ( [$index] )
        +
        mixed
        + $e->children ( [int $index] )
        +
        element
        + $e->firstChild ()
        +
        element
        + $e->first_child ()
        +
        element
        + $e->lastChild ()
        +
        element
        + $e->last_child ()
        +
        element
        + $e->nextSibling ()
        +
        element
        + $e->next_sibling ()
        +
        element
        + $e->previousSibling ()
        +
        element
        + $e->prev_sibling ()
        +
        +

        + Author: S.C. Chen (me578022@gmail.com)
        +Original idea is from Jose Solorzano's HTML Parser for PHP 4.
        +Contributions by: Contributions by: Yousuke Kumakura, Vadim Voituk, Antcs
        +
        +
        + + + \ No newline at end of file diff --git a/vendor/sunra/php-simple-html-dom-parser/Src/Sunra/PhpSimple/simplehtmldom_1_5/manual/.svn/text-base/manual_faq.htm.svn-base b/vendor/sunra/php-simple-html-dom-parser/Src/Sunra/PhpSimple/simplehtmldom_1_5/manual/.svn/text-base/manual_faq.htm.svn-base new file mode 100644 index 000000000..4013156b0 --- /dev/null +++ b/vendor/sunra/php-simple-html-dom-parser/Src/Sunra/PhpSimple/simplehtmldom_1_5/manual/.svn/text-base/manual_faq.htm.svn-base @@ -0,0 +1,91 @@ + + + + +PHP Simple HTML DOM Parser: FAQ + + + +

        PHP Simple HTML DOM Parser Manual

        +
        +

        FAQ

        + +
        + +

        Problem with finding

        + Top +
        Q: Element not found in such case:
        + $html->find('div[style=padding: 0px 2px;] span[class=rf]');
        +
        + A: If there is blank in selectors, quote it!  
        + $html->find('div[style="padding: 0px 2px;"] span[class=rf]');
        + +

        Problem with hosting

        + Top +
        Q: On my local server everything works fine, but when I put it on my esternal server it doesn't work. 
        +
        + A: The "file_get_dom" function is a wrapper of "file_get_contents" function,  you must set "allow_url_fopen" as TRUE in "php.ini" to allow accessing files via HTTP or FTP. However, some hosting venders disabled PHP's "allow_url_fopen" flag for security issues... PHP provides excellent support for "curl" library to do the same job, Use curl to get the page, then call "str_get_dom" to create DOM object. 
        +
        + Example: 
        +  
        + $curl = curl_init(); 
        + curl_setopt($curl, CURLOPT_URL, 'http://????????');  
        + curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);  
        + curl_setopt($curl, CURLOPT_CONNECTTIMEOUT, 10);  
        + $str = curl_exec($curl);  
        + curl_close($curl);  
        +  
        + $html= str_get_html($str); 
        + ... 
        + +
        +

        Behind a proxy

        + Top +
        Q: My server is behind a Proxy and i can't use file_get_contents b/c it returns a unauthorized error.
        +
        + A: Thanks for Shaggy to provide the solution: 
        +  
        + // Define a context for HTTP. 
        + $context = array
        + ( 
        +       'http' => array
        +       ( 
        +              'proxy' => 'addresseproxy:portproxy', // This needs to be the server and the port of the NTLM Authentication Proxy Server. 
        +              'request_fulluri' => true, 
        +       ), 
        + ); 
        +
        + $context = stream_context_create($context); 
        +  
        + $html= file_get_html('http://www.php.net', false, $context); 
        + ...
        +
        +
        + +

        Memory leak!

        + Top +
        Q: This script is leaking memory seriously... After it finished running, it's not cleaning up dom object properly from memory.. 
        +
        + A: Due to php5 circular references memory leak, after creating DOM object, you must call $dom->clear() to free memory if call file_get_dom() more then once. 
        +
        + Example: 
        +
        + $html = file_get_html(...); 
        + // do something... 
        + $html->clear(); 
        + unset($html);
        +
        + Author: S.C. Chen (me578022@gmail.com)
        +Original idea is from Jose Solorzano's HTML Parser for PHP 4.
        +Contributions by: Yousuke Kumakura, Vadim Voituk, Antcs
        +
        +
        + + + diff --git a/vendor/sunra/php-simple-html-dom-parser/Src/Sunra/PhpSimple/simplehtmldom_1_5/manual/css/.svn/all-wcprops b/vendor/sunra/php-simple-html-dom-parser/Src/Sunra/PhpSimple/simplehtmldom_1_5/manual/css/.svn/all-wcprops new file mode 100644 index 000000000..86b0d7c35 --- /dev/null +++ b/vendor/sunra/php-simple-html-dom-parser/Src/Sunra/PhpSimple/simplehtmldom_1_5/manual/css/.svn/all-wcprops @@ -0,0 +1,17 @@ +K 25 +svn:wc:ra_dav:version-url +V 52 +/svnroot/simplehtmldom/!svn/ver/120/trunk/manual/css +END +default.css +K 25 +svn:wc:ra_dav:version-url +V 64 +/svnroot/simplehtmldom/!svn/ver/120/trunk/manual/css/default.css +END +ui.tabs.css +K 25 +svn:wc:ra_dav:version-url +V 63 +/svnroot/simplehtmldom/!svn/ver/29/trunk/manual/css/ui.tabs.css +END diff --git a/vendor/sunra/php-simple-html-dom-parser/Src/Sunra/PhpSimple/simplehtmldom_1_5/manual/css/.svn/entries b/vendor/sunra/php-simple-html-dom-parser/Src/Sunra/PhpSimple/simplehtmldom_1_5/manual/css/.svn/entries new file mode 100644 index 000000000..8a1233854 --- /dev/null +++ b/vendor/sunra/php-simple-html-dom-parser/Src/Sunra/PhpSimple/simplehtmldom_1_5/manual/css/.svn/entries @@ -0,0 +1,96 @@ +10 + +dir +182 +https://simplehtmldom.svn.sourceforge.net/svnroot/simplehtmldom/trunk/manual/css +https://simplehtmldom.svn.sourceforge.net/svnroot/simplehtmldom + + + +2008-06-24T22:59:40.092528Z +120 +me578022 + + + + + + + + + + + + + + +d0e60b4b-9046-0410-940c-b97530268c78 + +default.css +file + + + + +2010-08-17T19:13:53.530296Z +2f01e1ff8a4fa8fe63c8be8e17800ab0 +2008-06-24T22:59:40.092528Z +120 +me578022 + + + + + + + + + + + + + + + + + + + + + +2069 + +ui.tabs.css +file + + + + +2010-08-17T19:13:53.531296Z +995c002d1908567d7542ec9c2adfdc65 +2008-03-14T14:58:12.908404Z +29 +me578022 + + + + + + + + + + + + + + + + + + + + + +3833 + diff --git a/vendor/sunra/php-simple-html-dom-parser/Src/Sunra/PhpSimple/simplehtmldom_1_5/manual/css/.svn/text-base/default.css.svn-base b/vendor/sunra/php-simple-html-dom-parser/Src/Sunra/PhpSimple/simplehtmldom_1_5/manual/css/.svn/text-base/default.css.svn-base new file mode 100644 index 000000000..2ccfc2f83 --- /dev/null +++ b/vendor/sunra/php-simple-html-dom-parser/Src/Sunra/PhpSimple/simplehtmldom_1_5/manual/css/.svn/text-base/default.css.svn-base @@ -0,0 +1,113 @@ +/*$Rev: 46 $*/ + +body { +margin: 0; +padding: 0; +font-family: verdana,arial,helvetica,sans-serif; +font-size: 11px; +color: #4F5155; +} + +#content { +margin: 0 20px 0 20px; +line-height: 16px; +padding: 0; +} + +h1 { +font-size: 18px; +margin: 0; +padding: 0 0 2px 0; +background-color: #D0D0D0; +text-align: center; +} + +h2 { +background-color: #727EA3; +border-right: 1px solid #D0D0D0; +border-bottom: 1px solid #D0D0D0; +color: #FFFFFF; +font-size: 14px; +font-weight: bold; +margin: 14px 0 4px 0; +padding: 1px 10px 1px 10px; +} + +ul { +margin-top: 0; +margin-bottom: 0; +line-height:1.5em; +list-style-image:url(bullet.gif); +list-style-type:square; +} + +.top { +font-size: 11px; +float: right; +} + +.code { +font-size: 11px; +font-family: Monaco, Verdana, Sans-serif; +line-height: 14px; +background-color: #f6f6f6; +border-bottom: 1px solid #D0D0D0; +border-top: 1px solid #A0A0A0; +border-left: 1px solid #A0A0A0; +border-right: 1px solid #D0D0D0; +color: #002166; +display: block; +margin: 2px 0 2px 0; +padding: 2px 10px 2px 10px; +} + +.code A:link {color: #002166; text-decoration: none; font-weight: bold;} +.code A:visited {color: #002166; text-decoration: none; font-weight: bold;} +.code A:active {color: #002166; text-decoration: none; font-weight: bold;} +.code A:hover {color: #0000ff; text-decoration: underline; font-weight: bold;} + +.code .keyword { +color: #007700; +} + +.code .comment { +font-size: 10px; +color: #888; +} + +.code .var { +color: #770000; +} + +th { +font-family: Lucida Grande, Verdana, Geneva, Sans-serif; +color: #000000; +background-color: #CFD4E6; +margin: 2px 2px 2px 2px; +padding: 2px 2px 2px 2px; +font-size: 13px; +font-weight: normal; +font-style: normal; +} + +td { +background-color: #dddddd; +} + +.description { +font-family: Lucida Grande, Verdana, Geneva, Sans-serif; +font-size: 11px; +color: #333; +text-ident: 30px; +font-style: normal; +} + +.returns { +font-family: Monaco, Verdana, Sans-serif; +font-size: 10px; +color: #888; +float: left; +text-align: right; +margin: 0 4px 0 0; +width: 48px; +} \ No newline at end of file diff --git a/vendor/sunra/php-simple-html-dom-parser/Src/Sunra/PhpSimple/simplehtmldom_1_5/manual/css/.svn/text-base/ui.tabs.css.svn-base b/vendor/sunra/php-simple-html-dom-parser/Src/Sunra/PhpSimple/simplehtmldom_1_5/manual/css/.svn/text-base/ui.tabs.css.svn-base new file mode 100644 index 000000000..a9dc19914 --- /dev/null +++ b/vendor/sunra/php-simple-html-dom-parser/Src/Sunra/PhpSimple/simplehtmldom_1_5/manual/css/.svn/text-base/ui.tabs.css.svn-base @@ -0,0 +1,116 @@ +/* Caution! Ensure accessibility in print and other media types... */ +@media projection, screen { /* Use class for showing/hiding tab content, so that visibility can be better controlled in different media types... */ + .ui-tabs-hide { + display: none; + } +} + +/* Hide useless elements in print layouts... */ +@media print { + .ui-tabs-nav { + display: none; + } +} + +/* Skin */ +.ui-tabs-nav, .ui-tabs-panel { + font-family: "Trebuchet MS", Trebuchet, Verdana, Helvetica, Arial, sans-serif; + font-size: 12px; +} +.ui-tabs-nav { + list-style: none; + margin: 0; + padding: 0 0 0 4px; +} +.ui-tabs-nav:after { /* clearing without presentational markup, IE gets extra treatment */ + display: block; + clear: both; + content: " "; +} +.ui-tabs-nav li { + float: left; + margin: 0 0 0 1px; + min-width: 84px; /* be nice to Opera */ +} +.ui-tabs-nav a, .ui-tabs-nav a span { + display: block; + padding: 0 10px; + background: url(../img/tab.png) no-repeat; +} +.ui-tabs-nav a { + margin: 1px 0 0; /* position: relative makes opacity fail for disabled tab in IE */ + padding-left: 0; + color: #27537a; + font-weight: bold; + line-height: 1.2; + text-align: center; + text-decoration: none; + white-space: nowrap; /* required in IE 6 */ + outline: 0; /* prevent dotted border in Firefox */ +} +.ui-tabs-nav .ui-tabs-selected a { + position: relative; + top: 1px; + z-index: 2; + margin-top: 0; + color: #000; +} +.ui-tabs-nav a span { + width: 64px; /* IE 6 treats width as min-width */ + min-width: 64px; + height: 18px; /* IE 6 treats height as min-height */ + min-height: 18px; + padding-top: 6px; + padding-right: 0; +} +*>.ui-tabs-nav a span { /* hide from IE 6 */ + width: auto; + height: auto; +} +.ui-tabs-nav .ui-tabs-selected a span { + padding-bottom: 1px; +} +.ui-tabs-nav .ui-tabs-selected a, .ui-tabs-nav a:hover, .ui-tabs-nav a:focus, .ui-tabs-nav a:active { + background-position: 100% -150px; +} +.ui-tabs-nav a, .ui-tabs-nav .ui-tabs-disabled a:hover, .ui-tabs-nav .ui-tabs-disabled a:focus, .ui-tabs-nav .ui-tabs-disabled a:active { + background-position: 100% -100px; +} +.ui-tabs-nav .ui-tabs-selected a span, .ui-tabs-nav a:hover span, .ui-tabs-nav a:focus span, .ui-tabs-nav a:active span { + background-position: 0 -50px; +} +.ui-tabs-nav a span, .ui-tabs-nav .ui-tabs-disabled a:hover span, .ui-tabs-nav .ui-tabs-disabled a:focus span, .ui-tabs-nav .ui-tabs-disabled a:active span { + background-position: 0 0; +} +.ui-tabs-nav .ui-tabs-selected a:link, .ui-tabs-nav .ui-tabs-selected a:visited, .ui-tabs-nav .ui-tabs-disabled a:link, .ui-tabs-nav .ui-tabs-disabled a:visited { /* @ Opera, use pseudo classes otherwise it confuses cursor... */ + cursor: text; +} +.ui-tabs-nav a:hover, .ui-tabs-nav a:focus, .ui-tabs-nav a:active, +.ui-tabs-nav .ui-tabs-unselect a:hover, .ui-tabs-nav .ui-tabs-unselect a:focus, .ui-tabs-nav .ui-tabs-unselect a:active { /* @ Opera, we need to be explicit again here now... */ + cursor: pointer; +} +.ui-tabs-disabled { + opacity: .4; + filter: alpha(opacity=40); +} +.ui-tabs-panel { + border-top: 1px solid #97a5b0; + padding: 2px 4px 2px 4px; + background: #fff; /* declare background color for container to avoid distorted fonts in IE while fading */ + border: 1px solid #D0D0D0; + border-bottom: 1px solid #A0A0A0; + border-right: 1px solid #A0A0A0; +} +.ui-tabs-loading em { + padding: 0 0 0 20px; + background: url(loading.gif) no-repeat 0 50%; +} + +/* Additional IE specific bug fixes... */ +* html .ui-tabs-nav { /* auto clear, @ IE 6 & IE 7 Quirks Mode */ + display: inline-block; +} +*:first-child+html .ui-tabs-nav { /* @ IE 7 Standards Mode - do not group selectors, otherwise IE 6 will ignore complete rule (because of the unknown + combinator)... */ + display: inline-block; +} + diff --git a/vendor/sunra/php-simple-html-dom-parser/Src/Sunra/PhpSimple/simplehtmldom_1_5/manual/css/default.css b/vendor/sunra/php-simple-html-dom-parser/Src/Sunra/PhpSimple/simplehtmldom_1_5/manual/css/default.css new file mode 100644 index 000000000..2ccfc2f83 --- /dev/null +++ b/vendor/sunra/php-simple-html-dom-parser/Src/Sunra/PhpSimple/simplehtmldom_1_5/manual/css/default.css @@ -0,0 +1,113 @@ +/*$Rev: 46 $*/ + +body { +margin: 0; +padding: 0; +font-family: verdana,arial,helvetica,sans-serif; +font-size: 11px; +color: #4F5155; +} + +#content { +margin: 0 20px 0 20px; +line-height: 16px; +padding: 0; +} + +h1 { +font-size: 18px; +margin: 0; +padding: 0 0 2px 0; +background-color: #D0D0D0; +text-align: center; +} + +h2 { +background-color: #727EA3; +border-right: 1px solid #D0D0D0; +border-bottom: 1px solid #D0D0D0; +color: #FFFFFF; +font-size: 14px; +font-weight: bold; +margin: 14px 0 4px 0; +padding: 1px 10px 1px 10px; +} + +ul { +margin-top: 0; +margin-bottom: 0; +line-height:1.5em; +list-style-image:url(bullet.gif); +list-style-type:square; +} + +.top { +font-size: 11px; +float: right; +} + +.code { +font-size: 11px; +font-family: Monaco, Verdana, Sans-serif; +line-height: 14px; +background-color: #f6f6f6; +border-bottom: 1px solid #D0D0D0; +border-top: 1px solid #A0A0A0; +border-left: 1px solid #A0A0A0; +border-right: 1px solid #D0D0D0; +color: #002166; +display: block; +margin: 2px 0 2px 0; +padding: 2px 10px 2px 10px; +} + +.code A:link {color: #002166; text-decoration: none; font-weight: bold;} +.code A:visited {color: #002166; text-decoration: none; font-weight: bold;} +.code A:active {color: #002166; text-decoration: none; font-weight: bold;} +.code A:hover {color: #0000ff; text-decoration: underline; font-weight: bold;} + +.code .keyword { +color: #007700; +} + +.code .comment { +font-size: 10px; +color: #888; +} + +.code .var { +color: #770000; +} + +th { +font-family: Lucida Grande, Verdana, Geneva, Sans-serif; +color: #000000; +background-color: #CFD4E6; +margin: 2px 2px 2px 2px; +padding: 2px 2px 2px 2px; +font-size: 13px; +font-weight: normal; +font-style: normal; +} + +td { +background-color: #dddddd; +} + +.description { +font-family: Lucida Grande, Verdana, Geneva, Sans-serif; +font-size: 11px; +color: #333; +text-ident: 30px; +font-style: normal; +} + +.returns { +font-family: Monaco, Verdana, Sans-serif; +font-size: 10px; +color: #888; +float: left; +text-align: right; +margin: 0 4px 0 0; +width: 48px; +} \ No newline at end of file diff --git a/vendor/sunra/php-simple-html-dom-parser/Src/Sunra/PhpSimple/simplehtmldom_1_5/manual/css/ui.tabs.css b/vendor/sunra/php-simple-html-dom-parser/Src/Sunra/PhpSimple/simplehtmldom_1_5/manual/css/ui.tabs.css new file mode 100644 index 000000000..a9dc19914 --- /dev/null +++ b/vendor/sunra/php-simple-html-dom-parser/Src/Sunra/PhpSimple/simplehtmldom_1_5/manual/css/ui.tabs.css @@ -0,0 +1,116 @@ +/* Caution! Ensure accessibility in print and other media types... */ +@media projection, screen { /* Use class for showing/hiding tab content, so that visibility can be better controlled in different media types... */ + .ui-tabs-hide { + display: none; + } +} + +/* Hide useless elements in print layouts... */ +@media print { + .ui-tabs-nav { + display: none; + } +} + +/* Skin */ +.ui-tabs-nav, .ui-tabs-panel { + font-family: "Trebuchet MS", Trebuchet, Verdana, Helvetica, Arial, sans-serif; + font-size: 12px; +} +.ui-tabs-nav { + list-style: none; + margin: 0; + padding: 0 0 0 4px; +} +.ui-tabs-nav:after { /* clearing without presentational markup, IE gets extra treatment */ + display: block; + clear: both; + content: " "; +} +.ui-tabs-nav li { + float: left; + margin: 0 0 0 1px; + min-width: 84px; /* be nice to Opera */ +} +.ui-tabs-nav a, .ui-tabs-nav a span { + display: block; + padding: 0 10px; + background: url(../img/tab.png) no-repeat; +} +.ui-tabs-nav a { + margin: 1px 0 0; /* position: relative makes opacity fail for disabled tab in IE */ + padding-left: 0; + color: #27537a; + font-weight: bold; + line-height: 1.2; + text-align: center; + text-decoration: none; + white-space: nowrap; /* required in IE 6 */ + outline: 0; /* prevent dotted border in Firefox */ +} +.ui-tabs-nav .ui-tabs-selected a { + position: relative; + top: 1px; + z-index: 2; + margin-top: 0; + color: #000; +} +.ui-tabs-nav a span { + width: 64px; /* IE 6 treats width as min-width */ + min-width: 64px; + height: 18px; /* IE 6 treats height as min-height */ + min-height: 18px; + padding-top: 6px; + padding-right: 0; +} +*>.ui-tabs-nav a span { /* hide from IE 6 */ + width: auto; + height: auto; +} +.ui-tabs-nav .ui-tabs-selected a span { + padding-bottom: 1px; +} +.ui-tabs-nav .ui-tabs-selected a, .ui-tabs-nav a:hover, .ui-tabs-nav a:focus, .ui-tabs-nav a:active { + background-position: 100% -150px; +} +.ui-tabs-nav a, .ui-tabs-nav .ui-tabs-disabled a:hover, .ui-tabs-nav .ui-tabs-disabled a:focus, .ui-tabs-nav .ui-tabs-disabled a:active { + background-position: 100% -100px; +} +.ui-tabs-nav .ui-tabs-selected a span, .ui-tabs-nav a:hover span, .ui-tabs-nav a:focus span, .ui-tabs-nav a:active span { + background-position: 0 -50px; +} +.ui-tabs-nav a span, .ui-tabs-nav .ui-tabs-disabled a:hover span, .ui-tabs-nav .ui-tabs-disabled a:focus span, .ui-tabs-nav .ui-tabs-disabled a:active span { + background-position: 0 0; +} +.ui-tabs-nav .ui-tabs-selected a:link, .ui-tabs-nav .ui-tabs-selected a:visited, .ui-tabs-nav .ui-tabs-disabled a:link, .ui-tabs-nav .ui-tabs-disabled a:visited { /* @ Opera, use pseudo classes otherwise it confuses cursor... */ + cursor: text; +} +.ui-tabs-nav a:hover, .ui-tabs-nav a:focus, .ui-tabs-nav a:active, +.ui-tabs-nav .ui-tabs-unselect a:hover, .ui-tabs-nav .ui-tabs-unselect a:focus, .ui-tabs-nav .ui-tabs-unselect a:active { /* @ Opera, we need to be explicit again here now... */ + cursor: pointer; +} +.ui-tabs-disabled { + opacity: .4; + filter: alpha(opacity=40); +} +.ui-tabs-panel { + border-top: 1px solid #97a5b0; + padding: 2px 4px 2px 4px; + background: #fff; /* declare background color for container to avoid distorted fonts in IE while fading */ + border: 1px solid #D0D0D0; + border-bottom: 1px solid #A0A0A0; + border-right: 1px solid #A0A0A0; +} +.ui-tabs-loading em { + padding: 0 0 0 20px; + background: url(loading.gif) no-repeat 0 50%; +} + +/* Additional IE specific bug fixes... */ +* html .ui-tabs-nav { /* auto clear, @ IE 6 & IE 7 Quirks Mode */ + display: inline-block; +} +*:first-child+html .ui-tabs-nav { /* @ IE 7 Standards Mode - do not group selectors, otherwise IE 6 will ignore complete rule (because of the unknown + combinator)... */ + display: inline-block; +} + diff --git a/vendor/sunra/php-simple-html-dom-parser/Src/Sunra/PhpSimple/simplehtmldom_1_5/manual/img/.svn/all-wcprops b/vendor/sunra/php-simple-html-dom-parser/Src/Sunra/PhpSimple/simplehtmldom_1_5/manual/img/.svn/all-wcprops new file mode 100644 index 000000000..ddb4fc224 --- /dev/null +++ b/vendor/sunra/php-simple-html-dom-parser/Src/Sunra/PhpSimple/simplehtmldom_1_5/manual/img/.svn/all-wcprops @@ -0,0 +1,11 @@ +K 25 +svn:wc:ra_dav:version-url +V 51 +/svnroot/simplehtmldom/!svn/ver/29/trunk/manual/img +END +tab.png +K 25 +svn:wc:ra_dav:version-url +V 59 +/svnroot/simplehtmldom/!svn/ver/29/trunk/manual/img/tab.png +END diff --git a/vendor/sunra/php-simple-html-dom-parser/Src/Sunra/PhpSimple/simplehtmldom_1_5/manual/img/.svn/entries b/vendor/sunra/php-simple-html-dom-parser/Src/Sunra/PhpSimple/simplehtmldom_1_5/manual/img/.svn/entries new file mode 100644 index 000000000..3d692dc60 --- /dev/null +++ b/vendor/sunra/php-simple-html-dom-parser/Src/Sunra/PhpSimple/simplehtmldom_1_5/manual/img/.svn/entries @@ -0,0 +1,62 @@ +10 + +dir +182 +https://simplehtmldom.svn.sourceforge.net/svnroot/simplehtmldom/trunk/manual/img +https://simplehtmldom.svn.sourceforge.net/svnroot/simplehtmldom + + + +2008-03-14T14:58:12.908404Z +29 +me578022 + + + + + + + + + + + + + + +d0e60b4b-9046-0410-940c-b97530268c78 + +tab.png +file + + + + +2010-08-17T19:13:53.595300Z +83a79d462146a7d0d1ea4dd969101885 +2008-03-14T14:58:12.908404Z +29 +me578022 +has-props + + + + + + + + + + + + + + + + + + + + +734 + diff --git a/vendor/sunra/php-simple-html-dom-parser/Src/Sunra/PhpSimple/simplehtmldom_1_5/manual/img/.svn/prop-base/tab.png.svn-base b/vendor/sunra/php-simple-html-dom-parser/Src/Sunra/PhpSimple/simplehtmldom_1_5/manual/img/.svn/prop-base/tab.png.svn-base new file mode 100644 index 000000000..5e9587e65 --- /dev/null +++ b/vendor/sunra/php-simple-html-dom-parser/Src/Sunra/PhpSimple/simplehtmldom_1_5/manual/img/.svn/prop-base/tab.png.svn-base @@ -0,0 +1,5 @@ +K 13 +svn:mime-type +V 24 +application/octet-stream +END diff --git a/vendor/sunra/php-simple-html-dom-parser/Src/Sunra/PhpSimple/simplehtmldom_1_5/manual/img/.svn/text-base/tab.png.svn-base b/vendor/sunra/php-simple-html-dom-parser/Src/Sunra/PhpSimple/simplehtmldom_1_5/manual/img/.svn/text-base/tab.png.svn-base new file mode 100644 index 0000000000000000000000000000000000000000..3d5f156d6fd315b5c2b1a4af7141ea3425885e08 GIT binary patch literal 734 zcmeAS@N?(olHy`uVBq!ia0y~yVAKJ!PjD~;$y7$2bRZ>J;u=vBoS#-wo>-L1;Fyx1 zl&avFo0y&&l$w}QS$Hzl2B@eaz$e7@|Ns9tUwyF&&3^LX`<*vmAH4f^_s!SaufIHe z_wDtUpD#ZB`0)MruRnipz4~(R?YFmIfBpFV_woDhUw;1i`s>f9AHTo<{`>Ot&)*~cG$|NZ~-_us$&|82r^lB;^&efxRk_G8z$qN3KxfoYX>eY2-5T_01_@bmBg zqW_0`fG+>z>EaktaqG=pPd}MJ0oRKM8eZmJ-rl!r(cS-iiZ>Ya**$p9#U7ftZ_4Bo z;ajWzEL{_|*KWO6q<$>_sa0ox`6Yh+Qnr4>tL&wr^4e>E&A+rte`;9mx-GAamxjh` zto`MYdDYx&^}p3yUNHj&G}rzL$h^AUYxTXbsIMz8t@=JSY%fsC9;jmNmRGV%L*D~c zxMW_9_G)J37SoB?zyc-{I6>@$gF-qH_gj{#*2Zo67e2xJTI=*RUbojs9= zb0&U0d-1)9-=<%uW*zbjiwL$j$(7Be9+~L-P(^!<=A4vP)7HsrHY_WcBzg^~>Ja6M zK9qj|xeMZN48||P+P%kKO)3r4ixhu4snk&~a{7}=r6;Xj7$6~}*Z|QeZ~$Tg2h;=> tsF_Tl@B>OQf&;RtmEqd=FM0J;u=vBoS#-wo>-L1;Fyx1 zl&avFo0y&&l$w}QS$Hzl2B@eaz$e7@|Ns9tUwyF&&3^LX`<*vmAH4f^_s!SaufIHe z_wDtUpD#ZB`0)MruRnipz4~(R?YFmIfBpFV_woDhUw;1i`s>f9AHTo<{`>Ot&)*~cG$|NZ~-_us$&|82r^lB;^&efxRk_G8z$qN3KxfoYX>eY2-5T_01_@bmBg zqW_0`fG+>z>EaktaqG=pPd}MJ0oRKM8eZmJ-rl!r(cS-iiZ>Ya**$p9#U7ftZ_4Bo z;ajWzEL{_|*KWO6q<$>_sa0ox`6Yh+Qnr4>tL&wr^4e>E&A+rte`;9mx-GAamxjh` zto`MYdDYx&^}p3yUNHj&G}rzL$h^AUYxTXbsIMz8t@=JSY%fsC9;jmNmRGV%L*D~c zxMW_9_G)J37SoB?zyc-{I6>@$gF-qH_gj{#*2Zo67e2xJTI=*RUbojs9= zb0&U0d-1)9-=<%uW*zbjiwL$j$(7Be9+~L-P(^!<=A4vP)7HsrHY_WcBzg^~>Ja6M zK9qj|xeMZN48||P+P%kKO)3r4ixhu4snk&~a{7}=r6;Xj7$6~}*Z|QeZ~$Tg2h;=> tsF_Tl@B>OQf&;RtmEqd=FM035?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)r[e(c)]=k[c]||e(c);k=[function(e){return r[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('(J(){7(1e.3N)L w=1e.3N;L E=1e.3N=J(a,b){K 1B E.2l.4T(a,b)};7(1e.$)L D=1e.$;1e.$=E;L u=/^[^<]*(<(.|\\s)+>)[^>]*$|^#(\\w+)$/;L G=/^.[^:#\\[\\.]*$/;E.1n=E.2l={4T:J(d,b){d=d||T;7(d.15){6[0]=d;6.M=1;K 6}N 7(1o d=="25"){L c=u.2O(d);7(c&&(c[1]||!b)){7(c[1])d=E.4a([c[1]],b);N{L a=T.5J(c[3]);7(a)7(a.2w!=c[3])K E().2s(d);N{6[0]=a;6.M=1;K 6}N d=[]}}N K 1B E(b).2s(d)}N 7(E.1q(d))K 1B E(T)[E.1n.21?"21":"3U"](d);K 6.6E(d.1k==1M&&d||(d.5h||d.M&&d!=1e&&!d.15&&d[0]!=10&&d[0].15)&&E.2I(d)||[d])},5h:"1.2.3",87:J(){K 6.M},M:0,22:J(a){K a==10?E.2I(6):6[a]},2F:J(b){L a=E(b);a.54=6;K a},6E:J(a){6.M=0;1M.2l.1g.1i(6,a);K 6},R:J(a,b){K E.R(6,a,b)},4X:J(b){L a=-1;6.R(J(i){7(6==b)a=i});K a},1J:J(c,a,b){L d=c;7(c.1k==4e)7(a==10)K 6.M&&E[b||"1J"](6[0],c)||10;N{d={};d[c]=a}K 6.R(J(i){Q(c 1p d)E.1J(b?6.W:6,c,E.1l(6,d[c],b,i,c))})},1j:J(b,a){7((b==\'27\'||b==\'1R\')&&2M(a)<0)a=10;K 6.1J(b,a,"2o")},1u:J(b){7(1o b!="3V"&&b!=V)K 6.4x().3t((6[0]&&6[0].2i||T).5r(b));L a="";E.R(b||6,J(){E.R(6.3p,J(){7(6.15!=8)a+=6.15!=1?6.6K:E.1n.1u([6])})});K a},5m:J(b){7(6[0])E(b,6[0].2i).5k().3o(6[0]).2c(J(){L a=6;2b(a.1C)a=a.1C;K a}).3t(6);K 6},8w:J(a){K 6.R(J(){E(6).6z().5m(a)})},8p:J(a){K 6.R(J(){E(6).5m(a)})},3t:J(){K 6.3O(18,P,S,J(a){7(6.15==1)6.38(a)})},6q:J(){K 6.3O(18,P,P,J(a){7(6.15==1)6.3o(a,6.1C)})},6o:J(){K 6.3O(18,S,S,J(a){6.1a.3o(a,6)})},5a:J(){K 6.3O(18,S,P,J(a){6.1a.3o(a,6.2B)})},3h:J(){K 6.54||E([])},2s:J(b){L c=E.2c(6,J(a){K E.2s(b,a)});K 6.2F(/[^+>] [^+>]/.17(b)||b.1f("..")>-1?E.57(c):c)},5k:J(e){L f=6.2c(J(){7(E.14.1d&&!E.3E(6)){L a=6.69(P),4Y=T.3s("1x");4Y.38(a);K E.4a([4Y.3d])[0]}N K 6.69(P)});L d=f.2s("*").4R().R(J(){7(6[F]!=10)6[F]=V});7(e===P)6.2s("*").4R().R(J(i){7(6.15==3)K;L c=E.O(6,"2R");Q(L a 1p c)Q(L b 1p c[a])E.16.1b(d[i],a,c[a][b],c[a][b].O)});K f},1E:J(b){K 6.2F(E.1q(b)&&E.3y(6,J(a,i){K b.1P(a,i)})||E.3e(b,6))},56:J(b){7(b.1k==4e)7(G.17(b))K 6.2F(E.3e(b,6,P));N b=E.3e(b,6);L a=b.M&&b[b.M-1]!==10&&!b.15;K 6.1E(J(){K a?E.33(6,b)<0:6!=b})},1b:J(a){K!a?6:6.2F(E.37(6.22(),a.1k==4e?E(a).22():a.M!=10&&(!a.12||E.12(a,"3u"))?a:[a]))},3H:J(a){K a?E.3e(a,6).M>0:S},7j:J(a){K 6.3H("."+a)},5O:J(b){7(b==10){7(6.M){L c=6[0];7(E.12(c,"2k")){L e=c.3T,5I=[],11=c.11,2X=c.U=="2k-2X";7(e<0)K V;Q(L i=2X?e:0,2f=2X?e+1:11.M;i<2f;i++){L d=11[i];7(d.2p){b=E.14.1d&&!d.9J.1A.9y?d.1u:d.1A;7(2X)K b;5I.1g(b)}}K 5I}N K(6[0].1A||"").1r(/\\r/g,"")}K 10}K 6.R(J(){7(6.15!=1)K;7(b.1k==1M&&/5u|5t/.17(6.U))6.3k=(E.33(6.1A,b)>=0||E.33(6.31,b)>=0);N 7(E.12(6,"2k")){L a=b.1k==1M?b:[b];E("98",6).R(J(){6.2p=(E.33(6.1A,a)>=0||E.33(6.1u,a)>=0)});7(!a.M)6.3T=-1}N 6.1A=b})},3q:J(a){K a==10?(6.M?6[0].3d:V):6.4x().3t(a)},6S:J(a){K 6.5a(a).1V()},6Z:J(i){K 6.2K(i,i+1)},2K:J(){K 6.2F(1M.2l.2K.1i(6,18))},2c:J(b){K 6.2F(E.2c(6,J(a,i){K b.1P(a,i,a)}))},4R:J(){K 6.1b(6.54)},O:J(d,b){L a=d.23(".");a[1]=a[1]?"."+a[1]:"";7(b==V){L c=6.5n("8P"+a[1]+"!",[a[0]]);7(c==10&&6.M)c=E.O(6[0],d);K c==V&&a[1]?6.O(a[0]):c}N K 6.1N("8K"+a[1]+"!",[a[0],b]).R(J(){E.O(6,d,b)})},35:J(a){K 6.R(J(){E.35(6,a)})},3O:J(g,f,h,d){L e=6.M>1,3n;K 6.R(J(){7(!3n){3n=E.4a(g,6.2i);7(h)3n.8D()}L b=6;7(f&&E.12(6,"1O")&&E.12(3n[0],"4v"))b=6.3S("1U")[0]||6.38(6.2i.3s("1U"));L c=E([]);E.R(3n,J(){L a=e?E(6).5k(P)[0]:6;7(E.12(a,"1m")){c=c.1b(a)}N{7(a.15==1)c=c.1b(E("1m",a).1V());d.1P(b,a)}});c.R(6A)})}};E.2l.4T.2l=E.2l;J 6A(i,a){7(a.3Q)E.3P({1c:a.3Q,3l:S,1H:"1m"});N E.5g(a.1u||a.6x||a.3d||"");7(a.1a)a.1a.34(a)}E.1s=E.1n.1s=J(){L b=18[0]||{},i=1,M=18.M,5c=S,11;7(b.1k==8d){5c=b;b=18[1]||{};i=2}7(1o b!="3V"&&1o b!="J")b={};7(M==1){b=6;i=0}Q(;i-1}},68:J(b,c,a){L e={};Q(L d 1p c){e[d]=b.W[d];b.W[d]=c[d]}a.1P(b);Q(L d 1p c)b.W[d]=e[d]},1j:J(d,e,c){7(e=="27"||e=="1R"){L b,46={43:"4W",4U:"1Z",19:"3D"},3c=e=="27"?["7O","7M"]:["7J","7I"];J 5E(){b=e=="27"?d.7H:d.7F;L a=0,2N=0;E.R(3c,J(){a+=2M(E.2o(d,"7E"+6,P))||0;2N+=2M(E.2o(d,"2N"+6+"5X",P))||0});b-=24.7C(a+2N)}7(E(d).3H(":4d"))5E();N E.68(d,46,5E);K 24.2f(0,b)}K E.2o(d,e,c)},2o:J(e,k,j){L d;J 3x(b){7(!E.14.2d)K S;L a=T.4c.4K(b,V);K!a||a.4M("3x")==""}7(k=="1w"&&E.14.1d){d=E.1J(e.W,"1w");K d==""?"1":d}7(E.14.2z&&k=="19"){L c=e.W.50;e.W.50="0 7r 7o";e.W.50=c}7(k.1D(/4g/i))k=y;7(!j&&e.W&&e.W[k])d=e.W[k];N 7(T.4c&&T.4c.4K){7(k.1D(/4g/i))k="4g";k=k.1r(/([A-Z])/g,"-$1").2h();L h=T.4c.4K(e,V);7(h&&!3x(e))d=h.4M(k);N{L f=[],2C=[];Q(L a=e;a&&3x(a);a=a.1a)2C.4J(a);Q(L i=0;i<2C.M;i++)7(3x(2C[i])){f[i]=2C[i].W.19;2C[i].W.19="3D"}d=k=="19"&&f[2C.M-1]!=V?"2H":(h&&h.4M(k))||"";Q(L i=0;i]*?)\\/>/g,J(b,a,c){K c.1D(/^(aa|a6|7e|a5|4D|7a|a0|3m|9W|9U|9S)$/i)?b:a+">"});L f=E.3g(d).2h(),1x=h.3s("1x");L e=!f.1f("<9P")&&[1,"<2k 74=\'74\'>",""]||!f.1f("<9M")&&[1,"<73>",""]||f.1D(/^<(9G|1U|9E|9B|9x)/)&&[1,"<1O>",""]||!f.1f("<4v")&&[2,"<1O><1U>",""]||(!f.1f("<9w")||!f.1f("<9v"))&&[3,"<1O><1U><4v>",""]||!f.1f("<7e")&&[2,"<1O><1U><6V>",""]||E.14.1d&&[1,"1x<1x>",""]||[0,"",""];1x.3d=e[1]+d+e[2];2b(e[0]--)1x=1x.5o;7(E.14.1d){L g=!f.1f("<1O")&&f.1f("<1U")<0?1x.1C&&1x.1C.3p:e[1]=="<1O>"&&f.1f("<1U")<0?1x.3p:[];Q(L j=g.M-1;j>=0;--j)7(E.12(g[j],"1U")&&!g[j].3p.M)g[j].1a.34(g[j]);7(/^\\s/.17(d))1x.3o(h.5r(d.1D(/^\\s*/)[0]),1x.1C)}d=E.2I(1x.3p)}7(d.M===0&&(!E.12(d,"3u")&&!E.12(d,"2k")))K;7(d[0]==10||E.12(d,"3u")||d.11)k.1g(d);N k=E.37(k,d)});K k},1J:J(d,e,c){7(!d||d.15==3||d.15==8)K 10;L f=E.3E(d)?{}:E.46;7(e=="2p"&&E.14.2d)d.1a.3T;7(f[e]){7(c!=10)d[f[e]]=c;K d[f[e]]}N 7(E.14.1d&&e=="W")K E.1J(d.W,"9u",c);N 7(c==10&&E.14.1d&&E.12(d,"3u")&&(e=="9r"||e=="9o"))K d.9m(e).6K;N 7(d.28){7(c!=10){7(e=="U"&&E.12(d,"4D")&&d.1a)6Q"U 9i 9h\'t 9g 9e";d.9b(e,""+c)}7(E.14.1d&&/6O|3Q/.17(e)&&!E.3E(d))K d.4z(e,2);K d.4z(e)}N{7(e=="1w"&&E.14.1d){7(c!=10){d.6k=1;d.1E=(d.1E||"").1r(/6M\\([^)]*\\)/,"")+(2M(c).3X()=="96"?"":"6M(1w="+c*6L+")")}K d.1E&&d.1E.1f("1w=")>=0?(2M(d.1E.1D(/1w=([^)]*)/)[1])/6L).3X():""}e=e.1r(/-([a-z])/95,J(a,b){K b.2E()});7(c!=10)d[e]=c;K d[e]}},3g:J(a){K(a||"").1r(/^\\s+|\\s+$/g,"")},2I:J(b){L a=[];7(1o b!="93")Q(L i=0,M=b.M;i*",6).1V();2b(6.1C)6.34(6.1C)}},J(a,b){E.1n[a]=J(){K 6.R(b,18)}});E.R(["8f","5X"],J(i,c){L b=c.2h();E.1n[b]=J(a){K 6[0]==1e?E.14.2z&&T.1h["5e"+c]||E.14.2d&&1e["8e"+c]||T.6F=="79"&&T.1F["5e"+c]||T.1h["5e"+c]:6[0]==T?24.2f(24.2f(T.1h["5d"+c],T.1F["5d"+c]),24.2f(T.1h["5L"+c],T.1F["5L"+c])):a==10?(6.M?E.1j(6[0],b):V):6.1j(b,a.1k==4e?a:a+"2S")}});L C=E.14.2d&&4s(E.14.5K)<8c?"(?:[\\\\w*4r-]|\\\\\\\\.)":"(?:[\\\\w\\8b-\\8a*4r-]|\\\\\\\\.)",6v=1B 4q("^>\\\\s*("+C+"+)"),6u=1B 4q("^("+C+"+)(#)("+C+"+)"),6s=1B 4q("^([#.]?)("+C+"*)");E.1s({6r:{"":J(a,i,m){K m[2]=="*"||E.12(a,m[2])},"#":J(a,i,m){K a.4z("2w")==m[2]},":":{89:J(a,i,m){K im[3]-0},2Z:J(a,i,m){K m[3]-0==i},6Z:J(a,i,m){K m[3]-0==i},3j:J(a,i){K i==0},3J:J(a,i,m,r){K i==r.M-1},6n:J(a,i){K i%2==0},6l:J(a,i){K i%2},"3j-4p":J(a){K a.1a.3S("*")[0]==a},"3J-4p":J(a){K E.2Z(a.1a.5o,1,"4t")==a},"83-4p":J(a){K!E.2Z(a.1a.5o,2,"4t")},6B:J(a){K a.1C},4x:J(a){K!a.1C},82:J(a,i,m){K(a.6x||a.81||E(a).1u()||"").1f(m[3])>=0},4d:J(a){K"1Z"!=a.U&&E.1j(a,"19")!="2H"&&E.1j(a,"4U")!="1Z"},1Z:J(a){K"1Z"==a.U||E.1j(a,"19")=="2H"||E.1j(a,"4U")=="1Z"},80:J(a){K!a.2Y},2Y:J(a){K a.2Y},3k:J(a){K a.3k},2p:J(a){K a.2p||E.1J(a,"2p")},1u:J(a){K"1u"==a.U},5u:J(a){K"5u"==a.U},5t:J(a){K"5t"==a.U},59:J(a){K"59"==a.U},3I:J(a){K"3I"==a.U},58:J(a){K"58"==a.U},6j:J(a){K"6j"==a.U},6i:J(a){K"6i"==a.U},2G:J(a){K"2G"==a.U||E.12(a,"2G")},4D:J(a){K/4D|2k|6h|2G/i.17(a.12)},3Y:J(a,i,m){K E.2s(m[3],a).M},7X:J(a){K/h\\d/i.17(a.12)},7W:J(a){K E.3y(E.3G,J(b){K a==b.Y}).M}}},6g:[/^(\\[) *@?([\\w-]+) *([!*$^~=]*) *(\'?"?)(.*?)\\4 *\\]/,/^(:)([\\w-]+)\\("?\'?(.*?(\\(.*?\\))?[^(]*?)"?\'?\\)/,1B 4q("^([:.#]*)("+C+"+)")],3e:J(a,c,b){L d,2m=[];2b(a&&a!=d){d=a;L f=E.1E(a,c,b);a=f.t.1r(/^\\s*,\\s*/,"");2m=b?c=f.r:E.37(2m,f.r)}K 2m},2s:J(t,p){7(1o t!="25")K[t];7(p&&p.15!=1&&p.15!=9)K[];p=p||T;L d=[p],2r=[],3J,12;2b(t&&3J!=t){L r=[];3J=t;t=E.3g(t);L o=S;L g=6v;L m=g.2O(t);7(m){12=m[1].2E();Q(L i=0;d[i];i++)Q(L c=d[i].1C;c;c=c.2B)7(c.15==1&&(12=="*"||c.12.2E()==12))r.1g(c);d=r;t=t.1r(g,"");7(t.1f(" ")==0)6w;o=P}N{g=/^([>+~])\\s*(\\w*)/i;7((m=g.2O(t))!=V){r=[];L l={};12=m[2].2E();m=m[1];Q(L j=0,3f=d.M;j<3f;j++){L n=m=="~"||m=="+"?d[j].2B:d[j].1C;Q(;n;n=n.2B)7(n.15==1){L h=E.O(n);7(m=="~"&&l[h])1Q;7(!12||n.12.2E()==12){7(m=="~")l[h]=P;r.1g(n)}7(m=="+")1Q}}d=r;t=E.3g(t.1r(g,""));o=P}}7(t&&!o){7(!t.1f(",")){7(p==d[0])d.4l();2r=E.37(2r,d);r=d=[p];t=" "+t.6e(1,t.M)}N{L k=6u;L m=k.2O(t);7(m){m=[0,m[2],m[3],m[1]]}N{k=6s;m=k.2O(t)}m[2]=m[2].1r(/\\\\/g,"");L f=d[d.M-1];7(m[1]=="#"&&f&&f.5J&&!E.3E(f)){L q=f.5J(m[2]);7((E.14.1d||E.14.2z)&&q&&1o q.2w=="25"&&q.2w!=m[2])q=E(\'[@2w="\'+m[2]+\'"]\',f)[0];d=r=q&&(!m[3]||E.12(q,m[3]))?[q]:[]}N{Q(L i=0;d[i];i++){L a=m[1]=="#"&&m[3]?m[3]:m[1]!=""||m[0]==""?"*":m[2];7(a=="*"&&d[i].12.2h()=="3V")a="3m";r=E.37(r,d[i].3S(a))}7(m[1]==".")r=E.55(r,m[2]);7(m[1]=="#"){L e=[];Q(L i=0;r[i];i++)7(r[i].4z("2w")==m[2]){e=[r[i]];1Q}r=e}d=r}t=t.1r(k,"")}}7(t){L b=E.1E(t,r);d=r=b.r;t=E.3g(b.t)}}7(t)d=[];7(d&&p==d[0])d.4l();2r=E.37(2r,d);K 2r},55:J(r,m,a){m=" "+m+" ";L c=[];Q(L i=0;r[i];i++){L b=(" "+r[i].1t+" ").1f(m)>=0;7(!a&&b||a&&!b)c.1g(r[i])}K c},1E:J(t,r,h){L d;2b(t&&t!=d){d=t;L p=E.6g,m;Q(L i=0;p[i];i++){m=p[i].2O(t);7(m){t=t.7V(m[0].M);m[2]=m[2].1r(/\\\\/g,"");1Q}}7(!m)1Q;7(m[1]==":"&&m[2]=="56")r=G.17(m[3])?E.1E(m[3],r,P).r:E(r).56(m[3]);N 7(m[1]==".")r=E.55(r,m[2],h);N 7(m[1]=="["){L g=[],U=m[3];Q(L i=0,3f=r.M;i<3f;i++){L a=r[i],z=a[E.46[m[2]]||m[2]];7(z==V||/6O|3Q|2p/.17(m[2]))z=E.1J(a,m[2])||\'\';7((U==""&&!!z||U=="="&&z==m[5]||U=="!="&&z!=m[5]||U=="^="&&z&&!z.1f(m[5])||U=="$="&&z.6e(z.M-m[5].M)==m[5]||(U=="*="||U=="~=")&&z.1f(m[5])>=0)^h)g.1g(a)}r=g}N 7(m[1]==":"&&m[2]=="2Z-4p"){L e={},g=[],17=/(-?)(\\d*)n((?:\\+|-)?\\d*)/.2O(m[3]=="6n"&&"2n"||m[3]=="6l"&&"2n+1"||!/\\D/.17(m[3])&&"7U+"+m[3]||m[3]),3j=(17[1]+(17[2]||1))-0,d=17[3]-0;Q(L i=0,3f=r.M;i<3f;i++){L j=r[i],1a=j.1a,2w=E.O(1a);7(!e[2w]){L c=1;Q(L n=1a.1C;n;n=n.2B)7(n.15==1)n.4k=c++;e[2w]=P}L b=S;7(3j==0){7(j.4k==d)b=P}N 7((j.4k-d)%3j==0&&(j.4k-d)/3j>=0)b=P;7(b^h)g.1g(j)}r=g}N{L f=E.6r[m[1]];7(1o f=="3V")f=f[m[2]];7(1o f=="25")f=6c("S||J(a,i){K "+f+";}");r=E.3y(r,J(a,i){K f(a,i,m,r)},h)}}K{r:r,t:t}},4u:J(b,c){L d=[];L a=b[c];2b(a&&a!=T){7(a.15==1)d.1g(a);a=a[c]}K d},2Z:J(a,e,c,b){e=e||1;L d=0;Q(;a;a=a[c])7(a.15==1&&++d==e)1Q;K a},5i:J(n,a){L r=[];Q(;n;n=n.2B){7(n.15==1&&(!a||n!=a))r.1g(n)}K r}});E.16={1b:J(f,i,g,e){7(f.15==3||f.15==8)K;7(E.14.1d&&f.53!=10)f=1e;7(!g.2D)g.2D=6.2D++;7(e!=10){L h=g;g=J(){K h.1i(6,18)};g.O=e;g.2D=h.2D}L j=E.O(f,"2R")||E.O(f,"2R",{}),1v=E.O(f,"1v")||E.O(f,"1v",J(){L a;7(1o E=="10"||E.16.5f)K a;a=E.16.1v.1i(18.3R.Y,18);K a});1v.Y=f;E.R(i.23(/\\s+/),J(c,b){L a=b.23(".");b=a[0];g.U=a[1];L d=j[b];7(!d){d=j[b]={};7(!E.16.2y[b]||E.16.2y[b].4j.1P(f)===S){7(f.3F)f.3F(b,1v,S);N 7(f.6b)f.6b("4i"+b,1v)}}d[g.2D]=g;E.16.2a[b]=P});f=V},2D:1,2a:{},1V:J(e,h,f){7(e.15==3||e.15==8)K;L i=E.O(e,"2R"),29,4X;7(i){7(h==10||(1o h=="25"&&h.7T(0)=="."))Q(L g 1p i)6.1V(e,g+(h||""));N{7(h.U){f=h.2q;h=h.U}E.R(h.23(/\\s+/),J(b,a){L c=a.23(".");a=c[0];7(i[a]){7(f)2V i[a][f.2D];N Q(f 1p i[a])7(!c[1]||i[a][f].U==c[1])2V i[a][f];Q(29 1p i[a])1Q;7(!29){7(!E.16.2y[a]||E.16.2y[a].4h.1P(e)===S){7(e.67)e.67(a,E.O(e,"1v"),S);N 7(e.66)e.66("4i"+a,E.O(e,"1v"))}29=V;2V i[a]}}})}Q(29 1p i)1Q;7(!29){L d=E.O(e,"1v");7(d)d.Y=V;E.35(e,"2R");E.35(e,"1v")}}},1N:J(g,c,d,f,h){c=E.2I(c||[]);7(g.1f("!")>=0){g=g.2K(0,-1);L a=P}7(!d){7(6.2a[g])E("*").1b([1e,T]).1N(g,c)}N{7(d.15==3||d.15==8)K 10;L b,29,1n=E.1q(d[g]||V),16=!c[0]||!c[0].36;7(16)c.4J(6.4Z({U:g,2L:d}));c[0].U=g;7(a)c[0].65=P;7(E.1q(E.O(d,"1v")))b=E.O(d,"1v").1i(d,c);7(!1n&&d["4i"+g]&&d["4i"+g].1i(d,c)===S)b=S;7(16)c.4l();7(h&&E.1q(h)){29=h.1i(d,b==V?c:c.71(b));7(29!==10)b=29}7(1n&&f!==S&&b!==S&&!(E.12(d,\'a\')&&g=="4V")){6.5f=P;1S{d[g]()}1X(e){}}6.5f=S}K b},1v:J(c){L a;c=E.16.4Z(c||1e.16||{});L b=c.U.23(".");c.U=b[0];L f=E.O(6,"2R")&&E.O(6,"2R")[c.U],42=1M.2l.2K.1P(18,1);42.4J(c);Q(L j 1p f){L d=f[j];42[0].2q=d;42[0].O=d.O;7(!b[1]&&!c.65||d.U==b[1]){L e=d.1i(6,42);7(a!==S)a=e;7(e===S){c.36();c.44()}}}7(E.14.1d)c.2L=c.36=c.44=c.2q=c.O=V;K a},4Z:J(c){L a=c;c=E.1s({},a);c.36=J(){7(a.36)a.36();a.7S=S};c.44=J(){7(a.44)a.44();a.7R=P};7(!c.2L)c.2L=c.7Q||T;7(c.2L.15==3)c.2L=a.2L.1a;7(!c.4S&&c.5w)c.4S=c.5w==c.2L?c.7P:c.5w;7(c.64==V&&c.63!=V){L b=T.1F,1h=T.1h;c.64=c.63+(b&&b.2v||1h&&1h.2v||0)-(b.62||0);c.7N=c.7L+(b&&b.2x||1h&&1h.2x||0)-(b.60||0)}7(!c.3c&&((c.4f||c.4f===0)?c.4f:c.5Z))c.3c=c.4f||c.5Z;7(!c.7b&&c.5Y)c.7b=c.5Y;7(!c.3c&&c.2G)c.3c=(c.2G&1?1:(c.2G&2?3:(c.2G&4?2:0)));K c},2y:{21:{4j:J(){5M();K},4h:J(){K}},3C:{4j:J(){7(E.14.1d)K S;E(6).2j("4P",E.16.2y.3C.2q);K P},4h:J(){7(E.14.1d)K S;E(6).3w("4P",E.16.2y.3C.2q);K P},2q:J(a){7(I(a,6))K P;18[0].U="3C";K E.16.1v.1i(6,18)}},3B:{4j:J(){7(E.14.1d)K S;E(6).2j("4O",E.16.2y.3B.2q);K P},4h:J(){7(E.14.1d)K S;E(6).3w("4O",E.16.2y.3B.2q);K P},2q:J(a){7(I(a,6))K P;18[0].U="3B";K E.16.1v.1i(6,18)}}}};E.1n.1s({2j:J(c,a,b){K c=="4H"?6.2X(c,a,b):6.R(J(){E.16.1b(6,c,b||a,b&&a)})},2X:J(d,b,c){K 6.R(J(){E.16.1b(6,d,J(a){E(6).3w(a);K(c||b).1i(6,18)},c&&b)})},3w:J(a,b){K 6.R(J(){E.16.1V(6,a,b)})},1N:J(c,a,b){K 6.R(J(){E.16.1N(c,a,6,P,b)})},5n:J(c,a,b){7(6[0])K E.16.1N(c,a,6[0],S,b);K 10},2g:J(){L b=18;K 6.4V(J(a){6.4N=0==6.4N?1:0;a.36();K b[6.4N].1i(6,18)||S})},7D:J(a,b){K 6.2j(\'3C\',a).2j(\'3B\',b)},21:J(a){5M();7(E.2Q)a.1P(T,E);N E.3A.1g(J(){K a.1P(6,E)});K 6}});E.1s({2Q:S,3A:[],21:J(){7(!E.2Q){E.2Q=P;7(E.3A){E.R(E.3A,J(){6.1i(T)});E.3A=V}E(T).5n("21")}}});L x=S;J 5M(){7(x)K;x=P;7(T.3F&&!E.14.2z)T.3F("5W",E.21,S);7(E.14.1d&&1e==3b)(J(){7(E.2Q)K;1S{T.1F.7B("26")}1X(3a){3z(18.3R,0);K}E.21()})();7(E.14.2z)T.3F("5W",J(){7(E.2Q)K;Q(L i=0;i=0){L i=g.2K(e,g.M);g=g.2K(0,e)}c=c||J(){};L f="4Q";7(d)7(E.1q(d)){c=d;d=V}N{d=E.3m(d);f="61"}L h=6;E.3P({1c:g,U:f,1H:"3q",O:d,1y:J(a,b){7(b=="1W"||b=="5U")h.3q(i?E("<1x/>").3t(a.4b.1r(/<1m(.|\\s)*?\\/1m>/g,"")).2s(i):a.4b);h.R(c,[a.4b,b,a])}});K 6},7n:J(){K E.3m(6.5T())},5T:J(){K 6.2c(J(){K E.12(6,"3u")?E.2I(6.7m):6}).1E(J(){K 6.31&&!6.2Y&&(6.3k||/2k|6h/i.17(6.12)||/1u|1Z|3I/i.17(6.U))}).2c(J(i,c){L b=E(6).5O();K b==V?V:b.1k==1M?E.2c(b,J(a,i){K{31:c.31,1A:a}}):{31:c.31,1A:b}}).22()}});E.R("5S,6d,5R,6D,5Q,6m".23(","),J(i,o){E.1n[o]=J(f){K 6.2j(o,f)}});L B=(1B 3v).3L();E.1s({22:J(d,b,a,c){7(E.1q(b)){a=b;b=V}K E.3P({U:"4Q",1c:d,O:b,1W:a,1H:c})},7l:J(b,a){K E.22(b,V,a,"1m")},7k:J(c,b,a){K E.22(c,b,a,"3i")},7i:J(d,b,a,c){7(E.1q(b)){a=b;b={}}K E.3P({U:"61",1c:d,O:b,1W:a,1H:c})},85:J(a){E.1s(E.4I,a)},4I:{2a:P,U:"4Q",2U:0,5P:"4o/x-7h-3u-7g",5N:P,3l:P,O:V,6p:V,3I:V,49:{3M:"4o/3M, 1u/3M",3q:"1u/3q",1m:"1u/4m, 4o/4m",3i:"4o/3i, 1u/4m",1u:"1u/a7",4G:"*/*"}},4F:{},3P:J(s){L f,2W=/=\\?(&|$)/g,1z,O;s=E.1s(P,s,E.1s(P,{},E.4I,s));7(s.O&&s.5N&&1o s.O!="25")s.O=E.3m(s.O);7(s.1H=="4E"){7(s.U.2h()=="22"){7(!s.1c.1D(2W))s.1c+=(s.1c.1D(/\\?/)?"&":"?")+(s.4E||"7d")+"=?"}N 7(!s.O||!s.O.1D(2W))s.O=(s.O?s.O+"&":"")+(s.4E||"7d")+"=?";s.1H="3i"}7(s.1H=="3i"&&(s.O&&s.O.1D(2W)||s.1c.1D(2W))){f="4E"+B++;7(s.O)s.O=(s.O+"").1r(2W,"="+f+"$1");s.1c=s.1c.1r(2W,"="+f+"$1");s.1H="1m";1e[f]=J(a){O=a;1W();1y();1e[f]=10;1S{2V 1e[f]}1X(e){}7(h)h.34(g)}}7(s.1H=="1m"&&s.1T==V)s.1T=S;7(s.1T===S&&s.U.2h()=="22"){L i=(1B 3v()).3L();L j=s.1c.1r(/(\\?|&)4r=.*?(&|$)/,"$a4="+i+"$2");s.1c=j+((j==s.1c)?(s.1c.1D(/\\?/)?"&":"?")+"4r="+i:"")}7(s.O&&s.U.2h()=="22"){s.1c+=(s.1c.1D(/\\?/)?"&":"?")+s.O;s.O=V}7(s.2a&&!E.5H++)E.16.1N("5S");7((!s.1c.1f("a3")||!s.1c.1f("//"))&&s.1H=="1m"&&s.U.2h()=="22"){L h=T.3S("6f")[0];L g=T.3s("1m");g.3Q=s.1c;7(s.7c)g.a2=s.7c;7(!f){L l=S;g.9Z=g.9Y=J(){7(!l&&(!6.39||6.39=="5V"||6.39=="1y")){l=P;1W();1y();h.34(g)}}}h.38(g);K 10}L m=S;L k=1e.78?1B 78("9X.9V"):1B 76();k.9T(s.U,s.1c,s.3l,s.6p,s.3I);1S{7(s.O)k.4C("9R-9Q",s.5P);7(s.5C)k.4C("9O-5A-9N",E.4F[s.1c]||"9L, 9K 9I 9H 5z:5z:5z 9F");k.4C("X-9C-9A","76");k.4C("9z",s.1H&&s.49[s.1H]?s.49[s.1H]+", */*":s.49.4G)}1X(e){}7(s.6Y)s.6Y(k);7(s.2a)E.16.1N("6m",[k,s]);L c=J(a){7(!m&&k&&(k.39==4||a=="2U")){m=P;7(d){6I(d);d=V}1z=a=="2U"&&"2U"||!E.6X(k)&&"3a"||s.5C&&E.6J(k,s.1c)&&"5U"||"1W";7(1z=="1W"){1S{O=E.6W(k,s.1H)}1X(e){1z="5x"}}7(1z=="1W"){L b;1S{b=k.5q("6U-5A")}1X(e){}7(s.5C&&b)E.4F[s.1c]=b;7(!f)1W()}N E.5v(s,k,1z);1y();7(s.3l)k=V}};7(s.3l){L d=53(c,13);7(s.2U>0)3z(J(){7(k){k.9t();7(!m)c("2U")}},s.2U)}1S{k.9s(s.O)}1X(e){E.5v(s,k,V,e)}7(!s.3l)c();J 1W(){7(s.1W)s.1W(O,1z);7(s.2a)E.16.1N("5Q",[k,s])}J 1y(){7(s.1y)s.1y(k,1z);7(s.2a)E.16.1N("5R",[k,s]);7(s.2a&&!--E.5H)E.16.1N("6d")}K k},5v:J(s,a,b,e){7(s.3a)s.3a(a,b,e);7(s.2a)E.16.1N("6D",[a,s,e])},5H:0,6X:J(r){1S{K!r.1z&&9q.9p=="59:"||(r.1z>=6T&&r.1z<9n)||r.1z==6R||r.1z==9l||E.14.2d&&r.1z==10}1X(e){}K S},6J:J(a,c){1S{L b=a.5q("6U-5A");K a.1z==6R||b==E.4F[c]||E.14.2d&&a.1z==10}1X(e){}K S},6W:J(r,b){L c=r.5q("9k-U");L d=b=="3M"||!b&&c&&c.1f("3M")>=0;L a=d?r.9j:r.4b;7(d&&a.1F.28=="5x")6Q"5x";7(b=="1m")E.5g(a);7(b=="3i")a=6c("("+a+")");K a},3m:J(a){L s=[];7(a.1k==1M||a.5h)E.R(a,J(){s.1g(3r(6.31)+"="+3r(6.1A))});N Q(L j 1p a)7(a[j]&&a[j].1k==1M)E.R(a[j],J(){s.1g(3r(j)+"="+3r(6))});N s.1g(3r(j)+"="+3r(a[j]));K s.6a("&").1r(/%20/g,"+")}});E.1n.1s({1G:J(c,b){K c?6.2e({1R:"1G",27:"1G",1w:"1G"},c,b):6.1E(":1Z").R(J(){6.W.19=6.5s||"";7(E.1j(6,"19")=="2H"){L a=E("<"+6.28+" />").6y("1h");6.W.19=a.1j("19");7(6.W.19=="2H")6.W.19="3D";a.1V()}}).3h()},1I:J(b,a){K b?6.2e({1R:"1I",27:"1I",1w:"1I"},b,a):6.1E(":4d").R(J(){6.5s=6.5s||E.1j(6,"19");6.W.19="2H"}).3h()},6N:E.1n.2g,2g:J(a,b){K E.1q(a)&&E.1q(b)?6.6N(a,b):a?6.2e({1R:"2g",27:"2g",1w:"2g"},a,b):6.R(J(){E(6)[E(6).3H(":1Z")?"1G":"1I"]()})},9f:J(b,a){K 6.2e({1R:"1G"},b,a)},9d:J(b,a){K 6.2e({1R:"1I"},b,a)},9c:J(b,a){K 6.2e({1R:"2g"},b,a)},9a:J(b,a){K 6.2e({1w:"1G"},b,a)},99:J(b,a){K 6.2e({1w:"1I"},b,a)},97:J(c,a,b){K 6.2e({1w:a},c,b)},2e:J(l,k,j,h){L i=E.6P(k,j,h);K 6[i.2P===S?"R":"2P"](J(){7(6.15!=1)K S;L g=E.1s({},i);L f=E(6).3H(":1Z"),4A=6;Q(L p 1p l){7(l[p]=="1I"&&f||l[p]=="1G"&&!f)K E.1q(g.1y)&&g.1y.1i(6);7(p=="1R"||p=="27"){g.19=E.1j(6,"19");g.32=6.W.32}}7(g.32!=V)6.W.32="1Z";g.40=E.1s({},l);E.R(l,J(c,a){L e=1B E.2t(4A,g,c);7(/2g|1G|1I/.17(a))e[a=="2g"?f?"1G":"1I":a](l);N{L b=a.3X().1D(/^([+-]=)?([\\d+-.]+)(.*)$/),1Y=e.2m(P)||0;7(b){L d=2M(b[2]),2A=b[3]||"2S";7(2A!="2S"){4A.W[c]=(d||1)+2A;1Y=((d||1)/e.2m(P))*1Y;4A.W[c]=1Y+2A}7(b[1])d=((b[1]=="-="?-1:1)*d)+1Y;e.45(1Y,d,2A)}N e.45(1Y,a,"")}});K P})},2P:J(a,b){7(E.1q(a)||(a&&a.1k==1M)){b=a;a="2t"}7(!a||(1o a=="25"&&!b))K A(6[0],a);K 6.R(J(){7(b.1k==1M)A(6,a,b);N{A(6,a).1g(b);7(A(6,a).M==1)b.1i(6)}})},94:J(b,c){L a=E.3G;7(b)6.2P([]);6.R(J(){Q(L i=a.M-1;i>=0;i--)7(a[i].Y==6){7(c)a[i](P);a.72(i,1)}});7(!c)6.5p();K 6}});L A=J(b,c,a){7(!b)K 10;c=c||"2t";L q=E.O(b,c+"2P");7(!q||a)q=E.O(b,c+"2P",a?E.2I(a):[]);K q};E.1n.5p=J(a){a=a||"2t";K 6.R(J(){L q=A(6,a);q.4l();7(q.M)q[0].1i(6)})};E.1s({6P:J(b,a,c){L d=b&&b.1k==92?b:{1y:c||!c&&a||E.1q(b)&&b,2u:b,3Z:c&&a||a&&a.1k!=91&&a};d.2u=(d.2u&&d.2u.1k==51?d.2u:{90:8Z,9D:6T}[d.2u])||8X;d.5y=d.1y;d.1y=J(){7(d.2P!==S)E(6).5p();7(E.1q(d.5y))d.5y.1i(6)};K d},3Z:{70:J(p,n,b,a){K b+a*p},5j:J(p,n,b,a){K((-24.8V(p*24.8U)/2)+0.5)*a+b}},3G:[],3W:V,2t:J(b,c,a){6.11=c;6.Y=b;6.1l=a;7(!c.47)c.47={}}});E.2t.2l={4y:J(){7(6.11.30)6.11.30.1i(6.Y,[6.2J,6]);(E.2t.30[6.1l]||E.2t.30.4G)(6);7(6.1l=="1R"||6.1l=="27")6.Y.W.19="3D"},2m:J(a){7(6.Y[6.1l]!=V&&6.Y.W[6.1l]==V)K 6.Y[6.1l];L r=2M(E.1j(6.Y,6.1l,a));K r&&r>-8Q?r:2M(E.2o(6.Y,6.1l))||0},45:J(c,b,d){6.5B=(1B 3v()).3L();6.1Y=c;6.3h=b;6.2A=d||6.2A||"2S";6.2J=6.1Y;6.4B=6.4w=0;6.4y();L e=6;J t(a){K e.30(a)}t.Y=6.Y;E.3G.1g(t);7(E.3W==V){E.3W=53(J(){L a=E.3G;Q(L i=0;i6.11.2u+6.5B){6.2J=6.3h;6.4B=6.4w=1;6.4y();6.11.40[6.1l]=P;L b=P;Q(L i 1p 6.11.40)7(6.11.40[i]!==P)b=S;7(b){7(6.11.19!=V){6.Y.W.32=6.11.32;6.Y.W.19=6.11.19;7(E.1j(6.Y,"19")=="2H")6.Y.W.19="3D"}7(6.11.1I)6.Y.W.19="2H";7(6.11.1I||6.11.1G)Q(L p 1p 6.11.40)E.1J(6.Y.W,p,6.11.47[p])}7(b&&E.1q(6.11.1y))6.11.1y.1i(6.Y);K S}N{L n=t-6.5B;6.4w=n/6.11.2u;6.4B=E.3Z[6.11.3Z||(E.3Z.5j?"5j":"70")](6.4w,n,0,1,6.11.2u);6.2J=6.1Y+((6.3h-6.1Y)*6.4B);6.4y()}K P}};E.2t.30={2v:J(a){a.Y.2v=a.2J},2x:J(a){a.Y.2x=a.2J},1w:J(a){E.1J(a.Y.W,"1w",a.2J)},4G:J(a){a.Y.W[a.1l]=a.2J+a.2A}};E.1n.5L=J(){L b=0,3b=0,Y=6[0],5l;7(Y)8M(E.14){L d=Y.1a,41=Y,1K=Y.1K,1L=Y.2i,5D=2d&&4s(5K)<8J&&!/a1/i.17(v),2T=E.1j(Y,"43")=="2T";7(Y.6G){L c=Y.6G();1b(c.26+24.2f(1L.1F.2v,1L.1h.2v),c.3b+24.2f(1L.1F.2x,1L.1h.2x));1b(-1L.1F.62,-1L.1F.60)}N{1b(Y.5G,Y.5F);2b(1K){1b(1K.5G,1K.5F);7(48&&!/^t(8H|d|h)$/i.17(1K.28)||2d&&!5D)2N(1K);7(!2T&&E.1j(1K,"43")=="2T")2T=P;41=/^1h$/i.17(1K.28)?41:1K;1K=1K.1K}2b(d&&d.28&&!/^1h|3q$/i.17(d.28)){7(!/^8G|1O.*$/i.17(E.1j(d,"19")))1b(-d.2v,-d.2x);7(48&&E.1j(d,"32")!="4d")2N(d);d=d.1a}7((5D&&(2T||E.1j(41,"43")=="4W"))||(48&&E.1j(41,"43")!="4W"))1b(-1L.1h.5G,-1L.1h.5F);7(2T)1b(24.2f(1L.1F.2v,1L.1h.2v),24.2f(1L.1F.2x,1L.1h.2x))}5l={3b:3b,26:b}}J 2N(a){1b(E.2o(a,"a8",P),E.2o(a,"a9",P))}J 1b(l,t){b+=4s(l)||0;3b+=4s(t)||0}K 5l}})();',62,631,'||||||this|if||||||||||||||||||||||||||||||||||||||function|return|var|length|else|data|true|for|each|false|document|type|null|style||elem||undefined|options|nodeName||browser|nodeType|event|test|arguments|display|parentNode|add|url|msie|window|indexOf|push|body|apply|css|constructor|prop|script|fn|typeof|in|isFunction|replace|extend|className|text|handle|opacity|div|complete|status|value|new|firstChild|match|filter|documentElement|show|dataType|hide|attr|offsetParent|doc|Array|trigger|table|call|break|height|try|cache|tbody|remove|success|catch|start|hidden||ready|get|split|Math|string|left|width|tagName|ret|global|while|map|safari|animate|max|toggle|toLowerCase|ownerDocument|bind|select|prototype|cur||curCSS|selected|handler|done|find|fx|duration|scrollLeft|id|scrollTop|special|opera|unit|nextSibling|stack|guid|toUpperCase|pushStack|button|none|makeArray|now|slice|target|parseFloat|border|exec|queue|isReady|events|px|fixed|timeout|delete|jsre|one|disabled|nth|step|name|overflow|inArray|removeChild|removeData|preventDefault|merge|appendChild|readyState|error|top|which|innerHTML|multiFilter|rl|trim|end|json|first|checked|async|param|elems|insertBefore|childNodes|html|encodeURIComponent|createElement|append|form|Date|unbind|color|grep|setTimeout|readyList|mouseleave|mouseenter|block|isXMLDoc|addEventListener|timers|is|password|last|runtimeStyle|getTime|xml|jQuery|domManip|ajax|src|callee|getElementsByTagName|selectedIndex|load|object|timerId|toString|has|easing|curAnim|offsetChild|args|position|stopPropagation|custom|props|orig|mozilla|accepts|clean|responseText|defaultView|visible|String|charCode|float|teardown|on|setup|nodeIndex|shift|javascript|currentStyle|application|child|RegExp|_|parseInt|previousSibling|dir|tr|state|empty|update|getAttribute|self|pos|setRequestHeader|input|jsonp|lastModified|_default|unload|ajaxSettings|unshift|getComputedStyle|styleSheets|getPropertyValue|lastToggle|mouseout|mouseover|GET|andSelf|relatedTarget|init|visibility|click|absolute|index|container|fix|outline|Number|removeAttribute|setInterval|prevObject|classFilter|not|unique|submit|file|after|windowData|deep|scroll|client|triggered|globalEval|jquery|sibling|swing|clone|results|wrapAll|triggerHandler|lastChild|dequeue|getResponseHeader|createTextNode|oldblock|checkbox|radio|handleError|fromElement|parsererror|old|00|Modified|startTime|ifModified|safari2|getWH|offsetTop|offsetLeft|active|values|getElementById|version|offset|bindReady|processData|val|contentType|ajaxSuccess|ajaxComplete|ajaxStart|serializeArray|notmodified|loaded|DOMContentLoaded|Width|ctrlKey|keyCode|clientTop|POST|clientLeft|clientX|pageX|exclusive|detachEvent|removeEventListener|swap|cloneNode|join|attachEvent|eval|ajaxStop|substr|head|parse|textarea|reset|image|zoom|odd|ajaxSend|even|before|username|prepend|expr|quickClass|uuid|quickID|quickChild|continue|textContent|appendTo|contents|evalScript|parent|defaultValue|ajaxError|setArray|compatMode|getBoundingClientRect|styleFloat|clearInterval|httpNotModified|nodeValue|100|alpha|_toggle|href|speed|throw|304|replaceWith|200|Last|colgroup|httpData|httpSuccess|beforeSend|eq|linear|concat|splice|fieldset|multiple|cssFloat|XMLHttpRequest|webkit|ActiveXObject|CSS1Compat|link|metaKey|scriptCharset|callback|col|pixelLeft|urlencoded|www|post|hasClass|getJSON|getScript|elements|serialize|black|keyup|keypress|solid|change|mousemove|mouseup|dblclick|resize|focus|blur|stylesheet|rel|doScroll|round|hover|padding|offsetHeight|mousedown|offsetWidth|Bottom|Top|keydown|clientY|Right|pageY|Left|toElement|srcElement|cancelBubble|returnValue|charAt|0n|substring|animated|header|noConflict|line|enabled|innerText|contains|only|weight|ajaxSetup|font|size|gt|lt|uFFFF|u0128|417|Boolean|inner|Height|toggleClass|removeClass|addClass|removeAttr|replaceAll|insertAfter|prependTo|contentWindow|contentDocument|wrap|iframe|children|siblings|prevAll|nextAll|prev|wrapInner|next|parents|maxLength|maxlength|readOnly|readonly|reverse|class|htmlFor|inline|able|boxModel|522|setData|compatible|with|1px|ie|getData|10000|ra|it|rv|PI|cos|userAgent|400|navigator|600|slow|Function|Object|array|stop|ig|NaN|fadeTo|option|fadeOut|fadeIn|setAttribute|slideToggle|slideUp|changed|slideDown|be|can|property|responseXML|content|1223|getAttributeNode|300|method|protocol|location|action|send|abort|cssText|th|td|cap|specified|Accept|With|colg|Requested|fast|tfoot|GMT|thead|1970|Jan|attributes|01|Thu|leg|Since|If|opt|Type|Content|embed|open|area|XMLHTTP|hr|Microsoft|onreadystatechange|onload|meta|adobeair|charset|http|1_|img|br|plain|borderLeftWidth|borderTopWidth|abbr'.split('|'),0,{})) \ No newline at end of file diff --git a/vendor/sunra/php-simple-html-dom-parser/Src/Sunra/PhpSimple/simplehtmldom_1_5/manual/js/.svn/text-base/ui.tabs.pack.js.svn-base b/vendor/sunra/php-simple-html-dom-parser/Src/Sunra/PhpSimple/simplehtmldom_1_5/manual/js/.svn/text-base/ui.tabs.pack.js.svn-base new file mode 100644 index 000000000..cfc226ada --- /dev/null +++ b/vendor/sunra/php-simple-html-dom-parser/Src/Sunra/PhpSimple/simplehtmldom_1_5/manual/js/.svn/text-base/ui.tabs.pack.js.svn-base @@ -0,0 +1,10 @@ +/* + * Tabs 3 - New Wave Tabs + * + * Copyright (c) 2007 Klaus Hartl (stilbuero.de) + * Dual licensed under the MIT (MIT-LICENSE.txt) + * and GPL (GPL-LICENSE.txt) licenses. + * + * http://docs.jquery.com/UI/Tabs + */ +eval(function(p,a,c,k,e,r){e=function(c){return(c35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)r[e(c)]=k[c]||e(c);k=[function(e){return r[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('(6($){$.4=$.4||{};$.2o.3=6(){7 b=1K 1q[0]==\'1X\'&&1q[0];7 c=b&&1P.1N.2g.2c(1q,1)||1q;l b==\'C\'?$.m(2[0],\'4-3\').$3.C:2.I(6(){5(b){7 a=$.m(2,\'4-3\');a[b].2n(a,c)}D 2l $.4.3(2,c[0]||{})})};$.4.3=6(e,f){7 d=2;2.q=e;2.8=$.1H({p:0,S:f.p===L,12:\'1A\',t:[],G:L,1l:\'2Bx;\',K:y,1R:\'4-3-\',1j:{},X:L,1Q:\'<1h>#{1g}\',1v:\'<1L>\',1f:\'4-3-2f\',w:\'4-3-p\',1t:\'4-3-S\',Q:\'4-3-t\',U:\'4-3-1e\',M:\'4-3-Y\',1s:\'4-3-2Y\'},f);5(f.p===L)2.8.p=L;2.8.12+=\'.4-3\';2.8.G=$.G&&$.G.28==2V&&2.8.G;$(e).1b(\'2T.4-3\',6(b,c,a){5((/^p/).27(c))d.1o(a);D{d.8[c]=a;d.11()}}).1b(\'2Q.4-3\',6(a,b){l d.8[b]});$.m(e,\'4-3\',2);2.11(1a)};$.1H($.4.3.1N,{1z:6(a){l a.22&&a.22.V(/\\s/g,\'1Z\').V(/[^A-2A-2y-9\\-1Z:\\.]/g,\'\')||2.8.1R+$.m(a)},4:6(a,b){l{2w:2,8:2.8,2v:a,1e:b}},11:6(f){2.$u=$(\'E:2s(a[x])\',2.q);2.$3=2.$u.1i(6(){l $(\'a\',2)[0]});2.$k=$([]);7 e=2,o=2.8;2.$3.I(6(i,a){5(a.H&&a.H.V(\'#\',\'\'))e.$k=e.$k.17(a.H);D 5($(a).W(\'x\')!=\'#\'){$.m(a,\'x.4-3\',a.x);$.m(a,\'z.4-3\',a.x);7 b=e.1z(a);a.x=\'#\'+b;7 c=$(\'#\'+b);5(!c.C){c=$(o.1v).W(\'16\',b).v(o.U).2m(e.$k[i-1]||e.q);c.m(\'15.4-3\',1a)}e.$k=e.$k.17(c)}D o.t.1O(i+1)});5(f){$(2.q).J(o.1f)||$(2.q).v(o.1f);2.$k.I(6(){7 a=$(2);a.J(o.U)||a.v(o.U)});2.$3.I(6(i,a){5(1w.H){5(a.H==1w.H){o.p=i;5($.O.14||$.O.2k){7 b=$(1w.H),1M=b.W(\'16\');b.W(\'16\',\'\');1u(6(){b.W(\'16\',1M)},2j)}2i(0,0);l y}}D 5(o.G){7 c=2h($.G(\'4-3\'+$.m(e.q)),10);5(c&&e.$3[c]){o.p=c;l y}}D 5(e.$u.F(i).J(o.w)){o.p=i;l y}});2.$k.v(o.M);2.$u.B(o.w);5(!o.S){2.$k.F(o.p).N().B(o.M);2.$u.F(o.p).v(o.w)}7 h=!o.S&&$.m(2.$3[o.p],\'z.4-3\');5(h)2.z(o.p);o.t=$.2e(o.t.2d($.1i(2.$u.T(\'.\'+o.Q),6(n,i){l e.$u.Z(n)}))).1J();$(2b).1b(\'2a\',6(){e.$3.1d(\'.4-3\');e.$u=e.$3=e.$k=L})}29(7 i=0,E;E=2.$u[i];i++)$(E)[$.1I(i,o.t)!=-1&&!$(E).J(o.w)?\'v\':\'B\'](o.Q);5(o.K===y)2.$3.1r(\'K.4-3\');7 j,R,1c={\'2X-2W\':0,1G:1},1F=\'2U\';5(o.X&&o.X.28==1P)j=o.X[0]||1c,R=o.X[1]||1c;D j=R=o.X||1c;7 g={1p:\'\',2S:\'\',2R:\'\'};5(!$.O.14)g.1E=\'\';6 1D(b,c,a){c.26(j,j.1G||1F,6(){c.v(o.M).13(g);5($.O.14&&j.1E)c[0].24.T=\'\';5(a)1C(b,a,c)})}6 1C(b,a,c){5(R===1c)a.13(\'1p\',\'1B\');a.26(R,R.1G||1F,6(){a.B(o.M).13(g);5($.O.14&&R.1E)a[0].24.T=\'\';$(e.q).P(\'N.4-3\',[e.4(b,a[0])])})}6 23(c,a,d,b){a.v(o.w).2P().B(o.w);1D(c,d,b)}2.$3.1d(\'.4-3\').1b(o.12,6(){7 b=$(2).2O(\'E:F(0)\'),$Y=e.$k.T(\':2N\'),$N=$(2.H);5((b.J(o.w)&&!o.S)||b.J(o.Q)||$(e.q).P(\'1o.4-3\',[e.4(2,$N[0])])===y){2.1k();l y}e.8.p=e.$3.Z(2);5(o.S){5(b.J(o.w)){e.8.p=L;b.B(o.w);e.$k.1y();1D(2,$Y);2.1k();l y}D 5(!$Y.C){e.$k.1y();7 a=2;e.z(e.$3.Z(2),6(){b.v(o.w).v(o.1t);1C(a,$N)});2.1k();l y}}5(o.G)$.G(\'4-3\'+$.m(e.q),e.8.p,o.G);e.$k.1y();5($N.C){7 a=2;e.z(e.$3.Z(2),6(){23(a,b,$Y,$N)})}D 2M\'21 2K 2J: 2H 2G 2F.\';5($.O.14)2.1k();l y});5(!(/^1A/).27(o.12))2.$3.1b(\'1A.4-3\',6(){l y})},17:6(d,e,f){5(f==1Y)f=2.$3.C;7 o=2.8;7 a=$(o.1Q.V(/#\\{x\\}/,d).V(/#\\{1g\\}/,e));a.m(\'15.4-3\',1a);7 b=d.2D(\'#\')==0?d.V(\'#\',\'\'):2.1z($(\'a:2C-2z\',a)[0]);7 c=$(\'#\'+b);5(!c.C){c=$(o.1v).W(\'16\',b).v(o.U).v(o.M);c.m(\'15.4-3\',1a)}5(f>=2.$u.C){a.1W(2.q);c.1W(2.q.2E)}D{a.1V(2.$u[f]);c.1V(2.$k[f])}o.t=$.1i(o.t,6(n,i){l n>=f?++n:n});2.11();5(2.$3.C==1){a.v(o.w);c.B(o.M);7 g=$.m(2.$3[0],\'z.4-3\');5(g)2.z(f,g)}$(2.q).P(\'17.4-3\',[2.4(2.$3[f],2.$k[f])])},19:6(a){7 o=2.8,$E=2.$u.F(a).19(),$1e=2.$k.F(a).19();5($E.J(o.w)&&2.$3.C>1)2.1o(a+(a+1<2.$3.C?1:-1));o.t=$.1i($.1U(o.t,6(n,i){l n!=a}),6(n,i){l n>=a?--n:n});2.11();$(2.q).P(\'19.4-3\',[2.4($E.2I(\'a\')[0],$1e[0])])},25:6(a){7 o=2.8;5($.1I(a,o.t)==-1)l;7 b=2.$u.F(a).B(o.Q);5($.O.2u){b.13(\'1p\',\'2L-1B\');1u(6(){b.13(\'1p\',\'1B\')},0)}o.t=$.1U(o.t,6(n,i){l n!=a});$(2.q).P(\'25.4-3\',[2.4(2.$3[a],2.$k[a])])},20:6(a){7 b=2,o=2.8;5(a!=o.p){2.$u.F(a).v(o.Q);o.t.1O(a);o.t.1J();$(2.q).P(\'20.4-3\',[2.4(2.$3[a],2.$k[a])])}},1o:6(a){5(1K a==\'1X\')a=2.$3.Z(2.$3.T(\'[x$=\'+a+\']\')[0]);2.$3.F(a).2t(2.8.12)},z:6(d,b){7 e=2,o=2.8,$a=2.$3.F(d),a=$a[0],1T=b==1Y|| b===y,18=$a.m(\'z.4-3\');b=b|| 6(){};5(!18|| ($.m(a,\'K.4-3\')&&!1T)){b();l}5(o.1l){7 g=$(\'1h\',a),1g=g.1n();g.1n(\'<1S>\'+o.1l+\'\')}7 c=6(){e.$3.T(\'.\'+o.1s).I(6(){$(2).B(o.1s);5(o.1l)$(\'1h\',2).1n(1g)});e.1m=L};7 f=$.1H({},o.1j,{18:18,1x:6(r,s){$(a.H).1n(r);c();b();5(o.K)$.m(a,\'K.4-3\',1a);$(e.q).P(\'z.4-3\',[e.4(e.$3[d],e.$k[d])]);o.1j.1x&&o.1j.1x(r,s)}});5(2.1m){2.1m.2r();c()}$a.v(o.1s);1u(6(){e.1m=$.2q(f)},0)},18:6(a,b){2.$3.F(a).1r(\'K.4-3\').m(\'z.4-3\',b)},15:6(){7 o=2.8;$(2.q).1d(\'.4-3\').B(o.1f).1r(\'4-3\');2.$3.I(6(){7 b=$.m(2,\'x.4-3\');5(b)2.x=b;7 c=$(2).1d(\'.4-3\');$.I([\'x\',\'z\',\'K\'],6(i,a){c.1r(a+\'.4-3\')})});2.$u.17(2.$k).I(6(){5($.m(2,\'15.4-3\'))$(2).19();D $(2).B([o.w,o.1t,o.Q,o.U,o.M].2p(\' \'))})}})})(21);',62,185,'||this|tabs|ui|if|function|var|options||||||||||||panels|return|data|||selected|element|||disabled|lis|addClass|selectedClass|href|false|load||removeClass|length|else|li|eq|cookie|hash|each|hasClass|cache|null|hideClass|show|browser|triggerHandler|disabledClass|showFx|unselect|filter|panelClass|replace|attr|fx|hide|index||tabify|event|css|msie|destroy|id|add|url|remove|true|bind|baseFx|unbind|panel|navClass|label|span|map|ajaxOptions|blur|spinner|xhr|html|select|display|arguments|removeData|loadingClass|unselectClass|setTimeout|panelTemplate|location|success|stop|tabId|click|block|showTab|hideTab|opacity|baseDuration|duration|extend|inArray|sort|typeof|div|toShowId|prototype|push|Array|tabTemplate|idPrefix|em|bypassCache|grep|insertBefore|appendTo|string|undefined|_|disable|jQuery|title|switchTab|style|enable|animate|test|constructor|for|unload|window|call|concat|unique|nav|slice|parseInt|scrollTo|500|opera|new|insertAfter|apply|fn|join|ajax|abort|has|trigger|safari|tab|instance|8230|z0|child|Za|Loading|first|indexOf|parentNode|identifier|fragment|Mismatching|find|Tabs|UI|inline|throw|visible|parents|siblings|getData|height|overflow|setData|normal|Function|width|min|loading'.split('|'),0,{})) \ No newline at end of file diff --git a/vendor/sunra/php-simple-html-dom-parser/Src/Sunra/PhpSimple/simplehtmldom_1_5/manual/js/jquery-1.2.3.pack.js b/vendor/sunra/php-simple-html-dom-parser/Src/Sunra/PhpSimple/simplehtmldom_1_5/manual/js/jquery-1.2.3.pack.js new file mode 100644 index 000000000..74cdfee17 --- /dev/null +++ b/vendor/sunra/php-simple-html-dom-parser/Src/Sunra/PhpSimple/simplehtmldom_1_5/manual/js/jquery-1.2.3.pack.js @@ -0,0 +1,11 @@ +/* + * jQuery 1.2.3 - New Wave Javascript + * + * Copyright (c) 2008 John Resig (jquery.com) + * Dual licensed under the MIT (MIT-LICENSE.txt) + * and GPL (GPL-LICENSE.txt) licenses. + * + * $Date: 2008-02-06 00:21:25 -0500 (Wed, 06 Feb 2008) $ + * $Rev: 4663 $ + */ +eval(function(p,a,c,k,e,r){e=function(c){return(c35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)r[e(c)]=k[c]||e(c);k=[function(e){return r[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('(J(){7(1e.3N)L w=1e.3N;L E=1e.3N=J(a,b){K 1B E.2l.4T(a,b)};7(1e.$)L D=1e.$;1e.$=E;L u=/^[^<]*(<(.|\\s)+>)[^>]*$|^#(\\w+)$/;L G=/^.[^:#\\[\\.]*$/;E.1n=E.2l={4T:J(d,b){d=d||T;7(d.15){6[0]=d;6.M=1;K 6}N 7(1o d=="25"){L c=u.2O(d);7(c&&(c[1]||!b)){7(c[1])d=E.4a([c[1]],b);N{L a=T.5J(c[3]);7(a)7(a.2w!=c[3])K E().2s(d);N{6[0]=a;6.M=1;K 6}N d=[]}}N K 1B E(b).2s(d)}N 7(E.1q(d))K 1B E(T)[E.1n.21?"21":"3U"](d);K 6.6E(d.1k==1M&&d||(d.5h||d.M&&d!=1e&&!d.15&&d[0]!=10&&d[0].15)&&E.2I(d)||[d])},5h:"1.2.3",87:J(){K 6.M},M:0,22:J(a){K a==10?E.2I(6):6[a]},2F:J(b){L a=E(b);a.54=6;K a},6E:J(a){6.M=0;1M.2l.1g.1i(6,a);K 6},R:J(a,b){K E.R(6,a,b)},4X:J(b){L a=-1;6.R(J(i){7(6==b)a=i});K a},1J:J(c,a,b){L d=c;7(c.1k==4e)7(a==10)K 6.M&&E[b||"1J"](6[0],c)||10;N{d={};d[c]=a}K 6.R(J(i){Q(c 1p d)E.1J(b?6.W:6,c,E.1l(6,d[c],b,i,c))})},1j:J(b,a){7((b==\'27\'||b==\'1R\')&&2M(a)<0)a=10;K 6.1J(b,a,"2o")},1u:J(b){7(1o b!="3V"&&b!=V)K 6.4x().3t((6[0]&&6[0].2i||T).5r(b));L a="";E.R(b||6,J(){E.R(6.3p,J(){7(6.15!=8)a+=6.15!=1?6.6K:E.1n.1u([6])})});K a},5m:J(b){7(6[0])E(b,6[0].2i).5k().3o(6[0]).2c(J(){L a=6;2b(a.1C)a=a.1C;K a}).3t(6);K 6},8w:J(a){K 6.R(J(){E(6).6z().5m(a)})},8p:J(a){K 6.R(J(){E(6).5m(a)})},3t:J(){K 6.3O(18,P,S,J(a){7(6.15==1)6.38(a)})},6q:J(){K 6.3O(18,P,P,J(a){7(6.15==1)6.3o(a,6.1C)})},6o:J(){K 6.3O(18,S,S,J(a){6.1a.3o(a,6)})},5a:J(){K 6.3O(18,S,P,J(a){6.1a.3o(a,6.2B)})},3h:J(){K 6.54||E([])},2s:J(b){L c=E.2c(6,J(a){K E.2s(b,a)});K 6.2F(/[^+>] [^+>]/.17(b)||b.1f("..")>-1?E.57(c):c)},5k:J(e){L f=6.2c(J(){7(E.14.1d&&!E.3E(6)){L a=6.69(P),4Y=T.3s("1x");4Y.38(a);K E.4a([4Y.3d])[0]}N K 6.69(P)});L d=f.2s("*").4R().R(J(){7(6[F]!=10)6[F]=V});7(e===P)6.2s("*").4R().R(J(i){7(6.15==3)K;L c=E.O(6,"2R");Q(L a 1p c)Q(L b 1p c[a])E.16.1b(d[i],a,c[a][b],c[a][b].O)});K f},1E:J(b){K 6.2F(E.1q(b)&&E.3y(6,J(a,i){K b.1P(a,i)})||E.3e(b,6))},56:J(b){7(b.1k==4e)7(G.17(b))K 6.2F(E.3e(b,6,P));N b=E.3e(b,6);L a=b.M&&b[b.M-1]!==10&&!b.15;K 6.1E(J(){K a?E.33(6,b)<0:6!=b})},1b:J(a){K!a?6:6.2F(E.37(6.22(),a.1k==4e?E(a).22():a.M!=10&&(!a.12||E.12(a,"3u"))?a:[a]))},3H:J(a){K a?E.3e(a,6).M>0:S},7j:J(a){K 6.3H("."+a)},5O:J(b){7(b==10){7(6.M){L c=6[0];7(E.12(c,"2k")){L e=c.3T,5I=[],11=c.11,2X=c.U=="2k-2X";7(e<0)K V;Q(L i=2X?e:0,2f=2X?e+1:11.M;i<2f;i++){L d=11[i];7(d.2p){b=E.14.1d&&!d.9J.1A.9y?d.1u:d.1A;7(2X)K b;5I.1g(b)}}K 5I}N K(6[0].1A||"").1r(/\\r/g,"")}K 10}K 6.R(J(){7(6.15!=1)K;7(b.1k==1M&&/5u|5t/.17(6.U))6.3k=(E.33(6.1A,b)>=0||E.33(6.31,b)>=0);N 7(E.12(6,"2k")){L a=b.1k==1M?b:[b];E("98",6).R(J(){6.2p=(E.33(6.1A,a)>=0||E.33(6.1u,a)>=0)});7(!a.M)6.3T=-1}N 6.1A=b})},3q:J(a){K a==10?(6.M?6[0].3d:V):6.4x().3t(a)},6S:J(a){K 6.5a(a).1V()},6Z:J(i){K 6.2K(i,i+1)},2K:J(){K 6.2F(1M.2l.2K.1i(6,18))},2c:J(b){K 6.2F(E.2c(6,J(a,i){K b.1P(a,i,a)}))},4R:J(){K 6.1b(6.54)},O:J(d,b){L a=d.23(".");a[1]=a[1]?"."+a[1]:"";7(b==V){L c=6.5n("8P"+a[1]+"!",[a[0]]);7(c==10&&6.M)c=E.O(6[0],d);K c==V&&a[1]?6.O(a[0]):c}N K 6.1N("8K"+a[1]+"!",[a[0],b]).R(J(){E.O(6,d,b)})},35:J(a){K 6.R(J(){E.35(6,a)})},3O:J(g,f,h,d){L e=6.M>1,3n;K 6.R(J(){7(!3n){3n=E.4a(g,6.2i);7(h)3n.8D()}L b=6;7(f&&E.12(6,"1O")&&E.12(3n[0],"4v"))b=6.3S("1U")[0]||6.38(6.2i.3s("1U"));L c=E([]);E.R(3n,J(){L a=e?E(6).5k(P)[0]:6;7(E.12(a,"1m")){c=c.1b(a)}N{7(a.15==1)c=c.1b(E("1m",a).1V());d.1P(b,a)}});c.R(6A)})}};E.2l.4T.2l=E.2l;J 6A(i,a){7(a.3Q)E.3P({1c:a.3Q,3l:S,1H:"1m"});N E.5g(a.1u||a.6x||a.3d||"");7(a.1a)a.1a.34(a)}E.1s=E.1n.1s=J(){L b=18[0]||{},i=1,M=18.M,5c=S,11;7(b.1k==8d){5c=b;b=18[1]||{};i=2}7(1o b!="3V"&&1o b!="J")b={};7(M==1){b=6;i=0}Q(;i-1}},68:J(b,c,a){L e={};Q(L d 1p c){e[d]=b.W[d];b.W[d]=c[d]}a.1P(b);Q(L d 1p c)b.W[d]=e[d]},1j:J(d,e,c){7(e=="27"||e=="1R"){L b,46={43:"4W",4U:"1Z",19:"3D"},3c=e=="27"?["7O","7M"]:["7J","7I"];J 5E(){b=e=="27"?d.7H:d.7F;L a=0,2N=0;E.R(3c,J(){a+=2M(E.2o(d,"7E"+6,P))||0;2N+=2M(E.2o(d,"2N"+6+"5X",P))||0});b-=24.7C(a+2N)}7(E(d).3H(":4d"))5E();N E.68(d,46,5E);K 24.2f(0,b)}K E.2o(d,e,c)},2o:J(e,k,j){L d;J 3x(b){7(!E.14.2d)K S;L a=T.4c.4K(b,V);K!a||a.4M("3x")==""}7(k=="1w"&&E.14.1d){d=E.1J(e.W,"1w");K d==""?"1":d}7(E.14.2z&&k=="19"){L c=e.W.50;e.W.50="0 7r 7o";e.W.50=c}7(k.1D(/4g/i))k=y;7(!j&&e.W&&e.W[k])d=e.W[k];N 7(T.4c&&T.4c.4K){7(k.1D(/4g/i))k="4g";k=k.1r(/([A-Z])/g,"-$1").2h();L h=T.4c.4K(e,V);7(h&&!3x(e))d=h.4M(k);N{L f=[],2C=[];Q(L a=e;a&&3x(a);a=a.1a)2C.4J(a);Q(L i=0;i<2C.M;i++)7(3x(2C[i])){f[i]=2C[i].W.19;2C[i].W.19="3D"}d=k=="19"&&f[2C.M-1]!=V?"2H":(h&&h.4M(k))||"";Q(L i=0;i]*?)\\/>/g,J(b,a,c){K c.1D(/^(aa|a6|7e|a5|4D|7a|a0|3m|9W|9U|9S)$/i)?b:a+">"});L f=E.3g(d).2h(),1x=h.3s("1x");L e=!f.1f("<9P")&&[1,"<2k 74=\'74\'>",""]||!f.1f("<9M")&&[1,"<73>",""]||f.1D(/^<(9G|1U|9E|9B|9x)/)&&[1,"<1O>",""]||!f.1f("<4v")&&[2,"<1O><1U>",""]||(!f.1f("<9w")||!f.1f("<9v"))&&[3,"<1O><1U><4v>",""]||!f.1f("<7e")&&[2,"<1O><1U><6V>",""]||E.14.1d&&[1,"1x<1x>",""]||[0,"",""];1x.3d=e[1]+d+e[2];2b(e[0]--)1x=1x.5o;7(E.14.1d){L g=!f.1f("<1O")&&f.1f("<1U")<0?1x.1C&&1x.1C.3p:e[1]=="<1O>"&&f.1f("<1U")<0?1x.3p:[];Q(L j=g.M-1;j>=0;--j)7(E.12(g[j],"1U")&&!g[j].3p.M)g[j].1a.34(g[j]);7(/^\\s/.17(d))1x.3o(h.5r(d.1D(/^\\s*/)[0]),1x.1C)}d=E.2I(1x.3p)}7(d.M===0&&(!E.12(d,"3u")&&!E.12(d,"2k")))K;7(d[0]==10||E.12(d,"3u")||d.11)k.1g(d);N k=E.37(k,d)});K k},1J:J(d,e,c){7(!d||d.15==3||d.15==8)K 10;L f=E.3E(d)?{}:E.46;7(e=="2p"&&E.14.2d)d.1a.3T;7(f[e]){7(c!=10)d[f[e]]=c;K d[f[e]]}N 7(E.14.1d&&e=="W")K E.1J(d.W,"9u",c);N 7(c==10&&E.14.1d&&E.12(d,"3u")&&(e=="9r"||e=="9o"))K d.9m(e).6K;N 7(d.28){7(c!=10){7(e=="U"&&E.12(d,"4D")&&d.1a)6Q"U 9i 9h\'t 9g 9e";d.9b(e,""+c)}7(E.14.1d&&/6O|3Q/.17(e)&&!E.3E(d))K d.4z(e,2);K d.4z(e)}N{7(e=="1w"&&E.14.1d){7(c!=10){d.6k=1;d.1E=(d.1E||"").1r(/6M\\([^)]*\\)/,"")+(2M(c).3X()=="96"?"":"6M(1w="+c*6L+")")}K d.1E&&d.1E.1f("1w=")>=0?(2M(d.1E.1D(/1w=([^)]*)/)[1])/6L).3X():""}e=e.1r(/-([a-z])/95,J(a,b){K b.2E()});7(c!=10)d[e]=c;K d[e]}},3g:J(a){K(a||"").1r(/^\\s+|\\s+$/g,"")},2I:J(b){L a=[];7(1o b!="93")Q(L i=0,M=b.M;i*",6).1V();2b(6.1C)6.34(6.1C)}},J(a,b){E.1n[a]=J(){K 6.R(b,18)}});E.R(["8f","5X"],J(i,c){L b=c.2h();E.1n[b]=J(a){K 6[0]==1e?E.14.2z&&T.1h["5e"+c]||E.14.2d&&1e["8e"+c]||T.6F=="79"&&T.1F["5e"+c]||T.1h["5e"+c]:6[0]==T?24.2f(24.2f(T.1h["5d"+c],T.1F["5d"+c]),24.2f(T.1h["5L"+c],T.1F["5L"+c])):a==10?(6.M?E.1j(6[0],b):V):6.1j(b,a.1k==4e?a:a+"2S")}});L C=E.14.2d&&4s(E.14.5K)<8c?"(?:[\\\\w*4r-]|\\\\\\\\.)":"(?:[\\\\w\\8b-\\8a*4r-]|\\\\\\\\.)",6v=1B 4q("^>\\\\s*("+C+"+)"),6u=1B 4q("^("+C+"+)(#)("+C+"+)"),6s=1B 4q("^([#.]?)("+C+"*)");E.1s({6r:{"":J(a,i,m){K m[2]=="*"||E.12(a,m[2])},"#":J(a,i,m){K a.4z("2w")==m[2]},":":{89:J(a,i,m){K im[3]-0},2Z:J(a,i,m){K m[3]-0==i},6Z:J(a,i,m){K m[3]-0==i},3j:J(a,i){K i==0},3J:J(a,i,m,r){K i==r.M-1},6n:J(a,i){K i%2==0},6l:J(a,i){K i%2},"3j-4p":J(a){K a.1a.3S("*")[0]==a},"3J-4p":J(a){K E.2Z(a.1a.5o,1,"4t")==a},"83-4p":J(a){K!E.2Z(a.1a.5o,2,"4t")},6B:J(a){K a.1C},4x:J(a){K!a.1C},82:J(a,i,m){K(a.6x||a.81||E(a).1u()||"").1f(m[3])>=0},4d:J(a){K"1Z"!=a.U&&E.1j(a,"19")!="2H"&&E.1j(a,"4U")!="1Z"},1Z:J(a){K"1Z"==a.U||E.1j(a,"19")=="2H"||E.1j(a,"4U")=="1Z"},80:J(a){K!a.2Y},2Y:J(a){K a.2Y},3k:J(a){K a.3k},2p:J(a){K a.2p||E.1J(a,"2p")},1u:J(a){K"1u"==a.U},5u:J(a){K"5u"==a.U},5t:J(a){K"5t"==a.U},59:J(a){K"59"==a.U},3I:J(a){K"3I"==a.U},58:J(a){K"58"==a.U},6j:J(a){K"6j"==a.U},6i:J(a){K"6i"==a.U},2G:J(a){K"2G"==a.U||E.12(a,"2G")},4D:J(a){K/4D|2k|6h|2G/i.17(a.12)},3Y:J(a,i,m){K E.2s(m[3],a).M},7X:J(a){K/h\\d/i.17(a.12)},7W:J(a){K E.3y(E.3G,J(b){K a==b.Y}).M}}},6g:[/^(\\[) *@?([\\w-]+) *([!*$^~=]*) *(\'?"?)(.*?)\\4 *\\]/,/^(:)([\\w-]+)\\("?\'?(.*?(\\(.*?\\))?[^(]*?)"?\'?\\)/,1B 4q("^([:.#]*)("+C+"+)")],3e:J(a,c,b){L d,2m=[];2b(a&&a!=d){d=a;L f=E.1E(a,c,b);a=f.t.1r(/^\\s*,\\s*/,"");2m=b?c=f.r:E.37(2m,f.r)}K 2m},2s:J(t,p){7(1o t!="25")K[t];7(p&&p.15!=1&&p.15!=9)K[];p=p||T;L d=[p],2r=[],3J,12;2b(t&&3J!=t){L r=[];3J=t;t=E.3g(t);L o=S;L g=6v;L m=g.2O(t);7(m){12=m[1].2E();Q(L i=0;d[i];i++)Q(L c=d[i].1C;c;c=c.2B)7(c.15==1&&(12=="*"||c.12.2E()==12))r.1g(c);d=r;t=t.1r(g,"");7(t.1f(" ")==0)6w;o=P}N{g=/^([>+~])\\s*(\\w*)/i;7((m=g.2O(t))!=V){r=[];L l={};12=m[2].2E();m=m[1];Q(L j=0,3f=d.M;j<3f;j++){L n=m=="~"||m=="+"?d[j].2B:d[j].1C;Q(;n;n=n.2B)7(n.15==1){L h=E.O(n);7(m=="~"&&l[h])1Q;7(!12||n.12.2E()==12){7(m=="~")l[h]=P;r.1g(n)}7(m=="+")1Q}}d=r;t=E.3g(t.1r(g,""));o=P}}7(t&&!o){7(!t.1f(",")){7(p==d[0])d.4l();2r=E.37(2r,d);r=d=[p];t=" "+t.6e(1,t.M)}N{L k=6u;L m=k.2O(t);7(m){m=[0,m[2],m[3],m[1]]}N{k=6s;m=k.2O(t)}m[2]=m[2].1r(/\\\\/g,"");L f=d[d.M-1];7(m[1]=="#"&&f&&f.5J&&!E.3E(f)){L q=f.5J(m[2]);7((E.14.1d||E.14.2z)&&q&&1o q.2w=="25"&&q.2w!=m[2])q=E(\'[@2w="\'+m[2]+\'"]\',f)[0];d=r=q&&(!m[3]||E.12(q,m[3]))?[q]:[]}N{Q(L i=0;d[i];i++){L a=m[1]=="#"&&m[3]?m[3]:m[1]!=""||m[0]==""?"*":m[2];7(a=="*"&&d[i].12.2h()=="3V")a="3m";r=E.37(r,d[i].3S(a))}7(m[1]==".")r=E.55(r,m[2]);7(m[1]=="#"){L e=[];Q(L i=0;r[i];i++)7(r[i].4z("2w")==m[2]){e=[r[i]];1Q}r=e}d=r}t=t.1r(k,"")}}7(t){L b=E.1E(t,r);d=r=b.r;t=E.3g(b.t)}}7(t)d=[];7(d&&p==d[0])d.4l();2r=E.37(2r,d);K 2r},55:J(r,m,a){m=" "+m+" ";L c=[];Q(L i=0;r[i];i++){L b=(" "+r[i].1t+" ").1f(m)>=0;7(!a&&b||a&&!b)c.1g(r[i])}K c},1E:J(t,r,h){L d;2b(t&&t!=d){d=t;L p=E.6g,m;Q(L i=0;p[i];i++){m=p[i].2O(t);7(m){t=t.7V(m[0].M);m[2]=m[2].1r(/\\\\/g,"");1Q}}7(!m)1Q;7(m[1]==":"&&m[2]=="56")r=G.17(m[3])?E.1E(m[3],r,P).r:E(r).56(m[3]);N 7(m[1]==".")r=E.55(r,m[2],h);N 7(m[1]=="["){L g=[],U=m[3];Q(L i=0,3f=r.M;i<3f;i++){L a=r[i],z=a[E.46[m[2]]||m[2]];7(z==V||/6O|3Q|2p/.17(m[2]))z=E.1J(a,m[2])||\'\';7((U==""&&!!z||U=="="&&z==m[5]||U=="!="&&z!=m[5]||U=="^="&&z&&!z.1f(m[5])||U=="$="&&z.6e(z.M-m[5].M)==m[5]||(U=="*="||U=="~=")&&z.1f(m[5])>=0)^h)g.1g(a)}r=g}N 7(m[1]==":"&&m[2]=="2Z-4p"){L e={},g=[],17=/(-?)(\\d*)n((?:\\+|-)?\\d*)/.2O(m[3]=="6n"&&"2n"||m[3]=="6l"&&"2n+1"||!/\\D/.17(m[3])&&"7U+"+m[3]||m[3]),3j=(17[1]+(17[2]||1))-0,d=17[3]-0;Q(L i=0,3f=r.M;i<3f;i++){L j=r[i],1a=j.1a,2w=E.O(1a);7(!e[2w]){L c=1;Q(L n=1a.1C;n;n=n.2B)7(n.15==1)n.4k=c++;e[2w]=P}L b=S;7(3j==0){7(j.4k==d)b=P}N 7((j.4k-d)%3j==0&&(j.4k-d)/3j>=0)b=P;7(b^h)g.1g(j)}r=g}N{L f=E.6r[m[1]];7(1o f=="3V")f=f[m[2]];7(1o f=="25")f=6c("S||J(a,i){K "+f+";}");r=E.3y(r,J(a,i){K f(a,i,m,r)},h)}}K{r:r,t:t}},4u:J(b,c){L d=[];L a=b[c];2b(a&&a!=T){7(a.15==1)d.1g(a);a=a[c]}K d},2Z:J(a,e,c,b){e=e||1;L d=0;Q(;a;a=a[c])7(a.15==1&&++d==e)1Q;K a},5i:J(n,a){L r=[];Q(;n;n=n.2B){7(n.15==1&&(!a||n!=a))r.1g(n)}K r}});E.16={1b:J(f,i,g,e){7(f.15==3||f.15==8)K;7(E.14.1d&&f.53!=10)f=1e;7(!g.2D)g.2D=6.2D++;7(e!=10){L h=g;g=J(){K h.1i(6,18)};g.O=e;g.2D=h.2D}L j=E.O(f,"2R")||E.O(f,"2R",{}),1v=E.O(f,"1v")||E.O(f,"1v",J(){L a;7(1o E=="10"||E.16.5f)K a;a=E.16.1v.1i(18.3R.Y,18);K a});1v.Y=f;E.R(i.23(/\\s+/),J(c,b){L a=b.23(".");b=a[0];g.U=a[1];L d=j[b];7(!d){d=j[b]={};7(!E.16.2y[b]||E.16.2y[b].4j.1P(f)===S){7(f.3F)f.3F(b,1v,S);N 7(f.6b)f.6b("4i"+b,1v)}}d[g.2D]=g;E.16.2a[b]=P});f=V},2D:1,2a:{},1V:J(e,h,f){7(e.15==3||e.15==8)K;L i=E.O(e,"2R"),29,4X;7(i){7(h==10||(1o h=="25"&&h.7T(0)=="."))Q(L g 1p i)6.1V(e,g+(h||""));N{7(h.U){f=h.2q;h=h.U}E.R(h.23(/\\s+/),J(b,a){L c=a.23(".");a=c[0];7(i[a]){7(f)2V i[a][f.2D];N Q(f 1p i[a])7(!c[1]||i[a][f].U==c[1])2V i[a][f];Q(29 1p i[a])1Q;7(!29){7(!E.16.2y[a]||E.16.2y[a].4h.1P(e)===S){7(e.67)e.67(a,E.O(e,"1v"),S);N 7(e.66)e.66("4i"+a,E.O(e,"1v"))}29=V;2V i[a]}}})}Q(29 1p i)1Q;7(!29){L d=E.O(e,"1v");7(d)d.Y=V;E.35(e,"2R");E.35(e,"1v")}}},1N:J(g,c,d,f,h){c=E.2I(c||[]);7(g.1f("!")>=0){g=g.2K(0,-1);L a=P}7(!d){7(6.2a[g])E("*").1b([1e,T]).1N(g,c)}N{7(d.15==3||d.15==8)K 10;L b,29,1n=E.1q(d[g]||V),16=!c[0]||!c[0].36;7(16)c.4J(6.4Z({U:g,2L:d}));c[0].U=g;7(a)c[0].65=P;7(E.1q(E.O(d,"1v")))b=E.O(d,"1v").1i(d,c);7(!1n&&d["4i"+g]&&d["4i"+g].1i(d,c)===S)b=S;7(16)c.4l();7(h&&E.1q(h)){29=h.1i(d,b==V?c:c.71(b));7(29!==10)b=29}7(1n&&f!==S&&b!==S&&!(E.12(d,\'a\')&&g=="4V")){6.5f=P;1S{d[g]()}1X(e){}}6.5f=S}K b},1v:J(c){L a;c=E.16.4Z(c||1e.16||{});L b=c.U.23(".");c.U=b[0];L f=E.O(6,"2R")&&E.O(6,"2R")[c.U],42=1M.2l.2K.1P(18,1);42.4J(c);Q(L j 1p f){L d=f[j];42[0].2q=d;42[0].O=d.O;7(!b[1]&&!c.65||d.U==b[1]){L e=d.1i(6,42);7(a!==S)a=e;7(e===S){c.36();c.44()}}}7(E.14.1d)c.2L=c.36=c.44=c.2q=c.O=V;K a},4Z:J(c){L a=c;c=E.1s({},a);c.36=J(){7(a.36)a.36();a.7S=S};c.44=J(){7(a.44)a.44();a.7R=P};7(!c.2L)c.2L=c.7Q||T;7(c.2L.15==3)c.2L=a.2L.1a;7(!c.4S&&c.5w)c.4S=c.5w==c.2L?c.7P:c.5w;7(c.64==V&&c.63!=V){L b=T.1F,1h=T.1h;c.64=c.63+(b&&b.2v||1h&&1h.2v||0)-(b.62||0);c.7N=c.7L+(b&&b.2x||1h&&1h.2x||0)-(b.60||0)}7(!c.3c&&((c.4f||c.4f===0)?c.4f:c.5Z))c.3c=c.4f||c.5Z;7(!c.7b&&c.5Y)c.7b=c.5Y;7(!c.3c&&c.2G)c.3c=(c.2G&1?1:(c.2G&2?3:(c.2G&4?2:0)));K c},2y:{21:{4j:J(){5M();K},4h:J(){K}},3C:{4j:J(){7(E.14.1d)K S;E(6).2j("4P",E.16.2y.3C.2q);K P},4h:J(){7(E.14.1d)K S;E(6).3w("4P",E.16.2y.3C.2q);K P},2q:J(a){7(I(a,6))K P;18[0].U="3C";K E.16.1v.1i(6,18)}},3B:{4j:J(){7(E.14.1d)K S;E(6).2j("4O",E.16.2y.3B.2q);K P},4h:J(){7(E.14.1d)K S;E(6).3w("4O",E.16.2y.3B.2q);K P},2q:J(a){7(I(a,6))K P;18[0].U="3B";K E.16.1v.1i(6,18)}}}};E.1n.1s({2j:J(c,a,b){K c=="4H"?6.2X(c,a,b):6.R(J(){E.16.1b(6,c,b||a,b&&a)})},2X:J(d,b,c){K 6.R(J(){E.16.1b(6,d,J(a){E(6).3w(a);K(c||b).1i(6,18)},c&&b)})},3w:J(a,b){K 6.R(J(){E.16.1V(6,a,b)})},1N:J(c,a,b){K 6.R(J(){E.16.1N(c,a,6,P,b)})},5n:J(c,a,b){7(6[0])K E.16.1N(c,a,6[0],S,b);K 10},2g:J(){L b=18;K 6.4V(J(a){6.4N=0==6.4N?1:0;a.36();K b[6.4N].1i(6,18)||S})},7D:J(a,b){K 6.2j(\'3C\',a).2j(\'3B\',b)},21:J(a){5M();7(E.2Q)a.1P(T,E);N E.3A.1g(J(){K a.1P(6,E)});K 6}});E.1s({2Q:S,3A:[],21:J(){7(!E.2Q){E.2Q=P;7(E.3A){E.R(E.3A,J(){6.1i(T)});E.3A=V}E(T).5n("21")}}});L x=S;J 5M(){7(x)K;x=P;7(T.3F&&!E.14.2z)T.3F("5W",E.21,S);7(E.14.1d&&1e==3b)(J(){7(E.2Q)K;1S{T.1F.7B("26")}1X(3a){3z(18.3R,0);K}E.21()})();7(E.14.2z)T.3F("5W",J(){7(E.2Q)K;Q(L i=0;i=0){L i=g.2K(e,g.M);g=g.2K(0,e)}c=c||J(){};L f="4Q";7(d)7(E.1q(d)){c=d;d=V}N{d=E.3m(d);f="61"}L h=6;E.3P({1c:g,U:f,1H:"3q",O:d,1y:J(a,b){7(b=="1W"||b=="5U")h.3q(i?E("<1x/>").3t(a.4b.1r(/<1m(.|\\s)*?\\/1m>/g,"")).2s(i):a.4b);h.R(c,[a.4b,b,a])}});K 6},7n:J(){K E.3m(6.5T())},5T:J(){K 6.2c(J(){K E.12(6,"3u")?E.2I(6.7m):6}).1E(J(){K 6.31&&!6.2Y&&(6.3k||/2k|6h/i.17(6.12)||/1u|1Z|3I/i.17(6.U))}).2c(J(i,c){L b=E(6).5O();K b==V?V:b.1k==1M?E.2c(b,J(a,i){K{31:c.31,1A:a}}):{31:c.31,1A:b}}).22()}});E.R("5S,6d,5R,6D,5Q,6m".23(","),J(i,o){E.1n[o]=J(f){K 6.2j(o,f)}});L B=(1B 3v).3L();E.1s({22:J(d,b,a,c){7(E.1q(b)){a=b;b=V}K E.3P({U:"4Q",1c:d,O:b,1W:a,1H:c})},7l:J(b,a){K E.22(b,V,a,"1m")},7k:J(c,b,a){K E.22(c,b,a,"3i")},7i:J(d,b,a,c){7(E.1q(b)){a=b;b={}}K E.3P({U:"61",1c:d,O:b,1W:a,1H:c})},85:J(a){E.1s(E.4I,a)},4I:{2a:P,U:"4Q",2U:0,5P:"4o/x-7h-3u-7g",5N:P,3l:P,O:V,6p:V,3I:V,49:{3M:"4o/3M, 1u/3M",3q:"1u/3q",1m:"1u/4m, 4o/4m",3i:"4o/3i, 1u/4m",1u:"1u/a7",4G:"*/*"}},4F:{},3P:J(s){L f,2W=/=\\?(&|$)/g,1z,O;s=E.1s(P,s,E.1s(P,{},E.4I,s));7(s.O&&s.5N&&1o s.O!="25")s.O=E.3m(s.O);7(s.1H=="4E"){7(s.U.2h()=="22"){7(!s.1c.1D(2W))s.1c+=(s.1c.1D(/\\?/)?"&":"?")+(s.4E||"7d")+"=?"}N 7(!s.O||!s.O.1D(2W))s.O=(s.O?s.O+"&":"")+(s.4E||"7d")+"=?";s.1H="3i"}7(s.1H=="3i"&&(s.O&&s.O.1D(2W)||s.1c.1D(2W))){f="4E"+B++;7(s.O)s.O=(s.O+"").1r(2W,"="+f+"$1");s.1c=s.1c.1r(2W,"="+f+"$1");s.1H="1m";1e[f]=J(a){O=a;1W();1y();1e[f]=10;1S{2V 1e[f]}1X(e){}7(h)h.34(g)}}7(s.1H=="1m"&&s.1T==V)s.1T=S;7(s.1T===S&&s.U.2h()=="22"){L i=(1B 3v()).3L();L j=s.1c.1r(/(\\?|&)4r=.*?(&|$)/,"$a4="+i+"$2");s.1c=j+((j==s.1c)?(s.1c.1D(/\\?/)?"&":"?")+"4r="+i:"")}7(s.O&&s.U.2h()=="22"){s.1c+=(s.1c.1D(/\\?/)?"&":"?")+s.O;s.O=V}7(s.2a&&!E.5H++)E.16.1N("5S");7((!s.1c.1f("a3")||!s.1c.1f("//"))&&s.1H=="1m"&&s.U.2h()=="22"){L h=T.3S("6f")[0];L g=T.3s("1m");g.3Q=s.1c;7(s.7c)g.a2=s.7c;7(!f){L l=S;g.9Z=g.9Y=J(){7(!l&&(!6.39||6.39=="5V"||6.39=="1y")){l=P;1W();1y();h.34(g)}}}h.38(g);K 10}L m=S;L k=1e.78?1B 78("9X.9V"):1B 76();k.9T(s.U,s.1c,s.3l,s.6p,s.3I);1S{7(s.O)k.4C("9R-9Q",s.5P);7(s.5C)k.4C("9O-5A-9N",E.4F[s.1c]||"9L, 9K 9I 9H 5z:5z:5z 9F");k.4C("X-9C-9A","76");k.4C("9z",s.1H&&s.49[s.1H]?s.49[s.1H]+", */*":s.49.4G)}1X(e){}7(s.6Y)s.6Y(k);7(s.2a)E.16.1N("6m",[k,s]);L c=J(a){7(!m&&k&&(k.39==4||a=="2U")){m=P;7(d){6I(d);d=V}1z=a=="2U"&&"2U"||!E.6X(k)&&"3a"||s.5C&&E.6J(k,s.1c)&&"5U"||"1W";7(1z=="1W"){1S{O=E.6W(k,s.1H)}1X(e){1z="5x"}}7(1z=="1W"){L b;1S{b=k.5q("6U-5A")}1X(e){}7(s.5C&&b)E.4F[s.1c]=b;7(!f)1W()}N E.5v(s,k,1z);1y();7(s.3l)k=V}};7(s.3l){L d=53(c,13);7(s.2U>0)3z(J(){7(k){k.9t();7(!m)c("2U")}},s.2U)}1S{k.9s(s.O)}1X(e){E.5v(s,k,V,e)}7(!s.3l)c();J 1W(){7(s.1W)s.1W(O,1z);7(s.2a)E.16.1N("5Q",[k,s])}J 1y(){7(s.1y)s.1y(k,1z);7(s.2a)E.16.1N("5R",[k,s]);7(s.2a&&!--E.5H)E.16.1N("6d")}K k},5v:J(s,a,b,e){7(s.3a)s.3a(a,b,e);7(s.2a)E.16.1N("6D",[a,s,e])},5H:0,6X:J(r){1S{K!r.1z&&9q.9p=="59:"||(r.1z>=6T&&r.1z<9n)||r.1z==6R||r.1z==9l||E.14.2d&&r.1z==10}1X(e){}K S},6J:J(a,c){1S{L b=a.5q("6U-5A");K a.1z==6R||b==E.4F[c]||E.14.2d&&a.1z==10}1X(e){}K S},6W:J(r,b){L c=r.5q("9k-U");L d=b=="3M"||!b&&c&&c.1f("3M")>=0;L a=d?r.9j:r.4b;7(d&&a.1F.28=="5x")6Q"5x";7(b=="1m")E.5g(a);7(b=="3i")a=6c("("+a+")");K a},3m:J(a){L s=[];7(a.1k==1M||a.5h)E.R(a,J(){s.1g(3r(6.31)+"="+3r(6.1A))});N Q(L j 1p a)7(a[j]&&a[j].1k==1M)E.R(a[j],J(){s.1g(3r(j)+"="+3r(6))});N s.1g(3r(j)+"="+3r(a[j]));K s.6a("&").1r(/%20/g,"+")}});E.1n.1s({1G:J(c,b){K c?6.2e({1R:"1G",27:"1G",1w:"1G"},c,b):6.1E(":1Z").R(J(){6.W.19=6.5s||"";7(E.1j(6,"19")=="2H"){L a=E("<"+6.28+" />").6y("1h");6.W.19=a.1j("19");7(6.W.19=="2H")6.W.19="3D";a.1V()}}).3h()},1I:J(b,a){K b?6.2e({1R:"1I",27:"1I",1w:"1I"},b,a):6.1E(":4d").R(J(){6.5s=6.5s||E.1j(6,"19");6.W.19="2H"}).3h()},6N:E.1n.2g,2g:J(a,b){K E.1q(a)&&E.1q(b)?6.6N(a,b):a?6.2e({1R:"2g",27:"2g",1w:"2g"},a,b):6.R(J(){E(6)[E(6).3H(":1Z")?"1G":"1I"]()})},9f:J(b,a){K 6.2e({1R:"1G"},b,a)},9d:J(b,a){K 6.2e({1R:"1I"},b,a)},9c:J(b,a){K 6.2e({1R:"2g"},b,a)},9a:J(b,a){K 6.2e({1w:"1G"},b,a)},99:J(b,a){K 6.2e({1w:"1I"},b,a)},97:J(c,a,b){K 6.2e({1w:a},c,b)},2e:J(l,k,j,h){L i=E.6P(k,j,h);K 6[i.2P===S?"R":"2P"](J(){7(6.15!=1)K S;L g=E.1s({},i);L f=E(6).3H(":1Z"),4A=6;Q(L p 1p l){7(l[p]=="1I"&&f||l[p]=="1G"&&!f)K E.1q(g.1y)&&g.1y.1i(6);7(p=="1R"||p=="27"){g.19=E.1j(6,"19");g.32=6.W.32}}7(g.32!=V)6.W.32="1Z";g.40=E.1s({},l);E.R(l,J(c,a){L e=1B E.2t(4A,g,c);7(/2g|1G|1I/.17(a))e[a=="2g"?f?"1G":"1I":a](l);N{L b=a.3X().1D(/^([+-]=)?([\\d+-.]+)(.*)$/),1Y=e.2m(P)||0;7(b){L d=2M(b[2]),2A=b[3]||"2S";7(2A!="2S"){4A.W[c]=(d||1)+2A;1Y=((d||1)/e.2m(P))*1Y;4A.W[c]=1Y+2A}7(b[1])d=((b[1]=="-="?-1:1)*d)+1Y;e.45(1Y,d,2A)}N e.45(1Y,a,"")}});K P})},2P:J(a,b){7(E.1q(a)||(a&&a.1k==1M)){b=a;a="2t"}7(!a||(1o a=="25"&&!b))K A(6[0],a);K 6.R(J(){7(b.1k==1M)A(6,a,b);N{A(6,a).1g(b);7(A(6,a).M==1)b.1i(6)}})},94:J(b,c){L a=E.3G;7(b)6.2P([]);6.R(J(){Q(L i=a.M-1;i>=0;i--)7(a[i].Y==6){7(c)a[i](P);a.72(i,1)}});7(!c)6.5p();K 6}});L A=J(b,c,a){7(!b)K 10;c=c||"2t";L q=E.O(b,c+"2P");7(!q||a)q=E.O(b,c+"2P",a?E.2I(a):[]);K q};E.1n.5p=J(a){a=a||"2t";K 6.R(J(){L q=A(6,a);q.4l();7(q.M)q[0].1i(6)})};E.1s({6P:J(b,a,c){L d=b&&b.1k==92?b:{1y:c||!c&&a||E.1q(b)&&b,2u:b,3Z:c&&a||a&&a.1k!=91&&a};d.2u=(d.2u&&d.2u.1k==51?d.2u:{90:8Z,9D:6T}[d.2u])||8X;d.5y=d.1y;d.1y=J(){7(d.2P!==S)E(6).5p();7(E.1q(d.5y))d.5y.1i(6)};K d},3Z:{70:J(p,n,b,a){K b+a*p},5j:J(p,n,b,a){K((-24.8V(p*24.8U)/2)+0.5)*a+b}},3G:[],3W:V,2t:J(b,c,a){6.11=c;6.Y=b;6.1l=a;7(!c.47)c.47={}}});E.2t.2l={4y:J(){7(6.11.30)6.11.30.1i(6.Y,[6.2J,6]);(E.2t.30[6.1l]||E.2t.30.4G)(6);7(6.1l=="1R"||6.1l=="27")6.Y.W.19="3D"},2m:J(a){7(6.Y[6.1l]!=V&&6.Y.W[6.1l]==V)K 6.Y[6.1l];L r=2M(E.1j(6.Y,6.1l,a));K r&&r>-8Q?r:2M(E.2o(6.Y,6.1l))||0},45:J(c,b,d){6.5B=(1B 3v()).3L();6.1Y=c;6.3h=b;6.2A=d||6.2A||"2S";6.2J=6.1Y;6.4B=6.4w=0;6.4y();L e=6;J t(a){K e.30(a)}t.Y=6.Y;E.3G.1g(t);7(E.3W==V){E.3W=53(J(){L a=E.3G;Q(L i=0;i6.11.2u+6.5B){6.2J=6.3h;6.4B=6.4w=1;6.4y();6.11.40[6.1l]=P;L b=P;Q(L i 1p 6.11.40)7(6.11.40[i]!==P)b=S;7(b){7(6.11.19!=V){6.Y.W.32=6.11.32;6.Y.W.19=6.11.19;7(E.1j(6.Y,"19")=="2H")6.Y.W.19="3D"}7(6.11.1I)6.Y.W.19="2H";7(6.11.1I||6.11.1G)Q(L p 1p 6.11.40)E.1J(6.Y.W,p,6.11.47[p])}7(b&&E.1q(6.11.1y))6.11.1y.1i(6.Y);K S}N{L n=t-6.5B;6.4w=n/6.11.2u;6.4B=E.3Z[6.11.3Z||(E.3Z.5j?"5j":"70")](6.4w,n,0,1,6.11.2u);6.2J=6.1Y+((6.3h-6.1Y)*6.4B);6.4y()}K P}};E.2t.30={2v:J(a){a.Y.2v=a.2J},2x:J(a){a.Y.2x=a.2J},1w:J(a){E.1J(a.Y.W,"1w",a.2J)},4G:J(a){a.Y.W[a.1l]=a.2J+a.2A}};E.1n.5L=J(){L b=0,3b=0,Y=6[0],5l;7(Y)8M(E.14){L d=Y.1a,41=Y,1K=Y.1K,1L=Y.2i,5D=2d&&4s(5K)<8J&&!/a1/i.17(v),2T=E.1j(Y,"43")=="2T";7(Y.6G){L c=Y.6G();1b(c.26+24.2f(1L.1F.2v,1L.1h.2v),c.3b+24.2f(1L.1F.2x,1L.1h.2x));1b(-1L.1F.62,-1L.1F.60)}N{1b(Y.5G,Y.5F);2b(1K){1b(1K.5G,1K.5F);7(48&&!/^t(8H|d|h)$/i.17(1K.28)||2d&&!5D)2N(1K);7(!2T&&E.1j(1K,"43")=="2T")2T=P;41=/^1h$/i.17(1K.28)?41:1K;1K=1K.1K}2b(d&&d.28&&!/^1h|3q$/i.17(d.28)){7(!/^8G|1O.*$/i.17(E.1j(d,"19")))1b(-d.2v,-d.2x);7(48&&E.1j(d,"32")!="4d")2N(d);d=d.1a}7((5D&&(2T||E.1j(41,"43")=="4W"))||(48&&E.1j(41,"43")!="4W"))1b(-1L.1h.5G,-1L.1h.5F);7(2T)1b(24.2f(1L.1F.2v,1L.1h.2v),24.2f(1L.1F.2x,1L.1h.2x))}5l={3b:3b,26:b}}J 2N(a){1b(E.2o(a,"a8",P),E.2o(a,"a9",P))}J 1b(l,t){b+=4s(l)||0;3b+=4s(t)||0}K 5l}})();',62,631,'||||||this|if||||||||||||||||||||||||||||||||||||||function|return|var|length|else|data|true|for|each|false|document|type|null|style||elem||undefined|options|nodeName||browser|nodeType|event|test|arguments|display|parentNode|add|url|msie|window|indexOf|push|body|apply|css|constructor|prop|script|fn|typeof|in|isFunction|replace|extend|className|text|handle|opacity|div|complete|status|value|new|firstChild|match|filter|documentElement|show|dataType|hide|attr|offsetParent|doc|Array|trigger|table|call|break|height|try|cache|tbody|remove|success|catch|start|hidden||ready|get|split|Math|string|left|width|tagName|ret|global|while|map|safari|animate|max|toggle|toLowerCase|ownerDocument|bind|select|prototype|cur||curCSS|selected|handler|done|find|fx|duration|scrollLeft|id|scrollTop|special|opera|unit|nextSibling|stack|guid|toUpperCase|pushStack|button|none|makeArray|now|slice|target|parseFloat|border|exec|queue|isReady|events|px|fixed|timeout|delete|jsre|one|disabled|nth|step|name|overflow|inArray|removeChild|removeData|preventDefault|merge|appendChild|readyState|error|top|which|innerHTML|multiFilter|rl|trim|end|json|first|checked|async|param|elems|insertBefore|childNodes|html|encodeURIComponent|createElement|append|form|Date|unbind|color|grep|setTimeout|readyList|mouseleave|mouseenter|block|isXMLDoc|addEventListener|timers|is|password|last|runtimeStyle|getTime|xml|jQuery|domManip|ajax|src|callee|getElementsByTagName|selectedIndex|load|object|timerId|toString|has|easing|curAnim|offsetChild|args|position|stopPropagation|custom|props|orig|mozilla|accepts|clean|responseText|defaultView|visible|String|charCode|float|teardown|on|setup|nodeIndex|shift|javascript|currentStyle|application|child|RegExp|_|parseInt|previousSibling|dir|tr|state|empty|update|getAttribute|self|pos|setRequestHeader|input|jsonp|lastModified|_default|unload|ajaxSettings|unshift|getComputedStyle|styleSheets|getPropertyValue|lastToggle|mouseout|mouseover|GET|andSelf|relatedTarget|init|visibility|click|absolute|index|container|fix|outline|Number|removeAttribute|setInterval|prevObject|classFilter|not|unique|submit|file|after|windowData|deep|scroll|client|triggered|globalEval|jquery|sibling|swing|clone|results|wrapAll|triggerHandler|lastChild|dequeue|getResponseHeader|createTextNode|oldblock|checkbox|radio|handleError|fromElement|parsererror|old|00|Modified|startTime|ifModified|safari2|getWH|offsetTop|offsetLeft|active|values|getElementById|version|offset|bindReady|processData|val|contentType|ajaxSuccess|ajaxComplete|ajaxStart|serializeArray|notmodified|loaded|DOMContentLoaded|Width|ctrlKey|keyCode|clientTop|POST|clientLeft|clientX|pageX|exclusive|detachEvent|removeEventListener|swap|cloneNode|join|attachEvent|eval|ajaxStop|substr|head|parse|textarea|reset|image|zoom|odd|ajaxSend|even|before|username|prepend|expr|quickClass|uuid|quickID|quickChild|continue|textContent|appendTo|contents|evalScript|parent|defaultValue|ajaxError|setArray|compatMode|getBoundingClientRect|styleFloat|clearInterval|httpNotModified|nodeValue|100|alpha|_toggle|href|speed|throw|304|replaceWith|200|Last|colgroup|httpData|httpSuccess|beforeSend|eq|linear|concat|splice|fieldset|multiple|cssFloat|XMLHttpRequest|webkit|ActiveXObject|CSS1Compat|link|metaKey|scriptCharset|callback|col|pixelLeft|urlencoded|www|post|hasClass|getJSON|getScript|elements|serialize|black|keyup|keypress|solid|change|mousemove|mouseup|dblclick|resize|focus|blur|stylesheet|rel|doScroll|round|hover|padding|offsetHeight|mousedown|offsetWidth|Bottom|Top|keydown|clientY|Right|pageY|Left|toElement|srcElement|cancelBubble|returnValue|charAt|0n|substring|animated|header|noConflict|line|enabled|innerText|contains|only|weight|ajaxSetup|font|size|gt|lt|uFFFF|u0128|417|Boolean|inner|Height|toggleClass|removeClass|addClass|removeAttr|replaceAll|insertAfter|prependTo|contentWindow|contentDocument|wrap|iframe|children|siblings|prevAll|nextAll|prev|wrapInner|next|parents|maxLength|maxlength|readOnly|readonly|reverse|class|htmlFor|inline|able|boxModel|522|setData|compatible|with|1px|ie|getData|10000|ra|it|rv|PI|cos|userAgent|400|navigator|600|slow|Function|Object|array|stop|ig|NaN|fadeTo|option|fadeOut|fadeIn|setAttribute|slideToggle|slideUp|changed|slideDown|be|can|property|responseXML|content|1223|getAttributeNode|300|method|protocol|location|action|send|abort|cssText|th|td|cap|specified|Accept|With|colg|Requested|fast|tfoot|GMT|thead|1970|Jan|attributes|01|Thu|leg|Since|If|opt|Type|Content|embed|open|area|XMLHTTP|hr|Microsoft|onreadystatechange|onload|meta|adobeair|charset|http|1_|img|br|plain|borderLeftWidth|borderTopWidth|abbr'.split('|'),0,{})) \ No newline at end of file diff --git a/vendor/sunra/php-simple-html-dom-parser/Src/Sunra/PhpSimple/simplehtmldom_1_5/manual/js/ui.tabs.pack.js b/vendor/sunra/php-simple-html-dom-parser/Src/Sunra/PhpSimple/simplehtmldom_1_5/manual/js/ui.tabs.pack.js new file mode 100644 index 000000000..cfc226ada --- /dev/null +++ b/vendor/sunra/php-simple-html-dom-parser/Src/Sunra/PhpSimple/simplehtmldom_1_5/manual/js/ui.tabs.pack.js @@ -0,0 +1,10 @@ +/* + * Tabs 3 - New Wave Tabs + * + * Copyright (c) 2007 Klaus Hartl (stilbuero.de) + * Dual licensed under the MIT (MIT-LICENSE.txt) + * and GPL (GPL-LICENSE.txt) licenses. + * + * http://docs.jquery.com/UI/Tabs + */ +eval(function(p,a,c,k,e,r){e=function(c){return(c35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)r[e(c)]=k[c]||e(c);k=[function(e){return r[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('(6($){$.4=$.4||{};$.2o.3=6(){7 b=1K 1q[0]==\'1X\'&&1q[0];7 c=b&&1P.1N.2g.2c(1q,1)||1q;l b==\'C\'?$.m(2[0],\'4-3\').$3.C:2.I(6(){5(b){7 a=$.m(2,\'4-3\');a[b].2n(a,c)}D 2l $.4.3(2,c[0]||{})})};$.4.3=6(e,f){7 d=2;2.q=e;2.8=$.1H({p:0,S:f.p===L,12:\'1A\',t:[],G:L,1l:\'2Bx;\',K:y,1R:\'4-3-\',1j:{},X:L,1Q:\'<1h>#{1g}\',1v:\'<1L>\',1f:\'4-3-2f\',w:\'4-3-p\',1t:\'4-3-S\',Q:\'4-3-t\',U:\'4-3-1e\',M:\'4-3-Y\',1s:\'4-3-2Y\'},f);5(f.p===L)2.8.p=L;2.8.12+=\'.4-3\';2.8.G=$.G&&$.G.28==2V&&2.8.G;$(e).1b(\'2T.4-3\',6(b,c,a){5((/^p/).27(c))d.1o(a);D{d.8[c]=a;d.11()}}).1b(\'2Q.4-3\',6(a,b){l d.8[b]});$.m(e,\'4-3\',2);2.11(1a)};$.1H($.4.3.1N,{1z:6(a){l a.22&&a.22.V(/\\s/g,\'1Z\').V(/[^A-2A-2y-9\\-1Z:\\.]/g,\'\')||2.8.1R+$.m(a)},4:6(a,b){l{2w:2,8:2.8,2v:a,1e:b}},11:6(f){2.$u=$(\'E:2s(a[x])\',2.q);2.$3=2.$u.1i(6(){l $(\'a\',2)[0]});2.$k=$([]);7 e=2,o=2.8;2.$3.I(6(i,a){5(a.H&&a.H.V(\'#\',\'\'))e.$k=e.$k.17(a.H);D 5($(a).W(\'x\')!=\'#\'){$.m(a,\'x.4-3\',a.x);$.m(a,\'z.4-3\',a.x);7 b=e.1z(a);a.x=\'#\'+b;7 c=$(\'#\'+b);5(!c.C){c=$(o.1v).W(\'16\',b).v(o.U).2m(e.$k[i-1]||e.q);c.m(\'15.4-3\',1a)}e.$k=e.$k.17(c)}D o.t.1O(i+1)});5(f){$(2.q).J(o.1f)||$(2.q).v(o.1f);2.$k.I(6(){7 a=$(2);a.J(o.U)||a.v(o.U)});2.$3.I(6(i,a){5(1w.H){5(a.H==1w.H){o.p=i;5($.O.14||$.O.2k){7 b=$(1w.H),1M=b.W(\'16\');b.W(\'16\',\'\');1u(6(){b.W(\'16\',1M)},2j)}2i(0,0);l y}}D 5(o.G){7 c=2h($.G(\'4-3\'+$.m(e.q)),10);5(c&&e.$3[c]){o.p=c;l y}}D 5(e.$u.F(i).J(o.w)){o.p=i;l y}});2.$k.v(o.M);2.$u.B(o.w);5(!o.S){2.$k.F(o.p).N().B(o.M);2.$u.F(o.p).v(o.w)}7 h=!o.S&&$.m(2.$3[o.p],\'z.4-3\');5(h)2.z(o.p);o.t=$.2e(o.t.2d($.1i(2.$u.T(\'.\'+o.Q),6(n,i){l e.$u.Z(n)}))).1J();$(2b).1b(\'2a\',6(){e.$3.1d(\'.4-3\');e.$u=e.$3=e.$k=L})}29(7 i=0,E;E=2.$u[i];i++)$(E)[$.1I(i,o.t)!=-1&&!$(E).J(o.w)?\'v\':\'B\'](o.Q);5(o.K===y)2.$3.1r(\'K.4-3\');7 j,R,1c={\'2X-2W\':0,1G:1},1F=\'2U\';5(o.X&&o.X.28==1P)j=o.X[0]||1c,R=o.X[1]||1c;D j=R=o.X||1c;7 g={1p:\'\',2S:\'\',2R:\'\'};5(!$.O.14)g.1E=\'\';6 1D(b,c,a){c.26(j,j.1G||1F,6(){c.v(o.M).13(g);5($.O.14&&j.1E)c[0].24.T=\'\';5(a)1C(b,a,c)})}6 1C(b,a,c){5(R===1c)a.13(\'1p\',\'1B\');a.26(R,R.1G||1F,6(){a.B(o.M).13(g);5($.O.14&&R.1E)a[0].24.T=\'\';$(e.q).P(\'N.4-3\',[e.4(b,a[0])])})}6 23(c,a,d,b){a.v(o.w).2P().B(o.w);1D(c,d,b)}2.$3.1d(\'.4-3\').1b(o.12,6(){7 b=$(2).2O(\'E:F(0)\'),$Y=e.$k.T(\':2N\'),$N=$(2.H);5((b.J(o.w)&&!o.S)||b.J(o.Q)||$(e.q).P(\'1o.4-3\',[e.4(2,$N[0])])===y){2.1k();l y}e.8.p=e.$3.Z(2);5(o.S){5(b.J(o.w)){e.8.p=L;b.B(o.w);e.$k.1y();1D(2,$Y);2.1k();l y}D 5(!$Y.C){e.$k.1y();7 a=2;e.z(e.$3.Z(2),6(){b.v(o.w).v(o.1t);1C(a,$N)});2.1k();l y}}5(o.G)$.G(\'4-3\'+$.m(e.q),e.8.p,o.G);e.$k.1y();5($N.C){7 a=2;e.z(e.$3.Z(2),6(){23(a,b,$Y,$N)})}D 2M\'21 2K 2J: 2H 2G 2F.\';5($.O.14)2.1k();l y});5(!(/^1A/).27(o.12))2.$3.1b(\'1A.4-3\',6(){l y})},17:6(d,e,f){5(f==1Y)f=2.$3.C;7 o=2.8;7 a=$(o.1Q.V(/#\\{x\\}/,d).V(/#\\{1g\\}/,e));a.m(\'15.4-3\',1a);7 b=d.2D(\'#\')==0?d.V(\'#\',\'\'):2.1z($(\'a:2C-2z\',a)[0]);7 c=$(\'#\'+b);5(!c.C){c=$(o.1v).W(\'16\',b).v(o.U).v(o.M);c.m(\'15.4-3\',1a)}5(f>=2.$u.C){a.1W(2.q);c.1W(2.q.2E)}D{a.1V(2.$u[f]);c.1V(2.$k[f])}o.t=$.1i(o.t,6(n,i){l n>=f?++n:n});2.11();5(2.$3.C==1){a.v(o.w);c.B(o.M);7 g=$.m(2.$3[0],\'z.4-3\');5(g)2.z(f,g)}$(2.q).P(\'17.4-3\',[2.4(2.$3[f],2.$k[f])])},19:6(a){7 o=2.8,$E=2.$u.F(a).19(),$1e=2.$k.F(a).19();5($E.J(o.w)&&2.$3.C>1)2.1o(a+(a+1<2.$3.C?1:-1));o.t=$.1i($.1U(o.t,6(n,i){l n!=a}),6(n,i){l n>=a?--n:n});2.11();$(2.q).P(\'19.4-3\',[2.4($E.2I(\'a\')[0],$1e[0])])},25:6(a){7 o=2.8;5($.1I(a,o.t)==-1)l;7 b=2.$u.F(a).B(o.Q);5($.O.2u){b.13(\'1p\',\'2L-1B\');1u(6(){b.13(\'1p\',\'1B\')},0)}o.t=$.1U(o.t,6(n,i){l n!=a});$(2.q).P(\'25.4-3\',[2.4(2.$3[a],2.$k[a])])},20:6(a){7 b=2,o=2.8;5(a!=o.p){2.$u.F(a).v(o.Q);o.t.1O(a);o.t.1J();$(2.q).P(\'20.4-3\',[2.4(2.$3[a],2.$k[a])])}},1o:6(a){5(1K a==\'1X\')a=2.$3.Z(2.$3.T(\'[x$=\'+a+\']\')[0]);2.$3.F(a).2t(2.8.12)},z:6(d,b){7 e=2,o=2.8,$a=2.$3.F(d),a=$a[0],1T=b==1Y|| b===y,18=$a.m(\'z.4-3\');b=b|| 6(){};5(!18|| ($.m(a,\'K.4-3\')&&!1T)){b();l}5(o.1l){7 g=$(\'1h\',a),1g=g.1n();g.1n(\'<1S>\'+o.1l+\'\')}7 c=6(){e.$3.T(\'.\'+o.1s).I(6(){$(2).B(o.1s);5(o.1l)$(\'1h\',2).1n(1g)});e.1m=L};7 f=$.1H({},o.1j,{18:18,1x:6(r,s){$(a.H).1n(r);c();b();5(o.K)$.m(a,\'K.4-3\',1a);$(e.q).P(\'z.4-3\',[e.4(e.$3[d],e.$k[d])]);o.1j.1x&&o.1j.1x(r,s)}});5(2.1m){2.1m.2r();c()}$a.v(o.1s);1u(6(){e.1m=$.2q(f)},0)},18:6(a,b){2.$3.F(a).1r(\'K.4-3\').m(\'z.4-3\',b)},15:6(){7 o=2.8;$(2.q).1d(\'.4-3\').B(o.1f).1r(\'4-3\');2.$3.I(6(){7 b=$.m(2,\'x.4-3\');5(b)2.x=b;7 c=$(2).1d(\'.4-3\');$.I([\'x\',\'z\',\'K\'],6(i,a){c.1r(a+\'.4-3\')})});2.$u.17(2.$k).I(6(){5($.m(2,\'15.4-3\'))$(2).19();D $(2).B([o.w,o.1t,o.Q,o.U,o.M].2p(\' \'))})}})})(21);',62,185,'||this|tabs|ui|if|function|var|options||||||||||||panels|return|data|||selected|element|||disabled|lis|addClass|selectedClass|href|false|load||removeClass|length|else|li|eq|cookie|hash|each|hasClass|cache|null|hideClass|show|browser|triggerHandler|disabledClass|showFx|unselect|filter|panelClass|replace|attr|fx|hide|index||tabify|event|css|msie|destroy|id|add|url|remove|true|bind|baseFx|unbind|panel|navClass|label|span|map|ajaxOptions|blur|spinner|xhr|html|select|display|arguments|removeData|loadingClass|unselectClass|setTimeout|panelTemplate|location|success|stop|tabId|click|block|showTab|hideTab|opacity|baseDuration|duration|extend|inArray|sort|typeof|div|toShowId|prototype|push|Array|tabTemplate|idPrefix|em|bypassCache|grep|insertBefore|appendTo|string|undefined|_|disable|jQuery|title|switchTab|style|enable|animate|test|constructor|for|unload|window|call|concat|unique|nav|slice|parseInt|scrollTo|500|opera|new|insertAfter|apply|fn|join|ajax|abort|has|trigger|safari|tab|instance|8230|z0|child|Za|Loading|first|indexOf|parentNode|identifier|fragment|Mismatching|find|Tabs|UI|inline|throw|visible|parents|siblings|getData|height|overflow|setData|normal|Function|width|min|loading'.split('|'),0,{})) \ No newline at end of file diff --git a/vendor/sunra/php-simple-html-dom-parser/Src/Sunra/PhpSimple/simplehtmldom_1_5/manual/manual.htm b/vendor/sunra/php-simple-html-dom-parser/Src/Sunra/PhpSimple/simplehtmldom_1_5/manual/manual.htm new file mode 100644 index 000000000..ed796e3bb --- /dev/null +++ b/vendor/sunra/php-simple-html-dom-parser/Src/Sunra/PhpSimple/simplehtmldom_1_5/manual/manual.htm @@ -0,0 +1,448 @@ + + + + +PHP Simple HTML DOM Parser: Manual + + + + + + + +

        PHP Simple HTML DOM Parser Manual

        +
        +

        Index

        + + + +

        Quick Start

        + Top +
        + +
        +
        + // Create DOM from URL or file
        + $html = file_get_html('http://www.google.com/');
        +
        + // Find all images
        + foreach($html->find('img') as $element)
        +       echo $element->src . '<br>';
        +
        +// Find all links
        +foreach($html->find('a') as $element)
        +       echo $element->href . '<br>';
        +
        +
        +
        + // Create DOM from string
        + $html = str_get_html('<div id="hello">Hello</div><div id="world">World</div>');
        +
        +
        + +$html->find('div', 1)->class = 'bar';
        +
        +$html->find('div[id=hello]', 0)->innertext = 'foo';
        +
        + echo $html; // Output: <div id="hello">foo</div><div id="world" class="bar">World</div>
        +
        +
        +

        + // Dump contents (without tags) from HTML
        + echo file_get_html('http://www.google.com/')->plaintext; +
        +
        +
        +
        +
        +
        + // Create DOM from URL
        + $html = file_get_html('http://slashdot.org/');
        +
        + // Find all article blocks
        + foreach($html->find('div.article') as $article) {
        +    $item['title']     = $article->find('div.title', 0)->plaintext;
        +    $item['intro']    = $article->find('div.intro', 0)->plaintext;
        +    $item['details'] = $article->find('div.details', 0)->plaintext;
        +    $articles[] = $item;
        + }
        +
        + print_r($articles); +
        +
        +
        + + +

        How to create HTML DOM object?

        + Top +
        + +
        +
        // Create a DOM object from a string
        + $html = str_get_html('<html><body>Hello!</body></html>');
        +
        + // Create a DOM object from a URL
        + $html = file_get_html('http://www.google.com/');
        +
        + // Create a DOM object from a HTML file
        + $html = file_get_html('test.htm');
        +
        +
        +
        +
        // Create a DOM object
        + $html = new simple_html_dom();
        +
        + // Load HTML from a string
        + $html->load('<html><body>Hello!</body></html>');
        +
        + // Load HTML from a URL
        + $html->load_file('http://www.google.com/');
        +
        + // Load HTML from a HTML file
        + $html->load_file('test.htm');
        +
        +
        + +

        How to find HTML elements?

        + Top +
        + +
        +
        // Find all anchors, returns a array of element objects
        + $ret = $html->find('a');
        +
        + // Find (N)th anchor, returns element object or null if not found (zero based)
        + $ret = $html->find('a', 0);
        +
        + // Find lastest anchor, returns element object or null if not found (zero based)
        +$ret = $html->find('a', -1);
        +
        + // Find all <div> with the id attribute
        +$ret = $html->find('div[id]');
        +
        + // Find all <div> which attribute id=foo
        +$ret = $html->find('div[id=foo]');
        +
        +
        +
        +
        // Find all element which id=foo
        + $ret = $html->find('#foo');
        +
        + // Find all element which class=foo
        + $ret = $html->find('.foo');
        +
        + // Find all element has attribute id
        +$ret = $html->find('*[id]');
        +
        + // Find all anchors and images
        +$ret = $html->find('a, img');
        +
        + // Find all anchors and images with the "title" attribute
        + $ret = $html->find('a[title], img[title]');
        +
        +
        +
        +
        + Supports these operators in attribute selectors:

        + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
        FilterDescription
        [attribute]Matches elements that have the specified attribute.
        [!attribute]Matches elements that don't have the specified attribute.
        [attribute=value]Matches elements that have the specified attribute with a certain value.
        [attribute!=value]Matches elements that don't have the specified attribute with a certain value.
        [attribute^=value]Matches elements that have the specified attribute and it starts with a certain value.
        [attribute$=value]Matches elements that have the specified attribute and it ends with a certain value.
        [attribute*=value]Matches elements that have the specified attribute and it contains a certain value.
        +
        +
        +
        +
        // Find all <li> in <ul>
        + $es = $html->find('ul li');
        +
        + // Find Nested <div> tags
        + $es = $html->find('div div div');
        +
        + // Find all <td> in <table> which class=hello
        + $es = $html->find('table.hello td');
        +
        + // Find all td tags with attribite align=center in table tags
        + $es = $html->find(''table td[align=center]');
        +
        +
        +
        +
        // Find all text blocks
        + $es = $html->find('text');
        +
        + // Find all comment (<!--...-->) blocks
        + $es = $html->find('comment');
        +
        +
        +
        +
        // Find all <li> in <ul>
        + foreach($html->find('ul') as $ul)
        + {
        +       foreach($ul->find('li') as $li)
        +       {
        +             // do something...
        +       }
        + }
        +
        + // Find first <li> in first <ul>
        + $e = $html->find('ul', 0)->find('li', 0);
        +
        +
        +
        + +

        How to access the HTML element's attributes?

        + Top +
        + +
        +
        + // Get a attribute ( If the attribute is non-value attribute (eg. checked, selected...), it will returns true or false)
        + $value = $e->href;
        +
        + // Set a attribute(If the attribute is non-value attribute (eg. checked, selected...), set it's value as true or false)
        + $e->href = 'my link';
        +
        + // Remove a attribute, set it's value as null!
        + $e->href = null;
        +
        + // Determine whether a attribute exist?
        +if(isset($e->href))
        +        echo 'href exist!';
        +
        +
        +
        +
        // Example
        + $html = str_get_html("<div>foo <b>bar</b></div>");
        + $e = $html->find("div", 0);
        +
        + echo $e->tag; // Returns: " div"
        + echo $e->outertext; // Returns: " <div>foo <b>bar</b></div>"
        + echo $e->innertext; // Returns: " foo <b>bar</b>"
        + echo $e->plaintext; // Returns: " foo bar"
        +
        +
        + + + + + + + + + + + + + + + + + + + + + +
        Attribute NameUsage
        $e->tagRead or write the tag name of element.
        $e->outertextRead or write the outer HTML text of element.
        $e->innertextRead or write the inner HTML text of element.
        $e->plaintextRead or write the plain text of element.
        +
        +
        +
        +
        // Extract contents from HTML
        +echo $html->plaintext;
        +
        + + // Wrap a element
        + $e->outertext = '<div class="wrap">' . $e->outertext . '<div>';
        +
        + // Remove a element, set it's outertext as an empty string
        + $e->outertext = '';
        +
        + // Append a element
        +$e->outertext = $e->outertext . '<div>foo<div>';
        +
        +// Insert a element
        +$e->outertext = '<div>foo<div>' . $e->outertext;
        +
        +
        +
        + +

        How to traverse the DOM tree?

        + Top +
        + +
        +
        // If you are not so familiar with HTML DOM, check this link to learn more...
        +
        + // Example
        + echo $html->find("#div1", 0)->children(1)->children(1)->children(2)->id;
        + // or
        + echo $html->getElementById("div1")->childNodes(1)->childNodes(1)->childNodes(2)->getAttribute('id');
        +
        +
        +
        You can also call methods with Camel naming convertions.
        + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
        Method Description
        +
        mixed
        $e->children ( [int $index] )
        Returns the Nth child object if index is set, otherwise return an array of children.
        +
        element
        $e->parent ()
        Returns the parent of element.
        +
        element
        $e->first_child ()
        Returns the first child of element, or null if not found.
        +
        element
        $e->last_child ()
        Returns the last child of element, or null if not found.
        +
        element
        $e->next_sibling ()
        Returns the next sibling of element, or null if not found.
        +
        element
        $e->prev_sibling ()
        Returns the previous sibling of element, or null if not found.
        +
        +
        + +
        + +

        How to dump contents of DOM object?

        + Top +
        + +
        +
        // Dumps the internal DOM tree back into string
        + $str = $html->save();
        +
        + // Dumps the internal DOM tree back into a file
        + $html->save('result.htm');
        +
        +
        +
        // Dumps the internal DOM tree back into string
        + $str = $html;
        +
        + // Print it!
        + echo $html;
        +
        +
        +
        + +

        How to customize the parsing behavior?

        + Top +
        + +
        +
        // Write a function with parameter "$element"
        + function my_callback($element) {
        +         // Hide all <b> tags
        +        if ($element->tag=='b')
        +                 $element->outertext = '';
        + }
        +
        + // Register the callback function with it's function name
        + $html->set_callback('my_callback');
        +
        + // Callback function will be invoked while dumping
        + echo $html; +
        +
        +
        + +

        + Author: S.C. Chen (me578022@gmail.com)
        +Original idea is from Jose Solorzano's HTML Parser for PHP 4.
        +Contributions by: Contributions by: Yousuke Kumakura, Vadim Voituk, Antcs
        +
        +
        + + + \ No newline at end of file diff --git a/vendor/sunra/php-simple-html-dom-parser/Src/Sunra/PhpSimple/simplehtmldom_1_5/manual/manual_api.htm b/vendor/sunra/php-simple-html-dom-parser/Src/Sunra/PhpSimple/simplehtmldom_1_5/manual/manual_api.htm new file mode 100644 index 000000000..365870f4b --- /dev/null +++ b/vendor/sunra/php-simple-html-dom-parser/Src/Sunra/PhpSimple/simplehtmldom_1_5/manual/manual_api.htm @@ -0,0 +1,320 @@ + + + + +PHP Simple HTML DOM Parser: API Reference + + + +

        PHP Simple HTML DOM Parser Manual

        +
        +

        Index

        + + +

        API Reference

        + Top +
        Helper functions + + + + + + + + + + + + + +
        NameDescription
        object str_get_html ( string $content )Creates a DOM object from a string.
        object file_get_html ( string $filename )Creates a DOM object from a file or a URL.
        +
        + DOM methods & properties
        + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
        Name Description
        +
        void
        + __construct ( [string $filename] )
        Constructor, set the filename parameter will automatically load the contents, either text or file/url.
        +
        string
        + plaintext
        Returns the contents extracted from HTML.
        +
        void
        + clear ()
        Clean up memory.
        +
        void
        + load ( string $content )
        Load contents from a string.
        +
        string
        + save ( [string $filename] )
        Dumps the internal DOM tree back into a string. If the $filename is set, result string will save to file.
        +
        void
        + load_file ( string $filename )
        Load contents from a from a file or a URL.
        +
        void
        + set_callback ( string $function_name )
        Set a callback function.
        +
        mixed
        + find ( string $selector [, int $index] )
        Find elements by the CSS selector. Returns the Nth element object if index is set, otherwise return an array of object.
        +
        + Element methods & properties
        + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
        NameDescription
        +
        string
        + [attribute]
        Read or write element's attribure value.
        +
        string
        + tag
        Read or write the tag name of element.
        +
        string
        + outertext
        Read or write the outer HTML text of element.
        +
        string
        + innertext
        Read or write the inner HTML text of element.
        +
        string
        + plaintext
        Read or write the plain text of element.
        +
        mixed
        + find ( string $selector [, int $index] )
        Find children by the CSS selector. Returns the Nth element object if index is set, otherwise, return an array of object.
        +
        + DOM
        traversing
        + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
        NameDescription
        +
        mixed
        + $e->children ( [int $index] )
        Returns the Nth child object if index is set, otherwise return an array of children.
        +
        element
        + $e->parent ()
        Returns the parent of element.
        +
        element
        + $e->first_child ()
        Returns the first child of element, or null if not found.
        +
        element
        + $e->last_child ()
        Returns the last child of element, or null if not found.
        +
        element
        + $e->next_sibling ()
        Returns the next sibling of element, or null if not found.
        +
        element
        + $e->prev_sibling ()
        Returns the previous sibling of element, or null if not found.
        +
        + +

        Camel naming convertions

        + Top +
        You can also call methods with W3C STANDARD camel naming convertions.
        +
        + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
        MethodMapping
        +
        array
        + $e->getAllAttributes ()
        +
        array
        + $e->attr
        +
        string
        + $e->getAttribute ( $name )
        +
        string
        + $e->attribute
        +
        void
        + $e->setAttribute ( $name, $value )
        +
        void
        + $value = $e->attribute
        +
        bool
        + $e->hasAttribute ( $name )
        +
        bool
        + isset($e->attribute)
        +
        void
        + $e->removeAttribute ( $name )
        +
        void
        + $e->attribute = null
        +
        element
        + $e->getElementById ( $id )
        +
        mixed
        + $e->find ( "#$id", 0 )
        +
        mixed
        + $e->getElementsById ( $id [,$index] )
        +
        mixed
        + $e->find ( "#$id" [, int $index] )
        +
        element
        + $e->getElementByTagName ($name )
        +
        mixed
        + $e->find ( $name, 0 )
        +
        mixed
        + $e->getElementsByTagName ( $name [, $index] )
        +
        mixed
        + $e->find ( $name [, int $index] )
        +
        element
        + $e->parentNode ()
        +
        element
        + $e->parent ()
        +
        mixed
        + $e->childNodes ( [$index] )
        +
        mixed
        + $e->children ( [int $index] )
        +
        element
        + $e->firstChild ()
        +
        element
        + $e->first_child ()
        +
        element
        + $e->lastChild ()
        +
        element
        + $e->last_child ()
        +
        element
        + $e->nextSibling ()
        +
        element
        + $e->next_sibling ()
        +
        element
        + $e->previousSibling ()
        +
        element
        + $e->prev_sibling ()
        +
        +

        + Author: S.C. Chen (me578022@gmail.com)
        +Original idea is from Jose Solorzano's HTML Parser for PHP 4.
        +Contributions by: Contributions by: Yousuke Kumakura, Vadim Voituk, Antcs
        +
        +
        + + + \ No newline at end of file diff --git a/vendor/sunra/php-simple-html-dom-parser/Src/Sunra/PhpSimple/simplehtmldom_1_5/manual/manual_faq.htm b/vendor/sunra/php-simple-html-dom-parser/Src/Sunra/PhpSimple/simplehtmldom_1_5/manual/manual_faq.htm new file mode 100644 index 000000000..3763eaa78 --- /dev/null +++ b/vendor/sunra/php-simple-html-dom-parser/Src/Sunra/PhpSimple/simplehtmldom_1_5/manual/manual_faq.htm @@ -0,0 +1,91 @@ + + + + +PHP Simple HTML DOM Parser: FAQ + + + +

        PHP Simple HTML DOM Parser Manual

        +
        +

        FAQ

        + +
        + +

        Problem with finding

        + Top +
        Q: Element not found in such case:
        + $html->find('div[style=padding: 0px 2px;] span[class=rf]');
        +
        + A: If there is blank in selectors, quote it!  
        + $html->find('div[style="padding: 0px 2px;"] span[class=rf]');
        + +

        Problem with hosting

        + Top +
        Q: On my local server everything works fine, but when I put it on my esternal server it doesn't work. 
        +
        + A: The "file_get_dom" function is a wrapper of "file_get_contents" function,  you must set "allow_url_fopen" as TRUE in "php.ini" to allow accessing files via HTTP or FTP. However, some hosting venders disabled PHP's "allow_url_fopen" flag for security issues... PHP provides excellent support for "curl" library to do the same job, Use curl to get the page, then call "str_get_dom" to create DOM object. 
        +
        + Example: 
        +  
        + $curl = curl_init(); 
        + curl_setopt($curl, CURLOPT_URL, 'http://????????');  
        + curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);  
        + curl_setopt($curl, CURLOPT_CONNECTTIMEOUT, 10);  
        + $str = curl_exec($curl);  
        + curl_close($curl);  
        +  
        + $html= str_get_html($str); 
        + ... 
        + +
        +

        Behind a proxy

        + Top +
        Q: My server is behind a Proxy and i can't use file_get_contents b/c it returns a unauthorized error.
        +
        + A: Thanks for Shaggy to provide the solution: 
        +  
        + // Define a context for HTTP. 
        + $context = array
        + ( 
        +       'http' => array
        +       ( 
        +              'proxy' => 'addresseproxy:portproxy', // This needs to be the server and the port of the NTLM Authentication Proxy Server. 
        +              'request_fulluri' => true, 
        +       ), 
        + ); 
        +
        + $context = stream_context_create($context); 
        +  
        + $html= file_get_html('http://www.php.net', false, $context); 
        + ...
        +
        +
        + +

        Memory leak!

        + Top +
        Q: This script is leaking memory seriously... After it finished running, it's not cleaning up dom object properly from memory.. 
        +
        + A: Due to php5 circular references memory leak, after creating DOM object, you must call $dom->clear() to free memory if call file_get_dom() more then once. 
        +
        + Example: 
        +
        + $html = file_get_html(...); 
        + // do something... 
        + $html->clear(); 
        + unset($html);
        +
        + Author: S.C. Chen (me578022@gmail.com)
        +Original idea is from Jose Solorzano's HTML Parser for PHP 4.
        +Contributions by: Yousuke Kumakura, Vadim Voituk, Antcs
        +
        +
        + + + diff --git a/vendor/sunra/php-simple-html-dom-parser/Src/Sunra/PhpSimple/simplehtmldom_1_5/simple_html_dom.php b/vendor/sunra/php-simple-html-dom-parser/Src/Sunra/PhpSimple/simplehtmldom_1_5/simple_html_dom.php new file mode 100644 index 000000000..9a7b2f668 --- /dev/null +++ b/vendor/sunra/php-simple-html-dom-parser/Src/Sunra/PhpSimple/simplehtmldom_1_5/simple_html_dom.php @@ -0,0 +1,1721 @@ +size is the "real" number of bytes the dom was created from. + * but for most purposes, it's a really good estimation. + * Paperg - Added the forceTagsClosed to the dom constructor. Forcing tags closed is great for malformed html, but it CAN lead to parsing errors. + * Allow the user to tell us how much they trust the html. + * Paperg add the text and plaintext to the selectors for the find syntax. plaintext implies text in the innertext of a node. text implies that the tag is a text node. + * This allows for us to find tags based on the text they contain. + * Create find_ancestor_tag to see if a tag is - at any level - inside of another specific tag. + * Paperg: added parse_charset so that we know about the character set of the source document. + * NOTE: If the user's system has a routine called get_last_retrieve_url_contents_content_type availalbe, we will assume it's returning the content-type header from the + * last transfer or curl_exec, and we will parse that and use it in preference to any other method of charset detection. + * + * Found infinite loop in the case of broken html in restore_noise. Rewrote to protect from that. + * PaperG (John Schlick) Added get_display_size for "IMG" tags. + * + * Licensed under The MIT License + * Redistributions of files must retain the above copyright notice. + * + * @author S.C. Chen + * @author John Schlick + * @author Rus Carroll + * @version 1.5 ($Rev: 196 $) + * @package PlaceLocalInclude + * @subpackage simple_html_dom + */ + +/** + * All of the Defines for the classes below. + * @author S.C. Chen + */ +define('HDOM_TYPE_ELEMENT', 1); +define('HDOM_TYPE_COMMENT', 2); +define('HDOM_TYPE_TEXT', 3); +define('HDOM_TYPE_ENDTAG', 4); +define('HDOM_TYPE_ROOT', 5); +define('HDOM_TYPE_UNKNOWN', 6); +define('HDOM_QUOTE_DOUBLE', 0); +define('HDOM_QUOTE_SINGLE', 1); +define('HDOM_QUOTE_NO', 3); +define('HDOM_INFO_BEGIN', 0); +define('HDOM_INFO_END', 1); +define('HDOM_INFO_QUOTE', 2); +define('HDOM_INFO_SPACE', 3); +define('HDOM_INFO_TEXT', 4); +define('HDOM_INFO_INNER', 5); +define('HDOM_INFO_OUTER', 6); +define('HDOM_INFO_ENDSPACE',7); +define('DEFAULT_TARGET_CHARSET', 'UTF-8'); +define('DEFAULT_BR_TEXT', "\r\n"); +define('DEFAULT_SPAN_TEXT', " "); +define('MAX_FILE_SIZE', 600000); +// helper functions +// ----------------------------------------------------------------------------- +// get html dom from file +// $maxlen is defined in the code as PHP_STREAM_COPY_ALL which is defined as -1. +function file_get_html($url, $use_include_path = false, $context=null, $offset = -1, $maxLen=-1, $lowercase = true, $forceTagsClosed=true, $target_charset = DEFAULT_TARGET_CHARSET, $stripRN=true, $defaultBRText=DEFAULT_BR_TEXT, $defaultSpanText=DEFAULT_SPAN_TEXT) +{ + // We DO force the tags to be terminated. + $dom = new simple_html_dom(null, $lowercase, $forceTagsClosed, $target_charset, $stripRN, $defaultBRText, $defaultSpanText); + // For sourceforge users: uncomment the next line and comment the retreive_url_contents line 2 lines down if it is not already done. + $contents = file_get_contents($url, $use_include_path, $context, $offset); + // Paperg - use our own mechanism for getting the contents as we want to control the timeout. + //$contents = retrieve_url_contents($url); + if (empty($contents) || strlen($contents) > MAX_FILE_SIZE) + { + return false; + } + // The second parameter can force the selectors to all be lowercase. + $dom->load($contents, $lowercase, $stripRN); + return $dom; +} + +// get html dom from string +function str_get_html($str, $lowercase=true, $forceTagsClosed=true, $target_charset = DEFAULT_TARGET_CHARSET, $stripRN=true, $defaultBRText=DEFAULT_BR_TEXT, $defaultSpanText=DEFAULT_SPAN_TEXT) +{ + $dom = new simple_html_dom(null, $lowercase, $forceTagsClosed, $target_charset, $stripRN, $defaultBRText, $defaultSpanText); + if (empty($str) || strlen($str) > MAX_FILE_SIZE) + { + $dom->clear(); + return false; + } + $dom->load($str, $lowercase, $stripRN); + return $dom; +} + +// dump html dom tree +function dump_html_tree($node, $show_attr=true, $deep=0) +{ + $node->dump($node); +} + + +/** + * simple html dom node + * PaperG - added ability for "find" routine to lowercase the value of the selector. + * PaperG - added $tag_start to track the start position of the tag in the total byte index + * + * @package PlaceLocalInclude + */ +class simple_html_dom_node +{ + public $nodetype = HDOM_TYPE_TEXT; + public $tag = 'text'; + public $attr = array(); + public $children = array(); + public $nodes = array(); + public $parent = null; + // The "info" array - see HDOM_INFO_... for what each element contains. + public $_ = array(); + public $tag_start = 0; + private $dom = null; + + function __construct($dom) + { + $this->dom = $dom; + $dom->nodes[] = $this; + } + + function __destruct() + { + $this->clear(); + } + + function __toString() + { + return $this->outertext(); + } + + // clean up memory due to php5 circular references memory leak... + function clear() + { + $this->dom = null; + $this->nodes = null; + $this->parent = null; + $this->children = null; + } + + // dump node's tree + function dump($show_attr=true, $deep=0) + { + $lead = str_repeat(' ', $deep); + + echo $lead.$this->tag; + if ($show_attr && count($this->attr)>0) + { + echo '('; + foreach ($this->attr as $k=>$v) + echo "[$k]=>\"".$this->$k.'", '; + echo ')'; + } + echo "\n"; + + if ($this->nodes) + { + foreach ($this->nodes as $c) + { + $c->dump($show_attr, $deep+1); + } + } + } + + + // Debugging function to dump a single dom node with a bunch of information about it. + function dump_node($echo=true) + { + + $string = $this->tag; + if (count($this->attr)>0) + { + $string .= '('; + foreach ($this->attr as $k=>$v) + { + $string .= "[$k]=>\"".$this->$k.'", '; + } + $string .= ')'; + } + if (count($this->_)>0) + { + $string .= ' $_ ('; + foreach ($this->_ as $k=>$v) + { + if (is_array($v)) + { + $string .= "[$k]=>("; + foreach ($v as $k2=>$v2) + { + $string .= "[$k2]=>\"".$v2.'", '; + } + $string .= ")"; + } else { + $string .= "[$k]=>\"".$v.'", '; + } + } + $string .= ")"; + } + + if (isset($this->text)) + { + $string .= " text: (" . $this->text . ")"; + } + + $string .= " HDOM_INNER_INFO: '"; + if (isset($node->_[HDOM_INFO_INNER])) + { + $string .= $node->_[HDOM_INFO_INNER] . "'"; + } + else + { + $string .= ' NULL '; + } + + $string .= " children: " . count($this->children); + $string .= " nodes: " . count($this->nodes); + $string .= " tag_start: " . $this->tag_start; + $string .= "\n"; + + if ($echo) + { + echo $string; + return; + } + else + { + return $string; + } + } + + // returns the parent of node + // If a node is passed in, it will reset the parent of the current node to that one. + function parent($parent=null) + { + // I am SURE that this doesn't work properly. + // It fails to unset the current node from it's current parents nodes or children list first. + if ($parent !== null) + { + $this->parent = $parent; + $this->parent->nodes[] = $this; + $this->parent->children[] = $this; + } + + return $this->parent; + } + + // verify that node has children + function has_child() + { + return !empty($this->children); + } + + // returns children of node + function children($idx=-1) + { + if ($idx===-1) + { + return $this->children; + } + if (isset($this->children[$idx])) return $this->children[$idx]; + return null; + } + + // returns the first child of node + function first_child() + { + if (count($this->children)>0) + { + return $this->children[0]; + } + return null; + } + + // returns the last child of node + function last_child() + { + if (($count=count($this->children))>0) + { + return $this->children[$count-1]; + } + return null; + } + + // returns the next sibling of node + function next_sibling() + { + if ($this->parent===null) + { + return null; + } + + $idx = 0; + $count = count($this->parent->children); + while ($idx<$count && $this!==$this->parent->children[$idx]) + { + ++$idx; + } + if (++$idx>=$count) + { + return null; + } + return $this->parent->children[$idx]; + } + + // returns the previous sibling of node + function prev_sibling() + { + if ($this->parent===null) return null; + $idx = 0; + $count = count($this->parent->children); + while ($idx<$count && $this!==$this->parent->children[$idx]) + ++$idx; + if (--$idx<0) return null; + return $this->parent->children[$idx]; + } + + // function to locate a specific ancestor tag in the path to the root. + function find_ancestor_tag($tag) + { + global $debugObject; + if (is_object($debugObject)) { $debugObject->debugLogEntry(1); } + + // Start by including ourselves in the comparison. + $returnDom = $this; + + while (!is_null($returnDom)) + { + if (is_object($debugObject)) { $debugObject->debugLog(2, "Current tag is: " . $returnDom->tag); } + + if ($returnDom->tag == $tag) + { + break; + } + $returnDom = $returnDom->parent; + } + return $returnDom; + } + + // get dom node's inner html + function innertext() + { + if (isset($this->_[HDOM_INFO_INNER])) return $this->_[HDOM_INFO_INNER]; + if (isset($this->_[HDOM_INFO_TEXT])) return $this->dom->restore_noise($this->_[HDOM_INFO_TEXT]); + + $ret = ''; + foreach ($this->nodes as $n) + $ret .= $n->outertext(); + return $ret; + } + + // get dom node's outer text (with tag) + function outertext() + { + global $debugObject; + if (is_object($debugObject)) + { + $text = ''; + if ($this->tag == 'text') + { + if (!empty($this->text)) + { + $text = " with text: " . $this->text; + } + } + $debugObject->debugLog(1, 'Innertext of tag: ' . $this->tag . $text); + } + + if ($this->tag==='root') return $this->innertext(); + + // trigger callback + if ($this->dom && $this->dom->callback!==null) + { + call_user_func_array($this->dom->callback, array($this)); + } + + if (isset($this->_[HDOM_INFO_OUTER])) return $this->_[HDOM_INFO_OUTER]; + if (isset($this->_[HDOM_INFO_TEXT])) return $this->dom->restore_noise($this->_[HDOM_INFO_TEXT]); + + // render begin tag + if ($this->dom && $this->dom->nodes[$this->_[HDOM_INFO_BEGIN]]) + { + $ret = $this->dom->nodes[$this->_[HDOM_INFO_BEGIN]]->makeup(); + } else { + $ret = ""; + } + + // render inner text + if (isset($this->_[HDOM_INFO_INNER])) + { + // If it's a br tag... don't return the HDOM_INNER_INFO that we may or may not have added. + if ($this->tag != "br") + { + $ret .= $this->_[HDOM_INFO_INNER]; + } + } else { + if ($this->nodes) + { + foreach ($this->nodes as $n) + { + $ret .= $this->convert_text($n->outertext()); + } + } + } + + // render end tag + if (isset($this->_[HDOM_INFO_END]) && $this->_[HDOM_INFO_END]!=0) + $ret .= 'tag.'>'; + return $ret; + } + + // get dom node's plain text + function text() + { + if (isset($this->_[HDOM_INFO_INNER])) return $this->_[HDOM_INFO_INNER]; + switch ($this->nodetype) + { + case HDOM_TYPE_TEXT: return $this->dom->restore_noise($this->_[HDOM_INFO_TEXT]); + case HDOM_TYPE_COMMENT: return ''; + case HDOM_TYPE_UNKNOWN: return ''; + } + if (strcasecmp($this->tag, 'script')===0) return ''; + if (strcasecmp($this->tag, 'style')===0) return ''; + + $ret = ''; + // In rare cases, (always node type 1 or HDOM_TYPE_ELEMENT - observed for some span tags, and some p tags) $this->nodes is set to NULL. + // NOTE: This indicates that there is a problem where it's set to NULL without a clear happening. + // WHY is this happening? + if (!is_null($this->nodes)) + { + foreach ($this->nodes as $n) + { + $ret .= $this->convert_text($n->text()); + } + + // If this node is a span... add a space at the end of it so multiple spans don't run into each other. This is plaintext after all. + if ($this->tag == "span") + { + $ret .= $this->dom->default_span_text; + } + + + } + return $ret; + } + + function xmltext() + { + $ret = $this->innertext(); + $ret = str_ireplace('', '', $ret); + return $ret; + } + + // build node's text with tag + function makeup() + { + // text, comment, unknown + if (isset($this->_[HDOM_INFO_TEXT])) return $this->dom->restore_noise($this->_[HDOM_INFO_TEXT]); + + $ret = '<'.$this->tag; + $i = -1; + + foreach ($this->attr as $key=>$val) + { + ++$i; + + // skip removed attribute + if ($val===null || $val===false) + continue; + + $ret .= $this->_[HDOM_INFO_SPACE][$i][0]; + //no value attr: nowrap, checked selected... + if ($val===true) + $ret .= $key; + else { + switch ($this->_[HDOM_INFO_QUOTE][$i]) + { + case HDOM_QUOTE_DOUBLE: $quote = '"'; break; + case HDOM_QUOTE_SINGLE: $quote = '\''; break; + default: $quote = ''; + } + $ret .= $key.$this->_[HDOM_INFO_SPACE][$i][1].'='.$this->_[HDOM_INFO_SPACE][$i][2].$quote.$val.$quote; + } + } + $ret = $this->dom->restore_noise($ret); + return $ret . $this->_[HDOM_INFO_ENDSPACE] . '>'; + } + + // find elements by css selector + //PaperG - added ability for find to lowercase the value of the selector. + function find($selector, $idx=null, $lowercase=false) + { + $selectors = $this->parse_selector($selector); + if (($count=count($selectors))===0) return array(); + $found_keys = array(); + + // find each selector + for ($c=0; $c<$count; ++$c) + { + // The change on the below line was documented on the sourceforge code tracker id 2788009 + // used to be: if (($levle=count($selectors[0]))===0) return array(); + if (($levle=count($selectors[$c]))===0) return array(); + if (!isset($this->_[HDOM_INFO_BEGIN])) return array(); + + $head = array($this->_[HDOM_INFO_BEGIN]=>1); + + // handle descendant selectors, no recursive! + for ($l=0; $l<$levle; ++$l) + { + $ret = array(); + foreach ($head as $k=>$v) + { + $n = ($k===-1) ? $this->dom->root : $this->dom->nodes[$k]; + //PaperG - Pass this optional parameter on to the seek function. + $n->seek($selectors[$c][$l], $ret, $lowercase); + } + $head = $ret; + } + + foreach ($head as $k=>$v) + { + if (!isset($found_keys[$k])) + $found_keys[$k] = 1; + } + } + + // sort keys + ksort($found_keys); + + $found = array(); + foreach ($found_keys as $k=>$v) + $found[] = $this->dom->nodes[$k]; + + // return nth-element or array + if (is_null($idx)) return $found; + else if ($idx<0) $idx = count($found) + $idx; + return (isset($found[$idx])) ? $found[$idx] : null; + } + + // seek for given conditions + // PaperG - added parameter to allow for case insensitive testing of the value of a selector. + protected function seek($selector, &$ret, $lowercase=false) + { + global $debugObject; + if (is_object($debugObject)) { $debugObject->debugLogEntry(1); } + + list($tag, $key, $val, $exp, $no_key) = $selector; + + // xpath index + if ($tag && $key && is_numeric($key)) + { + $count = 0; + foreach ($this->children as $c) + { + if ($tag==='*' || $tag===$c->tag) { + if (++$count==$key) { + $ret[$c->_[HDOM_INFO_BEGIN]] = 1; + return; + } + } + } + return; + } + + $end = (!empty($this->_[HDOM_INFO_END])) ? $this->_[HDOM_INFO_END] : 0; + if ($end==0) { + $parent = $this->parent; + while (!isset($parent->_[HDOM_INFO_END]) && $parent!==null) { + $end -= 1; + $parent = $parent->parent; + } + $end += $parent->_[HDOM_INFO_END]; + } + + for ($i=$this->_[HDOM_INFO_BEGIN]+1; $i<$end; ++$i) { + $node = $this->dom->nodes[$i]; + + $pass = true; + + if ($tag==='*' && !$key) { + if (in_array($node, $this->children, true)) + $ret[$i] = 1; + continue; + } + + // compare tag + if ($tag && $tag!=$node->tag && $tag!=='*') {$pass=false;} + // compare key + if ($pass && $key) { + if ($no_key) { + if (isset($node->attr[$key])) $pass=false; + } else { + if (($key != "plaintext") && !isset($node->attr[$key])) $pass=false; + } + } + // compare value + if ($pass && $key && $val && $val!=='*') { + // If they have told us that this is a "plaintext" search then we want the plaintext of the node - right? + if ($key == "plaintext") { + // $node->plaintext actually returns $node->text(); + $nodeKeyValue = $node->text(); + } else { + // this is a normal search, we want the value of that attribute of the tag. + $nodeKeyValue = $node->attr[$key]; + } + if (is_object($debugObject)) {$debugObject->debugLog(2, "testing node: " . $node->tag . " for attribute: " . $key . $exp . $val . " where nodes value is: " . $nodeKeyValue);} + + //PaperG - If lowercase is set, do a case insensitive test of the value of the selector. + if ($lowercase) { + $check = $this->match($exp, strtolower($val), strtolower($nodeKeyValue)); + } else { + $check = $this->match($exp, $val, $nodeKeyValue); + } + if (is_object($debugObject)) {$debugObject->debugLog(2, "after match: " . ($check ? "true" : "false"));} + + // handle multiple class + if (!$check && strcasecmp($key, 'class')===0) { + foreach (explode(' ',$node->attr[$key]) as $k) { + // Without this, there were cases where leading, trailing, or double spaces lead to our comparing blanks - bad form. + if (!empty($k)) { + if ($lowercase) { + $check = $this->match($exp, strtolower($val), strtolower($k)); + } else { + $check = $this->match($exp, $val, $k); + } + if ($check) break; + } + } + } + if (!$check) $pass = false; + } + if ($pass) $ret[$i] = 1; + unset($node); + } + // It's passed by reference so this is actually what this function returns. + if (is_object($debugObject)) {$debugObject->debugLog(1, "EXIT - ret: ", $ret);} + } + + protected function match($exp, $pattern, $value) { + global $debugObject; + if (is_object($debugObject)) {$debugObject->debugLogEntry(1);} + + switch ($exp) { + case '=': + return ($value===$pattern); + case '!=': + return ($value!==$pattern); + case '^=': + return preg_match("/^".preg_quote($pattern,'/')."/", $value); + case '$=': + return preg_match("/".preg_quote($pattern,'/')."$/", $value); + case '*=': + if ($pattern[0]=='/') { + return preg_match($pattern, $value); + } + return preg_match("/".$pattern."/i", $value); + } + return false; + } + + protected function parse_selector($selector_string) { + global $debugObject; + if (is_object($debugObject)) {$debugObject->debugLogEntry(1);} + + // pattern of CSS selectors, modified from mootools + // Paperg: Add the colon to the attrbute, so that it properly finds like google does. + // Note: if you try to look at this attribute, yo MUST use getAttribute since $dom->x:y will fail the php syntax check. +// Notice the \[ starting the attbute? and the @? following? This implies that an attribute can begin with an @ sign that is not captured. +// This implies that an html attribute specifier may start with an @ sign that is NOT captured by the expression. +// farther study is required to determine of this should be documented or removed. +// $pattern = "/([\w-:\*]*)(?:\#([\w-]+)|\.([\w-]+))?(?:\[@?(!?[\w-]+)(?:([!*^$]?=)[\"']?(.*?)[\"']?)?\])?([\/, ]+)/is"; + $pattern = "/([\w-:\*]*)(?:\#([\w-]+)|\.([\w-]+))?(?:\[@?(!?[\w-:]+)(?:([!*^$]?=)[\"']?(.*?)[\"']?)?\])?([\/, ]+)/is"; + preg_match_all($pattern, trim($selector_string).' ', $matches, PREG_SET_ORDER); + if (is_object($debugObject)) {$debugObject->debugLog(2, "Matches Array: ", $matches);} + + $selectors = array(); + $result = array(); + //print_r($matches); + + foreach ($matches as $m) { + $m[0] = trim($m[0]); + if ($m[0]==='' || $m[0]==='/' || $m[0]==='//') continue; + // for browser generated xpath + if ($m[1]==='tbody') continue; + + list($tag, $key, $val, $exp, $no_key) = array($m[1], null, null, '=', false); + if (!empty($m[2])) {$key='id'; $val=$m[2];} + if (!empty($m[3])) {$key='class'; $val=$m[3];} + if (!empty($m[4])) {$key=$m[4];} + if (!empty($m[5])) {$exp=$m[5];} + if (!empty($m[6])) {$val=$m[6];} + + // convert to lowercase + if ($this->dom->lowercase) {$tag=strtolower($tag); $key=strtolower($key);} + //elements that do NOT have the specified attribute + if (isset($key[0]) && $key[0]==='!') {$key=substr($key, 1); $no_key=true;} + + $result[] = array($tag, $key, $val, $exp, $no_key); + if (trim($m[7])===',') { + $selectors[] = $result; + $result = array(); + } + } + if (count($result)>0) + $selectors[] = $result; + return $selectors; + } + + function __get($name) { + if (isset($this->attr[$name])) + { + return $this->convert_text($this->attr[$name]); + } + switch ($name) { + case 'outertext': return $this->outertext(); + case 'innertext': return $this->innertext(); + case 'plaintext': return $this->text(); + case 'xmltext': return $this->xmltext(); + default: return array_key_exists($name, $this->attr); + } + } + + function __set($name, $value) { + switch ($name) { + case 'outertext': return $this->_[HDOM_INFO_OUTER] = $value; + case 'innertext': + if (isset($this->_[HDOM_INFO_TEXT])) return $this->_[HDOM_INFO_TEXT] = $value; + return $this->_[HDOM_INFO_INNER] = $value; + } + if (!isset($this->attr[$name])) { + $this->_[HDOM_INFO_SPACE][] = array(' ', '', ''); + $this->_[HDOM_INFO_QUOTE][] = HDOM_QUOTE_DOUBLE; + } + $this->attr[$name] = $value; + } + + function __isset($name) { + switch ($name) { + case 'outertext': return true; + case 'innertext': return true; + case 'plaintext': return true; + } + //no value attr: nowrap, checked selected... + return (array_key_exists($name, $this->attr)) ? true : isset($this->attr[$name]); + } + + function __unset($name) { + if (isset($this->attr[$name])) + unset($this->attr[$name]); + } + + // PaperG - Function to convert the text from one character set to another if the two sets are not the same. + function convert_text($text) + { + global $debugObject; + if (is_object($debugObject)) {$debugObject->debugLogEntry(1);} + + $converted_text = $text; + + $sourceCharset = ""; + $targetCharset = ""; + + if ($this->dom) + { + $sourceCharset = strtoupper($this->dom->_charset); + $targetCharset = strtoupper($this->dom->_target_charset); + } + if (is_object($debugObject)) {$debugObject->debugLog(3, "source charset: " . $sourceCharset . " target charaset: " . $targetCharset);} + + if (!empty($sourceCharset) && !empty($targetCharset) && (strcasecmp($sourceCharset, $targetCharset) != 0)) + { + // Check if the reported encoding could have been incorrect and the text is actually already UTF-8 + if ((strcasecmp($targetCharset, 'UTF-8') == 0) && ($this->is_utf8($text))) + { + $converted_text = $text; + } + else + { + $converted_text = iconv($sourceCharset, $targetCharset, $text); + } + } + + // Lets make sure that we don't have that silly BOM issue with any of the utf-8 text we output. + if ($targetCharset == 'UTF-8') + { + if (substr($converted_text, 0, 3) == "\xef\xbb\xbf") + { + $converted_text = substr($converted_text, 3); + } + if (substr($converted_text, -3) == "\xef\xbb\xbf") + { + $converted_text = substr($converted_text, 0, -3); + } + } + + return $converted_text; + } + + /** + * Returns true if $string is valid UTF-8 and false otherwise. + * + * @param mixed $str String to be tested + * @return boolean + */ + static function is_utf8($str) + { + $c=0; $b=0; + $bits=0; + $len=strlen($str); + for($i=0; $i<$len; $i++) + { + $c=ord($str[$i]); + if($c > 128) + { + if(($c >= 254)) return false; + elseif($c >= 252) $bits=6; + elseif($c >= 248) $bits=5; + elseif($c >= 240) $bits=4; + elseif($c >= 224) $bits=3; + elseif($c >= 192) $bits=2; + else return false; + if(($i+$bits) > $len) return false; + while($bits > 1) + { + $i++; + $b=ord($str[$i]); + if($b < 128 || $b > 191) return false; + $bits--; + } + } + } + return true; + } + /* + function is_utf8($string) + { + //this is buggy + return (utf8_encode(utf8_decode($string)) == $string); + } + */ + + /** + * Function to try a few tricks to determine the displayed size of an img on the page. + * NOTE: This will ONLY work on an IMG tag. Returns FALSE on all other tag types. + * + * @author John Schlick + * @version April 19 2012 + * @return array an array containing the 'height' and 'width' of the image on the page or -1 if we can't figure it out. + */ + function get_display_size() + { + global $debugObject; + + $width = -1; + $height = -1; + + if ($this->tag !== 'img') + { + return false; + } + + // See if there is aheight or width attribute in the tag itself. + if (isset($this->attr['width'])) + { + $width = $this->attr['width']; + } + + if (isset($this->attr['height'])) + { + $height = $this->attr['height']; + } + + // Now look for an inline style. + if (isset($this->attr['style'])) + { + // Thanks to user gnarf from stackoverflow for this regular expression. + $attributes = array(); + preg_match_all("/([\w-]+)\s*:\s*([^;]+)\s*;?/", $this->attr['style'], $matches, PREG_SET_ORDER); + foreach ($matches as $match) { + $attributes[$match[1]] = $match[2]; + } + + // If there is a width in the style attributes: + if (isset($attributes['width']) && $width == -1) + { + // check that the last two characters are px (pixels) + if (strtolower(substr($attributes['width'], -2)) == 'px') + { + $proposed_width = substr($attributes['width'], 0, -2); + // Now make sure that it's an integer and not something stupid. + if (filter_var($proposed_width, FILTER_VALIDATE_INT)) + { + $width = $proposed_width; + } + } + } + + // If there is a width in the style attributes: + if (isset($attributes['height']) && $height == -1) + { + // check that the last two characters are px (pixels) + if (strtolower(substr($attributes['height'], -2)) == 'px') + { + $proposed_height = substr($attributes['height'], 0, -2); + // Now make sure that it's an integer and not something stupid. + if (filter_var($proposed_height, FILTER_VALIDATE_INT)) + { + $height = $proposed_height; + } + } + } + + } + + // Future enhancement: + // Look in the tag to see if there is a class or id specified that has a height or width attribute to it. + + // Far future enhancement + // Look at all the parent tags of this image to see if they specify a class or id that has an img selector that specifies a height or width + // Note that in this case, the class or id will have the img subselector for it to apply to the image. + + // ridiculously far future development + // If the class or id is specified in a SEPARATE css file thats not on the page, go get it and do what we were just doing for the ones on the page. + + $result = array('height' => $height, + 'width' => $width); + return $result; + } + + // camel naming conventions + function getAllAttributes() {return $this->attr;} + function getAttribute($name) {return $this->__get($name);} + function setAttribute($name, $value) {$this->__set($name, $value);} + function hasAttribute($name) {return $this->__isset($name);} + function removeAttribute($name) {$this->__set($name, null);} + function getElementById($id) {return $this->find("#$id", 0);} + function getElementsById($id, $idx=null) {return $this->find("#$id", $idx);} + function getElementByTagName($name) {return $this->find($name, 0);} + function getElementsByTagName($name, $idx=null) {return $this->find($name, $idx);} + function parentNode() {return $this->parent();} + function childNodes($idx=-1) {return $this->children($idx);} + function firstChild() {return $this->first_child();} + function lastChild() {return $this->last_child();} + function nextSibling() {return $this->next_sibling();} + function previousSibling() {return $this->prev_sibling();} + function hasChildNodes() {return $this->has_child();} + function nodeName() {return $this->tag;} + function appendChild($node) {$node->parent($this); return $node;} + +} + +/** + * simple html dom parser + * Paperg - in the find routine: allow us to specify that we want case insensitive testing of the value of the selector. + * Paperg - change $size from protected to public so we can easily access it + * Paperg - added ForceTagsClosed in the constructor which tells us whether we trust the html or not. Default is to NOT trust it. + * + * @package PlaceLocalInclude + */ +class simple_html_dom +{ + public $root = null; + public $nodes = array(); + public $callback = null; + public $lowercase = false; + // Used to keep track of how large the text was when we started. + public $original_size; + public $size; + protected $pos; + protected $doc; + protected $char; + protected $cursor; + protected $parent; + protected $noise = array(); + protected $token_blank = " \t\r\n"; + protected $token_equal = ' =/>'; + protected $token_slash = " />\r\n\t"; + protected $token_attr = ' >'; + // Note that this is referenced by a child node, and so it needs to be public for that node to see this information. + public $_charset = ''; + public $_target_charset = ''; + protected $default_br_text = ""; + public $default_span_text = ""; + + // use isset instead of in_array, performance boost about 30%... + protected $self_closing_tags = array('img'=>1, 'br'=>1, 'input'=>1, 'meta'=>1, 'link'=>1, 'hr'=>1, 'base'=>1, 'embed'=>1, 'spacer'=>1); + protected $block_tags = array('root'=>1, 'body'=>1, 'form'=>1, 'div'=>1, 'span'=>1, 'table'=>1); + // Known sourceforge issue #2977341 + // B tags that are not closed cause us to return everything to the end of the document. + protected $optional_closing_tags = array( + 'tr'=>array('tr'=>1, 'td'=>1, 'th'=>1), + 'th'=>array('th'=>1), + 'td'=>array('td'=>1), + 'li'=>array('li'=>1), + 'dt'=>array('dt'=>1, 'dd'=>1), + 'dd'=>array('dd'=>1, 'dt'=>1), + 'dl'=>array('dd'=>1, 'dt'=>1), + 'p'=>array('p'=>1), + 'nobr'=>array('nobr'=>1), + 'b'=>array('b'=>1), + 'option'=>array('option'=>1), + ); + + function __construct($str=null, $lowercase=true, $forceTagsClosed=true, $target_charset=DEFAULT_TARGET_CHARSET, $stripRN=true, $defaultBRText=DEFAULT_BR_TEXT, $defaultSpanText=DEFAULT_SPAN_TEXT) + { + if ($str) + { + if (preg_match("/^http:\/\//i",$str) || is_file($str)) + { + $this->load_file($str); + } + else + { + $this->load($str, $lowercase, $stripRN, $defaultBRText, $defaultSpanText); + } + } + // Forcing tags to be closed implies that we don't trust the html, but it can lead to parsing errors if we SHOULD trust the html. + if (!$forceTagsClosed) { + $this->optional_closing_array=array(); + } + $this->_target_charset = $target_charset; + } + + function __destruct() + { + $this->clear(); + } + + // load html from string + function load($str, $lowercase=true, $stripRN=true, $defaultBRText=DEFAULT_BR_TEXT, $defaultSpanText=DEFAULT_SPAN_TEXT) + { + global $debugObject; + + // prepare + $this->prepare($str, $lowercase, $stripRN, $defaultBRText, $defaultSpanText); + // strip out comments + $this->remove_noise("''is"); + // strip out cdata + $this->remove_noise("''is", true); + // Per sourceforge http://sourceforge.net/tracker/?func=detail&aid=2949097&group_id=218559&atid=1044037 + // Script tags removal now preceeds style tag removal. + // strip out + + + +
        +

        W3C + +

        Selectors

        + +

        W3C Working Draft 15 December 2005

        + +
        + +
        This version: + +
        + http://www.w3.org/TR/2005/WD-css3-selectors-20051215 + +
        Latest version: + +
        + http://www.w3.org/TR/css3-selectors + +
        Previous version: + +
        + http://www.w3.org/TR/2001/CR-css3-selectors-20011113 + +
        Editors: + +
        Daniel Glazman (Invited Expert)
        + +
        Tantek Çelik (Invited Expert) + +
        Ian Hickson (Google) + +
        Peter Linss (former editor, Netscape/AOL) + +
        John Williams (former editor, Quark, Inc.) + +
        + +
        + +
        + +

        Abstract

        + +

        Selectors are patterns that match against elements in a + tree. Selectors have been optimized for use with HTML and XML, and + are designed to be usable in performance-critical code.

        + +

        CSS (Cascading + Style Sheets) is a language for describing the rendering of HTML and XML documents on + screen, on paper, in speech, etc. CSS uses Selectors for binding + style properties to elements in the document. This document + describes extensions to the selectors defined in CSS level 2. These + extended selectors will be used by CSS level 3. + +

        Selectors define the following function:

        + +
        expression ∗ element → boolean
        + +

        That is, given an element and a selector, this specification + defines whether that element matches the selector.

        + +

        These expressions can also be used, for instance, to select a set + of elements, or a single element from a set of elements, by + evaluating the expression across all the elements in a + subtree. STTS (Simple Tree Transformation Sheets), a + language for transforming XML trees, uses this mechanism. [STTS]

        + +

        Status of this document

        + +

        This section describes the status of this document at the + time of its publication. Other documents may supersede this + document. A list of current W3C publications and the latest revision + of this technical report can be found in the W3C technical reports index at + http://www.w3.org/TR/.

        + +

        This document describes the selectors that already exist in CSS1 and CSS2, and + also proposes new selectors for CSS3 and other languages that may need them.

        + +

        The CSS Working Group doesn't expect that all implementations of + CSS3 will have to implement all selectors. Instead, there will + probably be a small number of variants of CSS3, called profiles. For + example, it may be that only a profile for interactive user agents + will include all of the selectors.

        + +

        This specification is a last call working draft for the the CSS Working Group + (Style Activity). This + document is a revision of the Candidate + Recommendation dated 2001 November 13, and has incorporated + implementation feedback received in the past few years. It is + expected that this last call will proceed straight to Proposed + Recommendation stage since it is believed that interoperability will + be demonstrable.

        + +

        All persons are encouraged to review and implement this + specification and return comments to the (archived) + public mailing list www-style + (see instructions). W3C + Members can also send comments directly to the CSS Working + Group. + The deadline for comments is 14 January 2006.

        + +

        This is still a draft document and may be updated, replaced, or + obsoleted by other documents at any time. It is inappropriate to + cite a W3C Working Draft as other than "work in progress". + +

        This document may be available in translation. + The English version of this specification is the only normative + version. + +

        + +

        Table of contents

        + + + +
        + +

        1. Introduction

        + +

        1.1. Dependencies

        + +

        Some features of this specification are specific to CSS, or have + particular limitations or rules specific to CSS. In this + specification, these have been described in terms of CSS2.1. [CSS21]

        + +

        1.2. Terminology

        + +

        All of the text of this specification is normative except + examples, notes, and sections explicitly marked as + non-normative.

        + +

        1.3. Changes from CSS2

        + +

        This section is non-normative.

        + +

        The main differences between the selectors in CSS2 and those in + Selectors are: + +

          + +
        • the list of basic definitions (selector, group of selectors, + simple selector, etc.) has been changed; in particular, what was + referred to in CSS2 as a simple selector is now called a sequence + of simple selectors, and the term "simple selector" is now used for + the components of this sequence
        • + +
        • an optional namespace component is now allowed in type element + selectors, the universal selector and attribute selectors
        • + +
        • a new combinator has been introduced
        • + +
        • new simple selectors including substring matching attribute + selectors, and new pseudo-classes
        • + +
        • new pseudo-elements, and introduction of the "::" convention + for pseudo-elements
        • + +
        • the grammar has been rewritten
        • + +
        • profiles to be added to specifications integrating Selectors + and defining the set of selectors which is actually supported by + each specification
        • + +
        • Selectors are now a CSS3 Module and an independent + specification; other specifications can now refer to this document + independently of CSS
        • + +
        • the specification now has its own test suite
        • + +
        + +

        2. Selectors

        + +

        This section is non-normative, as it merely summarizes the +following sections.

        + +

        A Selector represents a structure. This structure can be used as a +condition (e.g. in a CSS rule) that determines which elements a +selector matches in the document tree, or as a flat description of the +HTML or XML fragment corresponding to that structure.

        + +

        Selectors may range from simple element names to rich contextual +representations.

        + +

        The following table summarizes the Selector syntax:

        + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
        PatternMeaningDescribed in sectionFirst defined in CSS level
        *any elementUniversal + selector2
        Ean element of type EType selector1
        E[foo]an E element with a "foo" attributeAttribute + selectors2
        E[foo="bar"]an E element whose "foo" attribute value is exactly + equal to "bar"Attribute + selectors2
        E[foo~="bar"]an E element whose "foo" attribute value is a list of + space-separated values, one of which is exactly equal to "bar"Attribute + selectors2
        E[foo^="bar"]an E element whose "foo" attribute value begins exactly + with the string "bar"Attribute + selectors3
        E[foo$="bar"]an E element whose "foo" attribute value ends exactly + with the string "bar"Attribute + selectors3
        E[foo*="bar"]an E element whose "foo" attribute value contains the + substring "bar"Attribute + selectors3
        E[hreflang|="en"]an E element whose "hreflang" attribute has a hyphen-separated + list of values beginning (from the left) with "en"Attribute + selectors2
        E:rootan E element, root of the documentStructural + pseudo-classes3
        E:nth-child(n)an E element, the n-th child of its parentStructural + pseudo-classes3
        E:nth-last-child(n)an E element, the n-th child of its parent, counting + from the last oneStructural + pseudo-classes3
        E:nth-of-type(n)an E element, the n-th sibling of its typeStructural + pseudo-classes3
        E:nth-last-of-type(n)an E element, the n-th sibling of its type, counting + from the last oneStructural + pseudo-classes3
        E:first-childan E element, first child of its parentStructural + pseudo-classes2
        E:last-childan E element, last child of its parentStructural + pseudo-classes3
        E:first-of-typean E element, first sibling of its typeStructural + pseudo-classes3
        E:last-of-typean E element, last sibling of its typeStructural + pseudo-classes3
        E:only-childan E element, only child of its parentStructural + pseudo-classes3
        E:only-of-typean E element, only sibling of its typeStructural + pseudo-classes3
        E:emptyan E element that has no children (including text + nodes)Structural + pseudo-classes3
        E:link
        E:visited
        an E element being the source anchor of a hyperlink of + which the target is not yet visited (:link) or already visited + (:visited)The link + pseudo-classes1
        E:active
        E:hover
        E:focus
        an E element during certain user actionsThe user + action pseudo-classes1 and 2
        E:targetan E element being the target of the referring URIThe target + pseudo-class3
        E:lang(fr)an element of type E in language "fr" (the document + language specifies how language is determined)The :lang() + pseudo-class2
        E:enabled
        E:disabled
        a user interface element E which is enabled or + disabledThe UI element states + pseudo-classes3
        E:checkeda user interface element E which is checked (for instance a radio-button or checkbox)The UI element states + pseudo-classes3
        E::first-linethe first formatted line of an E elementThe ::first-line + pseudo-element1
        E::first-letterthe first formatted letter of an E elementThe ::first-letter + pseudo-element1
        E::selectionthe portion of an E element that is currently + selected/highlighted by the userThe UI element + fragments pseudo-elements3
        E::beforegenerated content before an E elementThe ::before + pseudo-element2
        E::aftergenerated content after an E elementThe ::after + pseudo-element2
        E.warningan E element whose class is +"warning" (the document language specifies how class is determined).Class + selectors1
        E#myidan E element with ID equal to "myid".ID + selectors1
        E:not(s)an E element that does not match simple selector sNegation + pseudo-class3
        E Fan F element descendant of an E elementDescendant + combinator1
        E > Fan F element child of an E elementChild + combinator2
        E + Fan F element immediately preceded by an E elementAdjacent sibling combinator2
        E ~ Fan F element preceded by an E elementGeneral sibling combinator3
        + +

        The meaning of each selector is derived from the table above by +prepending "matches" to the contents of each cell in the "Meaning" +column.

        + +

        3. Case sensitivity

        + +

        The case sensitivity of document language element names, attribute +names, and attribute values in selectors depends on the document +language. For example, in HTML, element names are case-insensitive, +but in XML, they are case-sensitive.

        + +

        4. Selector syntax

        + +

        A selector is a chain of one +or more sequences of simple selectors +separated by combinators.

        + +

        A sequence of simple selectors +is a chain of simple selectors +that are not separated by a combinator. It +always begins with a type selector or a +universal selector. No other type +selector or universal selector is allowed in the sequence.

        + +

        A simple selector is either a type selector, universal selector, attribute selector, class selector, ID selector, content selector, or pseudo-class. One pseudo-element may be appended to the last +sequence of simple selectors.

        + +

        Combinators are: white space, "greater-than +sign" (U+003E, >), "plus sign" (U+002B, ++) and "tilde" (U+007E, ~). White +space may appear between a combinator and the simple selectors around +it. Only the characters "space" (U+0020), "tab" +(U+0009), "line feed" (U+000A), "carriage return" (U+000D), and "form +feed" (U+000C) can occur in white space. Other space-like characters, +such as "em-space" (U+2003) and "ideographic space" (U+3000), are +never part of white space.

        + +

        The elements of a document tree that are represented by a selector +are the subjects of the selector. A +selector consisting of a single sequence of simple selectors +represents any element satisfying its requirements. Prepending another +sequence of simple selectors and a combinator to a sequence imposes +additional matching constraints, so the subjects of a selector are +always a subset of the elements represented by the last sequence of +simple selectors.

        + +

        An empty selector, containing no sequence of simple selectors and +no pseudo-element, is an invalid +selector.

        + +

        5. Groups of selectors

        + +

        When several selectors share the same declarations, they may be +grouped into a comma-separated list. (A comma is U+002C.)

        + +
        +

        CSS examples:

        +

        In this example, we condense three rules with identical +declarations into one. Thus,

        +
        h1 { font-family: sans-serif }
        +h2 { font-family: sans-serif }
        +h3 { font-family: sans-serif }
        +

        is equivalent to:

        +
        h1, h2, h3 { font-family: sans-serif }
        +
        + +

        Warning: the equivalence is true in this example +because all the selectors are valid selectors. If just one of these +selectors were invalid, the entire group of selectors would be +invalid. This would invalidate the rule for all three heading +elements, whereas in the former case only one of the three individual +heading rules would be invalidated.

        + + +

        6. Simple selectors

        + +

        6.1. Type selector

        + +

        A type selector is the name of a document language +element type. A type selector represents an instance of the element +type in the document tree.

        + +
        +

        Example:

        +

        The following selector represents an h1 element in the document tree:

        +
        h1
        +
        + + +

        6.1.1. Type selectors and namespaces

        + +

        Type selectors allow an optional namespace ([XMLNAMES]) component. A namespace prefix +that has been previously declared may be prepended to the element name +separated by the namespace separator "vertical bar" +(U+007C, |).

        + +

        The namespace component may be left empty to indicate that the +selector is only to represent elements with no declared namespace.

        + +

        An asterisk may be used for the namespace prefix, indicating that +the selector represents elements in any namespace (including elements +with no namespace).

        + +

        Element type selectors that have no namespace component (no +namespace separator), represent elements without regard to the +element's namespace (equivalent to "*|") unless a default +namespace has been declared. If a default namespace has been declared, +the selector will represent only elements in the default +namespace.

        + +

        A type selector containing a namespace prefix that has not been +previously declared is an invalid selector. +The mechanism for declaring a namespace prefix is left up to the +language implementing Selectors. In CSS, such a mechanism is defined +in the General Syntax module.

        + +

        In a namespace-aware client, element type selectors will only match +against the local part +of the element's qualified +name. See below for notes about matching +behaviors in down-level clients.

        + +

        In summary:

        + +
        +
        ns|E
        +
        elements with name E in namespace ns
        +
        *|E
        +
        elements with name E in any namespace, including those without any + declared namespace
        +
        |E
        +
        elements with name E without any declared namespace
        +
        E
        +
        if no default namespace has been specified, this is equivalent to *|E. + Otherwise it is equivalent to ns|E where ns is the default namespace.
        +
        + +
        +

        CSS examples:

        + +
        @namespace foo url(http://www.example.com);
        + foo|h1 { color: blue }
        + foo|* { color: yellow }
        + |h1 { color: red }
        + *|h1 { color: green }
        + h1 { color: green }
        + +

        The first rule will match only h1 elements in the + "http://www.example.com" namespace.

        + +

        The second rule will match all elements in the + "http://www.example.com" namespace.

        + +

        The third rule will match only h1 elements without + any declared namespace.

        + +

        The fourth rule will match h1 elements in any + namespace (including those without any declared namespace).

        + +

        The last rule is equivalent to the fourth rule because no default + namespace has been defined.

        + +
        + +

        6.2. Universal selector

        + +

        The universal selector, written "asterisk" +(*), represents the qualified name of any element +type. It represents any single element in the document tree in any +namespace (including those without any declared namespace) if no +default namespace has been specified. If a default namespace has been +specified, see Universal selector and +Namespaces below.

        + +

        If the universal selector is not the only component of a sequence +of simple selectors, the * may be omitted.

        + +
        +

        Examples:

        +
          +
        • *[hreflang|=en] and [hreflang|=en] are equivalent,
        • +
        • *.warning and .warning are equivalent,
        • +
        • *#myid and #myid are equivalent.
        • +
        +
        + +

        Note: it is recommended that the +*, representing the universal selector, not be +omitted.

        + +

        6.2.1. Universal selector and namespaces

        + +

        The universal selector allows an optional namespace component. It +is used as follows:

        + +
        +
        ns|*
        +
        all elements in namespace ns
        +
        *|*
        +
        all elements
        +
        |*
        +
        all elements without any declared namespace
        +
        *
        +
        if no default namespace has been specified, this is equivalent to *|*. + Otherwise it is equivalent to ns|* where ns is the default namespace.
        +
        + +

        A universal selector containing a namespace prefix that has not +been previously declared is an invalid +selector. The mechanism for declaring a namespace prefix is left up +to the language implementing Selectors. In CSS, such a mechanism is +defined in the General Syntax module.

        + + +

        6.3. Attribute selectors

        + +

        Selectors allow the representation of an element's attributes. When +a selector is used as an expression to match against an element, +attribute selectors must be considered to match an element if that +element has an attribute that matches the attribute represented by the +attribute selector.

        + +

        6.3.1. Attribute presence and values +selectors

        + +

        CSS2 introduced four attribute selectors:

        + +
        +
        [att] +
        Represents an element with the att attribute, whatever the value of + the attribute.
        +
        [att=val]
        +
        Represents an element with the att attribute whose value is exactly + "val".
        +
        [att~=val]
        +
        Represents an element with the att attribute whose value is a whitespace-separated list of words, one of + which is exactly "val". If "val" contains whitespace, it will never + represent anything (since the words are separated by + spaces).
        +
        [att|=val] +
        Represents an element with the att attribute, its value either + being exactly "val" or beginning with "val" immediately followed by + "-" (U+002D). This is primarily intended to allow language subcode + matches (e.g., the hreflang attribute on the + link element in HTML) as described in RFC 3066 ([RFC3066]). For lang (or + xml:lang) language subcode matching, please see the :lang pseudo-class.
        +
        + +

        Attribute values must be identifiers or strings. The +case-sensitivity of attribute names and values in selectors depends on +the document language.

        + +
        + +

        Examples:

        + +

        The following attribute selector represents an h1 + element that carries the title attribute, whatever its + value:

        + +
        h1[title]
        + +

        In the following example, the selector represents a + span element whose class attribute has + exactly the value "example":

        + +
        span[class="example"]
        + +

        Multiple attribute selectors can be used to represent several + attributes of an element, or several conditions on the same + attribute. Here, the selector represents a span element + whose hello attribute has exactly the value "Cleveland" + and whose goodbye attribute has exactly the value + "Columbus":

        + +
        span[hello="Cleveland"][goodbye="Columbus"]
        + +

        The following selectors illustrate the differences between "=" + and "~=". The first selector will represent, for example, the value + "copyright copyleft copyeditor" on a rel attribute. The + second selector will only represent an a element with + an href attribute having the exact value + "http://www.w3.org/".

        + +
        a[rel~="copyright"]
        +a[href="http://www.w3.org/"]
        + +

        The following selector represents a link element + whose hreflang attribute is exactly "fr".

        + +
        link[hreflang=fr]
        + +

        The following selector represents a link element for + which the values of the hreflang attribute begins with + "en", including "en", "en-US", and "en-cockney":

        + +
        link[hreflang|="en"]
        + +

        Similarly, the following selectors represents a + DIALOGUE element whenever it has one of two different + values for an attribute character:

        + +
        DIALOGUE[character=romeo]
        +DIALOGUE[character=juliet]
        + +
        + +

        6.3.2. Substring matching attribute +selectors

        + +

        Three additional attribute selectors are provided for matching +substrings in the value of an attribute:

        + +
        +
        [att^=val]
        +
        Represents an element with the att attribute whose value begins + with the prefix "val".
        +
        [att$=val] +
        Represents an element with the att attribute whose value ends with + the suffix "val".
        +
        [att*=val] +
        Represents an element with the att attribute whose value contains + at least one instance of the substring "val".
        +
        + +

        Attribute values must be identifiers or strings. The +case-sensitivity of attribute names in selectors depends on the +document language.

        + +
        +

        Examples:

        +

        The following selector represents an HTML object, referencing an + image:

        +
        object[type^="image/"]
        +

        The following selector represents an HTML anchor a with an + href attribute whose value ends with ".html".

        +
        a[href$=".html"]
        +

        The following selector represents an HTML paragraph with a title + attribute whose value contains the substring "hello"

        +
        p[title*="hello"]
        +
        + +

        6.3.3. Attribute selectors and namespaces

        + +

        Attribute selectors allow an optional namespace component to the +attribute name. A namespace prefix that has been previously declared +may be prepended to the attribute name separated by the namespace +separator "vertical bar" (|). In keeping with +the Namespaces in the XML recommendation, default namespaces do not +apply to attributes, therefore attribute selectors without a namespace +component apply only to attributes that have no declared namespace +(equivalent to "|attr"). An asterisk may be used for the +namespace prefix indicating that the selector is to match all +attribute names without regard to the attribute's namespace. + +

        An attribute selector with an attribute name containing a namespace +prefix that has not been previously declared is an invalid selector. The mechanism for declaring +a namespace prefix is left up to the language implementing Selectors. +In CSS, such a mechanism is defined in the General Syntax module. + +

        +

        CSS examples:

        +
        @namespace foo "http://www.example.com";
        +[foo|att=val] { color: blue }
        +[*|att] { color: yellow }
        +[|att] { color: green }
        +[att] { color: green }
        + +

        The first rule will match only elements with the attribute + att in the "http://www.example.com" namespace with the + value "val".

        + +

        The second rule will match only elements with the attribute + att regardless of the namespace of the attribute + (including no declared namespace).

        + +

        The last two rules are equivalent and will match only elements + with the attribute att where the attribute is not + declared to be in a namespace.

        + +
        + +

        6.3.4. Default attribute values in DTDs

        + +

        Attribute selectors represent explicitly set attribute values in +the document tree. Default attribute values may be defined in a DTD or +elsewhere, but cannot always be selected by attribute +selectors. Selectors should be designed so that they work even if the +default values are not included in the document tree.

        + +

        More precisely, a UA is not required to read an "external +subset" of the DTD but is required to look for default +attribute values in the document's "internal subset." (See [XML10] for definitions of these subsets.)

        + +

        A UA that recognizes an XML namespace [XMLNAMES] is not required to use its +knowledge of that namespace to treat default attribute values as if +they were present in the document. (For example, an XHTML UA is not +required to use its built-in knowledge of the XHTML DTD.)

        + +

        Note: Typically, implementations +choose to ignore external subsets.

        + +
        +

        Example:

        + +

        Consider an element EXAMPLE with an attribute "notation" that has a +default value of "decimal". The DTD fragment might be

        + +
        <!ATTLIST EXAMPLE notation (decimal,octal) "decimal">
        + +

        If the style sheet contains the rules

        + +
        EXAMPLE[notation=decimal] { /*... default property settings ...*/ }
        +EXAMPLE[notation=octal]   { /*... other settings...*/ }
        + +

        the first rule will not match elements whose "notation" attribute +is set by default, i.e. not set explicitly. To catch all cases, the +attribute selector for the default value must be dropped:

        + +
        EXAMPLE                   { /*... default property settings ...*/ }
        +EXAMPLE[notation=octal]   { /*... other settings...*/ }
        + +

        Here, because the selector EXAMPLE[notation=octal] is +more specific than the tag +selector alone, the style declarations in the second rule will override +those in the first for elements that have a "notation" attribute value +of "octal". Care has to be taken that all property declarations that +are to apply only to the default case are overridden in the non-default +cases' style rules.

        + +
        + +

        6.4. Class selectors

        + +

        Working with HTML, authors may use the period (U+002E, +.) notation as an alternative to the ~= +notation when representing the class attribute. Thus, for +HTML, div.value and div[class~=value] have +the same meaning. The attribute value must immediately follow the +"period" (.).

        + +

        UAs may apply selectors using the period (.) notation in XML +documents if the UA has namespace-specific knowledge that allows it to +determine which attribute is the "class" attribute for the +respective namespace. One such example of namespace-specific knowledge +is the prose in the specification for a particular namespace (e.g. SVG +1.0 [SVG] describes the SVG +"class" attribute and how a UA should interpret it, and +similarly MathML 1.01 [MATH] describes the MathML +"class" attribute.)

        + +
        +

        CSS examples:

        + +

        We can assign style information to all elements with + class~="pastoral" as follows:

        + +
        *.pastoral { color: green }  /* all elements with class~=pastoral */
        + +

        or just

        + +
        .pastoral { color: green }  /* all elements with class~=pastoral */
        + +

        The following assigns style only to H1 elements with + class~="pastoral":

        + +
        H1.pastoral { color: green }  /* H1 elements with class~=pastoral */
        + +

        Given these rules, the first H1 instance below would not have + green text, while the second would:

        + +
        <H1>Not green</H1>
        +<H1 class="pastoral">Very green</H1>
        + +
        + +

        To represent a subset of "class" values, each value must be preceded +by a ".", in any order.

        + +
        + +

        CSS example:

        + +

        The following rule matches any P element whose "class" attribute + has been assigned a list of whitespace-separated values that includes + "pastoral" and "marine":

        + +
        p.pastoral.marine { color: green }
        + +

        This rule matches when class="pastoral blue aqua + marine" but does not match for class="pastoral + blue".

        + +
        + +

        Note: Because CSS gives considerable +power to the "class" attribute, authors could conceivably design their +own "document language" based on elements with almost no associated +presentation (such as DIV and SPAN in HTML) and assigning style +information through the "class" attribute. Authors should avoid this +practice since the structural elements of a document language often +have recognized and accepted meanings and author-defined classes may +not.

        + +

        Note: If an element has multiple +class attributes, their values must be concatenated with spaces +between the values before searching for the class. As of this time the +working group is not aware of any manner in which this situation can +be reached, however, so this behavior is explicitly non-normative in +this specification.

        + +

        6.5. ID selectors

        + +

        Document languages may contain attributes that are declared to be +of type ID. What makes attributes of type ID special is that no two +such attributes can have the same value in a document, regardless of +the type of the elements that carry them; whatever the document +language, an ID typed attribute can be used to uniquely identify its +element. In HTML all ID attributes are named "id"; XML applications +may name ID attributes differently, but the same restriction +applies.

        + +

        An ID-typed attribute of a document language allows authors to +assign an identifier to one element instance in the document tree. W3C +ID selectors represent an element instance based on its identifier. An +ID selector contains a "number sign" (U+0023, +#) immediately followed by the ID value, which must be an +identifier.

        + +

        Selectors does not specify how a UA knows the ID-typed attribute of +an element. The UA may, e.g., read a document's DTD, have the +information hard-coded or ask the user. + +

        +

        Examples:

        +

        The following ID selector represents an h1 element + whose ID-typed attribute has the value "chapter1":

        +
        h1#chapter1
        +

        The following ID selector represents any element whose ID-typed + attribute has the value "chapter1":

        +
        #chapter1
        +

        The following selector represents any element whose ID-typed + attribute has the value "z98y".

        +
        *#z98y
        +
        + +

        Note. In XML 1.0 [XML10], the information about which attribute +contains an element's IDs is contained in a DTD or a schema. When +parsing XML, UAs do not always read the DTD, and thus may not know +what the ID of an element is (though a UA may have namespace-specific +knowledge that allows it to determine which attribute is the ID +attribute for that namespace). If a style sheet designer knows or +suspects that a UA may not know what the ID of an element is, he +should use normal attribute selectors instead: +[name=p371] instead of #p371. Elements in +XML 1.0 documents without a DTD do not have IDs at all.

        + +

        If an element has multiple ID attributes, all of them must be +treated as IDs for that element for the purposes of the ID +selector. Such a situation could be reached using mixtures of xml:id, +DOM3 Core, XML DTDs, and namespace-specific knowledge.

        + +

        6.6. Pseudo-classes

        + +

        The pseudo-class concept is introduced to permit selection based on +information that lies outside of the document tree or that cannot be +expressed using the other simple selectors.

        + +

        A pseudo-class always consists of a "colon" +(:) followed by the name of the pseudo-class and +optionally by a value between parentheses.

        + +

        Pseudo-classes are allowed in all sequences of simple selectors +contained in a selector. Pseudo-classes are allowed anywhere in +sequences of simple selectors, after the leading type selector or +universal selector (possibly omitted). Pseudo-class names are +case-insensitive. Some pseudo-classes are mutually exclusive, while +others can be applied simultaneously to the same +element. Pseudo-classes may be dynamic, in the sense that an element +may acquire or lose a pseudo-class while a user interacts with the +document.

        + + +

        6.6.1. Dynamic pseudo-classes

        + +

        Dynamic pseudo-classes classify elements on characteristics other +than their name, attributes, or content, in principle characteristics +that cannot be deduced from the document tree.

        + +

        Dynamic pseudo-classes do not appear in the document source or +document tree.

        + + +
        The link pseudo-classes: :link and :visited
        + +

        User agents commonly display unvisited links differently from +previously visited ones. Selectors +provides the pseudo-classes :link and +:visited to distinguish them:

        + +
          +
        • The :link pseudo-class applies to links that have + not yet been visited.
        • +
        • The :visited pseudo-class applies once the link has + been visited by the user.
        • +
        + +

        After some amount of time, user agents may choose to return a +visited link to the (unvisited) ':link' state.

        + +

        The two states are mutually exclusive.

        + +
        + +

        Example:

        + +

        The following selector represents links carrying class + external and already visited:

        + +
        a.external:visited
        + +
        + +

        Note: It is possible for style sheet +authors to abuse the :link and :visited pseudo-classes to determine +which sites a user has visited without the user's consent. + +

        UAs may therefore treat all links as unvisited links, or implement +other measures to preserve the user's privacy while rendering visited +and unvisited links differently.

        + +
        The user action pseudo-classes +:hover, :active, and :focus
        + +

        Interactive user agents sometimes change the rendering in response +to user actions. Selectors provides +three pseudo-classes for the selection of an element the user is +acting on.

        + +
          + +
        • The :hover pseudo-class applies while the user + designates an element with a pointing device, but does not activate + it. For example, a visual user agent could apply this pseudo-class + when the cursor (mouse pointer) hovers over a box generated by the + element. User agents not that do not support interactive + media do not have to support this pseudo-class. Some conforming + user agents that support interactive + media may not be able to support this pseudo-class (e.g., a pen + device that does not detect hovering).
        • + +
        • The :active pseudo-class applies while an element + is being activated by the user. For example, between the times the + user presses the mouse button and releases it.
        • + +
        • The :focus pseudo-class applies while an element + has the focus (accepts keyboard or mouse events, or other forms of + input).
        • + +
        + +

        There may be document language or implementation specific limits on +which elements can become :active or acquire +:focus.

        + +

        These pseudo-classes are not mutually exclusive. An element may +match several pseudo-classes at the same time.

        + +

        Selectors doesn't define if the parent of an element that is +':active' or ':hover' is also in that state.

        + +
        +

        Examples:

        +
        a:link    /* unvisited links */
        +a:visited /* visited links */
        +a:hover   /* user hovers */
        +a:active  /* active links */
        +

        An example of combining dynamic pseudo-classes:

        +
        a:focus
        +a:focus:hover
        +

        The last selector matches a elements that are in + the pseudo-class :focus and in the pseudo-class :hover.

        +
        + +

        Note: An element can be both ':visited' +and ':active' (or ':link' and ':active').

        + +

        6.6.2. The target pseudo-class :target

        + +

        Some URIs refer to a location within a resource. This kind of URI +ends with a "number sign" (#) followed by an anchor +identifier (called the fragment identifier).

        + +

        URIs with fragment identifiers link to a certain element within the +document, known as the target element. For instance, here is a URI +pointing to an anchor named section_2 in an HTML +document:

        + +
        http://example.com/html/top.html#section_2
        + +

        A target element can be represented by the :target +pseudo-class. If the document's URI has no fragment identifier, then +the document has no target element.

        + +
        +

        Example:

        +
        p.note:target
        +

        This selector represents a p element of class + note that is the target element of the referring + URI.

        +
        + +
        +

        CSS example:

        +

        Here, the :target pseudo-class is used to make the + target element red and place an image before it, if there is one:

        +
        *:target { color : red }
        +*:target::before { content : url(target.png) }
        +
        + +

        6.6.3. The language pseudo-class :lang

        + +

        If the document language specifies how the human language of an +element is determined, it is possible to write selectors that +represent an element based on its language. For example, in HTML [HTML4], the language is determined by a +combination of the lang attribute, the meta +element, and possibly by information from the protocol (such as HTTP +headers). XML uses an attribute called xml:lang, and +there may be other document language-specific methods for determining +the language.

        + +

        The pseudo-class :lang(C) represents an element that +is in language C. Whether an element is represented by a +:lang() selector is based solely on the identifier C +being either equal to, or a hyphen-separated substring of, the +element's language value, in the same way as if performed by the '|=' operator in attribute +selectors. The identifier C does not have to be a valid language +name.

        + +

        C must not be empty. (If it is, the selector is invalid.)

        + +

        Note: It is recommended that +documents and protocols indicate language using codes from RFC 3066 [RFC3066] or its successor, and by means of +"xml:lang" attributes in the case of XML-based documents [XML10]. See +"FAQ: Two-letter or three-letter language codes."

        + +
        +

        Examples:

        +

        The two following selectors represent an HTML document that is in + Belgian, French, or German. The two next selectors represent + q quotations in an arbitrary element in Belgian, French, + or German.

        +
        html:lang(fr-be)
        +html:lang(de)
        +:lang(fr-be) > q
        +:lang(de) > q
        +
        + +

        6.6.4. The UI element states pseudo-classes

        + +
        The :enabled and :disabled pseudo-classes
        + +

        The :enabled pseudo-class allows authors to customize +the look of user interface elements that are enabled — which the +user can select or activate in some fashion (e.g. clicking on a button +with a mouse). There is a need for such a pseudo-class because there +is no way to programmatically specify the default appearance of say, +an enabled input element without also specifying what it +would look like when it was disabled.

        + +

        Similar to :enabled, :disabled allows the +author to specify precisely how a disabled or inactive user interface +element should look.

        + +

        Most elements will be neither enabled nor disabled. An element is +enabled if the user can either activate it or transfer the focus to +it. An element is disabled if it could be enabled, but the user cannot +presently activate it or transfer focus to it.

        + + +
        The :checked pseudo-class
        + +

        Radio and checkbox elements can be toggled by the user. Some menu +items are "checked" when the user selects them. When such elements are +toggled "on" the :checked pseudo-class applies. The +:checked pseudo-class initially applies to such elements +that have the HTML4 selected and checked +attributes as described in Section +17.2.1 of HTML4, but of course the user can toggle "off" such +elements in which case the :checked pseudo-class would no +longer apply. While the :checked pseudo-class is dynamic +in nature, and is altered by user action, since it can also be based +on the presence of the semantic HTML4 selected and +checked attributes, it applies to all media. + + +

        The :indeterminate pseudo-class
        + +
        + +

        Radio and checkbox elements can be toggled by the user, but are +sometimes in an indeterminate state, neither checked nor unchecked. +This can be due to an element attribute, or DOM manipulation.

        + +

        A future version of this specification may introduce an +:indeterminate pseudo-class that applies to such elements. +

        + +
        + + +

        6.6.5. Structural pseudo-classes

        + +

        Selectors introduces the concept of structural +pseudo-classes to permit selection based on extra information that lies in +the document tree but cannot be represented by other simple selectors or +combinators. + +

        Note that standalone pieces of PCDATA (text nodes in the DOM) are +not counted when calculating the position of an element in the list of +children of its parent. When calculating the position of an element in +the list of children of its parent, the index numbering starts at 1. + + +

        :root pseudo-class
        + +

        The :root pseudo-class represents an element that is +the root of the document. In HTML 4, this is always the +HTML element. + + +

        :nth-child() pseudo-class
        + +

        The +:nth-child(an+b) +pseudo-class notation represents an element that has +an+b-1 siblings +before it in the document tree, for a given positive +integer or zero value of n, and has a parent element. In +other words, this matches the bth child of an element after +all the children have been split into groups of a elements +each. For example, this allows the selectors to address every other +row in a table, and could be used to alternate the color +of paragraph text in a cycle of four. The a and +b values must be zero, negative integers or positive +integers. The index of the first child of an element is 1. + +

        In addition to this, :nth-child() can take +'odd' and 'even' as arguments instead. +'odd' has the same signification as 2n+1, +and 'even' has the same signification as 2n. + + +

        +

        Examples:

        +
        tr:nth-child(2n+1) /* represents every odd row of an HTML table */
        +tr:nth-child(odd)  /* same */
        +tr:nth-child(2n)   /* represents every even row of an HTML table */
        +tr:nth-child(even) /* same */
        +
        +/* Alternate paragraph colours in CSS */
        +p:nth-child(4n+1) { color: navy; }
        +p:nth-child(4n+2) { color: green; }
        +p:nth-child(4n+3) { color: maroon; }
        +p:nth-child(4n+4) { color: purple; }
        +
        + +

        When a=0, no repeating is used, so for example +:nth-child(0n+5) matches only the fifth child. When +a=0, the an part need not be +included, so the syntax simplifies to +:nth-child(b) and the last example simplifies +to :nth-child(5). + +

        +

        Examples:

        +
        foo:nth-child(0n+1)   /* represents an element foo, first child of its parent element */
        +foo:nth-child(1)      /* same */
        +
        + +

        When a=1, the number may be omitted from the rule. + +

        +

        Examples:

        +

        The following selectors are therefore equivalent:

        +
        bar:nth-child(1n+0)   /* represents all bar elements, specificity (0,1,1) */
        +bar:nth-child(n+0)    /* same */
        +bar:nth-child(n)      /* same */
        +bar                   /* same but lower specificity (0,0,1) */
        +
        + +

        If b=0, then every ath element is picked. In +such a case, the b part may be omitted. + +

        +

        Examples:

        +
        tr:nth-child(2n+0) /* represents every even row of an HTML table */
        +tr:nth-child(2n) /* same */
        +
        + +

        If both a and b are equal to zero, the +pseudo-class represents no element in the document tree.

        + +

        The value a can be negative, but only the positive +values of an+b, for +n≥0, may represent an element in the document +tree.

        + +
        +

        Example:

        +
        html|tr:nth-child(-n+6)  /* represents the 6 first rows of XHTML tables */
        +
        + +

        When the value b is negative, the "+" character in the +expression must be removed (it is effectively replaced by the "-" +character indicating the negative value of b).

        + +
        +

        Examples:

        +
        :nth-child(10n-1)  /* represents the 9th, 19th, 29th, etc, element */
        +:nth-child(10n+9)  /* Same */
        +:nth-child(10n+-1) /* Syntactically invalid, and would be ignored */
        +
        + + +
        :nth-last-child() pseudo-class
        + +

        The :nth-last-child(an+b) +pseudo-class notation represents an element that has +an+b-1 siblings +after it in the document tree, for a given positive +integer or zero value of n, and has a parent element. See +:nth-child() pseudo-class for the syntax of its argument. +It also accepts the 'even' and 'odd' values +as arguments. + + +

        +

        Examples:

        +
        tr:nth-last-child(-n+2)    /* represents the two last rows of an HTML table */
        +
        +foo:nth-last-child(odd)    /* represents all odd foo elements in their parent element,
        +                              counting from the last one */
        +
        + + +
        :nth-of-type() pseudo-class
        + +

        The :nth-of-type(an+b) +pseudo-class notation represents an element that has +an+b-1 siblings with the same +element name before it in the document tree, for a +given zero or positive integer value of n, and has a +parent element. In other words, this matches the bth child +of that type after all the children of that type have been split into +groups of a elements each. See :nth-child() pseudo-class +for the syntax of its argument. It also accepts the +'even' and 'odd' values. + + +

        +

        CSS example:

        +

        This allows an author to alternate the position of floated images:

        +
        img:nth-of-type(2n+1) { float: right; }
        +img:nth-of-type(2n) { float: left; }
        +
        + + +
        :nth-last-of-type() pseudo-class
        + +

        The :nth-last-of-type(an+b) +pseudo-class notation represents an element that has +an+b-1 siblings with the same +element name after it in the document tree, for a +given zero or positive integer value of n, and has a +parent element. See :nth-child() pseudo-class for the +syntax of its argument. It also accepts the 'even' and 'odd' values. + + +

        +

        Example:

        +

        To represent all h2 children of an XHTML + body except the first and last, one could use the + following selector:

        +
        body > h2:nth-of-type(n+2):nth-last-of-type(n+2)
        +

        In this case, one could also use :not(), although the + selector ends up being just as long:

        +
        body > h2:not(:first-of-type):not(:last-of-type)
        +
        + + +
        :first-child pseudo-class
        + +

        Same as :nth-child(1). The :first-child pseudo-class +represents an element that is the first child of some other element. + + +

        +

        Examples:

        +

        The following selector represents a p element that is + the first child of a div element:

        +
        div > p:first-child
        +

        This selector can represent the p inside the + div of the following fragment:

        +
        <p> The last P before the note.</p>
        +<div class="note">
        +   <p> The first P inside the note.</p>
        +</div>
        but cannot represent the second p in the following +fragment: +
        <p> The last P before the note.</p>
        +<div class="note">
        +   <h2> Note </h2>
        +   <p> The first P inside the note.</p>
        +</div>
        +

        The following two selectors are usually equivalent:

        +
        * > a:first-child /* a is first child of any element */
        +a:first-child /* Same (assuming a is not the root element) */
        +
        + +
        :last-child pseudo-class
        + +

        Same as :nth-last-child(1). The :last-child pseudo-class +represents an element that is the last child of some other element. + +

        +

        Example:

        +

        The following selector represents a list item li that + is the last child of an ordered list ol. +

        ol > li:last-child
        +
        + +
        :first-of-type pseudo-class
        + +

        Same as :nth-of-type(1). The :first-of-type pseudo-class +represents an element that is the first sibling of its type in the list of +children of its parent element. + +

        +

        Example:

        +

        The following selector represents a definition title +dt inside a definition list dl, this +dt being the first of its type in the list of children of +its parent element.

        +
        dl dt:first-of-type
        +

        It is a valid description for the first two dt +elements in the following example but not for the third one:

        +
        <dl>
        + <dt>gigogne</dt>
        + <dd>
        +  <dl>
        +   <dt>fusée</dt>
        +   <dd>multistage rocket</dd>
        +   <dt>table</dt>
        +   <dd>nest of tables</dd>
        +  </dl>
        + </dd>
        +</dl>
        +
        + +
        :last-of-type pseudo-class
        + +

        Same as :nth-last-of-type(1). The +:last-of-type pseudo-class represents an element that is +the last sibling of its type in the list of children of its parent +element.

        + +
        +

        Example:

        +

        The following selector represents the last data cell + td of a table row.

        +
        tr > td:last-of-type
        +
        + +
        :only-child pseudo-class
        + +

        Represents an element that has a parent element and whose parent +element has no other element children. Same as +:first-child:last-child or +:nth-child(1):nth-last-child(1), but with a lower +specificity.

        + +
        :only-of-type pseudo-class
        + +

        Represents an element that has a parent element and whose parent +element has no other element children with the same element name. Same +as :first-of-type:last-of-type or +:nth-of-type(1):nth-last-of-type(1), but with a lower +specificity.

        + + +
        :empty pseudo-class
        + +

        The :empty pseudo-class represents an element that has +no children at all. In terms of the DOM, only element nodes and text +nodes (including CDATA nodes and entity references) whose data has a +non-zero length must be considered as affecting emptiness; comments, +PIs, and other nodes must not affect whether an element is considered +empty or not.

        + +
        +

        Examples:

        +

        p:empty is a valid representation of the following fragment:

        +
        <p></p>
        +

        foo:empty is not a valid representation for the + following fragments:

        +
        <foo>bar</foo>
        +
        <foo><bar>bla</bar></foo>
        +
        <foo>this is not <bar>:empty</bar></foo>
        +
        + +

        6.6.6. Blank

        + +

        This section intentionally left blank.

        + + +

        6.6.7. The negation pseudo-class

        + +

        The negation pseudo-class, :not(X), is a +functional notation taking a simple +selector (excluding the negation pseudo-class itself and +pseudo-elements) as an argument. It represents an element that is not +represented by the argument. + + + +

        +

        Examples:

        +

        The following CSS selector matches all button + elements in an HTML document that are not disabled.

        +
        button:not([DISABLED])
        +

        The following selector represents all but FOO + elements.

        +
        *:not(FOO)
        +

        The following group of selectors represents all HTML elements + except links.

        +
        html|*:not(:link):not(:visited)
        +
        + +

        Default namespace declarations do not affect the argument of the +negation pseudo-class unless the argument is a universal selector or a +type selector.

        + +
        +

        Examples:

        +

        Assuming that the default namespace is bound to + "http://example.com/", the following selector represents all + elements that are not in that namespace:

        +
        *|*:not(*)
        +

        The following CSS selector matches any element being hovered, + regardless of its namespace. In particular, it is not limited to + only matching elements in the default namespace that are not being + hovered, and elements not in the default namespace don't match the + rule when they are being hovered.

        +
        *|*:not(:hover)
        +
        + +

        Note: the :not() pseudo allows +useless selectors to be written. For instance :not(*|*), +which represents no element at all, or foo:not(bar), +which is equivalent to foo but with a higher +specificity.

        + +

        7. Pseudo-elements

        + +

        Pseudo-elements create abstractions about the document tree beyond +those specified by the document language. For instance, document +languages do not offer mechanisms to access the first letter or first +line of an element's content. Pseudo-elements allow designers to refer +to this otherwise inaccessible information. Pseudo-elements may also +provide designers a way to refer to content that does not exist in the +source document (e.g., the ::before and +::after pseudo-elements give access to generated +content).

        + +

        A pseudo-element is made of two colons (::) followed +by the name of the pseudo-element.

        + +

        This :: notation is introduced by the current document +in order to establish a discrimination between pseudo-classes and +pseudo-elements. For compatibility with existing style sheets, user +agents must also accept the previous one-colon notation for +pseudo-elements introduced in CSS levels 1 and 2 (namely, +:first-line, :first-letter, +:before and :after). This compatibility is +not allowed for the new pseudo-elements introduced in CSS level 3.

        + +

        Only one pseudo-element may appear per selector, and if present it +must appear after the sequence of simple selectors that represents the +subjects of the selector. A +future version of this specification may allow multiple +pesudo-elements per selector.

        + +

        7.1. The ::first-line pseudo-element

        + +

        The ::first-line pseudo-element describes the contents +of the first formatted line of an element. + +

        +

        CSS example:

        +
        p::first-line { text-transform: uppercase }
        +

        The above rule means "change the letters of the first line of every +paragraph to uppercase".

        +
        + +

        The selector p::first-line does not match any real +HTML element. It does match a pseudo-element that conforming user +agents will insert at the beginning of every paragraph.

        + +

        Note that the length of the first line depends on a number of +factors, including the width of the page, the font size, etc. Thus, +an ordinary HTML paragraph such as:

        + +
        +<P>This is a somewhat long HTML 
        +paragraph that will be broken into several 
        +lines. The first line will be identified
        +by a fictional tag sequence. The other lines 
        +will be treated as ordinary lines in the 
        +paragraph.</P>
        +
        + +

        the lines of which happen to be broken as follows: + +

        +THIS IS A SOMEWHAT LONG HTML PARAGRAPH THAT
        +will be broken into several lines. The first
        +line will be identified by a fictional tag 
        +sequence. The other lines will be treated as 
        +ordinary lines in the paragraph.
        +
        + +

        This paragraph might be "rewritten" by user agents to include the +fictional tag sequence for ::first-line. This +fictional tag sequence helps to show how properties are inherited.

        + +
        +<P><P::first-line> This is a somewhat long HTML 
        +paragraph that </P::first-line> will be broken into several
        +lines. The first line will be identified 
        +by a fictional tag sequence. The other lines 
        +will be treated as ordinary lines in the 
        +paragraph.</P>
        +
        + +

        If a pseudo-element breaks up a real element, the desired effect +can often be described by a fictional tag sequence that closes and +then re-opens the element. Thus, if we mark up the previous paragraph +with a span element:

        + +
        +<P><SPAN class="test"> This is a somewhat long HTML
        +paragraph that will be broken into several
        +lines.</SPAN> The first line will be identified
        +by a fictional tag sequence. The other lines 
        +will be treated as ordinary lines in the 
        +paragraph.</P>
        +
        + +

        the user agent could simulate start and end tags for +span when inserting the fictional tag sequence for +::first-line. + +

        +<P><P::first-line><SPAN class="test"> This is a
        +somewhat long HTML
        +paragraph that will </SPAN></P::first-line><SPAN class="test"> be
        +broken into several
        +lines.</SPAN> The first line will be identified
        +by a fictional tag sequence. The other lines
        +will be treated as ordinary lines in the 
        +paragraph.</P>
        +
        + +

        In CSS, the ::first-line pseudo-element can only be +attached to a block-level element, an inline-block, a table-caption, +or a table-cell.

        + +

        The "first formatted line" of an +element may occur inside a +block-level descendant in the same flow (i.e., a block-level +descendant that is not positioned and not a float). E.g., the first +line of the div in <DIV><P>This +line...</P></DIV> is the first line of the p (assuming +that both p and div are block-level). + +

        The first line of a table-cell or inline-block cannot be the first +formatted line of an ancestor element. Thus, in <DIV><P +STYLE="display: inline-block">Hello<BR>Goodbye</P> +etcetera</DIV> the first formatted line of the +div is not the line "Hello". + +

        Note that the first line of the p in this +fragment: <p><br>First... doesn't contain any +letters (assuming the default style for br in HTML +4). The word "First" is not on the first formatted line. + +

        A UA should act as if the fictional start tags of the +::first-line pseudo-elements were nested just inside the +innermost enclosing block-level element. (Since CSS1 and CSS2 were +silent on this case, authors should not rely on this behavior.) Here +is an example. The fictional tag sequence for

        + +
        +<DIV>
        +  <P>First paragraph</P>
        +  <P>Second paragraph</P>
        +</DIV>
        +
        + +

        is

        + +
        +<DIV>
        +  <P><DIV::first-line><P::first-line>First paragraph</P::first-line></DIV::first-line></P>
        +  <P><P::first-line>Second paragraph</P::first-line></P>
        +</DIV>
        +
        + +

        The ::first-line pseudo-element is similar to an +inline-level element, but with certain restrictions. In CSS, the +following properties apply to a ::first-line +pseudo-element: font properties, color property, background +properties, 'word-spacing', 'letter-spacing', 'text-decoration', +'vertical-align', 'text-transform', 'line-height'. UAs may apply other +properties as well.

        + + +

        7.2. The ::first-letter pseudo-element

        + +

        The ::first-letter pseudo-element represents the first +letter of the first line of a block, if it is not preceded by any +other content (such as images or inline tables) on its line. The +::first-letter pseudo-element may be used for "initial caps" and "drop +caps", which are common typographical effects. This type of initial +letter is similar to an inline-level element if its 'float' property +is 'none'; otherwise, it is similar to a floated element.

        + +

        In CSS, these are the properties that apply to ::first-letter +pseudo-elements: font properties, 'text-decoration', 'text-transform', +'letter-spacing', 'word-spacing' (when appropriate), 'line-height', +'float', 'vertical-align' (only if 'float' is 'none'), margin +properties, padding properties, border properties, color property, +background properties. UAs may apply other properties as well. To +allow UAs to render a typographically correct drop cap or initial cap, +the UA may choose a line-height, width and height based on the shape +of the letter, unlike for normal elements.

        + +
        +

        Example:

        +

        This example shows a possible rendering of an initial cap. Note +that the 'line-height' that is inherited by the ::first-letter +pseudo-element is 1.1, but the UA in this example has computed the +height of the first letter differently, so that it doesn't cause any +unnecessary space between the first two lines. Also note that the +fictional start tag of the first letter is inside the span, and thus +the font weight of the first letter is normal, not bold as the span: +

        +p { line-height: 1.1 }
        +p::first-letter { font-size: 3em; font-weight: normal }
        +span { font-weight: bold }
        +...
        +<p><span>Het hemelsche</span> gerecht heeft zich ten lange lesten<br>
        +Erbarremt over my en mijn benaeuwde vesten<br>
        +En arme burgery, en op mijn volcx gebed<br>
        +En dagelix geschrey de bange stad ontzet.
        +
        +
        +

        Image illustrating the ::first-letter pseudo-element +

        +
        + +
        +

        The following CSS will make a drop cap initial letter span about two lines:

        + +
        +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN">
        +<HTML>
        + <HEAD>
        +  <TITLE>Drop cap initial letter</TITLE>
        +  <STYLE type="text/css">
        +   P               { font-size: 12pt; line-height: 1.2 }
        +   P::first-letter { font-size: 200%; font-weight: bold; float: left }
        +   SPAN            { text-transform: uppercase }
        +  </STYLE>
        + </HEAD>
        + <BODY>
        +  <P><SPAN>The first</SPAN> few words of an article
        +    in The Economist.</P>
        + </BODY>
        +</HTML>
        +
        + +

        This example might be formatted as follows:

        + +
        +

        Image illustrating the combined effect of the ::first-letter and ::first-line pseudo-elements

        +
        + +

        The fictional tag sequence is:

        + +
        +<P>
        +<SPAN>
        +<P::first-letter>
        +T
        +</P::first-letter>he first
        +</SPAN> 
        +few words of an article in the Economist.
        +</P>
        +
        + +

        Note that the ::first-letter pseudo-element tags abut +the content (i.e., the initial character), while the ::first-line +pseudo-element start tag is inserted right after the start tag of the +block element.

        + +

        In order to achieve traditional drop caps formatting, user agents +may approximate font sizes, for example to align baselines. Also, the +glyph outline may be taken into account when formatting.

        + +

        Punctuation (i.e, characters defined in Unicode in the "open" (Ps), +"close" (Pe), "initial" (Pi). "final" (Pf) and "other" (Po) +punctuation classes), that precedes or follows the first letter should +be included. [UNICODE]

        + +
        +

        Quotes that precede the
+first letter should be included.

        +
        + +

        The ::first-letter also applies if the first letter is +in fact a digit, e.g., the "6" in "67 million dollars is a lot of +money."

        + +

        In CSS, the ::first-letter pseudo-element applies to +block, list-item, table-cell, table-caption, and inline-block +elements. A future version of this specification +may allow this pesudo-element to apply to more element +types.

        + +

        The ::first-letter pseudo-element can be used with all +such elements that contain text, or that have a descendant in the same +flow that contains text. A UA should act as if the fictional start tag +of the ::first-letter pseudo-element is just before the first text of +the element, even if that first text is in a descendant.

        + +
        +

        Example:

        +

        The fictional tag sequence for this HTMLfragment: +

        <div>
        +<p>The first text.
        +

        is: +

        <div>
        +<p><div::first-letter><p::first-letter>T</...></...>he first text.
        +
        + +

        The first letter of a table-cell or inline-block cannot be the +first letter of an ancestor element. Thus, in <DIV><P +STYLE="display: inline-block">Hello<BR>Goodbye</P> +etcetera</DIV> the first letter of the div is not the +letter "H". In fact, the div doesn't have a first letter. + +

        The first letter must occur on the first formatted line. For example, in +this fragment: <p><br>First... the first line +doesn't contain any letters and ::first-letter doesn't +match anything (assuming the default style for br in HTML +4). In particular, it does not match the "F" of "First." + +

        In CSS, if an element is a list item ('display: list-item'), the +::first-letter applies to the first letter in the +principal box after the marker. UAs may ignore +::first-letter on list items with 'list-style-position: +inside'. If an element has ::before or +::after content, the ::first-letter applies +to the first letter of the element including that content. + +

        +

        Example:

        +

        After the rule 'p::before {content: "Note: "}', the selector +'p::first-letter' matches the "N" of "Note".

        +
        + +

        Some languages may have specific rules about how to treat certain +letter combinations. In Dutch, for example, if the letter combination +"ij" appears at the beginning of a word, both letters should be +considered within the ::first-letter pseudo-element. + +

        If the letters that would form the ::first-letter are not in the +same element, such as "'T" in <p>'<em>T..., the UA +may create a ::first-letter pseudo-element from one of the elements, +both elements, or simply not create a pseudo-element.

        + +

        Similarly, if the first letter(s) of the block are not at the start +of the line (for example due to bidirectional reordering), then the UA +need not create the pseudo-element(s). + +

        +

        Example:

        +

        The following example illustrates +how overlapping pseudo-elements may interact. The first letter of +each P element will be green with a font size of '24pt'. The rest of +the first formatted line will be 'blue' while the rest of the +paragraph will be 'red'.

        + +
        p { color: red; font-size: 12pt }
        +p::first-letter { color: green; font-size: 200% }
        +p::first-line { color: blue }
        +
        +<P>Some text that ends up on two lines</P>
        + +

        Assuming that a line break will occur before the word "ends", the +fictional tag +sequence for this fragment might be:

        + +
        <P>
        +<P::first-line>
        +<P::first-letter> 
        +S 
        +</P::first-letter>ome text that 
        +</P::first-line> 
        +ends up on two lines 
        +</P>
        + +

        Note that the ::first-letter element is inside the ::first-line +element. Properties set on ::first-line are inherited by +::first-letter, but are overridden if the same property is set on +::first-letter.

        +
        + + +

        7.3. The ::selection pseudo-element

        + +

        The ::selection pseudo-element applies to the portion +of a document that has been highlighted by the user. This also +applies, for example, to selected text within an editable text +field. This pseudo-element should not be confused with the :checked pseudo-class (which used to be +named :selected) + +

        Although the ::selection pseudo-element is dynamic in +nature, and is altered by user action, it is reasonable to expect that +when a UA re-renders to a static medium (such as a printed page, see +[CSS21]) which was originally rendered to a +dynamic medium (like screen), the UA may wish to transfer the current +::selection state to that other medium, and have all the +appropriate formatting and rendering take effect as well. This is not +required — UAs may omit the ::selection +pseudo-element for static media. + +

        These are the CSS properties that apply to ::selection +pseudo-elements: color, background, cursor (optional), outline +(optional). The computed value of the 'background-image' property on +::selection may be ignored. + + +

        7.4. The ::before and ::after pseudo-elements

        + +

        The ::before and ::after pseudo-elements +can be used to describe generated content before or after an element's +content. They are explained in CSS 2.1 [CSS21].

        + +

        When the ::first-letter and ::first-line +pseudo-elements are combined with ::before and +::after, they apply to the first letter or line of the +element including the inserted text.

        + +

        8. Combinators

        + +

        8.1. Descendant combinator

        + +

        At times, authors may want selectors to describe an element that is +the descendant of another element in the document tree (e.g., "an +EM element that is contained within an H1 +element"). Descendant combinators express such a relationship. A +descendant combinator is white space that +separates two sequences of simple selectors. A selector of the form +"A B" represents an element B that is an +arbitrary descendant of some ancestor element A. + +

        +

        Examples:

        +

        For example, consider the following selector:

        +
        h1 em
        +

        It represents an em element being the descendant of + an h1 element. It is a correct and valid, but partial, + description of the following fragment:

        +
        <h1>This <span class="myclass">headline
        +is <em>very</em> important</span></h1>
        +

        The following selector:

        +
        div * p
        +

        represents a p element that is a grandchild or later + descendant of a div element. Note the whitespace on + either side of the "*" is not part of the universal selector; the + whitespace is a combinator indicating that the DIV must be the + ancestor of some element, and that that element must be an ancestor + of the P.

        +

        The following selector, which combines descendant combinators and + attribute selectors, represents an + element that (1) has the href attribute set and (2) is + inside a p that is itself inside a div:

        +
        div p *[href]
        +
        + +

        8.2. Child combinators

        + +

        A child combinator describes a childhood relationship +between two elements. A child combinator is made of the +"greater-than sign" (>) character and +separates two sequences of simple selectors. + + +

        +

        Examples:

        +

        The following selector represents a p element that is + child of body:

        +
        body > p
        +

        The following example combines descendant combinators and child + combinators.

        +
        div ol>li p
        +

        It represents a p element that is a descendant of an + li element; the li element must be the + child of an ol element; the ol element must + be a descendant of a div. Notice that the optional white + space around the ">" combinator has been left out.

        +
        + +

        For information on selecting the first child of an element, please +see the section on the :first-child pseudo-class +above.

        + +

        8.3. Sibling combinators

        + +

        There are two different sibling combinators: the adjacent sibling +combinator and the general sibling combinator. In both cases, +non-element nodes (e.g. text between elements) are ignored when +considering adjacency of elements.

        + +

        8.3.1. Adjacent sibling combinator

        + +

        The adjacent sibling combinator is made of the "plus +sign" (U+002B, +) character that separates two +sequences of simple selectors. The elements represented by the two +sequences share the same parent in the document tree and the element +represented by the first sequence immediately precedes the element +represented by the second one.

        + +
        +

        Examples:

        +

        The following selector represents a p element + immediately following a math element:

        +
        math + p
        +

        The following selector is conceptually similar to the one in the + previous example, except that it adds an attribute selector — it + adds a constraint to the h1 element, that it must have + class="opener":

        +
        h1.opener + h2
        +
        + + +

        8.3.2. General sibling combinator

        + +

        The general sibling combinator is made of the "tilde" +(U+007E, ~) character that separates two sequences of +simple selectors. The elements represented by the two sequences share +the same parent in the document tree and the element represented by +the first sequence precedes (not necessarily immediately) the element +represented by the second one.

        + +
        +

        Example:

        +
        h1 ~ pre
        +

        represents a pre element following an h1. It + is a correct and valid, but partial, description of:

        +
        <h1>Definition of the function a</h1>
        +<p>Function a(x) has to be applied to all figures in the table.</p>
        +<pre>function a(x) = 12x/13.5</pre>
        +
        + +

        9. Calculating a selector's specificity

        + +

        A selector's specificity is calculated as follows:

        + +
          +
        • count the number of ID selectors in the selector (= a)
        • +
        • count the number of class selectors, attributes selectors, and pseudo-classes in the selector (= b)
        • +
        • count the number of element names in the selector (= c)
        • +
        • ignore pseudo-elements
        • +
        + +

        Selectors inside the negation pseudo-class +are counted like any other, but the negation itself does not count as +a pseudo-class.

        + +

        Concatenating the three numbers a-b-c (in a number system with a +large base) gives the specificity.

        + +
        +

        Examples:

        +
        *               /* a=0 b=0 c=0 -> specificity =   0 */
        +LI              /* a=0 b=0 c=1 -> specificity =   1 */
        +UL LI           /* a=0 b=0 c=2 -> specificity =   2 */
        +UL OL+LI        /* a=0 b=0 c=3 -> specificity =   3 */
        +H1 + *[REL=up]  /* a=0 b=1 c=1 -> specificity =  11 */
        +UL OL LI.red    /* a=0 b=1 c=3 -> specificity =  13 */
        +LI.red.level    /* a=0 b=2 c=1 -> specificity =  21 */
        +#x34y           /* a=1 b=0 c=0 -> specificity = 100 */
        +#s12:not(FOO)   /* a=1 b=0 c=1 -> specificity = 101 */
        +
        +
        + +

        Note: the specificity of the styles +specified in an HTML style attribute is described in CSS +2.1. [CSS21].

        + +

        10. The grammar of Selectors

        + +

        10.1. Grammar

        + +

        The grammar below defines the syntax of Selectors. It is globally +LL(1) and can be locally LL(2) (but note that most UA's should not use +it directly, since it doesn't express the parsing conventions). The +format of the productions is optimized for human consumption and some +shorthand notations beyond Yacc (see [YACC]) +are used:

        + +
          +
        • *: 0 or more +
        • +: 1 or more +
        • ?: 0 or 1 +
        • |: separates alternatives +
        • [ ]: grouping
        • +
        + +

        The productions are:

        + +
        selectors_group
        +  : selector [ COMMA S* selector ]*
        +  ;
        +
        +selector
        +  : simple_selector_sequence [ combinator simple_selector_sequence ]*
        +  ;
        +
        +combinator
        +  /* combinators can be surrounded by white space */
        +  : PLUS S* | GREATER S* | TILDE S* | S+
        +  ;
        +
        +simple_selector_sequence
        +  : [ type_selector | universal ]
        +    [ HASH | class | attrib | pseudo | negation ]*
        +  | [ HASH | class | attrib | pseudo | negation ]+
        +  ;
        +
        +type_selector
        +  : [ namespace_prefix ]? element_name
        +  ;
        +
        +namespace_prefix
        +  : [ IDENT | '*' ]? '|'
        +  ;
        +
        +element_name
        +  : IDENT
        +  ;
        +
        +universal
        +  : [ namespace_prefix ]? '*'
        +  ;
        +
        +class
        +  : '.' IDENT
        +  ;
        +
        +attrib
        +  : '[' S* [ namespace_prefix ]? IDENT S*
        +        [ [ PREFIXMATCH |
        +            SUFFIXMATCH |
        +            SUBSTRINGMATCH |
        +            '=' |
        +            INCLUDES |
        +            DASHMATCH ] S* [ IDENT | STRING ] S*
        +        ]? ']'
        +  ;
        +
        +pseudo
        +  /* '::' starts a pseudo-element, ':' a pseudo-class */
        +  /* Exceptions: :first-line, :first-letter, :before and :after. */
        +  /* Note that pseudo-elements are restricted to one per selector and */
        +  /* occur only in the last simple_selector_sequence. */
        +  : ':' ':'? [ IDENT | functional_pseudo ]
        +  ;
        +
        +functional_pseudo
        +  : FUNCTION S* expression ')'
        +  ;
        +
        +expression
        +  /* In CSS3, the expressions are identifiers, strings, */
        +  /* or of the form "an+b" */
        +  : [ [ PLUS | '-' | DIMENSION | NUMBER | STRING | IDENT ] S* ]+
        +  ;
        +
        +negation
        +  : NOT S* negation_arg S* ')'
        +  ;
        +
        +negation_arg
        +  : type_selector | universal | HASH | class | attrib | pseudo
        +  ;
        + + +

        10.2. Lexical scanner

        + +

        The following is the tokenizer, written in Flex (see +[FLEX]) notation. The tokenizer is +case-insensitive.

        + +

        The two occurrences of "\377" represent the highest character +number that current versions of Flex can deal with (decimal 255). They +should be read as "\4177777" (decimal 1114111), which is the highest +possible code point in Unicode/ISO-10646. [UNICODE]

        + +
        %option case-insensitive
        +
        +ident     [-]?{nmstart}{nmchar}*
        +name      {nmchar}+
        +nmstart   [_a-z]|{nonascii}|{escape}
        +nonascii  [^\0-\177]
        +unicode   \\[0-9a-f]{1,6}(\r\n|[ \n\r\t\f])?
        +escape    {unicode}|\\[^\n\r\f0-9a-f]
        +nmchar    [_a-z0-9-]|{nonascii}|{escape}
        +num       [0-9]+|[0-9]*\.[0-9]+
        +string    {string1}|{string2}
        +string1   \"([^\n\r\f\\"]|\\{nl}|{nonascii}|{escape})*\"
        +string2   \'([^\n\r\f\\']|\\{nl}|{nonascii}|{escape})*\'
        +invalid   {invalid1}|{invalid2}
        +invalid1  \"([^\n\r\f\\"]|\\{nl}|{nonascii}|{escape})*
        +invalid2  \'([^\n\r\f\\']|\\{nl}|{nonascii}|{escape})*
        +nl        \n|\r\n|\r|\f
        +w         [ \t\r\n\f]*
        +
        +%%
        +
        +[ \t\r\n\f]+     return S;
        +
        +"~="             return INCLUDES;
        +"|="             return DASHMATCH;
        +"^="             return PREFIXMATCH;
        +"$="             return SUFFIXMATCH;
        +"*="             return SUBSTRINGMATCH;
        +{ident}          return IDENT;
        +{string}         return STRING;
        +{ident}"("       return FUNCTION;
        +{num}            return NUMBER;
        +"#"{name}        return HASH;
        +{w}"+"           return PLUS;
        +{w}">"           return GREATER;
        +{w}","           return COMMA;
        +{w}"~"           return TILDE;
        +":not("          return NOT;
        +@{ident}         return ATKEYWORD;
        +{invalid}        return INVALID;
        +{num}%           return PERCENTAGE;
        +{num}{ident}     return DIMENSION;
        +"<!--"           return CDO;
        +"-->"            return CDC;
        +
        +"url("{w}{string}{w}")"                           return URI;
        +"url("{w}([!#$%&*-~]|{nonascii}|{escape})*{w}")"  return URI;
        +U\+[0-9a-f?]{1,6}(-[0-9a-f]{1,6})?                return UNICODE_RANGE;
        +
        +\/\*[^*]*\*+([^/*][^*]*\*+)*\/                    /* ignore comments */
        +
        +.                return *yytext;
        + + + +

        11. Namespaces and down-level clients

        + +

        An important issue is the interaction of CSS selectors with XML +documents in web clients that were produced prior to this +document. Unfortunately, due to the fact that namespaces must be +matched based on the URI which identifies the namespace, not the +namespace prefix, some mechanism is required to identify namespaces in +CSS by their URI as well. Without such a mechanism, it is impossible +to construct a CSS style sheet which will properly match selectors in +all cases against a random set of XML documents. However, given +complete knowledge of the XML document to which a style sheet is to be +applied, and a limited use of namespaces within the XML document, it +is possible to construct a style sheet in which selectors would match +elements and attributes correctly.

        + +

        It should be noted that a down-level CSS client will (if it +properly conforms to CSS forward compatible parsing rules) ignore all +@namespace at-rules, as well as all style rules that make +use of namespace qualified element type or attribute selectors. The +syntax of delimiting namespace prefixes in CSS was deliberately chosen +so that down-level CSS clients would ignore the style rules rather +than possibly match them incorrectly.

        + +

        The use of default namespaces in CSS makes it possible to write +element type selectors that will function in both namespace aware CSS +clients as well as down-level clients. It should be noted that +down-level clients may incorrectly match selectors against XML +elements in other namespaces.

        + +

        The following are scenarios and examples in which it is possible to +construct style sheets which would function properly in web clients +that do not implement this proposal.

        + +
          +
        1. + +

          The XML document does not use namespaces.

          + +
            + +
          • In this case, it is obviously not necessary to declare or use + namespaces in the style sheet. Standard CSS element type and + attribute selectors will function adequately in a down-level + client.
          • + +
          • In a CSS namespace aware client, the default behavior of + element selectors matching without regard to namespace will + function properly against all elements, since no namespaces are + present. However, the use of specific element type selectors that + match only elements that have no namespace ("|name") + will guarantee that selectors will match only XML elements that do + not have a declared namespace.
          • + +
          + +
        2. + +
        3. + +

          The XML document defines a single, default namespace used + throughout the document. No namespace prefixes are used in element + names.

          + +
            + +
          • In this case, a down-level client will function as if + namespaces were not used in the XML document at all. Standard CSS + element type and attribute selectors will match against all + elements.
          • + +
          + +
        4. + +
        5. + +

          The XML document does not use a default namespace, all + namespace prefixes used are known to the style sheet author, and + there is a direct mapping between namespace prefixes and namespace + URIs. (A given prefix may only be mapped to one namespace URI + throughout the XML document; there may be multiple prefixes mapped + to the same URI).

          + +
            + +
          • In this case, the down-level client will view and match + element type and attribute selectors based on their fully + qualified name, not the local part as outlined in the Type selectors and Namespaces section. CSS + selectors may be declared using an escaped colon "\:" + to describe the fully qualified names, e.g. + "html\:h1" will match + <html:h1>. Selectors using the qualified name + will only match XML elements that use the same prefix. Other + namespace prefixes used in the XML that are mapped to the same URI + will not match as expected unless additional CSS style rules are + declared for them.
          • + +
          • Note that selectors declared in this fashion will + only match in down-level clients. A CSS namespace aware + client will match element type and attribute selectors based on + the name's local part. Selectors declared with the fully + qualified name will not match (unless there is no namespace prefix + in the fully qualified name).
          • + +
          + +
        6. + +
        + +

        In other scenarios: when the namespace prefixes used in the XML are +not known in advance by the style sheet author; or a combination of +elements with no namespace are used in conjunction with elements using +a default namespace; or the same namespace prefix is mapped to +different namespace URIs within the same document, or in +different documents; it is impossible to construct a CSS style sheet +that will function properly against all elements in those documents, +unless, the style sheet is written using a namespace URI syntax (as +outlined in this document or similar) and the document is processed by +a CSS and XML namespace aware client.

        + +

        12. Profiles

        + +

        Each specification using Selectors must define the subset of W3C +Selectors it allows and excludes, and describe the local meaning of +all the components of that subset.

        + +

        Non normative examples: + +

        + + + + + + + + + + + + + + + +
        Selectors profile
        SpecificationCSS level 1
        Acceptstype selectors
        class selectors
        ID selectors
        :link, + :visited and :active pseudo-classes
        descendant combinator +
        ::first-line and ::first-letter pseudo-elements
        Excludes + +

        universal selector
        attribute selectors
        :hover and :focus + pseudo-classes
        :target pseudo-class
        :lang() pseudo-class
        all UI + element states pseudo-classes
        all structural + pseudo-classes
        negation pseudo-class
        all + UI element fragments pseudo-elements
        ::before and ::after + pseudo-elements
        child combinators
        sibling combinators + +

        namespaces

        Extra constraintsonly one class selector allowed per sequence of simple + selectors


        + + + + + + + + + + + + + + + +
        Selectors profile
        SpecificationCSS level 2
        Acceptstype selectors
        universal selector
        attribute presence and + values selectors
        class selectors
        ID selectors
        :link, :visited, + :active, :hover, :focus, :lang() and :first-child pseudo-classes +
        descendant combinator
        child combinator
        adjacent sibling + combinator
        ::first-line and ::first-letter pseudo-elements
        ::before + and ::after pseudo-elements
        Excludes + +

        content selectors
        substring matching attribute + selectors
        :target pseudo-classes
        all UI element + states pseudo-classes
        all structural pseudo-classes other + than :first-child
        negation pseudo-class
        all UI element + fragments pseudo-elements
        general sibling combinators + +

        namespaces

        Extra constraintsmore than one class selector per sequence of simple selectors (CSS1 + constraint) allowed
        + +

        In CSS, selectors express pattern matching rules that determine which style +rules apply to elements in the document tree. + +

        The following selector (CSS level 2) will match all anchors a +with attribute name set inside a section 1 header h1: +

        h1 a[name]
        + +

        All CSS declarations attached to such a selector are applied to elements +matching it.

        + +
        + + + + + + + + + + + + + + + + +
        Selectors profile
        SpecificationSTTS 3
        Accepts + +

        type selectors
        universal selectors
        attribute selectors
        class + selectors
        ID selectors
        all structural pseudo-classes
        + all combinators + +

        namespaces

        Excludesnon-accepted pseudo-classes
        pseudo-elements
        Extra constraintssome selectors and combinators are not allowed in fragment + descriptions on the right side of STTS declarations.
        + +

        Selectors can be used in STTS 3 in two different + manners: +

          +
        1. a selection mechanism equivalent to CSS selection mechanism: declarations + attached to a given selector are applied to elements matching that selector, +
        2. fragment descriptions that appear on the right side of declarations. +
        + +

        13. Conformance and requirements

        + +

        This section defines conformance with the present specification only. + +

        The inability of a user agent to implement part of this specification due to +the limitations of a particular device (e.g., non interactive user agents will +probably not implement dynamic pseudo-classes because they make no sense without +interactivity) does not imply non-conformance. + +

        All specifications reusing Selectors must contain a Profile listing the +subset of Selectors it accepts or excludes, and describing the constraints +it adds to the current specification. + +

        Invalidity is caused by a parsing error, e.g. an unrecognized token or a token +which is not allowed at the current parsing point. + +

        User agents must observe the rules for handling parsing errors: +

          +
        • a simple selector containing an undeclared namespace prefix is invalid
        • +
        • a selector containing an invalid simple selector, an invalid combinator + or an invalid token is invalid.
        • +
        • a group of selectors containing an invalid selector is invalid.
        • +
        + +

        Specifications reusing Selectors must define how to handle parsing +errors. (In the case of CSS, the entire rule in which the selector is +used is dropped.)

        + + + +

        14. Tests

        + +

        This specification has a test +suite allowing user agents to verify their basic conformance to +the specification. This test suite does not pretend to be exhaustive +and does not cover all possible combined cases of Selectors.

        + +

        15. Acknowledgements

        + +

        The CSS working group would like to thank everyone who has sent +comments on this specification over the years.

        + +

        The working group would like to extend special thanks to Donna +McManus, Justin Baker, Joel Sklar, and Molly Ives Brower who perfermed +the final editorial review.

        + +

        16. References

        + +
        + +
        [CSS1] +
        Bert Bos, Håkon Wium Lie; "Cascading Style Sheets, level 1", W3C Recommendation, 17 Dec 1996, revised 11 Jan 1999 +
        (http://www.w3.org/TR/REC-CSS1) + +
        [CSS21] +
        Bert Bos, Tantek Çelik, Ian Hickson, Håkon Wium Lie, editors; "Cascading Style Sheets, level 2 revision 1", W3C Working Draft, 13 June 2005 +
        (http://www.w3.org/TR/CSS21) + +
        [CWWW] +
        Martin J. Dürst, François Yergeau, Misha Wolf, Asmus Freytag, Tex Texin, editors; "Character Model for the World Wide Web", W3C Recommendation, 15 February 2005 +
        (http://www.w3.org/TR/charmod/) + +
        [FLEX] +
        "Flex: The Lexical Scanner Generator", Version 2.3.7, ISBN 1882114213 + +
        [HTML4] +
        Dave Ragget, Arnaud Le Hors, Ian Jacobs, editors; "HTML 4.01 Specification", W3C Recommendation, 24 December 1999 +
        (http://www.w3.org/TR/html4/) + +
        [MATH] +
        Patrick Ion, Robert Miner, editors; "Mathematical Markup Language (MathML) 1.01", W3C Recommendation, revision of 7 July 1999 +
        (http://www.w3.org/TR/REC-MathML/) + +
        [RFC3066] +
        H. Alvestrand; "Tags for the Identification of Languages", Request for Comments 3066, January 2001 +
        (http://www.ietf.org/rfc/rfc3066.txt) + +
        [STTS] +
        Daniel Glazman; "Simple Tree Transformation Sheets 3", Electricité de France, submission to the W3C, 11 November 1998 +
        (http://www.w3.org/TR/NOTE-STTS3) + +
        [SVG] +
        Jon Ferraiolo, 藤沢 淳, Dean Jackson, editors; "Scalable Vector Graphics (SVG) 1.1 Specification", W3C Recommendation, 14 January 2003 +
        (http://www.w3.org/TR/SVG/) + +
        [UNICODE]
        +
        The Unicode Standard, Version 4.1, The Unicode Consortium. Boston, MA, Addison-Wesley, March 2005. ISBN 0-321-18578-1, as amended by Unicode 4.0.1 and Unicode 4.1.0. +
        (http://www.unicode.org/versions/)
        + +
        [XML10] +
        Tim Bray, Jean Paoli, C. M. Sperberg-McQueen, Eve Maler, François Yergeau, editors; "Extensible Markup Language (XML) 1.0 (Third Edition)", W3C Recommendation, 4 February 2004 +
        (http://www.w3.org/TR/REC-xml/) + +
        [XMLNAMES] +
        Tim Bray, Dave Hollander, Andrew Layman, editors; "Namespaces in XML", W3C Recommendation, 14 January 1999 +
        (http://www.w3.org/TR/REC-xml-names/) + +
        [YACC] +
        S. C. Johnson; "YACC — Yet another compiler compiler", Technical Report, Murray Hill, 1975 + +
        + + diff --git a/vendor/sunra/php-simple-html-dom-parser/Src/Sunra/PhpSimple/simplehtmldom_1_5/testcase/.svn/text-base/std_testcase.php.svn-base b/vendor/sunra/php-simple-html-dom-parser/Src/Sunra/PhpSimple/simplehtmldom_1_5/testcase/.svn/text-base/std_testcase.php.svn-base new file mode 100644 index 000000000..02220f239 --- /dev/null +++ b/vendor/sunra/php-simple-html-dom-parser/Src/Sunra/PhpSimple/simplehtmldom_1_5/testcase/.svn/text-base/std_testcase.php.svn-base @@ -0,0 +1,243 @@ +load($str); +assert($dom->save()==$str); +// ----------------------------------------------- +$str = null; +$dom->load($str); +assert($dom->save()==$str); + +// ----------------------------------------------------------------------------- +// text test +$str = << + +HTML; +$dom->load($str); +assert(count($dom->find('unknown'))==1); +assert(count($dom->find('text'))==1); + +// ----------------------------------------------------------------------------- +// string quote test +$str = << + okok
        + +
        +
        + +
        +
        +
        +HTML; +$dom->load($str); +$es = $dom->find('input'); +assert(count($es)==4); +assert($es[0]->onclick=='goto("url0")'); +assert($es[1]->onclick=="goto('url1'+'\'')"); +assert($es[2]->onclick=="goto('url2')"); +assert($es[3]->onclick=='goto("url4"+"\"")'); + +// ----------------------------------------------------------------------------- +// clone test +$str = << + okok
        + +
        +
        + +
        +
        + +HTML; +$dom->load($str); +$es = $dom->find('input'); +assert(count($es)==4); +assert($es[0]->onclick=='goto("url0")'); +assert($es[1]->onclick=="goto('url1'+'\'')"); +assert($es[2]->onclick=="goto('url2')"); +assert($es[3]->onclick=='goto("url4"+"\"")'); + +unset($es); +$dom2 = clone($dom); +$es = $dom2->find('input'); +assert(count($es)==4); +assert($es[0]->onclick=='goto("url0")'); +assert($es[1]->onclick=="goto('url1'+'\'')"); +assert($es[2]->onclick=="goto('url2')"); +assert($es[3]->onclick=='goto("url4"+"\"")'); + +// ----------------------------------------------- +$str = << +HTML; +$dom->load($str); +assert($dom==$str); +assert($dom->save()==$str); + +// ----------------------------------------------------------------------------- +// monkey test +$str = <<load($str); +assert($dom==$str); +assert($dom->save()==$str); +// ----------------------------------------------- +$str = <<load($str); +assert($dom==$str); +assert($dom->save()==$str); +// ----------------------------------------------- +$str = <<load($str); +assert($dom==$str); +assert($dom->save()==$str); +// ----------------------------------------------- +$str = <<load($str); +assert($dom==$str); +assert($dom->save()==$str); +// ----------------------------------------------- +$str = <<load($str); +assert($dom==$str); +assert($dom->save()==$str); +// ----------------------------------------------- +$str = <<load($str); +assert($dom==$str); +assert($dom->save()==$str); +// ----------------------------------------------- +$str = <<load($str); +assert($dom==$str); +assert($dom->save()==$str); +// ----------------------------------------------- +$str = <<<<>ab +HTML; +$dom->load($str); +assert($dom==$str); +assert($dom->save()==$str); +// ----------------------------------------------- +$str = <<load($str); +assert($dom==$str); +assert($dom->save()==$str); +// ----------------------------------------------- +$str = << +HTML; +$dom->load($str); +assert($dom==$str); +assert($dom->save()==$str); +// ----------------------------------------------- +// $str = <<load($str); +// echo $dom; +// assert($dom==$str); +// assert($dom->save()==$str); +// ----------------------------------------------- +$str = <<load($str); +assert($dom==$str); +assert($dom->save()==$str); + +// ----------------------------------------------------------------------------- +// rnadom string test +function str_random($length) +{ + $str = ""; + srand((double)microtime()*1000000); + $char_list = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"; + $char_list .= "abcdefghijklmnopqrstuvwxyz"; + $char_list .= "1234567890"; + $char_list .= "<>!?[]%^&*()"; + for($i=0; $i<$length; ++$i) + $str .= substr($char_list,(rand()%(strlen($char_list))), 1); + return $str; +} + +for($i=0; $i<60; ++$i) { + $str = str_random($i); + //echo $str."\n
        "; + $dom->load($str, false); + //echo $dom->save()."\n
        "; + assert($dom==$str); +} + +// ----------------------------------------------------------------------------- +// lowercase test +$str = << +HTML; +$dom->load($str); +assert(count($dom->find('img'))==1); +assert(count($dom->find('IMG'))==1); +assert(isset($dom->find('img', 0)->class)); +assert(!isset($dom->find('img', 0)->CLASS)); +assert($dom->find('img', 0)->class=='class0'); +assert($dom==$str); +// ----------------------------------------------- +$str = << +HTML; +$dom->load($str); +assert(count($dom->find('img'))==1); +assert(count($dom->find('IMG'))==1); +assert(isset($dom->find('img', 0)->class)); +assert(!isset($dom->find('img', 0)->CLASS)); +assert($dom->find('img', 0)->class=='class0'); +assert($dom==strtolower($str)); +// ----------------------------------------------- +$str = << +HTML; +$dom->load($str, false); +assert(count($dom->find('img'))==0); +assert(count($dom->find('IMG'))==1); +assert(isset($dom->find('IMG', 0)->CLASS)); +assert(!isset($dom->find('IMG', 0)->class)); +assert($dom->find('IMG', 0)->CLASS=='class0'); +assert($dom==$str); + +// ----------------------------------------------------------------------------- +// tear down +$dom->clear(); +unset($dom); +?> \ No newline at end of file diff --git a/vendor/sunra/php-simple-html-dom-parser/Src/Sunra/PhpSimple/simplehtmldom_1_5/testcase/.svn/text-base/strip_testcase.php.svn-base b/vendor/sunra/php-simple-html-dom-parser/Src/Sunra/PhpSimple/simplehtmldom_1_5/testcase/.svn/text-base/strip_testcase.php.svn-base new file mode 100644 index 000000000..21af47fd6 --- /dev/null +++ b/vendor/sunra/php-simple-html-dom-parser/Src/Sunra/PhpSimple/simplehtmldom_1_5/testcase/.svn/text-base/strip_testcase.php.svn-base @@ -0,0 +1,137 @@ + + + +HTML; +$dom->load($str); +assert(count($dom->find('input'))==0); + +// ----------------------------------------------------------------------------- +// test +$str = << + + + + +HTML; +$dom->load($str); +assert(count($dom->find('code'))==1); +assert(count($dom->find('input'))==0); + +// ----------------------------------------------------------------------------- +//
         &  test
        +$str = <<
        +    
        +
        +HTML; +$dom->load($str); +assert(count($dom->find('pre'))==1); +assert(count($dom->find('input'))==0); + +// ----------------------------------------------------------------------------- +// + +HTML; +$dom->load($str); +assert(count($dom->find('style'))==1); +assert(count($dom->find('script'))==3); + +// ----------------------------------------------------------------------------- +// php short tag test +$str = <<hello + +HTML; +$dom->load($str); +assert($dom->find('a', 0)->href===""); +assert($dom->find('input', 0)->value===""); + +// ----------------------------------------------------------------------------- +// noise stripping test +$str = <<--> + + +HTML; +$dom->load($str); +assert(count($dom->find('img'))==1); +assert($dom==$str); +// ----------------------------------------------- +$str = <<ss + + + + + + + + + + + + + +HTML; +$dom->load($str); +assert(count($dom->find('script'))==8); +assert(count($dom->find('style'))==3); +//echo "\n\n\n\n".$dom->save(); +assert($dom==$str); + +// ----------------------------------------------------------------------------- +// tear down +$dom->clear(); +unset($dom); +?> \ No newline at end of file diff --git a/vendor/sunra/php-simple-html-dom-parser/Src/Sunra/PhpSimple/simplehtmldom_1_5/testcase/all_test.php b/vendor/sunra/php-simple-html-dom-parser/Src/Sunra/PhpSimple/simplehtmldom_1_5/testcase/all_test.php new file mode 100644 index 000000000..8574df900 --- /dev/null +++ b/vendor/sunra/php-simple-html-dom-parser/Src/Sunra/PhpSimple/simplehtmldom_1_5/testcase/all_test.php @@ -0,0 +1,24 @@ +'', 'plain'=>'', 'outer'=>'')) { + $html_dom->load($str); + $e = $html_dom->find($selector, 0); + if (isset($params['inner'])) + assert($e->innertext===$params['inner']); + if (isset($params['plain'])) + assert($e->plaintext===$params['plain']); + if (isset($params['outer'])) + assert($e->outertext===$params['outer']); + assert($html_dom==$str); +} + +foreach (new DirectoryIterator(getcwd()) as $entry) { + if ($entry->isFile() && strpos($entry, '_testcase.')>0) { + echo basename($entry); + require_once($entry); + echo '
        ...pass!

        '; + } +} +?> \ No newline at end of file diff --git a/vendor/sunra/php-simple-html-dom-parser/Src/Sunra/PhpSimple/simplehtmldom_1_5/testcase/callback_testcase.php b/vendor/sunra/php-simple-html-dom-parser/Src/Sunra/PhpSimple/simplehtmldom_1_5/testcase/callback_testcase.php new file mode 100644 index 000000000..f64496e4b --- /dev/null +++ b/vendor/sunra/php-simple-html-dom-parser/Src/Sunra/PhpSimple/simplehtmldom_1_5/testcase/callback_testcase.php @@ -0,0 +1,74 @@ +

        foo

        +HTML; + +function callback_1($e) { + if ($e->tag==='img') + $e->outertext = ''; +} + +$dom->load($str); +$dom->set_callback('callback_1'); +assert($dom=='

        foo

        '); + +// ----------------------------------------------- +// innertext test +function callback_2($e) { + if ($e->tag==='p') + $e->innertext = 'bar'; +} + +$dom->load($str); +$dom->set_callback('callback_2'); +assert($dom=='

        bar

        '); + +// ----------------------------------------------- +// attributes test +function callback_3($e) { + if ($e->tag==='img') + $e->src = 'foo'; +} + +$dom->load($str); +$dom->set_callback('callback_3'); +assert($dom=='

        foo

        '); + +function callback_4($e) { + if ($e->tag==='img') + $e->id = 'foo'; +} + +$dom->set_callback('callback_4'); +assert($dom=='

        foo

        '); + +// ----------------------------------------------- +// attributes test2 +//$dom = str_get_dom($str); +$dom->load($str); +$dom->remove_callback(); +$dom->find('img', 0)->id = "foo"; +assert($dom=='

        foo

        '); + +function callback_5($e) { + if ($e->src==='src0') + unset($e->id); +} + +$dom->set_callback('callback_5'); +assert($dom==$str); + +// ----------------------------------------------------------------------------- +// tear down +$dom->clear(); +unset($dom); +?> \ No newline at end of file diff --git a/vendor/sunra/php-simple-html-dom-parser/Src/Sunra/PhpSimple/simplehtmldom_1_5/testcase/dom_testcase.php b/vendor/sunra/php-simple-html-dom-parser/Src/Sunra/PhpSimple/simplehtmldom_1_5/testcase/dom_testcase.php new file mode 100644 index 000000000..6bac5dfbf --- /dev/null +++ b/vendor/sunra/php-simple-html-dom-parser/Src/Sunra/PhpSimple/simplehtmldom_1_5/testcase/dom_testcase.php @@ -0,0 +1,386 @@ +load(''); +$e = $html->root; +assert($e->first_child()==null); +assert($e->last_child()==null); +assert($e->next_sibling()==null); +assert($e->prev_sibling()==null); +// ----------------------------------------------- +$str = '
        '; +$html->load($str); + +$e = $html->root; +assert($e->first_child()->id=='div1'); +assert($e->last_child()->id=='div1'); +assert($e->next_sibling()==null); +assert($e->prev_sibling()==null); +assert($e->plaintext==''); +assert($e->innertext=='
        '); +assert($e->outertext==$str); +// ----------------------------------------------- +$str = << +
        +
        +
        + +HTML; +$html->load($str); +assert($html==$str); + +$e = $html->find('div#div1', 0); +assert(isset($e->id)==true); +assert(isset($e->_not_exist)==false); +assert($e->first_child()->id=='div10'); +assert($e->last_child()->id=='div12'); +assert($e->next_sibling()==null); +assert($e->prev_sibling()==null); +// ----------------------------------------------- +$str = << +
        + +
        +
        +
        +
        +
        +
        +HTML; +$html->load($str); +assert($html==$str); + +$e = $html->find('div#div1', 0); +assert($e->first_child()->id=='div10'); +assert($e->last_child()->id=='div12'); +assert($e->next_sibling()->id=='div2'); +assert($e->prev_sibling()->id=='div0'); + +$e = $html->find('div#div2', 0); +assert($e->first_child()==null); +assert($e->last_child()==null); + +$e = $html->find('div#div0 div#div00', 0); +assert($e->first_child()==null); +assert($e->last_child()==null); +assert($e->next_sibling()==null); +assert($e->prev_sibling()==null); +// ----------------------------------------------- +$str = << +
        + +
        +
        +
        +
        +
        +
        +
        +
        +
        +
        +
        +
        +
        +
        +HTML; +$html->load($str); +assert($html==$str); + +assert($html->find("#div1", 0)->id=='div1'); +assert($html->find("#div1", 0)->children(0)->id=='div10'); +assert($html->find("#div1", 0)->children(1)->children(1)->id=='div111'); +assert($html->find("#div1", 0)->children(1)->children(1)->children(2)->id=='div1112'); + +// ----------------------------------------------------------------------------- +// no value attr test +$str = << + aaa
        + bbb
        + ccc
        + +HTML; +$html->load($str); +assert($html==$str); + +$counter = 0; +foreach($html->find('input[type=checkbox]') as $checkbox) { + if (isset($checkbox->checked)) { + assert($checkbox->value=="checkbox$counter"); + $counter += 2; + } +} + +$counter = 0; +foreach($html->find('input[type=checkbox]') as $checkbox) { + if ($checkbox->checked) { + assert($checkbox->value=="checkbox$counter"); + $counter += 2; + } +} + +$es = $html->find('input[type=checkbox]'); +$es[1]->checked = true; +assert($es[1]->outertext==''); +$es[0]->checked = false; +assert($es[0]==''); +$es[0]->checked = true; +assert($es[0]->outertext==''); + +// ----------------------------------------------------------------------------- +// remove attr test +$str = << + +HTML; + +$html->load($str); +assert($html==$str); +$e = $html->find('[name=checkbox0]', 0); +$e->name = null; +assert($e==''); +$e->type = null; +assert($e==''); + +// ----------------------------------------------- +$html->load($str); +assert($html==$str); +$e = $html->find('[name=checkbox0]', 0); +$e->name = null; +assert($e==''); +$e->type = null; +assert($e==''); + +// ----------------------------------------------- +$html->load($str); +assert($html==$str); +$e = $html->find('[name=checkbox1]', 0); +$e->value = null; +assert($e==""); +$e->type = null; +assert($e==""); +$e->name = null; +assert($e==''); + +$html->load($str); +assert($html==$str); +$e = $html->find('[name=checkbox1]', 0); +$e->type = null; +assert($e==""); +$e->name = null; +assert($e==''); +$e->value = null; +assert($e==''); + +// ----------------------------------------------------------------------------- +// remove no value attr test +$str = << + +HTML; +$html->load($str); +assert($html==$str); +$e = $html->find('[name=checkbox1]', 0); +$e->type = NULL; +assert($e==""); +$e->name = null; +assert($e==""); +$e->checked = NULL; +assert($e==""); + +// ----------------------------------------------- +$html->load($str); +assert($html==$str); +$e = $html->find('[name=checkbox0]', 0); +$e->type = NULL; +assert($e==""); +$e->name = NULL; +assert($e==''); +$e->checked = NULL; +assert($e==''); + +$html->load($str); +assert($html==$str); +$e = $html->find('[name=checkbox0]', 0); +$e->checked = NULL; +assert($e==""); +$e->name = NULL; +assert($e==''); +$e->type = NULL; +assert($e==""); + +// ----------------------------------------------------------------------------- +// extract text +$str = <<okok +HTML; +$html->load($str); +assert($html==$str); +assert($html->plaintext=='okok'); + +$str = <<okok +HTML; +$html->load($str); +assert($html==$str); +assert($html->plaintext=='okok'); + +$str = <<okok +HTML; +$html->load($str); +assert($html==$str); +assert($html->plaintext=='okok'); + +$str = <<okok +HTML; +$html->load($str); +assert($html==$str); +assert($html->plaintext=='okok'); + + +// ----------------------------------------------------------------------------- +// old fashion camel naming conventions test +$str = << + + +HTML; +$html->load($str); +assert($html==$str); + +assert($html->getElementByTagName('input')->hasAttribute('checked')==true); +assert($html->getElementsByTagName('input', 1)->hasAttribute('checked')==false); +assert($html->getElementsByTagName('input', 1)->hasAttribute('not_exist')==false); + +assert($html->find('input', 0)->value==$html->getElementByTagName('input')->getAttribute('value')); +assert($html->find('input', 1)->value==$html->getElementsByTagName('input', 1)->getAttribute('value')); + +assert($html->find('#checkbox1', 0)->value==$html->getElementById('checkbox1')->getAttribute('value')); +assert($html->find('#checkbox2', 0)->value==$html->getElementsById('checkbox2', 0)->getAttribute('value')); + +$e = $html->find('[name=checkbox]', 0); +assert($e->getAttribute('value')=='checkbox'); +assert($e->getAttribute('checked')==true); +assert($e->getAttribute('not_exist')==''); + +$e->setAttribute('value', 'okok'); +assert($e==''); + +$e->setAttribute('checked', false); +assert($e==''); + +$e->setAttribute('checked', true); +assert($e==''); + +$e->removeAttribute('value'); +assert($e==''); + +$e->removeAttribute('checked'); +assert($e==''); + +// ----------------------------------------------- +$str = << +
        +
        +
        + +HTML; +$html->load($str); +assert($html==$str); + +$e = $html->find('div#div1', 0); +assert($e->firstChild()->getAttribute('id')=='div10'); +assert($e->lastChild()->getAttribute('id')=='div12'); +assert($e->nextSibling()==null); +assert($e->previousSibling()==null); + +// ----------------------------------------------- +$str = << +
        + +
        +
        +
        +
        +
        +
        +
        +
        +
        +
        +
        +
        +
        +
        +HTML; +$html->load($str); +assert($html==$str); + +assert($html->getElementById("div1")->hasAttribute('id')==true); +assert($html->getElementById("div1")->hasAttribute('not_exist')==false); + +assert($html->getElementById("div1")->getAttribute('id')=='div1'); +assert($html->getElementById("div1")->childNodes(0)->getAttribute('id')=='div10'); +assert($html->getElementById("div1")->childNodes(1)->childNodes(1)->getAttribute('id')=='div111'); +assert($html->getElementById("div1")->childNodes(1)->childNodes(1)->childNodes(2)->getAttribute('id')=='div1112'); + +assert($html->getElementsById("div1", 0)->childNodes(1)->id=='div11'); +assert($html->getElementsById("div1", 0)->childNodes(1)->childNodes(1)->getAttribute('id')=='div111'); +assert($html->getElementsById("div1", 0)->childNodes(1)->childNodes(1)->childNodes(1)->getAttribute('id')=='div1111'); + +// ----------------------------------------------- +$str = << + + + + +HTML; +$html->load($str); + +$ul = $html->find('ul', 0); +assert($ul->first_child()->tag==='ul'); + +// ----------------------------------------------- +$str = << +
      4. Item 1 +
          +
        • Sub Item 1
        • +
        • Sub Item 2
        • +
        +
      5. +
      6. Item 2
      7. + +HTML; + +$html->load($str); +assert($html==$str); + +$ul = $html->find('ul', 0); +assert($ul->first_child()->tag==='li'); +assert($ul->first_child()->next_sibling()->tag==='li'); +// ----------------------------------------------------------------------------- +// tear down +$html->clear(); +unset($html); +?> \ No newline at end of file diff --git a/vendor/sunra/php-simple-html-dom-parser/Src/Sunra/PhpSimple/simplehtmldom_1_5/testcase/element_testcase.php b/vendor/sunra/php-simple-html-dom-parser/Src/Sunra/PhpSimple/simplehtmldom_1_5/testcase/element_testcase.php new file mode 100644 index 000000000..6171decb8 --- /dev/null +++ b/vendor/sunra/php-simple-html-dom-parser/Src/Sunra/PhpSimple/simplehtmldom_1_5/testcase/element_testcase.php @@ -0,0 +1,247 @@ + + + +
        + foo + + +HTML; +$dom->load($str); +assert($dom==$str); +// ----------------------------------------------- +$str = << + + +
        + bar + + +HTML; +$dom->load($str); +$dom->find('span', 0)->innertext = 'bar'; +assert($dom==$str); +// ----------------------------------------------- +$str = << + ok + +
        + bar + + +HTML; +$dom->load($str); +$dom->find('head', 0)->innertext = 'ok'; +assert($dom==$str); +// ----------------------------------------------- +$str = <<foo +HTML; +$dom->load($str); + +$e = $dom->find('b text', 0); +assert($e->innertext=='foo'); +assert($e->outertext=='foo'); +$e->innertext = 'bar'; +assert($e->innertext=='bar'); +assert($e->outertext=='bar'); +$e = $dom->find('b', 0); +assert($e->innertext=='bar'); +assert($e->outertext=='bar'); + +// ----------------------------------------------------------------------------- +// outertext test +$str = << +Head1Head2Head3 +123 + +HTML; +$dom->load($str); +assert($dom->find('tr', 0)->outertext=='Head1Head2Head3'); +assert($dom->find('tr', 1)->outertext=='123'); +// ----------------------------------------------- +$str = <<Head1Head2Head3123 +HTML; +$dom->load($str); +assert($dom->find('tr', 0)->outertext=='Head1Head2Head3'); +assert($dom->find('tr', 1)->outertext=='123'); + +// ----------------------------------------------- +$str = <<
      8. li11
      9. li12
        • li21
        • li22
        +HTML; +$dom->load($str); +assert($dom->find('ul', 0)->outertext=='
        • li11
        • li12
        '); +assert($dom->find('ul', 1)->outertext=='
        • li21
        • li22
        '); + +// ----------------------------------------------- +$str = <<
      10. li11
      11. li12
        • li21
        • li22
        • +HTML; +$dom->load($str); +assert($dom->find('ul', 0)->outertext=='
          • li11
          • li12
            • li21
            • li22
            • '); +assert($dom->find('ul', 1)->outertext=='
              • li21
              • li22
              • '); + +// ----------------------------------------------- +$str = <<
              • li11
              • li12
                • li21
                • li22 +HTML; +$dom->load($str); +assert($dom->find('ul', 0)->outertext=='
                  • li11
                  • li12
                    • li21
                    • li22'); +assert($dom->find('ul', 1)->outertext=='
                      • li21
                      • li22'); + +// ----------------------------------------------- +$str = << +Head1Head2Head3 +123 + +HTML; +$dom->load($str); +assert($dom->find('tr', 0)->outertext=='Head1Head2Head3'); +assert($dom->find('tr', 1)->outertext=='123'); + +// ----------------------------------------------------------------------------- +// replacement test +$str = <<
                        ok
                        +HTML; +$dom->load($str); +$es = $dom->find('div'); +assert(count($es)==2); +assert($es[0]->innertext=='
                        ok
                        '); +assert($es[0]->outertext=='
                        ok
                        '); + +// test isset +$es[0]->class = 'class_test'; +assert(isset($es[0]->class)===true); +assert(isset($es[0]->okok)===false); + +// test replacement +$es[0]->class = 'class_test'; +assert($es[0]->outertext=='
                        ok
                        '); + +// test replacement +$es[0]->tag = 'span'; +assert($es[0]->outertext=='
                        ok
                        '); + +// test unset (no more support...) +//$dom = str_get_dom($str); +//$es = $dom->find('div'); +//unset($es[0]->class); +//assert($es[0]->outertext=='
                        ok
                        '); + +$dom->load($str); +$es = $dom->find('div'); +unset($es[0]->attr['class']); +assert($es[0]->outertext=='
                        ok
                        '); + +// ----------------------------------------------- +$str = <<blahblah2 +HTML; +$dom->load($str); +$e = $dom->find('select[name=something]', 0); +$e->innertext = ''; +assert($e->outertext ==''); + +// ----------------------------------------------------------------------------- +// nested replacement test +$str = <<
                        ok
                        +HTML; +$dom->load($str); +$es = $dom->find('div'); +assert(count($es)==2); +assert($es[0]->innertext=='
                        ok
                        '); +assert($es[0]->outertext=='
                        ok
                        '); +assert($es[1]->innertext=='ok'); +assert($es[1]->outertext=='
                        ok
                        '); + +// test replacement +$es[1]->innertext = 'okok'; +assert($es[1]->outertext=='
                        okok
                        '); +assert($es[0]->outertext=='
                        okok
                        '); +assert($dom=='
                        okok
                        '); + +$es[1]->class = 'class_test'; +assert($es[1]->outertext=='
                        okok
                        '); +assert($es[0]->outertext=='
                        okok
                        '); +assert($dom=='
                        okok
                        '); + +$es[0]->class = 'class_test'; +assert($es[0]->outertext=='
                        okok
                        '); +assert($dom=='
                        okok
                        '); + +$es[0]->innertext = 'okokok'; +assert($es[0]->outertext=='
                        okokok
                        '); +assert($dom=='
                        okokok
                        '); + +// ----------------------------------------------------------------------------- +//

                        test +$str = << +

                        ok0link0

                        + +
                        +

                        ok2link2

                        + +HTML; +$dom->load($str); +$es = $dom->find('p'); +assert($es[0]->innertext=='ok0link0'); +assert($es[1]->innertext=='ok1link1'); +assert($es[2]->innertext=='ok2link2'); +assert($dom->find('p', 0)->plaintext=='ok0link0'); +assert($dom->find('p', 1)->plaintext=='ok1link1'); +assert($dom->find('p', 2)->plaintext=='ok2link2'); + +$count = 0; +foreach($dom->find('p') as $p) { + $a = $p->find('a'); + assert($a[0]->innertext=='link'.$count); + ++$count; +} + +$es = $dom->find('p a'); +assert($es[0]->innertext=='link0'); +assert($es[1]->innertext=='link1'); +assert($es[2]->innertext=='link2'); +assert($dom->find('p a', 0)->plaintext=='link0'); +assert($dom->find('p a', 1)->plaintext=='link1'); +assert($dom->find('p a', 2)->plaintext=='link2'); + +assert($dom==$str); + +// ----------------------------------------------------------------------------- +// test +$str = << +HTML; +$dom->load($str); +$e = $dom->find('embed', 0); +assert($e->src=='../graphics/sounds/1812over.mid'); +assert($e->height=='60'); +assert($e->width=='144'); +assert($dom==strtolower($str)); + +// ----------------------------------------------------------------------------- +// tear down +$dom->clear(); +unset($dom); +?> \ No newline at end of file diff --git a/vendor/sunra/php-simple-html-dom-parser/Src/Sunra/PhpSimple/simplehtmldom_1_5/testcase/html/.svn/all-wcprops b/vendor/sunra/php-simple-html-dom-parser/Src/Sunra/PhpSimple/simplehtmldom_1_5/testcase/html/.svn/all-wcprops new file mode 100644 index 000000000..61b4d3bbe --- /dev/null +++ b/vendor/sunra/php-simple-html-dom-parser/Src/Sunra/PhpSimple/simplehtmldom_1_5/testcase/html/.svn/all-wcprops @@ -0,0 +1,5 @@ +K 25 +svn:wc:ra_dav:version-url +V 54 +/svnroot/simplehtmldom/!svn/ver/28/trunk/testcase/html +END diff --git a/vendor/sunra/php-simple-html-dom-parser/Src/Sunra/PhpSimple/simplehtmldom_1_5/testcase/html/.svn/entries b/vendor/sunra/php-simple-html-dom-parser/Src/Sunra/PhpSimple/simplehtmldom_1_5/testcase/html/.svn/entries new file mode 100644 index 000000000..f99c6853c --- /dev/null +++ b/vendor/sunra/php-simple-html-dom-parser/Src/Sunra/PhpSimple/simplehtmldom_1_5/testcase/html/.svn/entries @@ -0,0 +1,28 @@ +10 + +dir +182 +https://simplehtmldom.svn.sourceforge.net/svnroot/simplehtmldom/trunk/testcase/html +https://simplehtmldom.svn.sourceforge.net/svnroot/simplehtmldom + + + +2008-03-14T14:52:38.823464Z +28 +me578022 + + + + + + + + + + + + + + +d0e60b4b-9046-0410-940c-b97530268c78 + diff --git a/vendor/sunra/php-simple-html-dom-parser/Src/Sunra/PhpSimple/simplehtmldom_1_5/testcase/invalid_testcase.php b/vendor/sunra/php-simple-html-dom-parser/Src/Sunra/PhpSimple/simplehtmldom_1_5/testcase/invalid_testcase.php new file mode 100644 index 000000000..3e233d572 --- /dev/null +++ b/vendor/sunra/php-simple-html-dom-parser/Src/Sunra/PhpSimple/simplehtmldom_1_5/testcase/invalid_testcase.php @@ -0,0 +1,658 @@ + +HTML; +$dom->load($str); +$e = $dom->find('hr', 0); +$e->id= 'foo'; +assert($e->outertext=='
                        '); +// ----------------------------------------------- +$str = << +HTML; +$dom->load($str); +$e = $dom->find('hr', 0); +$e->id= 'foo'; +assert($e->outertext=='
                        '); +// ----------------------------------------------- +$str = << +HTML; +$dom->load($str); +$e = $dom->find('hr', 0); +$e->id= 'foo'; +assert($e->outertext=='
                        '); +// ----------------------------------------------- +$str = << +HTML; +$dom->load($str); +$e = $dom->find('hr', 0); +$e->id= 'foo'; +$e->class = 'bar'; +assert($e->outertext=='
                        '); +// ----------------------------------------------- +$str = << +HTML; +$dom->load($str); +$e = $dom->find('hr', 0); +$e->id= 'foo'; +$e->class = 'bar'; +assert($e->outertext=='
                        '); +// ----------------------------------------------- +$str = << +HTML; +$dom->load($str); +$e = $dom->find('hr', 0); +$e->id= 'foo'; +$e->class = 'bar'; +assert($e->outertext=='
                        '); +// ----------------------------------------------- +$str = << +HTML; +$dom->load($str); +$e = $dom->find('hr', 0); +$e->class = 'bar'; +assert($e->outertext=='
                        '); +// ----------------------------------------------- +$str = << +HTML; +$dom->load($str); +$e = $dom->find('hr', 0); +$e->class = 'bar'; +assert($e->outertext=='
                        '); +// ----------------------------------------------- +$str = << +HTML; +$dom->load($str); +$e = $dom->find('hr', 0); +$e->class = 'bar'; +assert($e->outertext=='
                        '); + +// ----------------------------------------------- +$str = << +HTML; +$dom->load($str); +$e = $dom->find('nobr', 0); +assert($e->outertext==''); + +// ----------------------------------------------------------------------------- +// optional closing tags test +$str = << +<.b> + +HTML; +$dom = str_get_html($str); +assert($dom->find('body', 0)->outertext==$str); + +// ----------------------------------------------- +$str = << + + foo + foo2 +HTML; +$dom = str_get_html($str); +assert($dom==$str); +assert($dom->find('html body a', 1)->innertext=='foo2'); + +// ----------------------------------------------- +$str = <<find('html a', 1)===null); +//assert($dom->find('html a', 1)->innertext=='foo2'); + +// ----------------------------------------------- +$str = << +
                        + +HTML; +$dom = str_get_html($str); +assert($dom==$str); +assert($dom->find('body', 0)->outertext==$str); + +// ----------------------------------------------- +$str = << +
                        + +HTML; +$dom = str_get_html($str); + +assert($dom->find('body', 0)->outertext==$str); + +// ----------------------------------------------- +$str = << + + aa + + bb + +HTML; +$dom = str_get_html($str); + +assert($dom==$str); + +// ----------------------------------------------- +$str = << +123 + +HTML; +$dom = str_get_html($str); +assert(count($dom->find('td'))==3); +assert($dom->find('td', 0)->innertext=='1'); +assert($dom->find('td', 0)->outertext=='1'); +assert($dom->find('td', 1)->innertext=='2'); +assert($dom->find('td', 1)->outertext=='2'); +assert($dom->find('td', 2)->innertext=="3\r\n"); +assert($dom->find('td', 2)->outertext=="3\r\n"); + +// ----------------------------------------------- +$str = << + + 1 + 2 + 3 + +HTML; +$dom = str_get_html($str); +assert(count($dom->find('tr td'))==3); + +// ----------------------------------------------- +$str = << +111213 +213243 + +HTML; +$dom = str_get_html($str); +assert(count($dom->find('tr'))==2); +assert(count($dom->find('tr td'))==6); +assert($dom->find('tr', 1)->outertext=="213243\r\n"); +assert($dom->find('tr', 1)->innertext=="213243\r\n"); +assert($dom->find('tr', 1)->plaintext=="213243\r\n"); + +// ----------------------------------------------- +$str = <<1 +

                        2

                        +

                        3 +HTML; +$dom = str_get_html($str); +assert(count($dom->find('p'))==3); +assert($dom->find('p', 0)->innertext=="1\r\n"); +assert($dom->find('p', 0)->outertext=="

                        1\r\n"); +assert($dom->find('p', 1)->innertext=="2"); +assert($dom->find('p', 1)->outertext=="

                        2

                        "); +assert($dom->find('p', 2)->innertext=="3"); +assert($dom->find('p', 2)->outertext=="

                        3"); + +// ----------------------------------------------- +$str = <<1 +2 +3 +HTML; +$dom = str_get_html($str); +assert(count($dom->find('nobr'))==3); +assert($dom->find('nobr', 0)->innertext=="1\r\n"); +assert($dom->find('nobr', 0)->outertext=="1\r\n"); +assert($dom->find('nobr', 1)->innertext=="2"); +assert($dom->find('nobr', 1)->outertext=="2"); +assert($dom->find('nobr', 2)->innertext=="3"); +assert($dom->find('nobr', 2)->outertext=="3"); + +// ----------------------------------------------- +$str = <<

                        1
                        2
                        3
                        4 +HTML; +$dom = str_get_html($str); +assert(count($dom->find('dt'))==2); +assert(count($dom->find('dd'))==2); +assert($dom->find('dt', 0)->innertext=="1"); +assert($dom->find('dt', 0)->outertext=="
                        1"); +assert($dom->find('dt', 1)->innertext=="3"); +assert($dom->find('dt', 1)->outertext=="
                        3"); +assert($dom->find('dd', 0)->innertext=="2"); +assert($dom->find('dd', 0)->outertext=="
                        2"); +assert($dom->find('dd', 1)->innertext=="4"); +assert($dom->find('dd', 1)->outertext=="
                        4"); + +// ----------------------------------------------- +$str = <<
                        11
                        12
                        13
                        14 +
                        21
                        22
                        23
                        24
                        +HTML; +$dom = str_get_html($str); +assert(count($dom->find('#dl1 dt'))==2); +assert(count($dom->find('#dl2 dd'))==2); +assert($dom->find('dl', 0)->innertext=="
                        11
                        12
                        13
                        14"); +assert($dom->find('dl', 1)->innertext=="
                        21
                        22
                        23
                        24"); + +// ----------------------------------------------- +$str = <<
                      • 1
                      • 2
                      +
                      • 3
                      • 4
                      +HTML; +$dom = str_get_html($str); +assert(count($dom->find('ul[id=ul1] li'))==2); + +// ----------------------------------------------------------------------------- +// invalid test +$str = << +
                      + + + +
                      + +HTML; +$dom->load($str); +assert(count($dom->find('img'))==2); +assert(count($dom->find('img'))==2); +assert($dom==$str); + +// ----------------------------------------------- +$str = << +
                      + + + +
                      + +HTML; + +$dom->load($str); +assert(count($dom->find('span'))==2); +assert(count($dom->find('div'))==2); +assert($dom==$str); + +// ----------------------------------------------- +$str = << +
                      + + + +
                      + +HTML; +$dom->load($str); +assert(count($dom->find('span'))==3); +assert(count($dom->find('div'))==2); +assert($dom==$str); + +// ----------------------------------------------- +$str = << +
                    • + + +
                    +HTML; +$dom->load($str); +assert(count($dom->find('ul'))==2); +assert(count($dom->find('ul ul'))==1); +assert(count($dom->find('li'))==1); +assert(count($dom->find('a'))==1); +assert($dom==$str); + +// ----------------------------------------------- +$str = << +
                    + +
                    + +HTML; +$dom->load($str); +assert(count($dom->find('td'))==1); +assert(count($dom->find('div'))==1); +assert(count($dom->find('td div'))==1); +assert($dom==$str); + +// ----------------------------------------------- +$str = << +
                    + +
                    + +HTML; +$dom->load($str); +assert(count($dom->find('td'))==1); +assert(count($dom->find('div'))==1); +assert(count($dom->find('td div'))==1); +assert($dom==$str); + +// ----------------------------------------------- +$str = << +
                    + + +HTML; +$dom->load($str); +assert(count($dom->find('td'))==1); +assert(count($dom->find('div'))==1); +assert(count($dom->find('td div'))==1); +assert($dom==$str); + +// ----------------------------------------------- +$str = << + + + + foo + bar + important + +
                    + + +HTML; +$dom->load($str); +assert(count($dom->find('table span'))===1); +assert($dom->find('table span', 0)->innertext==='bar'); +assert($dom==$str); + +// ----------------------------------------------- +$str = << +
                    + + foo +
                    + +HTML; +$dom->load($str); +assert(count($dom->find('td div font b'))==1); +assert($dom==$str); + +// ----------------------------------------------- +$str = << +... then slow into 287 + + + (hanover0...more volume between 202 & 53 + + + (parsippany) + + + ...then sluggish in spots out to dover chester road + + + (randolph) + + ..then traffic light delays out to route 46 + + + (roxbury) + + /eb slow into 202 + + + (morris plains) + + & again into 287 + + + (hanover) + + +. +52 +HTML; +$dom->load($str); +assert(count($dom->find('span td'))==0); +assert($dom==$str); + +// ----------------------------------------------------------------------------- +// invalid '<' +// ----------------------------------------------- +$str = <<test :1 gram but <5 grams +HTML; +$dom->load($str); +assert($dom->find('td', 0)->innertext==='test :1 gram but <5 grams'); +assert($dom->find('td', 0)->plaintext==='test :1 gram but <5 grams'); +assert($dom==$str); + +$str = <<test :1 gram but<5 grams +HTML; +$dom->load($str); +assert($dom->find('td', 0)->innertext==='test :1 gram but<5 grams'); +assert($dom->find('td', 0)->plaintext==='test :1 gram but<5 grams'); +assert($dom==$str); + +$str = <<test :1 gram but< 5 grams +HTML; +$dom->load($str); +assert($dom->find('td', 0)->innertext==='test :1 gram but< 5 grams'); +assert($dom->find('td', 0)->plaintext==='test :1 gram but< 5 grams'); +assert($dom==$str); + +$str = <<test :1 gram but < 5 grams +HTML; +$dom->load($str); +assert($dom->find('td', 0)->innertext==='test :1 gram but < 5 grams'); +assert($dom->find('td', 0)->plaintext==='test :1 gram but < 5 grams'); +assert($dom==$str); + +$str = <<test :1 gram but 5< grams +HTML; +$dom->load($str); +assert($dom->find('td', 0)->innertext==='test :1 gram but 5< grams'); +assert($dom->find('td', 0)->plaintext==='test :1 gram but 5< grams'); +assert($dom==$str); + +$str = <<test :1 gram but 5 < grams +HTML; +$dom->load($str); +assert($dom->find('td', 0)->innertext==='test :1 gram but 5 < grams'); +assert($dom->find('td', 0)->plaintext==='test :1 gram but 5 < grams'); +assert($dom==$str); + +$str = <<test :1 gram but 5 +HTML; +$dom->load($str); +assert($dom->find('td', 0)->innertext==='test :1 gram but 5 find('td', 0)->plaintext==='test :1 gram but 5 test :1 gram but 5< grams +HTML; +$dom->load($str); +assert($dom->find('td', 0)->innertext==='test :1 gram but 5< grams'); +assert($dom->find('td', 0)->plaintext==='test :1 gram but 5< grams'); +assert($dom==$str); + +$str = <<test :1 gram but5< grams +HTML; +$dom->load($str); +assert($dom->find('td', 0)->innertext==='test :1 gram but5< grams'); +assert($dom->find('td', 0)->plaintext==='test :1 gram but5< grams'); +assert($dom==$str); + +$str = <<test :1 gram but 5 +HTML; +$dom->load($str); +assert($dom->find('td', 0)->innertext==='test :1 gram but 5 find('td', 0)->plaintext==='test :1 gram but 5 test :1 gram but 5 +HTML; +$dom->load($str); +assert($dom->find('td', 0)->innertext==='test :1 gram but 5find('td', 0)->plaintext==='test :1 gram but 5test :1 gram but 5 +HTML; +$dom->load($str); +assert($dom->find('td', 0)->innertext==='test :1 gram but 5 find('td', 0)->plaintext==='test :1 gram but 5 ' +// ----------------------------------------------- +$str = <<test :1 gram but >5 grams +HTML; +$dom->load($str); +assert($dom->find('td', 0)->innertext==='test :1 gram but >5 grams'); +assert($dom->find('td', 0)->plaintext==='test :1 gram but >5 grams'); +assert($dom==$str); + +$str = <<test :1 gram but>5 grams +HTML; +$dom->load($str); +assert($dom->find('td', 0)->innertext==='test :1 gram but>5 grams'); +assert($dom->find('td', 0)->plaintext==='test :1 gram but>5 grams'); +assert($dom==$str); + +$str = <<test :1 gram but> 5 grams +HTML; +$dom->load($str); +assert($dom->find('td', 0)->innertext==='test :1 gram but> 5 grams'); +assert($dom->find('td', 0)->plaintext==='test :1 gram but> 5 grams'); +assert($dom==$str); + +$str = <<test :1 gram but > 5 grams +HTML; +$dom->load($str); +assert($dom->find('td', 0)->innertext==='test :1 gram but > 5 grams'); +assert($dom->find('td', 0)->plaintext==='test :1 gram but > 5 grams'); +assert($dom==$str); + +$str = <<test :1 gram but 5> grams +HTML; +$dom->load($str); +assert($dom->find('td', 0)->innertext==='test :1 gram but 5> grams'); +assert($dom->find('td', 0)->plaintext==='test :1 gram but 5> grams'); +assert($dom==$str); + +$str = <<test :1 gram but 5 > grams +HTML; +$dom->load($str); +assert($dom->find('td', 0)->innertext==='test :1 gram but 5 > grams'); +assert($dom->find('td', 0)->plaintext==='test :1 gram but 5 > grams'); +assert($dom==$str); + +$str = <<test :1 gram but 5 >grams +HTML; +$dom->load($str); +assert($dom->find('td', 0)->innertext==='test :1 gram but 5 >grams'); +assert($dom->find('td', 0)->plaintext==='test :1 gram but 5 >grams'); +assert($dom==$str); +// ----------------------------------------------- +$str = <<test :1 gram but 5> grams +HTML; +$dom->load($str); +assert($dom->find('td', 0)->innertext==='test :1 gram but 5> grams'); +assert($dom->find('td', 0)->plaintext==='test :1 gram but 5> grams'); +assert($dom==$str); + +$str = <<test :1 gram but5> grams +HTML; +$dom->load($str); +assert($dom->find('td', 0)->innertext==='test :1 gram but5> grams'); +assert($dom->find('td', 0)->plaintext==='test :1 gram but5> grams'); +assert($dom==$str); + +$str = <<test :1 gram but 5 >grams +HTML; +$dom->load($str); +assert($dom->find('td', 0)->innertext==='test :1 gram but 5 >grams'); +assert($dom->find('td', 0)->plaintext==='test :1 gram but 5 >grams'); +assert($dom==$str); + +$str = <<test :1 gram but 5>grams +HTML; +$dom->load($str); +assert($dom->find('td', 0)->innertext==='test :1 gram but 5>grams'); +assert($dom->find('td', 0)->plaintext==='test :1 gram but 5>grams'); +assert($dom==$str); + +$str = <<test :1 gram but 5 >grams +HTML; +$dom->load($str); +assert($dom->find('td', 0)->innertext==='test :1 gram but 5 >grams'); +assert($dom->find('td', 0)->plaintext==='test :1 gram but 5 >grams'); +assert($dom==$str); + +// ----------------------------------------------------------------------------- +// BAD HTML test +$str = <<http://www.oeb.harvard.edu/faculty/girguis/">.

                    +HTML; +$dom->load($str); +// ----------------------------------------------- +$str = <<http://www.oeb.harvard.edu/faculty/girguis/"> +HTML; +$dom->load($str); +// ----------------------------------------------- +$str = <<""'''"'" ' +HTML; +$dom->load($str); +// ----------------------------------------------------------------------------- +// tear down +$dom->clear(); +unset($dom); +?> \ No newline at end of file diff --git a/vendor/sunra/php-simple-html-dom-parser/Src/Sunra/PhpSimple/simplehtmldom_1_5/testcase/jquery-1.2.3.pack.js b/vendor/sunra/php-simple-html-dom-parser/Src/Sunra/PhpSimple/simplehtmldom_1_5/testcase/jquery-1.2.3.pack.js new file mode 100644 index 000000000..1ea906d5e --- /dev/null +++ b/vendor/sunra/php-simple-html-dom-parser/Src/Sunra/PhpSimple/simplehtmldom_1_5/testcase/jquery-1.2.3.pack.js @@ -0,0 +1,11 @@ +/* + * jQuery 1.2.3 - New Wave Javascript + * + * Copyright (c) 2008 John Resig (jquery.com) + * Dual licensed under the MIT (MIT-LICENSE.txt) + * and GPL (GPL-LICENSE.txt) licenses. + * + * $Date: 2008-02-06 00:21:25 -0500 (Wed, 06 Feb 2008) $ + * $Rev: 106 $ + */ +eval(function(p,a,c,k,e,r){e=function(c){return(c35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)r[e(c)]=k[c]||e(c);k=[function(e){return r[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('(J(){7(1e.3N)L w=1e.3N;L E=1e.3N=J(a,b){K 1B E.2l.4T(a,b)};7(1e.$)L D=1e.$;1e.$=E;L u=/^[^<]*(<(.|\\s)+>)[^>]*$|^#(\\w+)$/;L G=/^.[^:#\\[\\.]*$/;E.1n=E.2l={4T:J(d,b){d=d||T;7(d.15){6[0]=d;6.M=1;K 6}N 7(1o d=="25"){L c=u.2O(d);7(c&&(c[1]||!b)){7(c[1])d=E.4a([c[1]],b);N{L a=T.5J(c[3]);7(a)7(a.2w!=c[3])K E().2s(d);N{6[0]=a;6.M=1;K 6}N d=[]}}N K 1B E(b).2s(d)}N 7(E.1q(d))K 1B E(T)[E.1n.21?"21":"3U"](d);K 6.6E(d.1k==1M&&d||(d.5h||d.M&&d!=1e&&!d.15&&d[0]!=10&&d[0].15)&&E.2I(d)||[d])},5h:"1.2.3",87:J(){K 6.M},M:0,22:J(a){K a==10?E.2I(6):6[a]},2F:J(b){L a=E(b);a.54=6;K a},6E:J(a){6.M=0;1M.2l.1g.1i(6,a);K 6},R:J(a,b){K E.R(6,a,b)},4X:J(b){L a=-1;6.R(J(i){7(6==b)a=i});K a},1J:J(c,a,b){L d=c;7(c.1k==4e)7(a==10)K 6.M&&E[b||"1J"](6[0],c)||10;N{d={};d[c]=a}K 6.R(J(i){Q(c 1p d)E.1J(b?6.W:6,c,E.1l(6,d[c],b,i,c))})},1j:J(b,a){7((b==\'27\'||b==\'1R\')&&2M(a)<0)a=10;K 6.1J(b,a,"2o")},1u:J(b){7(1o b!="3V"&&b!=V)K 6.4x().3t((6[0]&&6[0].2i||T).5r(b));L a="";E.R(b||6,J(){E.R(6.3p,J(){7(6.15!=8)a+=6.15!=1?6.6K:E.1n.1u([6])})});K a},5m:J(b){7(6[0])E(b,6[0].2i).5k().3o(6[0]).2c(J(){L a=6;2b(a.1C)a=a.1C;K a}).3t(6);K 6},8w:J(a){K 6.R(J(){E(6).6z().5m(a)})},8p:J(a){K 6.R(J(){E(6).5m(a)})},3t:J(){K 6.3O(18,P,S,J(a){7(6.15==1)6.38(a)})},6q:J(){K 6.3O(18,P,P,J(a){7(6.15==1)6.3o(a,6.1C)})},6o:J(){K 6.3O(18,S,S,J(a){6.1a.3o(a,6)})},5a:J(){K 6.3O(18,S,P,J(a){6.1a.3o(a,6.2B)})},3h:J(){K 6.54||E([])},2s:J(b){L c=E.2c(6,J(a){K E.2s(b,a)});K 6.2F(/[^+>] [^+>]/.17(b)||b.1f("..")>-1?E.57(c):c)},5k:J(e){L f=6.2c(J(){7(E.14.1d&&!E.3E(6)){L a=6.69(P),4Y=T.3s("1x");4Y.38(a);K E.4a([4Y.3d])[0]}N K 6.69(P)});L d=f.2s("*").4R().R(J(){7(6[F]!=10)6[F]=V});7(e===P)6.2s("*").4R().R(J(i){7(6.15==3)K;L c=E.O(6,"2R");Q(L a 1p c)Q(L b 1p c[a])E.16.1b(d[i],a,c[a][b],c[a][b].O)});K f},1E:J(b){K 6.2F(E.1q(b)&&E.3y(6,J(a,i){K b.1P(a,i)})||E.3e(b,6))},56:J(b){7(b.1k==4e)7(G.17(b))K 6.2F(E.3e(b,6,P));N b=E.3e(b,6);L a=b.M&&b[b.M-1]!==10&&!b.15;K 6.1E(J(){K a?E.33(6,b)<0:6!=b})},1b:J(a){K!a?6:6.2F(E.37(6.22(),a.1k==4e?E(a).22():a.M!=10&&(!a.12||E.12(a,"3u"))?a:[a]))},3H:J(a){K a?E.3e(a,6).M>0:S},7j:J(a){K 6.3H("."+a)},5O:J(b){7(b==10){7(6.M){L c=6[0];7(E.12(c,"2k")){L e=c.3T,5I=[],11=c.11,2X=c.U=="2k-2X";7(e<0)K V;Q(L i=2X?e:0,2f=2X?e+1:11.M;i<2f;i++){L d=11[i];7(d.2p){b=E.14.1d&&!d.9J.1A.9y?d.1u:d.1A;7(2X)K b;5I.1g(b)}}K 5I}N K(6[0].1A||"").1r(/\\r/g,"")}K 10}K 6.R(J(){7(6.15!=1)K;7(b.1k==1M&&/5u|5t/.17(6.U))6.3k=(E.33(6.1A,b)>=0||E.33(6.31,b)>=0);N 7(E.12(6,"2k")){L a=b.1k==1M?b:[b];E("98",6).R(J(){6.2p=(E.33(6.1A,a)>=0||E.33(6.1u,a)>=0)});7(!a.M)6.3T=-1}N 6.1A=b})},3q:J(a){K a==10?(6.M?6[0].3d:V):6.4x().3t(a)},6S:J(a){K 6.5a(a).1V()},6Z:J(i){K 6.2K(i,i+1)},2K:J(){K 6.2F(1M.2l.2K.1i(6,18))},2c:J(b){K 6.2F(E.2c(6,J(a,i){K b.1P(a,i,a)}))},4R:J(){K 6.1b(6.54)},O:J(d,b){L a=d.23(".");a[1]=a[1]?"."+a[1]:"";7(b==V){L c=6.5n("8P"+a[1]+"!",[a[0]]);7(c==10&&6.M)c=E.O(6[0],d);K c==V&&a[1]?6.O(a[0]):c}N K 6.1N("8K"+a[1]+"!",[a[0],b]).R(J(){E.O(6,d,b)})},35:J(a){K 6.R(J(){E.35(6,a)})},3O:J(g,f,h,d){L e=6.M>1,3n;K 6.R(J(){7(!3n){3n=E.4a(g,6.2i);7(h)3n.8D()}L b=6;7(f&&E.12(6,"1O")&&E.12(3n[0],"4v"))b=6.3S("1U")[0]||6.38(6.2i.3s("1U"));L c=E([]);E.R(3n,J(){L a=e?E(6).5k(P)[0]:6;7(E.12(a,"1m")){c=c.1b(a)}N{7(a.15==1)c=c.1b(E("1m",a).1V());d.1P(b,a)}});c.R(6A)})}};E.2l.4T.2l=E.2l;J 6A(i,a){7(a.3Q)E.3P({1c:a.3Q,3l:S,1H:"1m"});N E.5g(a.1u||a.6x||a.3d||"");7(a.1a)a.1a.34(a)}E.1s=E.1n.1s=J(){L b=18[0]||{},i=1,M=18.M,5c=S,11;7(b.1k==8d){5c=b;b=18[1]||{};i=2}7(1o b!="3V"&&1o b!="J")b={};7(M==1){b=6;i=0}Q(;i-1}},68:J(b,c,a){L e={};Q(L d 1p c){e[d]=b.W[d];b.W[d]=c[d]}a.1P(b);Q(L d 1p c)b.W[d]=e[d]},1j:J(d,e,c){7(e=="27"||e=="1R"){L b,46={43:"4W",4U:"1Z",19:"3D"},3c=e=="27"?["7O","7M"]:["7J","7I"];J 5E(){b=e=="27"?d.7H:d.7F;L a=0,2N=0;E.R(3c,J(){a+=2M(E.2o(d,"7E"+6,P))||0;2N+=2M(E.2o(d,"2N"+6+"5X",P))||0});b-=24.7C(a+2N)}7(E(d).3H(":4d"))5E();N E.68(d,46,5E);K 24.2f(0,b)}K E.2o(d,e,c)},2o:J(e,k,j){L d;J 3x(b){7(!E.14.2d)K S;L a=T.4c.4K(b,V);K!a||a.4M("3x")==""}7(k=="1w"&&E.14.1d){d=E.1J(e.W,"1w");K d==""?"1":d}7(E.14.2z&&k=="19"){L c=e.W.50;e.W.50="0 7r 7o";e.W.50=c}7(k.1D(/4g/i))k=y;7(!j&&e.W&&e.W[k])d=e.W[k];N 7(T.4c&&T.4c.4K){7(k.1D(/4g/i))k="4g";k=k.1r(/([A-Z])/g,"-$1").2h();L h=T.4c.4K(e,V);7(h&&!3x(e))d=h.4M(k);N{L f=[],2C=[];Q(L a=e;a&&3x(a);a=a.1a)2C.4J(a);Q(L i=0;i<2C.M;i++)7(3x(2C[i])){f[i]=2C[i].W.19;2C[i].W.19="3D"}d=k=="19"&&f[2C.M-1]!=V?"2H":(h&&h.4M(k))||"";Q(L i=0;i]*?)\\/>/g,J(b,a,c){K c.1D(/^(aa|a6|7e|a5|4D|7a|a0|3m|9W|9U|9S)$/i)?b:a+">"});L f=E.3g(d).2h(),1x=h.3s("1x");L e=!f.1f("<9P")&&[1,"<2k 74=\'74\'>",""]||!f.1f("<9M")&&[1,"<73>",""]||f.1D(/^<(9G|1U|9E|9B|9x)/)&&[1,"<1O>",""]||!f.1f("<4v")&&[2,"<1O><1U>",""]||(!f.1f("<9w")||!f.1f("<9v"))&&[3,"<1O><1U><4v>",""]||!f.1f("<7e")&&[2,"<1O><1U><6V>",""]||E.14.1d&&[1,"1x<1x>",""]||[0,"",""];1x.3d=e[1]+d+e[2];2b(e[0]--)1x=1x.5o;7(E.14.1d){L g=!f.1f("<1O")&&f.1f("<1U")<0?1x.1C&&1x.1C.3p:e[1]=="<1O>"&&f.1f("<1U")<0?1x.3p:[];Q(L j=g.M-1;j>=0;--j)7(E.12(g[j],"1U")&&!g[j].3p.M)g[j].1a.34(g[j]);7(/^\\s/.17(d))1x.3o(h.5r(d.1D(/^\\s*/)[0]),1x.1C)}d=E.2I(1x.3p)}7(d.M===0&&(!E.12(d,"3u")&&!E.12(d,"2k")))K;7(d[0]==10||E.12(d,"3u")||d.11)k.1g(d);N k=E.37(k,d)});K k},1J:J(d,e,c){7(!d||d.15==3||d.15==8)K 10;L f=E.3E(d)?{}:E.46;7(e=="2p"&&E.14.2d)d.1a.3T;7(f[e]){7(c!=10)d[f[e]]=c;K d[f[e]]}N 7(E.14.1d&&e=="W")K E.1J(d.W,"9u",c);N 7(c==10&&E.14.1d&&E.12(d,"3u")&&(e=="9r"||e=="9o"))K d.9m(e).6K;N 7(d.28){7(c!=10){7(e=="U"&&E.12(d,"4D")&&d.1a)6Q"U 9i 9h\'t 9g 9e";d.9b(e,""+c)}7(E.14.1d&&/6O|3Q/.17(e)&&!E.3E(d))K d.4z(e,2);K d.4z(e)}N{7(e=="1w"&&E.14.1d){7(c!=10){d.6k=1;d.1E=(d.1E||"").1r(/6M\\([^)]*\\)/,"")+(2M(c).3X()=="96"?"":"6M(1w="+c*6L+")")}K d.1E&&d.1E.1f("1w=")>=0?(2M(d.1E.1D(/1w=([^)]*)/)[1])/6L).3X():""}e=e.1r(/-([a-z])/95,J(a,b){K b.2E()});7(c!=10)d[e]=c;K d[e]}},3g:J(a){K(a||"").1r(/^\\s+|\\s+$/g,"")},2I:J(b){L a=[];7(1o b!="93")Q(L i=0,M=b.M;i*",6).1V();2b(6.1C)6.34(6.1C)}},J(a,b){E.1n[a]=J(){K 6.R(b,18)}});E.R(["8f","5X"],J(i,c){L b=c.2h();E.1n[b]=J(a){K 6[0]==1e?E.14.2z&&T.1h["5e"+c]||E.14.2d&&1e["8e"+c]||T.6F=="79"&&T.1F["5e"+c]||T.1h["5e"+c]:6[0]==T?24.2f(24.2f(T.1h["5d"+c],T.1F["5d"+c]),24.2f(T.1h["5L"+c],T.1F["5L"+c])):a==10?(6.M?E.1j(6[0],b):V):6.1j(b,a.1k==4e?a:a+"2S")}});L C=E.14.2d&&4s(E.14.5K)<8c?"(?:[\\\\w*4r-]|\\\\\\\\.)":"(?:[\\\\w\\8b-\\8a*4r-]|\\\\\\\\.)",6v=1B 4q("^>\\\\s*("+C+"+)"),6u=1B 4q("^("+C+"+)(#)("+C+"+)"),6s=1B 4q("^([#.]?)("+C+"*)");E.1s({6r:{"":J(a,i,m){K m[2]=="*"||E.12(a,m[2])},"#":J(a,i,m){K a.4z("2w")==m[2]},":":{89:J(a,i,m){K im[3]-0},2Z:J(a,i,m){K m[3]-0==i},6Z:J(a,i,m){K m[3]-0==i},3j:J(a,i){K i==0},3J:J(a,i,m,r){K i==r.M-1},6n:J(a,i){K i%2==0},6l:J(a,i){K i%2},"3j-4p":J(a){K a.1a.3S("*")[0]==a},"3J-4p":J(a){K E.2Z(a.1a.5o,1,"4t")==a},"83-4p":J(a){K!E.2Z(a.1a.5o,2,"4t")},6B:J(a){K a.1C},4x:J(a){K!a.1C},82:J(a,i,m){K(a.6x||a.81||E(a).1u()||"").1f(m[3])>=0},4d:J(a){K"1Z"!=a.U&&E.1j(a,"19")!="2H"&&E.1j(a,"4U")!="1Z"},1Z:J(a){K"1Z"==a.U||E.1j(a,"19")=="2H"||E.1j(a,"4U")=="1Z"},80:J(a){K!a.2Y},2Y:J(a){K a.2Y},3k:J(a){K a.3k},2p:J(a){K a.2p||E.1J(a,"2p")},1u:J(a){K"1u"==a.U},5u:J(a){K"5u"==a.U},5t:J(a){K"5t"==a.U},59:J(a){K"59"==a.U},3I:J(a){K"3I"==a.U},58:J(a){K"58"==a.U},6j:J(a){K"6j"==a.U},6i:J(a){K"6i"==a.U},2G:J(a){K"2G"==a.U||E.12(a,"2G")},4D:J(a){K/4D|2k|6h|2G/i.17(a.12)},3Y:J(a,i,m){K E.2s(m[3],a).M},7X:J(a){K/h\\d/i.17(a.12)},7W:J(a){K E.3y(E.3G,J(b){K a==b.Y}).M}}},6g:[/^(\\[) *@?([\\w-]+) *([!*$^~=]*) *(\'?"?)(.*?)\\4 *\\]/,/^(:)([\\w-]+)\\("?\'?(.*?(\\(.*?\\))?[^(]*?)"?\'?\\)/,1B 4q("^([:.#]*)("+C+"+)")],3e:J(a,c,b){L d,2m=[];2b(a&&a!=d){d=a;L f=E.1E(a,c,b);a=f.t.1r(/^\\s*,\\s*/,"");2m=b?c=f.r:E.37(2m,f.r)}K 2m},2s:J(t,p){7(1o t!="25")K[t];7(p&&p.15!=1&&p.15!=9)K[];p=p||T;L d=[p],2r=[],3J,12;2b(t&&3J!=t){L r=[];3J=t;t=E.3g(t);L o=S;L g=6v;L m=g.2O(t);7(m){12=m[1].2E();Q(L i=0;d[i];i++)Q(L c=d[i].1C;c;c=c.2B)7(c.15==1&&(12=="*"||c.12.2E()==12))r.1g(c);d=r;t=t.1r(g,"");7(t.1f(" ")==0)6w;o=P}N{g=/^([>+~])\\s*(\\w*)/i;7((m=g.2O(t))!=V){r=[];L l={};12=m[2].2E();m=m[1];Q(L j=0,3f=d.M;j<3f;j++){L n=m=="~"||m=="+"?d[j].2B:d[j].1C;Q(;n;n=n.2B)7(n.15==1){L h=E.O(n);7(m=="~"&&l[h])1Q;7(!12||n.12.2E()==12){7(m=="~")l[h]=P;r.1g(n)}7(m=="+")1Q}}d=r;t=E.3g(t.1r(g,""));o=P}}7(t&&!o){7(!t.1f(",")){7(p==d[0])d.4l();2r=E.37(2r,d);r=d=[p];t=" "+t.6e(1,t.M)}N{L k=6u;L m=k.2O(t);7(m){m=[0,m[2],m[3],m[1]]}N{k=6s;m=k.2O(t)}m[2]=m[2].1r(/\\\\/g,"");L f=d[d.M-1];7(m[1]=="#"&&f&&f.5J&&!E.3E(f)){L q=f.5J(m[2]);7((E.14.1d||E.14.2z)&&q&&1o q.2w=="25"&&q.2w!=m[2])q=E(\'[@2w="\'+m[2]+\'"]\',f)[0];d=r=q&&(!m[3]||E.12(q,m[3]))?[q]:[]}N{Q(L i=0;d[i];i++){L a=m[1]=="#"&&m[3]?m[3]:m[1]!=""||m[0]==""?"*":m[2];7(a=="*"&&d[i].12.2h()=="3V")a="3m";r=E.37(r,d[i].3S(a))}7(m[1]==".")r=E.55(r,m[2]);7(m[1]=="#"){L e=[];Q(L i=0;r[i];i++)7(r[i].4z("2w")==m[2]){e=[r[i]];1Q}r=e}d=r}t=t.1r(k,"")}}7(t){L b=E.1E(t,r);d=r=b.r;t=E.3g(b.t)}}7(t)d=[];7(d&&p==d[0])d.4l();2r=E.37(2r,d);K 2r},55:J(r,m,a){m=" "+m+" ";L c=[];Q(L i=0;r[i];i++){L b=(" "+r[i].1t+" ").1f(m)>=0;7(!a&&b||a&&!b)c.1g(r[i])}K c},1E:J(t,r,h){L d;2b(t&&t!=d){d=t;L p=E.6g,m;Q(L i=0;p[i];i++){m=p[i].2O(t);7(m){t=t.7V(m[0].M);m[2]=m[2].1r(/\\\\/g,"");1Q}}7(!m)1Q;7(m[1]==":"&&m[2]=="56")r=G.17(m[3])?E.1E(m[3],r,P).r:E(r).56(m[3]);N 7(m[1]==".")r=E.55(r,m[2],h);N 7(m[1]=="["){L g=[],U=m[3];Q(L i=0,3f=r.M;i<3f;i++){L a=r[i],z=a[E.46[m[2]]||m[2]];7(z==V||/6O|3Q|2p/.17(m[2]))z=E.1J(a,m[2])||\'\';7((U==""&&!!z||U=="="&&z==m[5]||U=="!="&&z!=m[5]||U=="^="&&z&&!z.1f(m[5])||U=="$="&&z.6e(z.M-m[5].M)==m[5]||(U=="*="||U=="~=")&&z.1f(m[5])>=0)^h)g.1g(a)}r=g}N 7(m[1]==":"&&m[2]=="2Z-4p"){L e={},g=[],17=/(-?)(\\d*)n((?:\\+|-)?\\d*)/.2O(m[3]=="6n"&&"2n"||m[3]=="6l"&&"2n+1"||!/\\D/.17(m[3])&&"7U+"+m[3]||m[3]),3j=(17[1]+(17[2]||1))-0,d=17[3]-0;Q(L i=0,3f=r.M;i<3f;i++){L j=r[i],1a=j.1a,2w=E.O(1a);7(!e[2w]){L c=1;Q(L n=1a.1C;n;n=n.2B)7(n.15==1)n.4k=c++;e[2w]=P}L b=S;7(3j==0){7(j.4k==d)b=P}N 7((j.4k-d)%3j==0&&(j.4k-d)/3j>=0)b=P;7(b^h)g.1g(j)}r=g}N{L f=E.6r[m[1]];7(1o f=="3V")f=f[m[2]];7(1o f=="25")f=6c("S||J(a,i){K "+f+";}");r=E.3y(r,J(a,i){K f(a,i,m,r)},h)}}K{r:r,t:t}},4u:J(b,c){L d=[];L a=b[c];2b(a&&a!=T){7(a.15==1)d.1g(a);a=a[c]}K d},2Z:J(a,e,c,b){e=e||1;L d=0;Q(;a;a=a[c])7(a.15==1&&++d==e)1Q;K a},5i:J(n,a){L r=[];Q(;n;n=n.2B){7(n.15==1&&(!a||n!=a))r.1g(n)}K r}});E.16={1b:J(f,i,g,e){7(f.15==3||f.15==8)K;7(E.14.1d&&f.53!=10)f=1e;7(!g.2D)g.2D=6.2D++;7(e!=10){L h=g;g=J(){K h.1i(6,18)};g.O=e;g.2D=h.2D}L j=E.O(f,"2R")||E.O(f,"2R",{}),1v=E.O(f,"1v")||E.O(f,"1v",J(){L a;7(1o E=="10"||E.16.5f)K a;a=E.16.1v.1i(18.3R.Y,18);K a});1v.Y=f;E.R(i.23(/\\s+/),J(c,b){L a=b.23(".");b=a[0];g.U=a[1];L d=j[b];7(!d){d=j[b]={};7(!E.16.2y[b]||E.16.2y[b].4j.1P(f)===S){7(f.3F)f.3F(b,1v,S);N 7(f.6b)f.6b("4i"+b,1v)}}d[g.2D]=g;E.16.2a[b]=P});f=V},2D:1,2a:{},1V:J(e,h,f){7(e.15==3||e.15==8)K;L i=E.O(e,"2R"),29,4X;7(i){7(h==10||(1o h=="25"&&h.7T(0)=="."))Q(L g 1p i)6.1V(e,g+(h||""));N{7(h.U){f=h.2q;h=h.U}E.R(h.23(/\\s+/),J(b,a){L c=a.23(".");a=c[0];7(i[a]){7(f)2V i[a][f.2D];N Q(f 1p i[a])7(!c[1]||i[a][f].U==c[1])2V i[a][f];Q(29 1p i[a])1Q;7(!29){7(!E.16.2y[a]||E.16.2y[a].4h.1P(e)===S){7(e.67)e.67(a,E.O(e,"1v"),S);N 7(e.66)e.66("4i"+a,E.O(e,"1v"))}29=V;2V i[a]}}})}Q(29 1p i)1Q;7(!29){L d=E.O(e,"1v");7(d)d.Y=V;E.35(e,"2R");E.35(e,"1v")}}},1N:J(g,c,d,f,h){c=E.2I(c||[]);7(g.1f("!")>=0){g=g.2K(0,-1);L a=P}7(!d){7(6.2a[g])E("*").1b([1e,T]).1N(g,c)}N{7(d.15==3||d.15==8)K 10;L b,29,1n=E.1q(d[g]||V),16=!c[0]||!c[0].36;7(16)c.4J(6.4Z({U:g,2L:d}));c[0].U=g;7(a)c[0].65=P;7(E.1q(E.O(d,"1v")))b=E.O(d,"1v").1i(d,c);7(!1n&&d["4i"+g]&&d["4i"+g].1i(d,c)===S)b=S;7(16)c.4l();7(h&&E.1q(h)){29=h.1i(d,b==V?c:c.71(b));7(29!==10)b=29}7(1n&&f!==S&&b!==S&&!(E.12(d,\'a\')&&g=="4V")){6.5f=P;1S{d[g]()}1X(e){}}6.5f=S}K b},1v:J(c){L a;c=E.16.4Z(c||1e.16||{});L b=c.U.23(".");c.U=b[0];L f=E.O(6,"2R")&&E.O(6,"2R")[c.U],42=1M.2l.2K.1P(18,1);42.4J(c);Q(L j 1p f){L d=f[j];42[0].2q=d;42[0].O=d.O;7(!b[1]&&!c.65||d.U==b[1]){L e=d.1i(6,42);7(a!==S)a=e;7(e===S){c.36();c.44()}}}7(E.14.1d)c.2L=c.36=c.44=c.2q=c.O=V;K a},4Z:J(c){L a=c;c=E.1s({},a);c.36=J(){7(a.36)a.36();a.7S=S};c.44=J(){7(a.44)a.44();a.7R=P};7(!c.2L)c.2L=c.7Q||T;7(c.2L.15==3)c.2L=a.2L.1a;7(!c.4S&&c.5w)c.4S=c.5w==c.2L?c.7P:c.5w;7(c.64==V&&c.63!=V){L b=T.1F,1h=T.1h;c.64=c.63+(b&&b.2v||1h&&1h.2v||0)-(b.62||0);c.7N=c.7L+(b&&b.2x||1h&&1h.2x||0)-(b.60||0)}7(!c.3c&&((c.4f||c.4f===0)?c.4f:c.5Z))c.3c=c.4f||c.5Z;7(!c.7b&&c.5Y)c.7b=c.5Y;7(!c.3c&&c.2G)c.3c=(c.2G&1?1:(c.2G&2?3:(c.2G&4?2:0)));K c},2y:{21:{4j:J(){5M();K},4h:J(){K}},3C:{4j:J(){7(E.14.1d)K S;E(6).2j("4P",E.16.2y.3C.2q);K P},4h:J(){7(E.14.1d)K S;E(6).3w("4P",E.16.2y.3C.2q);K P},2q:J(a){7(I(a,6))K P;18[0].U="3C";K E.16.1v.1i(6,18)}},3B:{4j:J(){7(E.14.1d)K S;E(6).2j("4O",E.16.2y.3B.2q);K P},4h:J(){7(E.14.1d)K S;E(6).3w("4O",E.16.2y.3B.2q);K P},2q:J(a){7(I(a,6))K P;18[0].U="3B";K E.16.1v.1i(6,18)}}}};E.1n.1s({2j:J(c,a,b){K c=="4H"?6.2X(c,a,b):6.R(J(){E.16.1b(6,c,b||a,b&&a)})},2X:J(d,b,c){K 6.R(J(){E.16.1b(6,d,J(a){E(6).3w(a);K(c||b).1i(6,18)},c&&b)})},3w:J(a,b){K 6.R(J(){E.16.1V(6,a,b)})},1N:J(c,a,b){K 6.R(J(){E.16.1N(c,a,6,P,b)})},5n:J(c,a,b){7(6[0])K E.16.1N(c,a,6[0],S,b);K 10},2g:J(){L b=18;K 6.4V(J(a){6.4N=0==6.4N?1:0;a.36();K b[6.4N].1i(6,18)||S})},7D:J(a,b){K 6.2j(\'3C\',a).2j(\'3B\',b)},21:J(a){5M();7(E.2Q)a.1P(T,E);N E.3A.1g(J(){K a.1P(6,E)});K 6}});E.1s({2Q:S,3A:[],21:J(){7(!E.2Q){E.2Q=P;7(E.3A){E.R(E.3A,J(){6.1i(T)});E.3A=V}E(T).5n("21")}}});L x=S;J 5M(){7(x)K;x=P;7(T.3F&&!E.14.2z)T.3F("5W",E.21,S);7(E.14.1d&&1e==3b)(J(){7(E.2Q)K;1S{T.1F.7B("26")}1X(3a){3z(18.3R,0);K}E.21()})();7(E.14.2z)T.3F("5W",J(){7(E.2Q)K;Q(L i=0;i=0){L i=g.2K(e,g.M);g=g.2K(0,e)}c=c||J(){};L f="4Q";7(d)7(E.1q(d)){c=d;d=V}N{d=E.3m(d);f="61"}L h=6;E.3P({1c:g,U:f,1H:"3q",O:d,1y:J(a,b){7(b=="1W"||b=="5U")h.3q(i?E("<1x/>").3t(a.4b.1r(/<1m(.|\\s)*?\\/1m>/g,"")).2s(i):a.4b);h.R(c,[a.4b,b,a])}});K 6},7n:J(){K E.3m(6.5T())},5T:J(){K 6.2c(J(){K E.12(6,"3u")?E.2I(6.7m):6}).1E(J(){K 6.31&&!6.2Y&&(6.3k||/2k|6h/i.17(6.12)||/1u|1Z|3I/i.17(6.U))}).2c(J(i,c){L b=E(6).5O();K b==V?V:b.1k==1M?E.2c(b,J(a,i){K{31:c.31,1A:a}}):{31:c.31,1A:b}}).22()}});E.R("5S,6d,5R,6D,5Q,6m".23(","),J(i,o){E.1n[o]=J(f){K 6.2j(o,f)}});L B=(1B 3v).3L();E.1s({22:J(d,b,a,c){7(E.1q(b)){a=b;b=V}K E.3P({U:"4Q",1c:d,O:b,1W:a,1H:c})},7l:J(b,a){K E.22(b,V,a,"1m")},7k:J(c,b,a){K E.22(c,b,a,"3i")},7i:J(d,b,a,c){7(E.1q(b)){a=b;b={}}K E.3P({U:"61",1c:d,O:b,1W:a,1H:c})},85:J(a){E.1s(E.4I,a)},4I:{2a:P,U:"4Q",2U:0,5P:"4o/x-7h-3u-7g",5N:P,3l:P,O:V,6p:V,3I:V,49:{3M:"4o/3M, 1u/3M",3q:"1u/3q",1m:"1u/4m, 4o/4m",3i:"4o/3i, 1u/4m",1u:"1u/a7",4G:"*/*"}},4F:{},3P:J(s){L f,2W=/=\\?(&|$)/g,1z,O;s=E.1s(P,s,E.1s(P,{},E.4I,s));7(s.O&&s.5N&&1o s.O!="25")s.O=E.3m(s.O);7(s.1H=="4E"){7(s.U.2h()=="22"){7(!s.1c.1D(2W))s.1c+=(s.1c.1D(/\\?/)?"&":"?")+(s.4E||"7d")+"=?"}N 7(!s.O||!s.O.1D(2W))s.O=(s.O?s.O+"&":"")+(s.4E||"7d")+"=?";s.1H="3i"}7(s.1H=="3i"&&(s.O&&s.O.1D(2W)||s.1c.1D(2W))){f="4E"+B++;7(s.O)s.O=(s.O+"").1r(2W,"="+f+"$1");s.1c=s.1c.1r(2W,"="+f+"$1");s.1H="1m";1e[f]=J(a){O=a;1W();1y();1e[f]=10;1S{2V 1e[f]}1X(e){}7(h)h.34(g)}}7(s.1H=="1m"&&s.1T==V)s.1T=S;7(s.1T===S&&s.U.2h()=="22"){L i=(1B 3v()).3L();L j=s.1c.1r(/(\\?|&)4r=.*?(&|$)/,"$a4="+i+"$2");s.1c=j+((j==s.1c)?(s.1c.1D(/\\?/)?"&":"?")+"4r="+i:"")}7(s.O&&s.U.2h()=="22"){s.1c+=(s.1c.1D(/\\?/)?"&":"?")+s.O;s.O=V}7(s.2a&&!E.5H++)E.16.1N("5S");7((!s.1c.1f("a3")||!s.1c.1f("//"))&&s.1H=="1m"&&s.U.2h()=="22"){L h=T.3S("6f")[0];L g=T.3s("1m");g.3Q=s.1c;7(s.7c)g.a2=s.7c;7(!f){L l=S;g.9Z=g.9Y=J(){7(!l&&(!6.39||6.39=="5V"||6.39=="1y")){l=P;1W();1y();h.34(g)}}}h.38(g);K 10}L m=S;L k=1e.78?1B 78("9X.9V"):1B 76();k.9T(s.U,s.1c,s.3l,s.6p,s.3I);1S{7(s.O)k.4C("9R-9Q",s.5P);7(s.5C)k.4C("9O-5A-9N",E.4F[s.1c]||"9L, 9K 9I 9H 5z:5z:5z 9F");k.4C("X-9C-9A","76");k.4C("9z",s.1H&&s.49[s.1H]?s.49[s.1H]+", */*":s.49.4G)}1X(e){}7(s.6Y)s.6Y(k);7(s.2a)E.16.1N("6m",[k,s]);L c=J(a){7(!m&&k&&(k.39==4||a=="2U")){m=P;7(d){6I(d);d=V}1z=a=="2U"&&"2U"||!E.6X(k)&&"3a"||s.5C&&E.6J(k,s.1c)&&"5U"||"1W";7(1z=="1W"){1S{O=E.6W(k,s.1H)}1X(e){1z="5x"}}7(1z=="1W"){L b;1S{b=k.5q("6U-5A")}1X(e){}7(s.5C&&b)E.4F[s.1c]=b;7(!f)1W()}N E.5v(s,k,1z);1y();7(s.3l)k=V}};7(s.3l){L d=53(c,13);7(s.2U>0)3z(J(){7(k){k.9t();7(!m)c("2U")}},s.2U)}1S{k.9s(s.O)}1X(e){E.5v(s,k,V,e)}7(!s.3l)c();J 1W(){7(s.1W)s.1W(O,1z);7(s.2a)E.16.1N("5Q",[k,s])}J 1y(){7(s.1y)s.1y(k,1z);7(s.2a)E.16.1N("5R",[k,s]);7(s.2a&&!--E.5H)E.16.1N("6d")}K k},5v:J(s,a,b,e){7(s.3a)s.3a(a,b,e);7(s.2a)E.16.1N("6D",[a,s,e])},5H:0,6X:J(r){1S{K!r.1z&&9q.9p=="59:"||(r.1z>=6T&&r.1z<9n)||r.1z==6R||r.1z==9l||E.14.2d&&r.1z==10}1X(e){}K S},6J:J(a,c){1S{L b=a.5q("6U-5A");K a.1z==6R||b==E.4F[c]||E.14.2d&&a.1z==10}1X(e){}K S},6W:J(r,b){L c=r.5q("9k-U");L d=b=="3M"||!b&&c&&c.1f("3M")>=0;L a=d?r.9j:r.4b;7(d&&a.1F.28=="5x")6Q"5x";7(b=="1m")E.5g(a);7(b=="3i")a=6c("("+a+")");K a},3m:J(a){L s=[];7(a.1k==1M||a.5h)E.R(a,J(){s.1g(3r(6.31)+"="+3r(6.1A))});N Q(L j 1p a)7(a[j]&&a[j].1k==1M)E.R(a[j],J(){s.1g(3r(j)+"="+3r(6))});N s.1g(3r(j)+"="+3r(a[j]));K s.6a("&").1r(/%20/g,"+")}});E.1n.1s({1G:J(c,b){K c?6.2e({1R:"1G",27:"1G",1w:"1G"},c,b):6.1E(":1Z").R(J(){6.W.19=6.5s||"";7(E.1j(6,"19")=="2H"){L a=E("<"+6.28+" />").6y("1h");6.W.19=a.1j("19");7(6.W.19=="2H")6.W.19="3D";a.1V()}}).3h()},1I:J(b,a){K b?6.2e({1R:"1I",27:"1I",1w:"1I"},b,a):6.1E(":4d").R(J(){6.5s=6.5s||E.1j(6,"19");6.W.19="2H"}).3h()},6N:E.1n.2g,2g:J(a,b){K E.1q(a)&&E.1q(b)?6.6N(a,b):a?6.2e({1R:"2g",27:"2g",1w:"2g"},a,b):6.R(J(){E(6)[E(6).3H(":1Z")?"1G":"1I"]()})},9f:J(b,a){K 6.2e({1R:"1G"},b,a)},9d:J(b,a){K 6.2e({1R:"1I"},b,a)},9c:J(b,a){K 6.2e({1R:"2g"},b,a)},9a:J(b,a){K 6.2e({1w:"1G"},b,a)},99:J(b,a){K 6.2e({1w:"1I"},b,a)},97:J(c,a,b){K 6.2e({1w:a},c,b)},2e:J(l,k,j,h){L i=E.6P(k,j,h);K 6[i.2P===S?"R":"2P"](J(){7(6.15!=1)K S;L g=E.1s({},i);L f=E(6).3H(":1Z"),4A=6;Q(L p 1p l){7(l[p]=="1I"&&f||l[p]=="1G"&&!f)K E.1q(g.1y)&&g.1y.1i(6);7(p=="1R"||p=="27"){g.19=E.1j(6,"19");g.32=6.W.32}}7(g.32!=V)6.W.32="1Z";g.40=E.1s({},l);E.R(l,J(c,a){L e=1B E.2t(4A,g,c);7(/2g|1G|1I/.17(a))e[a=="2g"?f?"1G":"1I":a](l);N{L b=a.3X().1D(/^([+-]=)?([\\d+-.]+)(.*)$/),1Y=e.2m(P)||0;7(b){L d=2M(b[2]),2A=b[3]||"2S";7(2A!="2S"){4A.W[c]=(d||1)+2A;1Y=((d||1)/e.2m(P))*1Y;4A.W[c]=1Y+2A}7(b[1])d=((b[1]=="-="?-1:1)*d)+1Y;e.45(1Y,d,2A)}N e.45(1Y,a,"")}});K P})},2P:J(a,b){7(E.1q(a)||(a&&a.1k==1M)){b=a;a="2t"}7(!a||(1o a=="25"&&!b))K A(6[0],a);K 6.R(J(){7(b.1k==1M)A(6,a,b);N{A(6,a).1g(b);7(A(6,a).M==1)b.1i(6)}})},94:J(b,c){L a=E.3G;7(b)6.2P([]);6.R(J(){Q(L i=a.M-1;i>=0;i--)7(a[i].Y==6){7(c)a[i](P);a.72(i,1)}});7(!c)6.5p();K 6}});L A=J(b,c,a){7(!b)K 10;c=c||"2t";L q=E.O(b,c+"2P");7(!q||a)q=E.O(b,c+"2P",a?E.2I(a):[]);K q};E.1n.5p=J(a){a=a||"2t";K 6.R(J(){L q=A(6,a);q.4l();7(q.M)q[0].1i(6)})};E.1s({6P:J(b,a,c){L d=b&&b.1k==92?b:{1y:c||!c&&a||E.1q(b)&&b,2u:b,3Z:c&&a||a&&a.1k!=91&&a};d.2u=(d.2u&&d.2u.1k==51?d.2u:{90:8Z,9D:6T}[d.2u])||8X;d.5y=d.1y;d.1y=J(){7(d.2P!==S)E(6).5p();7(E.1q(d.5y))d.5y.1i(6)};K d},3Z:{70:J(p,n,b,a){K b+a*p},5j:J(p,n,b,a){K((-24.8V(p*24.8U)/2)+0.5)*a+b}},3G:[],3W:V,2t:J(b,c,a){6.11=c;6.Y=b;6.1l=a;7(!c.47)c.47={}}});E.2t.2l={4y:J(){7(6.11.30)6.11.30.1i(6.Y,[6.2J,6]);(E.2t.30[6.1l]||E.2t.30.4G)(6);7(6.1l=="1R"||6.1l=="27")6.Y.W.19="3D"},2m:J(a){7(6.Y[6.1l]!=V&&6.Y.W[6.1l]==V)K 6.Y[6.1l];L r=2M(E.1j(6.Y,6.1l,a));K r&&r>-8Q?r:2M(E.2o(6.Y,6.1l))||0},45:J(c,b,d){6.5B=(1B 3v()).3L();6.1Y=c;6.3h=b;6.2A=d||6.2A||"2S";6.2J=6.1Y;6.4B=6.4w=0;6.4y();L e=6;J t(a){K e.30(a)}t.Y=6.Y;E.3G.1g(t);7(E.3W==V){E.3W=53(J(){L a=E.3G;Q(L i=0;i6.11.2u+6.5B){6.2J=6.3h;6.4B=6.4w=1;6.4y();6.11.40[6.1l]=P;L b=P;Q(L i 1p 6.11.40)7(6.11.40[i]!==P)b=S;7(b){7(6.11.19!=V){6.Y.W.32=6.11.32;6.Y.W.19=6.11.19;7(E.1j(6.Y,"19")=="2H")6.Y.W.19="3D"}7(6.11.1I)6.Y.W.19="2H";7(6.11.1I||6.11.1G)Q(L p 1p 6.11.40)E.1J(6.Y.W,p,6.11.47[p])}7(b&&E.1q(6.11.1y))6.11.1y.1i(6.Y);K S}N{L n=t-6.5B;6.4w=n/6.11.2u;6.4B=E.3Z[6.11.3Z||(E.3Z.5j?"5j":"70")](6.4w,n,0,1,6.11.2u);6.2J=6.1Y+((6.3h-6.1Y)*6.4B);6.4y()}K P}};E.2t.30={2v:J(a){a.Y.2v=a.2J},2x:J(a){a.Y.2x=a.2J},1w:J(a){E.1J(a.Y.W,"1w",a.2J)},4G:J(a){a.Y.W[a.1l]=a.2J+a.2A}};E.1n.5L=J(){L b=0,3b=0,Y=6[0],5l;7(Y)8M(E.14){L d=Y.1a,41=Y,1K=Y.1K,1L=Y.2i,5D=2d&&4s(5K)<8J&&!/a1/i.17(v),2T=E.1j(Y,"43")=="2T";7(Y.6G){L c=Y.6G();1b(c.26+24.2f(1L.1F.2v,1L.1h.2v),c.3b+24.2f(1L.1F.2x,1L.1h.2x));1b(-1L.1F.62,-1L.1F.60)}N{1b(Y.5G,Y.5F);2b(1K){1b(1K.5G,1K.5F);7(48&&!/^t(8H|d|h)$/i.17(1K.28)||2d&&!5D)2N(1K);7(!2T&&E.1j(1K,"43")=="2T")2T=P;41=/^1h$/i.17(1K.28)?41:1K;1K=1K.1K}2b(d&&d.28&&!/^1h|3q$/i.17(d.28)){7(!/^8G|1O.*$/i.17(E.1j(d,"19")))1b(-d.2v,-d.2x);7(48&&E.1j(d,"32")!="4d")2N(d);d=d.1a}7((5D&&(2T||E.1j(41,"43")=="4W"))||(48&&E.1j(41,"43")!="4W"))1b(-1L.1h.5G,-1L.1h.5F);7(2T)1b(24.2f(1L.1F.2v,1L.1h.2v),24.2f(1L.1F.2x,1L.1h.2x))}5l={3b:3b,26:b}}J 2N(a){1b(E.2o(a,"a8",P),E.2o(a,"a9",P))}J 1b(l,t){b+=4s(l)||0;3b+=4s(t)||0}K 5l}})();',62,631,'||||||this|if||||||||||||||||||||||||||||||||||||||function|return|var|length|else|data|true|for|each|false|document|type|null|style||elem||undefined|options|nodeName||browser|nodeType|event|test|arguments|display|parentNode|add|url|msie|window|indexOf|push|body|apply|css|constructor|prop|script|fn|typeof|in|isFunction|replace|extend|className|text|handle|opacity|div|complete|status|value|new|firstChild|match|filter|documentElement|show|dataType|hide|attr|offsetParent|doc|Array|trigger|table|call|break|height|try|cache|tbody|remove|success|catch|start|hidden||ready|get|split|Math|string|left|width|tagName|ret|global|while|map|safari|animate|max|toggle|toLowerCase|ownerDocument|bind|select|prototype|cur||curCSS|selected|handler|done|find|fx|duration|scrollLeft|id|scrollTop|special|opera|unit|nextSibling|stack|guid|toUpperCase|pushStack|button|none|makeArray|now|slice|target|parseFloat|border|exec|queue|isReady|events|px|fixed|timeout|delete|jsre|one|disabled|nth|step|name|overflow|inArray|removeChild|removeData|preventDefault|merge|appendChild|readyState|error|top|which|innerHTML|multiFilter|rl|trim|end|json|first|checked|async|param|elems|insertBefore|childNodes|html|encodeURIComponent|createElement|append|form|Date|unbind|color|grep|setTimeout|readyList|mouseleave|mouseenter|block|isXMLDoc|addEventListener|timers|is|password|last|runtimeStyle|getTime|xml|jQuery|domManip|ajax|src|callee|getElementsByTagName|selectedIndex|load|object|timerId|toString|has|easing|curAnim|offsetChild|args|position|stopPropagation|custom|props|orig|mozilla|accepts|clean|responseText|defaultView|visible|String|charCode|float|teardown|on|setup|nodeIndex|shift|javascript|currentStyle|application|child|RegExp|_|parseInt|previousSibling|dir|tr|state|empty|update|getAttribute|self|pos|setRequestHeader|input|jsonp|lastModified|_default|unload|ajaxSettings|unshift|getComputedStyle|styleSheets|getPropertyValue|lastToggle|mouseout|mouseover|GET|andSelf|relatedTarget|init|visibility|click|absolute|index|container|fix|outline|Number|removeAttribute|setInterval|prevObject|classFilter|not|unique|submit|file|after|windowData|deep|scroll|client|triggered|globalEval|jquery|sibling|swing|clone|results|wrapAll|triggerHandler|lastChild|dequeue|getResponseHeader|createTextNode|oldblock|checkbox|radio|handleError|fromElement|parsererror|old|00|Modified|startTime|ifModified|safari2|getWH|offsetTop|offsetLeft|active|values|getElementById|version|offset|bindReady|processData|val|contentType|ajaxSuccess|ajaxComplete|ajaxStart|serializeArray|notmodified|loaded|DOMContentLoaded|Width|ctrlKey|keyCode|clientTop|POST|clientLeft|clientX|pageX|exclusive|detachEvent|removeEventListener|swap|cloneNode|join|attachEvent|eval|ajaxStop|substr|head|parse|textarea|reset|image|zoom|odd|ajaxSend|even|before|username|prepend|expr|quickClass|uuid|quickID|quickChild|continue|textContent|appendTo|contents|evalScript|parent|defaultValue|ajaxError|setArray|compatMode|getBoundingClientRect|styleFloat|clearInterval|httpNotModified|nodeValue|100|alpha|_toggle|href|speed|throw|304|replaceWith|200|Last|colgroup|httpData|httpSuccess|beforeSend|eq|linear|concat|splice|fieldset|multiple|cssFloat|XMLHttpRequest|webkit|ActiveXObject|CSS1Compat|link|metaKey|scriptCharset|callback|col|pixelLeft|urlencoded|www|post|hasClass|getJSON|getScript|elements|serialize|black|keyup|keypress|solid|change|mousemove|mouseup|dblclick|resize|focus|blur|stylesheet|rel|doScroll|round|hover|padding|offsetHeight|mousedown|offsetWidth|Bottom|Top|keydown|clientY|Right|pageY|Left|toElement|srcElement|cancelBubble|returnValue|charAt|0n|substring|animated|header|noConflict|line|enabled|innerText|contains|only|weight|ajaxSetup|font|size|gt|lt|uFFFF|u0128|417|Boolean|inner|Height|toggleClass|removeClass|addClass|removeAttr|replaceAll|insertAfter|prependTo|contentWindow|contentDocument|wrap|iframe|children|siblings|prevAll|nextAll|prev|wrapInner|next|parents|maxLength|maxlength|readOnly|readonly|reverse|class|htmlFor|inline|able|boxModel|522|setData|compatible|with|1px|ie|getData|10000|ra|it|rv|PI|cos|userAgent|400|navigator|600|slow|Function|Object|array|stop|ig|NaN|fadeTo|option|fadeOut|fadeIn|setAttribute|slideToggle|slideUp|changed|slideDown|be|can|property|responseXML|content|1223|getAttributeNode|300|method|protocol|location|action|send|abort|cssText|th|td|cap|specified|Accept|With|colg|Requested|fast|tfoot|GMT|thead|1970|Jan|attributes|01|Thu|leg|Since|If|opt|Type|Content|embed|open|area|XMLHTTP|hr|Microsoft|onreadystatechange|onload|meta|adobeair|charset|http|1_|img|br|plain|borderLeftWidth|borderTopWidth|abbr'.split('|'),0,{})) \ No newline at end of file diff --git a/vendor/sunra/php-simple-html-dom-parser/Src/Sunra/PhpSimple/simplehtmldom_1_5/testcase/mass_test.php b/vendor/sunra/php-simple-html-dom-parser/Src/Sunra/PhpSimple/simplehtmldom_1_5/testcase/mass_test.php new file mode 100644 index 000000000..8d74f909d --- /dev/null +++ b/vendor/sunra/php-simple-html-dom-parser/Src/Sunra/PhpSimple/simplehtmldom_1_5/testcase/mass_test.php @@ -0,0 +1,68 @@ +'empty.htm', 'url'=>''), + array('name'=>'smarty_1.htm', 'url'=>'guestbook.tpl'), + array('name'=>'smarty_2.htm', 'url'=>'guestbook_form.tpl'), + + array('name'=>'google.htm', 'url'=>'http://www.google.com/'), + array('name'=>'senate.htm', 'url'=>'http://www.senate.gov/legislative/LIS/roll_call_lists/roll_call_vote_cfm.cfm?congress=101&session=2&vote=00317'), + array('name'=>'cyberciti.htm', 'url'=>'http://www.cyberciti.biz/tips/configure-ubuntu-grub-to-load-freebsd.html'), + array('name'=>'myspace.htm', 'url'=>'http://www.myspace.com/'), + array('name'=>'mootools.htm', 'url'=>'http://www.mootools.net/'), + array('name'=>'jquery.htm', 'url'=>'http://jquery.com/'), + array('name'=>'scriptaculo.htm', 'url'=>'http://script.aculo.us/'), + array('name'=>'apache.htm', 'url'=>'http://www.apache.org/'), + array('name'=>'microsoft.htm', 'url'=>'http://www.microsoft.com/'), + array('name'=>'slashdot.htm', 'url'=>'http://www.slashdot.org/'), + array('name'=>'ror.htm', 'url'=>'http://www.rubyonrails.org/'), + array('name'=>'yahoo.htm', 'url'=>'http://www.yahoo.com/'), + array('name'=>'phpbb.htm', 'url'=>'http://www.phpbb.com/'), + array('name'=>'python.htm', 'url'=>'http://www.python.org/'), + array('name'=>'lua.htm', 'url'=>'http://www.lua.org/'), + array('name'=>'php.htm', 'url'=>'http://www.php.net/'), + array('name'=>'ibm.htm', 'url'=>'http://www.ibm.com/'), + array('name'=>'java.htm', 'url'=>'http://java.sun.com/'), + array('name'=>'flickr.htm', 'url'=>'http://www.flickr.com/tour/upload/'), + array('name'=>'amazon.htm', 'url'=>'http://www.amazon.com/'), + array('name'=>'youtube.htm', 'url'=>'http://www.youtube.com/watch?v=kib05Ip6GSo&feature=bz302'), +); + + +echo 'memory: '.memory_get_usage().'
                    '; +$dom = new simple_html_dom; + +foreach($files as $f) { + // get file from url + if($f['url']!='') file_put_contents($dir.$f['name'], file_get_contents($f['url'])); + else file_put_contents($dir.$f['name'], ''); + + $start = microtime(); + $dom->load(file_get_contents($dir.$f['name']), false); + list($eu, $es) = explode(' ', microtime()); + list($bu, $bs) = explode(' ', $start); + echo sprintf('(%.1f)', ((float)$eu+(float)$es-(float)$bu-(float)$bs)*1000).'
                    '; + + if (file_get_contents($dir.$f['name'])!=$dom->save()) { + echo "[failed] ".$f['name']."
                    "; + $dom->save($dir.$f['name'].'.error'); + } + else + echo "[success] ".$f['name']."
                    "; + + echo 'memory: '.memory_get_usage().'
                    '; + + flush(); + set_time_limit(0); +} + +$dom->clear(); +unset($dom); +echo '
                    memory: '.memory_get_usage().'
                    '; + +?> \ No newline at end of file diff --git a/vendor/sunra/php-simple-html-dom-parser/Src/Sunra/PhpSimple/simplehtmldom_1_5/testcase/memory_test.php b/vendor/sunra/php-simple-html-dom-parser/Src/Sunra/PhpSimple/simplehtmldom_1_5/testcase/memory_test.php new file mode 100644 index 000000000..1beeba547 --- /dev/null +++ b/vendor/sunra/php-simple-html-dom-parser/Src/Sunra/PhpSimple/simplehtmldom_1_5/testcase/memory_test.php @@ -0,0 +1,121 @@ +"; +} + +// ----------------------------------------------------------------------------- +$filename = './html/google.htm'; +//$filename = 'test.htm'; + +// ----------------------------------------------------------------------------- +// test_load_file_memory +function test_load_file_memory($filename, $init_size) { + echo '[load file] init memory: '.number_format(memory_get_usage()/1024, 0, '.', ',').'
                    '; + echo '--------------------------------------------------------------------
                    '; + flush(); + for($i=0; $i<3; ++$i) { + $str = file_get_contents($filename); + + dump_memory($init_size); + unset($str); + } + echo 'after loop: '.number_format(memory_get_usage(), 0, '.', ',').'
                    '; + echo '--------------------------------------------------------------------
                    '; + flush(); +} + +// ----------------------------------------------------------------------------- +// test_multi_objects_str_get_html +function test_multi_str_get_html($filename, $init_size) { + global $__g_node_mgr; + + $str = file_get_contents($filename); + echo '[str_get_html] init memory: '.number_format(memory_get_usage()/1024, 0, '.', ',').'
                    '; + echo '--------------------------------------------------------------------
                    '; + flush(); + for($i=0; $i<3; ++$i) { + $html = str_get_html($str); + dump_memory($init_size); + flush(); + } + echo 'after loop: '.number_format(memory_get_usage(), 0, '.', ',').'
                    '; + echo '--------------------------------------------------------------------
                    '; + flush(); + unset($str); +} + +// ----------------------------------------------------------------------------- +// test_multi_file_get_html +function test_multi_file_get_html($filename, $init_size) { + echo '[file_get_html] init memory: '.number_format(memory_get_usage()/1024, 0, '.', ',').'
                    '; + echo '--------------------------------------------------------------------
                    '; + flush(); + for($i=0; $i<3; ++$i) { + $html = file_get_html($filename); + //$html->clear(); + unset($html); + dump_memory($init_size); + flush(); + } + echo 'after loop: '.number_format(memory_get_usage(), 0, '.', ',').'
                    '; + echo '--------------------------------------------------------------------
                    '; + flush(); +} +/* +// ----------------------------------------------------------------------------- +// test_multi_objects_clear_memory +function test_multi_objects_file_get_html_clear_memory($filename) { +echo '

                    [one object]
                    init memory: '.number_format(memory_get_usage(), 0, '.', ',').'
                    '; +echo '------------------------------------------
                    '; +flush(); +$html = new simple_html_dom; +for($i=0; $i<3; ++$i) { + $html->load_file($filename); + $html->clear(); + dump_memory(); +} +unset($dom); +echo 'final: '.number_format(memory_get_usage(), 0, '.', ',').'
                    '; +flush(); + + +echo '

                    [multi objects without clear memory]
                    init memory: '.number_format(memory_get_usage(), 0, '.', ',').'
                    '; +echo '------------------------------------------
                    '; +flush(); +for($i=0; $i<3; ++$i) { + $html = file_get_html($filename); + dump_memory(); +} +echo 'final: '.number_format(memory_get_usage(), 0, '.', ',').'
                    '; +flush(); +*/ + +// ----------------------------------------------------------------------------- +// begin test +$init_size = number_format(memory_get_usage(), 0, '.', ','); +echo 'init ' . $init_size . " bytes
                    "; +flush(); + +echo '
                    before function: '.number_format(memory_get_usage()/1024, 0, '.', ',').'
                    '; +test_load_file_memory($filename, $init_size); +echo 'after function: '.number_format(memory_get_usage()/1024, 0, '.', ',').'

                    '; +flush(); + +echo '
                    before function: '.number_format(memory_get_usage()/1024, 0, '.', ',').'
                    '; +test_multi_file_get_html($filename, $init_size); +echo 'after function: '.number_format(memory_get_usage()/1024, 0, '.', ',').'

                    '; +flush(); + +echo '
                    before function: '.number_format(memory_get_usage()/1024, 0, '.', ',').'
                    '; +test_multi_file_get_html($filename, $init_size); +echo 'after function: '.number_format(memory_get_usage()/1024, 0, '.', ',').'

                    '; +flush(); +?> \ No newline at end of file diff --git a/vendor/sunra/php-simple-html-dom-parser/Src/Sunra/PhpSimple/simplehtmldom_1_5/testcase/misc_testcase.php b/vendor/sunra/php-simple-html-dom-parser/Src/Sunra/PhpSimple/simplehtmldom_1_5/testcase/misc_testcase.php new file mode 100644 index 000000000..fa307b16e --- /dev/null +++ b/vendor/sunra/php-simple-html-dom-parser/Src/Sunra/PhpSimple/simplehtmldom_1_5/testcase/misc_testcase.php @@ -0,0 +1,60 @@ + + + +HTML; + +$dom->load($str); +$es = $dom->find('img'); +assert(count($es)==3); +assert($es[0]->src=='src0'); +assert($es[1]->src=='src1'); +assert($es[2]->src=='src2'); +assert($es[0]->innertext==''); +assert($es[1]->innertext==''); +assert($es[2]->innertext==''); +assert($es[0]->outertext==''); +assert($es[1]->outertext==''); +assert($es[2]->outertext==''); +assert($dom->find('img', 0)->src=='src0'); +assert($dom->find('img', 1)->src=='src1'); +assert($dom->find('img', 2)->src=='src2'); +assert($dom->find('img', 3)===null); +assert($dom->find('img', 99)===null); +assert($dom->save()==$str); + +// ----------------------------------------------------------------------------- +// test error tag +$str = <<

                    p1

                    +

                    + +HTML; + +$dom = str_get_html($str); +$es = $dom->find('img'); +assert(count($es)==3); +assert($es[0]->src=='src0'); +assert($es[1]->src=='src1'); +assert($es[2]->src=='src2'); + +$es = $dom->find('p'); +assert($es[0]->innertext=='p1'); +assert($dom==$str); + +// ----------------------------------------------------------------------------- +// tear down +$dom->clear(); +unset($dom); +?> \ No newline at end of file diff --git a/vendor/sunra/php-simple-html-dom-parser/Src/Sunra/PhpSimple/simplehtmldom_1_5/testcase/performance_test.php b/vendor/sunra/php-simple-html-dom-parser/Src/Sunra/PhpSimple/simplehtmldom_1_5/testcase/performance_test.php new file mode 100644 index 000000000..384d2acec --- /dev/null +++ b/vendor/sunra/php-simple-html-dom-parser/Src/Sunra/PhpSimple/simplehtmldom_1_5/testcase/performance_test.php @@ -0,0 +1,40 @@ +load($str, false); + + list($eu, $es) = explode(' ', microtime()); + list($bu, $bs) = explode(' ', $start); + + $diff = ((float)$eu+(float)$es-(float)$bu-(float)$bs)*1000; + + if ($diff>$max) + $max = $diff; + + if ($diff<$min) + $min = $diff; + + $all += $diff; + echo sprintf('(%.1f)', $diff).'
                    '; +} + +echo '
                    -------------------------
                    '; +echo 'min: ' . $min . '
                    '; +echo 'max: ' . $max . '
                    '; + +echo '
                    avg: ' . $all/$count . '
                    '; +?> \ No newline at end of file diff --git a/vendor/sunra/php-simple-html-dom-parser/Src/Sunra/PhpSimple/simplehtmldom_1_5/testcase/reader/.svn/all-wcprops b/vendor/sunra/php-simple-html-dom-parser/Src/Sunra/PhpSimple/simplehtmldom_1_5/testcase/reader/.svn/all-wcprops new file mode 100644 index 000000000..4251337d9 --- /dev/null +++ b/vendor/sunra/php-simple-html-dom-parser/Src/Sunra/PhpSimple/simplehtmldom_1_5/testcase/reader/.svn/all-wcprops @@ -0,0 +1,35 @@ +K 25 +svn:wc:ra_dav:version-url +V 57 +/svnroot/simplehtmldom/!svn/ver/130/trunk/testcase/reader +END +selector_testcase.php +K 25 +svn:wc:ra_dav:version-url +V 79 +/svnroot/simplehtmldom/!svn/ver/130/trunk/testcase/reader/selector_testcase.php +END +performance_test.php +K 25 +svn:wc:ra_dav:version-url +V 78 +/svnroot/simplehtmldom/!svn/ver/130/trunk/testcase/reader/performance_test.php +END +element_testcase.php +K 25 +svn:wc:ra_dav:version-url +V 78 +/svnroot/simplehtmldom/!svn/ver/130/trunk/testcase/reader/element_testcase.php +END +all_test.php +K 25 +svn:wc:ra_dav:version-url +V 70 +/svnroot/simplehtmldom/!svn/ver/129/trunk/testcase/reader/all_test.php +END +memory_test.php +K 25 +svn:wc:ra_dav:version-url +V 73 +/svnroot/simplehtmldom/!svn/ver/130/trunk/testcase/reader/memory_test.php +END diff --git a/vendor/sunra/php-simple-html-dom-parser/Src/Sunra/PhpSimple/simplehtmldom_1_5/testcase/reader/.svn/dir-prop-base b/vendor/sunra/php-simple-html-dom-parser/Src/Sunra/PhpSimple/simplehtmldom_1_5/testcase/reader/.svn/dir-prop-base new file mode 100644 index 000000000..316065866 --- /dev/null +++ b/vendor/sunra/php-simple-html-dom-parser/Src/Sunra/PhpSimple/simplehtmldom_1_5/testcase/reader/.svn/dir-prop-base @@ -0,0 +1,5 @@ +K 13 +svn:mergeinfo +V 0 + +END diff --git a/vendor/sunra/php-simple-html-dom-parser/Src/Sunra/PhpSimple/simplehtmldom_1_5/testcase/reader/.svn/entries b/vendor/sunra/php-simple-html-dom-parser/Src/Sunra/PhpSimple/simplehtmldom_1_5/testcase/reader/.svn/entries new file mode 100644 index 000000000..269280784 --- /dev/null +++ b/vendor/sunra/php-simple-html-dom-parser/Src/Sunra/PhpSimple/simplehtmldom_1_5/testcase/reader/.svn/entries @@ -0,0 +1,198 @@ +10 + +dir +182 +https://simplehtmldom.svn.sourceforge.net/svnroot/simplehtmldom/trunk/testcase/reader +https://simplehtmldom.svn.sourceforge.net/svnroot/simplehtmldom + + + +2008-07-19T21:40:06.854888Z +130 +me578022 +has-props + + + + + + + + + + + + + +d0e60b4b-9046-0410-940c-b97530268c78 + +selector_testcase.php +file + + + + +2010-08-17T19:13:53.174276Z +ed68e3ea92d0c1b58ad31728b0b10023 +2008-07-19T21:40:06.854888Z +130 +me578022 +has-props + + + + + + + + + + + + + + + + + + + + +16889 + +performance_test.php +file + + + + +2010-08-17T19:13:53.181276Z +3659fd102d8a60a35a95e735d9762dd6 +2008-07-19T21:40:06.854888Z +130 +me578022 +has-props + + + + + + + + + + + + + + + + + + + + +1110 + +element_testcase.php +file + + + + +2010-08-17T19:13:53.188276Z +b346a61a9d66e112e5bb8e7cae72dfcf +2008-07-19T21:40:06.854888Z +130 +me578022 +has-props + + + + + + + + + + + + + + + + + + + + +8889 + +all_test.php +file + + + + +2010-08-17T19:13:53.198277Z +2217fa92f9dea484afa35bcd9ded0e15 +2008-07-15T20:06:11.267636Z +129 +me578022 +has-props + + + + + + + + + + + + + + + + + + + + +281 + +memory_test.php +file + + + + +2010-08-17T19:13:53.204277Z +2861f8bf56bfdd23a6444c4dddcfb177 +2008-07-19T21:40:06.854888Z +130 +me578022 +has-props + + + + + + + + + + + + + + + + + + + + +3134 + diff --git a/vendor/sunra/php-simple-html-dom-parser/Src/Sunra/PhpSimple/simplehtmldom_1_5/testcase/reader/.svn/prop-base/all_test.php.svn-base b/vendor/sunra/php-simple-html-dom-parser/Src/Sunra/PhpSimple/simplehtmldom_1_5/testcase/reader/.svn/prop-base/all_test.php.svn-base new file mode 100644 index 000000000..698ec4c94 --- /dev/null +++ b/vendor/sunra/php-simple-html-dom-parser/Src/Sunra/PhpSimple/simplehtmldom_1_5/testcase/reader/.svn/prop-base/all_test.php.svn-base @@ -0,0 +1,13 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 3 +Rev +K 13 +svn:mime-type +V 10 +text/x-php +END diff --git a/vendor/sunra/php-simple-html-dom-parser/Src/Sunra/PhpSimple/simplehtmldom_1_5/testcase/reader/.svn/prop-base/element_testcase.php.svn-base b/vendor/sunra/php-simple-html-dom-parser/Src/Sunra/PhpSimple/simplehtmldom_1_5/testcase/reader/.svn/prop-base/element_testcase.php.svn-base new file mode 100644 index 000000000..698ec4c94 --- /dev/null +++ b/vendor/sunra/php-simple-html-dom-parser/Src/Sunra/PhpSimple/simplehtmldom_1_5/testcase/reader/.svn/prop-base/element_testcase.php.svn-base @@ -0,0 +1,13 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 3 +Rev +K 13 +svn:mime-type +V 10 +text/x-php +END diff --git a/vendor/sunra/php-simple-html-dom-parser/Src/Sunra/PhpSimple/simplehtmldom_1_5/testcase/reader/.svn/prop-base/memory_test.php.svn-base b/vendor/sunra/php-simple-html-dom-parser/Src/Sunra/PhpSimple/simplehtmldom_1_5/testcase/reader/.svn/prop-base/memory_test.php.svn-base new file mode 100644 index 000000000..698ec4c94 --- /dev/null +++ b/vendor/sunra/php-simple-html-dom-parser/Src/Sunra/PhpSimple/simplehtmldom_1_5/testcase/reader/.svn/prop-base/memory_test.php.svn-base @@ -0,0 +1,13 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 3 +Rev +K 13 +svn:mime-type +V 10 +text/x-php +END diff --git a/vendor/sunra/php-simple-html-dom-parser/Src/Sunra/PhpSimple/simplehtmldom_1_5/testcase/reader/.svn/prop-base/performance_test.php.svn-base b/vendor/sunra/php-simple-html-dom-parser/Src/Sunra/PhpSimple/simplehtmldom_1_5/testcase/reader/.svn/prop-base/performance_test.php.svn-base new file mode 100644 index 000000000..698ec4c94 --- /dev/null +++ b/vendor/sunra/php-simple-html-dom-parser/Src/Sunra/PhpSimple/simplehtmldom_1_5/testcase/reader/.svn/prop-base/performance_test.php.svn-base @@ -0,0 +1,13 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 3 +Rev +K 13 +svn:mime-type +V 10 +text/x-php +END diff --git a/vendor/sunra/php-simple-html-dom-parser/Src/Sunra/PhpSimple/simplehtmldom_1_5/testcase/reader/.svn/prop-base/selector_testcase.php.svn-base b/vendor/sunra/php-simple-html-dom-parser/Src/Sunra/PhpSimple/simplehtmldom_1_5/testcase/reader/.svn/prop-base/selector_testcase.php.svn-base new file mode 100644 index 000000000..698ec4c94 --- /dev/null +++ b/vendor/sunra/php-simple-html-dom-parser/Src/Sunra/PhpSimple/simplehtmldom_1_5/testcase/reader/.svn/prop-base/selector_testcase.php.svn-base @@ -0,0 +1,13 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 3 +Rev +K 13 +svn:mime-type +V 10 +text/x-php +END diff --git a/vendor/sunra/php-simple-html-dom-parser/Src/Sunra/PhpSimple/simplehtmldom_1_5/testcase/reader/.svn/text-base/all_test.php.svn-base b/vendor/sunra/php-simple-html-dom-parser/Src/Sunra/PhpSimple/simplehtmldom_1_5/testcase/reader/.svn/text-base/all_test.php.svn-base new file mode 100644 index 000000000..3c3ccf1eb --- /dev/null +++ b/vendor/sunra/php-simple-html-dom-parser/Src/Sunra/PhpSimple/simplehtmldom_1_5/testcase/reader/.svn/text-base/all_test.php.svn-base @@ -0,0 +1,12 @@ +isFile() && strpos($entry, '_testcase.')>0) { + echo basename($entry); + require_once($entry); + echo '
                    ...pass!

                    '; + } +} +?> \ No newline at end of file diff --git a/vendor/sunra/php-simple-html-dom-parser/Src/Sunra/PhpSimple/simplehtmldom_1_5/testcase/reader/.svn/text-base/element_testcase.php.svn-base b/vendor/sunra/php-simple-html-dom-parser/Src/Sunra/PhpSimple/simplehtmldom_1_5/testcase/reader/.svn/text-base/element_testcase.php.svn-base new file mode 100644 index 000000000..55b0ec776 --- /dev/null +++ b/vendor/sunra/php-simple-html-dom-parser/Src/Sunra/PhpSimple/simplehtmldom_1_5/testcase/reader/.svn/text-base/element_testcase.php.svn-base @@ -0,0 +1,243 @@ +foo +HTML; +$dom->load($str); +assert($dom->find('div', 0)==$str); +// ----------------------------------------------- +$str = <<foo +HTML; +$dom->load($str); +assert($dom->find('div', 0)==$str); + +// ----------------------------------------------------------------------------- +// innertext test +$str = <<
                    foo +HTML; +$dom->load($str); +assert($dom==$str); +// ----------------------------------------------- +$str = <<
                    bar +HTML; +$dom->find('span', 0)->innertext = 'bar'; +assert($dom==$str); +// ----------------------------------------------- +$str = <<ok
                    bar +HTML; +$dom->find('head', 0)->innertext = 'ok'; +assert($dom==$str); + +// ----------------------------------------------------------------------------- +// outertext test +$str = << +Head1Head2Head3 +123 + +HTML; +$dom->load($str); +assert($dom->find('tr', 0)->outertext=='Head1Head2Head3'); +assert($dom->find('tr', 1)->outertext=='123'); +// ----------------------------------------------- +$str = <<Head1Head2Head3123 +HTML; +$dom->load($str); +assert($dom->find('tr', 0)->outertext=='Head1Head2Head3'); +assert($dom->find('tr', 1)->outertext=='123'); + +// ----------------------------------------------- +$str = <<

                  • li11
                  • li12
                  • li21
                  • li22
                  +HTML; +$dom->load($str); +assert($dom->find('ul', 0)->outertext=='
                  • li11
                  • li12
                  '); +assert($dom->find('ul', 1)->outertext=='
                  • li21
                  • li22
                  '); + +// ----------------------------------------------- +$str = <<
                • li11
                • li12
                  • li21
                  • li22
                  • +HTML; +//$dom->load($str); +//assert($dom->find('ul', 0)->outertext=='
                    • li11
                    • li12
                    '); +//assert($dom->find('ul', 1)->outertext=='
                    • li21
                    • li22
                    '); + +// ----------------------------------------------- +$str = <<
                  • li11
                  • li12
                    • li21
                    • li22 +HTML; +//$dom->load($str); +//assert($dom->find('ul', 0)->outertext=='
                      • li11
                      • li12
                      • '); +//assert($dom->find('ul', 1)->outertext=='
                        • li21
                        • li22'); + +// ----------------------------------------------- +$str = << +Head1Head2Head3 +123 + +HTML; +$dom->load($str); +assert($dom->find('tr', 0)->outertext=='Head1Head2Head3'); +assert($dom->find('tr', 1)->outertext=='123'); + +// ----------------------------------------------------------------------------- +// replacement test +$str = <<
                          ok
                          +HTML; +$dom->load($str); +$es = $dom->find('div'); +assert(count($es)==2); +assert($es[0]->innertext=='
                          ok
                          '); +assert($es[0]->outertext=='
                          ok
                          '); + +// test isset +$es[0]->class = 'class_test'; +assert(isset($es[0]->class)===true); +assert(isset($es[0]->okok)===false); + +// test replacement +$es[0]->class = 'class_test'; +assert($es[0]->outertext=='
                          ok
                          '); + +// test replacement +//$es[0]->tag = 'span'; +//assert($es[0]->outertext=='
                          ok
                          '); + +// test unset (no more support...) +//$dom = str_get_dom($str); +//$es = $dom->find('div'); +//unset($es[0]->class); +//assert($es[0]->outertext=='
                          ok
                          '); + +//$dom->load($str); +//$es = $dom->find('div'); +//unset($es[0]->attr['class']); +//assert($es[0]->outertext=='
                          ok
                          '); + +// ----------------------------------------------- +$str = <<blahblah2 +HTML; +$dom->load($str); +$e = $dom->find('select[name=something]', 0); +$e->innertext = ''; +assert($e->outertext ==''); + +// ----------------------------------------------------------------------------- +// nested replacement test +$str = <<
                          ok
                          +HTML; +$dom->load($str); +$es = $dom->find('div'); +assert(count($es)==2); +assert($es[0]->innertext=='
                          ok
                          '); +assert($es[0]->outertext=='
                          ok
                          '); +assert($es[1]->innertext=='ok'); +assert($es[1]->outertext=='
                          ok
                          '); + +// test replacement +$es[1]->innertext = 'okok'; +assert($es[1]->outertext=='
                          okok
                          '); +assert($es[0]->outertext=='
                          okok
                          '); +//assert($dom=='
                          okok
                          '); + +$es[1]->class = 'class_test'; +assert($es[1]->outertext=='
                          okok
                          '); +assert($es[0]->outertext=='
                          okok
                          '); +//assert($dom=='
                          okok
                          '); + +$es[0]->class = 'class_test'; +assert($es[0]->outertext=='
                          okok
                          '); +//assert($dom=='
                          okok
                          '); + +$es[0]->innertext = 'okokok'; +assert($es[0]->outertext=='
                          okokok
                          '); +//assert($dom=='
                          okokok
                          '); + +// ----------------------------------------------------------------------------- +//

                          test +$str = <<

                          ok0link0

                          ok2link2

                          +HTML; +$dom->load($str); +$es = $dom->find('p'); +assert($es[0]->innertext=='ok0link0'); +assert($es[1]->innertext=='ok1link1'); +assert($es[2]->innertext=='ok2link2'); +assert($dom->find('p', 0)->plaintext=='ok0link0'); +assert($dom->find('p', 1)->plaintext=='ok1link1'); +assert($dom->find('p', 2)->plaintext=='ok2link2'); + +$count = 0; +foreach($dom->find('p') as $p) { + $a = $p->find('a'); + assert($a[0]->innertext=='link'.$count); + ++$count; +} + +$es = $dom->find('p a'); +assert($es[0]->innertext=='link0'); +assert($es[1]->innertext=='link1'); +assert($es[2]->innertext=='link2'); +assert($dom->find('p a', 0)->plaintext=='link0'); +assert($dom->find('p a', 1)->plaintext=='link1'); +assert($dom->find('p a', 2)->plaintext=='link2'); + +// ----------------------------------------------------------------------------- +// test +$str = << +HTML; +$dom->load($str); +$e = $dom->find('embed', 0); +assert($e->src=='../graphics/sounds/1812over.mid'); +assert($e->height=='60'); +assert($e->width=='144'); +assert($e==strtolower($str)); + +// ----------------------------------------------------------------------------- +//
                           test
                          +$str = <<
                          +    
                          +        
                          +    
                          + +HTML; +$dom->load($str); +//assert(count($dom->find('input'))==0); + +// ----------------------------------------------------------------------------- +// test +$str = << + + + + +HTML; +$dom->load($str); +assert(count($dom->find('code'))==1); +//assert(count($dom->find('input'))==0); + +// ----------------------------------------------------------------------------- +// tear down +$dom->clear(); +unset($dom); +?> \ No newline at end of file diff --git a/vendor/sunra/php-simple-html-dom-parser/Src/Sunra/PhpSimple/simplehtmldom_1_5/testcase/reader/.svn/text-base/memory_test.php.svn-base b/vendor/sunra/php-simple-html-dom-parser/Src/Sunra/PhpSimple/simplehtmldom_1_5/testcase/reader/.svn/text-base/memory_test.php.svn-base new file mode 100644 index 000000000..06bc35170 --- /dev/null +++ b/vendor/sunra/php-simple-html-dom-parser/Src/Sunra/PhpSimple/simplehtmldom_1_5/testcase/reader/.svn/text-base/memory_test.php.svn-base @@ -0,0 +1,103 @@ +"; +} + +function stat_dom($dom) { + $count_text = 0; + $count_comm = 0; + $count_elem = 0; + $count_tag_end = 0; + + foreach($dom->nodes as $n) { + if ($n->nodetype==HDOM_TYPE_TEXT) + ++$count_text; + if ($n->nodetype==HDOM_TYPE_COMMENT) + ++$count_comm; + if ($n->nodetype==HDOM_TYPE_ELEMENT) + ++$count_elem; + if ($n->nodetype==HDOM_TYPE_ENDTAG) + ++$count_tag_end; + } + + echo 'Total: '. count($dom->nodes).', Text: '.$count_text.', Commnet: '.$count_comm.', Tag: '.$count_elem.', End Tag: '.$count_tag_end.'
                          '; +} + +echo 'init ' . number_format(memory_get_usage(), 0, '.', ',') . " bytes"; + + +echo '

                          [load file]
                          init memory: '.number_format(memory_get_usage(), 0, '.', ',').'
                          '; +echo '------------------------------------------
                          '; +flush(); +for($i=0; $i<3; ++$i) { + $str = file_get_contents($filename); + unset($str); + dump_memory(); +} +echo 'final: '.number_format(memory_get_usage(), 0, '.', ',').'
                          '; +flush(); + + +$str = file_get_contents($filename); +echo '

                          [multi objects str_get_dom clear memory]
                          init memory: '.number_format(memory_get_usage(), 0, '.', ',').'
                          '; +echo '------------------------------------------
                          '; +flush(); +for($i=0; $i<3; ++$i) { + $dom = str_get_dom($str); + //stat_dom($dom); + $dom->clear(); + unset($dom); + dump_memory(); + flush(); +} +echo 'final: '.number_format(memory_get_usage(), 0, '.', ',').'
                          '; +flush(); + +echo '

                          [multi objects file_get_dom clear memory]
                          init memory: '.number_format(memory_get_usage(), 0, '.', ',').'
                          '; +echo '------------------------------------------
                          '; +flush(); +for($i=0; $i<3; ++$i) { + $dom = file_get_dom($filename); + //stat_dom($dom); + $dom->clear(); + unset($dom); + dump_memory(); + flush(); +} +echo 'final: '.number_format(memory_get_usage(), 0, '.', ',').'
                          '; +flush(); + + +echo '

                          [one object]
                          init memory: '.number_format(memory_get_usage(), 0, '.', ',').'
                          '; +echo '------------------------------------------
                          '; +flush(); +$dom = new simple_html_dom; +for($i=0; $i<3; ++$i) { + $dom->load_file($filename); + $dom->clear(); + dump_memory(); +} +unset($dom); +echo 'final: '.number_format(memory_get_usage(), 0, '.', ',').'
                          '; +flush(); + + + +echo '

                          [multi objects without clear memory]
                          init memory: '.number_format(memory_get_usage(), 0, '.', ',').'
                          '; +echo '------------------------------------------
                          '; +flush(); +for($i=0; $i<3; ++$i) { + $dom = file_get_dom($filename); + dump_memory(); +} +echo 'final: '.number_format(memory_get_usage(), 0, '.', ',').'
                          '; +flush(); +?> \ No newline at end of file diff --git a/vendor/sunra/php-simple-html-dom-parser/Src/Sunra/PhpSimple/simplehtmldom_1_5/testcase/reader/.svn/text-base/performance_test.php.svn-base b/vendor/sunra/php-simple-html-dom-parser/Src/Sunra/PhpSimple/simplehtmldom_1_5/testcase/reader/.svn/text-base/performance_test.php.svn-base new file mode 100644 index 000000000..18d76706b --- /dev/null +++ b/vendor/sunra/php-simple-html-dom-parser/Src/Sunra/PhpSimple/simplehtmldom_1_5/testcase/reader/.svn/text-base/performance_test.php.svn-base @@ -0,0 +1,38 @@ +load($str, false); + list($eu, $es) = explode(' ', microtime()); + list($bu, $bs) = explode(' ', $start); + + if (((float)$eu+(float)$es-(float)$bu-(float)$bs)*1000 > $max) + $max = ((float)$eu+(float)$es-(float)$bu-(float)$bs)*1000; + + if (((float)$eu+(float)$es-(float)$bu-(float)$bs)*1000 < $min) + $min = ((float)$eu+(float)$es-(float)$bu-(float)$bs)*1000; + + $all += ((float)$eu+(float)$es-(float)$bu-(float)$bs)*1000; + echo sprintf('(%.1f)', ((float)$eu+(float)$es-(float)$bu-(float)$bs)*1000).'
                          '; + $dom->clear(); +} + +echo '
                          -------------------------
                          '; +echo 'min: ' . $min . '
                          '; +echo 'max: ' . $max . '
                          '; + +echo '
                          avg: ' . $all/$count . '
                          '; +?> \ No newline at end of file diff --git a/vendor/sunra/php-simple-html-dom-parser/Src/Sunra/PhpSimple/simplehtmldom_1_5/testcase/reader/.svn/text-base/selector_testcase.php.svn-base b/vendor/sunra/php-simple-html-dom-parser/Src/Sunra/PhpSimple/simplehtmldom_1_5/testcase/reader/.svn/text-base/selector_testcase.php.svn-base new file mode 100644 index 000000000..d93f9d672 --- /dev/null +++ b/vendor/sunra/php-simple-html-dom-parser/Src/Sunra/PhpSimple/simplehtmldom_1_5/testcase/reader/.svn/text-base/selector_testcase.php.svn-base @@ -0,0 +1,584 @@ + + + +HTML; +$dom->load($str); +$e = $dom->find('img'); +assert(count($e)==3); + +// ----------------------------------------------------------------------------- +// std selector test +$str = << + + +HTML; +$dom->load($str); + +// ----------------------------------------------- +// all +//$e = $dom->find('*'); +//assert(count($e)==3); + +// ----------------------------------------------- +// tag +assert(count($dom->find('img'))==3); + +// ----------------------------------------------- +// class +$es = $dom->find('img.class0'); +assert(count($es)==1); +assert($es[0]->src=='src0'); +assert($es[0]->innertext==''); +assert($es[0]->outertext==''); + +$es = $dom->find('.class0'); +assert(count($es)==1); +assert($es[0]->src=='src0'); +assert($es[0]->innertext==''); +assert($es[0]->outertext==''); + +// ----------------------------------------------- +// id +$es = $dom->find('img#id1'); +assert(count($es)==1); +assert($es[0]->src=='src1'); +assert($es[0]->innertext==''); +assert($es[0]->outertext==''); + +$es = $dom->find('#id2'); +assert(count($es)==1); +assert($es[0]->src=='src2'); +assert($es[0]->innertext==''); +assert($es[0]->outertext==''); + +// ----------------------------------------------- +// attr +$es = $dom->find('img[src="src0"]'); +assert(count($es)==1); +assert($es[0]->src=='src0'); +assert($es[0]->innertext==''); +assert($es[0]->outertext==''); + +$es = $dom->find('img[src=src0]'); +assert(count($es)==1); +assert($es[0]->src=='src0'); +assert($es[0]->innertext==''); +assert($es[0]->outertext==''); + +$es = $dom->find('[src=src0]'); +assert(count($es)==1); +assert($es[0]->src=='src0'); +assert($es[0]->innertext==''); +assert($es[0]->outertext==''); + +$es = $dom->find('[src="src0"]'); +assert(count($es)==1); +assert($es[0]->src=='src0'); +assert($es[0]->innertext==''); +assert($es[0]->outertext==''); + +// ----------------------------------------------- +// text +$str = <<text1
                          text2 +HTML; +$dom->load($str); +$es = $dom->find('text'); +assert(count($es)==2); +assert($es[0]->innertext=='text1'); +assert($es[0]->outertext=='text1'); +assert($es[0]->plaintext=='text1'); +assert($es[1]->innertext=='text2'); +assert($es[1]->outertext=='text2'); +assert($es[1]->plaintext=='text2'); + +$str = <<text1text2 +HTML; +$dom->load($str); +$es = $dom->find('b text'); +assert(count($es)==2); +assert($es[0]->innertext=='text1'); +assert($es[0]->outertext=='text1'); +assert($es[0]->plaintext=='text1'); +assert($es[1]->innertext=='text2'); +assert($es[1]->outertext=='text2'); +assert($es[1]->plaintext=='text2'); + + +// ----------------------------------------------- +// xml namespace test +$str = <<text +HTML; +$dom->load($str); +$es = $dom->find('bw:bizy'); +assert(count($es)==0); + +// ----------------------------------------------- +// user defined tag name test +$str = <<text +HTML; +$dom->load($str); +$es = $dom->find('div_test'); +assert(count($es)==1); +assert($es[0]->id=='1'); +// ----------------------------------------------- +$str = <<text +HTML; +$dom->load($str); +$es = $dom->find('div-test'); +assert(count($es)==1); +assert($es[0]->id=='1'); +// ----------------------------------------------- +$str = <<text +HTML; +$dom->load($str); +$es = $dom->find('div::test'); +assert(count($es)==0); + +// ----------------------------------------------- +// find all occurrences of id="1" regardless of the tag +$str = << + +
                          ok
                          +HTML; +$dom->load($str); +$es = $dom->find('[id=1]'); +assert(count($es)==2); +assert($es[0]->tag=='img'); +assert($es[1]->tag=='div'); + +// ----------------------------------------------------------------------------- +// multiple selector test +$str = << +
                          +
                          ok
                          +
                          + +HTML; +$dom->load($str); + +$es = $dom->find('div'); +assert(count($es)==3); +assert($es[0]->id=='id0'); +assert($es[1]->id=='id1'); +assert($es[2]->id=='id2'); + +$es = $dom->find('div div'); +assert(count($es)==2); +assert($es[0]->id=='id1'); +assert($es[1]->id=='id2'); + +$es = $dom->find('div div div'); +assert(count($es)==1); +assert($es[0]->id=='id2'); + +// ----------------------------------------------------------------------------- +// multiple selector test 2 +$str = << + + 0 + 1 + + + + + + + +
                          23
                          +HTML; +$dom->load($str); +$es = $dom->find('table td'); +assert(count($es)==4); +assert($es[0]->innertext=='0'); +assert($es[1]->innertext=='1'); +assert($es[2]->innertext=='2'); +assert($es[3]->innertext=='3'); + +// ----------------------------------------------------------------------------- +// multiple selector test 3 +$str = << + + + + + + + +
                          01
                          + + + + + + + + +
                          23
                          +HTML; +$dom = str_get_dom($str); +$es = $dom->find('table.hello td'); +assert(count($es)==4); +assert($es[0]->innertext=='0'); +assert($es[1]->innertext=='1'); +assert($es[2]->innertext=='2'); +assert($es[3]->innertext=='3'); + +// ----------------------------------------------------------------------------- +// nested selector test +$str = << +
                        • 0
                        • +
                        • 1
                        • +
                        +
                          +
                        • 2
                        • +
                        • 3
                        • +
                        +HTML; +$dom = str_get_dom($str); +$es= $dom->find('ul'); +assert(count($es)==2); + +foreach($es as $n) { + $li = $n->find('li'); + assert(count($li)==2); +} + +$es= $dom->find('li'); +assert(count($es)==4); +assert($es[0]->innertext=='0'); +assert($es[1]->innertext=='1'); +assert($es[2]->innertext=='2'); +assert($es[3]->innertext=='3'); +assert($es[0]->outertext=='
                      • 0
                      • '); +assert($es[1]->outertext=='
                      • 1
                      • '); +assert($es[2]->outertext=='
                      • 2
                      • '); +assert($es[3]->outertext=='
                      • 3
                      • '); + +$counter = 0; +foreach($dom->find('ul') as $ul) { + foreach($ul->find('li') as $li) { + assert($li->innertext=="$counter"); + assert($li->outertext=="
                      • $counter
                      • "); + ++$counter; + } +} + +// ----------------------------------------------------------------------------- +// [attribute=value] selector +$str = << + + +HTML; +$dom->load($str); + +$es = $dom->find('[name=newsletter]'); +assert(count($es)==1); +assert($es[0]->name=='newsletter'); +assert($es[0]->value=='Hot Fuzz'); +assert($es[0]->outertext==''); + +$es = $dom->find('[name="newsletter"]'); +assert(count($es)==1); +assert($es[0]->name=='newsletter'); +assert($es[0]->value=='Hot Fuzz'); +assert($es[0]->outertext==''); + +// ----------------------------------------------------------------------------- +// [attribute!=value] selector +$str = << + + +HTML; +$dom->load($str); + +$es = $dom->find('[name!=newsletter]'); +assert(count($es)==1); +assert($es[0]->name=='accept'); +assert($es[0]->value=='Evil Plans'); +assert($es[0]->outertext==''); + +$es = $dom->find('[name!="newsletter"]'); +assert(count($es)==1); +assert($es[0]->name=='accept'); +assert($es[0]->value=='Evil Plans'); +assert($es[0]->outertext==''); + +$es = $dom->find("[name!='newsletter']"); +assert(count($es)==1); +assert($es[0]->name=='accept'); +assert($es[0]->value=='Evil Plans'); +assert($es[0]->outertext==''); + +// ----------------------------------------------------------------------------- +// [attribute^=value] selector +$str = << + + +HTML; +$dom->load($str); + +$es = $dom->find('[name^=news]'); +assert(count($es)==2); +assert($es[0]->name=='newsletter'); +assert($es[0]->outertext==''); +assert($es[1]->name=='newsboy'); +assert($es[1]->outertext==''); + +$es = $dom->find('[name^="news"]'); +assert(count($es)==2); +assert($es[0]->name=='newsletter'); +assert($es[0]->outertext==''); +assert($es[1]->name=='newsboy'); +assert($es[1]->outertext==''); + +// ----------------------------------------------------------------------------- +// [attribute$=value] selector +$str = << + + +HTML; +$dom->load($str); + +$es = $dom->find('[name$=letter]'); +assert(count($es)==2); +assert($es[0]->name=='newsletter'); +assert($es[0]->outertext==''); +assert($es[1]->name=='jobletter'); +assert($es[1]->outertext==''); + +$es = $dom->find('[name$="letter"]'); +assert(count($es)==2); +assert($es[0]->name=='newsletter'); +assert($es[0]->outertext==''); +assert($es[1]->name=='jobletter'); +assert($es[1]->outertext==''); + +// ----------------------------------------------------------------------------- +// [attribute*=value] selector +$str = << + + + +
                        +
                        +
                        +HTML; +$dom->load($str); + +$es = $dom->find('[name*=man]'); +assert(count($es)==3); +assert($es[0]->name=='man-news'); +assert($es[0]->outertext==''); +assert($es[1]->name=='milkman'); +assert($es[1]->outertext==''); +assert($es[2]->name=='letterman2'); +assert($es[2]->outertext==''); + +$es = $dom->find('[name*="man"]'); +assert(count($es)==3); +assert($es[0]->name=='man-news'); +assert($es[0]->outertext==''); +assert($es[1]->name=='milkman'); +assert($es[1]->outertext==''); +assert($es[2]->name=='letterman2'); +assert($es[2]->outertext==''); + +$es = $dom->find('[class*=hello]'); +assert($es[0]->outertext=='
                        '); +assert($es[1]->outertext=='
                        '); +assert($es[2]->outertext=='
                        '); + +// ----------------------------------------------------------------------------- +// Testcase for '[]' names element +// normal checkbox +$str = << + + +HTML; +$dom->load($str); +$es = $dom->find('[name=news]'); +assert(count($es)==3); +assert($es[0]->name=='news'); +assert($es[0]->value=='foo'); +assert($es[1]->name=='news'); +assert($es[1]->value=='bar'); +assert($es[2]->name=='news'); +assert($es[2]->value=='baz'); + +// ----------------------------------------------------------------------------- +// with '[]' names checkbox +$str = << + + +HTML; +$dom->load($str); +$es = $dom->find('[name=news[]]'); +assert(count($es)==3); +assert($es[0]->name=='news[]'); +assert($es[0]->value=='foo'); +assert($es[1]->name=='news[]'); +assert($es[1]->value=='bar'); +assert($es[2]->name=='news[]'); +assert($es[2]->value=='baz'); + +// ----------------------------------------------------------------------------- +// with '[]' names checkbox 2 +$str = << + +HTML; +$dom->load($str); +$es = $dom->find('[name=news[foo]]'); +assert(count($es)==1); +assert($es[0]->name=='news[foo]'); +assert($es[0]->value=='foo'); + +// ----------------------------------------------------------------------------- +// regular expression syntax escaping +$str = << +one +two +three (text) + +HTML; +$dom->load($str); +assert(count($dom->find('a[href^="image/"]'))==2); +assert(count($dom->find('a[href*="/favorites/"]'))==1); + +// ----------------------------------------------------------------------------- +// multiple class test +$str = <<should verify +
                        should verify
                        +
                        should verify
                        +
                        should verify
                        +
                        should not verify
                        +
                        should not verify
                        +
                        should not verify
                        +HTML; + +$dom->load($str); +$es = $dom->find('[class="hello"],[class*="hello "],[class*=" hello"]'); +assert(count($es)==4); +assert($es[0]->class=='hello'); +assert($es[1]->class=='foo hello bar'); +assert($es[2]->class=='foo bar hello'); +assert($es[3]->class=='hello foo bar'); + +$es = $dom->find('.hello'); +assert(count($es)==4); +assert($es[0]->class=='hello'); +assert($es[1]->class=='foo hello bar'); +assert($es[2]->class=='foo bar hello'); +assert($es[3]->class=='hello foo bar'); + +// ----------------------------------------------------------------------------- +// multiple class test 2 +$str = << +HTML; +$dom->load($str); +assert(count($dom->find('[class=aa]'))==1); +assert(count($dom->find('[class=bb]'))==1); +assert(count($dom->find('[class="aa bb"]'))==1); +assert(count($dom->find('[class=aa], [class=bb]'))==1); + +// ----------------------------------------------------------------------------- +// multiple selector test +$str = <<aaa

                        +bbb +ccc +HTML; +$dom->load($str); + +$es = $dom->find('p,b,i'); +assert(count($es)==3); +assert($es[0]->tag=='p'); +assert($es[1]->tag=='b'); +assert($es[2]->tag=='i'); + +$es = $dom->find('p, b, i'); +assert(count($es)==3); +assert($es[0]->tag=='p'); +assert($es[1]->tag=='b'); +assert($es[2]->tag=='i'); + +$es = $dom->find('p, b , i'); +assert(count($es)==3); +assert($es[0]->tag=='p'); +assert($es[1]->tag=='b'); +assert($es[2]->tag=='i'); + +$es = $dom->find('p ,b ,i'); +assert(count($es)==3); +assert($es[0]->tag=='p'); +assert($es[1]->tag=='b'); +assert($es[2]->tag=='i'); + +$es = $dom->find('b,p,i'); +assert(count($es)==3); +assert($es[0]->tag=='p'); +assert($es[1]->tag=='b'); +assert($es[2]->tag=='i'); + +$es = $dom->find('i,b,p'); +assert(count($es)==3); +assert($es[0]->tag=='p'); +assert($es[1]->tag=='b'); +assert($es[2]->tag=='i'); + +$es = $dom->find('p,b,i,p,b'); +assert(count($es)==3); +assert($es[0]->tag=='p'); +assert($es[1]->tag=='b'); +assert($es[2]->tag=='i'); + +// ----------------------------------------------------------------------------- +// multiple selector test 2 +$str = << + +HTML; +$dom->load($str); +assert(count($dom->find('a[title], img[title]'))==2); + +// ----------------------------------------------------------------------------- +// tear down +$dom->clear(); +unset($dom); +?> \ No newline at end of file diff --git a/vendor/sunra/php-simple-html-dom-parser/Src/Sunra/PhpSimple/simplehtmldom_1_5/testcase/reader/all_test.php b/vendor/sunra/php-simple-html-dom-parser/Src/Sunra/PhpSimple/simplehtmldom_1_5/testcase/reader/all_test.php new file mode 100644 index 000000000..bada36047 --- /dev/null +++ b/vendor/sunra/php-simple-html-dom-parser/Src/Sunra/PhpSimple/simplehtmldom_1_5/testcase/reader/all_test.php @@ -0,0 +1,12 @@ +isFile() && strpos($entry, '_testcase.')>0) { + echo basename($entry); + require_once($entry); + echo '
                        ...pass!

                        '; + } +} +?> \ No newline at end of file diff --git a/vendor/sunra/php-simple-html-dom-parser/Src/Sunra/PhpSimple/simplehtmldom_1_5/testcase/reader/element_testcase.php b/vendor/sunra/php-simple-html-dom-parser/Src/Sunra/PhpSimple/simplehtmldom_1_5/testcase/reader/element_testcase.php new file mode 100644 index 000000000..019f7b2be --- /dev/null +++ b/vendor/sunra/php-simple-html-dom-parser/Src/Sunra/PhpSimple/simplehtmldom_1_5/testcase/reader/element_testcase.php @@ -0,0 +1,243 @@ +foo +HTML; +$dom->load($str); +assert($dom->find('div', 0)==$str); +// ----------------------------------------------- +$str = <<foo +HTML; +$dom->load($str); +assert($dom->find('div', 0)==$str); + +// ----------------------------------------------------------------------------- +// innertext test +$str = <<
                        foo +HTML; +$dom->load($str); +assert($dom==$str); +// ----------------------------------------------- +$str = <<
                        bar +HTML; +$dom->find('span', 0)->innertext = 'bar'; +assert($dom==$str); +// ----------------------------------------------- +$str = <<ok
                        bar +HTML; +$dom->find('head', 0)->innertext = 'ok'; +assert($dom==$str); + +// ----------------------------------------------------------------------------- +// outertext test +$str = << +Head1Head2Head3 +123 + +HTML; +$dom->load($str); +assert($dom->find('tr', 0)->outertext=='Head1Head2Head3'); +assert($dom->find('tr', 1)->outertext=='123'); +// ----------------------------------------------- +$str = <<Head1Head2Head3123 +HTML; +$dom->load($str); +assert($dom->find('tr', 0)->outertext=='Head1Head2Head3'); +assert($dom->find('tr', 1)->outertext=='123'); + +// ----------------------------------------------- +$str = <<
                      • li11
                      • li12
                      • li21
                      • li22
                      +HTML; +$dom->load($str); +assert($dom->find('ul', 0)->outertext=='
                      • li11
                      • li12
                      '); +assert($dom->find('ul', 1)->outertext=='
                      • li21
                      • li22
                      '); + +// ----------------------------------------------- +$str = <<
                    • li11
                    • li12
                      • li21
                      • li22
                      • +HTML; +//$dom->load($str); +//assert($dom->find('ul', 0)->outertext=='
                        • li11
                        • li12
                        '); +//assert($dom->find('ul', 1)->outertext=='
                        • li21
                        • li22
                        '); + +// ----------------------------------------------- +$str = <<
                      • li11
                      • li12
                        • li21
                        • li22 +HTML; +//$dom->load($str); +//assert($dom->find('ul', 0)->outertext=='
                          • li11
                          • li12
                          • '); +//assert($dom->find('ul', 1)->outertext=='
                            • li21
                            • li22'); + +// ----------------------------------------------- +$str = << +Head1Head2Head3 +123 + +HTML; +$dom->load($str); +assert($dom->find('tr', 0)->outertext=='Head1Head2Head3'); +assert($dom->find('tr', 1)->outertext=='123'); + +// ----------------------------------------------------------------------------- +// replacement test +$str = <<
                              ok
                              +HTML; +$dom->load($str); +$es = $dom->find('div'); +assert(count($es)==2); +assert($es[0]->innertext=='
                              ok
                              '); +assert($es[0]->outertext=='
                              ok
                              '); + +// test isset +$es[0]->class = 'class_test'; +assert(isset($es[0]->class)===true); +assert(isset($es[0]->okok)===false); + +// test replacement +$es[0]->class = 'class_test'; +assert($es[0]->outertext=='
                              ok
                              '); + +// test replacement +//$es[0]->tag = 'span'; +//assert($es[0]->outertext=='
                              ok
                              '); + +// test unset (no more support...) +//$dom = str_get_dom($str); +//$es = $dom->find('div'); +//unset($es[0]->class); +//assert($es[0]->outertext=='
                              ok
                              '); + +//$dom->load($str); +//$es = $dom->find('div'); +//unset($es[0]->attr['class']); +//assert($es[0]->outertext=='
                              ok
                              '); + +// ----------------------------------------------- +$str = <<blahblah2 +HTML; +$dom->load($str); +$e = $dom->find('select[name=something]', 0); +$e->innertext = ''; +assert($e->outertext ==''); + +// ----------------------------------------------------------------------------- +// nested replacement test +$str = <<
                              ok
                              +HTML; +$dom->load($str); +$es = $dom->find('div'); +assert(count($es)==2); +assert($es[0]->innertext=='
                              ok
                              '); +assert($es[0]->outertext=='
                              ok
                              '); +assert($es[1]->innertext=='ok'); +assert($es[1]->outertext=='
                              ok
                              '); + +// test replacement +$es[1]->innertext = 'okok'; +assert($es[1]->outertext=='
                              okok
                              '); +assert($es[0]->outertext=='
                              okok
                              '); +//assert($dom=='
                              okok
                              '); + +$es[1]->class = 'class_test'; +assert($es[1]->outertext=='
                              okok
                              '); +assert($es[0]->outertext=='
                              okok
                              '); +//assert($dom=='
                              okok
                              '); + +$es[0]->class = 'class_test'; +assert($es[0]->outertext=='
                              okok
                              '); +//assert($dom=='
                              okok
                              '); + +$es[0]->innertext = 'okokok'; +assert($es[0]->outertext=='
                              okokok
                              '); +//assert($dom=='
                              okokok
                              '); + +// ----------------------------------------------------------------------------- +//

                              test +$str = <<

                              ok0link0

                              ok2link2

                              +HTML; +$dom->load($str); +$es = $dom->find('p'); +assert($es[0]->innertext=='ok0link0'); +assert($es[1]->innertext=='ok1link1'); +assert($es[2]->innertext=='ok2link2'); +assert($dom->find('p', 0)->plaintext=='ok0link0'); +assert($dom->find('p', 1)->plaintext=='ok1link1'); +assert($dom->find('p', 2)->plaintext=='ok2link2'); + +$count = 0; +foreach($dom->find('p') as $p) { + $a = $p->find('a'); + assert($a[0]->innertext=='link'.$count); + ++$count; +} + +$es = $dom->find('p a'); +assert($es[0]->innertext=='link0'); +assert($es[1]->innertext=='link1'); +assert($es[2]->innertext=='link2'); +assert($dom->find('p a', 0)->plaintext=='link0'); +assert($dom->find('p a', 1)->plaintext=='link1'); +assert($dom->find('p a', 2)->plaintext=='link2'); + +// ----------------------------------------------------------------------------- +// test +$str = << +HTML; +$dom->load($str); +$e = $dom->find('embed', 0); +assert($e->src=='../graphics/sounds/1812over.mid'); +assert($e->height=='60'); +assert($e->width=='144'); +assert($e==strtolower($str)); + +// ----------------------------------------------------------------------------- +//
                               test
                              +$str = <<
                              +    
                              +        
                              +    
                              + +HTML; +$dom->load($str); +//assert(count($dom->find('input'))==0); + +// ----------------------------------------------------------------------------- +// test +$str = << + + + + +HTML; +$dom->load($str); +assert(count($dom->find('code'))==1); +//assert(count($dom->find('input'))==0); + +// ----------------------------------------------------------------------------- +// tear down +$dom->clear(); +unset($dom); +?> \ No newline at end of file diff --git a/vendor/sunra/php-simple-html-dom-parser/Src/Sunra/PhpSimple/simplehtmldom_1_5/testcase/reader/memory_test.php b/vendor/sunra/php-simple-html-dom-parser/Src/Sunra/PhpSimple/simplehtmldom_1_5/testcase/reader/memory_test.php new file mode 100644 index 000000000..fa8fda54a --- /dev/null +++ b/vendor/sunra/php-simple-html-dom-parser/Src/Sunra/PhpSimple/simplehtmldom_1_5/testcase/reader/memory_test.php @@ -0,0 +1,103 @@ +"; +} + +function stat_dom($dom) { + $count_text = 0; + $count_comm = 0; + $count_elem = 0; + $count_tag_end = 0; + + foreach($dom->nodes as $n) { + if ($n->nodetype==HDOM_TYPE_TEXT) + ++$count_text; + if ($n->nodetype==HDOM_TYPE_COMMENT) + ++$count_comm; + if ($n->nodetype==HDOM_TYPE_ELEMENT) + ++$count_elem; + if ($n->nodetype==HDOM_TYPE_ENDTAG) + ++$count_tag_end; + } + + echo 'Total: '. count($dom->nodes).', Text: '.$count_text.', Commnet: '.$count_comm.', Tag: '.$count_elem.', End Tag: '.$count_tag_end.'
                              '; +} + +echo 'init ' . number_format(memory_get_usage(), 0, '.', ',') . " bytes"; + + +echo '

                              [load file]
                              init memory: '.number_format(memory_get_usage(), 0, '.', ',').'
                              '; +echo '------------------------------------------
                              '; +flush(); +for($i=0; $i<3; ++$i) { + $str = file_get_contents($filename); + unset($str); + dump_memory(); +} +echo 'final: '.number_format(memory_get_usage(), 0, '.', ',').'
                              '; +flush(); + + +$str = file_get_contents($filename); +echo '

                              [multi objects str_get_dom clear memory]
                              init memory: '.number_format(memory_get_usage(), 0, '.', ',').'
                              '; +echo '------------------------------------------
                              '; +flush(); +for($i=0; $i<3; ++$i) { + $dom = str_get_dom($str); + //stat_dom($dom); + $dom->clear(); + unset($dom); + dump_memory(); + flush(); +} +echo 'final: '.number_format(memory_get_usage(), 0, '.', ',').'
                              '; +flush(); + +echo '

                              [multi objects file_get_dom clear memory]
                              init memory: '.number_format(memory_get_usage(), 0, '.', ',').'
                              '; +echo '------------------------------------------
                              '; +flush(); +for($i=0; $i<3; ++$i) { + $dom = file_get_dom($filename); + //stat_dom($dom); + $dom->clear(); + unset($dom); + dump_memory(); + flush(); +} +echo 'final: '.number_format(memory_get_usage(), 0, '.', ',').'
                              '; +flush(); + + +echo '

                              [one object]
                              init memory: '.number_format(memory_get_usage(), 0, '.', ',').'
                              '; +echo '------------------------------------------
                              '; +flush(); +$dom = new simple_html_dom; +for($i=0; $i<3; ++$i) { + $dom->load_file($filename); + $dom->clear(); + dump_memory(); +} +unset($dom); +echo 'final: '.number_format(memory_get_usage(), 0, '.', ',').'
                              '; +flush(); + + + +echo '

                              [multi objects without clear memory]
                              init memory: '.number_format(memory_get_usage(), 0, '.', ',').'
                              '; +echo '------------------------------------------
                              '; +flush(); +for($i=0; $i<3; ++$i) { + $dom = file_get_dom($filename); + dump_memory(); +} +echo 'final: '.number_format(memory_get_usage(), 0, '.', ',').'
                              '; +flush(); +?> \ No newline at end of file diff --git a/vendor/sunra/php-simple-html-dom-parser/Src/Sunra/PhpSimple/simplehtmldom_1_5/testcase/reader/performance_test.php b/vendor/sunra/php-simple-html-dom-parser/Src/Sunra/PhpSimple/simplehtmldom_1_5/testcase/reader/performance_test.php new file mode 100644 index 000000000..a4bbb7542 --- /dev/null +++ b/vendor/sunra/php-simple-html-dom-parser/Src/Sunra/PhpSimple/simplehtmldom_1_5/testcase/reader/performance_test.php @@ -0,0 +1,38 @@ +load($str, false); + list($eu, $es) = explode(' ', microtime()); + list($bu, $bs) = explode(' ', $start); + + if (((float)$eu+(float)$es-(float)$bu-(float)$bs)*1000 > $max) + $max = ((float)$eu+(float)$es-(float)$bu-(float)$bs)*1000; + + if (((float)$eu+(float)$es-(float)$bu-(float)$bs)*1000 < $min) + $min = ((float)$eu+(float)$es-(float)$bu-(float)$bs)*1000; + + $all += ((float)$eu+(float)$es-(float)$bu-(float)$bs)*1000; + echo sprintf('(%.1f)', ((float)$eu+(float)$es-(float)$bu-(float)$bs)*1000).'
                              '; + $dom->clear(); +} + +echo '
                              -------------------------
                              '; +echo 'min: ' . $min . '
                              '; +echo 'max: ' . $max . '
                              '; + +echo '
                              avg: ' . $all/$count . '
                              '; +?> \ No newline at end of file diff --git a/vendor/sunra/php-simple-html-dom-parser/Src/Sunra/PhpSimple/simplehtmldom_1_5/testcase/reader/selector_testcase.php b/vendor/sunra/php-simple-html-dom-parser/Src/Sunra/PhpSimple/simplehtmldom_1_5/testcase/reader/selector_testcase.php new file mode 100644 index 000000000..2dd340311 --- /dev/null +++ b/vendor/sunra/php-simple-html-dom-parser/Src/Sunra/PhpSimple/simplehtmldom_1_5/testcase/reader/selector_testcase.php @@ -0,0 +1,584 @@ + + + +HTML; +$dom->load($str); +$e = $dom->find('img'); +assert(count($e)==3); + +// ----------------------------------------------------------------------------- +// std selector test +$str = << + + +HTML; +$dom->load($str); + +// ----------------------------------------------- +// all +//$e = $dom->find('*'); +//assert(count($e)==3); + +// ----------------------------------------------- +// tag +assert(count($dom->find('img'))==3); + +// ----------------------------------------------- +// class +$es = $dom->find('img.class0'); +assert(count($es)==1); +assert($es[0]->src=='src0'); +assert($es[0]->innertext==''); +assert($es[0]->outertext==''); + +$es = $dom->find('.class0'); +assert(count($es)==1); +assert($es[0]->src=='src0'); +assert($es[0]->innertext==''); +assert($es[0]->outertext==''); + +// ----------------------------------------------- +// id +$es = $dom->find('img#id1'); +assert(count($es)==1); +assert($es[0]->src=='src1'); +assert($es[0]->innertext==''); +assert($es[0]->outertext==''); + +$es = $dom->find('#id2'); +assert(count($es)==1); +assert($es[0]->src=='src2'); +assert($es[0]->innertext==''); +assert($es[0]->outertext==''); + +// ----------------------------------------------- +// attr +$es = $dom->find('img[src="src0"]'); +assert(count($es)==1); +assert($es[0]->src=='src0'); +assert($es[0]->innertext==''); +assert($es[0]->outertext==''); + +$es = $dom->find('img[src=src0]'); +assert(count($es)==1); +assert($es[0]->src=='src0'); +assert($es[0]->innertext==''); +assert($es[0]->outertext==''); + +$es = $dom->find('[src=src0]'); +assert(count($es)==1); +assert($es[0]->src=='src0'); +assert($es[0]->innertext==''); +assert($es[0]->outertext==''); + +$es = $dom->find('[src="src0"]'); +assert(count($es)==1); +assert($es[0]->src=='src0'); +assert($es[0]->innertext==''); +assert($es[0]->outertext==''); + +// ----------------------------------------------- +// text +$str = <<text1text2 +HTML; +$dom->load($str); +$es = $dom->find('text'); +assert(count($es)==2); +assert($es[0]->innertext=='text1'); +assert($es[0]->outertext=='text1'); +assert($es[0]->plaintext=='text1'); +assert($es[1]->innertext=='text2'); +assert($es[1]->outertext=='text2'); +assert($es[1]->plaintext=='text2'); + +$str = <<text1text2 +HTML; +$dom->load($str); +$es = $dom->find('b text'); +assert(count($es)==2); +assert($es[0]->innertext=='text1'); +assert($es[0]->outertext=='text1'); +assert($es[0]->plaintext=='text1'); +assert($es[1]->innertext=='text2'); +assert($es[1]->outertext=='text2'); +assert($es[1]->plaintext=='text2'); + + +// ----------------------------------------------- +// xml namespace test +$str = <<text +HTML; +$dom->load($str); +$es = $dom->find('bw:bizy'); +assert(count($es)==0); + +// ----------------------------------------------- +// user defined tag name test +$str = <<text +HTML; +$dom->load($str); +$es = $dom->find('div_test'); +assert(count($es)==1); +assert($es[0]->id=='1'); +// ----------------------------------------------- +$str = <<text +HTML; +$dom->load($str); +$es = $dom->find('div-test'); +assert(count($es)==1); +assert($es[0]->id=='1'); +// ----------------------------------------------- +$str = <<text +HTML; +$dom->load($str); +$es = $dom->find('div::test'); +assert(count($es)==0); + +// ----------------------------------------------- +// find all occurrences of id="1" regardless of the tag +$str = << + +
                              ok
                              +HTML; +$dom->load($str); +$es = $dom->find('[id=1]'); +assert(count($es)==2); +assert($es[0]->tag=='img'); +assert($es[1]->tag=='div'); + +// ----------------------------------------------------------------------------- +// multiple selector test +$str = << +
                              +
                              ok
                              +
                              + +HTML; +$dom->load($str); + +$es = $dom->find('div'); +assert(count($es)==3); +assert($es[0]->id=='id0'); +assert($es[1]->id=='id1'); +assert($es[2]->id=='id2'); + +$es = $dom->find('div div'); +assert(count($es)==2); +assert($es[0]->id=='id1'); +assert($es[1]->id=='id2'); + +$es = $dom->find('div div div'); +assert(count($es)==1); +assert($es[0]->id=='id2'); + +// ----------------------------------------------------------------------------- +// multiple selector test 2 +$str = << + + 0 + 1 + + + + + + + +
                              23
                              +HTML; +$dom->load($str); +$es = $dom->find('table td'); +assert(count($es)==4); +assert($es[0]->innertext=='0'); +assert($es[1]->innertext=='1'); +assert($es[2]->innertext=='2'); +assert($es[3]->innertext=='3'); + +// ----------------------------------------------------------------------------- +// multiple selector test 3 +$str = << + + + + + + + +
                              01
                              + + + + + + + + +
                              23
                              +HTML; +$dom = str_get_dom($str); +$es = $dom->find('table.hello td'); +assert(count($es)==4); +assert($es[0]->innertext=='0'); +assert($es[1]->innertext=='1'); +assert($es[2]->innertext=='2'); +assert($es[3]->innertext=='3'); + +// ----------------------------------------------------------------------------- +// nested selector test +$str = << +
                            • 0
                            • +
                            • 1
                            • +
                            +
                              +
                            • 2
                            • +
                            • 3
                            • +
                            +HTML; +$dom = str_get_dom($str); +$es= $dom->find('ul'); +assert(count($es)==2); + +foreach($es as $n) { + $li = $n->find('li'); + assert(count($li)==2); +} + +$es= $dom->find('li'); +assert(count($es)==4); +assert($es[0]->innertext=='0'); +assert($es[1]->innertext=='1'); +assert($es[2]->innertext=='2'); +assert($es[3]->innertext=='3'); +assert($es[0]->outertext=='
                          • 0
                          • '); +assert($es[1]->outertext=='
                          • 1
                          • '); +assert($es[2]->outertext=='
                          • 2
                          • '); +assert($es[3]->outertext=='
                          • 3
                          • '); + +$counter = 0; +foreach($dom->find('ul') as $ul) { + foreach($ul->find('li') as $li) { + assert($li->innertext=="$counter"); + assert($li->outertext=="
                          • $counter
                          • "); + ++$counter; + } +} + +// ----------------------------------------------------------------------------- +// [attribute=value] selector +$str = << + + +HTML; +$dom->load($str); + +$es = $dom->find('[name=newsletter]'); +assert(count($es)==1); +assert($es[0]->name=='newsletter'); +assert($es[0]->value=='Hot Fuzz'); +assert($es[0]->outertext==''); + +$es = $dom->find('[name="newsletter"]'); +assert(count($es)==1); +assert($es[0]->name=='newsletter'); +assert($es[0]->value=='Hot Fuzz'); +assert($es[0]->outertext==''); + +// ----------------------------------------------------------------------------- +// [attribute!=value] selector +$str = << + + +HTML; +$dom->load($str); + +$es = $dom->find('[name!=newsletter]'); +assert(count($es)==1); +assert($es[0]->name=='accept'); +assert($es[0]->value=='Evil Plans'); +assert($es[0]->outertext==''); + +$es = $dom->find('[name!="newsletter"]'); +assert(count($es)==1); +assert($es[0]->name=='accept'); +assert($es[0]->value=='Evil Plans'); +assert($es[0]->outertext==''); + +$es = $dom->find("[name!='newsletter']"); +assert(count($es)==1); +assert($es[0]->name=='accept'); +assert($es[0]->value=='Evil Plans'); +assert($es[0]->outertext==''); + +// ----------------------------------------------------------------------------- +// [attribute^=value] selector +$str = << + + +HTML; +$dom->load($str); + +$es = $dom->find('[name^=news]'); +assert(count($es)==2); +assert($es[0]->name=='newsletter'); +assert($es[0]->outertext==''); +assert($es[1]->name=='newsboy'); +assert($es[1]->outertext==''); + +$es = $dom->find('[name^="news"]'); +assert(count($es)==2); +assert($es[0]->name=='newsletter'); +assert($es[0]->outertext==''); +assert($es[1]->name=='newsboy'); +assert($es[1]->outertext==''); + +// ----------------------------------------------------------------------------- +// [attribute$=value] selector +$str = << + + +HTML; +$dom->load($str); + +$es = $dom->find('[name$=letter]'); +assert(count($es)==2); +assert($es[0]->name=='newsletter'); +assert($es[0]->outertext==''); +assert($es[1]->name=='jobletter'); +assert($es[1]->outertext==''); + +$es = $dom->find('[name$="letter"]'); +assert(count($es)==2); +assert($es[0]->name=='newsletter'); +assert($es[0]->outertext==''); +assert($es[1]->name=='jobletter'); +assert($es[1]->outertext==''); + +// ----------------------------------------------------------------------------- +// [attribute*=value] selector +$str = << + + + +
                            +
                            +
                            +HTML; +$dom->load($str); + +$es = $dom->find('[name*=man]'); +assert(count($es)==3); +assert($es[0]->name=='man-news'); +assert($es[0]->outertext==''); +assert($es[1]->name=='milkman'); +assert($es[1]->outertext==''); +assert($es[2]->name=='letterman2'); +assert($es[2]->outertext==''); + +$es = $dom->find('[name*="man"]'); +assert(count($es)==3); +assert($es[0]->name=='man-news'); +assert($es[0]->outertext==''); +assert($es[1]->name=='milkman'); +assert($es[1]->outertext==''); +assert($es[2]->name=='letterman2'); +assert($es[2]->outertext==''); + +$es = $dom->find('[class*=hello]'); +assert($es[0]->outertext=='
                            '); +assert($es[1]->outertext=='
                            '); +assert($es[2]->outertext=='
                            '); + +// ----------------------------------------------------------------------------- +// Testcase for '[]' names element +// normal checkbox +$str = << + + +HTML; +$dom->load($str); +$es = $dom->find('[name=news]'); +assert(count($es)==3); +assert($es[0]->name=='news'); +assert($es[0]->value=='foo'); +assert($es[1]->name=='news'); +assert($es[1]->value=='bar'); +assert($es[2]->name=='news'); +assert($es[2]->value=='baz'); + +// ----------------------------------------------------------------------------- +// with '[]' names checkbox +$str = << + + +HTML; +$dom->load($str); +$es = $dom->find('[name=news[]]'); +assert(count($es)==3); +assert($es[0]->name=='news[]'); +assert($es[0]->value=='foo'); +assert($es[1]->name=='news[]'); +assert($es[1]->value=='bar'); +assert($es[2]->name=='news[]'); +assert($es[2]->value=='baz'); + +// ----------------------------------------------------------------------------- +// with '[]' names checkbox 2 +$str = << + +HTML; +$dom->load($str); +$es = $dom->find('[name=news[foo]]'); +assert(count($es)==1); +assert($es[0]->name=='news[foo]'); +assert($es[0]->value=='foo'); + +// ----------------------------------------------------------------------------- +// regular expression syntax escaping +$str = << +one +two +three (text) + +HTML; +$dom->load($str); +assert(count($dom->find('a[href^="image/"]'))==2); +assert(count($dom->find('a[href*="/favorites/"]'))==1); + +// ----------------------------------------------------------------------------- +// multiple class test +$str = <<should verify +
                            should verify
                            +
                            should verify
                            +
                            should verify
                            +
                            should not verify
                            +
                            should not verify
                            +
                            should not verify
                            +HTML; + +$dom->load($str); +$es = $dom->find('[class="hello"],[class*="hello "],[class*=" hello"]'); +assert(count($es)==4); +assert($es[0]->class=='hello'); +assert($es[1]->class=='foo hello bar'); +assert($es[2]->class=='foo bar hello'); +assert($es[3]->class=='hello foo bar'); + +$es = $dom->find('.hello'); +assert(count($es)==4); +assert($es[0]->class=='hello'); +assert($es[1]->class=='foo hello bar'); +assert($es[2]->class=='foo bar hello'); +assert($es[3]->class=='hello foo bar'); + +// ----------------------------------------------------------------------------- +// multiple class test 2 +$str = << +HTML; +$dom->load($str); +assert(count($dom->find('[class=aa]'))==1); +assert(count($dom->find('[class=bb]'))==1); +assert(count($dom->find('[class="aa bb"]'))==1); +assert(count($dom->find('[class=aa], [class=bb]'))==1); + +// ----------------------------------------------------------------------------- +// multiple selector test +$str = <<aaa

                            +bbb +ccc +HTML; +$dom->load($str); + +$es = $dom->find('p,b,i'); +assert(count($es)==3); +assert($es[0]->tag=='p'); +assert($es[1]->tag=='b'); +assert($es[2]->tag=='i'); + +$es = $dom->find('p, b, i'); +assert(count($es)==3); +assert($es[0]->tag=='p'); +assert($es[1]->tag=='b'); +assert($es[2]->tag=='i'); + +$es = $dom->find('p, b , i'); +assert(count($es)==3); +assert($es[0]->tag=='p'); +assert($es[1]->tag=='b'); +assert($es[2]->tag=='i'); + +$es = $dom->find('p ,b ,i'); +assert(count($es)==3); +assert($es[0]->tag=='p'); +assert($es[1]->tag=='b'); +assert($es[2]->tag=='i'); + +$es = $dom->find('b,p,i'); +assert(count($es)==3); +assert($es[0]->tag=='p'); +assert($es[1]->tag=='b'); +assert($es[2]->tag=='i'); + +$es = $dom->find('i,b,p'); +assert(count($es)==3); +assert($es[0]->tag=='p'); +assert($es[1]->tag=='b'); +assert($es[2]->tag=='i'); + +$es = $dom->find('p,b,i,p,b'); +assert(count($es)==3); +assert($es[0]->tag=='p'); +assert($es[1]->tag=='b'); +assert($es[2]->tag=='i'); + +// ----------------------------------------------------------------------------- +// multiple selector test 2 +$str = << + +HTML; +$dom->load($str); +assert(count($dom->find('a[title], img[title]'))==2); + +// ----------------------------------------------------------------------------- +// tear down +$dom->clear(); +unset($dom); +?> \ No newline at end of file diff --git a/vendor/sunra/php-simple-html-dom-parser/Src/Sunra/PhpSimple/simplehtmldom_1_5/testcase/selector_testcase.php b/vendor/sunra/php-simple-html-dom-parser/Src/Sunra/PhpSimple/simplehtmldom_1_5/testcase/selector_testcase.php new file mode 100644 index 000000000..de7e6a4f2 --- /dev/null +++ b/vendor/sunra/php-simple-html-dom-parser/Src/Sunra/PhpSimple/simplehtmldom_1_5/testcase/selector_testcase.php @@ -0,0 +1,742 @@ + + + +HTML; +$dom->load($str); +$e = $dom->find('img'); +assert(count($e)==3); + +// ----------------------------------------------------------------------------- +// std selector test +$str = << + + + + +HTML; +$dom->load($str); + +// ----------------------------------------------- +// wildcard +assert(count($dom->find('*'))==1); +assert(count($dom->find('div *'))==3); +assert(count($dom->find('div img *'))==0); + + +assert(count($dom->find(' * '))==1); +assert(count($dom->find(' div * '))==3); +assert(count($dom->find(' div img *'))==0); + +// ----------------------------------------------- +// tag +assert(count($dom->find('img'))==3); +assert(count($dom->find('text'))==4); + +// ----------------------------------------------- +// class +$es = $dom->find('img.class0'); +assert(count($es)==1); +assert($es[0]->src=='src0'); +assert($es[0]->innertext==''); +assert($es[0]->outertext==''); + +$es = $dom->find('.class0'); +assert(count($es)==1); +assert($es[0]->src=='src0'); +assert($es[0]->innertext==''); +assert($es[0]->outertext==''); + +// ----------------------------------------------- +// index +assert($dom->find('img', 0)->src=='src0'); +assert($dom->find('img', 1)->src=='src1'); +assert($dom->find('img', 2)->src=='src2'); +assert($dom->find('img', -3)->src=='src0'); +assert($dom->find('img', -2)->src=='src1'); +assert($dom->find('img', -1)->src=='src2'); + +// ----------------------------------------------- +// id +$es = $dom->find('img#id1'); +assert(count($es)==1); +assert($es[0]->src=='src1'); +assert($es[0]->innertext==''); +assert($es[0]->outertext==''); + +$es = $dom->find('#id2'); +assert(count($es)==1); +assert($es[0]->src=='src2'); +assert($es[0]->innertext==''); +assert($es[0]->outertext==''); + +// ----------------------------------------------- +// attr +$es = $dom->find('img[src="src0"]'); +assert(count($es)==1); +assert($es[0]->src=='src0'); +assert($es[0]->innertext==''); +assert($es[0]->outertext==''); + +$es = $dom->find('img[src=src0]'); +assert(count($es)==1); +assert($es[0]->src=='src0'); +assert($es[0]->innertext==''); +assert($es[0]->outertext==''); + +// ----------------------------------------------------------------------------- +// wildcard +$es = $dom->find('*[src]'); +assert(count($es)==3); + +$es = $dom->find('*[src=*]'); +assert(count($es)==3); + +$es = $dom->find('*[alt=*]'); +assert(count($es)==0); + +$es = $dom->find('*[src="src0"]'); +assert(count($es)==1); +assert($es[0]->src=='src0'); +assert($es[0]->innertext==''); +assert($es[0]->outertext==''); + +$es = $dom->find('*[src=src0]'); +assert(count($es)==1); +assert($es[0]->src=='src0'); +assert($es[0]->innertext==''); +assert($es[0]->outertext==''); + +$es = $dom->find('[src=src0]'); +assert(count($es)==1); +assert($es[0]->src=='src0'); +assert($es[0]->innertext==''); +assert($es[0]->outertext==''); + +$es = $dom->find('[src="src0"]'); +assert(count($es)==1); +assert($es[0]->src=='src0'); +assert($es[0]->innertext==''); +assert($es[0]->outertext==''); + +$es = $dom->find('*#id1'); +assert(count($es)==1); +assert($es[0]->src=='src1'); +assert($es[0]->innertext==''); +assert($es[0]->outertext==''); + +$es = $dom->find('*.class0'); +assert(count($es)==1); +assert($es[0]->src=='src0'); +assert($es[0]->innertext==''); +assert($es[0]->outertext==''); + + +// ----------------------------------------------------------------------------- +// text +$str = <<text1text2 +HTML; +$dom->load($str); +$es = $dom->find('text'); +assert(count($es)==2); +assert($es[0]->innertext=='text1'); +assert($es[0]->outertext=='text1'); +assert($es[0]->plaintext=='text1'); +assert($es[1]->innertext=='text2'); +assert($es[1]->outertext=='text2'); +assert($es[1]->plaintext=='text2'); + +$str = <<text1text2 +HTML; +$dom->load($str); +$es = $dom->find('b text'); +assert(count($es)==2); +assert($es[0]->innertext=='text1'); +assert($es[0]->outertext=='text1'); +assert($es[0]->plaintext=='text1'); +assert($es[1]->innertext=='text2'); +assert($es[1]->outertext=='text2'); +assert($es[1]->plaintext=='text2'); + + +// ----------------------------------------------------------------------------- +// xml namespace test +$str = <<text +HTML; +$dom->load($str); +$es = $dom->find('bw:bizy'); +assert(count($es)==1); +assert($es[0]->id=='date'); + +// ----------------------------------------------------------------------------- +// user defined tag name test +$str = <<text +HTML; +$dom->load($str); +$es = $dom->find('div_test'); +assert(count($es)==1); +assert($es[0]->id=='1'); + +// ----------------------------------------------- +$str = <<text +HTML; +$dom->load($str); +$es = $dom->find('div-test'); +assert(count($es)==1); +assert($es[0]->id=='1'); + +// ----------------------------------------------- +$str = <<text +HTML; +$dom->load($str); +$es = $dom->find('div::test'); +assert(count($es)==1); +assert($es[0]->id=='1'); + +// ----------------------------------------------- +// find all occurrences of id="1" regardless of the tag +$str = << + +
                            ok
                            +HTML; +$dom->load($str); +$es = $dom->find('[id=1]'); +assert(count($es)==2); +assert($es[0]->tag=='img'); +assert($es[1]->tag=='div'); + +// ----------------------------------------------------------------------------- +// multiple selector test +$str = <<
                            ok
                            ok
                            +HTML; +$dom->load($str); + +$es = $dom->find('div'); +assert(count($es)==4); +assert($es[0]->id=='id0'); +assert($es[1]->id=='id1'); +assert($es[2]->id=='id2'); + +$es = $dom->find('div div'); +assert(count($es)==3); +assert($es[0]->id=='id1'); +assert($es[1]->id=='id2'); + +$es = $dom->find('div div div'); +assert(count($es)==2); +assert($es[0]->id=='id2'); + +$es = $dom->find('.class0 .class1 .class2'); +assert(count($es)==1); +assert($es[0]->id=='id2'); + +$es = $dom->find('#id0 #id1 #id2'); +assert(count($es)==1); +assert($es[0]->id=='id2'); + +$es = $dom->find('div[id=id0] div[id=id1] div[id=id2]'); +assert(count($es)==1); +assert($es[0]->id=='id2'); + +$es = $dom->find('div[id="id0"] div[id="id1"] div[id="id2"]'); +assert(count($es)==1); +assert($es[0]->id=='id2'); + +$es = $dom->find('div[id=id0] div[id="id1"] div[id="id2"]'); +assert(count($es)==1); +assert($es[0]->id=='id2'); + +$es = $dom->find('div[id="id0"] div[id=id1] div[id="id2"]'); +assert(count($es)==1); +assert($es[0]->id=='id2'); + +$es = $dom->find('div[id="id0"] div[id="id1"] div[id=id2]'); +assert(count($es)==1); +assert($es[0]->id=='id2'); + +$es = $dom->find("div[id='id0'] div[id='id1'] div[id='id2']"); +assert(count($es)==1); +assert($es[0]->id=='id2'); + +$es = $dom->find('[id=id0] [id=id1] [id=id2]'); +assert(count($es)==1); +assert($es[0]->id=='id2'); + +$es = $dom->find('[id] [id] [id]'); +assert(count($es)==2); +assert($es[0]->id=='id2'); +assert($es[1]->id=='id3'); + +$es = $dom->find('[id=id0] [id=id1] [id=id3]'); +assert(count($es)==1); +assert($es[0]->id=='id3'); + +$es = $dom->find('[id=id0] [id=id1] [style="st1 st2"]'); +assert(count($es)==1); +assert($es[0]->id=='id3'); + +$es = $dom->find('[id=id0] [id=id1] [style=st1 st2]'); +assert(count($es)==1); +assert($es[0]->id=='id3'); + +$es = $dom->find('[id=id0] [id=id1] [style=st1 st2] span[class=id4]'); +assert(count($es)==1); +assert($es[0]->innertext=='ok'); + +$es = $dom->find('[id=id0] [id=id1] [style="st1 st2"] span[class="id4"]'); +assert(count($es)==1); +assert($es[0]->innertext=='ok'); + +// ----------------------------------------------- +$str = << + + 0 + 1 + + + + + + + +
                            23
                            +HTML; +$dom->load($str); +$es = $dom->find('table td'); +assert(count($es)==4); +assert($es[0]->innertext=='0'); +assert($es[1]->innertext=='1'); +assert($es[2]->innertext=='2'); +assert($es[3]->innertext=='3'); + +// ----------------------------------------------------------------------------- +// multiple selector test 3 +$str = << + + + + + + + +
                            01
                            + + + + + + + + +
                            23
                            +HTML; +$dom = str_get_html($str); +$es = $dom->find('table.hello td'); +assert(count($es)==4); +assert($es[0]->innertext=='0'); +assert($es[1]->innertext=='1'); +assert($es[2]->innertext=='2'); +assert($es[3]->innertext=='3'); + +// ----------------------------------------------------------------------------- +// nested selector test +$str = << +
                          • 0
                          • +
                          • 1
                          • +
                          +
                            +
                          • 2
                          • +
                          • 3
                          • +
                          +HTML; +$dom = str_get_html($str); +$es= $dom->find('ul'); +assert(count($es)==2); +foreach($es as $n) { + $li = $n->find('li'); + assert(count($li)==2); +} + +$es= $dom->find('li'); +assert(count($es)==4); +assert($es[0]->innertext=='0'); +assert($es[1]->innertext=='1'); +assert($es[2]->innertext=='2'); +assert($es[3]->innertext=='3'); +assert($es[0]->outertext=='
                        • 0
                        • '); +assert($es[1]->outertext=='
                        • 1
                        • '); +assert($es[2]->outertext=='
                        • 2
                        • '); +assert($es[3]->outertext=='
                        • 3
                        • '); + +$counter = 0; +foreach($dom->find('ul') as $ul) { + foreach($ul->find('li') as $li) { + assert($li->innertext=="$counter"); + assert($li->outertext=="
                        • $counter
                        • "); + ++$counter; + } +} + +// ----------------------------------------------------------------------------- +// [attribute=value] selector +$str = << + + +HTML; +$dom->load($str); + +$es = $dom->find('[name=newsletter]'); +assert(count($es)==1); +assert($es[0]->name=='newsletter'); +assert($es[0]->value=='Hot Fuzz'); +assert($es[0]->outertext==''); + +$es = $dom->find('[name="newsletter"]'); +assert(count($es)==1); +assert($es[0]->name=='newsletter'); +assert($es[0]->value=='Hot Fuzz'); +assert($es[0]->outertext==''); + +// ----------------------------------------------------------------------------- +// [attribute!=value] selector +$str = << + + +HTML; +$dom->load($str); + +$es = $dom->find('[name!=newsletter]'); +assert(count($es)==1); +assert($es[0]->name=='accept'); +assert($es[0]->value=='Evil Plans'); +assert($es[0]->outertext==''); + +$es = $dom->find('[name!="newsletter"]'); +assert(count($es)==1); +assert($es[0]->name=='accept'); +assert($es[0]->value=='Evil Plans'); +assert($es[0]->outertext==''); + +$es = $dom->find("[name!='newsletter']"); +assert(count($es)==1); +assert($es[0]->name=='accept'); +assert($es[0]->value=='Evil Plans'); +assert($es[0]->outertext==''); + +// ----------------------------------------------------------------------------- +// [attribute^=value] selector +$str = << + + +HTML; +$dom->load($str); + +$es = $dom->find('[name^=news]'); +assert(count($es)==2); +assert($es[0]->name=='newsletter'); +assert($es[0]->outertext==''); +assert($es[1]->name=='newsboy'); +assert($es[1]->outertext==''); + +$es = $dom->find('[name^="news"]'); +assert(count($es)==2); +assert($es[0]->name=='newsletter'); +assert($es[0]->outertext==''); +assert($es[1]->name=='newsboy'); +assert($es[1]->outertext==''); + +// ----------------------------------------------------------------------------- +// [attribute$=value] selector +$str = << + + +HTML; +$dom->load($str); + +$es = $dom->find('[name$=letter]'); +assert(count($es)==2); +assert($es[0]->name=='newsletter'); +assert($es[0]->outertext==''); +assert($es[1]->name=='jobletter'); +assert($es[1]->outertext==''); + +$es = $dom->find('[name$="letter"]'); +assert(count($es)==2); +assert($es[0]->name=='newsletter'); +assert($es[0]->outertext==''); +assert($es[1]->name=='jobletter'); +assert($es[1]->outertext==''); + +// ----------------------------------------------------------------------------- +// [attribute*=value] selector +$str = << + + + +
                          +
                          +
                          +HTML; +$dom->load($str); + +$es = $dom->find('[name*=man]'); +assert(count($es)==3); +assert($es[0]->name=='man-news'); +assert($es[0]->outertext==''); +assert($es[1]->name=='milkman'); +assert($es[1]->outertext==''); +assert($es[2]->name=='letterman2'); +assert($es[2]->outertext==''); + +$es = $dom->find('[name*="man"]'); +assert(count($es)==3); +assert($es[0]->name=='man-news'); +assert($es[0]->outertext==''); +assert($es[1]->name=='milkman'); +assert($es[1]->outertext==''); +assert($es[2]->name=='letterman2'); +assert($es[2]->outertext==''); + +$es = $dom->find('[class*=hello]'); +assert($es[0]->outertext=='
                          '); +assert($es[1]->outertext=='
                          '); +assert($es[2]->outertext=='
                          '); + +// ----------------------------------------------------------------------------- +// Testcase for '[]' names element +// normal checkbox +$str = << + + +HTML; +$dom->load($str); +$es = $dom->find('[name=news]'); +assert(count($es)==3); +assert($es[0]->name=='news'); +assert($es[0]->value=='foo'); +assert($es[1]->name=='news'); +assert($es[1]->value=='bar'); +assert($es[2]->name=='news'); +assert($es[2]->value=='baz'); + +// ----------------------------------------------------------------------------- +// with '[]' names checkbox +$str = << + + +HTML; +$dom->load($str); +$es = $dom->find('[name=news[]]'); +assert(count($es)==3); +assert($es[0]->name=='news[]'); +assert($es[0]->value=='foo'); +assert($es[1]->name=='news[]'); +assert($es[1]->value=='bar'); +assert($es[2]->name=='news[]'); +assert($es[2]->value=='baz'); + +// ----------------------------------------------------------------------------- +// with '[]' names checkbox 2 +$str = << + +HTML; +$dom->load($str); +$es = $dom->find('[name=news[foo]]'); +assert(count($es)==1); +assert($es[0]->name=='news[foo]'); +assert($es[0]->value=='foo'); + +// ----------------------------------------------------------------------------- +// with '[]' names 3 +$str = << + + +HTML; +$dom->load($str); +$es = $dom->find('div[name=div[]] input[name=checkbox[]]'); +assert(count($es)==1); +assert($es[0]->value=='foo'); + +// ----------------------------------------------------------------------------- +// regular expression +$str = << +one +two +three (text) + +HTML; +$dom->load($str); +assert(count($dom->find('a[href^="image/"]'))==2); +assert(count($dom->find('a[href*="/favorites/"]'))==1); + +$str = << + +
                          okok
                          + + +HTML; +$dom->load($str); +assert(count($dom->find('div[id*=news-id-[0-9]+]'))==1); +assert(count($dom->find('div[id*=/news-id-[0-9]+/i]'))==1); + +// ----------------------------------------------------------------------------- +// multiple class test +$str = <<should verify +
                          should verify
                          +
                          should verify
                          +
                          should verify
                          +
                          should not verify
                          +
                          should not verify
                          +
                          should not verify
                          +HTML; + +$dom->load($str); +$es = $dom->find('[class="hello"],[class*="hello "],[class*=" hello"]'); +assert(count($es)==4); +assert($es[0]->class=='hello'); +assert($es[1]->class=='foo hello bar'); +assert($es[2]->class=='foo bar hello'); +assert($es[3]->class=='hello foo bar'); + +$es = $dom->find('.hello'); +assert(count($es)==4); +assert($es[0]->class=='hello'); +assert($es[1]->class=='foo hello bar'); +assert($es[2]->class=='foo bar hello'); +assert($es[3]->class=='hello foo bar'); + +// ----------------------------------------------- +$str = << +HTML; +$dom->load($str); +assert(count($dom->find('[class=aa]'))==1); +assert(count($dom->find('[class=bb]'))==1); +assert(count($dom->find('[class="aa bb"]'))==1); +assert(count($dom->find('[class=aa], [class=bb]'))==1); + +// ----------------------------------------------------------------------------- +// multiple selector test +$str = <<aaa

                          +bbb +ccc +HTML; +$dom->load($str); + +$es = $dom->find('p,b,i'); +assert(count($es)==3); +assert($es[0]->tag=='p'); +assert($es[1]->tag=='b'); +assert($es[2]->tag=='i'); + +$es = $dom->find('p, b, i'); +assert(count($es)==3); +assert($es[0]->tag=='p'); +assert($es[1]->tag=='b'); +assert($es[2]->tag=='i'); + +$es = $dom->find('p, b , i'); +assert(count($es)==3); +assert($es[0]->tag=='p'); +assert($es[1]->tag=='b'); +assert($es[2]->tag=='i'); + +$es = $dom->find('p ,b ,i'); +assert(count($es)==3); +assert($es[0]->tag=='p'); +assert($es[1]->tag=='b'); +assert($es[2]->tag=='i'); + +$es = $dom->find('b,p,i'); +assert(count($es)==3); +assert($es[0]->tag=='p'); +assert($es[1]->tag=='b'); +assert($es[2]->tag=='i'); + +$es = $dom->find('i,b,p'); +assert(count($es)==3); +assert($es[0]->tag=='p'); +assert($es[1]->tag=='b'); +assert($es[2]->tag=='i'); + +$es = $dom->find('p,b,i,p,b'); +assert(count($es)==3); +assert($es[0]->tag=='p'); +assert($es[1]->tag=='b'); +assert($es[2]->tag=='i'); + +// ----------------------------------------------- +$str = << + +HTML; +$dom->load($str); +assert(count($dom->find('a[title], img[title]'))==2); + +// ----------------------------------------------------------------------------- +// elements that do NOT have the specified attribute +$str = << + +HTML; +$dom->load($str); +assert(count($dom->find('img[!id]'))==1); + +// ----------------------------------------------------------------------------- +//js test +$str = <<foo +HTML; +$dom->load($str); +assert($dom->find('a[onMouseover="dropdownmenu(this, event, \'messagesmenu\')"]',0)->innertext=='foo'); +assert($dom->find("a[onMouseover=dropdownmenu(this, event, 'messagesmenu')]",0)->innertext=='foo'); + +// ----------------------------------------------------------------------------- +//dash test +$str = ''; + +$dom->load($str); +assert($dom->find('meta[http-equiv=content-type]', 0)->content==='text/html; charset=utf-8'); + +// ----------------------------------------------------------------------------- +// tear down +$dom->clear(); +unset($dom); +?> \ No newline at end of file diff --git a/vendor/sunra/php-simple-html-dom-parser/Src/Sunra/PhpSimple/simplehtmldom_1_5/testcase/slick_test.php b/vendor/sunra/php-simple-html-dom-parser/Src/Sunra/PhpSimple/simplehtmldom_1_5/testcase/slick_test.php new file mode 100644 index 000000000..b3f23310b --- /dev/null +++ b/vendor/sunra/php-simple-html-dom-parser/Src/Sunra/PhpSimple/simplehtmldom_1_5/testcase/slick_test.php @@ -0,0 +1,27 @@ +
                          '; + +assert(count($html->find('#title'))==1); +assert(count($html->find('div'))==51); +assert(count($html->find('div[class]'))==51); +assert(count($html->find('div.example'))==43); +assert(count($html->find('div[class=example]'))==43); +assert(count($html->find('.note'))==14); + +assert(count($html->find('div[class^=exa]'))==43); +assert(count($html->find('div[class$=mple]'))==43); +assert(count($html->find('div[class*=e]'))==50); +assert(count($html->find('div[class!=made_up]'))==51); + +assert(count($html->find('p'))==324); + +echo 'All pass!
                          '; +?> \ No newline at end of file diff --git a/vendor/sunra/php-simple-html-dom-parser/Src/Sunra/PhpSimple/simplehtmldom_1_5/testcase/slickspeed.htm b/vendor/sunra/php-simple-html-dom-parser/Src/Sunra/PhpSimple/simplehtmldom_1_5/testcase/slickspeed.htm new file mode 100644 index 000000000..c7d96b9d7 --- /dev/null +++ b/vendor/sunra/php-simple-html-dom-parser/Src/Sunra/PhpSimple/simplehtmldom_1_5/testcase/slickspeed.htm @@ -0,0 +1,2888 @@ + + + + Selectors + + + + + + +
                          +

                          W3C + +

                          Selectors

                          + +

                          W3C Working Draft 15 December 2005

                          + +
                          + +
                          This version: + +
                          + http://www.w3.org/TR/2005/WD-css3-selectors-20051215 + +
                          Latest version: + +
                          + http://www.w3.org/TR/css3-selectors + +
                          Previous version: + +
                          + http://www.w3.org/TR/2001/CR-css3-selectors-20011113 + +
                          Editors: + +
                          Daniel Glazman (Invited Expert)
                          + +
                          Tantek Çelik (Invited Expert) + +
                          Ian Hickson (Google) + +
                          Peter Linss (former editor, Netscape/AOL) + +
                          John Williams (former editor, Quark, Inc.) + +
                          + +
                          + +
                          + +

                          Abstract

                          + +

                          Selectors are patterns that match against elements in a + tree. Selectors have been optimized for use with HTML and XML, and + are designed to be usable in performance-critical code.

                          + +

                          CSS (Cascading + Style Sheets) is a language for describing the rendering of HTML and XML documents on + screen, on paper, in speech, etc. CSS uses Selectors for binding + style properties to elements in the document. This document + describes extensions to the selectors defined in CSS level 2. These + extended selectors will be used by CSS level 3. + +

                          Selectors define the following function:

                          + +
                          expression ∗ element → boolean
                          + +

                          That is, given an element and a selector, this specification + defines whether that element matches the selector.

                          + +

                          These expressions can also be used, for instance, to select a set + of elements, or a single element from a set of elements, by + evaluating the expression across all the elements in a + subtree. STTS (Simple Tree Transformation Sheets), a + language for transforming XML trees, uses this mechanism. [STTS]

                          + +

                          Status of this document

                          + +

                          This section describes the status of this document at the + time of its publication. Other documents may supersede this + document. A list of current W3C publications and the latest revision + of this technical report can be found in the W3C technical reports index at + http://www.w3.org/TR/.

                          + +

                          This document describes the selectors that already exist in CSS1 and CSS2, and + also proposes new selectors for CSS3 and other languages that may need them.

                          + +

                          The CSS Working Group doesn't expect that all implementations of + CSS3 will have to implement all selectors. Instead, there will + probably be a small number of variants of CSS3, called profiles. For + example, it may be that only a profile for interactive user agents + will include all of the selectors.

                          + +

                          This specification is a last call working draft for the the CSS Working Group + (Style Activity). This + document is a revision of the Candidate + Recommendation dated 2001 November 13, and has incorporated + implementation feedback received in the past few years. It is + expected that this last call will proceed straight to Proposed + Recommendation stage since it is believed that interoperability will + be demonstrable.

                          + +

                          All persons are encouraged to review and implement this + specification and return comments to the (archived) + public mailing list www-style + (see instructions). W3C + Members can also send comments directly to the CSS Working + Group. + The deadline for comments is 14 January 2006.

                          + +

                          This is still a draft document and may be updated, replaced, or + obsoleted by other documents at any time. It is inappropriate to + cite a W3C Working Draft as other than "work in progress". + +

                          This document may be available in translation. + The English version of this specification is the only normative + version. + +

                          + +

                          Table of contents

                          + + + +
                          + +

                          1. Introduction

                          + +

                          1.1. Dependencies

                          + +

                          Some features of this specification are specific to CSS, or have + particular limitations or rules specific to CSS. In this + specification, these have been described in terms of CSS2.1. [CSS21]

                          + +

                          1.2. Terminology

                          + +

                          All of the text of this specification is normative except + examples, notes, and sections explicitly marked as + non-normative.

                          + +

                          1.3. Changes from CSS2

                          + +

                          This section is non-normative.

                          + +

                          The main differences between the selectors in CSS2 and those in + Selectors are: + +

                            + +
                          • the list of basic definitions (selector, group of selectors, + simple selector, etc.) has been changed; in particular, what was + referred to in CSS2 as a simple selector is now called a sequence + of simple selectors, and the term "simple selector" is now used for + the components of this sequence
                          • + +
                          • an optional namespace component is now allowed in type element + selectors, the universal selector and attribute selectors
                          • + +
                          • a new combinator has been introduced
                          • + +
                          • new simple selectors including substring matching attribute + selectors, and new pseudo-classes
                          • + +
                          • new pseudo-elements, and introduction of the "::" convention + for pseudo-elements
                          • + +
                          • the grammar has been rewritten
                          • + +
                          • profiles to be added to specifications integrating Selectors + and defining the set of selectors which is actually supported by + each specification
                          • + +
                          • Selectors are now a CSS3 Module and an independent + specification; other specifications can now refer to this document + independently of CSS
                          • + +
                          • the specification now has its own test suite
                          • + +
                          + +

                          2. Selectors

                          + +

                          This section is non-normative, as it merely summarizes the +following sections.

                          + +

                          A Selector represents a structure. This structure can be used as a +condition (e.g. in a CSS rule) that determines which elements a +selector matches in the document tree, or as a flat description of the +HTML or XML fragment corresponding to that structure.

                          + +

                          Selectors may range from simple element names to rich contextual +representations.

                          + +

                          The following table summarizes the Selector syntax:

                          + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
                          PatternMeaningDescribed in sectionFirst defined in CSS level
                          *any elementUniversal + selector2
                          Ean element of type EType selector1
                          E[foo]an E element with a "foo" attributeAttribute + selectors2
                          E[foo="bar"]an E element whose "foo" attribute value is exactly + equal to "bar"Attribute + selectors2
                          E[foo~="bar"]an E element whose "foo" attribute value is a list of + space-separated values, one of which is exactly equal to "bar"Attribute + selectors2
                          E[foo^="bar"]an E element whose "foo" attribute value begins exactly + with the string "bar"Attribute + selectors3
                          E[foo$="bar"]an E element whose "foo" attribute value ends exactly + with the string "bar"Attribute + selectors3
                          E[foo*="bar"]an E element whose "foo" attribute value contains the + substring "bar"Attribute + selectors3
                          E[hreflang|="en"]an E element whose "hreflang" attribute has a hyphen-separated + list of values beginning (from the left) with "en"Attribute + selectors2
                          E:rootan E element, root of the documentStructural + pseudo-classes3
                          E:nth-child(n)an E element, the n-th child of its parentStructural + pseudo-classes3
                          E:nth-last-child(n)an E element, the n-th child of its parent, counting + from the last oneStructural + pseudo-classes3
                          E:nth-of-type(n)an E element, the n-th sibling of its typeStructural + pseudo-classes3
                          E:nth-last-of-type(n)an E element, the n-th sibling of its type, counting + from the last oneStructural + pseudo-classes3
                          E:first-childan E element, first child of its parentStructural + pseudo-classes2
                          E:last-childan E element, last child of its parentStructural + pseudo-classes3
                          E:first-of-typean E element, first sibling of its typeStructural + pseudo-classes3
                          E:last-of-typean E element, last sibling of its typeStructural + pseudo-classes3
                          E:only-childan E element, only child of its parentStructural + pseudo-classes3
                          E:only-of-typean E element, only sibling of its typeStructural + pseudo-classes3
                          E:emptyan E element that has no children (including text + nodes)Structural + pseudo-classes3
                          E:link
                          E:visited
                          an E element being the source anchor of a hyperlink of + which the target is not yet visited (:link) or already visited + (:visited)The link + pseudo-classes1
                          E:active
                          E:hover
                          E:focus
                          an E element during certain user actionsThe user + action pseudo-classes1 and 2
                          E:targetan E element being the target of the referring URIThe target + pseudo-class3
                          E:lang(fr)an element of type E in language "fr" (the document + language specifies how language is determined)The :lang() + pseudo-class2
                          E:enabled
                          E:disabled
                          a user interface element E which is enabled or + disabledThe UI element states + pseudo-classes3
                          E:checkeda user interface element E which is checked (for instance a radio-button or checkbox)The UI element states + pseudo-classes3
                          E::first-linethe first formatted line of an E elementThe ::first-line + pseudo-element1
                          E::first-letterthe first formatted letter of an E elementThe ::first-letter + pseudo-element1
                          E::selectionthe portion of an E element that is currently + selected/highlighted by the userThe UI element + fragments pseudo-elements3
                          E::beforegenerated content before an E elementThe ::before + pseudo-element2
                          E::aftergenerated content after an E elementThe ::after + pseudo-element2
                          E.warningan E element whose class is +"warning" (the document language specifies how class is determined).Class + selectors1
                          E#myidan E element with ID equal to "myid".ID + selectors1
                          E:not(s)an E element that does not match simple selector sNegation + pseudo-class3
                          E Fan F element descendant of an E elementDescendant + combinator1
                          E > Fan F element child of an E elementChild + combinator2
                          E + Fan F element immediately preceded by an E elementAdjacent sibling combinator2
                          E ~ Fan F element preceded by an E elementGeneral sibling combinator3
                          + +

                          The meaning of each selector is derived from the table above by +prepending "matches" to the contents of each cell in the "Meaning" +column.

                          + +

                          3. Case sensitivity

                          + +

                          The case sensitivity of document language element names, attribute +names, and attribute values in selectors depends on the document +language. For example, in HTML, element names are case-insensitive, +but in XML, they are case-sensitive.

                          + +

                          4. Selector syntax

                          + +

                          A selector is a chain of one +or more sequences of simple selectors +separated by combinators.

                          + +

                          A sequence of simple selectors +is a chain of simple selectors +that are not separated by a combinator. It +always begins with a type selector or a +universal selector. No other type +selector or universal selector is allowed in the sequence.

                          + +

                          A simple selector is either a type selector, universal selector, attribute selector, class selector, ID selector, content selector, or pseudo-class. One pseudo-element may be appended to the last +sequence of simple selectors.

                          + +

                          Combinators are: white space, "greater-than +sign" (U+003E, >), "plus sign" (U+002B, ++) and "tilde" (U+007E, ~). White +space may appear between a combinator and the simple selectors around +it. Only the characters "space" (U+0020), "tab" +(U+0009), "line feed" (U+000A), "carriage return" (U+000D), and "form +feed" (U+000C) can occur in white space. Other space-like characters, +such as "em-space" (U+2003) and "ideographic space" (U+3000), are +never part of white space.

                          + +

                          The elements of a document tree that are represented by a selector +are the subjects of the selector. A +selector consisting of a single sequence of simple selectors +represents any element satisfying its requirements. Prepending another +sequence of simple selectors and a combinator to a sequence imposes +additional matching constraints, so the subjects of a selector are +always a subset of the elements represented by the last sequence of +simple selectors.

                          + +

                          An empty selector, containing no sequence of simple selectors and +no pseudo-element, is an invalid +selector.

                          + +

                          5. Groups of selectors

                          + +

                          When several selectors share the same declarations, they may be +grouped into a comma-separated list. (A comma is U+002C.)

                          + +
                          +

                          CSS examples:

                          +

                          In this example, we condense three rules with identical +declarations into one. Thus,

                          +
                          h1 { font-family: sans-serif }
                          +h2 { font-family: sans-serif }
                          +h3 { font-family: sans-serif }
                          +

                          is equivalent to:

                          +
                          h1, h2, h3 { font-family: sans-serif }
                          +
                          + +

                          Warning: the equivalence is true in this example +because all the selectors are valid selectors. If just one of these +selectors were invalid, the entire group of selectors would be +invalid. This would invalidate the rule for all three heading +elements, whereas in the former case only one of the three individual +heading rules would be invalidated.

                          + + +

                          6. Simple selectors

                          + +

                          6.1. Type selector

                          + +

                          A type selector is the name of a document language +element type. A type selector represents an instance of the element +type in the document tree.

                          + +
                          +

                          Example:

                          +

                          The following selector represents an h1 element in the document tree:

                          +
                          h1
                          +
                          + + +

                          6.1.1. Type selectors and namespaces

                          + +

                          Type selectors allow an optional namespace ([XMLNAMES]) component. A namespace prefix +that has been previously declared may be prepended to the element name +separated by the namespace separator "vertical bar" +(U+007C, |).

                          + +

                          The namespace component may be left empty to indicate that the +selector is only to represent elements with no declared namespace.

                          + +

                          An asterisk may be used for the namespace prefix, indicating that +the selector represents elements in any namespace (including elements +with no namespace).

                          + +

                          Element type selectors that have no namespace component (no +namespace separator), represent elements without regard to the +element's namespace (equivalent to "*|") unless a default +namespace has been declared. If a default namespace has been declared, +the selector will represent only elements in the default +namespace.

                          + +

                          A type selector containing a namespace prefix that has not been +previously declared is an invalid selector. +The mechanism for declaring a namespace prefix is left up to the +language implementing Selectors. In CSS, such a mechanism is defined +in the General Syntax module.

                          + +

                          In a namespace-aware client, element type selectors will only match +against the local part +of the element's qualified +name. See below for notes about matching +behaviors in down-level clients.

                          + +

                          In summary:

                          + +
                          +
                          ns|E
                          +
                          elements with name E in namespace ns
                          +
                          *|E
                          +
                          elements with name E in any namespace, including those without any + declared namespace
                          +
                          |E
                          +
                          elements with name E without any declared namespace
                          +
                          E
                          +
                          if no default namespace has been specified, this is equivalent to *|E. + Otherwise it is equivalent to ns|E where ns is the default namespace.
                          +
                          + +
                          +

                          CSS examples:

                          + +
                          @namespace foo url(http://www.example.com);
                          + foo|h1 { color: blue }
                          + foo|* { color: yellow }
                          + |h1 { color: red }
                          + *|h1 { color: green }
                          + h1 { color: green }
                          + +

                          The first rule will match only h1 elements in the + "http://www.example.com" namespace.

                          + +

                          The second rule will match all elements in the + "http://www.example.com" namespace.

                          + +

                          The third rule will match only h1 elements without + any declared namespace.

                          + +

                          The fourth rule will match h1 elements in any + namespace (including those without any declared namespace).

                          + +

                          The last rule is equivalent to the fourth rule because no default + namespace has been defined.

                          + +
                          + +

                          6.2. Universal selector

                          + +

                          The universal selector, written "asterisk" +(*), represents the qualified name of any element +type. It represents any single element in the document tree in any +namespace (including those without any declared namespace) if no +default namespace has been specified. If a default namespace has been +specified, see Universal selector and +Namespaces below.

                          + +

                          If the universal selector is not the only component of a sequence +of simple selectors, the * may be omitted.

                          + +
                          +

                          Examples:

                          +
                            +
                          • *[hreflang|=en] and [hreflang|=en] are equivalent,
                          • +
                          • *.warning and .warning are equivalent,
                          • +
                          • *#myid and #myid are equivalent.
                          • +
                          +
                          + +

                          Note: it is recommended that the +*, representing the universal selector, not be +omitted.

                          + +

                          6.2.1. Universal selector and namespaces

                          + +

                          The universal selector allows an optional namespace component. It +is used as follows:

                          + +
                          +
                          ns|*
                          +
                          all elements in namespace ns
                          +
                          *|*
                          +
                          all elements
                          +
                          |*
                          +
                          all elements without any declared namespace
                          +
                          *
                          +
                          if no default namespace has been specified, this is equivalent to *|*. + Otherwise it is equivalent to ns|* where ns is the default namespace.
                          +
                          + +

                          A universal selector containing a namespace prefix that has not +been previously declared is an invalid +selector. The mechanism for declaring a namespace prefix is left up +to the language implementing Selectors. In CSS, such a mechanism is +defined in the General Syntax module.

                          + + +

                          6.3. Attribute selectors

                          + +

                          Selectors allow the representation of an element's attributes. When +a selector is used as an expression to match against an element, +attribute selectors must be considered to match an element if that +element has an attribute that matches the attribute represented by the +attribute selector.

                          + +

                          6.3.1. Attribute presence and values +selectors

                          + +

                          CSS2 introduced four attribute selectors:

                          + +
                          +
                          [att] +
                          Represents an element with the att attribute, whatever the value of + the attribute.
                          +
                          [att=val]
                          +
                          Represents an element with the att attribute whose value is exactly + "val".
                          +
                          [att~=val]
                          +
                          Represents an element with the att attribute whose value is a whitespace-separated list of words, one of + which is exactly "val". If "val" contains whitespace, it will never + represent anything (since the words are separated by + spaces).
                          +
                          [att|=val] +
                          Represents an element with the att attribute, its value either + being exactly "val" or beginning with "val" immediately followed by + "-" (U+002D). This is primarily intended to allow language subcode + matches (e.g., the hreflang attribute on the + link element in HTML) as described in RFC 3066 ([RFC3066]). For lang (or + xml:lang) language subcode matching, please see the :lang pseudo-class.
                          +
                          + +

                          Attribute values must be identifiers or strings. The +case-sensitivity of attribute names and values in selectors depends on +the document language.

                          + +
                          + +

                          Examples:

                          + +

                          The following attribute selector represents an h1 + element that carries the title attribute, whatever its + value:

                          + +
                          h1[title]
                          + +

                          In the following example, the selector represents a + span element whose class attribute has + exactly the value "example":

                          + +
                          span[class="example"]
                          + +

                          Multiple attribute selectors can be used to represent several + attributes of an element, or several conditions on the same + attribute. Here, the selector represents a span element + whose hello attribute has exactly the value "Cleveland" + and whose goodbye attribute has exactly the value + "Columbus":

                          + +
                          span[hello="Cleveland"][goodbye="Columbus"]
                          + +

                          The following selectors illustrate the differences between "=" + and "~=". The first selector will represent, for example, the value + "copyright copyleft copyeditor" on a rel attribute. The + second selector will only represent an a element with + an href attribute having the exact value + "http://www.w3.org/".

                          + +
                          a[rel~="copyright"]
                          +a[href="http://www.w3.org/"]
                          + +

                          The following selector represents a link element + whose hreflang attribute is exactly "fr".

                          + +
                          link[hreflang=fr]
                          + +

                          The following selector represents a link element for + which the values of the hreflang attribute begins with + "en", including "en", "en-US", and "en-cockney":

                          + +
                          link[hreflang|="en"]
                          + +

                          Similarly, the following selectors represents a + DIALOGUE element whenever it has one of two different + values for an attribute character:

                          + +
                          DIALOGUE[character=romeo]
                          +DIALOGUE[character=juliet]
                          + +
                          + +

                          6.3.2. Substring matching attribute +selectors

                          + +

                          Three additional attribute selectors are provided for matching +substrings in the value of an attribute:

                          + +
                          +
                          [att^=val]
                          +
                          Represents an element with the att attribute whose value begins + with the prefix "val".
                          +
                          [att$=val] +
                          Represents an element with the att attribute whose value ends with + the suffix "val".
                          +
                          [att*=val] +
                          Represents an element with the att attribute whose value contains + at least one instance of the substring "val".
                          +
                          + +

                          Attribute values must be identifiers or strings. The +case-sensitivity of attribute names in selectors depends on the +document language.

                          + +
                          +

                          Examples:

                          +

                          The following selector represents an HTML object, referencing an + image:

                          +
                          object[type^="image/"]
                          +

                          The following selector represents an HTML anchor a with an + href attribute whose value ends with ".html".

                          +
                          a[href$=".html"]
                          +

                          The following selector represents an HTML paragraph with a title + attribute whose value contains the substring "hello"

                          +
                          p[title*="hello"]
                          +
                          + +

                          6.3.3. Attribute selectors and namespaces

                          + +

                          Attribute selectors allow an optional namespace component to the +attribute name. A namespace prefix that has been previously declared +may be prepended to the attribute name separated by the namespace +separator "vertical bar" (|). In keeping with +the Namespaces in the XML recommendation, default namespaces do not +apply to attributes, therefore attribute selectors without a namespace +component apply only to attributes that have no declared namespace +(equivalent to "|attr"). An asterisk may be used for the +namespace prefix indicating that the selector is to match all +attribute names without regard to the attribute's namespace. + +

                          An attribute selector with an attribute name containing a namespace +prefix that has not been previously declared is an invalid selector. The mechanism for declaring +a namespace prefix is left up to the language implementing Selectors. +In CSS, such a mechanism is defined in the General Syntax module. + +

                          +

                          CSS examples:

                          +
                          @namespace foo "http://www.example.com";
                          +[foo|att=val] { color: blue }
                          +[*|att] { color: yellow }
                          +[|att] { color: green }
                          +[att] { color: green }
                          + +

                          The first rule will match only elements with the attribute + att in the "http://www.example.com" namespace with the + value "val".

                          + +

                          The second rule will match only elements with the attribute + att regardless of the namespace of the attribute + (including no declared namespace).

                          + +

                          The last two rules are equivalent and will match only elements + with the attribute att where the attribute is not + declared to be in a namespace.

                          + +
                          + +

                          6.3.4. Default attribute values in DTDs

                          + +

                          Attribute selectors represent explicitly set attribute values in +the document tree. Default attribute values may be defined in a DTD or +elsewhere, but cannot always be selected by attribute +selectors. Selectors should be designed so that they work even if the +default values are not included in the document tree.

                          + +

                          More precisely, a UA is not required to read an "external +subset" of the DTD but is required to look for default +attribute values in the document's "internal subset." (See [XML10] for definitions of these subsets.)

                          + +

                          A UA that recognizes an XML namespace [XMLNAMES] is not required to use its +knowledge of that namespace to treat default attribute values as if +they were present in the document. (For example, an XHTML UA is not +required to use its built-in knowledge of the XHTML DTD.)

                          + +

                          Note: Typically, implementations +choose to ignore external subsets.

                          + +
                          +

                          Example:

                          + +

                          Consider an element EXAMPLE with an attribute "notation" that has a +default value of "decimal". The DTD fragment might be

                          + +
                          <!ATTLIST EXAMPLE notation (decimal,octal) "decimal">
                          + +

                          If the style sheet contains the rules

                          + +
                          EXAMPLE[notation=decimal] { /*... default property settings ...*/ }
                          +EXAMPLE[notation=octal]   { /*... other settings...*/ }
                          + +

                          the first rule will not match elements whose "notation" attribute +is set by default, i.e. not set explicitly. To catch all cases, the +attribute selector for the default value must be dropped:

                          + +
                          EXAMPLE                   { /*... default property settings ...*/ }
                          +EXAMPLE[notation=octal]   { /*... other settings...*/ }
                          + +

                          Here, because the selector EXAMPLE[notation=octal] is +more specific than the tag +selector alone, the style declarations in the second rule will override +those in the first for elements that have a "notation" attribute value +of "octal". Care has to be taken that all property declarations that +are to apply only to the default case are overridden in the non-default +cases' style rules.

                          + +
                          + +

                          6.4. Class selectors

                          + +

                          Working with HTML, authors may use the period (U+002E, +.) notation as an alternative to the ~= +notation when representing the class attribute. Thus, for +HTML, div.value and div[class~=value] have +the same meaning. The attribute value must immediately follow the +"period" (.).

                          + +

                          UAs may apply selectors using the period (.) notation in XML +documents if the UA has namespace-specific knowledge that allows it to +determine which attribute is the "class" attribute for the +respective namespace. One such example of namespace-specific knowledge +is the prose in the specification for a particular namespace (e.g. SVG +1.0 [SVG] describes the SVG +"class" attribute and how a UA should interpret it, and +similarly MathML 1.01 [MATH] describes the MathML +"class" attribute.)

                          + +
                          +

                          CSS examples:

                          + +

                          We can assign style information to all elements with + class~="pastoral" as follows:

                          + +
                          *.pastoral { color: green }  /* all elements with class~=pastoral */
                          + +

                          or just

                          + +
                          .pastoral { color: green }  /* all elements with class~=pastoral */
                          + +

                          The following assigns style only to H1 elements with + class~="pastoral":

                          + +
                          H1.pastoral { color: green }  /* H1 elements with class~=pastoral */
                          + +

                          Given these rules, the first H1 instance below would not have + green text, while the second would:

                          + +
                          <H1>Not green</H1>
                          +<H1 class="pastoral">Very green</H1>
                          + +
                          + +

                          To represent a subset of "class" values, each value must be preceded +by a ".", in any order.

                          + +
                          + +

                          CSS example:

                          + +

                          The following rule matches any P element whose "class" attribute + has been assigned a list of whitespace-separated values that includes + "pastoral" and "marine":

                          + +
                          p.pastoral.marine { color: green }
                          + +

                          This rule matches when class="pastoral blue aqua + marine" but does not match for class="pastoral + blue".

                          + +
                          + +

                          Note: Because CSS gives considerable +power to the "class" attribute, authors could conceivably design their +own "document language" based on elements with almost no associated +presentation (such as DIV and SPAN in HTML) and assigning style +information through the "class" attribute. Authors should avoid this +practice since the structural elements of a document language often +have recognized and accepted meanings and author-defined classes may +not.

                          + +

                          Note: If an element has multiple +class attributes, their values must be concatenated with spaces +between the values before searching for the class. As of this time the +working group is not aware of any manner in which this situation can +be reached, however, so this behavior is explicitly non-normative in +this specification.

                          + +

                          6.5. ID selectors

                          + +

                          Document languages may contain attributes that are declared to be +of type ID. What makes attributes of type ID special is that no two +such attributes can have the same value in a document, regardless of +the type of the elements that carry them; whatever the document +language, an ID typed attribute can be used to uniquely identify its +element. In HTML all ID attributes are named "id"; XML applications +may name ID attributes differently, but the same restriction +applies.

                          + +

                          An ID-typed attribute of a document language allows authors to +assign an identifier to one element instance in the document tree. W3C +ID selectors represent an element instance based on its identifier. An +ID selector contains a "number sign" (U+0023, +#) immediately followed by the ID value, which must be an +identifier.

                          + +

                          Selectors does not specify how a UA knows the ID-typed attribute of +an element. The UA may, e.g., read a document's DTD, have the +information hard-coded or ask the user. + +

                          +

                          Examples:

                          +

                          The following ID selector represents an h1 element + whose ID-typed attribute has the value "chapter1":

                          +
                          h1#chapter1
                          +

                          The following ID selector represents any element whose ID-typed + attribute has the value "chapter1":

                          +
                          #chapter1
                          +

                          The following selector represents any element whose ID-typed + attribute has the value "z98y".

                          +
                          *#z98y
                          +
                          + +

                          Note. In XML 1.0 [XML10], the information about which attribute +contains an element's IDs is contained in a DTD or a schema. When +parsing XML, UAs do not always read the DTD, and thus may not know +what the ID of an element is (though a UA may have namespace-specific +knowledge that allows it to determine which attribute is the ID +attribute for that namespace). If a style sheet designer knows or +suspects that a UA may not know what the ID of an element is, he +should use normal attribute selectors instead: +[name=p371] instead of #p371. Elements in +XML 1.0 documents without a DTD do not have IDs at all.

                          + +

                          If an element has multiple ID attributes, all of them must be +treated as IDs for that element for the purposes of the ID +selector. Such a situation could be reached using mixtures of xml:id, +DOM3 Core, XML DTDs, and namespace-specific knowledge.

                          + +

                          6.6. Pseudo-classes

                          + +

                          The pseudo-class concept is introduced to permit selection based on +information that lies outside of the document tree or that cannot be +expressed using the other simple selectors.

                          + +

                          A pseudo-class always consists of a "colon" +(:) followed by the name of the pseudo-class and +optionally by a value between parentheses.

                          + +

                          Pseudo-classes are allowed in all sequences of simple selectors +contained in a selector. Pseudo-classes are allowed anywhere in +sequences of simple selectors, after the leading type selector or +universal selector (possibly omitted). Pseudo-class names are +case-insensitive. Some pseudo-classes are mutually exclusive, while +others can be applied simultaneously to the same +element. Pseudo-classes may be dynamic, in the sense that an element +may acquire or lose a pseudo-class while a user interacts with the +document.

                          + + +

                          6.6.1. Dynamic pseudo-classes

                          + +

                          Dynamic pseudo-classes classify elements on characteristics other +than their name, attributes, or content, in principle characteristics +that cannot be deduced from the document tree.

                          + +

                          Dynamic pseudo-classes do not appear in the document source or +document tree.

                          + + +
                          The link pseudo-classes: :link and :visited
                          + +

                          User agents commonly display unvisited links differently from +previously visited ones. Selectors +provides the pseudo-classes :link and +:visited to distinguish them:

                          + +
                            +
                          • The :link pseudo-class applies to links that have + not yet been visited.
                          • +
                          • The :visited pseudo-class applies once the link has + been visited by the user.
                          • +
                          + +

                          After some amount of time, user agents may choose to return a +visited link to the (unvisited) ':link' state.

                          + +

                          The two states are mutually exclusive.

                          + +
                          + +

                          Example:

                          + +

                          The following selector represents links carrying class + external and already visited:

                          + +
                          a.external:visited
                          + +
                          + +

                          Note: It is possible for style sheet +authors to abuse the :link and :visited pseudo-classes to determine +which sites a user has visited without the user's consent. + +

                          UAs may therefore treat all links as unvisited links, or implement +other measures to preserve the user's privacy while rendering visited +and unvisited links differently.

                          + +
                          The user action pseudo-classes +:hover, :active, and :focus
                          + +

                          Interactive user agents sometimes change the rendering in response +to user actions. Selectors provides +three pseudo-classes for the selection of an element the user is +acting on.

                          + +
                            + +
                          • The :hover pseudo-class applies while the user + designates an element with a pointing device, but does not activate + it. For example, a visual user agent could apply this pseudo-class + when the cursor (mouse pointer) hovers over a box generated by the + element. User agents not that do not support interactive + media do not have to support this pseudo-class. Some conforming + user agents that support interactive + media may not be able to support this pseudo-class (e.g., a pen + device that does not detect hovering).
                          • + +
                          • The :active pseudo-class applies while an element + is being activated by the user. For example, between the times the + user presses the mouse button and releases it.
                          • + +
                          • The :focus pseudo-class applies while an element + has the focus (accepts keyboard or mouse events, or other forms of + input).
                          • + +
                          + +

                          There may be document language or implementation specific limits on +which elements can become :active or acquire +:focus.

                          + +

                          These pseudo-classes are not mutually exclusive. An element may +match several pseudo-classes at the same time.

                          + +

                          Selectors doesn't define if the parent of an element that is +':active' or ':hover' is also in that state.

                          + +
                          +

                          Examples:

                          +
                          a:link    /* unvisited links */
                          +a:visited /* visited links */
                          +a:hover   /* user hovers */
                          +a:active  /* active links */
                          +

                          An example of combining dynamic pseudo-classes:

                          +
                          a:focus
                          +a:focus:hover
                          +

                          The last selector matches a elements that are in + the pseudo-class :focus and in the pseudo-class :hover.

                          +
                          + +

                          Note: An element can be both ':visited' +and ':active' (or ':link' and ':active').

                          + +

                          6.6.2. The target pseudo-class :target

                          + +

                          Some URIs refer to a location within a resource. This kind of URI +ends with a "number sign" (#) followed by an anchor +identifier (called the fragment identifier).

                          + +

                          URIs with fragment identifiers link to a certain element within the +document, known as the target element. For instance, here is a URI +pointing to an anchor named section_2 in an HTML +document:

                          + +
                          http://example.com/html/top.html#section_2
                          + +

                          A target element can be represented by the :target +pseudo-class. If the document's URI has no fragment identifier, then +the document has no target element.

                          + +
                          +

                          Example:

                          +
                          p.note:target
                          +

                          This selector represents a p element of class + note that is the target element of the referring + URI.

                          +
                          + +
                          +

                          CSS example:

                          +

                          Here, the :target pseudo-class is used to make the + target element red and place an image before it, if there is one:

                          +
                          *:target { color : red }
                          +*:target::before { content : url(target.png) }
                          +
                          + +

                          6.6.3. The language pseudo-class :lang

                          + +

                          If the document language specifies how the human language of an +element is determined, it is possible to write selectors that +represent an element based on its language. For example, in HTML [HTML4], the language is determined by a +combination of the lang attribute, the meta +element, and possibly by information from the protocol (such as HTTP +headers). XML uses an attribute called xml:lang, and +there may be other document language-specific methods for determining +the language.

                          + +

                          The pseudo-class :lang(C) represents an element that +is in language C. Whether an element is represented by a +:lang() selector is based solely on the identifier C +being either equal to, or a hyphen-separated substring of, the +element's language value, in the same way as if performed by the '|=' operator in attribute +selectors. The identifier C does not have to be a valid language +name.

                          + +

                          C must not be empty. (If it is, the selector is invalid.)

                          + +

                          Note: It is recommended that +documents and protocols indicate language using codes from RFC 3066 [RFC3066] or its successor, and by means of +"xml:lang" attributes in the case of XML-based documents [XML10]. See +"FAQ: Two-letter or three-letter language codes."

                          + +
                          +

                          Examples:

                          +

                          The two following selectors represent an HTML document that is in + Belgian, French, or German. The two next selectors represent + q quotations in an arbitrary element in Belgian, French, + or German.

                          +
                          html:lang(fr-be)
                          +html:lang(de)
                          +:lang(fr-be) > q
                          +:lang(de) > q
                          +
                          + +

                          6.6.4. The UI element states pseudo-classes

                          + +
                          The :enabled and :disabled pseudo-classes
                          + +

                          The :enabled pseudo-class allows authors to customize +the look of user interface elements that are enabled — which the +user can select or activate in some fashion (e.g. clicking on a button +with a mouse). There is a need for such a pseudo-class because there +is no way to programmatically specify the default appearance of say, +an enabled input element without also specifying what it +would look like when it was disabled.

                          + +

                          Similar to :enabled, :disabled allows the +author to specify precisely how a disabled or inactive user interface +element should look.

                          + +

                          Most elements will be neither enabled nor disabled. An element is +enabled if the user can either activate it or transfer the focus to +it. An element is disabled if it could be enabled, but the user cannot +presently activate it or transfer focus to it.

                          + + +
                          The :checked pseudo-class
                          + +

                          Radio and checkbox elements can be toggled by the user. Some menu +items are "checked" when the user selects them. When such elements are +toggled "on" the :checked pseudo-class applies. The +:checked pseudo-class initially applies to such elements +that have the HTML4 selected and checked +attributes as described in Section +17.2.1 of HTML4, but of course the user can toggle "off" such +elements in which case the :checked pseudo-class would no +longer apply. While the :checked pseudo-class is dynamic +in nature, and is altered by user action, since it can also be based +on the presence of the semantic HTML4 selected and +checked attributes, it applies to all media. + + +

                          The :indeterminate pseudo-class
                          + +
                          + +

                          Radio and checkbox elements can be toggled by the user, but are +sometimes in an indeterminate state, neither checked nor unchecked. +This can be due to an element attribute, or DOM manipulation.

                          + +

                          A future version of this specification may introduce an +:indeterminate pseudo-class that applies to such elements. +

                          + +
                          + + +

                          6.6.5. Structural pseudo-classes

                          + +

                          Selectors introduces the concept of structural +pseudo-classes to permit selection based on extra information that lies in +the document tree but cannot be represented by other simple selectors or +combinators. + +

                          Note that standalone pieces of PCDATA (text nodes in the DOM) are +not counted when calculating the position of an element in the list of +children of its parent. When calculating the position of an element in +the list of children of its parent, the index numbering starts at 1. + + +

                          :root pseudo-class
                          + +

                          The :root pseudo-class represents an element that is +the root of the document. In HTML 4, this is always the +HTML element. + + +

                          :nth-child() pseudo-class
                          + +

                          The +:nth-child(an+b) +pseudo-class notation represents an element that has +an+b-1 siblings +before it in the document tree, for a given positive +integer or zero value of n, and has a parent element. In +other words, this matches the bth child of an element after +all the children have been split into groups of a elements +each. For example, this allows the selectors to address every other +row in a table, and could be used to alternate the color +of paragraph text in a cycle of four. The a and +b values must be zero, negative integers or positive +integers. The index of the first child of an element is 1. + +

                          In addition to this, :nth-child() can take +'odd' and 'even' as arguments instead. +'odd' has the same signification as 2n+1, +and 'even' has the same signification as 2n. + + +

                          +

                          Examples:

                          +
                          tr:nth-child(2n+1) /* represents every odd row of an HTML table */
                          +tr:nth-child(odd)  /* same */
                          +tr:nth-child(2n)   /* represents every even row of an HTML table */
                          +tr:nth-child(even) /* same */
                          +
                          +/* Alternate paragraph colours in CSS */
                          +p:nth-child(4n+1) { color: navy; }
                          +p:nth-child(4n+2) { color: green; }
                          +p:nth-child(4n+3) { color: maroon; }
                          +p:nth-child(4n+4) { color: purple; }
                          +
                          + +

                          When a=0, no repeating is used, so for example +:nth-child(0n+5) matches only the fifth child. When +a=0, the an part need not be +included, so the syntax simplifies to +:nth-child(b) and the last example simplifies +to :nth-child(5). + +

                          +

                          Examples:

                          +
                          foo:nth-child(0n+1)   /* represents an element foo, first child of its parent element */
                          +foo:nth-child(1)      /* same */
                          +
                          + +

                          When a=1, the number may be omitted from the rule. + +

                          +

                          Examples:

                          +

                          The following selectors are therefore equivalent:

                          +
                          bar:nth-child(1n+0)   /* represents all bar elements, specificity (0,1,1) */
                          +bar:nth-child(n+0)    /* same */
                          +bar:nth-child(n)      /* same */
                          +bar                   /* same but lower specificity (0,0,1) */
                          +
                          + +

                          If b=0, then every ath element is picked. In +such a case, the b part may be omitted. + +

                          +

                          Examples:

                          +
                          tr:nth-child(2n+0) /* represents every even row of an HTML table */
                          +tr:nth-child(2n) /* same */
                          +
                          + +

                          If both a and b are equal to zero, the +pseudo-class represents no element in the document tree.

                          + +

                          The value a can be negative, but only the positive +values of an+b, for +n≥0, may represent an element in the document +tree.

                          + +
                          +

                          Example:

                          +
                          html|tr:nth-child(-n+6)  /* represents the 6 first rows of XHTML tables */
                          +
                          + +

                          When the value b is negative, the "+" character in the +expression must be removed (it is effectively replaced by the "-" +character indicating the negative value of b).

                          + +
                          +

                          Examples:

                          +
                          :nth-child(10n-1)  /* represents the 9th, 19th, 29th, etc, element */
                          +:nth-child(10n+9)  /* Same */
                          +:nth-child(10n+-1) /* Syntactically invalid, and would be ignored */
                          +
                          + + +
                          :nth-last-child() pseudo-class
                          + +

                          The :nth-last-child(an+b) +pseudo-class notation represents an element that has +an+b-1 siblings +after it in the document tree, for a given positive +integer or zero value of n, and has a parent element. See +:nth-child() pseudo-class for the syntax of its argument. +It also accepts the 'even' and 'odd' values +as arguments. + + +

                          +

                          Examples:

                          +
                          tr:nth-last-child(-n+2)    /* represents the two last rows of an HTML table */
                          +
                          +foo:nth-last-child(odd)    /* represents all odd foo elements in their parent element,
                          +                              counting from the last one */
                          +
                          + + +
                          :nth-of-type() pseudo-class
                          + +

                          The :nth-of-type(an+b) +pseudo-class notation represents an element that has +an+b-1 siblings with the same +element name before it in the document tree, for a +given zero or positive integer value of n, and has a +parent element. In other words, this matches the bth child +of that type after all the children of that type have been split into +groups of a elements each. See :nth-child() pseudo-class +for the syntax of its argument. It also accepts the +'even' and 'odd' values. + + +

                          +

                          CSS example:

                          +

                          This allows an author to alternate the position of floated images:

                          +
                          img:nth-of-type(2n+1) { float: right; }
                          +img:nth-of-type(2n) { float: left; }
                          +
                          + + +
                          :nth-last-of-type() pseudo-class
                          + +

                          The :nth-last-of-type(an+b) +pseudo-class notation represents an element that has +an+b-1 siblings with the same +element name after it in the document tree, for a +given zero or positive integer value of n, and has a +parent element. See :nth-child() pseudo-class for the +syntax of its argument. It also accepts the 'even' and 'odd' values. + + +

                          +

                          Example:

                          +

                          To represent all h2 children of an XHTML + body except the first and last, one could use the + following selector:

                          +
                          body > h2:nth-of-type(n+2):nth-last-of-type(n+2)
                          +

                          In this case, one could also use :not(), although the + selector ends up being just as long:

                          +
                          body > h2:not(:first-of-type):not(:last-of-type)
                          +
                          + + +
                          :first-child pseudo-class
                          + +

                          Same as :nth-child(1). The :first-child pseudo-class +represents an element that is the first child of some other element. + + +

                          +

                          Examples:

                          +

                          The following selector represents a p element that is + the first child of a div element:

                          +
                          div > p:first-child
                          +

                          This selector can represent the p inside the + div of the following fragment:

                          +
                          <p> The last P before the note.</p>
                          +<div class="note">
                          +   <p> The first P inside the note.</p>
                          +</div>
                          but cannot represent the second p in the following +fragment: +
                          <p> The last P before the note.</p>
                          +<div class="note">
                          +   <h2> Note </h2>
                          +   <p> The first P inside the note.</p>
                          +</div>
                          +

                          The following two selectors are usually equivalent:

                          +
                          * > a:first-child /* a is first child of any element */
                          +a:first-child /* Same (assuming a is not the root element) */
                          +
                          + +
                          :last-child pseudo-class
                          + +

                          Same as :nth-last-child(1). The :last-child pseudo-class +represents an element that is the last child of some other element. + +

                          +

                          Example:

                          +

                          The following selector represents a list item li that + is the last child of an ordered list ol. +

                          ol > li:last-child
                          +
                          + +
                          :first-of-type pseudo-class
                          + +

                          Same as :nth-of-type(1). The :first-of-type pseudo-class +represents an element that is the first sibling of its type in the list of +children of its parent element. + +

                          +

                          Example:

                          +

                          The following selector represents a definition title +dt inside a definition list dl, this +dt being the first of its type in the list of children of +its parent element.

                          +
                          dl dt:first-of-type
                          +

                          It is a valid description for the first two dt +elements in the following example but not for the third one:

                          +
                          <dl>
                          + <dt>gigogne</dt>
                          + <dd>
                          +  <dl>
                          +   <dt>fusée</dt>
                          +   <dd>multistage rocket</dd>
                          +   <dt>table</dt>
                          +   <dd>nest of tables</dd>
                          +  </dl>
                          + </dd>
                          +</dl>
                          +
                          + +
                          :last-of-type pseudo-class
                          + +

                          Same as :nth-last-of-type(1). The +:last-of-type pseudo-class represents an element that is +the last sibling of its type in the list of children of its parent +element.

                          + +
                          +

                          Example:

                          +

                          The following selector represents the last data cell + td of a table row.

                          +
                          tr > td:last-of-type
                          +
                          + +
                          :only-child pseudo-class
                          + +

                          Represents an element that has a parent element and whose parent +element has no other element children. Same as +:first-child:last-child or +:nth-child(1):nth-last-child(1), but with a lower +specificity.

                          + +
                          :only-of-type pseudo-class
                          + +

                          Represents an element that has a parent element and whose parent +element has no other element children with the same element name. Same +as :first-of-type:last-of-type or +:nth-of-type(1):nth-last-of-type(1), but with a lower +specificity.

                          + + +
                          :empty pseudo-class
                          + +

                          The :empty pseudo-class represents an element that has +no children at all. In terms of the DOM, only element nodes and text +nodes (including CDATA nodes and entity references) whose data has a +non-zero length must be considered as affecting emptiness; comments, +PIs, and other nodes must not affect whether an element is considered +empty or not.

                          + +
                          +

                          Examples:

                          +

                          p:empty is a valid representation of the following fragment:

                          +
                          <p></p>
                          +

                          foo:empty is not a valid representation for the + following fragments:

                          +
                          <foo>bar</foo>
                          +
                          <foo><bar>bla</bar></foo>
                          +
                          <foo>this is not <bar>:empty</bar></foo>
                          +
                          + +

                          6.6.6. Blank

                          + +

                          This section intentionally left blank.

                          + + +

                          6.6.7. The negation pseudo-class

                          + +

                          The negation pseudo-class, :not(X), is a +functional notation taking a simple +selector (excluding the negation pseudo-class itself and +pseudo-elements) as an argument. It represents an element that is not +represented by the argument. + + + +

                          +

                          Examples:

                          +

                          The following CSS selector matches all button + elements in an HTML document that are not disabled.

                          +
                          button:not([DISABLED])
                          +

                          The following selector represents all but FOO + elements.

                          +
                          *:not(FOO)
                          +

                          The following group of selectors represents all HTML elements + except links.

                          +
                          html|*:not(:link):not(:visited)
                          +
                          + +

                          Default namespace declarations do not affect the argument of the +negation pseudo-class unless the argument is a universal selector or a +type selector.

                          + +
                          +

                          Examples:

                          +

                          Assuming that the default namespace is bound to + "http://example.com/", the following selector represents all + elements that are not in that namespace:

                          +
                          *|*:not(*)
                          +

                          The following CSS selector matches any element being hovered, + regardless of its namespace. In particular, it is not limited to + only matching elements in the default namespace that are not being + hovered, and elements not in the default namespace don't match the + rule when they are being hovered.

                          +
                          *|*:not(:hover)
                          +
                          + +

                          Note: the :not() pseudo allows +useless selectors to be written. For instance :not(*|*), +which represents no element at all, or foo:not(bar), +which is equivalent to foo but with a higher +specificity.

                          + +

                          7. Pseudo-elements

                          + +

                          Pseudo-elements create abstractions about the document tree beyond +those specified by the document language. For instance, document +languages do not offer mechanisms to access the first letter or first +line of an element's content. Pseudo-elements allow designers to refer +to this otherwise inaccessible information. Pseudo-elements may also +provide designers a way to refer to content that does not exist in the +source document (e.g., the ::before and +::after pseudo-elements give access to generated +content).

                          + +

                          A pseudo-element is made of two colons (::) followed +by the name of the pseudo-element.

                          + +

                          This :: notation is introduced by the current document +in order to establish a discrimination between pseudo-classes and +pseudo-elements. For compatibility with existing style sheets, user +agents must also accept the previous one-colon notation for +pseudo-elements introduced in CSS levels 1 and 2 (namely, +:first-line, :first-letter, +:before and :after). This compatibility is +not allowed for the new pseudo-elements introduced in CSS level 3.

                          + +

                          Only one pseudo-element may appear per selector, and if present it +must appear after the sequence of simple selectors that represents the +subjects of the selector. A +future version of this specification may allow multiple +pesudo-elements per selector.

                          + +

                          7.1. The ::first-line pseudo-element

                          + +

                          The ::first-line pseudo-element describes the contents +of the first formatted line of an element. + +

                          +

                          CSS example:

                          +
                          p::first-line { text-transform: uppercase }
                          +

                          The above rule means "change the letters of the first line of every +paragraph to uppercase".

                          +
                          + +

                          The selector p::first-line does not match any real +HTML element. It does match a pseudo-element that conforming user +agents will insert at the beginning of every paragraph.

                          + +

                          Note that the length of the first line depends on a number of +factors, including the width of the page, the font size, etc. Thus, +an ordinary HTML paragraph such as:

                          + +
                          +<P>This is a somewhat long HTML 
                          +paragraph that will be broken into several 
                          +lines. The first line will be identified
                          +by a fictional tag sequence. The other lines 
                          +will be treated as ordinary lines in the 
                          +paragraph.</P>
                          +
                          + +

                          the lines of which happen to be broken as follows: + +

                          +THIS IS A SOMEWHAT LONG HTML PARAGRAPH THAT
                          +will be broken into several lines. The first
                          +line will be identified by a fictional tag 
                          +sequence. The other lines will be treated as 
                          +ordinary lines in the paragraph.
                          +
                          + +

                          This paragraph might be "rewritten" by user agents to include the +fictional tag sequence for ::first-line. This +fictional tag sequence helps to show how properties are inherited.

                          + +
                          +<P><P::first-line> This is a somewhat long HTML 
                          +paragraph that </P::first-line> will be broken into several
                          +lines. The first line will be identified 
                          +by a fictional tag sequence. The other lines 
                          +will be treated as ordinary lines in the 
                          +paragraph.</P>
                          +
                          + +

                          If a pseudo-element breaks up a real element, the desired effect +can often be described by a fictional tag sequence that closes and +then re-opens the element. Thus, if we mark up the previous paragraph +with a span element:

                          + +
                          +<P><SPAN class="test"> This is a somewhat long HTML
                          +paragraph that will be broken into several
                          +lines.</SPAN> The first line will be identified
                          +by a fictional tag sequence. The other lines 
                          +will be treated as ordinary lines in the 
                          +paragraph.</P>
                          +
                          + +

                          the user agent could simulate start and end tags for +span when inserting the fictional tag sequence for +::first-line. + +

                          +<P><P::first-line><SPAN class="test"> This is a
                          +somewhat long HTML
                          +paragraph that will </SPAN></P::first-line><SPAN class="test"> be
                          +broken into several
                          +lines.</SPAN> The first line will be identified
                          +by a fictional tag sequence. The other lines
                          +will be treated as ordinary lines in the 
                          +paragraph.</P>
                          +
                          + +

                          In CSS, the ::first-line pseudo-element can only be +attached to a block-level element, an inline-block, a table-caption, +or a table-cell.

                          + +

                          The "first formatted line" of an +element may occur inside a +block-level descendant in the same flow (i.e., a block-level +descendant that is not positioned and not a float). E.g., the first +line of the div in <DIV><P>This +line...</P></DIV> is the first line of the p (assuming +that both p and div are block-level). + +

                          The first line of a table-cell or inline-block cannot be the first +formatted line of an ancestor element. Thus, in <DIV><P +STYLE="display: inline-block">Hello<BR>Goodbye</P> +etcetera</DIV> the first formatted line of the +div is not the line "Hello". + +

                          Note that the first line of the p in this +fragment: <p><br>First... doesn't contain any +letters (assuming the default style for br in HTML +4). The word "First" is not on the first formatted line. + +

                          A UA should act as if the fictional start tags of the +::first-line pseudo-elements were nested just inside the +innermost enclosing block-level element. (Since CSS1 and CSS2 were +silent on this case, authors should not rely on this behavior.) Here +is an example. The fictional tag sequence for

                          + +
                          +<DIV>
                          +  <P>First paragraph</P>
                          +  <P>Second paragraph</P>
                          +</DIV>
                          +
                          + +

                          is

                          + +
                          +<DIV>
                          +  <P><DIV::first-line><P::first-line>First paragraph</P::first-line></DIV::first-line></P>
                          +  <P><P::first-line>Second paragraph</P::first-line></P>
                          +</DIV>
                          +
                          + +

                          The ::first-line pseudo-element is similar to an +inline-level element, but with certain restrictions. In CSS, the +following properties apply to a ::first-line +pseudo-element: font properties, color property, background +properties, 'word-spacing', 'letter-spacing', 'text-decoration', +'vertical-align', 'text-transform', 'line-height'. UAs may apply other +properties as well.

                          + + +

                          7.2. The ::first-letter pseudo-element

                          + +

                          The ::first-letter pseudo-element represents the first +letter of the first line of a block, if it is not preceded by any +other content (such as images or inline tables) on its line. The +::first-letter pseudo-element may be used for "initial caps" and "drop +caps", which are common typographical effects. This type of initial +letter is similar to an inline-level element if its 'float' property +is 'none'; otherwise, it is similar to a floated element.

                          + +

                          In CSS, these are the properties that apply to ::first-letter +pseudo-elements: font properties, 'text-decoration', 'text-transform', +'letter-spacing', 'word-spacing' (when appropriate), 'line-height', +'float', 'vertical-align' (only if 'float' is 'none'), margin +properties, padding properties, border properties, color property, +background properties. UAs may apply other properties as well. To +allow UAs to render a typographically correct drop cap or initial cap, +the UA may choose a line-height, width and height based on the shape +of the letter, unlike for normal elements.

                          + +
                          +

                          Example:

                          +

                          This example shows a possible rendering of an initial cap. Note +that the 'line-height' that is inherited by the ::first-letter +pseudo-element is 1.1, but the UA in this example has computed the +height of the first letter differently, so that it doesn't cause any +unnecessary space between the first two lines. Also note that the +fictional start tag of the first letter is inside the span, and thus +the font weight of the first letter is normal, not bold as the span: +

                          +p { line-height: 1.1 }
                          +p::first-letter { font-size: 3em; font-weight: normal }
                          +span { font-weight: bold }
                          +...
                          +<p><span>Het hemelsche</span> gerecht heeft zich ten lange lesten<br>
                          +Erbarremt over my en mijn benaeuwde vesten<br>
                          +En arme burgery, en op mijn volcx gebed<br>
                          +En dagelix geschrey de bange stad ontzet.
                          +
                          +
                          +

                          Image illustrating the ::first-letter pseudo-element +

                          +
                          + +
                          +

                          The following CSS will make a drop cap initial letter span about two lines:

                          + +
                          +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN">
                          +<HTML>
                          + <HEAD>
                          +  <TITLE>Drop cap initial letter</TITLE>
                          +  <STYLE type="text/css">
                          +   P               { font-size: 12pt; line-height: 1.2 }
                          +   P::first-letter { font-size: 200%; font-weight: bold; float: left }
                          +   SPAN            { text-transform: uppercase }
                          +  </STYLE>
                          + </HEAD>
                          + <BODY>
                          +  <P><SPAN>The first</SPAN> few words of an article
                          +    in The Economist.</P>
                          + </BODY>
                          +</HTML>
                          +
                          + +

                          This example might be formatted as follows:

                          + +
                          +

                          Image illustrating the combined effect of the ::first-letter and ::first-line pseudo-elements

                          +
                          + +

                          The fictional tag sequence is:

                          + +
                          +<P>
                          +<SPAN>
                          +<P::first-letter>
                          +T
                          +</P::first-letter>he first
                          +</SPAN> 
                          +few words of an article in the Economist.
                          +</P>
                          +
                          + +

                          Note that the ::first-letter pseudo-element tags abut +the content (i.e., the initial character), while the ::first-line +pseudo-element start tag is inserted right after the start tag of the +block element.

                          + +

                          In order to achieve traditional drop caps formatting, user agents +may approximate font sizes, for example to align baselines. Also, the +glyph outline may be taken into account when formatting.

                          + +

                          Punctuation (i.e, characters defined in Unicode in the "open" (Ps), +"close" (Pe), "initial" (Pi). "final" (Pf) and "other" (Po) +punctuation classes), that precedes or follows the first letter should +be included. [UNICODE]

                          + +
                          +

                          Quotes that precede the
+first letter should be included.

                          +
                          + +

                          The ::first-letter also applies if the first letter is +in fact a digit, e.g., the "6" in "67 million dollars is a lot of +money."

                          + +

                          In CSS, the ::first-letter pseudo-element applies to +block, list-item, table-cell, table-caption, and inline-block +elements. A future version of this specification +may allow this pesudo-element to apply to more element +types.

                          + +

                          The ::first-letter pseudo-element can be used with all +such elements that contain text, or that have a descendant in the same +flow that contains text. A UA should act as if the fictional start tag +of the ::first-letter pseudo-element is just before the first text of +the element, even if that first text is in a descendant.

                          + +
                          +

                          Example:

                          +

                          The fictional tag sequence for this HTMLfragment: +

                          <div>
                          +<p>The first text.
                          +

                          is: +

                          <div>
                          +<p><div::first-letter><p::first-letter>T</...></...>he first text.
                          +
                          + +

                          The first letter of a table-cell or inline-block cannot be the +first letter of an ancestor element. Thus, in <DIV><P +STYLE="display: inline-block">Hello<BR>Goodbye</P> +etcetera</DIV> the first letter of the div is not the +letter "H". In fact, the div doesn't have a first letter. + +

                          The first letter must occur on the first formatted line. For example, in +this fragment: <p><br>First... the first line +doesn't contain any letters and ::first-letter doesn't +match anything (assuming the default style for br in HTML +4). In particular, it does not match the "F" of "First." + +

                          In CSS, if an element is a list item ('display: list-item'), the +::first-letter applies to the first letter in the +principal box after the marker. UAs may ignore +::first-letter on list items with 'list-style-position: +inside'. If an element has ::before or +::after content, the ::first-letter applies +to the first letter of the element including that content. + +

                          +

                          Example:

                          +

                          After the rule 'p::before {content: "Note: "}', the selector +'p::first-letter' matches the "N" of "Note".

                          +
                          + +

                          Some languages may have specific rules about how to treat certain +letter combinations. In Dutch, for example, if the letter combination +"ij" appears at the beginning of a word, both letters should be +considered within the ::first-letter pseudo-element. + +

                          If the letters that would form the ::first-letter are not in the +same element, such as "'T" in <p>'<em>T..., the UA +may create a ::first-letter pseudo-element from one of the elements, +both elements, or simply not create a pseudo-element.

                          + +

                          Similarly, if the first letter(s) of the block are not at the start +of the line (for example due to bidirectional reordering), then the UA +need not create the pseudo-element(s). + +

                          +

                          Example:

                          +

                          The following example illustrates +how overlapping pseudo-elements may interact. The first letter of +each P element will be green with a font size of '24pt'. The rest of +the first formatted line will be 'blue' while the rest of the +paragraph will be 'red'.

                          + +
                          p { color: red; font-size: 12pt }
                          +p::first-letter { color: green; font-size: 200% }
                          +p::first-line { color: blue }
                          +
                          +<P>Some text that ends up on two lines</P>
                          + +

                          Assuming that a line break will occur before the word "ends", the +fictional tag +sequence for this fragment might be:

                          + +
                          <P>
                          +<P::first-line>
                          +<P::first-letter> 
                          +S 
                          +</P::first-letter>ome text that 
                          +</P::first-line> 
                          +ends up on two lines 
                          +</P>
                          + +

                          Note that the ::first-letter element is inside the ::first-line +element. Properties set on ::first-line are inherited by +::first-letter, but are overridden if the same property is set on +::first-letter.

                          +
                          + + +

                          7.3. The ::selection pseudo-element

                          + +

                          The ::selection pseudo-element applies to the portion +of a document that has been highlighted by the user. This also +applies, for example, to selected text within an editable text +field. This pseudo-element should not be confused with the :checked pseudo-class (which used to be +named :selected) + +

                          Although the ::selection pseudo-element is dynamic in +nature, and is altered by user action, it is reasonable to expect that +when a UA re-renders to a static medium (such as a printed page, see +[CSS21]) which was originally rendered to a +dynamic medium (like screen), the UA may wish to transfer the current +::selection state to that other medium, and have all the +appropriate formatting and rendering take effect as well. This is not +required — UAs may omit the ::selection +pseudo-element for static media. + +

                          These are the CSS properties that apply to ::selection +pseudo-elements: color, background, cursor (optional), outline +(optional). The computed value of the 'background-image' property on +::selection may be ignored. + + +

                          7.4. The ::before and ::after pseudo-elements

                          + +

                          The ::before and ::after pseudo-elements +can be used to describe generated content before or after an element's +content. They are explained in CSS 2.1 [CSS21].

                          + +

                          When the ::first-letter and ::first-line +pseudo-elements are combined with ::before and +::after, they apply to the first letter or line of the +element including the inserted text.

                          + +

                          8. Combinators

                          + +

                          8.1. Descendant combinator

                          + +

                          At times, authors may want selectors to describe an element that is +the descendant of another element in the document tree (e.g., "an +EM element that is contained within an H1 +element"). Descendant combinators express such a relationship. A +descendant combinator is white space that +separates two sequences of simple selectors. A selector of the form +"A B" represents an element B that is an +arbitrary descendant of some ancestor element A. + +

                          +

                          Examples:

                          +

                          For example, consider the following selector:

                          +
                          h1 em
                          +

                          It represents an em element being the descendant of + an h1 element. It is a correct and valid, but partial, + description of the following fragment:

                          +
                          <h1>This <span class="myclass">headline
                          +is <em>very</em> important</span></h1>
                          +

                          The following selector:

                          +
                          div * p
                          +

                          represents a p element that is a grandchild or later + descendant of a div element. Note the whitespace on + either side of the "*" is not part of the universal selector; the + whitespace is a combinator indicating that the DIV must be the + ancestor of some element, and that that element must be an ancestor + of the P.

                          +

                          The following selector, which combines descendant combinators and + attribute selectors, represents an + element that (1) has the href attribute set and (2) is + inside a p that is itself inside a div:

                          +
                          div p *[href]
                          +
                          + +

                          8.2. Child combinators

                          + +

                          A child combinator describes a childhood relationship +between two elements. A child combinator is made of the +"greater-than sign" (>) character and +separates two sequences of simple selectors. + + +

                          +

                          Examples:

                          +

                          The following selector represents a p element that is + child of body:

                          +
                          body > p
                          +

                          The following example combines descendant combinators and child + combinators.

                          +
                          div ol>li p
                          +

                          It represents a p element that is a descendant of an + li element; the li element must be the + child of an ol element; the ol element must + be a descendant of a div. Notice that the optional white + space around the ">" combinator has been left out.

                          +
                          + +

                          For information on selecting the first child of an element, please +see the section on the :first-child pseudo-class +above.

                          + +

                          8.3. Sibling combinators

                          + +

                          There are two different sibling combinators: the adjacent sibling +combinator and the general sibling combinator. In both cases, +non-element nodes (e.g. text between elements) are ignored when +considering adjacency of elements.

                          + +

                          8.3.1. Adjacent sibling combinator

                          + +

                          The adjacent sibling combinator is made of the "plus +sign" (U+002B, +) character that separates two +sequences of simple selectors. The elements represented by the two +sequences share the same parent in the document tree and the element +represented by the first sequence immediately precedes the element +represented by the second one.

                          + +
                          +

                          Examples:

                          +

                          The following selector represents a p element + immediately following a math element:

                          +
                          math + p
                          +

                          The following selector is conceptually similar to the one in the + previous example, except that it adds an attribute selector — it + adds a constraint to the h1 element, that it must have + class="opener":

                          +
                          h1.opener + h2
                          +
                          + + +

                          8.3.2. General sibling combinator

                          + +

                          The general sibling combinator is made of the "tilde" +(U+007E, ~) character that separates two sequences of +simple selectors. The elements represented by the two sequences share +the same parent in the document tree and the element represented by +the first sequence precedes (not necessarily immediately) the element +represented by the second one.

                          + +
                          +

                          Example:

                          +
                          h1 ~ pre
                          +

                          represents a pre element following an h1. It + is a correct and valid, but partial, description of:

                          +
                          <h1>Definition of the function a</h1>
                          +<p>Function a(x) has to be applied to all figures in the table.</p>
                          +<pre>function a(x) = 12x/13.5</pre>
                          +
                          + +

                          9. Calculating a selector's specificity

                          + +

                          A selector's specificity is calculated as follows:

                          + +
                            +
                          • count the number of ID selectors in the selector (= a)
                          • +
                          • count the number of class selectors, attributes selectors, and pseudo-classes in the selector (= b)
                          • +
                          • count the number of element names in the selector (= c)
                          • +
                          • ignore pseudo-elements
                          • +
                          + +

                          Selectors inside the negation pseudo-class +are counted like any other, but the negation itself does not count as +a pseudo-class.

                          + +

                          Concatenating the three numbers a-b-c (in a number system with a +large base) gives the specificity.

                          + +
                          +

                          Examples:

                          +
                          *               /* a=0 b=0 c=0 -> specificity =   0 */
                          +LI              /* a=0 b=0 c=1 -> specificity =   1 */
                          +UL LI           /* a=0 b=0 c=2 -> specificity =   2 */
                          +UL OL+LI        /* a=0 b=0 c=3 -> specificity =   3 */
                          +H1 + *[REL=up]  /* a=0 b=1 c=1 -> specificity =  11 */
                          +UL OL LI.red    /* a=0 b=1 c=3 -> specificity =  13 */
                          +LI.red.level    /* a=0 b=2 c=1 -> specificity =  21 */
                          +#x34y           /* a=1 b=0 c=0 -> specificity = 100 */
                          +#s12:not(FOO)   /* a=1 b=0 c=1 -> specificity = 101 */
                          +
                          +
                          + +

                          Note: the specificity of the styles +specified in an HTML style attribute is described in CSS +2.1. [CSS21].

                          + +

                          10. The grammar of Selectors

                          + +

                          10.1. Grammar

                          + +

                          The grammar below defines the syntax of Selectors. It is globally +LL(1) and can be locally LL(2) (but note that most UA's should not use +it directly, since it doesn't express the parsing conventions). The +format of the productions is optimized for human consumption and some +shorthand notations beyond Yacc (see [YACC]) +are used:

                          + +
                            +
                          • *: 0 or more +
                          • +: 1 or more +
                          • ?: 0 or 1 +
                          • |: separates alternatives +
                          • [ ]: grouping
                          • +
                          + +

                          The productions are:

                          + +
                          selectors_group
                          +  : selector [ COMMA S* selector ]*
                          +  ;
                          +
                          +selector
                          +  : simple_selector_sequence [ combinator simple_selector_sequence ]*
                          +  ;
                          +
                          +combinator
                          +  /* combinators can be surrounded by white space */
                          +  : PLUS S* | GREATER S* | TILDE S* | S+
                          +  ;
                          +
                          +simple_selector_sequence
                          +  : [ type_selector | universal ]
                          +    [ HASH | class | attrib | pseudo | negation ]*
                          +  | [ HASH | class | attrib | pseudo | negation ]+
                          +  ;
                          +
                          +type_selector
                          +  : [ namespace_prefix ]? element_name
                          +  ;
                          +
                          +namespace_prefix
                          +  : [ IDENT | '*' ]? '|'
                          +  ;
                          +
                          +element_name
                          +  : IDENT
                          +  ;
                          +
                          +universal
                          +  : [ namespace_prefix ]? '*'
                          +  ;
                          +
                          +class
                          +  : '.' IDENT
                          +  ;
                          +
                          +attrib
                          +  : '[' S* [ namespace_prefix ]? IDENT S*
                          +        [ [ PREFIXMATCH |
                          +            SUFFIXMATCH |
                          +            SUBSTRINGMATCH |
                          +            '=' |
                          +            INCLUDES |
                          +            DASHMATCH ] S* [ IDENT | STRING ] S*
                          +        ]? ']'
                          +  ;
                          +
                          +pseudo
                          +  /* '::' starts a pseudo-element, ':' a pseudo-class */
                          +  /* Exceptions: :first-line, :first-letter, :before and :after. */
                          +  /* Note that pseudo-elements are restricted to one per selector and */
                          +  /* occur only in the last simple_selector_sequence. */
                          +  : ':' ':'? [ IDENT | functional_pseudo ]
                          +  ;
                          +
                          +functional_pseudo
                          +  : FUNCTION S* expression ')'
                          +  ;
                          +
                          +expression
                          +  /* In CSS3, the expressions are identifiers, strings, */
                          +  /* or of the form "an+b" */
                          +  : [ [ PLUS | '-' | DIMENSION | NUMBER | STRING | IDENT ] S* ]+
                          +  ;
                          +
                          +negation
                          +  : NOT S* negation_arg S* ')'
                          +  ;
                          +
                          +negation_arg
                          +  : type_selector | universal | HASH | class | attrib | pseudo
                          +  ;
                          + + +

                          10.2. Lexical scanner

                          + +

                          The following is the tokenizer, written in Flex (see +[FLEX]) notation. The tokenizer is +case-insensitive.

                          + +

                          The two occurrences of "\377" represent the highest character +number that current versions of Flex can deal with (decimal 255). They +should be read as "\4177777" (decimal 1114111), which is the highest +possible code point in Unicode/ISO-10646. [UNICODE]

                          + +
                          %option case-insensitive
                          +
                          +ident     [-]?{nmstart}{nmchar}*
                          +name      {nmchar}+
                          +nmstart   [_a-z]|{nonascii}|{escape}
                          +nonascii  [^\0-\177]
                          +unicode   \\[0-9a-f]{1,6}(\r\n|[ \n\r\t\f])?
                          +escape    {unicode}|\\[^\n\r\f0-9a-f]
                          +nmchar    [_a-z0-9-]|{nonascii}|{escape}
                          +num       [0-9]+|[0-9]*\.[0-9]+
                          +string    {string1}|{string2}
                          +string1   \"([^\n\r\f\\"]|\\{nl}|{nonascii}|{escape})*\"
                          +string2   \'([^\n\r\f\\']|\\{nl}|{nonascii}|{escape})*\'
                          +invalid   {invalid1}|{invalid2}
                          +invalid1  \"([^\n\r\f\\"]|\\{nl}|{nonascii}|{escape})*
                          +invalid2  \'([^\n\r\f\\']|\\{nl}|{nonascii}|{escape})*
                          +nl        \n|\r\n|\r|\f
                          +w         [ \t\r\n\f]*
                          +
                          +%%
                          +
                          +[ \t\r\n\f]+     return S;
                          +
                          +"~="             return INCLUDES;
                          +"|="             return DASHMATCH;
                          +"^="             return PREFIXMATCH;
                          +"$="             return SUFFIXMATCH;
                          +"*="             return SUBSTRINGMATCH;
                          +{ident}          return IDENT;
                          +{string}         return STRING;
                          +{ident}"("       return FUNCTION;
                          +{num}            return NUMBER;
                          +"#"{name}        return HASH;
                          +{w}"+"           return PLUS;
                          +{w}">"           return GREATER;
                          +{w}","           return COMMA;
                          +{w}"~"           return TILDE;
                          +":not("          return NOT;
                          +@{ident}         return ATKEYWORD;
                          +{invalid}        return INVALID;
                          +{num}%           return PERCENTAGE;
                          +{num}{ident}     return DIMENSION;
                          +"<!--"           return CDO;
                          +"-->"            return CDC;
                          +
                          +"url("{w}{string}{w}")"                           return URI;
                          +"url("{w}([!#$%&*-~]|{nonascii}|{escape})*{w}")"  return URI;
                          +U\+[0-9a-f?]{1,6}(-[0-9a-f]{1,6})?                return UNICODE_RANGE;
                          +
                          +\/\*[^*]*\*+([^/*][^*]*\*+)*\/                    /* ignore comments */
                          +
                          +.                return *yytext;
                          + + + +

                          11. Namespaces and down-level clients

                          + +

                          An important issue is the interaction of CSS selectors with XML +documents in web clients that were produced prior to this +document. Unfortunately, due to the fact that namespaces must be +matched based on the URI which identifies the namespace, not the +namespace prefix, some mechanism is required to identify namespaces in +CSS by their URI as well. Without such a mechanism, it is impossible +to construct a CSS style sheet which will properly match selectors in +all cases against a random set of XML documents. However, given +complete knowledge of the XML document to which a style sheet is to be +applied, and a limited use of namespaces within the XML document, it +is possible to construct a style sheet in which selectors would match +elements and attributes correctly.

                          + +

                          It should be noted that a down-level CSS client will (if it +properly conforms to CSS forward compatible parsing rules) ignore all +@namespace at-rules, as well as all style rules that make +use of namespace qualified element type or attribute selectors. The +syntax of delimiting namespace prefixes in CSS was deliberately chosen +so that down-level CSS clients would ignore the style rules rather +than possibly match them incorrectly.

                          + +

                          The use of default namespaces in CSS makes it possible to write +element type selectors that will function in both namespace aware CSS +clients as well as down-level clients. It should be noted that +down-level clients may incorrectly match selectors against XML +elements in other namespaces.

                          + +

                          The following are scenarios and examples in which it is possible to +construct style sheets which would function properly in web clients +that do not implement this proposal.

                          + +
                            +
                          1. + +

                            The XML document does not use namespaces.

                            + +
                              + +
                            • In this case, it is obviously not necessary to declare or use + namespaces in the style sheet. Standard CSS element type and + attribute selectors will function adequately in a down-level + client.
                            • + +
                            • In a CSS namespace aware client, the default behavior of + element selectors matching without regard to namespace will + function properly against all elements, since no namespaces are + present. However, the use of specific element type selectors that + match only elements that have no namespace ("|name") + will guarantee that selectors will match only XML elements that do + not have a declared namespace.
                            • + +
                            + +
                          2. + +
                          3. + +

                            The XML document defines a single, default namespace used + throughout the document. No namespace prefixes are used in element + names.

                            + +
                              + +
                            • In this case, a down-level client will function as if + namespaces were not used in the XML document at all. Standard CSS + element type and attribute selectors will match against all + elements.
                            • + +
                            + +
                          4. + +
                          5. + +

                            The XML document does not use a default namespace, all + namespace prefixes used are known to the style sheet author, and + there is a direct mapping between namespace prefixes and namespace + URIs. (A given prefix may only be mapped to one namespace URI + throughout the XML document; there may be multiple prefixes mapped + to the same URI).

                            + +
                              + +
                            • In this case, the down-level client will view and match + element type and attribute selectors based on their fully + qualified name, not the local part as outlined in the Type selectors and Namespaces section. CSS + selectors may be declared using an escaped colon "\:" + to describe the fully qualified names, e.g. + "html\:h1" will match + <html:h1>. Selectors using the qualified name + will only match XML elements that use the same prefix. Other + namespace prefixes used in the XML that are mapped to the same URI + will not match as expected unless additional CSS style rules are + declared for them.
                            • + +
                            • Note that selectors declared in this fashion will + only match in down-level clients. A CSS namespace aware + client will match element type and attribute selectors based on + the name's local part. Selectors declared with the fully + qualified name will not match (unless there is no namespace prefix + in the fully qualified name).
                            • + +
                            + +
                          6. + +
                          + +

                          In other scenarios: when the namespace prefixes used in the XML are +not known in advance by the style sheet author; or a combination of +elements with no namespace are used in conjunction with elements using +a default namespace; or the same namespace prefix is mapped to +different namespace URIs within the same document, or in +different documents; it is impossible to construct a CSS style sheet +that will function properly against all elements in those documents, +unless, the style sheet is written using a namespace URI syntax (as +outlined in this document or similar) and the document is processed by +a CSS and XML namespace aware client.

                          + +

                          12. Profiles

                          + +

                          Each specification using Selectors must define the subset of W3C +Selectors it allows and excludes, and describe the local meaning of +all the components of that subset.

                          + +

                          Non normative examples: + +

                          + + + + + + + + + + + + + + + +
                          Selectors profile
                          SpecificationCSS level 1
                          Acceptstype selectors
                          class selectors
                          ID selectors
                          :link, + :visited and :active pseudo-classes
                          descendant combinator +
                          ::first-line and ::first-letter pseudo-elements
                          Excludes + +

                          universal selector
                          attribute selectors
                          :hover and :focus + pseudo-classes
                          :target pseudo-class
                          :lang() pseudo-class
                          all UI + element states pseudo-classes
                          all structural + pseudo-classes
                          negation pseudo-class
                          all + UI element fragments pseudo-elements
                          ::before and ::after + pseudo-elements
                          child combinators
                          sibling combinators + +

                          namespaces

                          Extra constraintsonly one class selector allowed per sequence of simple + selectors


                          + + + + + + + + + + + + + + + +
                          Selectors profile
                          SpecificationCSS level 2
                          Acceptstype selectors
                          universal selector
                          attribute presence and + values selectors
                          class selectors
                          ID selectors
                          :link, :visited, + :active, :hover, :focus, :lang() and :first-child pseudo-classes +
                          descendant combinator
                          child combinator
                          adjacent sibling + combinator
                          ::first-line and ::first-letter pseudo-elements
                          ::before + and ::after pseudo-elements
                          Excludes + +

                          content selectors
                          substring matching attribute + selectors
                          :target pseudo-classes
                          all UI element + states pseudo-classes
                          all structural pseudo-classes other + than :first-child
                          negation pseudo-class
                          all UI element + fragments pseudo-elements
                          general sibling combinators + +

                          namespaces

                          Extra constraintsmore than one class selector per sequence of simple selectors (CSS1 + constraint) allowed
                          + +

                          In CSS, selectors express pattern matching rules that determine which style +rules apply to elements in the document tree. + +

                          The following selector (CSS level 2) will match all anchors a +with attribute name set inside a section 1 header h1: +

                          h1 a[name]
                          + +

                          All CSS declarations attached to such a selector are applied to elements +matching it.

                          + +
                          + + + + + + + + + + + + + + + + +
                          Selectors profile
                          SpecificationSTTS 3
                          Accepts + +

                          type selectors
                          universal selectors
                          attribute selectors
                          class + selectors
                          ID selectors
                          all structural pseudo-classes
                          + all combinators + +

                          namespaces

                          Excludesnon-accepted pseudo-classes
                          pseudo-elements
                          Extra constraintssome selectors and combinators are not allowed in fragment + descriptions on the right side of STTS declarations.
                          + +

                          Selectors can be used in STTS 3 in two different + manners: +

                            +
                          1. a selection mechanism equivalent to CSS selection mechanism: declarations + attached to a given selector are applied to elements matching that selector, +
                          2. fragment descriptions that appear on the right side of declarations. +
                          + +

                          13. Conformance and requirements

                          + +

                          This section defines conformance with the present specification only. + +

                          The inability of a user agent to implement part of this specification due to +the limitations of a particular device (e.g., non interactive user agents will +probably not implement dynamic pseudo-classes because they make no sense without +interactivity) does not imply non-conformance. + +

                          All specifications reusing Selectors must contain a Profile listing the +subset of Selectors it accepts or excludes, and describing the constraints +it adds to the current specification. + +

                          Invalidity is caused by a parsing error, e.g. an unrecognized token or a token +which is not allowed at the current parsing point. + +

                          User agents must observe the rules for handling parsing errors: +

                            +
                          • a simple selector containing an undeclared namespace prefix is invalid
                          • +
                          • a selector containing an invalid simple selector, an invalid combinator + or an invalid token is invalid.
                          • +
                          • a group of selectors containing an invalid selector is invalid.
                          • +
                          + +

                          Specifications reusing Selectors must define how to handle parsing +errors. (In the case of CSS, the entire rule in which the selector is +used is dropped.)

                          + + + +

                          14. Tests

                          + +

                          This specification has a test +suite allowing user agents to verify their basic conformance to +the specification. This test suite does not pretend to be exhaustive +and does not cover all possible combined cases of Selectors.

                          + +

                          15. Acknowledgements

                          + +

                          The CSS working group would like to thank everyone who has sent +comments on this specification over the years.

                          + +

                          The working group would like to extend special thanks to Donna +McManus, Justin Baker, Joel Sklar, and Molly Ives Brower who perfermed +the final editorial review.

                          + +

                          16. References

                          + +
                          + +
                          [CSS1] +
                          Bert Bos, Håkon Wium Lie; "Cascading Style Sheets, level 1", W3C Recommendation, 17 Dec 1996, revised 11 Jan 1999 +
                          (http://www.w3.org/TR/REC-CSS1) + +
                          [CSS21] +
                          Bert Bos, Tantek Çelik, Ian Hickson, Håkon Wium Lie, editors; "Cascading Style Sheets, level 2 revision 1", W3C Working Draft, 13 June 2005 +
                          (http://www.w3.org/TR/CSS21) + +
                          [CWWW] +
                          Martin J. Dürst, François Yergeau, Misha Wolf, Asmus Freytag, Tex Texin, editors; "Character Model for the World Wide Web", W3C Recommendation, 15 February 2005 +
                          (http://www.w3.org/TR/charmod/) + +
                          [FLEX] +
                          "Flex: The Lexical Scanner Generator", Version 2.3.7, ISBN 1882114213 + +
                          [HTML4] +
                          Dave Ragget, Arnaud Le Hors, Ian Jacobs, editors; "HTML 4.01 Specification", W3C Recommendation, 24 December 1999 +
                          (http://www.w3.org/TR/html4/) + +
                          [MATH] +
                          Patrick Ion, Robert Miner, editors; "Mathematical Markup Language (MathML) 1.01", W3C Recommendation, revision of 7 July 1999 +
                          (http://www.w3.org/TR/REC-MathML/) + +
                          [RFC3066] +
                          H. Alvestrand; "Tags for the Identification of Languages", Request for Comments 3066, January 2001 +
                          (http://www.ietf.org/rfc/rfc3066.txt) + +
                          [STTS] +
                          Daniel Glazman; "Simple Tree Transformation Sheets 3", Electricité de France, submission to the W3C, 11 November 1998 +
                          (http://www.w3.org/TR/NOTE-STTS3) + +
                          [SVG] +
                          Jon Ferraiolo, 藤沢 淳, Dean Jackson, editors; "Scalable Vector Graphics (SVG) 1.1 Specification", W3C Recommendation, 14 January 2003 +
                          (http://www.w3.org/TR/SVG/) + +
                          [UNICODE]
                          +
                          The Unicode Standard, Version 4.1, The Unicode Consortium. Boston, MA, Addison-Wesley, March 2005. ISBN 0-321-18578-1, as amended by Unicode 4.0.1 and Unicode 4.1.0. +
                          (http://www.unicode.org/versions/)
                          + +
                          [XML10] +
                          Tim Bray, Jean Paoli, C. M. Sperberg-McQueen, Eve Maler, François Yergeau, editors; "Extensible Markup Language (XML) 1.0 (Third Edition)", W3C Recommendation, 4 February 2004 +
                          (http://www.w3.org/TR/REC-xml/) + +
                          [XMLNAMES] +
                          Tim Bray, Dave Hollander, Andrew Layman, editors; "Namespaces in XML", W3C Recommendation, 14 January 1999 +
                          (http://www.w3.org/TR/REC-xml-names/) + +
                          [YACC] +
                          S. C. Johnson; "YACC — Yet another compiler compiler", Technical Report, Murray Hill, 1975 + +
                          + + diff --git a/vendor/sunra/php-simple-html-dom-parser/Src/Sunra/PhpSimple/simplehtmldom_1_5/testcase/std_testcase.php b/vendor/sunra/php-simple-html-dom-parser/Src/Sunra/PhpSimple/simplehtmldom_1_5/testcase/std_testcase.php new file mode 100644 index 000000000..57d9f10aa --- /dev/null +++ b/vendor/sunra/php-simple-html-dom-parser/Src/Sunra/PhpSimple/simplehtmldom_1_5/testcase/std_testcase.php @@ -0,0 +1,243 @@ +load($str); +assert($dom->save()==$str); +// ----------------------------------------------- +$str = null; +$dom->load($str); +assert($dom->save()==$str); + +// ----------------------------------------------------------------------------- +// text test +$str = << + +HTML; +$dom->load($str); +assert(count($dom->find('unknown'))==1); +assert(count($dom->find('text'))==1); + +// ----------------------------------------------------------------------------- +// string quote test +$str = << + okok
                          + +
                          +
                          + +
                          +
                          + +HTML; +$dom->load($str); +$es = $dom->find('input'); +assert(count($es)==4); +assert($es[0]->onclick=='goto("url0")'); +assert($es[1]->onclick=="goto('url1'+'\'')"); +assert($es[2]->onclick=="goto('url2')"); +assert($es[3]->onclick=='goto("url4"+"\"")'); + +// ----------------------------------------------------------------------------- +// clone test +$str = << + okok
                          + +
                          +
                          + +
                          +
                          + +HTML; +$dom->load($str); +$es = $dom->find('input'); +assert(count($es)==4); +assert($es[0]->onclick=='goto("url0")'); +assert($es[1]->onclick=="goto('url1'+'\'')"); +assert($es[2]->onclick=="goto('url2')"); +assert($es[3]->onclick=='goto("url4"+"\"")'); + +unset($es); +$dom2 = clone($dom); +$es = $dom2->find('input'); +assert(count($es)==4); +assert($es[0]->onclick=='goto("url0")'); +assert($es[1]->onclick=="goto('url1'+'\'')"); +assert($es[2]->onclick=="goto('url2')"); +assert($es[3]->onclick=='goto("url4"+"\"")'); + +// ----------------------------------------------- +$str = << +HTML; +$dom->load($str); +assert($dom==$str); +assert($dom->save()==$str); + +// ----------------------------------------------------------------------------- +// monkey test +$str = <<load($str); +assert($dom==$str); +assert($dom->save()==$str); +// ----------------------------------------------- +$str = <<load($str); +assert($dom==$str); +assert($dom->save()==$str); +// ----------------------------------------------- +$str = <<load($str); +assert($dom==$str); +assert($dom->save()==$str); +// ----------------------------------------------- +$str = <<load($str); +assert($dom==$str); +assert($dom->save()==$str); +// ----------------------------------------------- +$str = <<load($str); +assert($dom==$str); +assert($dom->save()==$str); +// ----------------------------------------------- +$str = <<load($str); +assert($dom==$str); +assert($dom->save()==$str); +// ----------------------------------------------- +$str = <<load($str); +assert($dom==$str); +assert($dom->save()==$str); +// ----------------------------------------------- +$str = <<<<>ab +HTML; +$dom->load($str); +assert($dom==$str); +assert($dom->save()==$str); +// ----------------------------------------------- +$str = <<load($str); +assert($dom==$str); +assert($dom->save()==$str); +// ----------------------------------------------- +$str = << +HTML; +$dom->load($str); +assert($dom==$str); +assert($dom->save()==$str); +// ----------------------------------------------- +// $str = <<load($str); +// echo $dom; +// assert($dom==$str); +// assert($dom->save()==$str); +// ----------------------------------------------- +$str = <<load($str); +assert($dom==$str); +assert($dom->save()==$str); + +// ----------------------------------------------------------------------------- +// rnadom string test +function str_random($length) +{ + $str = ""; + srand((double)microtime()*1000000); + $char_list = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"; + $char_list .= "abcdefghijklmnopqrstuvwxyz"; + $char_list .= "1234567890"; + $char_list .= "<>!?[]%^&*()"; + for($i=0; $i<$length; ++$i) + $str .= substr($char_list,(rand()%(strlen($char_list))), 1); + return $str; +} + +for($i=0; $i<60; ++$i) { + $str = str_random($i); + //echo $str."\n
                          "; + $dom->load($str, false); + //echo $dom->save()."\n
                          "; + assert($dom==$str); +} + +// ----------------------------------------------------------------------------- +// lowercase test +$str = << +HTML; +$dom->load($str); +assert(count($dom->find('img'))==1); +assert(count($dom->find('IMG'))==1); +assert(isset($dom->find('img', 0)->class)); +assert(!isset($dom->find('img', 0)->CLASS)); +assert($dom->find('img', 0)->class=='class0'); +assert($dom==$str); +// ----------------------------------------------- +$str = << +HTML; +$dom->load($str); +assert(count($dom->find('img'))==1); +assert(count($dom->find('IMG'))==1); +assert(isset($dom->find('img', 0)->class)); +assert(!isset($dom->find('img', 0)->CLASS)); +assert($dom->find('img', 0)->class=='class0'); +assert($dom==strtolower($str)); +// ----------------------------------------------- +$str = << +HTML; +$dom->load($str, false); +assert(count($dom->find('img'))==0); +assert(count($dom->find('IMG'))==1); +assert(isset($dom->find('IMG', 0)->CLASS)); +assert(!isset($dom->find('IMG', 0)->class)); +assert($dom->find('IMG', 0)->CLASS=='class0'); +assert($dom==$str); + +// ----------------------------------------------------------------------------- +// tear down +$dom->clear(); +unset($dom); +?> \ No newline at end of file diff --git a/vendor/sunra/php-simple-html-dom-parser/Src/Sunra/PhpSimple/simplehtmldom_1_5/testcase/strip_testcase.php b/vendor/sunra/php-simple-html-dom-parser/Src/Sunra/PhpSimple/simplehtmldom_1_5/testcase/strip_testcase.php new file mode 100644 index 000000000..66a45f6b2 --- /dev/null +++ b/vendor/sunra/php-simple-html-dom-parser/Src/Sunra/PhpSimple/simplehtmldom_1_5/testcase/strip_testcase.php @@ -0,0 +1,137 @@ + + + +HTML; +$dom->load($str); +assert(count($dom->find('input'))==0); + +// ----------------------------------------------------------------------------- +// test +$str = << + + + + +HTML; +$dom->load($str); +assert(count($dom->find('code'))==1); +assert(count($dom->find('input'))==0); + +// ----------------------------------------------------------------------------- +//
                           &  test
                          +$str = <<
                          +    
                          +
                          +HTML; +$dom->load($str); +assert(count($dom->find('pre'))==1); +assert(count($dom->find('input'))==0); + +// ----------------------------------------------------------------------------- +// + +HTML; +$dom->load($str); +assert(count($dom->find('style'))==1); +assert(count($dom->find('script'))==3); + +// ----------------------------------------------------------------------------- +// php short tag test +$str = <<hello + +HTML; +$dom->load($str); +assert($dom->find('a', 0)->href===""); +assert($dom->find('input', 0)->value===""); + +// ----------------------------------------------------------------------------- +// noise stripping test +$str = <<--> + + +HTML; +$dom->load($str); +assert(count($dom->find('img'))==1); +assert($dom==$str); +// ----------------------------------------------- +$str = <<ss + + + + + + + + + + + + + +HTML; +$dom->load($str); +assert(count($dom->find('script'))==8); +assert(count($dom->find('style'))==3); +//echo "\n\n\n\n".$dom->save(); +assert($dom==$str); + +// ----------------------------------------------------------------------------- +// tear down +$dom->clear(); +unset($dom); +?> \ No newline at end of file diff --git a/vendor/sunra/php-simple-html-dom-parser/composer.json b/vendor/sunra/php-simple-html-dom-parser/composer.json new file mode 100644 index 000000000..6d21ae1c5 --- /dev/null +++ b/vendor/sunra/php-simple-html-dom-parser/composer.json @@ -0,0 +1,24 @@ +{ + "name": "sunra/php-simple-html-dom-parser", + "type": "library", + "description": "Composer adaptation of: A HTML DOM parser written in PHP5+ let you manipulate HTML in a very easy way! Require PHP 5+. Supports invalid HTML. Find tags on an HTML page with selectors just like jQuery. Extract contents from HTML in a single line.", + "keywords": ["html", "dom", "parser"], + "homepage": "https://github.com/sunra/php-simple-html-dom-parser", + "license": "MIT", + "authors": [ + { + "homepage": "http://sourceforge.net/projects/simplehtmldom/" + }, + { + "name": "Sunra", + "email": "sunra@yandex.ru", + "homepage": "https://github.com/sunra" + } + ], + "require": { + "php": ">=5.3.2" + }, + "autoload": { + "psr-0": { "Sunra\\PhpSimple\\HtmlDomParser": "Src/" } + } +} \ No newline at end of file