From 370fd8c85193e081ebf499ca334076a27866f312 Mon Sep 17 00:00:00 2001 From: Julio Montoya Date: Mon, 2 Feb 2015 09:42:59 +0100 Subject: [PATCH] Adds composer as autoloader instead of custom autoloader see #7501 Adds HTMLpurifier as a composer package see #7502 --- .gitattributes | 11 + composer.json | 34 +- composer.lock | 142 +- main/course_notice/index.php | 2 +- main/document/file.php | 36 +- main/inc/autoload.inc.php | 18 - main/inc/global.inc.php | 4 +- main/inc/lib/autoload.class.php | 2 +- main/inc/lib/htmlpurifier/README | 24 - main/inc/lib/htmlpurifier/VERSION | 1 - .../lib/htmlpurifier/configdoc/generate.php | 64 - .../inc/lib/htmlpurifier/configdoc/index.html | 6 - .../htmlpurifier/configdoc/styles/index.html | 6 - .../htmlpurifier/configdoc/styles/plain.css | 44 - .../htmlpurifier/configdoc/styles/plain.xsl | 253 -- main/inc/lib/htmlpurifier/configdoc/types.xml | 69 - main/inc/lib/htmlpurifier/configdoc/usage.xml | 472 -- .../extras/ConfigDoc/HTMLXSLTProcessor.php | 86 - .../htmlpurifier/extras/ConfigDoc/index.html | 6 - main/inc/lib/htmlpurifier/extras/FSTools.php | 157 - .../lib/htmlpurifier/extras/FSTools/File.php | 126 - .../htmlpurifier/extras/FSTools/index.html | 6 - .../extras/HTMLPurifierExtras.auto.php | 11 - .../extras/HTMLPurifierExtras.autoload.php | 25 - .../extras/HTMLPurifierExtras.php | 29 - main/inc/lib/htmlpurifier/extras/README | 32 - main/inc/lib/htmlpurifier/extras/index.html | 6 - main/inc/lib/htmlpurifier/index.html | 6 - .../library/HTMLPurifier.auto.php | 11 - .../library/HTMLPurifier.autoload.php | 26 - .../library/HTMLPurifier.func.php | 23 - .../library/HTMLPurifier.includes.php | 212 - .../library/HTMLPurifier.kses.php | 30 - .../library/HTMLPurifier.path.php | 11 - .../lib/htmlpurifier/library/HTMLPurifier.php | 237 - .../library/HTMLPurifier.safe-includes.php | 206 - .../library/HTMLPurifier/AttrCollections.php | 128 - .../library/HTMLPurifier/AttrDef.php | 123 - .../library/HTMLPurifier/AttrDef/CSS.php | 87 - .../HTMLPurifier/AttrDef/CSS/AlphaValue.php | 21 - .../HTMLPurifier/AttrDef/CSS/Background.php | 87 - .../AttrDef/CSS/BackgroundPosition.php | 133 - .../HTMLPurifier/AttrDef/CSS/Border.php | 43 - .../HTMLPurifier/AttrDef/CSS/Color.php | 78 - .../HTMLPurifier/AttrDef/CSS/Composite.php | 38 - .../AttrDef/CSS/DenyElementDecorator.php | 28 - .../HTMLPurifier/AttrDef/CSS/Filter.php | 54 - .../library/HTMLPurifier/AttrDef/CSS/Font.php | 149 - .../HTMLPurifier/AttrDef/CSS/FontFamily.php | 72 - .../AttrDef/CSS/ImportantDecorator.php | 40 - .../HTMLPurifier/AttrDef/CSS/Length.php | 47 - .../HTMLPurifier/AttrDef/CSS/ListStyle.php | 78 - .../HTMLPurifier/AttrDef/CSS/Multiple.php | 58 - .../HTMLPurifier/AttrDef/CSS/Number.php | 69 - .../HTMLPurifier/AttrDef/CSS/Percentage.php | 40 - .../AttrDef/CSS/TextDecoration.php | 38 - .../library/HTMLPurifier/AttrDef/CSS/URI.php | 52 - .../HTMLPurifier/AttrDef/CSS/index.html | 6 - .../library/HTMLPurifier/AttrDef/Enum.php | 65 - .../HTMLPurifier/AttrDef/HTML/Bool.php | 28 - .../HTMLPurifier/AttrDef/HTML/Class.php | 34 - .../HTMLPurifier/AttrDef/HTML/Color.php | 32 - .../HTMLPurifier/AttrDef/HTML/FrameTarget.php | 21 - .../library/HTMLPurifier/AttrDef/HTML/ID.php | 70 - .../HTMLPurifier/AttrDef/HTML/Length.php | 41 - .../HTMLPurifier/AttrDef/HTML/LinkTypes.php | 53 - .../HTMLPurifier/AttrDef/HTML/MultiLength.php | 41 - .../HTMLPurifier/AttrDef/HTML/Nmtokens.php | 52 - .../HTMLPurifier/AttrDef/HTML/Pixels.php | 48 - .../HTMLPurifier/AttrDef/HTML/index.html | 6 - .../library/HTMLPurifier/AttrDef/Integer.php | 73 - .../library/HTMLPurifier/AttrDef/Lang.php | 73 - .../library/HTMLPurifier/AttrDef/Switch.php | 34 - .../library/HTMLPurifier/AttrDef/Text.php | 15 - .../library/HTMLPurifier/AttrDef/URI.php | 77 - .../HTMLPurifier/AttrDef/URI/Email.php | 17 - .../AttrDef/URI/Email/SimpleCheck.php | 21 - .../HTMLPurifier/AttrDef/URI/Email/index.html | 6 - .../library/HTMLPurifier/AttrDef/URI/Host.php | 68 - .../library/HTMLPurifier/AttrDef/URI/IPv4.php | 39 - .../library/HTMLPurifier/AttrDef/URI/IPv6.php | 99 - .../HTMLPurifier/AttrDef/URI/index.html | 6 - .../library/HTMLPurifier/AttrDef/index.html | 6 - .../library/HTMLPurifier/AttrTransform.php | 56 - .../HTMLPurifier/AttrTransform/Background.php | 23 - .../HTMLPurifier/AttrTransform/BdoDir.php | 19 - .../HTMLPurifier/AttrTransform/BgColor.php | 23 - .../HTMLPurifier/AttrTransform/BoolToCSS.php | 36 - .../HTMLPurifier/AttrTransform/Border.php | 18 - .../HTMLPurifier/AttrTransform/EnumToCSS.php | 58 - .../AttrTransform/ImgRequired.php | 43 - .../HTMLPurifier/AttrTransform/ImgSpace.php | 44 - .../HTMLPurifier/AttrTransform/Input.php | 40 - .../HTMLPurifier/AttrTransform/Lang.php | 28 - .../HTMLPurifier/AttrTransform/Length.php | 27 - .../HTMLPurifier/AttrTransform/Name.php | 21 - .../HTMLPurifier/AttrTransform/NameSync.php | 27 - .../HTMLPurifier/AttrTransform/SafeEmbed.php | 20 - .../HTMLPurifier/AttrTransform/SafeObject.php | 16 - .../HTMLPurifier/AttrTransform/SafeParam.php | 67 - .../AttrTransform/ScriptRequired.php | 16 - .../HTMLPurifier/AttrTransform/Textarea.php | 18 - .../HTMLPurifier/AttrTransform/index.html | 6 - .../library/HTMLPurifier/AttrTypes.php | 77 - .../library/HTMLPurifier/AttrValidator.php | 162 - .../library/HTMLPurifier/Bootstrap.php | 104 - .../library/HTMLPurifier/CSSDefinition.php | 301 -- .../library/HTMLPurifier/ChildDef.php | 48 - .../HTMLPurifier/ChildDef/Chameleon.php | 48 - .../library/HTMLPurifier/ChildDef/Custom.php | 90 - .../library/HTMLPurifier/ChildDef/Empty.php | 20 - .../HTMLPurifier/ChildDef/Optional.php | 26 - .../HTMLPurifier/ChildDef/Required.php | 117 - .../ChildDef/StrictBlockquote.php | 88 - .../library/HTMLPurifier/ChildDef/Table.php | 142 - .../library/HTMLPurifier/ChildDef/index.html | 6 - .../library/HTMLPurifier/Config.php | 709 --- .../library/HTMLPurifier/ConfigSchema.php | 164 - .../ConfigSchema/Builder/ConfigSchema.php | 44 - .../HTMLPurifier/ConfigSchema/Builder/Xml.php | 106 - .../ConfigSchema/Builder/index.html | 6 - .../HTMLPurifier/ConfigSchema/Exception.php | 11 - .../HTMLPurifier/ConfigSchema/Interchange.php | 42 - .../ConfigSchema/Interchange/Directive.php | 77 - .../ConfigSchema/Interchange/Id.php | 37 - .../ConfigSchema/Interchange/index.html | 6 - .../ConfigSchema/InterchangeBuilder.php | 180 - .../HTMLPurifier/ConfigSchema/Validator.php | 206 - .../ConfigSchema/ValidatorAtom.php | 66 - .../HTMLPurifier/ConfigSchema/index.html | 6 - .../HTMLPurifier/ConfigSchema/schema.ser | Bin 13701 -> 0 bytes .../schema/Attr.AllowedClasses.txt | 8 - .../schema/Attr.AllowedFrameTargets.txt | 12 - .../ConfigSchema/schema/Attr.AllowedRel.txt | 9 - .../ConfigSchema/schema/Attr.AllowedRev.txt | 9 - .../schema/Attr.ClassUseCDATA.txt | 19 - .../schema/Attr.DefaultImageAlt.txt | 11 - .../schema/Attr.DefaultInvalidImage.txt | 9 - .../schema/Attr.DefaultInvalidImageAlt.txt | 8 - .../schema/Attr.DefaultTextDir.txt | 10 - .../ConfigSchema/schema/Attr.EnableID.txt | 16 - .../schema/Attr.ForbiddenClasses.txt | 8 - .../ConfigSchema/schema/Attr.IDBlacklist.txt | 5 - .../schema/Attr.IDBlacklistRegexp.txt | 9 - .../ConfigSchema/schema/Attr.IDPrefix.txt | 12 - .../schema/Attr.IDPrefixLocal.txt | 14 - .../schema/AutoFormat.AutoParagraph.txt | 31 - .../ConfigSchema/schema/AutoFormat.Custom.txt | 12 - .../schema/AutoFormat.DisplayLinkURI.txt | 11 - .../schema/AutoFormat.Linkify.txt | 12 - .../AutoFormat.PurifierLinkify.DocURL.txt | 12 - .../schema/AutoFormat.PurifierLinkify.txt | 12 - ...rmat.RemoveEmpty.RemoveNbsp.Exceptions.txt | 11 - .../AutoFormat.RemoveEmpty.RemoveNbsp.txt | 15 - .../schema/AutoFormat.RemoveEmpty.txt | 46 - ...utoFormat.RemoveSpansWithoutAttributes.txt | 11 - .../schema/CSS.AllowImportant.txt | 8 - .../ConfigSchema/schema/CSS.AllowTricky.txt | 11 - .../schema/CSS.AllowedProperties.txt | 18 - .../ConfigSchema/schema/CSS.DefinitionRev.txt | 11 - .../schema/CSS.ForbiddenProperties.txt | 13 - .../ConfigSchema/schema/CSS.MaxImgLength.txt | 16 - .../ConfigSchema/schema/CSS.Proprietary.txt | 10 - .../schema/Cache.DefinitionImpl.txt | 14 - .../schema/Cache.SerializerPath.txt | 13 - .../schema/Core.AggressivelyFixLt.txt | 18 - .../schema/Core.CollectErrors.txt | 12 - .../schema/Core.ColorKeywords.txt | 28 - .../schema/Core.ConvertDocumentToFragment.txt | 14 - .../Core.DirectLexLineNumberSyncInterval.txt | 17 - .../ConfigSchema/schema/Core.Encoding.txt | 15 - .../schema/Core.EscapeInvalidChildren.txt | 10 - .../schema/Core.EscapeInvalidTags.txt | 7 - .../schema/Core.EscapeNonASCIICharacters.txt | 13 - .../schema/Core.HiddenElements.txt | 19 - .../ConfigSchema/schema/Core.Language.txt | 10 - .../ConfigSchema/schema/Core.LexerImpl.txt | 34 - .../schema/Core.MaintainLineNumbers.txt | 16 - .../schema/Core.NormalizeNewlines.txt | 11 - .../schema/Core.RemoveInvalidImg.txt | 12 - .../Core.RemoveProcessingInstructions.txt | 11 - .../schema/Core.RemoveScriptContents.txt | 12 - .../ConfigSchema/schema/Filter.Custom.txt | 11 - .../Filter.ExtractStyleBlocks.Escaping.txt | 14 - .../Filter.ExtractStyleBlocks.Scope.txt | 29 - .../Filter.ExtractStyleBlocks.TidyImpl.txt | 16 - .../schema/Filter.ExtractStyleBlocks.txt | 74 - .../ConfigSchema/schema/Filter.YouTube.txt | 16 - .../ConfigSchema/schema/HTML.Allowed.txt | 25 - .../schema/HTML.AllowedAttributes.txt | 19 - .../schema/HTML.AllowedElements.txt | 23 - .../schema/HTML.AllowedModules.txt | 20 - .../schema/HTML.Attr.Name.UseCDATA.txt | 11 - .../ConfigSchema/schema/HTML.BlockWrapper.txt | 18 - .../ConfigSchema/schema/HTML.CoreModules.txt | 23 - .../schema/HTML.CustomDoctype.txt | 9 - .../ConfigSchema/schema/HTML.DefinitionID.txt | 33 - .../schema/HTML.DefinitionRev.txt | 16 - .../ConfigSchema/schema/HTML.Doctype.txt | 11 - .../schema/HTML.FlashAllowFullScreen.txt | 11 - .../schema/HTML.ForbiddenAttributes.txt | 21 - .../schema/HTML.ForbiddenElements.txt | 20 - .../ConfigSchema/schema/HTML.MaxImgLength.txt | 14 - .../ConfigSchema/schema/HTML.Parent.txt | 12 - .../ConfigSchema/schema/HTML.Proprietary.txt | 12 - .../ConfigSchema/schema/HTML.SafeEmbed.txt | 13 - .../ConfigSchema/schema/HTML.SafeObject.txt | 13 - .../ConfigSchema/schema/HTML.Strict.txt | 9 - .../ConfigSchema/schema/HTML.TidyAdd.txt | 8 - .../ConfigSchema/schema/HTML.TidyLevel.txt | 24 - .../ConfigSchema/schema/HTML.TidyRemove.txt | 8 - .../ConfigSchema/schema/HTML.Trusted.txt | 8 - .../ConfigSchema/schema/HTML.XHTML.txt | 11 - .../schema/Output.CommentScriptContents.txt | 10 - .../schema/Output.FlashCompat.txt | 11 - .../ConfigSchema/schema/Output.Newline.txt | 13 - .../ConfigSchema/schema/Output.SortAttr.txt | 14 - .../ConfigSchema/schema/Output.TidyFormat.txt | 25 - .../ConfigSchema/schema/Test.ForceNoIconv.txt | 7 - .../schema/URI.AllowedSchemes.txt | 17 - .../ConfigSchema/schema/URI.Base.txt | 17 - .../ConfigSchema/schema/URI.DefaultScheme.txt | 10 - .../ConfigSchema/schema/URI.DefinitionID.txt | 11 - .../ConfigSchema/schema/URI.DefinitionRev.txt | 11 - .../ConfigSchema/schema/URI.Disable.txt | 14 - .../schema/URI.DisableExternal.txt | 11 - .../schema/URI.DisableExternalResources.txt | 13 - .../schema/URI.DisableResources.txt | 15 - .../ConfigSchema/schema/URI.Host.txt | 19 - .../ConfigSchema/schema/URI.HostBlacklist.txt | 9 - .../ConfigSchema/schema/URI.MakeAbsolute.txt | 13 - .../ConfigSchema/schema/URI.Munge.txt | 83 - .../schema/URI.MungeResources.txt | 17 - .../schema/URI.MungeSecretKey.txt | 30 - .../schema/URI.OverrideAllowedSchemes.txt | 9 - .../ConfigSchema/schema/index.html | 6 - .../HTMLPurifier/ConfigSchema/schema/info.ini | 3 - .../library/HTMLPurifier/ContentSets.php | 155 - .../library/HTMLPurifier/Context.php | 82 - .../library/HTMLPurifier/Definition.php | 50 - .../library/HTMLPurifier/DefinitionCache.php | 108 - .../DefinitionCache/Decorator.php | 62 - .../DefinitionCache/Decorator/Cleanup.php | 43 - .../DefinitionCache/Decorator/Memory.php | 46 - .../DefinitionCache/Decorator/Template.php.in | 47 - .../DefinitionCache/Decorator/index.html | 6 - .../HTMLPurifier/DefinitionCache/Null.php | 39 - .../DefinitionCache/Serializer.php | 172 - .../DefinitionCache/Serializer/README | 3 - .../DefinitionCache/Serializer/index.html | 6 - .../HTMLPurifier/DefinitionCache/index.html | 6 - .../HTMLPurifier/DefinitionCacheFactory.php | 91 - .../library/HTMLPurifier/Doctype.php | 60 - .../library/HTMLPurifier/DoctypeRegistry.php | 103 - .../library/HTMLPurifier/ElementDef.php | 183 - .../library/HTMLPurifier/Encoder.php | 448 -- .../library/HTMLPurifier/EntityLookup.php | 44 - .../HTMLPurifier/EntityLookup/entities.ser | 1 - .../HTMLPurifier/EntityLookup/index.html | 6 - .../library/HTMLPurifier/EntityParser.php | 144 - .../library/HTMLPurifier/ErrorCollector.php | 209 - .../library/HTMLPurifier/ErrorStruct.php | 60 - .../library/HTMLPurifier/Exception.php | 12 - .../library/HTMLPurifier/Filter.php | 46 - .../HTMLPurifier/Filter/AllowIframes.php | 65 - .../Filter/ExtractStyleBlocks.php | 135 - .../library/HTMLPurifier/Filter/YouTube.php | 39 - .../library/HTMLPurifier/Filter/index.html | 6 - .../library/HTMLPurifier/Generator.php | 229 - .../library/HTMLPurifier/HTMLDefinition.php | 425 -- .../library/HTMLPurifier/HTMLModule.php | 244 -- .../library/HTMLPurifier/HTMLModule/Bdo.php | 31 - .../HTMLModule/CommonAttributes.php | 26 - .../library/HTMLPurifier/HTMLModule/Edit.php | 38 - .../library/HTMLPurifier/HTMLModule/Forms.php | 118 - .../HTMLPurifier/HTMLModule/Hypertext.php | 31 - .../library/HTMLPurifier/HTMLModule/Image.php | 40 - .../HTMLPurifier/HTMLModule/Legacy.php | 143 - .../library/HTMLPurifier/HTMLModule/List.php | 37 - .../library/HTMLPurifier/HTMLModule/Name.php | 21 - .../HTMLModule/NonXMLCommonAttributes.php | 14 - .../HTMLPurifier/HTMLModule/Object.php | 47 - .../HTMLPurifier/HTMLModule/Presentation.php | 36 - .../HTMLPurifier/HTMLModule/Proprietary.php | 33 - .../library/HTMLPurifier/HTMLModule/Ruby.php | 27 - .../HTMLPurifier/HTMLModule/SafeEmbed.php | 35 - .../HTMLPurifier/HTMLModule/SafeObject.php | 53 - .../HTMLPurifier/HTMLModule/Scripting.php | 54 - .../HTMLModule/StyleAttribute.php | 24 - .../HTMLPurifier/HTMLModule/Tables.php | 66 - .../HTMLPurifier/HTMLModule/Target.php | 23 - .../library/HTMLPurifier/HTMLModule/Text.php | 71 - .../library/HTMLPurifier/HTMLModule/Tidy.php | 207 - .../HTMLPurifier/HTMLModule/Tidy/Name.php | 24 - .../HTMLModule/Tidy/Proprietary.php | 24 - .../HTMLPurifier/HTMLModule/Tidy/Strict.php | 21 - .../HTMLModule/Tidy/Transitional.php | 9 - .../HTMLPurifier/HTMLModule/Tidy/XHTML.php | 17 - .../HTMLModule/Tidy/XHTMLAndHTML4.php | 161 - .../HTMLPurifier/HTMLModule/Tidy/index.html | 6 - .../HTMLModule/XMLCommonAttributes.php | 14 - .../HTMLPurifier/HTMLModule/index.html | 6 - .../HTMLPurifier/HTMLModuleManager.php | 400 -- .../library/HTMLPurifier/IDAccumulator.php | 53 - .../library/HTMLPurifier/Injector.php | 239 - .../HTMLPurifier/Injector/AutoParagraph.php | 345 -- .../HTMLPurifier/Injector/DisplayLinkURI.php | 26 - .../library/HTMLPurifier/Injector/Linkify.php | 46 - .../HTMLPurifier/Injector/PurifierLinkify.php | 45 - .../HTMLPurifier/Injector/RemoveEmpty.php | 51 - .../Injector/RemoveSpansWithoutAttributes.php | 60 - .../HTMLPurifier/Injector/SafeObject.php | 95 - .../library/HTMLPurifier/Injector/index.html | 6 - .../library/HTMLPurifier/Language.php | 163 - .../Language/classes/en-x-test.php | 12 - .../HTMLPurifier/Language/classes/index.html | 6 - .../library/HTMLPurifier/Language/index.html | 6 - .../Language/messages/en-x-test.php | 11 - .../Language/messages/en-x-testmini.php | 12 - .../HTMLPurifier/Language/messages/en.php | 63 - .../HTMLPurifier/Language/messages/index.html | 6 - .../library/HTMLPurifier/LanguageFactory.php | 198 - .../library/HTMLPurifier/Length.php | 115 - .../library/HTMLPurifier/Lexer.php | 326 -- .../library/HTMLPurifier/Lexer/DOMLex.php | 213 - .../library/HTMLPurifier/Lexer/DirectLex.php | 490 --- .../library/HTMLPurifier/Lexer/PEARSax3.php | 139 - .../library/HTMLPurifier/Lexer/PH5P.php | 3904 ----------------- .../library/HTMLPurifier/Lexer/index.html | 6 - .../library/HTMLPurifier/PercentEncoder.php | 98 - .../library/HTMLPurifier/Printer.php | 176 - .../HTMLPurifier/Printer/CSSDefinition.php | 38 - .../HTMLPurifier/Printer/ConfigForm.css | 10 - .../HTMLPurifier/Printer/ConfigForm.js | 5 - .../HTMLPurifier/Printer/ConfigForm.php | 368 -- .../HTMLPurifier/Printer/HTMLDefinition.php | 272 -- .../library/HTMLPurifier/Printer/index.html | 6 - .../library/HTMLPurifier/PropertyList.php | 86 - .../HTMLPurifier/PropertyListIterator.php | 32 - .../library/HTMLPurifier/Strategy.php | 26 - .../HTMLPurifier/Strategy/Composite.php | 25 - .../library/HTMLPurifier/Strategy/Core.php | 18 - .../HTMLPurifier/Strategy/FixNesting.php | 328 -- .../HTMLPurifier/Strategy/MakeWellFormed.php | 475 -- .../Strategy/RemoveForeignElements.php | 171 - .../Strategy/ValidateAttributes.php | 39 - .../library/HTMLPurifier/Strategy/index.html | 6 - .../library/HTMLPurifier/StringHash.php | 39 - .../library/HTMLPurifier/StringHashParser.php | 110 - .../library/HTMLPurifier/TagTransform.php | 36 - .../HTMLPurifier/TagTransform/Font.php | 96 - .../HTMLPurifier/TagTransform/Simple.php | 35 - .../HTMLPurifier/TagTransform/index.html | 6 - .../library/HTMLPurifier/Token.php | 57 - .../library/HTMLPurifier/Token/Comment.php | 22 - .../library/HTMLPurifier/Token/Empty.php | 11 - .../library/HTMLPurifier/Token/End.php | 19 - .../library/HTMLPurifier/Token/Start.php | 11 - .../library/HTMLPurifier/Token/Tag.php | 56 - .../library/HTMLPurifier/Token/Text.php | 33 - .../library/HTMLPurifier/Token/index.html | 6 - .../library/HTMLPurifier/TokenFactory.php | 94 - .../htmlpurifier/library/HTMLPurifier/URI.php | 173 - .../library/HTMLPurifier/URIDefinition.php | 93 - .../library/HTMLPurifier/URIFilter.php | 45 - .../URIFilter/DisableExternal.php | 23 - .../URIFilter/DisableExternalResources.php | 12 - .../URIFilter/DisableResources.php | 11 - .../HTMLPurifier/URIFilter/HostBlacklist.php | 21 - .../HTMLPurifier/URIFilter/MakeAbsolute.php | 114 - .../library/HTMLPurifier/URIFilter/Munge.php | 58 - .../library/HTMLPurifier/URIFilter/index.html | 6 - .../library/HTMLPurifier/URIParser.php | 70 - .../library/HTMLPurifier/URIScheme.php | 42 - .../library/HTMLPurifier/URIScheme/data.php | 93 - .../library/HTMLPurifier/URIScheme/file.php | 26 - .../library/HTMLPurifier/URIScheme/ftp.php | 43 - .../library/HTMLPurifier/URIScheme/http.php | 20 - .../library/HTMLPurifier/URIScheme/https.php | 12 - .../library/HTMLPurifier/URIScheme/index.html | 6 - .../library/HTMLPurifier/URIScheme/mailto.php | 27 - .../library/HTMLPurifier/URIScheme/news.php | 22 - .../library/HTMLPurifier/URIScheme/nntp.php | 20 - .../HTMLPurifier/URISchemeRegistry.php | 68 - .../library/HTMLPurifier/UnitConverter.php | 254 -- .../library/HTMLPurifier/VarParser.php | 154 - .../HTMLPurifier/VarParser/Flexible.php | 103 - .../library/HTMLPurifier/VarParser/Native.php | 26 - .../library/HTMLPurifier/VarParser/index.html | 6 - .../HTMLPurifier/VarParserException.php | 11 - .../library/HTMLPurifier/index.html | 6 - main/inc/lib/htmlpurifier/library/index.html | 6 - .../lib/htmlpurifier/maintenance/.htaccess | 1 - .../lib/htmlpurifier/maintenance/PH5P.patch | 102 - .../inc/lib/htmlpurifier/maintenance/PH5P.php | 3824 ---------------- .../htmlpurifier/maintenance/add-vimline.php | 131 - .../lib/htmlpurifier/maintenance/common.php | 22 - .../maintenance/compile-doxygen.sh | 11 - .../maintenance/config-scanner.php | 153 - .../maintenance/flush-definition-cache.php | 42 - .../lib/htmlpurifier/maintenance/flush.php | 29 - .../maintenance/generate-entity-file.php | 74 - .../maintenance/generate-includes.php | 190 - .../maintenance/generate-ph5p-patch.php | 22 - .../maintenance/generate-schema-cache.php | 45 - .../maintenance/generate-standalone.php | 152 - .../lib/htmlpurifier/maintenance/index.html | 6 - .../maintenance/merge-library.php | 11 - .../maintenance/old-extract-schema.php | 70 - .../maintenance/old-remove-require-once.php | 32 - .../maintenance/old-remove-schema-def.php | 32 - .../maintenance/phpt-modifications.patch | 367 -- .../maintenance/regenerate-docs.sh | 5 - .../remove-trailing-whitespace.php | 37 - .../maintenance/rename-config.php | 84 - .../maintenance/update-config.php | 34 - .../maintenance/update-freshmeat.php | 156 - main/inc/lib/htmlpurifier/plugins/index.html | 6 - main/inc/lib/htmlpurifier/plugins/modx.txt | 112 - .../htmlpurifier/plugins/phorum/.gitignore | 2 - .../lib/htmlpurifier/plugins/phorum/Changelog | 27 - .../lib/htmlpurifier/plugins/phorum/INSTALL | 84 - .../lib/htmlpurifier/plugins/phorum/README | 45 - .../plugins/phorum/config.default.php | 57 - .../plugins/phorum/htmlpurifier.php | 309 -- .../plugins/phorum/htmlpurifier/LICENSE | 504 --- .../plugins/phorum/htmlpurifier/README | 3 - .../plugins/phorum/htmlpurifier/index.html | 6 - .../htmlpurifier/plugins/phorum/index.html | 6 - .../lib/htmlpurifier/plugins/phorum/info.txt | 18 - .../plugins/phorum/init-config.php | 28 - .../plugins/phorum/migrate.bbcode.php | 30 - .../htmlpurifier/plugins/phorum/settings.php | 64 - .../plugins/phorum/settings/form.php | 93 - .../plugins/phorum/settings/index.html | 6 - .../phorum/settings/migrate-sigs-form.php | 22 - .../plugins/phorum/settings/migrate-sigs.php | 77 - .../plugins/phorum/settings/save.php | 27 - main/inc/lib/security.lib.php | 4 - main/install/index.php | 30 +- main/work/file.php | 34 +- tests/phpunit/autoload.php | 2 +- vendor/autoload.php | 2 +- vendor/composer/ClassLoader.php | 1 + vendor/composer/autoload_classmap.php | 1405 ++++++ vendor/composer/autoload_files.php | 2 +- vendor/composer/autoload_namespaces.php | 1 + vendor/composer/autoload_real.php | 13 +- vendor/composer/installed.json | 587 +-- vendor/doctrine/cache/composer.json | 3 +- .../lib/Doctrine/Common/Cache/ApcCache.php | 10 +- .../lib/Doctrine/Common/Cache/ArrayCache.php | 1 + .../cache/lib/Doctrine/Common/Cache/Cache.php | 11 +- .../Doctrine/Common/Cache/CacheProvider.php | 50 +- .../lib/Doctrine/Common/Cache/FileCache.php | 97 +- .../Doctrine/Common/Cache/FilesystemCache.php | 28 +- .../Doctrine/Common/Cache/MemcachedCache.php | 8 + .../Doctrine/Common/Cache/PhpFileCache.php | 20 +- .../lib/Doctrine/Common/Cache/RedisCache.php | 3 + .../lib/Doctrine/Common/Cache/XcacheCache.php | 7 +- .../Doctrine/Tests/Common/Cache/CacheTest.php | 51 + .../Tests/Common/Cache/FileCacheTest.php | 106 +- vendor/monolog/monolog/CHANGELOG.mdown | 14 + vendor/monolog/monolog/README.mdown | 20 +- vendor/monolog/monolog/composer.json | 4 +- vendor/monolog/monolog/doc/usage.md | 2 +- .../Formatter/GelfMessageFormatter.php | 2 +- .../src/Monolog/Formatter/HtmlFormatter.php | 4 +- .../src/Monolog/Formatter/JsonFormatter.php | 6 +- .../src/Monolog/Formatter/LineFormatter.php | 37 +- .../Monolog/Formatter/NormalizerFormatter.php | 4 +- .../Monolog/Handler/ExceptionTestHandler.php | 34 - .../src/Monolog/Handler/FilterHandler.php | 10 +- .../Monolog/Handler/FingersCrossedHandler.php | 7 +- .../src/Monolog/Handler/HandlerInterface.php | 2 +- .../src/Monolog/Handler/HipChatHandler.php | 5 +- .../src/Monolog/Handler/LogEntriesHandler.php | 2 - .../src/Monolog/Handler/MandrillHandler.php | 1 + .../Handler/MissingExtensionException.php | 1 - .../Monolog/Handler/NativeMailerHandler.php | 8 + .../src/Monolog/Handler/NewRelicHandler.php | 84 +- .../src/Monolog/Handler/PushoverHandler.php | 35 +- .../src/Monolog/Handler/RavenHandler.php | 6 + .../src/Monolog/Handler/SlackHandler.php | 85 +- .../src/Monolog/Handler/SocketHandler.php | 1 - .../src/Monolog/Handler/StreamHandler.php | 2 +- .../Monolog/Handler/SyslogUdp/UdpSocket.php | 26 +- .../src/Monolog/Handler/SyslogUdpHandler.php | 4 +- .../Handler/WhatFailureGroupHandler.php | 2 +- vendor/monolog/monolog/src/Monolog/Logger.php | 32 +- .../src/Monolog/Processor/MemoryProcessor.php | 1 - .../src/Monolog/Processor/WebProcessor.php | 2 +- .../Formatter/GelfMessageFormatterTest.php | 2 - .../Monolog/Formatter/JsonFormatterTest.php | 1 - .../Monolog/Formatter/LineFormatterTest.php | 4 +- .../Formatter/LogstashFormatterTest.php | 3 - .../Formatter/NormalizerFormatterTest.php | 67 +- .../Monolog/Formatter/ScalarFormatterTest.php | 6 +- .../Handler/BrowserConsoleHandlerTest.php | 1 - .../Monolog/Handler/ErrorLogHandlerTest.php | 1 - .../Monolog/Handler/FleepHookHandlerTest.php | 2 - .../tests/Monolog/Handler/GelfHandlerTest.php | 2 - .../Monolog/Handler/HipChatHandlerTest.php | 1 - .../Monolog/Handler/MongoDBHandlerTest.php | 4 +- .../Handler/NativeMailerHandlerTest.php | 18 + .../Monolog/Handler/NewRelicHandlerTest.php | 59 + .../Monolog/Handler/PushoverHandlerTest.php | 1 - .../Monolog/Handler/SlackHandlerTest.php | 6 +- .../Monolog/Handler/SocketHandlerTest.php | 1 - .../Monolog/Handler/StreamHandlerTest.php | 4 +- .../Monolog/Handler/SyslogHandlerTest.php | 1 + .../Monolog/Handler/SyslogUdpHandlerTest.php | 4 +- .../tests/Monolog/Handler/UdpSocketTest.php | 25 +- .../Handler/WhatFailureGroupHandlerTest.php | 16 +- .../Processor/PsrLogMessageProcessorTest.php | 2 - vendor/sabre/vobject/ChangeLog.md | 30 +- vendor/sabre/vobject/LICENSE | 2 +- vendor/sabre/vobject/README.md | 1 + vendor/sabre/vobject/lib/Cli.php | 4 +- vendor/sabre/vobject/lib/Component.php | 40 +- vendor/sabre/vobject/lib/Component/VAlarm.php | 2 +- .../sabre/vobject/lib/Component/VCalendar.php | 94 +- vendor/sabre/vobject/lib/Component/VCard.php | 62 +- vendor/sabre/vobject/lib/Component/VEvent.php | 2 +- .../sabre/vobject/lib/Component/VFreeBusy.php | 2 +- .../sabre/vobject/lib/Component/VJournal.php | 2 +- .../sabre/vobject/lib/Component/VTimeZone.php | 2 +- vendor/sabre/vobject/lib/Component/VTodo.php | 2 +- vendor/sabre/vobject/lib/DateTimeParser.php | 2 +- vendor/sabre/vobject/lib/Document.php | 2 +- vendor/sabre/vobject/lib/ElementList.php | 2 +- vendor/sabre/vobject/lib/EofException.php | 2 +- .../sabre/vobject/lib/FreeBusyGenerator.php | 2 +- vendor/sabre/vobject/lib/ITip/Broker.php | 5 +- .../sabre/vobject/lib/ITip/ITipException.php | 2 +- vendor/sabre/vobject/lib/ITip/Message.php | 2 +- ...SameOrganizerForAllComponentsException.php | 2 +- vendor/sabre/vobject/lib/Node.php | 23 +- vendor/sabre/vobject/lib/Parameter.php | 2 +- vendor/sabre/vobject/lib/ParseException.php | 2 +- vendor/sabre/vobject/lib/Parser/Json.php | 2 +- vendor/sabre/vobject/lib/Parser/MimeDir.php | 18 +- vendor/sabre/vobject/lib/Parser/Parser.php | 2 +- vendor/sabre/vobject/lib/Property.php | 2 +- vendor/sabre/vobject/lib/Property/Binary.php | 2 +- vendor/sabre/vobject/lib/Property/Boolean.php | 2 +- .../sabre/vobject/lib/Property/FlatText.php | 2 +- vendor/sabre/vobject/lib/Property/Float.php | 2 +- .../lib/Property/ICalendar/CalAddress.php | 2 +- .../vobject/lib/Property/ICalendar/Date.php | 2 +- .../lib/Property/ICalendar/DateTime.php | 22 +- .../lib/Property/ICalendar/Duration.php | 2 +- .../vobject/lib/Property/ICalendar/Period.php | 2 +- .../vobject/lib/Property/ICalendar/Recur.php | 2 +- vendor/sabre/vobject/lib/Property/Integer.php | 2 +- vendor/sabre/vobject/lib/Property/Text.php | 2 +- vendor/sabre/vobject/lib/Property/Time.php | 2 +- vendor/sabre/vobject/lib/Property/Unknown.php | 2 +- vendor/sabre/vobject/lib/Property/Uri.php | 2 +- .../sabre/vobject/lib/Property/UtcOffset.php | 2 +- .../sabre/vobject/lib/Property/VCard/Date.php | 2 +- .../lib/Property/VCard/DateAndOrTime.php | 2 +- .../vobject/lib/Property/VCard/DateTime.php | 2 +- .../lib/Property/VCard/LanguageTag.php | 2 +- .../vobject/lib/Property/VCard/TimeStamp.php | 2 +- vendor/sabre/vobject/lib/Reader.php | 2 +- .../sabre/vobject/lib/Recur/EventIterator.php | 14 +- .../lib/Recur/NoInstancesException.php | 2 +- .../sabre/vobject/lib/Recur/RDateIterator.php | 2 +- .../sabre/vobject/lib/Recur/RRuleIterator.php | 2 +- .../sabre/vobject/lib/RecurrenceIterator.php | 2 +- .../sabre/vobject/lib/Splitter/ICalendar.php | 2 +- .../lib/Splitter/SplitterInterface.php | 2 +- vendor/sabre/vobject/lib/Splitter/VCard.php | 2 +- vendor/sabre/vobject/lib/StringUtil.php | 2 +- vendor/sabre/vobject/lib/TimeZoneUtil.php | 2 +- vendor/sabre/vobject/lib/UUIDUtil.php | 2 +- vendor/sabre/vobject/lib/VCardConverter.php | 10 +- vendor/sabre/vobject/lib/Version.php | 4 +- .../lib/timezonedata/exchangezones.php | 2 +- .../vobject/lib/timezonedata/lotuszones.php | 2 +- .../sabre/vobject/lib/timezonedata/php-bc.php | 4 +- .../lib/timezonedata/php-workaround.php | 2 +- .../vobject/lib/timezonedata/windowszones.php | 4 +- .../sabre/vobject/tests/VObject/CliTest.php | 3 +- .../tests/VObject/Component/VCalendarTest.php | 172 + .../tests/VObject/Component/VCardTest.php | 112 + .../VObject/ITip/BrokerProcessReplyTest.php | 9 +- .../tests/VObject/ITip/BrokerTester.php | 2 +- .../sabre/vobject/tests/VObject/JCalTest.php | 8 + .../vobject/tests/VObject/ReaderTest.php | 16 +- .../tests/VObject/VCardConverterTest.php | 77 +- .../Symfony/Component/Console/Application.php | 38 +- .../Component/Console/Command/Command.php | 5 +- .../Component/Console/Command/HelpCommand.php | 2 +- .../Descriptor/ApplicationDescription.php | 2 + .../Console/Descriptor/Descriptor.php | 6 +- .../Console/Descriptor/JsonDescriptor.php | 2 + .../Console/Descriptor/MarkdownDescriptor.php | 2 + .../Console/Descriptor/TextDescriptor.php | 2 + .../Console/Descriptor/XmlDescriptor.php | 2 + .../Formatter/OutputFormatterStyle.php | 1 - .../Console/Helper/DescriptorHelper.php | 6 +- .../Component/Console/Helper/DialogHelper.php | 11 +- .../Component/Console/Helper/ProgressBar.php | 20 +- .../Console/Helper/ProgressHelper.php | 14 +- .../Console/Helper/QuestionHelper.php | 26 +- .../Component/Console/Helper/Table.php | 12 +- .../Component/Console/Helper/TableHelper.php | 3 +- .../Component/Console/Helper/TableStyle.php | 2 +- .../Component/Console/Input/ArgvInput.php | 6 +- .../Component/Console/Input/ArrayInput.php | 2 +- .../Symfony/Component/Console/Input/Input.php | 2 +- .../console/Symfony/Component/Console/LICENSE | 2 +- .../Console/Logger/ConsoleLogger.php | 6 +- .../Console/Question/ChoiceQuestion.php | 14 +- .../Console/Question/ConfirmationQuestion.php | 11 + .../Component/Console/Question/Question.php | 18 +- .../Console/Tester/ApplicationTester.php | 2 +- .../Console/Tester/CommandTester.php | 2 +- .../Console/Tests/ApplicationTest.php | 9 +- .../Console/Tests/Command/CommandTest.php | 8 +- .../Console/Tests/Fixtures/application_1.json | 2 +- .../Console/Tests/Fixtures/application_1.md | 14 +- .../Console/Tests/Fixtures/application_1.txt | 14 +- .../Console/Tests/Fixtures/application_1.xml | 14 +- .../Console/Tests/Fixtures/application_2.json | 2 +- .../Console/Tests/Fixtures/application_2.md | 42 +- .../Console/Tests/Fixtures/application_2.txt | 14 +- .../Console/Tests/Fixtures/application_2.xml | 42 +- .../Tests/Fixtures/application_astext1.txt | 14 +- .../Tests/Fixtures/application_astext2.txt | 14 +- .../Tests/Fixtures/application_asxml1.txt | 28 +- .../Tests/Fixtures/application_asxml2.txt | 14 +- .../Tests/Fixtures/application_run1.txt | 14 +- .../Tests/Fixtures/application_run2.txt | 14 +- .../Console/Tests/Fixtures/command_astext.txt | 14 +- .../Console/Tests/Fixtures/command_asxml.txt | 14 +- .../Console/Tests/Helper/DialogHelperTest.php | 192 - .../Tests/Helper/ProcessHelperTest.php | 2 +- .../Tests/Helper/ProgressHelperTest.php | 224 - .../Tests/Helper/QuestionHelperTest.php | 8 +- .../Console/Tests/Helper/TableHelperTest.php | 294 -- .../Tests/Input/InputDefinitionTest.php | 10 +- .../Console/Tests/Input/StringInputTest.php | 10 +- .../Component/Console/phpunit.xml.dist | 4 + .../Filesystem/Exception/IOException.php | 2 +- .../Component/Filesystem/Filesystem.php | 27 +- .../Symfony/Component/Filesystem/LICENSE | 2 +- .../Filesystem/Tests/FilesystemTest.php | 42 +- .../Filesystem/Tests/FilesystemTestCase.php | 14 +- .../Component/Filesystem/phpunit.xml.dist | 4 + .../Component/Process/ExecutableFinder.php | 4 +- .../process/Symfony/Component/Process/LICENSE | 2 +- .../Component/Process/PhpExecutableFinder.php | 2 +- .../Component/Process/Pipes/UnixPipes.php | 2 +- .../Component/Process/Pipes/WindowsPipes.php | 2 +- .../Symfony/Component/Process/Process.php | 45 +- .../Component/Process/ProcessBuilder.php | 6 +- .../Component/Process/ProcessUtils.php | 6 +- .../Process/Tests/AbstractProcessTest.php | 111 +- .../Process/Tests/ExecutableFinderTest.php | 14 +- .../Process/Tests/NonStopableProcess.php | 3 +- .../Process/Tests/PhpExecutableFinderTest.php | 10 +- .../Process/Tests/ProcessBuilderTest.php | 16 +- .../Tests/ProcessFailedExceptionTest.php | 4 +- .../Process/Tests/ProcessUtilsTest.php | 2 +- .../Tests/SigchildEnabledProcessTest.php | 2 +- .../Process/Tests/SimpleProcessTest.php | 6 +- .../Component/Process/phpunit.xml.dist | 4 + .../yaml/Symfony/Component/Yaml/Inline.php | 2 +- .../yaml/Symfony/Component/Yaml/LICENSE | 2 +- .../yaml/Symfony/Component/Yaml/Parser.php | 14 +- .../yaml/Symfony/Component/Yaml/README.md | 2 +- .../Component/Yaml/Tests/DumperTest.php | 1 - .../Yaml/Tests/ParseExceptionTest.php | 1 - .../Component/Yaml/Tests/ParserTest.php | 2 - .../yaml/Symfony/Component/Yaml/Unescaper.php | 2 +- .../Symfony/Component/Yaml/phpunit.xml.dist | 4 + vendor/twig/twig/.gitignore | 5 +- vendor/twig/twig/CHANGELOG | 19 + vendor/twig/twig/composer.json | 4 +- vendor/twig/twig/doc/advanced.rst | 10 +- vendor/twig/twig/doc/advanced_legacy.rst | 6 +- vendor/twig/twig/doc/api.rst | 50 +- vendor/twig/twig/doc/filters/batch.rst | 2 +- vendor/twig/twig/doc/filters/index.rst | 4 +- vendor/twig/twig/doc/filters/slice.rst | 2 +- vendor/twig/twig/doc/installation.rst | 8 +- vendor/twig/twig/doc/intro.rst | 4 +- vendor/twig/twig/doc/tags/if.rst | 8 + vendor/twig/twig/doc/tags/index.rst | 2 +- vendor/twig/twig/doc/templates.rst | 2 +- vendor/twig/twig/ext/twig/php_twig.h | 2 +- vendor/twig/twig/lib/Twig/Autoloader.php | 2 +- vendor/twig/twig/lib/Twig/Compiler.php | 6 +- vendor/twig/twig/lib/Twig/Environment.php | 79 +- vendor/twig/twig/lib/Twig/Error.php | 4 +- .../twig/lib/Twig/ExistsLoaderInterface.php | 2 +- .../twig/twig/lib/Twig/ExpressionParser.php | 23 +- vendor/twig/twig/lib/Twig/Extension/Core.php | 37 +- .../twig/twig/lib/Twig/Extension/Escaper.php | 4 + .../twig/lib/Twig/Extension/StringLoader.php | 19 +- vendor/twig/twig/lib/Twig/Lexer.php | 2 - .../twig/twig/lib/Twig/Loader/Filesystem.php | 3 + vendor/twig/twig/lib/Twig/LoaderInterface.php | 2 +- vendor/twig/twig/lib/Twig/Node.php | 12 +- .../twig/lib/Twig/Node/Expression/Call.php | 48 +- .../twig/lib/Twig/Node/Expression/Name.php | 2 + .../twig/lib/Twig/Node/Expression/Unary.php | 7 +- vendor/twig/twig/lib/Twig/Node/Module.php | 101 +- .../twig/lib/Twig/Node/SandboxedModule.php | 96 - .../twig/lib/Twig/NodeVisitor/Optimizer.php | 12 +- .../twig/lib/Twig/NodeVisitor/Sandbox.php | 2 +- .../twig/lib/Twig/NodeVisitorInterface.php | 2 +- vendor/twig/twig/lib/Twig/Template.php | 74 +- .../lib/Twig/Test/IntegrationTestCase.php | 2 +- .../twig/twig/lib/Twig/Test/NodeTestCase.php | 8 +- vendor/twig/twig/lib/Twig/Token.php | 16 +- vendor/twig/twig/lib/Twig/TokenStream.php | 2 +- .../twig/twig/test/Twig/Tests/ErrorTest.php | 4 +- .../test/Twig/Tests/ExpressionParserTest.php | 4 +- .../twig/test/Twig/Tests/FileCachingTest.php | 9 + .../Twig/Tests/Fixtures/filters/slice.test | 4 + .../test/Twig/Tests/Fixtures/tests/in.test | 82 +- .../test/Twig/Tests/Loader/FilesystemTest.php | 6 + .../test/Twig/Tests/NativeExtensionTest.php | 10 +- .../test/Twig/Tests/Node/AutoEscapeTest.php | 12 - .../Twig/Tests/Node/BlockReferenceTest.php | 12 - .../twig/test/Twig/Tests/Node/BlockTest.php | 12 - .../twig/twig/test/Twig/Tests/Node/DoTest.php | 12 - .../Twig/Tests/Node/Expression/ArrayTest.php | 12 - .../Tests/Node/Expression/AssignNameTest.php | 12 - .../Tests/Node/Expression/Binary/AddTest.php | 13 - .../Tests/Node/Expression/Binary/AndTest.php | 13 - .../Node/Expression/Binary/ConcatTest.php | 13 - .../Tests/Node/Expression/Binary/DivTest.php | 13 - .../Node/Expression/Binary/FloorDivTest.php | 13 - .../Tests/Node/Expression/Binary/ModTest.php | 13 - .../Tests/Node/Expression/Binary/MulTest.php | 13 - .../Tests/Node/Expression/Binary/OrTest.php | 13 - .../Tests/Node/Expression/Binary/SubTest.php | 13 - .../Twig/Tests/Node/Expression/CallTest.php | 29 +- .../Tests/Node/Expression/ConditionalTest.php | 12 - .../Tests/Node/Expression/ConstantTest.php | 12 - .../Twig/Tests/Node/Expression/FilterTest.php | 14 +- .../Tests/Node/Expression/FunctionTest.php | 12 - .../Tests/Node/Expression/GetAttrTest.php | 18 +- .../Twig/Tests/Node/Expression/NameTest.php | 20 +- .../Twig/Tests/Node/Expression/ParentTest.php | 12 - .../Twig/Tests/Node/Expression/TestTest.php | 12 - .../Tests/Node/Expression/Unary/NegTest.php | 16 +- .../Tests/Node/Expression/Unary/NotTest.php | 15 +- .../Tests/Node/Expression/Unary/PosTest.php | 15 +- .../twig/test/Twig/Tests/Node/ForTest.php | 12 - .../twig/twig/test/Twig/Tests/Node/IfTest.php | 12 - .../twig/test/Twig/Tests/Node/ImportTest.php | 12 - .../twig/test/Twig/Tests/Node/IncludeTest.php | 12 - .../twig/test/Twig/Tests/Node/MacroTest.php | 12 - .../twig/test/Twig/Tests/Node/ModuleTest.php | 53 +- .../twig/test/Twig/Tests/Node/PrintTest.php | 12 - .../twig/test/Twig/Tests/Node/SandboxTest.php | 12 - .../Twig/Tests/Node/SandboxedModuleTest.php | 209 - .../Twig/Tests/Node/SandboxedPrintTest.php | 12 - .../twig/test/Twig/Tests/Node/SetTest.php | 12 - .../test/Twig/Tests/Node/SpacelessTest.php | 12 - .../twig/test/Twig/Tests/Node/TextTest.php | 12 - .../Twig/Tests/NodeVisitor/OptimizerTest.php | 10 + .../twig/test/Twig/Tests/TemplateTest.php | 6 +- .../twig/test/Twig/Tests/escapingTest.php | 11 +- 770 files changed, 4499 insertions(+), 36193 deletions(-) delete mode 100755 main/inc/autoload.inc.php delete mode 100755 main/inc/lib/htmlpurifier/README delete mode 100755 main/inc/lib/htmlpurifier/VERSION delete mode 100755 main/inc/lib/htmlpurifier/configdoc/generate.php delete mode 100755 main/inc/lib/htmlpurifier/configdoc/index.html delete mode 100755 main/inc/lib/htmlpurifier/configdoc/styles/index.html delete mode 100755 main/inc/lib/htmlpurifier/configdoc/styles/plain.css delete mode 100755 main/inc/lib/htmlpurifier/configdoc/styles/plain.xsl delete mode 100755 main/inc/lib/htmlpurifier/configdoc/types.xml delete mode 100755 main/inc/lib/htmlpurifier/configdoc/usage.xml delete mode 100755 main/inc/lib/htmlpurifier/extras/ConfigDoc/HTMLXSLTProcessor.php delete mode 100755 main/inc/lib/htmlpurifier/extras/ConfigDoc/index.html delete mode 100755 main/inc/lib/htmlpurifier/extras/FSTools.php delete mode 100755 main/inc/lib/htmlpurifier/extras/FSTools/File.php delete mode 100755 main/inc/lib/htmlpurifier/extras/FSTools/index.html delete mode 100755 main/inc/lib/htmlpurifier/extras/HTMLPurifierExtras.auto.php delete mode 100755 main/inc/lib/htmlpurifier/extras/HTMLPurifierExtras.autoload.php delete mode 100755 main/inc/lib/htmlpurifier/extras/HTMLPurifierExtras.php delete mode 100755 main/inc/lib/htmlpurifier/extras/README delete mode 100755 main/inc/lib/htmlpurifier/extras/index.html delete mode 100755 main/inc/lib/htmlpurifier/index.html delete mode 100755 main/inc/lib/htmlpurifier/library/HTMLPurifier.auto.php delete mode 100755 main/inc/lib/htmlpurifier/library/HTMLPurifier.autoload.php delete mode 100755 main/inc/lib/htmlpurifier/library/HTMLPurifier.func.php delete mode 100755 main/inc/lib/htmlpurifier/library/HTMLPurifier.includes.php delete mode 100755 main/inc/lib/htmlpurifier/library/HTMLPurifier.kses.php delete mode 100755 main/inc/lib/htmlpurifier/library/HTMLPurifier.path.php delete mode 100755 main/inc/lib/htmlpurifier/library/HTMLPurifier.php delete mode 100755 main/inc/lib/htmlpurifier/library/HTMLPurifier.safe-includes.php delete mode 100755 main/inc/lib/htmlpurifier/library/HTMLPurifier/AttrCollections.php delete mode 100755 main/inc/lib/htmlpurifier/library/HTMLPurifier/AttrDef.php delete mode 100755 main/inc/lib/htmlpurifier/library/HTMLPurifier/AttrDef/CSS.php delete mode 100755 main/inc/lib/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/AlphaValue.php delete mode 100755 main/inc/lib/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/Background.php delete mode 100755 main/inc/lib/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/BackgroundPosition.php delete mode 100755 main/inc/lib/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/Border.php delete mode 100755 main/inc/lib/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/Color.php delete mode 100755 main/inc/lib/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/Composite.php delete mode 100755 main/inc/lib/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/DenyElementDecorator.php delete mode 100755 main/inc/lib/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/Filter.php delete mode 100755 main/inc/lib/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/Font.php delete mode 100755 main/inc/lib/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/FontFamily.php delete mode 100755 main/inc/lib/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/ImportantDecorator.php delete mode 100755 main/inc/lib/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/Length.php delete mode 100755 main/inc/lib/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/ListStyle.php delete mode 100755 main/inc/lib/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/Multiple.php delete mode 100755 main/inc/lib/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/Number.php delete mode 100755 main/inc/lib/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/Percentage.php delete mode 100755 main/inc/lib/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/TextDecoration.php delete mode 100755 main/inc/lib/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/URI.php delete mode 100755 main/inc/lib/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/index.html delete mode 100755 main/inc/lib/htmlpurifier/library/HTMLPurifier/AttrDef/Enum.php delete mode 100755 main/inc/lib/htmlpurifier/library/HTMLPurifier/AttrDef/HTML/Bool.php delete mode 100755 main/inc/lib/htmlpurifier/library/HTMLPurifier/AttrDef/HTML/Class.php delete mode 100755 main/inc/lib/htmlpurifier/library/HTMLPurifier/AttrDef/HTML/Color.php delete mode 100755 main/inc/lib/htmlpurifier/library/HTMLPurifier/AttrDef/HTML/FrameTarget.php delete mode 100755 main/inc/lib/htmlpurifier/library/HTMLPurifier/AttrDef/HTML/ID.php delete mode 100755 main/inc/lib/htmlpurifier/library/HTMLPurifier/AttrDef/HTML/Length.php delete mode 100755 main/inc/lib/htmlpurifier/library/HTMLPurifier/AttrDef/HTML/LinkTypes.php delete mode 100755 main/inc/lib/htmlpurifier/library/HTMLPurifier/AttrDef/HTML/MultiLength.php delete mode 100755 main/inc/lib/htmlpurifier/library/HTMLPurifier/AttrDef/HTML/Nmtokens.php delete mode 100755 main/inc/lib/htmlpurifier/library/HTMLPurifier/AttrDef/HTML/Pixels.php delete mode 100755 main/inc/lib/htmlpurifier/library/HTMLPurifier/AttrDef/HTML/index.html delete mode 100755 main/inc/lib/htmlpurifier/library/HTMLPurifier/AttrDef/Integer.php delete mode 100755 main/inc/lib/htmlpurifier/library/HTMLPurifier/AttrDef/Lang.php delete mode 100755 main/inc/lib/htmlpurifier/library/HTMLPurifier/AttrDef/Switch.php delete mode 100755 main/inc/lib/htmlpurifier/library/HTMLPurifier/AttrDef/Text.php delete mode 100755 main/inc/lib/htmlpurifier/library/HTMLPurifier/AttrDef/URI.php delete mode 100755 main/inc/lib/htmlpurifier/library/HTMLPurifier/AttrDef/URI/Email.php delete mode 100755 main/inc/lib/htmlpurifier/library/HTMLPurifier/AttrDef/URI/Email/SimpleCheck.php delete mode 100755 main/inc/lib/htmlpurifier/library/HTMLPurifier/AttrDef/URI/Email/index.html delete mode 100755 main/inc/lib/htmlpurifier/library/HTMLPurifier/AttrDef/URI/Host.php delete mode 100755 main/inc/lib/htmlpurifier/library/HTMLPurifier/AttrDef/URI/IPv4.php delete mode 100755 main/inc/lib/htmlpurifier/library/HTMLPurifier/AttrDef/URI/IPv6.php delete mode 100755 main/inc/lib/htmlpurifier/library/HTMLPurifier/AttrDef/URI/index.html delete mode 100755 main/inc/lib/htmlpurifier/library/HTMLPurifier/AttrDef/index.html delete mode 100755 main/inc/lib/htmlpurifier/library/HTMLPurifier/AttrTransform.php delete mode 100755 main/inc/lib/htmlpurifier/library/HTMLPurifier/AttrTransform/Background.php delete mode 100755 main/inc/lib/htmlpurifier/library/HTMLPurifier/AttrTransform/BdoDir.php delete mode 100755 main/inc/lib/htmlpurifier/library/HTMLPurifier/AttrTransform/BgColor.php delete mode 100755 main/inc/lib/htmlpurifier/library/HTMLPurifier/AttrTransform/BoolToCSS.php delete mode 100755 main/inc/lib/htmlpurifier/library/HTMLPurifier/AttrTransform/Border.php delete mode 100755 main/inc/lib/htmlpurifier/library/HTMLPurifier/AttrTransform/EnumToCSS.php delete mode 100755 main/inc/lib/htmlpurifier/library/HTMLPurifier/AttrTransform/ImgRequired.php delete mode 100755 main/inc/lib/htmlpurifier/library/HTMLPurifier/AttrTransform/ImgSpace.php delete mode 100755 main/inc/lib/htmlpurifier/library/HTMLPurifier/AttrTransform/Input.php delete mode 100755 main/inc/lib/htmlpurifier/library/HTMLPurifier/AttrTransform/Lang.php delete mode 100755 main/inc/lib/htmlpurifier/library/HTMLPurifier/AttrTransform/Length.php delete mode 100755 main/inc/lib/htmlpurifier/library/HTMLPurifier/AttrTransform/Name.php delete mode 100755 main/inc/lib/htmlpurifier/library/HTMLPurifier/AttrTransform/NameSync.php delete mode 100755 main/inc/lib/htmlpurifier/library/HTMLPurifier/AttrTransform/SafeEmbed.php delete mode 100755 main/inc/lib/htmlpurifier/library/HTMLPurifier/AttrTransform/SafeObject.php delete mode 100755 main/inc/lib/htmlpurifier/library/HTMLPurifier/AttrTransform/SafeParam.php delete mode 100755 main/inc/lib/htmlpurifier/library/HTMLPurifier/AttrTransform/ScriptRequired.php delete mode 100755 main/inc/lib/htmlpurifier/library/HTMLPurifier/AttrTransform/Textarea.php delete mode 100755 main/inc/lib/htmlpurifier/library/HTMLPurifier/AttrTransform/index.html delete mode 100755 main/inc/lib/htmlpurifier/library/HTMLPurifier/AttrTypes.php delete mode 100755 main/inc/lib/htmlpurifier/library/HTMLPurifier/AttrValidator.php delete mode 100755 main/inc/lib/htmlpurifier/library/HTMLPurifier/Bootstrap.php delete mode 100755 main/inc/lib/htmlpurifier/library/HTMLPurifier/CSSDefinition.php delete mode 100755 main/inc/lib/htmlpurifier/library/HTMLPurifier/ChildDef.php delete mode 100755 main/inc/lib/htmlpurifier/library/HTMLPurifier/ChildDef/Chameleon.php delete mode 100755 main/inc/lib/htmlpurifier/library/HTMLPurifier/ChildDef/Custom.php delete mode 100755 main/inc/lib/htmlpurifier/library/HTMLPurifier/ChildDef/Empty.php delete mode 100755 main/inc/lib/htmlpurifier/library/HTMLPurifier/ChildDef/Optional.php delete mode 100755 main/inc/lib/htmlpurifier/library/HTMLPurifier/ChildDef/Required.php delete mode 100755 main/inc/lib/htmlpurifier/library/HTMLPurifier/ChildDef/StrictBlockquote.php delete mode 100755 main/inc/lib/htmlpurifier/library/HTMLPurifier/ChildDef/Table.php delete mode 100755 main/inc/lib/htmlpurifier/library/HTMLPurifier/ChildDef/index.html delete mode 100755 main/inc/lib/htmlpurifier/library/HTMLPurifier/Config.php delete mode 100755 main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema.php delete mode 100755 main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/Builder/ConfigSchema.php delete mode 100755 main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/Builder/Xml.php delete mode 100755 main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/Builder/index.html delete mode 100755 main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/Exception.php delete mode 100755 main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/Interchange.php delete mode 100755 main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/Interchange/Directive.php delete mode 100755 main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/Interchange/Id.php delete mode 100755 main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/Interchange/index.html delete mode 100755 main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/InterchangeBuilder.php delete mode 100755 main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/Validator.php delete mode 100755 main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/ValidatorAtom.php delete mode 100755 main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/index.html delete mode 100755 main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema.ser delete mode 100755 main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Attr.AllowedClasses.txt delete mode 100755 main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Attr.AllowedFrameTargets.txt delete mode 100755 main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Attr.AllowedRel.txt delete mode 100755 main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Attr.AllowedRev.txt delete mode 100755 main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Attr.ClassUseCDATA.txt delete mode 100755 main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Attr.DefaultImageAlt.txt delete mode 100755 main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Attr.DefaultInvalidImage.txt delete mode 100755 main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Attr.DefaultInvalidImageAlt.txt delete mode 100755 main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Attr.DefaultTextDir.txt delete mode 100755 main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Attr.EnableID.txt delete mode 100755 main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Attr.ForbiddenClasses.txt delete mode 100755 main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Attr.IDBlacklist.txt delete mode 100755 main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Attr.IDBlacklistRegexp.txt delete mode 100755 main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Attr.IDPrefix.txt delete mode 100755 main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Attr.IDPrefixLocal.txt delete mode 100755 main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/AutoFormat.AutoParagraph.txt delete mode 100755 main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/AutoFormat.Custom.txt delete mode 100755 main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/AutoFormat.DisplayLinkURI.txt delete mode 100755 main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/AutoFormat.Linkify.txt delete mode 100755 main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/AutoFormat.PurifierLinkify.DocURL.txt delete mode 100755 main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/AutoFormat.PurifierLinkify.txt delete mode 100755 main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/AutoFormat.RemoveEmpty.RemoveNbsp.Exceptions.txt delete mode 100755 main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/AutoFormat.RemoveEmpty.RemoveNbsp.txt delete mode 100755 main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/AutoFormat.RemoveEmpty.txt delete mode 100755 main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/AutoFormat.RemoveSpansWithoutAttributes.txt delete mode 100755 main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/CSS.AllowImportant.txt delete mode 100755 main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/CSS.AllowTricky.txt delete mode 100755 main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/CSS.AllowedProperties.txt delete mode 100755 main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/CSS.DefinitionRev.txt delete mode 100755 main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/CSS.ForbiddenProperties.txt delete mode 100755 main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/CSS.MaxImgLength.txt delete mode 100755 main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/CSS.Proprietary.txt delete mode 100755 main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Cache.DefinitionImpl.txt delete mode 100755 main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Cache.SerializerPath.txt delete mode 100755 main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Core.AggressivelyFixLt.txt delete mode 100755 main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Core.CollectErrors.txt delete mode 100755 main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Core.ColorKeywords.txt delete mode 100755 main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Core.ConvertDocumentToFragment.txt delete mode 100755 main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Core.DirectLexLineNumberSyncInterval.txt delete mode 100755 main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Core.Encoding.txt delete mode 100755 main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Core.EscapeInvalidChildren.txt delete mode 100755 main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Core.EscapeInvalidTags.txt delete mode 100755 main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Core.EscapeNonASCIICharacters.txt delete mode 100755 main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Core.HiddenElements.txt delete mode 100755 main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Core.Language.txt delete mode 100755 main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Core.LexerImpl.txt delete mode 100755 main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Core.MaintainLineNumbers.txt delete mode 100755 main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Core.NormalizeNewlines.txt delete mode 100755 main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Core.RemoveInvalidImg.txt delete mode 100755 main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Core.RemoveProcessingInstructions.txt delete mode 100755 main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Core.RemoveScriptContents.txt delete mode 100755 main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Filter.Custom.txt delete mode 100755 main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Filter.ExtractStyleBlocks.Escaping.txt delete mode 100755 main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Filter.ExtractStyleBlocks.Scope.txt delete mode 100755 main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Filter.ExtractStyleBlocks.TidyImpl.txt delete mode 100755 main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Filter.ExtractStyleBlocks.txt delete mode 100755 main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Filter.YouTube.txt delete mode 100755 main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/HTML.Allowed.txt delete mode 100755 main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/HTML.AllowedAttributes.txt delete mode 100755 main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/HTML.AllowedElements.txt delete mode 100755 main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/HTML.AllowedModules.txt delete mode 100755 main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/HTML.Attr.Name.UseCDATA.txt delete mode 100755 main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/HTML.BlockWrapper.txt delete mode 100755 main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/HTML.CoreModules.txt delete mode 100755 main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/HTML.CustomDoctype.txt delete mode 100755 main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/HTML.DefinitionID.txt delete mode 100755 main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/HTML.DefinitionRev.txt delete mode 100755 main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/HTML.Doctype.txt delete mode 100755 main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/HTML.FlashAllowFullScreen.txt delete mode 100755 main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/HTML.ForbiddenAttributes.txt delete mode 100755 main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/HTML.ForbiddenElements.txt delete mode 100755 main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/HTML.MaxImgLength.txt delete mode 100755 main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/HTML.Parent.txt delete mode 100755 main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/HTML.Proprietary.txt delete mode 100755 main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/HTML.SafeEmbed.txt delete mode 100755 main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/HTML.SafeObject.txt delete mode 100755 main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/HTML.Strict.txt delete mode 100755 main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/HTML.TidyAdd.txt delete mode 100755 main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/HTML.TidyLevel.txt delete mode 100755 main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/HTML.TidyRemove.txt delete mode 100755 main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/HTML.Trusted.txt delete mode 100755 main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/HTML.XHTML.txt delete mode 100755 main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Output.CommentScriptContents.txt delete mode 100755 main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Output.FlashCompat.txt delete mode 100755 main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Output.Newline.txt delete mode 100755 main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Output.SortAttr.txt delete mode 100755 main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Output.TidyFormat.txt delete mode 100755 main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Test.ForceNoIconv.txt delete mode 100755 main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/URI.AllowedSchemes.txt delete mode 100755 main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/URI.Base.txt delete mode 100755 main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/URI.DefaultScheme.txt delete mode 100755 main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/URI.DefinitionID.txt delete mode 100755 main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/URI.DefinitionRev.txt delete mode 100755 main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/URI.Disable.txt delete mode 100755 main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/URI.DisableExternal.txt delete mode 100755 main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/URI.DisableExternalResources.txt delete mode 100755 main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/URI.DisableResources.txt delete mode 100755 main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/URI.Host.txt delete mode 100755 main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/URI.HostBlacklist.txt delete mode 100755 main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/URI.MakeAbsolute.txt delete mode 100755 main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/URI.Munge.txt delete mode 100755 main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/URI.MungeResources.txt delete mode 100755 main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/URI.MungeSecretKey.txt delete mode 100755 main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/URI.OverrideAllowedSchemes.txt delete mode 100755 main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/index.html delete mode 100755 main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/info.ini delete mode 100755 main/inc/lib/htmlpurifier/library/HTMLPurifier/ContentSets.php delete mode 100755 main/inc/lib/htmlpurifier/library/HTMLPurifier/Context.php delete mode 100755 main/inc/lib/htmlpurifier/library/HTMLPurifier/Definition.php delete mode 100755 main/inc/lib/htmlpurifier/library/HTMLPurifier/DefinitionCache.php delete mode 100755 main/inc/lib/htmlpurifier/library/HTMLPurifier/DefinitionCache/Decorator.php delete mode 100755 main/inc/lib/htmlpurifier/library/HTMLPurifier/DefinitionCache/Decorator/Cleanup.php delete mode 100755 main/inc/lib/htmlpurifier/library/HTMLPurifier/DefinitionCache/Decorator/Memory.php delete mode 100755 main/inc/lib/htmlpurifier/library/HTMLPurifier/DefinitionCache/Decorator/Template.php.in delete mode 100755 main/inc/lib/htmlpurifier/library/HTMLPurifier/DefinitionCache/Decorator/index.html delete mode 100755 main/inc/lib/htmlpurifier/library/HTMLPurifier/DefinitionCache/Null.php delete mode 100755 main/inc/lib/htmlpurifier/library/HTMLPurifier/DefinitionCache/Serializer.php delete mode 100755 main/inc/lib/htmlpurifier/library/HTMLPurifier/DefinitionCache/Serializer/README delete mode 100755 main/inc/lib/htmlpurifier/library/HTMLPurifier/DefinitionCache/Serializer/index.html delete mode 100755 main/inc/lib/htmlpurifier/library/HTMLPurifier/DefinitionCache/index.html delete mode 100755 main/inc/lib/htmlpurifier/library/HTMLPurifier/DefinitionCacheFactory.php delete mode 100755 main/inc/lib/htmlpurifier/library/HTMLPurifier/Doctype.php delete mode 100755 main/inc/lib/htmlpurifier/library/HTMLPurifier/DoctypeRegistry.php delete mode 100755 main/inc/lib/htmlpurifier/library/HTMLPurifier/ElementDef.php delete mode 100755 main/inc/lib/htmlpurifier/library/HTMLPurifier/Encoder.php delete mode 100755 main/inc/lib/htmlpurifier/library/HTMLPurifier/EntityLookup.php delete mode 100755 main/inc/lib/htmlpurifier/library/HTMLPurifier/EntityLookup/entities.ser delete mode 100755 main/inc/lib/htmlpurifier/library/HTMLPurifier/EntityLookup/index.html delete mode 100755 main/inc/lib/htmlpurifier/library/HTMLPurifier/EntityParser.php delete mode 100755 main/inc/lib/htmlpurifier/library/HTMLPurifier/ErrorCollector.php delete mode 100755 main/inc/lib/htmlpurifier/library/HTMLPurifier/ErrorStruct.php delete mode 100755 main/inc/lib/htmlpurifier/library/HTMLPurifier/Exception.php delete mode 100755 main/inc/lib/htmlpurifier/library/HTMLPurifier/Filter.php delete mode 100755 main/inc/lib/htmlpurifier/library/HTMLPurifier/Filter/AllowIframes.php delete mode 100755 main/inc/lib/htmlpurifier/library/HTMLPurifier/Filter/ExtractStyleBlocks.php delete mode 100755 main/inc/lib/htmlpurifier/library/HTMLPurifier/Filter/YouTube.php delete mode 100755 main/inc/lib/htmlpurifier/library/HTMLPurifier/Filter/index.html delete mode 100755 main/inc/lib/htmlpurifier/library/HTMLPurifier/Generator.php delete mode 100755 main/inc/lib/htmlpurifier/library/HTMLPurifier/HTMLDefinition.php delete mode 100755 main/inc/lib/htmlpurifier/library/HTMLPurifier/HTMLModule.php delete mode 100755 main/inc/lib/htmlpurifier/library/HTMLPurifier/HTMLModule/Bdo.php delete mode 100755 main/inc/lib/htmlpurifier/library/HTMLPurifier/HTMLModule/CommonAttributes.php delete mode 100755 main/inc/lib/htmlpurifier/library/HTMLPurifier/HTMLModule/Edit.php delete mode 100755 main/inc/lib/htmlpurifier/library/HTMLPurifier/HTMLModule/Forms.php delete mode 100755 main/inc/lib/htmlpurifier/library/HTMLPurifier/HTMLModule/Hypertext.php delete mode 100755 main/inc/lib/htmlpurifier/library/HTMLPurifier/HTMLModule/Image.php delete mode 100755 main/inc/lib/htmlpurifier/library/HTMLPurifier/HTMLModule/Legacy.php delete mode 100755 main/inc/lib/htmlpurifier/library/HTMLPurifier/HTMLModule/List.php delete mode 100755 main/inc/lib/htmlpurifier/library/HTMLPurifier/HTMLModule/Name.php delete mode 100755 main/inc/lib/htmlpurifier/library/HTMLPurifier/HTMLModule/NonXMLCommonAttributes.php delete mode 100755 main/inc/lib/htmlpurifier/library/HTMLPurifier/HTMLModule/Object.php delete mode 100755 main/inc/lib/htmlpurifier/library/HTMLPurifier/HTMLModule/Presentation.php delete mode 100755 main/inc/lib/htmlpurifier/library/HTMLPurifier/HTMLModule/Proprietary.php delete mode 100755 main/inc/lib/htmlpurifier/library/HTMLPurifier/HTMLModule/Ruby.php delete mode 100755 main/inc/lib/htmlpurifier/library/HTMLPurifier/HTMLModule/SafeEmbed.php delete mode 100755 main/inc/lib/htmlpurifier/library/HTMLPurifier/HTMLModule/SafeObject.php delete mode 100755 main/inc/lib/htmlpurifier/library/HTMLPurifier/HTMLModule/Scripting.php delete mode 100755 main/inc/lib/htmlpurifier/library/HTMLPurifier/HTMLModule/StyleAttribute.php delete mode 100755 main/inc/lib/htmlpurifier/library/HTMLPurifier/HTMLModule/Tables.php delete mode 100755 main/inc/lib/htmlpurifier/library/HTMLPurifier/HTMLModule/Target.php delete mode 100755 main/inc/lib/htmlpurifier/library/HTMLPurifier/HTMLModule/Text.php delete mode 100755 main/inc/lib/htmlpurifier/library/HTMLPurifier/HTMLModule/Tidy.php delete mode 100755 main/inc/lib/htmlpurifier/library/HTMLPurifier/HTMLModule/Tidy/Name.php delete mode 100755 main/inc/lib/htmlpurifier/library/HTMLPurifier/HTMLModule/Tidy/Proprietary.php delete mode 100755 main/inc/lib/htmlpurifier/library/HTMLPurifier/HTMLModule/Tidy/Strict.php delete mode 100755 main/inc/lib/htmlpurifier/library/HTMLPurifier/HTMLModule/Tidy/Transitional.php delete mode 100755 main/inc/lib/htmlpurifier/library/HTMLPurifier/HTMLModule/Tidy/XHTML.php delete mode 100755 main/inc/lib/htmlpurifier/library/HTMLPurifier/HTMLModule/Tidy/XHTMLAndHTML4.php delete mode 100755 main/inc/lib/htmlpurifier/library/HTMLPurifier/HTMLModule/Tidy/index.html delete mode 100755 main/inc/lib/htmlpurifier/library/HTMLPurifier/HTMLModule/XMLCommonAttributes.php delete mode 100755 main/inc/lib/htmlpurifier/library/HTMLPurifier/HTMLModule/index.html delete mode 100755 main/inc/lib/htmlpurifier/library/HTMLPurifier/HTMLModuleManager.php delete mode 100755 main/inc/lib/htmlpurifier/library/HTMLPurifier/IDAccumulator.php delete mode 100755 main/inc/lib/htmlpurifier/library/HTMLPurifier/Injector.php delete mode 100755 main/inc/lib/htmlpurifier/library/HTMLPurifier/Injector/AutoParagraph.php delete mode 100755 main/inc/lib/htmlpurifier/library/HTMLPurifier/Injector/DisplayLinkURI.php delete mode 100755 main/inc/lib/htmlpurifier/library/HTMLPurifier/Injector/Linkify.php delete mode 100755 main/inc/lib/htmlpurifier/library/HTMLPurifier/Injector/PurifierLinkify.php delete mode 100755 main/inc/lib/htmlpurifier/library/HTMLPurifier/Injector/RemoveEmpty.php delete mode 100755 main/inc/lib/htmlpurifier/library/HTMLPurifier/Injector/RemoveSpansWithoutAttributes.php delete mode 100755 main/inc/lib/htmlpurifier/library/HTMLPurifier/Injector/SafeObject.php delete mode 100755 main/inc/lib/htmlpurifier/library/HTMLPurifier/Injector/index.html delete mode 100755 main/inc/lib/htmlpurifier/library/HTMLPurifier/Language.php delete mode 100755 main/inc/lib/htmlpurifier/library/HTMLPurifier/Language/classes/en-x-test.php delete mode 100755 main/inc/lib/htmlpurifier/library/HTMLPurifier/Language/classes/index.html delete mode 100755 main/inc/lib/htmlpurifier/library/HTMLPurifier/Language/index.html delete mode 100755 main/inc/lib/htmlpurifier/library/HTMLPurifier/Language/messages/en-x-test.php delete mode 100755 main/inc/lib/htmlpurifier/library/HTMLPurifier/Language/messages/en-x-testmini.php delete mode 100755 main/inc/lib/htmlpurifier/library/HTMLPurifier/Language/messages/en.php delete mode 100755 main/inc/lib/htmlpurifier/library/HTMLPurifier/Language/messages/index.html delete mode 100755 main/inc/lib/htmlpurifier/library/HTMLPurifier/LanguageFactory.php delete mode 100755 main/inc/lib/htmlpurifier/library/HTMLPurifier/Length.php delete mode 100755 main/inc/lib/htmlpurifier/library/HTMLPurifier/Lexer.php delete mode 100755 main/inc/lib/htmlpurifier/library/HTMLPurifier/Lexer/DOMLex.php delete mode 100755 main/inc/lib/htmlpurifier/library/HTMLPurifier/Lexer/DirectLex.php delete mode 100755 main/inc/lib/htmlpurifier/library/HTMLPurifier/Lexer/PEARSax3.php delete mode 100755 main/inc/lib/htmlpurifier/library/HTMLPurifier/Lexer/PH5P.php delete mode 100755 main/inc/lib/htmlpurifier/library/HTMLPurifier/Lexer/index.html delete mode 100755 main/inc/lib/htmlpurifier/library/HTMLPurifier/PercentEncoder.php delete mode 100755 main/inc/lib/htmlpurifier/library/HTMLPurifier/Printer.php delete mode 100755 main/inc/lib/htmlpurifier/library/HTMLPurifier/Printer/CSSDefinition.php delete mode 100755 main/inc/lib/htmlpurifier/library/HTMLPurifier/Printer/ConfigForm.css delete mode 100755 main/inc/lib/htmlpurifier/library/HTMLPurifier/Printer/ConfigForm.js delete mode 100755 main/inc/lib/htmlpurifier/library/HTMLPurifier/Printer/ConfigForm.php delete mode 100755 main/inc/lib/htmlpurifier/library/HTMLPurifier/Printer/HTMLDefinition.php delete mode 100755 main/inc/lib/htmlpurifier/library/HTMLPurifier/Printer/index.html delete mode 100755 main/inc/lib/htmlpurifier/library/HTMLPurifier/PropertyList.php delete mode 100755 main/inc/lib/htmlpurifier/library/HTMLPurifier/PropertyListIterator.php delete mode 100755 main/inc/lib/htmlpurifier/library/HTMLPurifier/Strategy.php delete mode 100755 main/inc/lib/htmlpurifier/library/HTMLPurifier/Strategy/Composite.php delete mode 100755 main/inc/lib/htmlpurifier/library/HTMLPurifier/Strategy/Core.php delete mode 100755 main/inc/lib/htmlpurifier/library/HTMLPurifier/Strategy/FixNesting.php delete mode 100755 main/inc/lib/htmlpurifier/library/HTMLPurifier/Strategy/MakeWellFormed.php delete mode 100755 main/inc/lib/htmlpurifier/library/HTMLPurifier/Strategy/RemoveForeignElements.php delete mode 100755 main/inc/lib/htmlpurifier/library/HTMLPurifier/Strategy/ValidateAttributes.php delete mode 100755 main/inc/lib/htmlpurifier/library/HTMLPurifier/Strategy/index.html delete mode 100755 main/inc/lib/htmlpurifier/library/HTMLPurifier/StringHash.php delete mode 100755 main/inc/lib/htmlpurifier/library/HTMLPurifier/StringHashParser.php delete mode 100755 main/inc/lib/htmlpurifier/library/HTMLPurifier/TagTransform.php delete mode 100755 main/inc/lib/htmlpurifier/library/HTMLPurifier/TagTransform/Font.php delete mode 100755 main/inc/lib/htmlpurifier/library/HTMLPurifier/TagTransform/Simple.php delete mode 100755 main/inc/lib/htmlpurifier/library/HTMLPurifier/TagTransform/index.html delete mode 100755 main/inc/lib/htmlpurifier/library/HTMLPurifier/Token.php delete mode 100755 main/inc/lib/htmlpurifier/library/HTMLPurifier/Token/Comment.php delete mode 100755 main/inc/lib/htmlpurifier/library/HTMLPurifier/Token/Empty.php delete mode 100755 main/inc/lib/htmlpurifier/library/HTMLPurifier/Token/End.php delete mode 100755 main/inc/lib/htmlpurifier/library/HTMLPurifier/Token/Start.php delete mode 100755 main/inc/lib/htmlpurifier/library/HTMLPurifier/Token/Tag.php delete mode 100755 main/inc/lib/htmlpurifier/library/HTMLPurifier/Token/Text.php delete mode 100755 main/inc/lib/htmlpurifier/library/HTMLPurifier/Token/index.html delete mode 100755 main/inc/lib/htmlpurifier/library/HTMLPurifier/TokenFactory.php delete mode 100755 main/inc/lib/htmlpurifier/library/HTMLPurifier/URI.php delete mode 100755 main/inc/lib/htmlpurifier/library/HTMLPurifier/URIDefinition.php delete mode 100755 main/inc/lib/htmlpurifier/library/HTMLPurifier/URIFilter.php delete mode 100755 main/inc/lib/htmlpurifier/library/HTMLPurifier/URIFilter/DisableExternal.php delete mode 100755 main/inc/lib/htmlpurifier/library/HTMLPurifier/URIFilter/DisableExternalResources.php delete mode 100755 main/inc/lib/htmlpurifier/library/HTMLPurifier/URIFilter/DisableResources.php delete mode 100755 main/inc/lib/htmlpurifier/library/HTMLPurifier/URIFilter/HostBlacklist.php delete mode 100755 main/inc/lib/htmlpurifier/library/HTMLPurifier/URIFilter/MakeAbsolute.php delete mode 100755 main/inc/lib/htmlpurifier/library/HTMLPurifier/URIFilter/Munge.php delete mode 100755 main/inc/lib/htmlpurifier/library/HTMLPurifier/URIFilter/index.html delete mode 100755 main/inc/lib/htmlpurifier/library/HTMLPurifier/URIParser.php delete mode 100755 main/inc/lib/htmlpurifier/library/HTMLPurifier/URIScheme.php delete mode 100755 main/inc/lib/htmlpurifier/library/HTMLPurifier/URIScheme/data.php delete mode 100755 main/inc/lib/htmlpurifier/library/HTMLPurifier/URIScheme/file.php delete mode 100755 main/inc/lib/htmlpurifier/library/HTMLPurifier/URIScheme/ftp.php delete mode 100755 main/inc/lib/htmlpurifier/library/HTMLPurifier/URIScheme/http.php delete mode 100755 main/inc/lib/htmlpurifier/library/HTMLPurifier/URIScheme/https.php delete mode 100755 main/inc/lib/htmlpurifier/library/HTMLPurifier/URIScheme/index.html delete mode 100755 main/inc/lib/htmlpurifier/library/HTMLPurifier/URIScheme/mailto.php delete mode 100755 main/inc/lib/htmlpurifier/library/HTMLPurifier/URIScheme/news.php delete mode 100755 main/inc/lib/htmlpurifier/library/HTMLPurifier/URIScheme/nntp.php delete mode 100755 main/inc/lib/htmlpurifier/library/HTMLPurifier/URISchemeRegistry.php delete mode 100755 main/inc/lib/htmlpurifier/library/HTMLPurifier/UnitConverter.php delete mode 100755 main/inc/lib/htmlpurifier/library/HTMLPurifier/VarParser.php delete mode 100755 main/inc/lib/htmlpurifier/library/HTMLPurifier/VarParser/Flexible.php delete mode 100755 main/inc/lib/htmlpurifier/library/HTMLPurifier/VarParser/Native.php delete mode 100755 main/inc/lib/htmlpurifier/library/HTMLPurifier/VarParser/index.html delete mode 100755 main/inc/lib/htmlpurifier/library/HTMLPurifier/VarParserException.php delete mode 100755 main/inc/lib/htmlpurifier/library/HTMLPurifier/index.html delete mode 100755 main/inc/lib/htmlpurifier/library/index.html delete mode 100755 main/inc/lib/htmlpurifier/maintenance/.htaccess delete mode 100755 main/inc/lib/htmlpurifier/maintenance/PH5P.patch delete mode 100755 main/inc/lib/htmlpurifier/maintenance/PH5P.php delete mode 100755 main/inc/lib/htmlpurifier/maintenance/add-vimline.php delete mode 100755 main/inc/lib/htmlpurifier/maintenance/common.php delete mode 100755 main/inc/lib/htmlpurifier/maintenance/compile-doxygen.sh delete mode 100755 main/inc/lib/htmlpurifier/maintenance/config-scanner.php delete mode 100755 main/inc/lib/htmlpurifier/maintenance/flush-definition-cache.php delete mode 100755 main/inc/lib/htmlpurifier/maintenance/flush.php delete mode 100755 main/inc/lib/htmlpurifier/maintenance/generate-entity-file.php delete mode 100755 main/inc/lib/htmlpurifier/maintenance/generate-includes.php delete mode 100755 main/inc/lib/htmlpurifier/maintenance/generate-ph5p-patch.php delete mode 100755 main/inc/lib/htmlpurifier/maintenance/generate-schema-cache.php delete mode 100755 main/inc/lib/htmlpurifier/maintenance/generate-standalone.php delete mode 100755 main/inc/lib/htmlpurifier/maintenance/index.html delete mode 100755 main/inc/lib/htmlpurifier/maintenance/merge-library.php delete mode 100755 main/inc/lib/htmlpurifier/maintenance/old-extract-schema.php delete mode 100755 main/inc/lib/htmlpurifier/maintenance/old-remove-require-once.php delete mode 100755 main/inc/lib/htmlpurifier/maintenance/old-remove-schema-def.php delete mode 100755 main/inc/lib/htmlpurifier/maintenance/phpt-modifications.patch delete mode 100755 main/inc/lib/htmlpurifier/maintenance/regenerate-docs.sh delete mode 100755 main/inc/lib/htmlpurifier/maintenance/remove-trailing-whitespace.php delete mode 100755 main/inc/lib/htmlpurifier/maintenance/rename-config.php delete mode 100755 main/inc/lib/htmlpurifier/maintenance/update-config.php delete mode 100755 main/inc/lib/htmlpurifier/maintenance/update-freshmeat.php delete mode 100755 main/inc/lib/htmlpurifier/plugins/index.html delete mode 100755 main/inc/lib/htmlpurifier/plugins/modx.txt delete mode 100755 main/inc/lib/htmlpurifier/plugins/phorum/.gitignore delete mode 100755 main/inc/lib/htmlpurifier/plugins/phorum/Changelog delete mode 100755 main/inc/lib/htmlpurifier/plugins/phorum/INSTALL delete mode 100755 main/inc/lib/htmlpurifier/plugins/phorum/README delete mode 100755 main/inc/lib/htmlpurifier/plugins/phorum/config.default.php delete mode 100755 main/inc/lib/htmlpurifier/plugins/phorum/htmlpurifier.php delete mode 100755 main/inc/lib/htmlpurifier/plugins/phorum/htmlpurifier/LICENSE delete mode 100755 main/inc/lib/htmlpurifier/plugins/phorum/htmlpurifier/README delete mode 100755 main/inc/lib/htmlpurifier/plugins/phorum/htmlpurifier/index.html delete mode 100755 main/inc/lib/htmlpurifier/plugins/phorum/index.html delete mode 100755 main/inc/lib/htmlpurifier/plugins/phorum/info.txt delete mode 100755 main/inc/lib/htmlpurifier/plugins/phorum/init-config.php delete mode 100755 main/inc/lib/htmlpurifier/plugins/phorum/migrate.bbcode.php delete mode 100755 main/inc/lib/htmlpurifier/plugins/phorum/settings.php delete mode 100755 main/inc/lib/htmlpurifier/plugins/phorum/settings/form.php delete mode 100755 main/inc/lib/htmlpurifier/plugins/phorum/settings/index.html delete mode 100755 main/inc/lib/htmlpurifier/plugins/phorum/settings/migrate-sigs-form.php delete mode 100755 main/inc/lib/htmlpurifier/plugins/phorum/settings/migrate-sigs.php delete mode 100755 main/inc/lib/htmlpurifier/plugins/phorum/settings/save.php delete mode 100644 vendor/monolog/monolog/src/Monolog/Handler/ExceptionTestHandler.php delete mode 100644 vendor/symfony/console/Symfony/Component/Console/Tests/Helper/DialogHelperTest.php delete mode 100644 vendor/symfony/console/Symfony/Component/Console/Tests/Helper/ProgressHelperTest.php delete mode 100644 vendor/symfony/console/Symfony/Component/Console/Tests/Helper/TableHelperTest.php delete mode 100644 vendor/twig/twig/lib/Twig/Node/SandboxedModule.php delete mode 100644 vendor/twig/twig/test/Twig/Tests/Node/SandboxedModuleTest.php diff --git a/.gitattributes b/.gitattributes index 410014eb50..b8a2e33f84 100755 --- a/.gitattributes +++ b/.gitattributes @@ -2,3 +2,14 @@ .gitignore export-ignore .travis.yml export-ignore /tests export-ignore +/vendor/ezyang/htmlpurifier/docs +/vendor/ezyang/htmlpurifier/benchmarks +/vendor/ezyang/htmlpurifier/tests +/vendor/ezyang/htmlpurifier/smoketests +/vendor/ezyang/htmlpurifier/package.php +/vendor/ezyang/htmlpurifier/release1-update.php +/vendor/ezyang/htmlpurifier/release2-tag.php +/vendor/ezyang/htmlpurifier/test-settings.sample.php + + + diff --git a/composer.json b/composer.json index e3957a9f53..37bb8e8cc7 100755 --- a/composer.json +++ b/composer.json @@ -1,11 +1,43 @@ { + "name": "chamilo/chamilo-lms", + "description": "E-learning and collaboration software", + "type": "project", + "homepage": "http://www.chamilo.org", + "license": "GPL-3.0", + "support": { + "forum": "http://www.chamilo.org/forum", + "irc": "irc://irc.freenode.org/chamilo" + }, + "autoload": { + "classmap": [ + "main/auth", + "main/admin", + "main/cron/lang", + "main/coursecopy", + "main/exercice", + "main/gradebook/lib", + "main/newscorm", + "main/inc/lib", + "plugin", + "main/install", + "main/inc/lib/getid3", + "main/survey" + ] + }, "require": { + "php": ">=5.3.3", "php-ffmpeg/php-ffmpeg": "0.3.x-dev@dev", "sabre/vobject": "~3.1", "toin0u/digitalocean": "~1.4", "twig/twig": "1.*", "michelf/php-markdown": "1.4.1", "emojione/emojione": "1.3.0", - "zendframework/zend-config": "2.3.3" + "zendframework/zend-config": "2.3.3", + "ezyang/htmlpurifier": "4.6.0" + }, + "extra": { + "branch-alias": { + "dev-master": "1.10.x-dev" + } } } diff --git a/composer.lock b/composer.lock index bd15f962d6..bea02dc187 100755 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at http://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "This file is @generated automatically" ], - "hash": "1abe77cf0b8752805b4ac0e3cde352b0", + "hash": "081c64716f44e878af4776f0e850d91d", "packages": [ { "name": "alchemy/binary-driver", @@ -65,16 +65,16 @@ }, { "name": "doctrine/cache", - "version": "v1.3.1", + "version": "v1.4.0", "source": { "type": "git", "url": "https://github.com/doctrine/cache.git", - "reference": "cf483685798a72c93bf4206e3dd6358ea07d64e7" + "reference": "2346085d2b027b233ae1d5de59b07440b9f288c8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/cache/zipball/cf483685798a72c93bf4206e3dd6358ea07d64e7", - "reference": "cf483685798a72c93bf4206e3dd6358ea07d64e7", + "url": "https://api.github.com/repos/doctrine/cache/zipball/2346085d2b027b233ae1d5de59b07440b9f288c8", + "reference": "2346085d2b027b233ae1d5de59b07440b9f288c8", "shasum": "" }, "require": { @@ -85,6 +85,7 @@ }, "require-dev": { "phpunit/phpunit": ">=3.7", + "predis/predis": "~0.8", "satooshi/php-coveralls": "~0.6" }, "type": "library", @@ -130,7 +131,7 @@ "cache", "caching" ], - "time": "2014-09-17 14:24:04" + "time": "2015-01-15 20:38:55" }, { "name": "emojione/emojione", @@ -210,6 +211,50 @@ ], "time": "2012-05-30 15:01:08" }, + { + "name": "ezyang/htmlpurifier", + "version": "v4.6.0", + "source": { + "type": "git", + "url": "https://github.com/ezyang/htmlpurifier.git", + "reference": "6f389f0f25b90d0b495308efcfa073981177f0fd" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/ezyang/htmlpurifier/zipball/6f389f0f25b90d0b495308efcfa073981177f0fd", + "reference": "6f389f0f25b90d0b495308efcfa073981177f0fd", + "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": "2013-11-30 08:25:19" + }, { "name": "michelf/php-markdown", "version": "1.4.1", @@ -263,16 +308,16 @@ }, { "name": "monolog/monolog", - "version": "1.11.0", + "version": "1.12.0", "source": { "type": "git", "url": "https://github.com/Seldaek/monolog.git", - "reference": "ec3961874c43840e96da3a8a1ed20d8c73d7e5aa" + "reference": "1fbe8c2641f2b163addf49cc5e18f144bec6b19f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Seldaek/monolog/zipball/ec3961874c43840e96da3a8a1ed20d8c73d7e5aa", - "reference": "ec3961874c43840e96da3a8a1ed20d8c73d7e5aa", + "url": "https://api.github.com/repos/Seldaek/monolog/zipball/1fbe8c2641f2b163addf49cc5e18f144bec6b19f", + "reference": "1fbe8c2641f2b163addf49cc5e18f144bec6b19f", "shasum": "" }, "require": { @@ -286,7 +331,7 @@ "aws/aws-sdk-php": "~2.4, >2.4.8", "doctrine/couchdb": "~1.0@dev", "graylog2/gelf-php": "~1.0", - "phpunit/phpunit": "~3.7.0", + "phpunit/phpunit": "~4.0", "raven/raven": "~0.5", "ruflin/elastica": "0.90.*", "videlalvaro/php-amqplib": "~2.4" @@ -305,7 +350,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.11.x-dev" + "dev-master": "1.12.x-dev" } }, "autoload": { @@ -331,7 +376,7 @@ "logging", "psr-3" ], - "time": "2014-09-30 13:30:58" + "time": "2014-12-29 21:29:35" }, { "name": "neutron/temporary-filesystem", @@ -482,16 +527,16 @@ }, { "name": "sabre/vobject", - "version": "3.3.4", + "version": "3.3.5", "source": { "type": "git", "url": "https://github.com/fruux/sabre-vobject.git", - "reference": "e7cbc59a7a77325dfa32924865e1802c9216a3e0" + "reference": "77cb636a5bde4c19d7522c2c548b258859ddd1ef" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/fruux/sabre-vobject/zipball/e7cbc59a7a77325dfa32924865e1802c9216a3e0", - "reference": "e7cbc59a7a77325dfa32924865e1802c9216a3e0", + "url": "https://api.github.com/repos/fruux/sabre-vobject/zipball/77cb636a5bde4c19d7522c2c548b258859ddd1ef", + "reference": "77cb636a5bde4c19d7522c2c548b258859ddd1ef", "shasum": "" }, "require": { @@ -544,21 +589,21 @@ "jCard", "vCard" ], - "time": "2014-11-19 22:15:24" + "time": "2015-01-10 00:54:52" }, { "name": "symfony/console", - "version": "v2.6.1", + "version": "v2.6.3", "target-dir": "Symfony/Component/Console", "source": { "type": "git", "url": "https://github.com/symfony/Console.git", - "reference": "ef825fd9f809d275926547c9e57cbf14968793e8" + "reference": "6ac6491ff60c0e5a941db3ccdc75a07adbb61476" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/Console/zipball/ef825fd9f809d275926547c9e57cbf14968793e8", - "reference": "ef825fd9f809d275926547c9e57cbf14968793e8", + "url": "https://api.github.com/repos/symfony/Console/zipball/6ac6491ff60c0e5a941db3ccdc75a07adbb61476", + "reference": "6ac6491ff60c0e5a941db3ccdc75a07adbb61476", "shasum": "" }, "require": { @@ -601,21 +646,21 @@ ], "description": "Symfony Console Component", "homepage": "http://symfony.com", - "time": "2014-12-02 20:19:20" + "time": "2015-01-06 17:50:02" }, { "name": "symfony/filesystem", - "version": "v2.6.1", + "version": "v2.6.3", "target-dir": "Symfony/Component/Filesystem", "source": { "type": "git", "url": "https://github.com/symfony/Filesystem.git", - "reference": "ff6efc95256cb33031933729e68b01d720b5436b" + "reference": "a1f566d1f92e142fa1593f4555d6d89e3044a9b7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/Filesystem/zipball/ff6efc95256cb33031933729e68b01d720b5436b", - "reference": "ff6efc95256cb33031933729e68b01d720b5436b", + "url": "https://api.github.com/repos/symfony/Filesystem/zipball/a1f566d1f92e142fa1593f4555d6d89e3044a9b7", + "reference": "a1f566d1f92e142fa1593f4555d6d89e3044a9b7", "shasum": "" }, "require": { @@ -648,21 +693,21 @@ ], "description": "Symfony Filesystem Component", "homepage": "http://symfony.com", - "time": "2014-12-02 20:19:20" + "time": "2015-01-03 21:13:09" }, { "name": "symfony/process", - "version": "v2.6.1", + "version": "v2.6.3", "target-dir": "Symfony/Component/Process", "source": { "type": "git", "url": "https://github.com/symfony/Process.git", - "reference": "bf0c9bd625f13b0b0bbe39919225cf145dfb935a" + "reference": "319794f611bd8bdefbac72beb3f05e847f8ebc92" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/Process/zipball/bf0c9bd625f13b0b0bbe39919225cf145dfb935a", - "reference": "bf0c9bd625f13b0b0bbe39919225cf145dfb935a", + "url": "https://api.github.com/repos/symfony/Process/zipball/319794f611bd8bdefbac72beb3f05e847f8ebc92", + "reference": "319794f611bd8bdefbac72beb3f05e847f8ebc92", "shasum": "" }, "require": { @@ -695,21 +740,21 @@ ], "description": "Symfony Process Component", "homepage": "http://symfony.com", - "time": "2014-12-02 20:19:20" + "time": "2015-01-06 22:47:52" }, { "name": "symfony/yaml", - "version": "v2.6.1", + "version": "v2.6.3", "target-dir": "Symfony/Component/Yaml", "source": { "type": "git", "url": "https://github.com/symfony/Yaml.git", - "reference": "3346fc090a3eb6b53d408db2903b241af51dcb20" + "reference": "82462a90848a52c2533aa6b598b107d68076b018" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/Yaml/zipball/3346fc090a3eb6b53d408db2903b241af51dcb20", - "reference": "3346fc090a3eb6b53d408db2903b241af51dcb20", + "url": "https://api.github.com/repos/symfony/Yaml/zipball/82462a90848a52c2533aa6b598b107d68076b018", + "reference": "82462a90848a52c2533aa6b598b107d68076b018", "shasum": "" }, "require": { @@ -742,7 +787,7 @@ ], "description": "Symfony Yaml Component", "homepage": "http://symfony.com", - "time": "2014-12-02 20:19:20" + "time": "2015-01-03 15:33:07" }, { "name": "toin0u/digitalocean", @@ -866,16 +911,16 @@ }, { "name": "twig/twig", - "version": "v1.16.2", + "version": "v1.18.0", "source": { "type": "git", - "url": "https://github.com/fabpot/Twig.git", - "reference": "42f758d9fe2146d1f0470604fc05ee43580873fc" + "url": "https://github.com/twigphp/Twig.git", + "reference": "4cf7464348e7f9893a93f7096a90b73722be99cf" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/fabpot/Twig/zipball/42f758d9fe2146d1f0470604fc05ee43580873fc", - "reference": "42f758d9fe2146d1f0470604fc05ee43580873fc", + "url": "https://api.github.com/repos/twigphp/Twig/zipball/4cf7464348e7f9893a93f7096a90b73722be99cf", + "reference": "4cf7464348e7f9893a93f7096a90b73722be99cf", "shasum": "" }, "require": { @@ -884,7 +929,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.16-dev" + "dev-master": "1.18-dev" } }, "autoload": { @@ -910,7 +955,7 @@ }, { "name": "Twig Team", - "homepage": "https://github.com/fabpot/Twig/graphs/contributors", + "homepage": "http://twig.sensiolabs.org/contributors", "role": "Contributors" } ], @@ -919,7 +964,7 @@ "keywords": [ "templating" ], - "time": "2014-10-17 12:53:44" + "time": "2015-01-25 17:32:08" }, { "name": "zendframework/zend-config", @@ -1035,6 +1080,9 @@ "php-ffmpeg/php-ffmpeg": 20 }, "prefer-stable": false, - "platform": [], + "prefer-lowest": false, + "platform": { + "php": ">=5.3.3" + }, "platform-dev": [] } diff --git a/main/course_notice/index.php b/main/course_notice/index.php index f41f7491a2..1aa4149d0c 100755 --- a/main/course_notice/index.php +++ b/main/course_notice/index.php @@ -6,7 +6,7 @@ * @license see /license.txt * @author Laurent Opprecht for the Univesity of Geneva */ -require_once dirname(__FILE__) . '/../inc/autoload.inc.php'; +require_once dirname(__FILE__) . '/../../vendor/autoload.php'; $controller = CourseNoticeController::instance(); KeyAuth::enable_services($controller); diff --git a/main/document/file.php b/main/document/file.php index de6eda6598..b4e84d9ec8 100755 --- a/main/document/file.php +++ b/main/document/file.php @@ -11,25 +11,25 @@ Use Model\Document; Use Model\Course; /** - * Return either - * + * Return either + * * - one document * - several documents (file and/or folders) zipped together - * + * * Used to transfer files to another application through http. - * + * * Script parameters: - * - * - id id(s) of the document id=1 or id=1,2,4 + * + * - id id(s) of the document id=1 or id=1,2,4 * - cidReq course code - * + * * Note this script enables key authentication so access with a key token is possible. - * + * * @package chamilo.document * @license see /license.txt * @author Laurent Opprecht for the Univesity of Geneva */ -require_once __DIR__ . '/../inc/autoload.inc.php'; +require_once __DIR__ . '/../../vendor/autoload.php'; KeyAuth::enable(); require_once __DIR__ . '/../inc/global.inc.php'; @@ -48,14 +48,14 @@ $course = Course::current(); /** * No files requested. We make sure we return 404 error to tell the client - * that the call failed. + * that the call failed. */ if (count($ids) == 0 || empty($course)) { Response::not_found(); } /** - * One file requested. In this case we return the file itself. + * One file requested. In this case we return the file itself. */ if (count($ids) == 1) { $id = reset($ids); @@ -77,7 +77,7 @@ if (count($ids) == 1) { } /** - * Several files requested. In this case we zip them together. + * Several files requested. In this case we zip them together. */ $files = array(); $folders = array(); @@ -97,9 +97,9 @@ foreach ($ids as $id) { $requested_folders = $folders; /** - * Note that if a parent folder is hidden children should not be accesible - * even if they are visible. It is therefore not sufficient to check document - * visibility. + * Note that if a parent folder is hidden children should not be accesible + * even if they are visible. It is therefore not sufficient to check document + * visibility. */ while ($folders) { $items = $folders; @@ -123,7 +123,7 @@ while ($folders) { $folders = $requested_folders; /** - * Requested files may not be accessible. + * Requested files may not be accessible. */ if (count($files) == 0) { Response::not_found(); @@ -142,7 +142,7 @@ foreach ($items as $item) { } /** - * Zip files together. + * Zip files together. */ $temp_zip_path = Chamilo::temp_file('zip'); $zip_folder = new PclZip($temp_zip_path); @@ -155,7 +155,7 @@ foreach ($files as $file) { } /** - * Send file for download + * Send file for download */ event_download(Uri::here()); DocumentManager::file_send_for_download($temp_zip_path, false, get_lang('Documents') . '.zip'); diff --git a/main/inc/autoload.inc.php b/main/inc/autoload.inc.php deleted file mode 100755 index 4c9ec5ca07..0000000000 --- a/main/inc/autoload.inc.php +++ /dev/null @@ -1,18 +0,0 @@ -registerNamespaces(array( - 'Symfony\\Component\\HttpFoundation', __DIR__.'/vendor/symfony/http-foundation', -)); -$loader->register(); - */ \ No newline at end of file diff --git a/main/inc/global.inc.php b/main/inc/global.inc.php index d71d79f062..ce64215464 100755 --- a/main/inc/global.inc.php +++ b/main/inc/global.inc.php @@ -84,7 +84,7 @@ if (api_get_setting('login_is_email') == 'true') { define('USERNAME_MAX_LENGTH', $default_username_length); // Do not over-use this variable. It is only for this script's local use. -$lib_path = api_get_path(LIBRARY_PATH); +$lib_path = dirname(__FILE__).'/../../main/inc/lib/'; // Fix bug in IIS that doesn't fill the $_SERVER['REQUEST_URI']. api_request_uri(); @@ -96,7 +96,7 @@ ini_set('include_path', api_create_include_path_setting()); ini_set('auto_detect_line_endings', '1'); // Include the libraries that are necessary everywhere -require_once dirname(__FILE__).'/autoload.inc.php'; +require_once dirname(__FILE__).'/../../vendor/autoload.php'; require_once $lib_path.'database.lib.php'; require_once $lib_path.'text.lib.php'; diff --git a/main/inc/lib/autoload.class.php b/main/inc/lib/autoload.class.php index a55ad0b826..c9ddfb2dea 100755 --- a/main/inc/lib/autoload.class.php +++ b/main/inc/lib/autoload.class.php @@ -2,7 +2,7 @@ /** * Autoload Chamilo classes - * + * @deprecated * @license see /license.txt * @author Laurent Opprecht for the Univesity of Geneva */ diff --git a/main/inc/lib/htmlpurifier/README b/main/inc/lib/htmlpurifier/README deleted file mode 100755 index 53f26f1c28..0000000000 --- a/main/inc/lib/htmlpurifier/README +++ /dev/null @@ -1,24 +0,0 @@ - -README - All about HTML Purifier - -HTML Purifier is an HTML filtering solution that uses a unique combination -of robust whitelists and agressive parsing to ensure that not only are -XSS attacks thwarted, but the resulting HTML is standards compliant. - -HTML Purifier is oriented towards richly formatted documents from -untrusted sources that require CSS and a full tag-set. This library can -be configured to accept a more restrictive set of tags, but it won't be -as efficient as more bare-bones parsers. It will, however, do the job -right, which may be more important. - -Places to go: - -* See INSTALL for a quick installation guide -* See docs/ for developer-oriented documentation, code examples and - an in-depth installation guide. -* See WYSIWYG for information on editors like TinyMCE and FCKeditor - -HTML Purifier can be found on the web at: http://htmlpurifier.org/ - - vim: et sw=4 sts=4 diff --git a/main/inc/lib/htmlpurifier/VERSION b/main/inc/lib/htmlpurifier/VERSION deleted file mode 100755 index ef8d7569d6..0000000000 --- a/main/inc/lib/htmlpurifier/VERSION +++ /dev/null @@ -1 +0,0 @@ -4.2.0 \ No newline at end of file diff --git a/main/inc/lib/htmlpurifier/configdoc/generate.php b/main/inc/lib/htmlpurifier/configdoc/generate.php deleted file mode 100755 index 1611a1f701..0000000000 --- a/main/inc/lib/htmlpurifier/configdoc/generate.php +++ /dev/null @@ -1,64 +0,0 @@ - true -)); - -$builder = new HTMLPurifier_ConfigSchema_InterchangeBuilder(); -$interchange = new HTMLPurifier_ConfigSchema_Interchange(); -$builder->buildDir($interchange); -$loader = dirname(__FILE__) . '/../config-schema.php'; -if (file_exists($loader)) include $loader; -$interchange->validate(); - -$style = 'plain'; // use $_GET in the future, careful to validate! -$configdoc_xml = 'configdoc.xml'; - -$xml_builder = new HTMLPurifier_ConfigSchema_Builder_Xml(); -$xml_builder->openURI($configdoc_xml); -$xml_builder->build($interchange); -unset($xml_builder); // free handle - -$xslt = new ConfigDoc_HTMLXSLTProcessor(); -$xslt->importStylesheet(dirname(__FILE__) . "/styles/$style.xsl"); -$output = $xslt->transformToHTML($configdoc_xml); - -if (!$output) { - echo "Error in generating files\n"; - exit(1); -} - -// write out -file_put_contents("$style.html", $output); - -if (php_sapi_name() != 'cli') { - // output (instant feedback if it's a browser) - echo $output; -} else { - echo 'Files generated successfully.'; -} \ No newline at end of file diff --git a/main/inc/lib/htmlpurifier/configdoc/index.html b/main/inc/lib/htmlpurifier/configdoc/index.html deleted file mode 100755 index aa7b9c934b..0000000000 --- a/main/inc/lib/htmlpurifier/configdoc/index.html +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/main/inc/lib/htmlpurifier/configdoc/styles/index.html b/main/inc/lib/htmlpurifier/configdoc/styles/index.html deleted file mode 100755 index aa7b9c934b..0000000000 --- a/main/inc/lib/htmlpurifier/configdoc/styles/index.html +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/main/inc/lib/htmlpurifier/configdoc/styles/plain.css b/main/inc/lib/htmlpurifier/configdoc/styles/plain.css deleted file mode 100755 index 7af80d0612..0000000000 --- a/main/inc/lib/htmlpurifier/configdoc/styles/plain.css +++ /dev/null @@ -1,44 +0,0 @@ - -body {margin:0;padding:0;} -#content { - margin:1em auto; - max-width: 47em; - width: expression(document.body.clientWidth > - 85 * parseInt(document.body.currentStyle.fontSize) ? - "54em": "auto"); -} - -table {border-collapse:collapse;} -table td, table th {padding:0.2em;} - -table.constraints {margin:0 0 1em;} -table.constraints th { - text-align:right;padding-left:0.4em;padding-right:0.4em;background:#EEE; - width:8em;vertical-align:top;} -table.constraints td {padding-right:0.4em; padding-left: 1em;} -table.constraints td ul {padding:0; margin:0; list-style:none;} -table.constraints td pre {margin:0;} - -#tocContainer {position:relative;} -#toc {list-style-type:none; font-weight:bold; font-size:1em; margin-bottom:1em;} -#toc li {position:relative; line-height: 1.2em;} -#toc .col-2 {margin-left:50%;} -#toc .col-l {float:left;} -#toc ul {list-style-type:disc; font-weight:normal; padding-bottom:1.2em;} - -.description p {margin-top:0;margin-bottom:1em;} - -#library, h1 {text-align:center; font-family:Garamond, serif; - font-variant:small-caps;} -#library {font-size:1em;} -h1 {margin-top:0;} -h2 {border-bottom:1px solid #CCC; font-family:sans-serif; font-weight:normal; - font-size:1.3em; clear:both;} -h3 {font-family:sans-serif; font-size:1.1em; font-weight:bold; } -h4 {font-family:sans-serif; font-size:0.9em; font-weight:bold; } - -.deprecated {color: #CCC;} -.deprecated table.constraints th {background:#FFF;} -.deprecated-notice {color: #000; text-align:center; margin-bottom: 1em;} - -/* vim: et sw=4 sts=4 */ diff --git a/main/inc/lib/htmlpurifier/configdoc/styles/plain.xsl b/main/inc/lib/htmlpurifier/configdoc/styles/plain.xsl deleted file mode 100755 index 55e157f029..0000000000 --- a/main/inc/lib/htmlpurifier/configdoc/styles/plain.xsl +++ /dev/null @@ -1,253 +0,0 @@ - - - - - - - - - - - - - - - - <xsl:value-of select="$title" /> - <xsl:value-of select="/configdoc/title" /> - - - - -
-
-

-
-

Table of Contents

-
    - - - -
-
-
-

Types

- -
- -
- - -
- - -
- type- -

:

-
- -
-
-
- - - - - - - -
  • - - - col-2 - - - margin-top:-em - - - -
      - - - -
    - -
    - -
  • -
    -
    - - - - - -
  • - -
  • -
    -
    - - - - -
    - - -

    No configuration directives defined for this namespace.

    -
    -
    -
    - -

    -
    - -
    - -
    -
    - - -
    - directive deprecated - - - -
    -
    - - - -

    -
    - - - - - - - - - - - - - - - -
    -
    - - - Aliases - - - , - - - - - - -
    - -
    -
    - -
    - Warning: - This directive was deprecated in version . - % should be used instead. -
    -
    - - - Used in - -
      - -
    - - -
    - -
  • - on lines - - - , - - -
  • -
    - - - - Version added - - - - - - Type - - - type type- - - #type- - - - (or null) - - - - - - - - Allowed values - - , - "" - - - - - - Default -
    - -
    - - - External deps - -
      - -
    - - -
    - -
  • -
    - -
    - - diff --git a/main/inc/lib/htmlpurifier/configdoc/types.xml b/main/inc/lib/htmlpurifier/configdoc/types.xml deleted file mode 100755 index f394cee0ff..0000000000 --- a/main/inc/lib/htmlpurifier/configdoc/types.xml +++ /dev/null @@ -1,69 +0,0 @@ - - - -
    - A series of case-insensitive characters. Internally, upper-case - ASCII characters will be converted to lower-case. -
    -
    - A series of characters that may contain newlines. Text tends to - indicate human-oriented text, as opposed to a machine format. -
    -
    - A series of case-insensitive characters that may contain newlines. -
    -
    - An - integer. You are alternatively permitted to pass a string of - digits instead, which will be cast to an integer using - (int). -
    -
    - A - floating point number. You are alternatively permitted to - pass a numeric string (as defined by is_numeric()), - which will be cast to a float using (float). -
    -
    - A boolean. - You are alternatively permitted to pass an integer 0 or - 1 (other integers are not permitted) or a string - "on", "true" or "1" for - true, and "off", "false" or - "0" for false. -
    -
    - An array whose values are true, e.g. array('key' - => true, 'key2' => true). You are alternatively permitted - to pass an array list of the keys array('key', 'key2') - or a comma-separated string of keys "key, key2". If - you pass an array list of values, ensure that your values are - strictly numerically indexed: array('key1', 2 => - 'key2') will not do what you expect and emits a warning. -
    -
    - An array which has consecutive integer indexes, e.g. - array('val1', 'val2'). You are alternatively permitted - to pass a comma-separated string of keys "val1, val2". - If your array is not in this form, array_values is run - on the array and a warning is emitted. -
    -
    - An array which is a mapping of keys to values, e.g. - array('key1' => 'val1', 'key2' => 'val2'). You are - alternatively permitted to pass a comma-separated string of - key-colon-value strings, e.g. "key1: val1, key2: val2". -
    -
    - An arbitrary PHP value of any type. -
    -
    - - diff --git a/main/inc/lib/htmlpurifier/configdoc/usage.xml b/main/inc/lib/htmlpurifier/configdoc/usage.xml deleted file mode 100755 index bd2f1a8a4f..0000000000 --- a/main/inc/lib/htmlpurifier/configdoc/usage.xml +++ /dev/null @@ -1,472 +0,0 @@ - - - - - 131 - - - 81 - 284 - - - 53 - 73 - 348 - - - 47 - - - - - 157 - - - - - 214 - - - - - 218 - - - - - 222 - - - - - 275 - - - - - 289 - - - - - 49 - - - - - 83 - - - - - 85 - - - - - 88 - - - - - 93 - - - - - 267 - 300 - - - - - 272 - 308 - - - - - 304 - - - - - 56 - - - - - 57 - - - - - 58 - - - - - 87 - - - - - 101 - - - 266 - - - - - 102 - - - - - 222 - - - - - 230 - - - - - 247 - - - - - 248 - - - - - 251 - - - - - 342 - - - - - 343 - - - - - 202 - - - 271 - - - 27 - - - 36 - - - 23 - - - - - 209 - - - - - 210 - - - - - 221 - - - - - 226 - - - - - 229 - - - - - 26 - - - - - 88 - - - - - 76 - - - - - 80 - - - 48 - - - - - 282 - - - - - 303 - - - - - 55 - - - 12 - - - - - 64 - - - - - 65 - - - - - 72 - - - - - 41 - - - - - 42 - - - - - 28 - - - - - 12 - - - 12 - - - - - 18 - - - - - 19 - - - - - 15 - - - - - 20 - - - - - 26 - - - - - 28 - 31 - - - - - 54 - - - - - 30 - - - - - 13 - - - - - 18 - - - 20 - - - - - 19 - - - - - 25 - - - - - 33 - - - - - 11 - - - 13 - - - - - 37 - - - - - 62 - - - - - 91 - - - - - 41 - - - - - 65 - - - - - 123 - - - - - 14 - - - 13 - - - 19 - - - - - 45 - - - - - 49 - - - - - 50 - - - - - 15 - - - - - 12 - - - - - 13 - - - - - 44 - - - - - 70 - - - - - 45 - - - 19 - - - - - 25 - - - - - 26 - - - - - 8 - - - - - 14 - - - - - 15 - - - diff --git a/main/inc/lib/htmlpurifier/extras/ConfigDoc/HTMLXSLTProcessor.php b/main/inc/lib/htmlpurifier/extras/ConfigDoc/HTMLXSLTProcessor.php deleted file mode 100755 index f7095285bb..0000000000 --- a/main/inc/lib/htmlpurifier/extras/ConfigDoc/HTMLXSLTProcessor.php +++ /dev/null @@ -1,86 +0,0 @@ -xsltProcessor = $proc; - } - - /** - * @note Allows a string $xsl filename to be passed - */ - public function importStylesheet($xsl) { - if (is_string($xsl)) { - $xsl_file = $xsl; - $xsl = new DOMDocument(); - $xsl->load($xsl_file); - } - return $this->xsltProcessor->importStylesheet($xsl); - } - - /** - * Transforms an XML file into compatible XHTML based on the stylesheet - * @param $xml XML DOM tree, or string filename - * @return string HTML output - * @todo Rename to transformToXHTML, as transformToHTML is misleading - */ - public function transformToHTML($xml) { - if (is_string($xml)) { - $dom = new DOMDocument(); - $dom->load($xml); - } else { - $dom = $xml; - } - $out = $this->xsltProcessor->transformToXML($dom); - - // fudges for HTML backwards compatibility - // assumes that document is XHTML - $out = str_replace('/>', ' />', $out); //
    not
    - $out = str_replace(' xmlns=""', '', $out); // rm unnecessary xmlns - - if (class_exists('Tidy')) { - // cleanup output - $config = array( - 'indent' => true, - 'output-xhtml' => true, - 'wrap' => 80 - ); - $tidy = new Tidy; - $tidy->parseString($out, $config, 'utf8'); - $tidy->cleanRepair(); - $out = (string) $tidy; - } - - return $out; - } - - /** - * Bulk sets parameters for the XSL stylesheet - * @param array $options Associative array of options to set - */ - public function setParameters($options) { - foreach ($options as $name => $value) { - $this->xsltProcessor->setParameter('', $name, $value); - } - } - - /** - * Forward any other calls to the XSLT processor - */ - public function __call($name, $arguments) { - call_user_func_array(array($this->xsltProcessor, $name), $arguments); - } - -} - -// vim: et sw=4 sts=4 diff --git a/main/inc/lib/htmlpurifier/extras/ConfigDoc/index.html b/main/inc/lib/htmlpurifier/extras/ConfigDoc/index.html deleted file mode 100755 index aa7b9c934b..0000000000 --- a/main/inc/lib/htmlpurifier/extras/ConfigDoc/index.html +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/main/inc/lib/htmlpurifier/extras/FSTools.php b/main/inc/lib/htmlpurifier/extras/FSTools.php deleted file mode 100755 index 17c35ee6d0..0000000000 --- a/main/inc/lib/htmlpurifier/extras/FSTools.php +++ /dev/null @@ -1,157 +0,0 @@ -mkdir($base); - } - $base .= DIRECTORY_SEPARATOR; - } - } - - /** - * Copy a file, or recursively copy a folder and its contents; modified - * so that copied files, if PHP, have includes removed - * @note Adapted from http://aidanlister.com/repos/v/function.copyr.php - */ - public function copyr($source, $dest) { - // Simple copy for a file - if (is_file($source)) { - return $this->copy($source, $dest); - } - // Make destination directory - if (!is_dir($dest)) { - $this->mkdir($dest); - } - // Loop through the folder - $dir = $this->dir($source); - while ( false !== ($entry = $dir->read()) ) { - // Skip pointers - if ($entry == '.' || $entry == '..') { - continue; - } - if (!$this->copyable($entry)) { - continue; - } - // Deep copy directories - if ($dest !== "$source/$entry") { - $this->copyr("$source/$entry", "$dest/$entry"); - } - } - // Clean up - $dir->close(); - return true; - } - - /** - * Overloadable function that tests a filename for copyability. By - * default, everything should be copied; you can restrict things to - * ignore hidden files, unreadable files, etc. This function - * applies to copyr(). - */ - public function copyable($file) { - return true; - } - - /** - * Delete a file, or a folder and its contents - * @note Adapted from http://aidanlister.com/repos/v/function.rmdirr.php - */ - public function rmdirr($dirname) - { - // Sanity check - if (!$this->file_exists($dirname)) { - return false; - } - - // Simple delete for a file - if ($this->is_file($dirname) || $this->is_link($dirname)) { - return $this->unlink($dirname); - } - - // Loop through the folder - $dir = $this->dir($dirname); - while (false !== $entry = $dir->read()) { - // Skip pointers - if ($entry == '.' || $entry == '..') { - continue; - } - // Recurse - $this->rmdirr($dirname . DIRECTORY_SEPARATOR . $entry); - } - - // Clean up - $dir->close(); - return $this->rmdir($dirname); - } - - /** - * Recursively globs a directory. - */ - public function globr($dir, $pattern, $flags = NULL) { - $files = $this->glob("$dir/$pattern", $flags); - if ($files === false) $files = array(); - $sub_dirs = $this->glob("$dir/*", GLOB_ONLYDIR); - if ($sub_dirs === false) $sub_dirs = array(); - foreach ($sub_dirs as $sub_dir) { - $sub_files = $this->globr($sub_dir, $pattern, $flags); - $files = array_merge($files, $sub_files); - } - return $files; - } - - /** - * Allows for PHP functions to be called and be stubbed. - * @warning This function will not work for functions that need - * to pass references; manually define a stub function for those. - */ - public function __call($name, $args) { - return call_user_func_array($name, $args); - } - -} - -// vim: et sw=4 sts=4 diff --git a/main/inc/lib/htmlpurifier/extras/FSTools/File.php b/main/inc/lib/htmlpurifier/extras/FSTools/File.php deleted file mode 100755 index 1c76705d65..0000000000 --- a/main/inc/lib/htmlpurifier/extras/FSTools/File.php +++ /dev/null @@ -1,126 +0,0 @@ -name = $name; - $this->fs = $fs ? $fs : FSTools::singleton(); - } - - /** Returns the filename of the file. */ - public function getName() {return $this->name;} - - /** Returns directory of the file without trailing slash */ - public function getDirectory() {return $this->fs->dirname($this->name);} - - /** - * Retrieves the contents of a file - * @todo Throw an exception if file doesn't exist - */ - public function get() { - return $this->fs->file_get_contents($this->name); - } - - /** Writes contents to a file, creates new file if necessary */ - public function write($contents) { - return $this->fs->file_put_contents($this->name, $contents); - } - - /** Deletes the file */ - public function delete() { - return $this->fs->unlink($this->name); - } - - /** Returns true if file exists and is a file. */ - public function exists() { - return $this->fs->is_file($this->name); - } - - /** Returns last file modification time */ - public function getMTime() { - return $this->fs->filemtime($this->name); - } - - /** - * Chmod a file - * @note We ignore errors because of some weird owner trickery due - * to SVN duality - */ - public function chmod($octal_code) { - return @$this->fs->chmod($this->name, $octal_code); - } - - /** Opens file's handle */ - public function open($mode) { - if ($this->handle) $this->close(); - $this->handle = $this->fs->fopen($this->name, $mode); - return true; - } - - /** Closes file's handle */ - public function close() { - if (!$this->handle) return false; - $status = $this->fs->fclose($this->handle); - $this->handle = false; - return $status; - } - - /** Retrieves a line from an open file, with optional max length $length */ - public function getLine($length = null) { - if (!$this->handle) $this->open('r'); - if ($length === null) return $this->fs->fgets($this->handle); - else return $this->fs->fgets($this->handle, $length); - } - - /** Retrieves a character from an open file */ - public function getChar() { - if (!$this->handle) $this->open('r'); - return $this->fs->fgetc($this->handle); - } - - /** Retrieves an $length bytes of data from an open data */ - public function read($length) { - if (!$this->handle) $this->open('r'); - return $this->fs->fread($this->handle, $length); - } - - /** Writes to an open file */ - public function put($string) { - if (!$this->handle) $this->open('a'); - return $this->fs->fwrite($this->handle, $string); - } - - /** Returns TRUE if the end of the file has been reached */ - public function eof() { - if (!$this->handle) return true; - return $this->fs->feof($this->handle); - } - - public function __destruct() { - if ($this->handle) $this->close(); - } - -} - -// vim: et sw=4 sts=4 diff --git a/main/inc/lib/htmlpurifier/extras/FSTools/index.html b/main/inc/lib/htmlpurifier/extras/FSTools/index.html deleted file mode 100755 index aa7b9c934b..0000000000 --- a/main/inc/lib/htmlpurifier/extras/FSTools/index.html +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/main/inc/lib/htmlpurifier/extras/HTMLPurifierExtras.auto.php b/main/inc/lib/htmlpurifier/extras/HTMLPurifierExtras.auto.php deleted file mode 100755 index 4016d8afd1..0000000000 --- a/main/inc/lib/htmlpurifier/extras/HTMLPurifierExtras.auto.php +++ /dev/null @@ -1,11 +0,0 @@ -fopen(...). - This makes it a lot simpler to mock these filesystem calls for unit testing. - -- FSTools_File: This object represents a single file, and has almost any - method imaginable one would need. - -Check the files themselves for more information. - - vim: et sw=4 sts=4 diff --git a/main/inc/lib/htmlpurifier/extras/index.html b/main/inc/lib/htmlpurifier/extras/index.html deleted file mode 100755 index aa7b9c934b..0000000000 --- a/main/inc/lib/htmlpurifier/extras/index.html +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/main/inc/lib/htmlpurifier/index.html b/main/inc/lib/htmlpurifier/index.html deleted file mode 100755 index aa7b9c934b..0000000000 --- a/main/inc/lib/htmlpurifier/index.html +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/main/inc/lib/htmlpurifier/library/HTMLPurifier.auto.php b/main/inc/lib/htmlpurifier/library/HTMLPurifier.auto.php deleted file mode 100755 index 1960c399f8..0000000000 --- a/main/inc/lib/htmlpurifier/library/HTMLPurifier.auto.php +++ /dev/null @@ -1,11 +0,0 @@ -purify($html, $config); -} - -// vim: et sw=4 sts=4 diff --git a/main/inc/lib/htmlpurifier/library/HTMLPurifier.includes.php b/main/inc/lib/htmlpurifier/library/HTMLPurifier.includes.php deleted file mode 100755 index 3594eb604b..0000000000 --- a/main/inc/lib/htmlpurifier/library/HTMLPurifier.includes.php +++ /dev/null @@ -1,212 +0,0 @@ - $attributes) { - $allowed_elements[$element] = true; - foreach ($attributes as $attribute => $x) { - $allowed_attributes["$element.$attribute"] = true; - } - } - $config->set('HTML.AllowedElements', $allowed_elements); - $config->set('HTML.AllowedAttributes', $allowed_attributes); - $allowed_schemes = array(); - if ($allowed_protocols !== null) { - $config->set('URI.AllowedSchemes', $allowed_protocols); - } - $purifier = new HTMLPurifier($config); - return $purifier->purify($string); -} - -// vim: et sw=4 sts=4 diff --git a/main/inc/lib/htmlpurifier/library/HTMLPurifier.path.php b/main/inc/lib/htmlpurifier/library/HTMLPurifier.path.php deleted file mode 100755 index 39b1b65319..0000000000 --- a/main/inc/lib/htmlpurifier/library/HTMLPurifier.path.php +++ /dev/null @@ -1,11 +0,0 @@ -config = HTMLPurifier_Config::create($config); - - $this->strategy = new HTMLPurifier_Strategy_Core(); - - } - - /** - * Adds a filter to process the output. First come first serve - * @param $filter HTMLPurifier_Filter object - */ - public function addFilter($filter) { - trigger_error('HTMLPurifier->addFilter() is deprecated, use configuration directives in the Filter namespace or Filter.Custom', E_USER_WARNING); - $this->filters[] = $filter; - } - - /** - * Filters an HTML snippet/document to be XSS-free and standards-compliant. - * - * @param $html String of HTML to purify - * @param $config HTMLPurifier_Config object for this operation, if omitted, - * defaults to the config object specified during this - * object's construction. The parameter can also be any type - * that HTMLPurifier_Config::create() supports. - * @return Purified HTML - */ - public function purify($html, $config = null) { - - // :TODO: make the config merge in, instead of replace - $config = $config ? HTMLPurifier_Config::create($config) : $this->config; - - // implementation is partially environment dependant, partially - // configuration dependant - $lexer = HTMLPurifier_Lexer::create($config); - - $context = new HTMLPurifier_Context(); - - // setup HTML generator - $this->generator = new HTMLPurifier_Generator($config, $context); - $context->register('Generator', $this->generator); - - // set up global context variables - if ($config->get('Core.CollectErrors')) { - // may get moved out if other facilities use it - $language_factory = HTMLPurifier_LanguageFactory::instance(); - $language = $language_factory->create($config, $context); - $context->register('Locale', $language); - - $error_collector = new HTMLPurifier_ErrorCollector($context); - $context->register('ErrorCollector', $error_collector); - } - - // setup id_accumulator context, necessary due to the fact that - // AttrValidator can be called from many places - $id_accumulator = HTMLPurifier_IDAccumulator::build($config, $context); - $context->register('IDAccumulator', $id_accumulator); - - $html = HTMLPurifier_Encoder::convertToUTF8($html, $config, $context); - - // setup filters - $filter_flags = $config->getBatch('Filter'); - $custom_filters = $filter_flags['Custom']; - unset($filter_flags['Custom']); - $filters = array(); - foreach ($filter_flags as $filter => $flag) { - if (!$flag) continue; - if (strpos($filter, '.') !== false) continue; - $class = "HTMLPurifier_Filter_$filter"; - $filters[] = new $class; - } - foreach ($custom_filters as $filter) { - // maybe "HTMLPurifier_Filter_$filter", but be consistent with AutoFormat - $filters[] = $filter; - } - $filters = array_merge($filters, $this->filters); - // maybe prepare(), but later - - for ($i = 0, $filter_size = count($filters); $i < $filter_size; $i++) { - $html = $filters[$i]->preFilter($html, $config, $context); - } - - // purified HTML - $html = - $this->generator->generateFromTokens( - // list of tokens - $this->strategy->execute( - // list of un-purified tokens - $lexer->tokenizeHTML( - // un-purified HTML - $html, $config, $context - ), - $config, $context - ) - ); - - for ($i = $filter_size - 1; $i >= 0; $i--) { - $html = $filters[$i]->postFilter($html, $config, $context); - } - - $html = HTMLPurifier_Encoder::convertFromUTF8($html, $config, $context); - $this->context =& $context; - return $html; - } - - /** - * Filters an array of HTML snippets - * @param $config Optional HTMLPurifier_Config object for this operation. - * See HTMLPurifier::purify() for more details. - * @return Array of purified HTML - */ - public function purifyArray($array_of_html, $config = null) { - $context_array = array(); - foreach ($array_of_html as $key => $html) { - $array_of_html[$key] = $this->purify($html, $config); - $context_array[$key] = $this->context; - } - $this->context = $context_array; - return $array_of_html; - } - - /** - * Singleton for enforcing just one HTML Purifier in your system - * @param $prototype Optional prototype HTMLPurifier instance to - * overload singleton with, or HTMLPurifier_Config - * instance to configure the generated version with. - */ - public static function instance($prototype = null) { - if (!self::$instance || $prototype) { - if ($prototype instanceof HTMLPurifier) { - self::$instance = $prototype; - } elseif ($prototype) { - self::$instance = new HTMLPurifier($prototype); - } else { - self::$instance = new HTMLPurifier(); - } - } - return self::$instance; - } - - /** - * @note Backwards compatibility, see instance() - */ - public static function getInstance($prototype = null) { - return HTMLPurifier::instance($prototype); - } - -} - -// vim: et sw=4 sts=4 diff --git a/main/inc/lib/htmlpurifier/library/HTMLPurifier.safe-includes.php b/main/inc/lib/htmlpurifier/library/HTMLPurifier.safe-includes.php deleted file mode 100755 index 2f9755c69c..0000000000 --- a/main/inc/lib/htmlpurifier/library/HTMLPurifier.safe-includes.php +++ /dev/null @@ -1,206 +0,0 @@ -attr_collections as $coll_i => $coll) { - if (!isset($this->info[$coll_i])) { - $this->info[$coll_i] = array(); - } - foreach ($coll as $attr_i => $attr) { - if ($attr_i === 0 && isset($this->info[$coll_i][$attr_i])) { - // merge in includes - $this->info[$coll_i][$attr_i] = array_merge( - $this->info[$coll_i][$attr_i], $attr); - continue; - } - $this->info[$coll_i][$attr_i] = $attr; - } - } - } - // perform internal expansions and inclusions - foreach ($this->info as $name => $attr) { - // merge attribute collections that include others - $this->performInclusions($this->info[$name]); - // replace string identifiers with actual attribute objects - $this->expandIdentifiers($this->info[$name], $attr_types); - } - } - - /** - * Takes a reference to an attribute associative array and performs - * all inclusions specified by the zero index. - * @param &$attr Reference to attribute array - */ - public function performInclusions(&$attr) { - if (!isset($attr[0])) return; - $merge = $attr[0]; - $seen = array(); // recursion guard - // loop through all the inclusions - for ($i = 0; isset($merge[$i]); $i++) { - if (isset($seen[$merge[$i]])) continue; - $seen[$merge[$i]] = true; - // foreach attribute of the inclusion, copy it over - if (!isset($this->info[$merge[$i]])) continue; - foreach ($this->info[$merge[$i]] as $key => $value) { - if (isset($attr[$key])) continue; // also catches more inclusions - $attr[$key] = $value; - } - if (isset($this->info[$merge[$i]][0])) { - // recursion - $merge = array_merge($merge, $this->info[$merge[$i]][0]); - } - } - unset($attr[0]); - } - - /** - * Expands all string identifiers in an attribute array by replacing - * them with the appropriate values inside HTMLPurifier_AttrTypes - * @param &$attr Reference to attribute array - * @param $attr_types HTMLPurifier_AttrTypes instance - */ - public function expandIdentifiers(&$attr, $attr_types) { - - // because foreach will process new elements we add, make sure we - // skip duplicates - $processed = array(); - - foreach ($attr as $def_i => $def) { - // skip inclusions - if ($def_i === 0) continue; - - if (isset($processed[$def_i])) continue; - - // determine whether or not attribute is required - if ($required = (strpos($def_i, '*') !== false)) { - // rename the definition - unset($attr[$def_i]); - $def_i = trim($def_i, '*'); - $attr[$def_i] = $def; - } - - $processed[$def_i] = true; - - // if we've already got a literal object, move on - if (is_object($def)) { - // preserve previous required - $attr[$def_i]->required = ($required || $attr[$def_i]->required); - continue; - } - - if ($def === false) { - unset($attr[$def_i]); - continue; - } - - if ($t = $attr_types->get($def)) { - $attr[$def_i] = $t; - $attr[$def_i]->required = $required; - } else { - unset($attr[$def_i]); - } - } - - } - -} - -// vim: et sw=4 sts=4 diff --git a/main/inc/lib/htmlpurifier/library/HTMLPurifier/AttrDef.php b/main/inc/lib/htmlpurifier/library/HTMLPurifier/AttrDef.php deleted file mode 100755 index f001738b8d..0000000000 --- a/main/inc/lib/htmlpurifier/library/HTMLPurifier/AttrDef.php +++ /dev/null @@ -1,123 +0,0 @@ - by removing - * leading and trailing whitespace, ignoring line feeds, and replacing - * carriage returns and tabs with spaces. While most useful for HTML - * attributes specified as CDATA, it can also be applied to most CSS - * values. - * - * @note This method is not entirely standards compliant, as trim() removes - * more types of whitespace than specified in the spec. In practice, - * this is rarely a problem, as those extra characters usually have - * already been removed by HTMLPurifier_Encoder. - * - * @warning This processing is inconsistent with XML's whitespace handling - * as specified by section 3.3.3 and referenced XHTML 1.0 section - * 4.7. However, note that we are NOT necessarily - * parsing XML, thus, this behavior may still be correct. We - * assume that newlines have been normalized. - */ - public function parseCDATA($string) { - $string = trim($string); - $string = str_replace(array("\n", "\t", "\r"), ' ', $string); - return $string; - } - - /** - * Factory method for creating this class from a string. - * @param $string String construction info - * @return Created AttrDef object corresponding to $string - */ - public function make($string) { - // default implementation, return a flyweight of this object. - // If $string has an effect on the returned object (i.e. you - // need to overload this method), it is best - // to clone or instantiate new copies. (Instantiation is safer.) - return $this; - } - - /** - * Removes spaces from rgb(0, 0, 0) so that shorthand CSS properties work - * properly. THIS IS A HACK! - */ - protected function mungeRgb($string) { - return preg_replace('/rgb\((\d+)\s*,\s*(\d+)\s*,\s*(\d+)\)/', 'rgb(\1,\2,\3)', $string); - } - - /** - * Parses a possibly escaped CSS string and returns the "pure" - * version of it. - */ - protected function expandCSSEscape($string) { - // flexibly parse it - $ret = ''; - for ($i = 0, $c = strlen($string); $i < $c; $i++) { - if ($string[$i] === '\\') { - $i++; - if ($i >= $c) { - $ret .= '\\'; - break; - } - if (ctype_xdigit($string[$i])) { - $code = $string[$i]; - for ($a = 1, $i++; $i < $c && $a < 6; $i++, $a++) { - if (!ctype_xdigit($string[$i])) break; - $code .= $string[$i]; - } - // We have to be extremely careful when adding - // new characters, to make sure we're not breaking - // the encoding. - $char = HTMLPurifier_Encoder::unichr(hexdec($code)); - if (HTMLPurifier_Encoder::cleanUTF8($char) === '') continue; - $ret .= $char; - if ($i < $c && trim($string[$i]) !== '') $i--; - continue; - } - if ($string[$i] === "\n") continue; - } - $ret .= $string[$i]; - } - return $ret; - } - -} - -// vim: et sw=4 sts=4 diff --git a/main/inc/lib/htmlpurifier/library/HTMLPurifier/AttrDef/CSS.php b/main/inc/lib/htmlpurifier/library/HTMLPurifier/AttrDef/CSS.php deleted file mode 100755 index 953e706755..0000000000 --- a/main/inc/lib/htmlpurifier/library/HTMLPurifier/AttrDef/CSS.php +++ /dev/null @@ -1,87 +0,0 @@ -parseCDATA($css); - - $definition = $config->getCSSDefinition(); - - // we're going to break the spec and explode by semicolons. - // This is because semicolon rarely appears in escaped form - // Doing this is generally flaky but fast - // IT MIGHT APPEAR IN URIs, see HTMLPurifier_AttrDef_CSSURI - // for details - - $declarations = explode(';', $css); - $propvalues = array(); - - /** - * Name of the current CSS property being validated. - */ - $property = false; - $context->register('CurrentCSSProperty', $property); - - foreach ($declarations as $declaration) { - if (!$declaration) continue; - if (!strpos($declaration, ':')) continue; - list($property, $value) = explode(':', $declaration, 2); - $property = trim($property); - $value = trim($value); - $ok = false; - do { - if (isset($definition->info[$property])) { - $ok = true; - break; - } - if (ctype_lower($property)) break; - $property = strtolower($property); - if (isset($definition->info[$property])) { - $ok = true; - break; - } - } while(0); - if (!$ok) continue; - // inefficient call, since the validator will do this again - if (strtolower(trim($value)) !== 'inherit') { - // inherit works for everything (but only on the base property) - $result = $definition->info[$property]->validate( - $value, $config, $context ); - } else { - $result = 'inherit'; - } - if ($result === false) continue; - $propvalues[$property] = $result; - } - - $context->destroy('CurrentCSSProperty'); - - // procedure does not write the new CSS simultaneously, so it's - // slightly inefficient, but it's the only way of getting rid of - // duplicates. Perhaps config to optimize it, but not now. - - $new_declarations = ''; - foreach ($propvalues as $prop => $value) { - $new_declarations .= "$prop:$value;"; - } - - return $new_declarations ? $new_declarations : false; - - } - -} - -// vim: et sw=4 sts=4 diff --git a/main/inc/lib/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/AlphaValue.php b/main/inc/lib/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/AlphaValue.php deleted file mode 100755 index 292c040d4b..0000000000 --- a/main/inc/lib/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/AlphaValue.php +++ /dev/null @@ -1,21 +0,0 @@ - 1.0) $result = '1'; - return $result; - } - -} - -// vim: et sw=4 sts=4 diff --git a/main/inc/lib/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/Background.php b/main/inc/lib/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/Background.php deleted file mode 100755 index 3a3d20cd6a..0000000000 --- a/main/inc/lib/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/Background.php +++ /dev/null @@ -1,87 +0,0 @@ -getCSSDefinition(); - $this->info['background-color'] = $def->info['background-color']; - $this->info['background-image'] = $def->info['background-image']; - $this->info['background-repeat'] = $def->info['background-repeat']; - $this->info['background-attachment'] = $def->info['background-attachment']; - $this->info['background-position'] = $def->info['background-position']; - } - - public function validate($string, $config, $context) { - - // regular pre-processing - $string = $this->parseCDATA($string); - if ($string === '') return false; - - // munge rgb() decl if necessary - $string = $this->mungeRgb($string); - - // assumes URI doesn't have spaces in it - $bits = explode(' ', strtolower($string)); // bits to process - - $caught = array(); - $caught['color'] = false; - $caught['image'] = false; - $caught['repeat'] = false; - $caught['attachment'] = false; - $caught['position'] = false; - - $i = 0; // number of catches - $none = false; - - foreach ($bits as $bit) { - if ($bit === '') continue; - foreach ($caught as $key => $status) { - if ($key != 'position') { - if ($status !== false) continue; - $r = $this->info['background-' . $key]->validate($bit, $config, $context); - } else { - $r = $bit; - } - if ($r === false) continue; - if ($key == 'position') { - if ($caught[$key] === false) $caught[$key] = ''; - $caught[$key] .= $r . ' '; - } else { - $caught[$key] = $r; - } - $i++; - break; - } - } - - if (!$i) return false; - if ($caught['position'] !== false) { - $caught['position'] = $this->info['background-position']-> - validate($caught['position'], $config, $context); - } - - $ret = array(); - foreach ($caught as $value) { - if ($value === false) continue; - $ret[] = $value; - } - - if (empty($ret)) return false; - return implode(' ', $ret); - - } - -} - -// vim: et sw=4 sts=4 diff --git a/main/inc/lib/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/BackgroundPosition.php b/main/inc/lib/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/BackgroundPosition.php deleted file mode 100755 index 6627218e18..0000000000 --- a/main/inc/lib/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/BackgroundPosition.php +++ /dev/null @@ -1,133 +0,0 @@ - | | left | center | right - ] - [ - | | top | center | bottom - ]? - ] | - [ // this signifies that the vertical and horizontal adjectives - // can be arbitrarily ordered, however, there can only be two, - // one of each, or none at all - [ - left | center | right - ] || - [ - top | center | bottom - ] - ] - top, left = 0% - center, (none) = 50% - bottom, right = 100% -*/ - -/* QuirksMode says: - keyword + length/percentage must be ordered correctly, as per W3C - - Internet Explorer and Opera, however, support arbitrary ordering. We - should fix it up. - - Minor issue though, not strictly necessary. -*/ - -// control freaks may appreciate the ability to convert these to -// percentages or something, but it's not necessary - -/** - * Validates the value of background-position. - */ -class HTMLPurifier_AttrDef_CSS_BackgroundPosition extends HTMLPurifier_AttrDef -{ - - protected $length; - protected $percentage; - - public function __construct() { - $this->length = new HTMLPurifier_AttrDef_CSS_Length(); - $this->percentage = new HTMLPurifier_AttrDef_CSS_Percentage(); - } - - public function validate($string, $config, $context) { - $string = $this->parseCDATA($string); - $bits = explode(' ', $string); - - $keywords = array(); - $keywords['h'] = false; // left, right - $keywords['v'] = false; // top, bottom - $keywords['ch'] = false; // center (first word) - $keywords['cv'] = false; // center (second word) - $measures = array(); - - $i = 0; - - $lookup = array( - 'top' => 'v', - 'bottom' => 'v', - 'left' => 'h', - 'right' => 'h', - 'center' => 'c' - ); - - foreach ($bits as $bit) { - if ($bit === '') continue; - - // test for keyword - $lbit = ctype_lower($bit) ? $bit : strtolower($bit); - if (isset($lookup[$lbit])) { - $status = $lookup[$lbit]; - if ($status == 'c') { - if ($i == 0) { - $status = 'ch'; - } else { - $status = 'cv'; - } - } - $keywords[$status] = $lbit; - $i++; - } - - // test for length - $r = $this->length->validate($bit, $config, $context); - if ($r !== false) { - $measures[] = $r; - $i++; - } - - // test for percentage - $r = $this->percentage->validate($bit, $config, $context); - if ($r !== false) { - $measures[] = $r; - $i++; - } - - } - - if (!$i) return false; // no valid values were caught - - $ret = array(); - - // first keyword - if ($keywords['h']) $ret[] = $keywords['h']; - elseif ($keywords['ch']) { - $ret[] = $keywords['ch']; - $keywords['cv'] = false; // prevent re-use: center = center center - } - elseif (count($measures)) $ret[] = array_shift($measures); - - if ($keywords['v']) $ret[] = $keywords['v']; - elseif ($keywords['cv']) $ret[] = $keywords['cv']; - elseif (count($measures)) $ret[] = array_shift($measures); - - if (empty($ret)) return false; - return implode(' ', $ret); - - } - -} - -// vim: et sw=4 sts=4 diff --git a/main/inc/lib/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/Border.php b/main/inc/lib/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/Border.php deleted file mode 100755 index 42a1d1b4ae..0000000000 --- a/main/inc/lib/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/Border.php +++ /dev/null @@ -1,43 +0,0 @@ -getCSSDefinition(); - $this->info['border-width'] = $def->info['border-width']; - $this->info['border-style'] = $def->info['border-style']; - $this->info['border-top-color'] = $def->info['border-top-color']; - } - - public function validate($string, $config, $context) { - $string = $this->parseCDATA($string); - $string = $this->mungeRgb($string); - $bits = explode(' ', $string); - $done = array(); // segments we've finished - $ret = ''; // return value - foreach ($bits as $bit) { - foreach ($this->info as $propname => $validator) { - if (isset($done[$propname])) continue; - $r = $validator->validate($bit, $config, $context); - if ($r !== false) { - $ret .= $r . ' '; - $done[$propname] = true; - break; - } - } - } - return rtrim($ret); - } - -} - -// vim: et sw=4 sts=4 diff --git a/main/inc/lib/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/Color.php b/main/inc/lib/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/Color.php deleted file mode 100755 index 07f95a6719..0000000000 --- a/main/inc/lib/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/Color.php +++ /dev/null @@ -1,78 +0,0 @@ -get('Core.ColorKeywords'); - - $color = trim($color); - if ($color === '') return false; - - $lower = strtolower($color); - if (isset($colors[$lower])) return $colors[$lower]; - - if (strpos($color, 'rgb(') !== false) { - // rgb literal handling - $length = strlen($color); - if (strpos($color, ')') !== $length - 1) return false; - $triad = substr($color, 4, $length - 4 - 1); - $parts = explode(',', $triad); - if (count($parts) !== 3) return false; - $type = false; // to ensure that they're all the same type - $new_parts = array(); - foreach ($parts as $part) { - $part = trim($part); - if ($part === '') return false; - $length = strlen($part); - if ($part[$length - 1] === '%') { - // handle percents - if (!$type) { - $type = 'percentage'; - } elseif ($type !== 'percentage') { - return false; - } - $num = (float) substr($part, 0, $length - 1); - if ($num < 0) $num = 0; - if ($num > 100) $num = 100; - $new_parts[] = "$num%"; - } else { - // handle integers - if (!$type) { - $type = 'integer'; - } elseif ($type !== 'integer') { - return false; - } - $num = (int) $part; - if ($num < 0) $num = 0; - if ($num > 255) $num = 255; - $new_parts[] = (string) $num; - } - } - $new_triad = implode(',', $new_parts); - $color = "rgb($new_triad)"; - } else { - // hexadecimal handling - if ($color[0] === '#') { - $hex = substr($color, 1); - } else { - $hex = $color; - $color = '#' . $color; - } - $length = strlen($hex); - if ($length !== 3 && $length !== 6) return false; - if (!ctype_xdigit($hex)) return false; - } - - return $color; - - } - -} - -// vim: et sw=4 sts=4 diff --git a/main/inc/lib/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/Composite.php b/main/inc/lib/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/Composite.php deleted file mode 100755 index de1289cba8..0000000000 --- a/main/inc/lib/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/Composite.php +++ /dev/null @@ -1,38 +0,0 @@ -defs = $defs; - } - - public function validate($string, $config, $context) { - foreach ($this->defs as $i => $def) { - $result = $this->defs[$i]->validate($string, $config, $context); - if ($result !== false) return $result; - } - return false; - } - -} - -// vim: et sw=4 sts=4 diff --git a/main/inc/lib/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/DenyElementDecorator.php b/main/inc/lib/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/DenyElementDecorator.php deleted file mode 100755 index 6599c5b2dd..0000000000 --- a/main/inc/lib/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/DenyElementDecorator.php +++ /dev/null @@ -1,28 +0,0 @@ -def = $def; - $this->element = $element; - } - /** - * Checks if CurrentToken is set and equal to $this->element - */ - public function validate($string, $config, $context) { - $token = $context->get('CurrentToken', true); - if ($token && $token->name == $this->element) return false; - return $this->def->validate($string, $config, $context); - } -} - -// vim: et sw=4 sts=4 diff --git a/main/inc/lib/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/Filter.php b/main/inc/lib/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/Filter.php deleted file mode 100755 index 147894b861..0000000000 --- a/main/inc/lib/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/Filter.php +++ /dev/null @@ -1,54 +0,0 @@ -intValidator = new HTMLPurifier_AttrDef_Integer(); - } - - public function validate($value, $config, $context) { - $value = $this->parseCDATA($value); - if ($value === 'none') return $value; - // if we looped this we could support multiple filters - $function_length = strcspn($value, '('); - $function = trim(substr($value, 0, $function_length)); - if ($function !== 'alpha' && - $function !== 'Alpha' && - $function !== 'progid:DXImageTransform.Microsoft.Alpha' - ) return false; - $cursor = $function_length + 1; - $parameters_length = strcspn($value, ')', $cursor); - $parameters = substr($value, $cursor, $parameters_length); - $params = explode(',', $parameters); - $ret_params = array(); - $lookup = array(); - foreach ($params as $param) { - list($key, $value) = explode('=', $param); - $key = trim($key); - $value = trim($value); - if (isset($lookup[$key])) continue; - if ($key !== 'opacity') continue; - $value = $this->intValidator->validate($value, $config, $context); - if ($value === false) continue; - $int = (int) $value; - if ($int > 100) $value = '100'; - if ($int < 0) $value = '0'; - $ret_params[] = "$key=$value"; - $lookup[$key] = true; - } - $ret_parameters = implode(',', $ret_params); - $ret_function = "$function($ret_parameters)"; - return $ret_function; - } - -} - -// vim: et sw=4 sts=4 diff --git a/main/inc/lib/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/Font.php b/main/inc/lib/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/Font.php deleted file mode 100755 index 699ee0b701..0000000000 --- a/main/inc/lib/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/Font.php +++ /dev/null @@ -1,149 +0,0 @@ -getCSSDefinition(); - $this->info['font-style'] = $def->info['font-style']; - $this->info['font-variant'] = $def->info['font-variant']; - $this->info['font-weight'] = $def->info['font-weight']; - $this->info['font-size'] = $def->info['font-size']; - $this->info['line-height'] = $def->info['line-height']; - $this->info['font-family'] = $def->info['font-family']; - } - - public function validate($string, $config, $context) { - - static $system_fonts = array( - 'caption' => true, - 'icon' => true, - 'menu' => true, - 'message-box' => true, - 'small-caption' => true, - 'status-bar' => true - ); - - // regular pre-processing - $string = $this->parseCDATA($string); - if ($string === '') return false; - - // check if it's one of the keywords - $lowercase_string = strtolower($string); - if (isset($system_fonts[$lowercase_string])) { - return $lowercase_string; - } - - $bits = explode(' ', $string); // bits to process - $stage = 0; // this indicates what we're looking for - $caught = array(); // which stage 0 properties have we caught? - $stage_1 = array('font-style', 'font-variant', 'font-weight'); - $final = ''; // output - - for ($i = 0, $size = count($bits); $i < $size; $i++) { - if ($bits[$i] === '') continue; - switch ($stage) { - - // attempting to catch font-style, font-variant or font-weight - case 0: - foreach ($stage_1 as $validator_name) { - if (isset($caught[$validator_name])) continue; - $r = $this->info[$validator_name]->validate( - $bits[$i], $config, $context); - if ($r !== false) { - $final .= $r . ' '; - $caught[$validator_name] = true; - break; - } - } - // all three caught, continue on - if (count($caught) >= 3) $stage = 1; - if ($r !== false) break; - - // attempting to catch font-size and perhaps line-height - case 1: - $found_slash = false; - if (strpos($bits[$i], '/') !== false) { - list($font_size, $line_height) = - explode('/', $bits[$i]); - if ($line_height === '') { - // ooh, there's a space after the slash! - $line_height = false; - $found_slash = true; - } - } else { - $font_size = $bits[$i]; - $line_height = false; - } - $r = $this->info['font-size']->validate( - $font_size, $config, $context); - if ($r !== false) { - $final .= $r; - // attempt to catch line-height - if ($line_height === false) { - // we need to scroll forward - for ($j = $i + 1; $j < $size; $j++) { - if ($bits[$j] === '') continue; - if ($bits[$j] === '/') { - if ($found_slash) { - return false; - } else { - $found_slash = true; - continue; - } - } - $line_height = $bits[$j]; - break; - } - } else { - // slash already found - $found_slash = true; - $j = $i; - } - if ($found_slash) { - $i = $j; - $r = $this->info['line-height']->validate( - $line_height, $config, $context); - if ($r !== false) { - $final .= '/' . $r; - } - } - $final .= ' '; - $stage = 2; - break; - } - return false; - - // attempting to catch font-family - case 2: - $font_family = - implode(' ', array_slice($bits, $i, $size - $i)); - $r = $this->info['font-family']->validate( - $font_family, $config, $context); - if ($r !== false) { - $final .= $r . ' '; - // processing completed successfully - return rtrim($final); - } - return false; - } - } - return false; - } - -} - -// vim: et sw=4 sts=4 diff --git a/main/inc/lib/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/FontFamily.php b/main/inc/lib/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/FontFamily.php deleted file mode 100755 index 1b7dc6082a..0000000000 --- a/main/inc/lib/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/FontFamily.php +++ /dev/null @@ -1,72 +0,0 @@ - true, - 'sans-serif' => true, - 'monospace' => true, - 'fantasy' => true, - 'cursive' => true - ); - - // assume that no font names contain commas in them - $fonts = explode(',', $string); - $final = ''; - foreach($fonts as $font) { - $font = trim($font); - if ($font === '') continue; - // match a generic name - if (isset($generic_names[$font])) { - $final .= $font . ', '; - continue; - } - // match a quoted name - if ($font[0] === '"' || $font[0] === "'") { - $length = strlen($font); - if ($length <= 2) continue; - $quote = $font[0]; - if ($font[$length - 1] !== $quote) continue; - $font = substr($font, 1, $length - 2); - } - - $font = $this->expandCSSEscape($font); - - // $font is a pure representation of the font name - - if (ctype_alnum($font) && $font !== '') { - // very simple font, allow it in unharmed - $final .= $font . ', '; - continue; - } - - // bugger out on whitespace. form feed (0C) really - // shouldn't show up regardless - $font = str_replace(array("\n", "\t", "\r", "\x0C"), ' ', $font); - - // These ugly transforms don't pose a security - // risk (as \\ and \" might). We could try to be clever and - // use single-quote wrapping when there is a double quote - // present, but I have choosen not to implement that. - // (warning: this code relies on the selection of quotation - // mark below) - $font = str_replace('\\', '\\5C ', $font); - $font = str_replace('"', '\\22 ', $font); - - // complicated font, requires quoting - $final .= "\"$font\", "; // note that this will later get turned into " - } - $final = rtrim($final, ', '); - if ($final === '') return false; - return $final; - } - -} - -// vim: et sw=4 sts=4 diff --git a/main/inc/lib/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/ImportantDecorator.php b/main/inc/lib/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/ImportantDecorator.php deleted file mode 100755 index 4e6b35e5a0..0000000000 --- a/main/inc/lib/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/ImportantDecorator.php +++ /dev/null @@ -1,40 +0,0 @@ -def = $def; - $this->allow = $allow; - } - /** - * Intercepts and removes !important if necessary - */ - public function validate($string, $config, $context) { - // test for ! and important tokens - $string = trim($string); - $is_important = false; - // :TODO: optimization: test directly for !important and ! important - if (strlen($string) >= 9 && substr($string, -9) === 'important') { - $temp = rtrim(substr($string, 0, -9)); - // use a temp, because we might want to restore important - if (strlen($temp) >= 1 && substr($temp, -1) === '!') { - $string = rtrim(substr($temp, 0, -1)); - $is_important = true; - } - } - $string = $this->def->validate($string, $config, $context); - if ($this->allow && $is_important) $string .= ' !important'; - return $string; - } -} - -// vim: et sw=4 sts=4 diff --git a/main/inc/lib/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/Length.php b/main/inc/lib/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/Length.php deleted file mode 100755 index a07ec58135..0000000000 --- a/main/inc/lib/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/Length.php +++ /dev/null @@ -1,47 +0,0 @@ -min = $min !== null ? HTMLPurifier_Length::make($min) : null; - $this->max = $max !== null ? HTMLPurifier_Length::make($max) : null; - } - - public function validate($string, $config, $context) { - $string = $this->parseCDATA($string); - - // Optimizations - if ($string === '') return false; - if ($string === '0') return '0'; - if (strlen($string) === 1) return false; - - $length = HTMLPurifier_Length::make($string); - if (!$length->isValid()) return false; - - if ($this->min) { - $c = $length->compareTo($this->min); - if ($c === false) return false; - if ($c < 0) return false; - } - if ($this->max) { - $c = $length->compareTo($this->max); - if ($c === false) return false; - if ($c > 0) return false; - } - - return $length->toString(); - } - -} - -// vim: et sw=4 sts=4 diff --git a/main/inc/lib/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/ListStyle.php b/main/inc/lib/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/ListStyle.php deleted file mode 100755 index 4406868c08..0000000000 --- a/main/inc/lib/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/ListStyle.php +++ /dev/null @@ -1,78 +0,0 @@ -getCSSDefinition(); - $this->info['list-style-type'] = $def->info['list-style-type']; - $this->info['list-style-position'] = $def->info['list-style-position']; - $this->info['list-style-image'] = $def->info['list-style-image']; - } - - public function validate($string, $config, $context) { - - // regular pre-processing - $string = $this->parseCDATA($string); - if ($string === '') return false; - - // assumes URI doesn't have spaces in it - $bits = explode(' ', strtolower($string)); // bits to process - - $caught = array(); - $caught['type'] = false; - $caught['position'] = false; - $caught['image'] = false; - - $i = 0; // number of catches - $none = false; - - foreach ($bits as $bit) { - if ($i >= 3) return; // optimization bit - if ($bit === '') continue; - foreach ($caught as $key => $status) { - if ($status !== false) continue; - $r = $this->info['list-style-' . $key]->validate($bit, $config, $context); - if ($r === false) continue; - if ($r === 'none') { - if ($none) continue; - else $none = true; - if ($key == 'image') continue; - } - $caught[$key] = $r; - $i++; - break; - } - } - - if (!$i) return false; - - $ret = array(); - - // construct type - if ($caught['type']) $ret[] = $caught['type']; - - // construct image - if ($caught['image']) $ret[] = $caught['image']; - - // construct position - if ($caught['position']) $ret[] = $caught['position']; - - if (empty($ret)) return false; - return implode(' ', $ret); - - } - -} - -// vim: et sw=4 sts=4 diff --git a/main/inc/lib/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/Multiple.php b/main/inc/lib/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/Multiple.php deleted file mode 100755 index 4d62a40d7f..0000000000 --- a/main/inc/lib/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/Multiple.php +++ /dev/null @@ -1,58 +0,0 @@ -single = $single; - $this->max = $max; - } - - public function validate($string, $config, $context) { - $string = $this->parseCDATA($string); - if ($string === '') return false; - $parts = explode(' ', $string); // parseCDATA replaced \r, \t and \n - $length = count($parts); - $final = ''; - for ($i = 0, $num = 0; $i < $length && $num < $this->max; $i++) { - if (ctype_space($parts[$i])) continue; - $result = $this->single->validate($parts[$i], $config, $context); - if ($result !== false) { - $final .= $result . ' '; - $num++; - } - } - if ($final === '') return false; - return rtrim($final); - } - -} - -// vim: et sw=4 sts=4 diff --git a/main/inc/lib/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/Number.php b/main/inc/lib/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/Number.php deleted file mode 100755 index 3f99e12ec2..0000000000 --- a/main/inc/lib/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/Number.php +++ /dev/null @@ -1,69 +0,0 @@ -non_negative = $non_negative; - } - - /** - * @warning Some contexts do not pass $config, $context. These - * variables should not be used without checking HTMLPurifier_Length - */ - public function validate($number, $config, $context) { - - $number = $this->parseCDATA($number); - - if ($number === '') return false; - if ($number === '0') return '0'; - - $sign = ''; - switch ($number[0]) { - case '-': - if ($this->non_negative) return false; - $sign = '-'; - case '+': - $number = substr($number, 1); - } - - if (ctype_digit($number)) { - $number = ltrim($number, '0'); - return $number ? $sign . $number : '0'; - } - - // Period is the only non-numeric character allowed - if (strpos($number, '.') === false) return false; - - list($left, $right) = explode('.', $number, 2); - - if ($left === '' && $right === '') return false; - if ($left !== '' && !ctype_digit($left)) return false; - - $left = ltrim($left, '0'); - $right = rtrim($right, '0'); - - if ($right === '') { - return $left ? $sign . $left : '0'; - } elseif (!ctype_digit($right)) { - return false; - } - - return $sign . $left . '.' . $right; - - } - -} - -// vim: et sw=4 sts=4 diff --git a/main/inc/lib/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/Percentage.php b/main/inc/lib/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/Percentage.php deleted file mode 100755 index c34b8fc3c3..0000000000 --- a/main/inc/lib/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/Percentage.php +++ /dev/null @@ -1,40 +0,0 @@ -number_def = new HTMLPurifier_AttrDef_CSS_Number($non_negative); - } - - public function validate($string, $config, $context) { - - $string = $this->parseCDATA($string); - - if ($string === '') return false; - $length = strlen($string); - if ($length === 1) return false; - if ($string[$length - 1] !== '%') return false; - - $number = substr($string, 0, $length - 1); - $number = $this->number_def->validate($number, $config, $context); - - if ($number === false) return false; - return "$number%"; - - } - -} - -// vim: et sw=4 sts=4 diff --git a/main/inc/lib/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/TextDecoration.php b/main/inc/lib/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/TextDecoration.php deleted file mode 100755 index 772c922d80..0000000000 --- a/main/inc/lib/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/TextDecoration.php +++ /dev/null @@ -1,38 +0,0 @@ - true, - 'overline' => true, - 'underline' => true, - ); - - $string = strtolower($this->parseCDATA($string)); - - if ($string === 'none') return $string; - - $parts = explode(' ', $string); - $final = ''; - foreach ($parts as $part) { - if (isset($allowed_values[$part])) { - $final .= $part . ' '; - } - } - $final = rtrim($final); - if ($final === '') return false; - return $final; - - } - -} - -// vim: et sw=4 sts=4 diff --git a/main/inc/lib/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/URI.php b/main/inc/lib/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/URI.php deleted file mode 100755 index 5309dc7082..0000000000 --- a/main/inc/lib/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/URI.php +++ /dev/null @@ -1,52 +0,0 @@ -parseCDATA($uri_string); - if (strpos($uri_string, 'url(') !== 0) return false; - $uri_string = substr($uri_string, 4); - $new_length = strlen($uri_string) - 1; - if ($uri_string[$new_length] != ')') return false; - $uri = trim(substr($uri_string, 0, $new_length)); - - if (!empty($uri) && ($uri[0] == "'" || $uri[0] == '"')) { - $quote = $uri[0]; - $new_length = strlen($uri) - 1; - if ($uri[$new_length] !== $quote) return false; - $uri = substr($uri, 1, $new_length - 1); - } - - $uri = $this->expandCSSEscape($uri); - - $result = parent::validate($uri, $config, $context); - - if ($result === false) return false; - - // extra sanity check; should have been done by URI - $result = str_replace(array('"', "\\", "\n", "\x0c", "\r"), "", $result); - - return "url(\"$result\")"; - - } - -} - -// vim: et sw=4 sts=4 diff --git a/main/inc/lib/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/index.html b/main/inc/lib/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/index.html deleted file mode 100755 index aa7b9c934b..0000000000 --- a/main/inc/lib/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/index.html +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/main/inc/lib/htmlpurifier/library/HTMLPurifier/AttrDef/Enum.php b/main/inc/lib/htmlpurifier/library/HTMLPurifier/AttrDef/Enum.php deleted file mode 100755 index 5d603ebcc6..0000000000 --- a/main/inc/lib/htmlpurifier/library/HTMLPurifier/AttrDef/Enum.php +++ /dev/null @@ -1,65 +0,0 @@ -valid_values = array_flip($valid_values); - $this->case_sensitive = $case_sensitive; - } - - public function validate($string, $config, $context) { - $string = trim($string); - if (!$this->case_sensitive) { - // we may want to do full case-insensitive libraries - $string = ctype_lower($string) ? $string : strtolower($string); - } - $result = isset($this->valid_values[$string]); - - return $result ? $string : false; - } - - /** - * @param $string In form of comma-delimited list of case-insensitive - * valid values. Example: "foo,bar,baz". Prepend "s:" to make - * case sensitive - */ - public function make($string) { - if (strlen($string) > 2 && $string[0] == 's' && $string[1] == ':') { - $string = substr($string, 2); - $sensitive = true; - } else { - $sensitive = false; - } - $values = explode(',', $string); - return new HTMLPurifier_AttrDef_Enum($values, $sensitive); - } - -} - -// vim: et sw=4 sts=4 diff --git a/main/inc/lib/htmlpurifier/library/HTMLPurifier/AttrDef/HTML/Bool.php b/main/inc/lib/htmlpurifier/library/HTMLPurifier/AttrDef/HTML/Bool.php deleted file mode 100755 index e06987eb8d..0000000000 --- a/main/inc/lib/htmlpurifier/library/HTMLPurifier/AttrDef/HTML/Bool.php +++ /dev/null @@ -1,28 +0,0 @@ -name = $name;} - - public function validate($string, $config, $context) { - if (empty($string)) return false; - return $this->name; - } - - /** - * @param $string Name of attribute - */ - public function make($string) { - return new HTMLPurifier_AttrDef_HTML_Bool($string); - } - -} - -// vim: et sw=4 sts=4 diff --git a/main/inc/lib/htmlpurifier/library/HTMLPurifier/AttrDef/HTML/Class.php b/main/inc/lib/htmlpurifier/library/HTMLPurifier/AttrDef/HTML/Class.php deleted file mode 100755 index 370068d975..0000000000 --- a/main/inc/lib/htmlpurifier/library/HTMLPurifier/AttrDef/HTML/Class.php +++ /dev/null @@ -1,34 +0,0 @@ -getDefinition('HTML')->doctype->name; - if ($name == "XHTML 1.1" || $name == "XHTML 2.0") { - return parent::split($string, $config, $context); - } else { - return preg_split('/\s+/', $string); - } - } - protected function filter($tokens, $config, $context) { - $allowed = $config->get('Attr.AllowedClasses'); - $forbidden = $config->get('Attr.ForbiddenClasses'); - $ret = array(); - foreach ($tokens as $token) { - if ( - ($allowed === null || isset($allowed[$token])) && - !isset($forbidden[$token]) && - // We need this O(n) check because of PHP's array - // implementation that casts -0 to 0. - !in_array($token, $ret, true) - ) { - $ret[] = $token; - } - } - return $ret; - } -} diff --git a/main/inc/lib/htmlpurifier/library/HTMLPurifier/AttrDef/HTML/Color.php b/main/inc/lib/htmlpurifier/library/HTMLPurifier/AttrDef/HTML/Color.php deleted file mode 100755 index d01e20454e..0000000000 --- a/main/inc/lib/htmlpurifier/library/HTMLPurifier/AttrDef/HTML/Color.php +++ /dev/null @@ -1,32 +0,0 @@ -get('Core.ColorKeywords'); - - $string = trim($string); - - if (empty($string)) return false; - if (isset($colors[$string])) return $colors[$string]; - if ($string[0] === '#') $hex = substr($string, 1); - else $hex = $string; - - $length = strlen($hex); - if ($length !== 3 && $length !== 6) return false; - if (!ctype_xdigit($hex)) return false; - if ($length === 3) $hex = $hex[0].$hex[0].$hex[1].$hex[1].$hex[2].$hex[2]; - - return "#$hex"; - - } - -} - -// vim: et sw=4 sts=4 diff --git a/main/inc/lib/htmlpurifier/library/HTMLPurifier/AttrDef/HTML/FrameTarget.php b/main/inc/lib/htmlpurifier/library/HTMLPurifier/AttrDef/HTML/FrameTarget.php deleted file mode 100755 index ae6ea7c01d..0000000000 --- a/main/inc/lib/htmlpurifier/library/HTMLPurifier/AttrDef/HTML/FrameTarget.php +++ /dev/null @@ -1,21 +0,0 @@ -valid_values === false) $this->valid_values = $config->get('Attr.AllowedFrameTargets'); - return parent::validate($string, $config, $context); - } - -} - -// vim: et sw=4 sts=4 diff --git a/main/inc/lib/htmlpurifier/library/HTMLPurifier/AttrDef/HTML/ID.php b/main/inc/lib/htmlpurifier/library/HTMLPurifier/AttrDef/HTML/ID.php deleted file mode 100755 index 81d03762de..0000000000 --- a/main/inc/lib/htmlpurifier/library/HTMLPurifier/AttrDef/HTML/ID.php +++ /dev/null @@ -1,70 +0,0 @@ -get('Attr.EnableID')) return false; - - $id = trim($id); // trim it first - - if ($id === '') return false; - - $prefix = $config->get('Attr.IDPrefix'); - if ($prefix !== '') { - $prefix .= $config->get('Attr.IDPrefixLocal'); - // prevent re-appending the prefix - if (strpos($id, $prefix) !== 0) $id = $prefix . $id; - } elseif ($config->get('Attr.IDPrefixLocal') !== '') { - trigger_error('%Attr.IDPrefixLocal cannot be used unless '. - '%Attr.IDPrefix is set', E_USER_WARNING); - } - - //if (!$this->ref) { - $id_accumulator =& $context->get('IDAccumulator'); - if (isset($id_accumulator->ids[$id])) return false; - //} - - // we purposely avoid using regex, hopefully this is faster - - if (ctype_alpha($id)) { - $result = true; - } else { - if (!ctype_alpha(@$id[0])) return false; - $trim = trim( // primitive style of regexps, I suppose - $id, - 'A..Za..z0..9:-._' - ); - $result = ($trim === ''); - } - - $regexp = $config->get('Attr.IDBlacklistRegexp'); - if ($regexp && preg_match($regexp, $id)) { - return false; - } - - if (/*!$this->ref && */$result) $id_accumulator->add($id); - - // if no change was made to the ID, return the result - // else, return the new id if stripping whitespace made it - // valid, or return false. - return $result ? $id : false; - - } - -} - -// vim: et sw=4 sts=4 diff --git a/main/inc/lib/htmlpurifier/library/HTMLPurifier/AttrDef/HTML/Length.php b/main/inc/lib/htmlpurifier/library/HTMLPurifier/AttrDef/HTML/Length.php deleted file mode 100755 index a242f9c238..0000000000 --- a/main/inc/lib/htmlpurifier/library/HTMLPurifier/AttrDef/HTML/Length.php +++ /dev/null @@ -1,41 +0,0 @@ - 100) return '100%'; - - return ((string) $points) . '%'; - - } - -} - -// vim: et sw=4 sts=4 diff --git a/main/inc/lib/htmlpurifier/library/HTMLPurifier/AttrDef/HTML/LinkTypes.php b/main/inc/lib/htmlpurifier/library/HTMLPurifier/AttrDef/HTML/LinkTypes.php deleted file mode 100755 index 76d25ed088..0000000000 --- a/main/inc/lib/htmlpurifier/library/HTMLPurifier/AttrDef/HTML/LinkTypes.php +++ /dev/null @@ -1,53 +0,0 @@ - 'AllowedRel', - 'rev' => 'AllowedRev' - ); - if (!isset($configLookup[$name])) { - trigger_error('Unrecognized attribute name for link '. - 'relationship.', E_USER_ERROR); - return; - } - $this->name = $configLookup[$name]; - } - - public function validate($string, $config, $context) { - - $allowed = $config->get('Attr.' . $this->name); - if (empty($allowed)) return false; - - $string = $this->parseCDATA($string); - $parts = explode(' ', $string); - - // lookup to prevent duplicates - $ret_lookup = array(); - foreach ($parts as $part) { - $part = strtolower(trim($part)); - if (!isset($allowed[$part])) continue; - $ret_lookup[$part] = true; - } - - if (empty($ret_lookup)) return false; - $string = implode(' ', array_keys($ret_lookup)); - - return $string; - - } - -} - -// vim: et sw=4 sts=4 diff --git a/main/inc/lib/htmlpurifier/library/HTMLPurifier/AttrDef/HTML/MultiLength.php b/main/inc/lib/htmlpurifier/library/HTMLPurifier/AttrDef/HTML/MultiLength.php deleted file mode 100755 index c72fc76e4d..0000000000 --- a/main/inc/lib/htmlpurifier/library/HTMLPurifier/AttrDef/HTML/MultiLength.php +++ /dev/null @@ -1,41 +0,0 @@ -split($string, $config, $context); - $tokens = $this->filter($tokens, $config, $context); - if (empty($tokens)) return false; - return implode(' ', $tokens); - - } - - /** - * Splits a space separated list of tokens into its constituent parts. - */ - protected function split($string, $config, $context) { - // OPTIMIZABLE! - // do the preg_match, capture all subpatterns for reformulation - - // we don't support U+00A1 and up codepoints or - // escaping because I don't know how to do that with regexps - // and plus it would complicate optimization efforts (you never - // see that anyway). - $pattern = '/(?:(?<=\s)|\A)'. // look behind for space or string start - '((?:--|-?[A-Za-z_])[A-Za-z_\-0-9]*)'. - '(?:(?=\s)|\z)/'; // look ahead for space or string end - preg_match_all($pattern, $string, $matches); - return $matches[1]; - } - - /** - * Template method for removing certain tokens based on arbitrary criteria. - * @note If we wanted to be really functional, we'd do an array_filter - * with a callback. But... we're not. - */ - protected function filter($tokens, $config, $context) { - return $tokens; - } - -} - -// vim: et sw=4 sts=4 diff --git a/main/inc/lib/htmlpurifier/library/HTMLPurifier/AttrDef/HTML/Pixels.php b/main/inc/lib/htmlpurifier/library/HTMLPurifier/AttrDef/HTML/Pixels.php deleted file mode 100755 index 4cb2c1b857..0000000000 --- a/main/inc/lib/htmlpurifier/library/HTMLPurifier/AttrDef/HTML/Pixels.php +++ /dev/null @@ -1,48 +0,0 @@ -max = $max; - } - - public function validate($string, $config, $context) { - - $string = trim($string); - if ($string === '0') return $string; - if ($string === '') return false; - $length = strlen($string); - if (substr($string, $length - 2) == 'px') { - $string = substr($string, 0, $length - 2); - } - if (!is_numeric($string)) return false; - $int = (int) $string; - - if ($int < 0) return '0'; - - // upper-bound value, extremely high values can - // crash operating systems, see - // WARNING, above link WILL crash you if you're using Windows - - if ($this->max !== null && $int > $this->max) return (string) $this->max; - - return (string) $int; - - } - - public function make($string) { - if ($string === '') $max = null; - else $max = (int) $string; - $class = get_class($this); - return new $class($max); - } - -} - -// vim: et sw=4 sts=4 diff --git a/main/inc/lib/htmlpurifier/library/HTMLPurifier/AttrDef/HTML/index.html b/main/inc/lib/htmlpurifier/library/HTMLPurifier/AttrDef/HTML/index.html deleted file mode 100755 index aa7b9c934b..0000000000 --- a/main/inc/lib/htmlpurifier/library/HTMLPurifier/AttrDef/HTML/index.html +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/main/inc/lib/htmlpurifier/library/HTMLPurifier/AttrDef/Integer.php b/main/inc/lib/htmlpurifier/library/HTMLPurifier/AttrDef/Integer.php deleted file mode 100755 index d59738d2a2..0000000000 --- a/main/inc/lib/htmlpurifier/library/HTMLPurifier/AttrDef/Integer.php +++ /dev/null @@ -1,73 +0,0 @@ -negative = $negative; - $this->zero = $zero; - $this->positive = $positive; - } - - public function validate($integer, $config, $context) { - - $integer = $this->parseCDATA($integer); - if ($integer === '') return false; - - // we could possibly simply typecast it to integer, but there are - // certain fringe cases that must not return an integer. - - // clip leading sign - if ( $this->negative && $integer[0] === '-' ) { - $digits = substr($integer, 1); - if ($digits === '0') $integer = '0'; // rm minus sign for zero - } elseif( $this->positive && $integer[0] === '+' ) { - $digits = $integer = substr($integer, 1); // rm unnecessary plus - } else { - $digits = $integer; - } - - // test if it's numeric - if (!ctype_digit($digits)) return false; - - // perform scope tests - if (!$this->zero && $integer == 0) return false; - if (!$this->positive && $integer > 0) return false; - if (!$this->negative && $integer < 0) return false; - - return $integer; - - } - -} - -// vim: et sw=4 sts=4 diff --git a/main/inc/lib/htmlpurifier/library/HTMLPurifier/AttrDef/Lang.php b/main/inc/lib/htmlpurifier/library/HTMLPurifier/AttrDef/Lang.php deleted file mode 100755 index 10e6da56db..0000000000 --- a/main/inc/lib/htmlpurifier/library/HTMLPurifier/AttrDef/Lang.php +++ /dev/null @@ -1,73 +0,0 @@ - 8 || !ctype_alnum($subtags[1])) { - return $new_string; - } - if (!ctype_lower($subtags[1])) $subtags[1] = strtolower($subtags[1]); - - $new_string .= '-' . $subtags[1]; - if ($num_subtags == 2) return $new_string; - - // process all other subtags, index 2 and up - for ($i = 2; $i < $num_subtags; $i++) { - $length = strlen($subtags[$i]); - if ($length == 0 || $length > 8 || !ctype_alnum($subtags[$i])) { - return $new_string; - } - if (!ctype_lower($subtags[$i])) { - $subtags[$i] = strtolower($subtags[$i]); - } - $new_string .= '-' . $subtags[$i]; - } - - return $new_string; - - } - -} - -// vim: et sw=4 sts=4 diff --git a/main/inc/lib/htmlpurifier/library/HTMLPurifier/AttrDef/Switch.php b/main/inc/lib/htmlpurifier/library/HTMLPurifier/AttrDef/Switch.php deleted file mode 100755 index c9e3ed193e..0000000000 --- a/main/inc/lib/htmlpurifier/library/HTMLPurifier/AttrDef/Switch.php +++ /dev/null @@ -1,34 +0,0 @@ -tag = $tag; - $this->withTag = $with_tag; - $this->withoutTag = $without_tag; - } - - public function validate($string, $config, $context) { - $token = $context->get('CurrentToken', true); - if (!$token || $token->name !== $this->tag) { - return $this->withoutTag->validate($string, $config, $context); - } else { - return $this->withTag->validate($string, $config, $context); - } - } - -} - -// vim: et sw=4 sts=4 diff --git a/main/inc/lib/htmlpurifier/library/HTMLPurifier/AttrDef/Text.php b/main/inc/lib/htmlpurifier/library/HTMLPurifier/AttrDef/Text.php deleted file mode 100755 index c6216cc531..0000000000 --- a/main/inc/lib/htmlpurifier/library/HTMLPurifier/AttrDef/Text.php +++ /dev/null @@ -1,15 +0,0 @@ -parseCDATA($string); - } - -} - -// vim: et sw=4 sts=4 diff --git a/main/inc/lib/htmlpurifier/library/HTMLPurifier/AttrDef/URI.php b/main/inc/lib/htmlpurifier/library/HTMLPurifier/AttrDef/URI.php deleted file mode 100755 index 01a6d83e95..0000000000 --- a/main/inc/lib/htmlpurifier/library/HTMLPurifier/AttrDef/URI.php +++ /dev/null @@ -1,77 +0,0 @@ -parser = new HTMLPurifier_URIParser(); - $this->embedsResource = (bool) $embeds_resource; - } - - public function make($string) { - $embeds = (bool) $string; - return new HTMLPurifier_AttrDef_URI($embeds); - } - - public function validate($uri, $config, $context) { - - if ($config->get('URI.Disable')) return false; - - $uri = $this->parseCDATA($uri); - - // parse the URI - $uri = $this->parser->parse($uri); - if ($uri === false) return false; - - // add embedded flag to context for validators - $context->register('EmbeddedURI', $this->embedsResource); - - $ok = false; - do { - - // generic validation - $result = $uri->validate($config, $context); - if (!$result) break; - - // chained filtering - $uri_def = $config->getDefinition('URI'); - $result = $uri_def->filter($uri, $config, $context); - if (!$result) break; - - // scheme-specific validation - $scheme_obj = $uri->getSchemeObj($config, $context); - if (!$scheme_obj) break; - if ($this->embedsResource && !$scheme_obj->browsable) break; - $result = $scheme_obj->validate($uri, $config, $context); - if (!$result) break; - - // Post chained filtering - $result = $uri_def->postFilter($uri, $config, $context); - if (!$result) break; - - // survived gauntlet - $ok = true; - - } while (false); - - $context->destroy('EmbeddedURI'); - if (!$ok) return false; - - // back to string - return $uri->toString(); - - } - -} - -// vim: et sw=4 sts=4 diff --git a/main/inc/lib/htmlpurifier/library/HTMLPurifier/AttrDef/URI/Email.php b/main/inc/lib/htmlpurifier/library/HTMLPurifier/AttrDef/URI/Email.php deleted file mode 100755 index bfee9d166c..0000000000 --- a/main/inc/lib/htmlpurifier/library/HTMLPurifier/AttrDef/URI/Email.php +++ /dev/null @@ -1,17 +0,0 @@ -" - // that needs more percent encoding to be done - if ($string == '') return false; - $string = trim($string); - $result = preg_match('/^[A-Z0-9._%-]+@[A-Z0-9.-]+\.[A-Z]{2,4}$/i', $string); - return $result ? $string : false; - } - -} - -// vim: et sw=4 sts=4 diff --git a/main/inc/lib/htmlpurifier/library/HTMLPurifier/AttrDef/URI/Email/index.html b/main/inc/lib/htmlpurifier/library/HTMLPurifier/AttrDef/URI/Email/index.html deleted file mode 100755 index aa7b9c934b..0000000000 --- a/main/inc/lib/htmlpurifier/library/HTMLPurifier/AttrDef/URI/Email/index.html +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/main/inc/lib/htmlpurifier/library/HTMLPurifier/AttrDef/URI/Host.php b/main/inc/lib/htmlpurifier/library/HTMLPurifier/AttrDef/URI/Host.php deleted file mode 100755 index feca469d70..0000000000 --- a/main/inc/lib/htmlpurifier/library/HTMLPurifier/AttrDef/URI/Host.php +++ /dev/null @@ -1,68 +0,0 @@ -ipv4 = new HTMLPurifier_AttrDef_URI_IPv4(); - $this->ipv6 = new HTMLPurifier_AttrDef_URI_IPv6(); - } - - public function validate($string, $config, $context) { - $length = strlen($string); - // empty hostname is OK; it's usually semantically equivalent: - // the default host as defined by a URI scheme is used: - // - // If the URI scheme defines a default for host, then that - // default applies when the host subcomponent is undefined - // or when the registered name is empty (zero length). - if ($string === '') return ''; - if ($length > 1 && $string[0] === '[' && $string[$length-1] === ']') { - //IPv6 - $ip = substr($string, 1, $length - 2); - $valid = $this->ipv6->validate($ip, $config, $context); - if ($valid === false) return false; - return '['. $valid . ']'; - } - - // need to do checks on unusual encodings too - $ipv4 = $this->ipv4->validate($string, $config, $context); - if ($ipv4 !== false) return $ipv4; - - // A regular domain name. - - // This breaks I18N domain names, but we don't have proper IRI support, - // so force users to insert Punycode. If there's complaining we'll - // try to fix things into an international friendly form. - - // The productions describing this are: - $a = '[a-z]'; // alpha - $an = '[a-z0-9]'; // alphanum - $and = '[a-z0-9-]'; // alphanum | "-" - // domainlabel = alphanum | alphanum *( alphanum | "-" ) alphanum - $domainlabel = "$an($and*$an)?"; - // toplabel = alpha | alpha *( alphanum | "-" ) alphanum - $toplabel = "$a($and*$an)?"; - // hostname = *( domainlabel "." ) toplabel [ "." ] - $match = preg_match("/^($domainlabel\.)*$toplabel\.?$/i", $string); - if (!$match) return false; - - return $string; - } - -} - -// vim: et sw=4 sts=4 diff --git a/main/inc/lib/htmlpurifier/library/HTMLPurifier/AttrDef/URI/IPv4.php b/main/inc/lib/htmlpurifier/library/HTMLPurifier/AttrDef/URI/IPv4.php deleted file mode 100755 index ec4cf591b8..0000000000 --- a/main/inc/lib/htmlpurifier/library/HTMLPurifier/AttrDef/URI/IPv4.php +++ /dev/null @@ -1,39 +0,0 @@ -ip4) $this->_loadRegex(); - - if (preg_match('#^' . $this->ip4 . '$#s', $aIP)) - { - return $aIP; - } - - return false; - - } - - /** - * Lazy load function to prevent regex from being stuffed in - * cache. - */ - protected function _loadRegex() { - $oct = '(?:25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])'; // 0-255 - $this->ip4 = "(?:{$oct}\\.{$oct}\\.{$oct}\\.{$oct})"; - } - -} - -// vim: et sw=4 sts=4 diff --git a/main/inc/lib/htmlpurifier/library/HTMLPurifier/AttrDef/URI/IPv6.php b/main/inc/lib/htmlpurifier/library/HTMLPurifier/AttrDef/URI/IPv6.php deleted file mode 100755 index 9454e9be50..0000000000 --- a/main/inc/lib/htmlpurifier/library/HTMLPurifier/AttrDef/URI/IPv6.php +++ /dev/null @@ -1,99 +0,0 @@ -ip4) $this->_loadRegex(); - - $original = $aIP; - - $hex = '[0-9a-fA-F]'; - $blk = '(?:' . $hex . '{1,4})'; - $pre = '(?:/(?:12[0-8]|1[0-1][0-9]|[1-9][0-9]|[0-9]))'; // /0 - /128 - - // prefix check - if (strpos($aIP, '/') !== false) - { - if (preg_match('#' . $pre . '$#s', $aIP, $find)) - { - $aIP = substr($aIP, 0, 0-strlen($find[0])); - unset($find); - } - else - { - return false; - } - } - - // IPv4-compatiblity check - if (preg_match('#(?<=:'.')' . $this->ip4 . '$#s', $aIP, $find)) - { - $aIP = substr($aIP, 0, 0-strlen($find[0])); - $ip = explode('.', $find[0]); - $ip = array_map('dechex', $ip); - $aIP .= $ip[0] . $ip[1] . ':' . $ip[2] . $ip[3]; - unset($find, $ip); - } - - // compression check - $aIP = explode('::', $aIP); - $c = count($aIP); - if ($c > 2) - { - return false; - } - elseif ($c == 2) - { - list($first, $second) = $aIP; - $first = explode(':', $first); - $second = explode(':', $second); - - if (count($first) + count($second) > 8) - { - return false; - } - - while(count($first) < 8) - { - array_push($first, '0'); - } - - array_splice($first, 8 - count($second), 8, $second); - $aIP = $first; - unset($first,$second); - } - else - { - $aIP = explode(':', $aIP[0]); - } - $c = count($aIP); - - if ($c != 8) - { - return false; - } - - // All the pieces should be 16-bit hex strings. Are they? - foreach ($aIP as $piece) - { - if (!preg_match('#^[0-9a-fA-F]{4}$#s', sprintf('%04s', $piece))) - { - return false; - } - } - - return $original; - - } - -} - -// vim: et sw=4 sts=4 diff --git a/main/inc/lib/htmlpurifier/library/HTMLPurifier/AttrDef/URI/index.html b/main/inc/lib/htmlpurifier/library/HTMLPurifier/AttrDef/URI/index.html deleted file mode 100755 index aa7b9c934b..0000000000 --- a/main/inc/lib/htmlpurifier/library/HTMLPurifier/AttrDef/URI/index.html +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/main/inc/lib/htmlpurifier/library/HTMLPurifier/AttrDef/index.html b/main/inc/lib/htmlpurifier/library/HTMLPurifier/AttrDef/index.html deleted file mode 100755 index aa7b9c934b..0000000000 --- a/main/inc/lib/htmlpurifier/library/HTMLPurifier/AttrDef/index.html +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/main/inc/lib/htmlpurifier/library/HTMLPurifier/AttrTransform.php b/main/inc/lib/htmlpurifier/library/HTMLPurifier/AttrTransform.php deleted file mode 100755 index e61d3e01b6..0000000000 --- a/main/inc/lib/htmlpurifier/library/HTMLPurifier/AttrTransform.php +++ /dev/null @@ -1,56 +0,0 @@ -confiscateAttr($attr, 'background'); - // some validation should happen here - - $this->prependCSS($attr, "background-image:url($background);"); - - return $attr; - - } - -} - -// vim: et sw=4 sts=4 diff --git a/main/inc/lib/htmlpurifier/library/HTMLPurifier/AttrTransform/BdoDir.php b/main/inc/lib/htmlpurifier/library/HTMLPurifier/AttrTransform/BdoDir.php deleted file mode 100755 index 4d1a05665e..0000000000 --- a/main/inc/lib/htmlpurifier/library/HTMLPurifier/AttrTransform/BdoDir.php +++ /dev/null @@ -1,19 +0,0 @@ -get('Attr.DefaultTextDir'); - return $attr; - } - -} - -// vim: et sw=4 sts=4 diff --git a/main/inc/lib/htmlpurifier/library/HTMLPurifier/AttrTransform/BgColor.php b/main/inc/lib/htmlpurifier/library/HTMLPurifier/AttrTransform/BgColor.php deleted file mode 100755 index ad3916bb96..0000000000 --- a/main/inc/lib/htmlpurifier/library/HTMLPurifier/AttrTransform/BgColor.php +++ /dev/null @@ -1,23 +0,0 @@ -confiscateAttr($attr, 'bgcolor'); - // some validation should happen here - - $this->prependCSS($attr, "background-color:$bgcolor;"); - - return $attr; - - } - -} - -// vim: et sw=4 sts=4 diff --git a/main/inc/lib/htmlpurifier/library/HTMLPurifier/AttrTransform/BoolToCSS.php b/main/inc/lib/htmlpurifier/library/HTMLPurifier/AttrTransform/BoolToCSS.php deleted file mode 100755 index 51159b6715..0000000000 --- a/main/inc/lib/htmlpurifier/library/HTMLPurifier/AttrTransform/BoolToCSS.php +++ /dev/null @@ -1,36 +0,0 @@ -attr = $attr; - $this->css = $css; - } - - public function transform($attr, $config, $context) { - if (!isset($attr[$this->attr])) return $attr; - unset($attr[$this->attr]); - $this->prependCSS($attr, $this->css); - return $attr; - } - -} - -// vim: et sw=4 sts=4 diff --git a/main/inc/lib/htmlpurifier/library/HTMLPurifier/AttrTransform/Border.php b/main/inc/lib/htmlpurifier/library/HTMLPurifier/AttrTransform/Border.php deleted file mode 100755 index 476b0b079b..0000000000 --- a/main/inc/lib/htmlpurifier/library/HTMLPurifier/AttrTransform/Border.php +++ /dev/null @@ -1,18 +0,0 @@ -confiscateAttr($attr, 'border'); - // some validation should happen here - $this->prependCSS($attr, "border:{$border_width}px solid;"); - return $attr; - } - -} - -// vim: et sw=4 sts=4 diff --git a/main/inc/lib/htmlpurifier/library/HTMLPurifier/AttrTransform/EnumToCSS.php b/main/inc/lib/htmlpurifier/library/HTMLPurifier/AttrTransform/EnumToCSS.php deleted file mode 100755 index 2a5b4514ab..0000000000 --- a/main/inc/lib/htmlpurifier/library/HTMLPurifier/AttrTransform/EnumToCSS.php +++ /dev/null @@ -1,58 +0,0 @@ -attr = $attr; - $this->enumToCSS = $enum_to_css; - $this->caseSensitive = (bool) $case_sensitive; - } - - public function transform($attr, $config, $context) { - - if (!isset($attr[$this->attr])) return $attr; - - $value = trim($attr[$this->attr]); - unset($attr[$this->attr]); - - if (!$this->caseSensitive) $value = strtolower($value); - - if (!isset($this->enumToCSS[$value])) { - return $attr; - } - - $this->prependCSS($attr, $this->enumToCSS[$value]); - - return $attr; - - } - -} - -// vim: et sw=4 sts=4 diff --git a/main/inc/lib/htmlpurifier/library/HTMLPurifier/AttrTransform/ImgRequired.php b/main/inc/lib/htmlpurifier/library/HTMLPurifier/AttrTransform/ImgRequired.php deleted file mode 100755 index 7f0e4b7a59..0000000000 --- a/main/inc/lib/htmlpurifier/library/HTMLPurifier/AttrTransform/ImgRequired.php +++ /dev/null @@ -1,43 +0,0 @@ -get('Core.RemoveInvalidImg')) return $attr; - $attr['src'] = $config->get('Attr.DefaultInvalidImage'); - $src = false; - } - - if (!isset($attr['alt'])) { - if ($src) { - $alt = $config->get('Attr.DefaultImageAlt'); - if ($alt === null) { - // truncate if the alt is too long - $attr['alt'] = substr(basename($attr['src']),0,40); - } else { - $attr['alt'] = $alt; - } - } else { - $attr['alt'] = $config->get('Attr.DefaultInvalidImageAlt'); - } - } - - return $attr; - - } - -} - -// vim: et sw=4 sts=4 diff --git a/main/inc/lib/htmlpurifier/library/HTMLPurifier/AttrTransform/ImgSpace.php b/main/inc/lib/htmlpurifier/library/HTMLPurifier/AttrTransform/ImgSpace.php deleted file mode 100755 index fd84c10c36..0000000000 --- a/main/inc/lib/htmlpurifier/library/HTMLPurifier/AttrTransform/ImgSpace.php +++ /dev/null @@ -1,44 +0,0 @@ - array('left', 'right'), - 'vspace' => array('top', 'bottom') - ); - - public function __construct($attr) { - $this->attr = $attr; - if (!isset($this->css[$attr])) { - trigger_error(htmlspecialchars($attr) . ' is not valid space attribute'); - } - } - - public function transform($attr, $config, $context) { - - if (!isset($attr[$this->attr])) return $attr; - - $width = $this->confiscateAttr($attr, $this->attr); - // some validation could happen here - - if (!isset($this->css[$this->attr])) return $attr; - - $style = ''; - foreach ($this->css[$this->attr] as $suffix) { - $property = "margin-$suffix"; - $style .= "$property:{$width}px;"; - } - - $this->prependCSS($attr, $style); - - return $attr; - - } - -} - -// vim: et sw=4 sts=4 diff --git a/main/inc/lib/htmlpurifier/library/HTMLPurifier/AttrTransform/Input.php b/main/inc/lib/htmlpurifier/library/HTMLPurifier/AttrTransform/Input.php deleted file mode 100755 index 16829552d1..0000000000 --- a/main/inc/lib/htmlpurifier/library/HTMLPurifier/AttrTransform/Input.php +++ /dev/null @@ -1,40 +0,0 @@ -pixels = new HTMLPurifier_AttrDef_HTML_Pixels(); - } - - public function transform($attr, $config, $context) { - if (!isset($attr['type'])) $t = 'text'; - else $t = strtolower($attr['type']); - if (isset($attr['checked']) && $t !== 'radio' && $t !== 'checkbox') { - unset($attr['checked']); - } - if (isset($attr['maxlength']) && $t !== 'text' && $t !== 'password') { - unset($attr['maxlength']); - } - if (isset($attr['size']) && $t !== 'text' && $t !== 'password') { - $result = $this->pixels->validate($attr['size'], $config, $context); - if ($result === false) unset($attr['size']); - else $attr['size'] = $result; - } - if (isset($attr['src']) && $t !== 'image') { - unset($attr['src']); - } - if (!isset($attr['value']) && ($t === 'radio' || $t === 'checkbox')) { - $attr['value'] = ''; - } - return $attr; - } - -} - -// vim: et sw=4 sts=4 diff --git a/main/inc/lib/htmlpurifier/library/HTMLPurifier/AttrTransform/Lang.php b/main/inc/lib/htmlpurifier/library/HTMLPurifier/AttrTransform/Lang.php deleted file mode 100755 index 5869e7f820..0000000000 --- a/main/inc/lib/htmlpurifier/library/HTMLPurifier/AttrTransform/Lang.php +++ /dev/null @@ -1,28 +0,0 @@ -name = $name; - $this->cssName = $css_name ? $css_name : $name; - } - - public function transform($attr, $config, $context) { - if (!isset($attr[$this->name])) return $attr; - $length = $this->confiscateAttr($attr, $this->name); - if(ctype_digit($length)) $length .= 'px'; - $this->prependCSS($attr, $this->cssName . ":$length;"); - return $attr; - } - -} - -// vim: et sw=4 sts=4 diff --git a/main/inc/lib/htmlpurifier/library/HTMLPurifier/AttrTransform/Name.php b/main/inc/lib/htmlpurifier/library/HTMLPurifier/AttrTransform/Name.php deleted file mode 100755 index 15315bc735..0000000000 --- a/main/inc/lib/htmlpurifier/library/HTMLPurifier/AttrTransform/Name.php +++ /dev/null @@ -1,21 +0,0 @@ -get('HTML.Attr.Name.UseCDATA')) return $attr; - if (!isset($attr['name'])) return $attr; - $id = $this->confiscateAttr($attr, 'name'); - if ( isset($attr['id'])) return $attr; - $attr['id'] = $id; - return $attr; - } - -} - -// vim: et sw=4 sts=4 diff --git a/main/inc/lib/htmlpurifier/library/HTMLPurifier/AttrTransform/NameSync.php b/main/inc/lib/htmlpurifier/library/HTMLPurifier/AttrTransform/NameSync.php deleted file mode 100755 index a95638c140..0000000000 --- a/main/inc/lib/htmlpurifier/library/HTMLPurifier/AttrTransform/NameSync.php +++ /dev/null @@ -1,27 +0,0 @@ -idDef = new HTMLPurifier_AttrDef_HTML_ID(); - } - - public function transform($attr, $config, $context) { - if (!isset($attr['name'])) return $attr; - $name = $attr['name']; - if (isset($attr['id']) && $attr['id'] === $name) return $attr; - $result = $this->idDef->validate($name, $config, $context); - if ($result === false) unset($attr['name']); - else $attr['name'] = $result; - return $attr; - } - -} - -// vim: et sw=4 sts=4 diff --git a/main/inc/lib/htmlpurifier/library/HTMLPurifier/AttrTransform/SafeEmbed.php b/main/inc/lib/htmlpurifier/library/HTMLPurifier/AttrTransform/SafeEmbed.php deleted file mode 100755 index 01e9475f8c..0000000000 --- a/main/inc/lib/htmlpurifier/library/HTMLPurifier/AttrTransform/SafeEmbed.php +++ /dev/null @@ -1,20 +0,0 @@ -get('HTML.FlashAllowFullScreen') || !$attr['allowfullscreen'] == 'true') { - unset($attr['allowfullscreen']); // if omitted, assume to be 'false' - } - - return $attr; - } -} - -// vim: et sw=4 sts=4 diff --git a/main/inc/lib/htmlpurifier/library/HTMLPurifier/AttrTransform/SafeObject.php b/main/inc/lib/htmlpurifier/library/HTMLPurifier/AttrTransform/SafeObject.php deleted file mode 100755 index 1ed74898ba..0000000000 --- a/main/inc/lib/htmlpurifier/library/HTMLPurifier/AttrTransform/SafeObject.php +++ /dev/null @@ -1,16 +0,0 @@ -uri = new HTMLPurifier_AttrDef_URI(true); // embedded - $this->wmode = new HTMLPurifier_AttrDef_Enum(array('window', 'opaque', 'transparent')); - } - - public function transform($attr, $config, $context) { - // If we add support for other objects, we'll need to alter the - // transforms. - switch ($attr['name']) { - // application/x-shockwave-flash - // Keep this synchronized with Injector/SafeObject.php - case 'allowScriptAccess': - case 'allowscriptaccess': - $attr['value'] = 'never'; - break; - case 'allowNetworking': - case 'allownetworking': - $attr['value'] = 'internal'; - break; - case 'allowFullScreen': - case 'allowfullscreen': - if ($config->get('HTML.FlashAllowFullScreen')) { - $attr['value'] = ($attr['value'] == 'true') ? 'true' : 'false'; - } else { - $attr['value'] = 'false'; - } - break; - case 'wmode': - $attr['value'] = $this->wmode->validate($attr['value'], $config, $context); - break; - case 'movie': - case 'src': - $attr['name'] = "movie"; - $attr['value'] = $this->uri->validate($attr['value'], $config, $context); - break; - case 'flashvars': - // we're going to allow arbitrary inputs to the SWF, on - // the reasoning that it could only hack the SWF, not us. - break; - // add other cases to support other param name/value pairs - default: - $attr['name'] = $attr['value'] = null; - } - return $attr; - } -} - -// vim: et sw=4 sts=4 diff --git a/main/inc/lib/htmlpurifier/library/HTMLPurifier/AttrTransform/ScriptRequired.php b/main/inc/lib/htmlpurifier/library/HTMLPurifier/AttrTransform/ScriptRequired.php deleted file mode 100755 index 4499050a22..0000000000 --- a/main/inc/lib/htmlpurifier/library/HTMLPurifier/AttrTransform/ScriptRequired.php +++ /dev/null @@ -1,16 +0,0 @@ - - */ -class HTMLPurifier_AttrTransform_ScriptRequired extends HTMLPurifier_AttrTransform -{ - public function transform($attr, $config, $context) { - if (!isset($attr['type'])) { - $attr['type'] = 'text/javascript'; - } - return $attr; - } -} - -// vim: et sw=4 sts=4 diff --git a/main/inc/lib/htmlpurifier/library/HTMLPurifier/AttrTransform/Textarea.php b/main/inc/lib/htmlpurifier/library/HTMLPurifier/AttrTransform/Textarea.php deleted file mode 100755 index 81ac3488ba..0000000000 --- a/main/inc/lib/htmlpurifier/library/HTMLPurifier/AttrTransform/Textarea.php +++ /dev/null @@ -1,18 +0,0 @@ - - */ -class HTMLPurifier_AttrTransform_Textarea extends HTMLPurifier_AttrTransform -{ - - public function transform($attr, $config, $context) { - // Calculated from Firefox - if (!isset($attr['cols'])) $attr['cols'] = '22'; - if (!isset($attr['rows'])) $attr['rows'] = '3'; - return $attr; - } - -} - -// vim: et sw=4 sts=4 diff --git a/main/inc/lib/htmlpurifier/library/HTMLPurifier/AttrTransform/index.html b/main/inc/lib/htmlpurifier/library/HTMLPurifier/AttrTransform/index.html deleted file mode 100755 index aa7b9c934b..0000000000 --- a/main/inc/lib/htmlpurifier/library/HTMLPurifier/AttrTransform/index.html +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/main/inc/lib/htmlpurifier/library/HTMLPurifier/AttrTypes.php b/main/inc/lib/htmlpurifier/library/HTMLPurifier/AttrTypes.php deleted file mode 100755 index fc2ea4e588..0000000000 --- a/main/inc/lib/htmlpurifier/library/HTMLPurifier/AttrTypes.php +++ /dev/null @@ -1,77 +0,0 @@ -info['Enum'] = new HTMLPurifier_AttrDef_Enum(); - $this->info['Bool'] = new HTMLPurifier_AttrDef_HTML_Bool(); - - $this->info['CDATA'] = new HTMLPurifier_AttrDef_Text(); - $this->info['ID'] = new HTMLPurifier_AttrDef_HTML_ID(); - $this->info['Length'] = new HTMLPurifier_AttrDef_HTML_Length(); - $this->info['MultiLength'] = new HTMLPurifier_AttrDef_HTML_MultiLength(); - $this->info['NMTOKENS'] = new HTMLPurifier_AttrDef_HTML_Nmtokens(); - $this->info['Pixels'] = new HTMLPurifier_AttrDef_HTML_Pixels(); - $this->info['Text'] = new HTMLPurifier_AttrDef_Text(); - $this->info['URI'] = new HTMLPurifier_AttrDef_URI(); - $this->info['LanguageCode'] = new HTMLPurifier_AttrDef_Lang(); - $this->info['Color'] = new HTMLPurifier_AttrDef_HTML_Color(); - - // unimplemented aliases - $this->info['ContentType'] = new HTMLPurifier_AttrDef_Text(); - $this->info['ContentTypes'] = new HTMLPurifier_AttrDef_Text(); - $this->info['Charsets'] = new HTMLPurifier_AttrDef_Text(); - $this->info['Character'] = new HTMLPurifier_AttrDef_Text(); - - // "proprietary" types - $this->info['Class'] = new HTMLPurifier_AttrDef_HTML_Class(); - - // number is really a positive integer (one or more digits) - // FIXME: ^^ not always, see start and value of list items - $this->info['Number'] = new HTMLPurifier_AttrDef_Integer(false, false, true); - } - - /** - * Retrieves a type - * @param $type String type name - * @return Object AttrDef for type - */ - public function get($type) { - - // determine if there is any extra info tacked on - if (strpos($type, '#') !== false) list($type, $string) = explode('#', $type, 2); - else $string = ''; - - if (!isset($this->info[$type])) { - trigger_error('Cannot retrieve undefined attribute type ' . $type, E_USER_ERROR); - return; - } - - return $this->info[$type]->make($string); - - } - - /** - * Sets a new implementation for a type - * @param $type String type name - * @param $impl Object AttrDef for type - */ - public function set($type, $impl) { - $this->info[$type] = $impl; - } -} - -// vim: et sw=4 sts=4 diff --git a/main/inc/lib/htmlpurifier/library/HTMLPurifier/AttrValidator.php b/main/inc/lib/htmlpurifier/library/HTMLPurifier/AttrValidator.php deleted file mode 100755 index 829a0f8f22..0000000000 --- a/main/inc/lib/htmlpurifier/library/HTMLPurifier/AttrValidator.php +++ /dev/null @@ -1,162 +0,0 @@ -getHTMLDefinition(); - $e =& $context->get('ErrorCollector', true); - - // initialize IDAccumulator if necessary - $ok =& $context->get('IDAccumulator', true); - if (!$ok) { - $id_accumulator = HTMLPurifier_IDAccumulator::build($config, $context); - $context->register('IDAccumulator', $id_accumulator); - } - - // initialize CurrentToken if necessary - $current_token =& $context->get('CurrentToken', true); - if (!$current_token) $context->register('CurrentToken', $token); - - if ( - !$token instanceof HTMLPurifier_Token_Start && - !$token instanceof HTMLPurifier_Token_Empty - ) return $token; - - // create alias to global definition array, see also $defs - // DEFINITION CALL - $d_defs = $definition->info_global_attr; - - // don't update token until the very end, to ensure an atomic update - $attr = $token->attr; - - // do global transformations (pre) - // nothing currently utilizes this - foreach ($definition->info_attr_transform_pre as $transform) { - $attr = $transform->transform($o = $attr, $config, $context); - if ($e) { - if ($attr != $o) $e->send(E_NOTICE, 'AttrValidator: Attributes transformed', $o, $attr); - } - } - - // do local transformations only applicable to this element (pre) - // ex.

    to

    - foreach ($definition->info[$token->name]->attr_transform_pre as $transform) { - $attr = $transform->transform($o = $attr, $config, $context); - if ($e) { - if ($attr != $o) $e->send(E_NOTICE, 'AttrValidator: Attributes transformed', $o, $attr); - } - } - - // create alias to this element's attribute definition array, see - // also $d_defs (global attribute definition array) - // DEFINITION CALL - $defs = $definition->info[$token->name]->attr; - - $attr_key = false; - $context->register('CurrentAttr', $attr_key); - - // iterate through all the attribute keypairs - // Watch out for name collisions: $key has previously been used - foreach ($attr as $attr_key => $value) { - - // call the definition - if ( isset($defs[$attr_key]) ) { - // there is a local definition defined - if ($defs[$attr_key] === false) { - // We've explicitly been told not to allow this element. - // This is usually when there's a global definition - // that must be overridden. - // Theoretically speaking, we could have a - // AttrDef_DenyAll, but this is faster! - $result = false; - } else { - // validate according to the element's definition - $result = $defs[$attr_key]->validate( - $value, $config, $context - ); - } - } elseif ( isset($d_defs[$attr_key]) ) { - // there is a global definition defined, validate according - // to the global definition - $result = $d_defs[$attr_key]->validate( - $value, $config, $context - ); - } else { - // system never heard of the attribute? DELETE! - $result = false; - } - - // put the results into effect - if ($result === false || $result === null) { - // this is a generic error message that should replaced - // with more specific ones when possible - if ($e) $e->send(E_ERROR, 'AttrValidator: Attribute removed'); - - // remove the attribute - unset($attr[$attr_key]); - } elseif (is_string($result)) { - // generally, if a substitution is happening, there - // was some sort of implicit correction going on. We'll - // delegate it to the attribute classes to say exactly what. - - // simple substitution - $attr[$attr_key] = $result; - } else { - // nothing happens - } - - // we'd also want slightly more complicated substitution - // involving an array as the return value, - // although we're not sure how colliding attributes would - // resolve (certain ones would be completely overriden, - // others would prepend themselves). - } - - $context->destroy('CurrentAttr'); - - // post transforms - - // global (error reporting untested) - foreach ($definition->info_attr_transform_post as $transform) { - $attr = $transform->transform($o = $attr, $config, $context); - if ($e) { - if ($attr != $o) $e->send(E_NOTICE, 'AttrValidator: Attributes transformed', $o, $attr); - } - } - - // local (error reporting untested) - foreach ($definition->info[$token->name]->attr_transform_post as $transform) { - $attr = $transform->transform($o = $attr, $config, $context); - if ($e) { - if ($attr != $o) $e->send(E_NOTICE, 'AttrValidator: Attributes transformed', $o, $attr); - } - } - - $token->attr = $attr; - - // destroy CurrentToken if we made it ourselves - if (!$current_token) $context->destroy('CurrentToken'); - - } - - -} - -// vim: et sw=4 sts=4 diff --git a/main/inc/lib/htmlpurifier/library/HTMLPurifier/Bootstrap.php b/main/inc/lib/htmlpurifier/library/HTMLPurifier/Bootstrap.php deleted file mode 100755 index 607c5b1880..0000000000 --- a/main/inc/lib/htmlpurifier/library/HTMLPurifier/Bootstrap.php +++ /dev/null @@ -1,104 +0,0 @@ - -if (!defined('PHP_EOL')) { - switch (strtoupper(substr(PHP_OS, 0, 3))) { - case 'WIN': - define('PHP_EOL', "\r\n"); - break; - case 'DAR': - define('PHP_EOL', "\r"); - break; - default: - define('PHP_EOL', "\n"); - } -} - -/** - * Bootstrap class that contains meta-functionality for HTML Purifier such as - * the autoload function. - * - * @note - * This class may be used without any other files from HTML Purifier. - */ -class HTMLPurifier_Bootstrap -{ - - /** - * Autoload function for HTML Purifier - * @param $class Class to load - */ - public static function autoload($class) { - $file = HTMLPurifier_Bootstrap::getPath($class); - if (!$file) return false; - // Technically speaking, it should be ok and more efficient to - // just do 'require', but Antonio Parraga reports that with - // Zend extensions such as Zend debugger and APC, this invariant - // may be broken. Since we have efficient alternatives, pay - // the cost here and avoid the bug. - require_once HTMLPURIFIER_PREFIX . '/' . $file; - return true; - } - - /** - * Returns the path for a specific class. - */ - public static function getPath($class) { - if (strncmp('HTMLPurifier', $class, 12) !== 0) return false; - // Custom implementations - if (strncmp('HTMLPurifier_Language_', $class, 22) === 0) { - $code = str_replace('_', '-', substr($class, 22)); - $file = 'HTMLPurifier/Language/classes/' . $code . '.php'; - } else { - $file = str_replace('_', '/', $class) . '.php'; - } - if (!file_exists(HTMLPURIFIER_PREFIX . '/' . $file)) return false; - return $file; - } - - /** - * "Pre-registers" our autoloader on the SPL stack. - */ - public static function registerAutoload() { - $autoload = array('HTMLPurifier_Bootstrap', 'autoload'); - if ( ($funcs = spl_autoload_functions()) === false ) { - spl_autoload_register($autoload); - } elseif (function_exists('spl_autoload_unregister')) { - $buggy = version_compare(PHP_VERSION, '5.2.11', '<'); - $compat = version_compare(PHP_VERSION, '5.1.2', '<=') && - version_compare(PHP_VERSION, '5.1.0', '>='); - foreach ($funcs as $func) { - if ($buggy && is_array($func)) { - // :TRICKY: There are some compatibility issues and some - // places where we need to error out - $reflector = new ReflectionMethod($func[0], $func[1]); - if (!$reflector->isStatic()) { - throw new Exception(' - HTML Purifier autoloader registrar is not compatible - with non-static object methods due to PHP Bug #44144; - Please do not use HTMLPurifier.autoload.php (or any - file that includes this file); instead, place the code: - spl_autoload_register(array(\'HTMLPurifier_Bootstrap\', \'autoload\')) - after your own autoloaders. - '); - } - // Suprisingly, spl_autoload_register supports the - // Class::staticMethod callback format, although call_user_func doesn't - if ($compat) $func = implode('::', $func); - } - spl_autoload_unregister($func); - } - spl_autoload_register($autoload); - foreach ($funcs as $func) spl_autoload_register($func); - } - } - -} - -// vim: et sw=4 sts=4 diff --git a/main/inc/lib/htmlpurifier/library/HTMLPurifier/CSSDefinition.php b/main/inc/lib/htmlpurifier/library/HTMLPurifier/CSSDefinition.php deleted file mode 100755 index 478d6d4abe..0000000000 --- a/main/inc/lib/htmlpurifier/library/HTMLPurifier/CSSDefinition.php +++ /dev/null @@ -1,301 +0,0 @@ -info['text-align'] = new HTMLPurifier_AttrDef_Enum( - array('left', 'right', 'center', 'justify'), false); - - $border_style = - $this->info['border-bottom-style'] = - $this->info['border-right-style'] = - $this->info['border-left-style'] = - $this->info['border-top-style'] = new HTMLPurifier_AttrDef_Enum( - array('none', 'hidden', 'dotted', 'dashed', 'solid', 'double', - 'groove', 'ridge', 'inset', 'outset'), false); - - $this->info['border-style'] = new HTMLPurifier_AttrDef_CSS_Multiple($border_style); - - $this->info['clear'] = new HTMLPurifier_AttrDef_Enum( - array('none', 'left', 'right', 'both'), false); - $this->info['float'] = new HTMLPurifier_AttrDef_Enum( - array('none', 'left', 'right'), false); - $this->info['font-style'] = new HTMLPurifier_AttrDef_Enum( - array('normal', 'italic', 'oblique'), false); - $this->info['font-variant'] = new HTMLPurifier_AttrDef_Enum( - array('normal', 'small-caps'), false); - - $uri_or_none = new HTMLPurifier_AttrDef_CSS_Composite( - array( - new HTMLPurifier_AttrDef_Enum(array('none')), - new HTMLPurifier_AttrDef_CSS_URI() - ) - ); - - $this->info['list-style-position'] = new HTMLPurifier_AttrDef_Enum( - array('inside', 'outside'), false); - $this->info['list-style-type'] = new HTMLPurifier_AttrDef_Enum( - array('disc', 'circle', 'square', 'decimal', 'lower-roman', - 'upper-roman', 'lower-alpha', 'upper-alpha', 'none'), false); - $this->info['list-style-image'] = $uri_or_none; - - $this->info['list-style'] = new HTMLPurifier_AttrDef_CSS_ListStyle($config); - - $this->info['text-transform'] = new HTMLPurifier_AttrDef_Enum( - array('capitalize', 'uppercase', 'lowercase', 'none'), false); - $this->info['color'] = new HTMLPurifier_AttrDef_CSS_Color(); - - $this->info['background-image'] = $uri_or_none; - $this->info['background-repeat'] = new HTMLPurifier_AttrDef_Enum( - array('repeat', 'repeat-x', 'repeat-y', 'no-repeat') - ); - $this->info['background-attachment'] = new HTMLPurifier_AttrDef_Enum( - array('scroll', 'fixed') - ); - $this->info['background-position'] = new HTMLPurifier_AttrDef_CSS_BackgroundPosition(); - - $border_color = - $this->info['border-top-color'] = - $this->info['border-bottom-color'] = - $this->info['border-left-color'] = - $this->info['border-right-color'] = - $this->info['background-color'] = new HTMLPurifier_AttrDef_CSS_Composite(array( - new HTMLPurifier_AttrDef_Enum(array('transparent')), - new HTMLPurifier_AttrDef_CSS_Color() - )); - - $this->info['background'] = new HTMLPurifier_AttrDef_CSS_Background($config); - - $this->info['border-color'] = new HTMLPurifier_AttrDef_CSS_Multiple($border_color); - - $border_width = - $this->info['border-top-width'] = - $this->info['border-bottom-width'] = - $this->info['border-left-width'] = - $this->info['border-right-width'] = new HTMLPurifier_AttrDef_CSS_Composite(array( - new HTMLPurifier_AttrDef_Enum(array('thin', 'medium', 'thick')), - new HTMLPurifier_AttrDef_CSS_Length('0') //disallow negative - )); - - $this->info['border-width'] = new HTMLPurifier_AttrDef_CSS_Multiple($border_width); - - $this->info['letter-spacing'] = new HTMLPurifier_AttrDef_CSS_Composite(array( - new HTMLPurifier_AttrDef_Enum(array('normal')), - new HTMLPurifier_AttrDef_CSS_Length() - )); - - $this->info['word-spacing'] = new HTMLPurifier_AttrDef_CSS_Composite(array( - new HTMLPurifier_AttrDef_Enum(array('normal')), - new HTMLPurifier_AttrDef_CSS_Length() - )); - - $this->info['font-size'] = new HTMLPurifier_AttrDef_CSS_Composite(array( - new HTMLPurifier_AttrDef_Enum(array('xx-small', 'x-small', - 'small', 'medium', 'large', 'x-large', 'xx-large', - 'larger', 'smaller')), - new HTMLPurifier_AttrDef_CSS_Percentage(), - new HTMLPurifier_AttrDef_CSS_Length() - )); - - $this->info['line-height'] = new HTMLPurifier_AttrDef_CSS_Composite(array( - new HTMLPurifier_AttrDef_Enum(array('normal')), - new HTMLPurifier_AttrDef_CSS_Number(true), // no negatives - new HTMLPurifier_AttrDef_CSS_Length('0'), - new HTMLPurifier_AttrDef_CSS_Percentage(true) - )); - - $margin = - $this->info['margin-top'] = - $this->info['margin-bottom'] = - $this->info['margin-left'] = - $this->info['margin-right'] = new HTMLPurifier_AttrDef_CSS_Composite(array( - new HTMLPurifier_AttrDef_CSS_Length(), - new HTMLPurifier_AttrDef_CSS_Percentage(), - new HTMLPurifier_AttrDef_Enum(array('auto')) - )); - - $this->info['margin'] = new HTMLPurifier_AttrDef_CSS_Multiple($margin); - - // non-negative - $padding = - $this->info['padding-top'] = - $this->info['padding-bottom'] = - $this->info['padding-left'] = - $this->info['padding-right'] = new HTMLPurifier_AttrDef_CSS_Composite(array( - new HTMLPurifier_AttrDef_CSS_Length('0'), - new HTMLPurifier_AttrDef_CSS_Percentage(true) - )); - - $this->info['padding'] = new HTMLPurifier_AttrDef_CSS_Multiple($padding); - - $this->info['text-indent'] = new HTMLPurifier_AttrDef_CSS_Composite(array( - new HTMLPurifier_AttrDef_CSS_Length(), - new HTMLPurifier_AttrDef_CSS_Percentage() - )); - - $trusted_wh = new HTMLPurifier_AttrDef_CSS_Composite(array( - new HTMLPurifier_AttrDef_CSS_Length('0'), - new HTMLPurifier_AttrDef_CSS_Percentage(true), - new HTMLPurifier_AttrDef_Enum(array('auto')) - )); - $max = $config->get('CSS.MaxImgLength'); - - $this->info['width'] = - $this->info['height'] = - $max === null ? - $trusted_wh : - new HTMLPurifier_AttrDef_Switch('img', - // For img tags: - new HTMLPurifier_AttrDef_CSS_Composite(array( - new HTMLPurifier_AttrDef_CSS_Length('0', $max), - new HTMLPurifier_AttrDef_Enum(array('auto')) - )), - // For everyone else: - $trusted_wh - ); - - $this->info['text-decoration'] = new HTMLPurifier_AttrDef_CSS_TextDecoration(); - - $this->info['font-family'] = new HTMLPurifier_AttrDef_CSS_FontFamily(); - - // this could use specialized code - $this->info['font-weight'] = new HTMLPurifier_AttrDef_Enum( - array('normal', 'bold', 'bolder', 'lighter', '100', '200', '300', - '400', '500', '600', '700', '800', '900'), false); - - // MUST be called after other font properties, as it references - // a CSSDefinition object - $this->info['font'] = new HTMLPurifier_AttrDef_CSS_Font($config); - - // same here - $this->info['border'] = - $this->info['border-bottom'] = - $this->info['border-top'] = - $this->info['border-left'] = - $this->info['border-right'] = new HTMLPurifier_AttrDef_CSS_Border($config); - - $this->info['border-collapse'] = new HTMLPurifier_AttrDef_Enum(array( - 'collapse', 'separate')); - - $this->info['caption-side'] = new HTMLPurifier_AttrDef_Enum(array( - 'top', 'bottom')); - - $this->info['table-layout'] = new HTMLPurifier_AttrDef_Enum(array( - 'auto', 'fixed')); - - $this->info['vertical-align'] = new HTMLPurifier_AttrDef_CSS_Composite(array( - new HTMLPurifier_AttrDef_Enum(array('baseline', 'sub', 'super', - 'top', 'text-top', 'middle', 'bottom', 'text-bottom')), - new HTMLPurifier_AttrDef_CSS_Length(), - new HTMLPurifier_AttrDef_CSS_Percentage() - )); - - $this->info['border-spacing'] = new HTMLPurifier_AttrDef_CSS_Multiple(new HTMLPurifier_AttrDef_CSS_Length(), 2); - - // partial support - $this->info['white-space'] = new HTMLPurifier_AttrDef_Enum(array('nowrap')); - - if ($config->get('CSS.Proprietary')) { - $this->doSetupProprietary($config); - } - - if ($config->get('CSS.AllowTricky')) { - $this->doSetupTricky($config); - } - - $allow_important = $config->get('CSS.AllowImportant'); - // wrap all attr-defs with decorator that handles !important - foreach ($this->info as $k => $v) { - $this->info[$k] = new HTMLPurifier_AttrDef_CSS_ImportantDecorator($v, $allow_important); - } - - $this->setupConfigStuff($config); - } - - protected function doSetupProprietary($config) { - // Internet Explorer only scrollbar colors - $this->info['scrollbar-arrow-color'] = new HTMLPurifier_AttrDef_CSS_Color(); - $this->info['scrollbar-base-color'] = new HTMLPurifier_AttrDef_CSS_Color(); - $this->info['scrollbar-darkshadow-color'] = new HTMLPurifier_AttrDef_CSS_Color(); - $this->info['scrollbar-face-color'] = new HTMLPurifier_AttrDef_CSS_Color(); - $this->info['scrollbar-highlight-color'] = new HTMLPurifier_AttrDef_CSS_Color(); - $this->info['scrollbar-shadow-color'] = new HTMLPurifier_AttrDef_CSS_Color(); - - // technically not proprietary, but CSS3, and no one supports it - $this->info['opacity'] = new HTMLPurifier_AttrDef_CSS_AlphaValue(); - $this->info['-moz-opacity'] = new HTMLPurifier_AttrDef_CSS_AlphaValue(); - $this->info['-khtml-opacity'] = new HTMLPurifier_AttrDef_CSS_AlphaValue(); - - // only opacity, for now - $this->info['filter'] = new HTMLPurifier_AttrDef_CSS_Filter(); - - } - - protected function doSetupTricky($config) { - $this->info['display'] = new HTMLPurifier_AttrDef_Enum(array( - 'inline', 'block', 'list-item', 'run-in', 'compact', - 'marker', 'table', 'inline-table', 'table-row-group', - 'table-header-group', 'table-footer-group', 'table-row', - 'table-column-group', 'table-column', 'table-cell', 'table-caption', 'none' - )); - $this->info['visibility'] = new HTMLPurifier_AttrDef_Enum(array( - 'visible', 'hidden', 'collapse' - )); - $this->info['overflow'] = new HTMLPurifier_AttrDef_Enum(array('visible', 'hidden', 'auto', 'scroll')); - } - - - /** - * Performs extra config-based processing. Based off of - * HTMLPurifier_HTMLDefinition. - * @todo Refactor duplicate elements into common class (probably using - * composition, not inheritance). - */ - protected function setupConfigStuff($config) { - - // setup allowed elements - $support = "(for information on implementing this, see the ". - "support forums) "; - $allowed_properties = $config->get('CSS.AllowedProperties'); - if ($allowed_properties !== null) { - foreach ($this->info as $name => $d) { - if(!isset($allowed_properties[$name])) unset($this->info[$name]); - unset($allowed_properties[$name]); - } - // emit errors - foreach ($allowed_properties as $name => $d) { - // :TODO: Is this htmlspecialchars() call really necessary? - $name = htmlspecialchars($name); - trigger_error("Style attribute '$name' is not supported $support", E_USER_WARNING); - } - } - - $forbidden_properties = $config->get('CSS.ForbiddenProperties'); - if ($forbidden_properties !== null) { - foreach ($this->info as $name => $d) { - if (isset($forbidden_properties[$name])) { - unset($this->info[$name]); - } - } - } - - } -} - -// vim: et sw=4 sts=4 diff --git a/main/inc/lib/htmlpurifier/library/HTMLPurifier/ChildDef.php b/main/inc/lib/htmlpurifier/library/HTMLPurifier/ChildDef.php deleted file mode 100755 index c5d5216dab..0000000000 --- a/main/inc/lib/htmlpurifier/library/HTMLPurifier/ChildDef.php +++ /dev/null @@ -1,48 +0,0 @@ -elements; - } - - /** - * Validates nodes according to definition and returns modification. - * - * @param $tokens_of_children Array of HTMLPurifier_Token - * @param $config HTMLPurifier_Config object - * @param $context HTMLPurifier_Context object - * @return bool true to leave nodes as is - * @return bool false to remove parent node - * @return array of replacement child tokens - */ - abstract public function validateChildren($tokens_of_children, $config, $context); -} - -// vim: et sw=4 sts=4 diff --git a/main/inc/lib/htmlpurifier/library/HTMLPurifier/ChildDef/Chameleon.php b/main/inc/lib/htmlpurifier/library/HTMLPurifier/ChildDef/Chameleon.php deleted file mode 100755 index 15c364ee33..0000000000 --- a/main/inc/lib/htmlpurifier/library/HTMLPurifier/ChildDef/Chameleon.php +++ /dev/null @@ -1,48 +0,0 @@ -inline = new HTMLPurifier_ChildDef_Optional($inline); - $this->block = new HTMLPurifier_ChildDef_Optional($block); - $this->elements = $this->block->elements; - } - - public function validateChildren($tokens_of_children, $config, $context) { - if ($context->get('IsInline') === false) { - return $this->block->validateChildren( - $tokens_of_children, $config, $context); - } else { - return $this->inline->validateChildren( - $tokens_of_children, $config, $context); - } - } -} - -// vim: et sw=4 sts=4 diff --git a/main/inc/lib/htmlpurifier/library/HTMLPurifier/ChildDef/Custom.php b/main/inc/lib/htmlpurifier/library/HTMLPurifier/ChildDef/Custom.php deleted file mode 100755 index b68047b4b5..0000000000 --- a/main/inc/lib/htmlpurifier/library/HTMLPurifier/ChildDef/Custom.php +++ /dev/null @@ -1,90 +0,0 @@ -dtd_regex = $dtd_regex; - $this->_compileRegex(); - } - /** - * Compiles the PCRE regex from a DTD regex ($dtd_regex to $_pcre_regex) - */ - protected function _compileRegex() { - $raw = str_replace(' ', '', $this->dtd_regex); - if ($raw{0} != '(') { - $raw = "($raw)"; - } - $el = '[#a-zA-Z0-9_.-]+'; - $reg = $raw; - - // COMPLICATED! AND MIGHT BE BUGGY! I HAVE NO CLUE WHAT I'M - // DOING! Seriously: if there's problems, please report them. - - // collect all elements into the $elements array - preg_match_all("/$el/", $reg, $matches); - foreach ($matches[0] as $match) { - $this->elements[$match] = true; - } - - // setup all elements as parentheticals with leading commas - $reg = preg_replace("/$el/", '(,\\0)', $reg); - - // remove commas when they were not solicited - $reg = preg_replace("/([^,(|]\(+),/", '\\1', $reg); - - // remove all non-paranthetical commas: they are handled by first regex - $reg = preg_replace("/,\(/", '(', $reg); - - $this->_pcre_regex = $reg; - } - public function validateChildren($tokens_of_children, $config, $context) { - $list_of_children = ''; - $nesting = 0; // depth into the nest - foreach ($tokens_of_children as $token) { - if (!empty($token->is_whitespace)) continue; - - $is_child = ($nesting == 0); // direct - - if ($token instanceof HTMLPurifier_Token_Start) { - $nesting++; - } elseif ($token instanceof HTMLPurifier_Token_End) { - $nesting--; - } - - if ($is_child) { - $list_of_children .= $token->name . ','; - } - } - // add leading comma to deal with stray comma declarations - $list_of_children = ',' . rtrim($list_of_children, ','); - $okay = - preg_match( - '/^,?'.$this->_pcre_regex.'$/', - $list_of_children - ); - - return (bool) $okay; - } -} - -// vim: et sw=4 sts=4 diff --git a/main/inc/lib/htmlpurifier/library/HTMLPurifier/ChildDef/Empty.php b/main/inc/lib/htmlpurifier/library/HTMLPurifier/ChildDef/Empty.php deleted file mode 100755 index 13171f6651..0000000000 --- a/main/inc/lib/htmlpurifier/library/HTMLPurifier/ChildDef/Empty.php +++ /dev/null @@ -1,20 +0,0 @@ -whitespace) return $tokens_of_children; - else return array(); - } - return $result; - } -} - -// vim: et sw=4 sts=4 diff --git a/main/inc/lib/htmlpurifier/library/HTMLPurifier/ChildDef/Required.php b/main/inc/lib/htmlpurifier/library/HTMLPurifier/ChildDef/Required.php deleted file mode 100755 index 4889f249b8..0000000000 --- a/main/inc/lib/htmlpurifier/library/HTMLPurifier/ChildDef/Required.php +++ /dev/null @@ -1,117 +0,0 @@ - $x) { - $elements[$i] = true; - if (empty($i)) unset($elements[$i]); // remove blank - } - } - $this->elements = $elements; - } - public $allow_empty = false; - public $type = 'required'; - public function validateChildren($tokens_of_children, $config, $context) { - // Flag for subclasses - $this->whitespace = false; - - // if there are no tokens, delete parent node - if (empty($tokens_of_children)) return false; - - // the new set of children - $result = array(); - - // current depth into the nest - $nesting = 0; - - // whether or not we're deleting a node - $is_deleting = false; - - // whether or not parsed character data is allowed - // this controls whether or not we silently drop a tag - // or generate escaped HTML from it - $pcdata_allowed = isset($this->elements['#PCDATA']); - - // a little sanity check to make sure it's not ALL whitespace - $all_whitespace = true; - - // some configuration - $escape_invalid_children = $config->get('Core.EscapeInvalidChildren'); - - // generator - $gen = new HTMLPurifier_Generator($config, $context); - - foreach ($tokens_of_children as $token) { - if (!empty($token->is_whitespace)) { - $result[] = $token; - continue; - } - $all_whitespace = false; // phew, we're not talking about whitespace - - $is_child = ($nesting == 0); - - if ($token instanceof HTMLPurifier_Token_Start) { - $nesting++; - } elseif ($token instanceof HTMLPurifier_Token_End) { - $nesting--; - } - - if ($is_child) { - $is_deleting = false; - if (!isset($this->elements[$token->name])) { - $is_deleting = true; - if ($pcdata_allowed && $token instanceof HTMLPurifier_Token_Text) { - $result[] = $token; - } elseif ($pcdata_allowed && $escape_invalid_children) { - $result[] = new HTMLPurifier_Token_Text( - $gen->generateFromToken($token) - ); - } - continue; - } - } - if (!$is_deleting || ($pcdata_allowed && $token instanceof HTMLPurifier_Token_Text)) { - $result[] = $token; - } elseif ($pcdata_allowed && $escape_invalid_children) { - $result[] = - new HTMLPurifier_Token_Text( - $gen->generateFromToken($token) - ); - } else { - // drop silently - } - } - if (empty($result)) return false; - if ($all_whitespace) { - $this->whitespace = true; - return false; - } - if ($tokens_of_children == $result) return true; - return $result; - } -} - -// vim: et sw=4 sts=4 diff --git a/main/inc/lib/htmlpurifier/library/HTMLPurifier/ChildDef/StrictBlockquote.php b/main/inc/lib/htmlpurifier/library/HTMLPurifier/ChildDef/StrictBlockquote.php deleted file mode 100755 index dfae8a6e5e..0000000000 --- a/main/inc/lib/htmlpurifier/library/HTMLPurifier/ChildDef/StrictBlockquote.php +++ /dev/null @@ -1,88 +0,0 @@ -init($config); - return $this->fake_elements; - } - - public function validateChildren($tokens_of_children, $config, $context) { - - $this->init($config); - - // trick the parent class into thinking it allows more - $this->elements = $this->fake_elements; - $result = parent::validateChildren($tokens_of_children, $config, $context); - $this->elements = $this->real_elements; - - if ($result === false) return array(); - if ($result === true) $result = $tokens_of_children; - - $def = $config->getHTMLDefinition(); - $block_wrap_start = new HTMLPurifier_Token_Start($def->info_block_wrapper); - $block_wrap_end = new HTMLPurifier_Token_End( $def->info_block_wrapper); - $is_inline = false; - $depth = 0; - $ret = array(); - - // assuming that there are no comment tokens - foreach ($result as $i => $token) { - $token = $result[$i]; - // ifs are nested for readability - if (!$is_inline) { - if (!$depth) { - if ( - ($token instanceof HTMLPurifier_Token_Text && !$token->is_whitespace) || - (!$token instanceof HTMLPurifier_Token_Text && !isset($this->elements[$token->name])) - ) { - $is_inline = true; - $ret[] = $block_wrap_start; - } - } - } else { - if (!$depth) { - // starting tokens have been inline text / empty - if ($token instanceof HTMLPurifier_Token_Start || $token instanceof HTMLPurifier_Token_Empty) { - if (isset($this->elements[$token->name])) { - // ended - $ret[] = $block_wrap_end; - $is_inline = false; - } - } - } - } - $ret[] = $token; - if ($token instanceof HTMLPurifier_Token_Start) $depth++; - if ($token instanceof HTMLPurifier_Token_End) $depth--; - } - if ($is_inline) $ret[] = $block_wrap_end; - return $ret; - } - - private function init($config) { - if (!$this->init) { - $def = $config->getHTMLDefinition(); - // allow all inline elements - $this->real_elements = $this->elements; - $this->fake_elements = $def->info_content_sets['Flow']; - $this->fake_elements['#PCDATA'] = true; - $this->init = true; - } - } -} - -// vim: et sw=4 sts=4 diff --git a/main/inc/lib/htmlpurifier/library/HTMLPurifier/ChildDef/Table.php b/main/inc/lib/htmlpurifier/library/HTMLPurifier/ChildDef/Table.php deleted file mode 100755 index 34f0227dd2..0000000000 --- a/main/inc/lib/htmlpurifier/library/HTMLPurifier/ChildDef/Table.php +++ /dev/null @@ -1,142 +0,0 @@ - true, 'tbody' => true, 'thead' => true, - 'tfoot' => true, 'caption' => true, 'colgroup' => true, 'col' => true); - public function __construct() {} - public function validateChildren($tokens_of_children, $config, $context) { - if (empty($tokens_of_children)) return false; - - // this ensures that the loop gets run one last time before closing - // up. It's a little bit of a hack, but it works! Just make sure you - // get rid of the token later. - $tokens_of_children[] = false; - - // only one of these elements is allowed in a table - $caption = false; - $thead = false; - $tfoot = false; - - // as many of these as you want - $cols = array(); - $content = array(); - - $nesting = 0; // current depth so we can determine nodes - $is_collecting = false; // are we globbing together tokens to package - // into one of the collectors? - $collection = array(); // collected nodes - $tag_index = 0; // the first node might be whitespace, - // so this tells us where the start tag is - - foreach ($tokens_of_children as $token) { - $is_child = ($nesting == 0); - - if ($token === false) { - // terminating sequence started - } elseif ($token instanceof HTMLPurifier_Token_Start) { - $nesting++; - } elseif ($token instanceof HTMLPurifier_Token_End) { - $nesting--; - } - - // handle node collection - if ($is_collecting) { - if ($is_child) { - // okay, let's stash the tokens away - // first token tells us the type of the collection - switch ($collection[$tag_index]->name) { - case 'tr': - case 'tbody': - $content[] = $collection; - break; - case 'caption': - if ($caption !== false) break; - $caption = $collection; - break; - case 'thead': - case 'tfoot': - // access the appropriate variable, $thead or $tfoot - $var = $collection[$tag_index]->name; - if ($$var === false) { - $$var = $collection; - } else { - // transmutate the first and less entries into - // tbody tags, and then put into content - $collection[$tag_index]->name = 'tbody'; - $collection[count($collection)-1]->name = 'tbody'; - $content[] = $collection; - } - break; - case 'colgroup': - $cols[] = $collection; - break; - } - $collection = array(); - $is_collecting = false; - $tag_index = 0; - } else { - // add the node to the collection - $collection[] = $token; - } - } - - // terminate - if ($token === false) break; - - if ($is_child) { - // determine what we're dealing with - if ($token->name == 'col') { - // the only empty tag in the possie, we can handle it - // immediately - $cols[] = array_merge($collection, array($token)); - $collection = array(); - $tag_index = 0; - continue; - } - switch($token->name) { - case 'caption': - case 'colgroup': - case 'thead': - case 'tfoot': - case 'tbody': - case 'tr': - $is_collecting = true; - $collection[] = $token; - continue; - default: - if (!empty($token->is_whitespace)) { - $collection[] = $token; - $tag_index++; - } - continue; - } - } - } - - if (empty($content)) return false; - - $ret = array(); - if ($caption !== false) $ret = array_merge($ret, $caption); - if ($cols !== false) foreach ($cols as $token_array) $ret = array_merge($ret, $token_array); - if ($thead !== false) $ret = array_merge($ret, $thead); - if ($tfoot !== false) $ret = array_merge($ret, $tfoot); - foreach ($content as $token_array) $ret = array_merge($ret, $token_array); - if (!empty($collection) && $is_collecting == false){ - // grab the trailing space - $ret = array_merge($ret, $collection); - } - - array_pop($tokens_of_children); // remove phantom token - - return ($ret === $tokens_of_children) ? true : $ret; - - } -} - -// vim: et sw=4 sts=4 diff --git a/main/inc/lib/htmlpurifier/library/HTMLPurifier/ChildDef/index.html b/main/inc/lib/htmlpurifier/library/HTMLPurifier/ChildDef/index.html deleted file mode 100755 index aa7b9c934b..0000000000 --- a/main/inc/lib/htmlpurifier/library/HTMLPurifier/ChildDef/index.html +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/main/inc/lib/htmlpurifier/library/HTMLPurifier/Config.php b/main/inc/lib/htmlpurifier/library/HTMLPurifier/Config.php deleted file mode 100755 index 69c5683233..0000000000 --- a/main/inc/lib/htmlpurifier/library/HTMLPurifier/Config.php +++ /dev/null @@ -1,709 +0,0 @@ -defaultPlist; - $this->plist = new HTMLPurifier_PropertyList($parent); - $this->def = $definition; // keep a copy around for checking - $this->parser = new HTMLPurifier_VarParser_Flexible(); - } - - /** - * Convenience constructor that creates a config object based on a mixed var - * @param mixed $config Variable that defines the state of the config - * object. Can be: a HTMLPurifier_Config() object, - * an array of directives based on loadArray(), - * or a string filename of an ini file. - * @param HTMLPurifier_ConfigSchema Schema object - * @return Configured HTMLPurifier_Config object - */ - public static function create($config, $schema = null) { - if ($config instanceof HTMLPurifier_Config) { - // pass-through - return $config; - } - if (!$schema) { - $ret = HTMLPurifier_Config::createDefault(); - } else { - $ret = new HTMLPurifier_Config($schema); - } - if (is_string($config)) $ret->loadIni($config); - elseif (is_array($config)) $ret->loadArray($config); - return $ret; - } - - /** - * Creates a new config object that inherits from a previous one. - * @param HTMLPurifier_Config $config Configuration object to inherit - * from. - * @return HTMLPurifier_Config object with $config as its parent. - */ - public static function inherit(HTMLPurifier_Config $config) { - return new HTMLPurifier_Config($config->def, $config->plist); - } - - /** - * Convenience constructor that creates a default configuration object. - * @return Default HTMLPurifier_Config object. - */ - public static function createDefault() { - $definition = HTMLPurifier_ConfigSchema::instance(); - $config = new HTMLPurifier_Config($definition); - return $config; - } - - /** - * Retreives a value from the configuration. - * @param $key String key - */ - public function get($key, $a = null) { - if ($a !== null) { - $this->triggerError("Using deprecated API: use \$config->get('$key.$a') instead", E_USER_WARNING); - $key = "$key.$a"; - } - if (!$this->finalized) $this->autoFinalize(); - if (!isset($this->def->info[$key])) { - // can't add % due to SimpleTest bug - $this->triggerError('Cannot retrieve value of undefined directive ' . htmlspecialchars($key), - E_USER_WARNING); - return; - } - if (isset($this->def->info[$key]->isAlias)) { - $d = $this->def->info[$key]; - $this->triggerError('Cannot get value from aliased directive, use real name ' . $d->key, - E_USER_ERROR); - return; - } - if ($this->lock) { - list($ns) = explode('.', $key); - if ($ns !== $this->lock) { - $this->triggerError('Cannot get value of namespace ' . $ns . ' when lock for ' . $this->lock . ' is active, this probably indicates a Definition setup method is accessing directives that are not within its namespace', E_USER_ERROR); - return; - } - } - return $this->plist->get($key); - } - - /** - * Retreives an array of directives to values from a given namespace - * @param $namespace String namespace - */ - public function getBatch($namespace) { - if (!$this->finalized) $this->autoFinalize(); - $full = $this->getAll(); - if (!isset($full[$namespace])) { - $this->triggerError('Cannot retrieve undefined namespace ' . htmlspecialchars($namespace), - E_USER_WARNING); - return; - } - return $full[$namespace]; - } - - /** - * Returns a md5 signature of a segment of the configuration object - * that uniquely identifies that particular configuration - * @note Revision is handled specially and is removed from the batch - * before processing! - * @param $namespace Namespace to get serial for - */ - public function getBatchSerial($namespace) { - if (empty($this->serials[$namespace])) { - $batch = $this->getBatch($namespace); - unset($batch['DefinitionRev']); - $this->serials[$namespace] = md5(serialize($batch)); - } - return $this->serials[$namespace]; - } - - /** - * Returns a md5 signature for the entire configuration object - * that uniquely identifies that particular configuration - */ - public function getSerial() { - if (empty($this->serial)) { - $this->serial = md5(serialize($this->getAll())); - } - return $this->serial; - } - - /** - * Retrieves all directives, organized by namespace - * @warning This is a pretty inefficient function, avoid if you can - */ - public function getAll() { - if (!$this->finalized) $this->autoFinalize(); - $ret = array(); - foreach ($this->plist->squash() as $name => $value) { - list($ns, $key) = explode('.', $name, 2); - $ret[$ns][$key] = $value; - } - return $ret; - } - - /** - * Sets a value to configuration. - * @param $key String key - * @param $value Mixed value - */ - public function set($key, $value, $a = null) { - if (strpos($key, '.') === false) { - $namespace = $key; - $directive = $value; - $value = $a; - $key = "$key.$directive"; - $this->triggerError("Using deprecated API: use \$config->set('$key', ...) instead", E_USER_NOTICE); - } else { - list($namespace) = explode('.', $key); - } - if ($this->isFinalized('Cannot set directive after finalization')) return; - if (!isset($this->def->info[$key])) { - $this->triggerError('Cannot set undefined directive ' . htmlspecialchars($key) . ' to value', - E_USER_WARNING); - return; - } - $def = $this->def->info[$key]; - - if (isset($def->isAlias)) { - if ($this->aliasMode) { - $this->triggerError('Double-aliases not allowed, please fix '. - 'ConfigSchema bug with' . $key, E_USER_ERROR); - return; - } - $this->aliasMode = true; - $this->set($def->key, $value); - $this->aliasMode = false; - $this->triggerError("$key is an alias, preferred directive name is {$def->key}", E_USER_NOTICE); - return; - } - - // Raw type might be negative when using the fully optimized form - // of stdclass, which indicates allow_null == true - $rtype = is_int($def) ? $def : $def->type; - if ($rtype < 0) { - $type = -$rtype; - $allow_null = true; - } else { - $type = $rtype; - $allow_null = isset($def->allow_null); - } - - try { - $value = $this->parser->parse($value, $type, $allow_null); - } catch (HTMLPurifier_VarParserException $e) { - $this->triggerError('Value for ' . $key . ' is of invalid type, should be ' . HTMLPurifier_VarParser::getTypeName($type), E_USER_WARNING); - return; - } - if (is_string($value) && is_object($def)) { - // resolve value alias if defined - if (isset($def->aliases[$value])) { - $value = $def->aliases[$value]; - } - // check to see if the value is allowed - if (isset($def->allowed) && !isset($def->allowed[$value])) { - $this->triggerError('Value not supported, valid values are: ' . - $this->_listify($def->allowed), E_USER_WARNING); - return; - } - } - $this->plist->set($key, $value); - - // reset definitions if the directives they depend on changed - // this is a very costly process, so it's discouraged - // with finalization - if ($namespace == 'HTML' || $namespace == 'CSS' || $namespace == 'URI') { - $this->definitions[$namespace] = null; - } - - $this->serials[$namespace] = false; - } - - /** - * Convenience function for error reporting - */ - private function _listify($lookup) { - $list = array(); - foreach ($lookup as $name => $b) $list[] = $name; - return implode(', ', $list); - } - - /** - * Retrieves object reference to the HTML definition. - * @param $raw Return a copy that has not been setup yet. Must be - * called before it's been setup, otherwise won't work. - * @param $optimized If true, this method may return null, to - * indicate that a cached version of the modified - * definition object is available and no further edits - * are necessary. Consider using - * maybeGetRawHTMLDefinition, which is more explicitly - * named, instead. - */ - public function getHTMLDefinition($raw = false, $optimized = false) { - return $this->getDefinition('HTML', $raw, $optimized); - } - - /** - * Retrieves object reference to the CSS definition - * @param $raw Return a copy that has not been setup yet. Must be - * called before it's been setup, otherwise won't work. - * @param $optimized If true, this method may return null, to - * indicate that a cached version of the modified - * definition object is available and no further edits - * are necessary. Consider using - * maybeGetRawCSSDefinition, which is more explicitly - * named, instead. - */ - public function getCSSDefinition($raw = false, $optimized = false) { - return $this->getDefinition('CSS', $raw, $optimized); - } - - /** - * Retrieves object reference to the URI definition - * @param $raw Return a copy that has not been setup yet. Must be - * called before it's been setup, otherwise won't work. - * @param $optimized If true, this method may return null, to - * indicate that a cached version of the modified - * definition object is available and no further edits - * are necessary. Consider using - * maybeGetRawURIDefinition, which is more explicitly - * named, instead. - */ - public function getURIDefinition($raw = false, $optimized = false) { - return $this->getDefinition('URI', $raw, $optimized); - } - - /** - * Retrieves a definition - * @param $type Type of definition: HTML, CSS, etc - * @param $raw Whether or not definition should be returned raw - * @param $optimized Only has an effect when $raw is true. Whether - * or not to return null if the result is already present in - * the cache. This is off by default for backwards - * compatibility reasons, but you need to do things this - * way in order to ensure that caching is done properly. - * Check out enduser-customize.html for more details. - * We probably won't ever change this default, as much as the - * maybe semantics is the "right thing to do." - */ - public function getDefinition($type, $raw = false, $optimized = false) { - if ($optimized && !$raw) { - throw new HTMLPurifier_Exception("Cannot set optimized = true when raw = false"); - } - if (!$this->finalized) $this->autoFinalize(); - // temporarily suspend locks, so we can handle recursive definition calls - $lock = $this->lock; - $this->lock = null; - $factory = HTMLPurifier_DefinitionCacheFactory::instance(); - $cache = $factory->create($type, $this); - $this->lock = $lock; - if (!$raw) { - // full definition - // --------------- - // check if definition is in memory - if (!empty($this->definitions[$type])) { - $def = $this->definitions[$type]; - // check if the definition is setup - if ($def->setup) { - return $def; - } else { - $def->setup($this); - if ($def->optimized) $cache->add($def, $this); - return $def; - } - } - // check if definition is in cache - $def = $cache->get($this); - if ($def) { - // definition in cache, save to memory and return it - $this->definitions[$type] = $def; - return $def; - } - // initialize it - $def = $this->initDefinition($type); - // set it up - $this->lock = $type; - $def->setup($this); - $this->lock = null; - // save in cache - $cache->add($def, $this); - // return it - return $def; - } else { - // raw definition - // -------------- - // check preconditions - $def = null; - if ($optimized) { - if (is_null($this->get($type . '.DefinitionID'))) { - // fatally error out if definition ID not set - throw new HTMLPurifier_Exception("Cannot retrieve raw version without specifying %$type.DefinitionID"); - } - } - if (!empty($this->definitions[$type])) { - $def = $this->definitions[$type]; - if ($def->setup && !$optimized) { - $extra = $this->chatty ? " (try moving this code block earlier in your initialization)" : ""; - throw new HTMLPurifier_Exception("Cannot retrieve raw definition after it has already been setup" . $extra); - } - if ($def->optimized === null) { - $extra = $this->chatty ? " (try flushing your cache)" : ""; - throw new HTMLPurifier_Exception("Optimization status of definition is unknown" . $extra); - } - if ($def->optimized !== $optimized) { - $msg = $optimized ? "optimized" : "unoptimized"; - $extra = $this->chatty ? " (this backtrace is for the first inconsistent call, which was for a $msg raw definition)" : ""; - throw new HTMLPurifier_Exception("Inconsistent use of optimized and unoptimized raw definition retrievals" . $extra); - } - } - // check if definition was in memory - if ($def) { - if ($def->setup) { - // invariant: $optimized === true (checked above) - return null; - } else { - return $def; - } - } - // if optimized, check if definition was in cache - // (because we do the memory check first, this formulation - // is prone to cache slamming, but I think - // guaranteeing that either /all/ of the raw - // setup code or /none/ of it is run is more important.) - if ($optimized) { - // This code path only gets run once; once we put - // something in $definitions (which is guaranteed by the - // trailing code), we always short-circuit above. - $def = $cache->get($this); - if ($def) { - // save the full definition for later, but don't - // return it yet - $this->definitions[$type] = $def; - return null; - } - } - // check invariants for creation - if (!$optimized) { - if (!is_null($this->get($type . '.DefinitionID'))) { - if ($this->chatty) { - $this->triggerError("Due to a documentation error in previous version of HTML Purifier, your definitions are not being cached. If this is OK, you can remove the %$type.DefinitionRev and %$type.DefinitionID declaration. Otherwise, modify your code to use maybeGetRawDefinition, and test if the returned value is null before making any edits (if it is null, that means that a cached version is available, and no raw operations are necessary). See Customize for more details", E_USER_WARNING); - } else { - $this->triggerError("Useless DefinitionID declaration", E_USER_WARNING); - } - } - } - // initialize it - $def = $this->initDefinition($type); - $def->optimized = $optimized; - return $def; - } - throw new HTMLPurifier_Exception("The impossible happened!"); - } - - private function initDefinition($type) { - // quick checks failed, let's create the object - if ($type == 'HTML') { - $def = new HTMLPurifier_HTMLDefinition(); - } elseif ($type == 'CSS') { - $def = new HTMLPurifier_CSSDefinition(); - } elseif ($type == 'URI') { - $def = new HTMLPurifier_URIDefinition(); - } else { - throw new HTMLPurifier_Exception("Definition of $type type not supported"); - } - $this->definitions[$type] = $def; - return $def; - } - - public function maybeGetRawDefinition($name) { - return $this->getDefinition($name, true, true); - } - - public function maybeGetRawHTMLDefinition() { - return $this->getDefinition('HTML', true, true); - } - - public function maybeGetRawCSSDefinition() { - return $this->getDefinition('CSS', true, true); - } - - public function maybeGetRawURIDefinition() { - return $this->getDefinition('URI', true, true); - } - - /** - * Loads configuration values from an array with the following structure: - * Namespace.Directive => Value - * @param $config_array Configuration associative array - */ - public function loadArray($config_array) { - if ($this->isFinalized('Cannot load directives after finalization')) return; - foreach ($config_array as $key => $value) { - $key = str_replace('_', '.', $key); - if (strpos($key, '.') !== false) { - $this->set($key, $value); - } else { - $namespace = $key; - $namespace_values = $value; - foreach ($namespace_values as $directive => $value) { - $this->set($namespace .'.'. $directive, $value); - } - } - } - } - - /** - * Returns a list of array(namespace, directive) for all directives - * that are allowed in a web-form context as per an allowed - * namespaces/directives list. - * @param $allowed List of allowed namespaces/directives - */ - public static function getAllowedDirectivesForForm($allowed, $schema = null) { - if (!$schema) { - $schema = HTMLPurifier_ConfigSchema::instance(); - } - if ($allowed !== true) { - if (is_string($allowed)) $allowed = array($allowed); - $allowed_ns = array(); - $allowed_directives = array(); - $blacklisted_directives = array(); - foreach ($allowed as $ns_or_directive) { - if (strpos($ns_or_directive, '.') !== false) { - // directive - if ($ns_or_directive[0] == '-') { - $blacklisted_directives[substr($ns_or_directive, 1)] = true; - } else { - $allowed_directives[$ns_or_directive] = true; - } - } else { - // namespace - $allowed_ns[$ns_or_directive] = true; - } - } - } - $ret = array(); - foreach ($schema->info as $key => $def) { - list($ns, $directive) = explode('.', $key, 2); - if ($allowed !== true) { - if (isset($blacklisted_directives["$ns.$directive"])) continue; - if (!isset($allowed_directives["$ns.$directive"]) && !isset($allowed_ns[$ns])) continue; - } - if (isset($def->isAlias)) continue; - if ($directive == 'DefinitionID' || $directive == 'DefinitionRev') continue; - $ret[] = array($ns, $directive); - } - return $ret; - } - - /** - * Loads configuration values from $_GET/$_POST that were posted - * via ConfigForm - * @param $array $_GET or $_POST array to import - * @param $index Index/name that the config variables are in - * @param $allowed List of allowed namespaces/directives - * @param $mq_fix Boolean whether or not to enable magic quotes fix - * @param $schema Instance of HTMLPurifier_ConfigSchema to use, if not global copy - */ - public static function loadArrayFromForm($array, $index = false, $allowed = true, $mq_fix = true, $schema = null) { - $ret = HTMLPurifier_Config::prepareArrayFromForm($array, $index, $allowed, $mq_fix, $schema); - $config = HTMLPurifier_Config::create($ret, $schema); - return $config; - } - - /** - * Merges in configuration values from $_GET/$_POST to object. NOT STATIC. - * @note Same parameters as loadArrayFromForm - */ - public function mergeArrayFromForm($array, $index = false, $allowed = true, $mq_fix = true) { - $ret = HTMLPurifier_Config::prepareArrayFromForm($array, $index, $allowed, $mq_fix, $this->def); - $this->loadArray($ret); - } - - /** - * Prepares an array from a form into something usable for the more - * strict parts of HTMLPurifier_Config - */ - public static function prepareArrayFromForm($array, $index = false, $allowed = true, $mq_fix = true, $schema = null) { - if ($index !== false) $array = (isset($array[$index]) && is_array($array[$index])) ? $array[$index] : array(); - $mq = $mq_fix && function_exists('get_magic_quotes_gpc') && get_magic_quotes_gpc(); - - $allowed = HTMLPurifier_Config::getAllowedDirectivesForForm($allowed, $schema); - $ret = array(); - foreach ($allowed as $key) { - list($ns, $directive) = $key; - $skey = "$ns.$directive"; - if (!empty($array["Null_$skey"])) { - $ret[$ns][$directive] = null; - continue; - } - if (!isset($array[$skey])) continue; - $value = $mq ? stripslashes($array[$skey]) : $array[$skey]; - $ret[$ns][$directive] = $value; - } - return $ret; - } - - /** - * Loads configuration values from an ini file - * @param $filename Name of ini file - */ - public function loadIni($filename) { - if ($this->isFinalized('Cannot load directives after finalization')) return; - $array = parse_ini_file($filename, true); - $this->loadArray($array); - } - - /** - * Checks whether or not the configuration object is finalized. - * @param $error String error message, or false for no error - */ - public function isFinalized($error = false) { - if ($this->finalized && $error) { - $this->triggerError($error, E_USER_ERROR); - } - return $this->finalized; - } - - /** - * Finalizes configuration only if auto finalize is on and not - * already finalized - */ - public function autoFinalize() { - if ($this->autoFinalize) { - $this->finalize(); - } else { - $this->plist->squash(true); - } - } - - /** - * Finalizes a configuration object, prohibiting further change - */ - public function finalize() { - $this->finalized = true; - unset($this->parser); - } - - /** - * Produces a nicely formatted error message by supplying the - * stack frame information OUTSIDE of HTMLPurifier_Config. - */ - protected function triggerError($msg, $no) { - // determine previous stack frame - $extra = ''; - if ($this->chatty) { - $trace = debug_backtrace(); - // zip(tail(trace), trace) -- but PHP is not Haskell har har - for ($i = 0, $c = count($trace); $i < $c - 1; $i++) { - if ($trace[$i + 1]['class'] === 'HTMLPurifier_Config') { - continue; - } - $frame = $trace[$i]; - $extra = " invoked on line {$frame['line']} in file {$frame['file']}"; - break; - } - } - trigger_error($msg . $extra, $no); - } - - /** - * Returns a serialized form of the configuration object that can - * be reconstituted. - */ - public function serialize() { - $this->getDefinition('HTML'); - $this->getDefinition('CSS'); - $this->getDefinition('URI'); - return serialize($this); - } - -} - -// vim: et sw=4 sts=4 diff --git a/main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema.php b/main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema.php deleted file mode 100755 index fadf7a5890..0000000000 --- a/main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema.php +++ /dev/null @@ -1,164 +0,0 @@ - array( - * 'Directive' => new stdclass(), - * ) - * ) - * - * The stdclass may have the following properties: - * - * - If isAlias isn't set: - * - type: Integer type of directive, see HTMLPurifier_VarParser for definitions - * - allow_null: If set, this directive allows null values - * - aliases: If set, an associative array of value aliases to real values - * - allowed: If set, a lookup array of allowed (string) values - * - If isAlias is set: - * - namespace: Namespace this directive aliases to - * - name: Directive name this directive aliases to - * - * In certain degenerate cases, stdclass will actually be an integer. In - * that case, the value is equivalent to an stdclass with the type - * property set to the integer. If the integer is negative, type is - * equal to the absolute value of integer, and allow_null is true. - * - * This class is friendly with HTMLPurifier_Config. If you need introspection - * about the schema, you're better of using the ConfigSchema_Interchange, - * which uses more memory but has much richer information. - */ - public $info = array(); - - /** - * Application-wide singleton - */ - static protected $singleton; - - public function __construct() { - $this->defaultPlist = new HTMLPurifier_PropertyList(); - } - - /** - * Unserializes the default ConfigSchema. - */ - public static function makeFromSerial() { - $contents = file_get_contents(HTMLPURIFIER_PREFIX . '/HTMLPurifier/ConfigSchema/schema.ser'); - $r = unserialize($contents); - if (!$r) { - $hash = sha1($contents); - trigger_error("Unserialization of configuration schema failed, sha1 of file was $hash", E_USER_ERROR); - } - return $r; - } - - /** - * Retrieves an instance of the application-wide configuration definition. - */ - public static function instance($prototype = null) { - if ($prototype !== null) { - HTMLPurifier_ConfigSchema::$singleton = $prototype; - } elseif (HTMLPurifier_ConfigSchema::$singleton === null || $prototype === true) { - HTMLPurifier_ConfigSchema::$singleton = HTMLPurifier_ConfigSchema::makeFromSerial(); - } - return HTMLPurifier_ConfigSchema::$singleton; - } - - /** - * Defines a directive for configuration - * @warning Will fail of directive's namespace is defined. - * @warning This method's signature is slightly different from the legacy - * define() static method! Beware! - * @param $namespace Namespace the directive is in - * @param $name Key of directive - * @param $default Default value of directive - * @param $type Allowed type of the directive. See - * HTMLPurifier_DirectiveDef::$type for allowed values - * @param $allow_null Whether or not to allow null values - */ - public function add($key, $default, $type, $allow_null) { - $obj = new stdclass(); - $obj->type = is_int($type) ? $type : HTMLPurifier_VarParser::$types[$type]; - if ($allow_null) $obj->allow_null = true; - $this->info[$key] = $obj; - $this->defaults[$key] = $default; - $this->defaultPlist->set($key, $default); - } - - /** - * Defines a directive value alias. - * - * Directive value aliases are convenient for developers because it lets - * them set a directive to several values and get the same result. - * @param $namespace Directive's namespace - * @param $name Name of Directive - * @param $aliases Hash of aliased values to the real alias - */ - public function addValueAliases($key, $aliases) { - if (!isset($this->info[$key]->aliases)) { - $this->info[$key]->aliases = array(); - } - foreach ($aliases as $alias => $real) { - $this->info[$key]->aliases[$alias] = $real; - } - } - - /** - * Defines a set of allowed values for a directive. - * @warning This is slightly different from the corresponding static - * method definition. - * @param $namespace Namespace of directive - * @param $name Name of directive - * @param $allowed Lookup array of allowed values - */ - public function addAllowedValues($key, $allowed) { - $this->info[$key]->allowed = $allowed; - } - - /** - * Defines a directive alias for backwards compatibility - * @param $namespace - * @param $name Directive that will be aliased - * @param $new_namespace - * @param $new_name Directive that the alias will be to - */ - public function addAlias($key, $new_key) { - $obj = new stdclass; - $obj->key = $new_key; - $obj->isAlias = true; - $this->info[$key] = $obj; - } - - /** - * Replaces any stdclass that only has the type property with type integer. - */ - public function postProcess() { - foreach ($this->info as $key => $v) { - if (count((array) $v) == 1) { - $this->info[$key] = $v->type; - } elseif (count((array) $v) == 2 && isset($v->allow_null)) { - $this->info[$key] = -$v->type; - } - } - } - -} - -// vim: et sw=4 sts=4 diff --git a/main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/Builder/ConfigSchema.php b/main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/Builder/ConfigSchema.php deleted file mode 100755 index c05668a706..0000000000 --- a/main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/Builder/ConfigSchema.php +++ /dev/null @@ -1,44 +0,0 @@ -directives as $d) { - $schema->add( - $d->id->key, - $d->default, - $d->type, - $d->typeAllowsNull - ); - if ($d->allowed !== null) { - $schema->addAllowedValues( - $d->id->key, - $d->allowed - ); - } - foreach ($d->aliases as $alias) { - $schema->addAlias( - $alias->key, - $d->id->key - ); - } - if ($d->valueAliases !== null) { - $schema->addValueAliases( - $d->id->key, - $d->valueAliases - ); - } - } - $schema->postProcess(); - return $schema; - } - -} - -// vim: et sw=4 sts=4 diff --git a/main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/Builder/Xml.php b/main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/Builder/Xml.php deleted file mode 100755 index 244561a372..0000000000 --- a/main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/Builder/Xml.php +++ /dev/null @@ -1,106 +0,0 @@ -startElement('div'); - - $purifier = HTMLPurifier::getInstance(); - $html = $purifier->purify($html); - $this->writeAttribute('xmlns', 'http://www.w3.org/1999/xhtml'); - $this->writeRaw($html); - - $this->endElement(); // div - } - - protected function export($var) { - if ($var === array()) return 'array()'; - return var_export($var, true); - } - - public function build($interchange) { - // global access, only use as last resort - $this->interchange = $interchange; - - $this->setIndent(true); - $this->startDocument('1.0', 'UTF-8'); - $this->startElement('configdoc'); - $this->writeElement('title', $interchange->name); - - foreach ($interchange->directives as $directive) { - $this->buildDirective($directive); - } - - if ($this->namespace) $this->endElement(); // namespace - - $this->endElement(); // configdoc - $this->flush(); - } - - public function buildDirective($directive) { - - // Kludge, although I suppose having a notion of a "root namespace" - // certainly makes things look nicer when documentation is built. - // Depends on things being sorted. - if (!$this->namespace || $this->namespace !== $directive->id->getRootNamespace()) { - if ($this->namespace) $this->endElement(); // namespace - $this->namespace = $directive->id->getRootNamespace(); - $this->startElement('namespace'); - $this->writeAttribute('id', $this->namespace); - $this->writeElement('name', $this->namespace); - } - - $this->startElement('directive'); - $this->writeAttribute('id', $directive->id->toString()); - - $this->writeElement('name', $directive->id->getDirective()); - - $this->startElement('aliases'); - foreach ($directive->aliases as $alias) $this->writeElement('alias', $alias->toString()); - $this->endElement(); // aliases - - $this->startElement('constraints'); - if ($directive->version) $this->writeElement('version', $directive->version); - $this->startElement('type'); - if ($directive->typeAllowsNull) $this->writeAttribute('allow-null', 'yes'); - $this->text($directive->type); - $this->endElement(); // type - if ($directive->allowed) { - $this->startElement('allowed'); - foreach ($directive->allowed as $value => $x) $this->writeElement('value', $value); - $this->endElement(); // allowed - } - $this->writeElement('default', $this->export($directive->default)); - $this->writeAttribute('xml:space', 'preserve'); - if ($directive->external) { - $this->startElement('external'); - foreach ($directive->external as $project) $this->writeElement('project', $project); - $this->endElement(); - } - $this->endElement(); // constraints - - if ($directive->deprecatedVersion) { - $this->startElement('deprecated'); - $this->writeElement('version', $directive->deprecatedVersion); - $this->writeElement('use', $directive->deprecatedUse->toString()); - $this->endElement(); // deprecated - } - - $this->startElement('description'); - $this->writeHTMLDiv($directive->description); - $this->endElement(); // description - - $this->endElement(); // directive - } - -} - -// vim: et sw=4 sts=4 diff --git a/main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/Builder/index.html b/main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/Builder/index.html deleted file mode 100755 index aa7b9c934b..0000000000 --- a/main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/Builder/index.html +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/Exception.php b/main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/Exception.php deleted file mode 100755 index 2671516c58..0000000000 --- a/main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/Exception.php +++ /dev/null @@ -1,11 +0,0 @@ - array(directive info) - */ - public $directives = array(); - - /** - * Adds a directive array to $directives - */ - public function addDirective($directive) { - if (isset($this->directives[$i = $directive->id->toString()])) { - throw new HTMLPurifier_ConfigSchema_Exception("Cannot redefine directive '$i'"); - } - $this->directives[$i] = $directive; - } - - /** - * Convenience function to perform standard validation. Throws exception - * on failed validation. - */ - public function validate() { - $validator = new HTMLPurifier_ConfigSchema_Validator(); - return $validator->validate($this); - } - -} - -// vim: et sw=4 sts=4 diff --git a/main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/Interchange/Directive.php b/main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/Interchange/Directive.php deleted file mode 100755 index ac8be0d970..0000000000 --- a/main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/Interchange/Directive.php +++ /dev/null @@ -1,77 +0,0 @@ - true). - * Null if all values are allowed. - */ - public $allowed; - - /** - * List of aliases for the directive, - * e.g. array(new HTMLPurifier_ConfigSchema_Interchange_Id('Ns', 'Dir'))). - */ - public $aliases = array(); - - /** - * Hash of value aliases, e.g. array('alt' => 'real'). Null if value - * aliasing is disabled (necessary for non-scalar types). - */ - public $valueAliases; - - /** - * Version of HTML Purifier the directive was introduced, e.g. '1.3.1'. - * Null if the directive has always existed. - */ - public $version; - - /** - * ID of directive that supercedes this old directive, is an instance - * of HTMLPurifier_ConfigSchema_Interchange_Id. Null if not deprecated. - */ - public $deprecatedUse; - - /** - * Version of HTML Purifier this directive was deprecated. Null if not - * deprecated. - */ - public $deprecatedVersion; - - /** - * List of external projects this directive depends on, e.g. array('CSSTidy'). - */ - public $external = array(); - -} - -// vim: et sw=4 sts=4 diff --git a/main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/Interchange/Id.php b/main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/Interchange/Id.php deleted file mode 100755 index b9b3c6f5cf..0000000000 --- a/main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/Interchange/Id.php +++ /dev/null @@ -1,37 +0,0 @@ -key = $key; - } - - /** - * @warning This is NOT magic, to ensure that people don't abuse SPL and - * cause problems for PHP 5.0 support. - */ - public function toString() { - return $this->key; - } - - public function getRootNamespace() { - return substr($this->key, 0, strpos($this->key, ".")); - } - - public function getDirective() { - return substr($this->key, strpos($this->key, ".") + 1); - } - - public static function make($id) { - return new HTMLPurifier_ConfigSchema_Interchange_Id($id); - } - -} - -// vim: et sw=4 sts=4 diff --git a/main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/Interchange/index.html b/main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/Interchange/index.html deleted file mode 100755 index aa7b9c934b..0000000000 --- a/main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/Interchange/index.html +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/InterchangeBuilder.php b/main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/InterchangeBuilder.php deleted file mode 100755 index 785b72ce8e..0000000000 --- a/main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/InterchangeBuilder.php +++ /dev/null @@ -1,180 +0,0 @@ -varParser = $varParser ? $varParser : new HTMLPurifier_VarParser_Native(); - } - - public static function buildFromDirectory($dir = null) { - $builder = new HTMLPurifier_ConfigSchema_InterchangeBuilder(); - $interchange = new HTMLPurifier_ConfigSchema_Interchange(); - return $builder->buildDir($interchange, $dir); - } - - public function buildDir($interchange, $dir = null) { - if (!$dir) $dir = HTMLPURIFIER_PREFIX . '/HTMLPurifier/ConfigSchema/schema'; - if (file_exists($dir . '/info.ini')) { - $info = parse_ini_file($dir . '/info.ini'); - $interchange->name = $info['name']; - } - - $files = array(); - $dh = opendir($dir); - while (false !== ($file = readdir($dh))) { - if (!$file || $file[0] == '.' || strrchr($file, '.') !== '.txt') { - continue; - } - $files[] = $file; - } - closedir($dh); - - sort($files); - foreach ($files as $file) { - $this->buildFile($interchange, $dir . '/' . $file); - } - - return $interchange; - } - - public function buildFile($interchange, $file) { - $parser = new HTMLPurifier_StringHashParser(); - $this->build( - $interchange, - new HTMLPurifier_StringHash( $parser->parseFile($file) ) - ); - } - - /** - * Builds an interchange object based on a hash. - * @param $interchange HTMLPurifier_ConfigSchema_Interchange object to build - * @param $hash HTMLPurifier_ConfigSchema_StringHash source data - */ - public function build($interchange, $hash) { - if (!$hash instanceof HTMLPurifier_StringHash) { - $hash = new HTMLPurifier_StringHash($hash); - } - if (!isset($hash['ID'])) { - throw new HTMLPurifier_ConfigSchema_Exception('Hash does not have any ID'); - } - if (strpos($hash['ID'], '.') === false) { - if (count($hash) == 2 && isset($hash['DESCRIPTION'])) { - $hash->offsetGet('DESCRIPTION'); // prevent complaining - } else { - throw new HTMLPurifier_ConfigSchema_Exception('All directives must have a namespace'); - } - } else { - $this->buildDirective($interchange, $hash); - } - $this->_findUnused($hash); - } - - public function buildDirective($interchange, $hash) { - $directive = new HTMLPurifier_ConfigSchema_Interchange_Directive(); - - // These are required elements: - $directive->id = $this->id($hash->offsetGet('ID')); - $id = $directive->id->toString(); // convenience - - if (isset($hash['TYPE'])) { - $type = explode('/', $hash->offsetGet('TYPE')); - if (isset($type[1])) $directive->typeAllowsNull = true; - $directive->type = $type[0]; - } else { - throw new HTMLPurifier_ConfigSchema_Exception("TYPE in directive hash '$id' not defined"); - } - - if (isset($hash['DEFAULT'])) { - try { - $directive->default = $this->varParser->parse($hash->offsetGet('DEFAULT'), $directive->type, $directive->typeAllowsNull); - } catch (HTMLPurifier_VarParserException $e) { - throw new HTMLPurifier_ConfigSchema_Exception($e->getMessage() . " in DEFAULT in directive hash '$id'"); - } - } - - if (isset($hash['DESCRIPTION'])) { - $directive->description = $hash->offsetGet('DESCRIPTION'); - } - - if (isset($hash['ALLOWED'])) { - $directive->allowed = $this->lookup($this->evalArray($hash->offsetGet('ALLOWED'))); - } - - if (isset($hash['VALUE-ALIASES'])) { - $directive->valueAliases = $this->evalArray($hash->offsetGet('VALUE-ALIASES')); - } - - if (isset($hash['ALIASES'])) { - $raw_aliases = trim($hash->offsetGet('ALIASES')); - $aliases = preg_split('/\s*,\s*/', $raw_aliases); - foreach ($aliases as $alias) { - $directive->aliases[] = $this->id($alias); - } - } - - if (isset($hash['VERSION'])) { - $directive->version = $hash->offsetGet('VERSION'); - } - - if (isset($hash['DEPRECATED-USE'])) { - $directive->deprecatedUse = $this->id($hash->offsetGet('DEPRECATED-USE')); - } - - if (isset($hash['DEPRECATED-VERSION'])) { - $directive->deprecatedVersion = $hash->offsetGet('DEPRECATED-VERSION'); - } - - if (isset($hash['EXTERNAL'])) { - $directive->external = preg_split('/\s*,\s*/', trim($hash->offsetGet('EXTERNAL'))); - } - - $interchange->addDirective($directive); - } - - /** - * Evaluates an array PHP code string without array() wrapper - */ - protected function evalArray($contents) { - return eval('return array('. $contents .');'); - } - - /** - * Converts an array list into a lookup array. - */ - protected function lookup($array) { - $ret = array(); - foreach ($array as $val) $ret[$val] = true; - return $ret; - } - - /** - * Convenience function that creates an HTMLPurifier_ConfigSchema_Interchange_Id - * object based on a string Id. - */ - protected function id($id) { - return HTMLPurifier_ConfigSchema_Interchange_Id::make($id); - } - - /** - * Triggers errors for any unused keys passed in the hash; such keys - * may indicate typos, missing values, etc. - * @param $hash Instance of ConfigSchema_StringHash to check. - */ - protected function _findUnused($hash) { - $accessed = $hash->getAccessed(); - foreach ($hash as $k => $v) { - if (!isset($accessed[$k])) { - trigger_error("String hash key '$k' not used by builder", E_USER_NOTICE); - } - } - } - -} - -// vim: et sw=4 sts=4 diff --git a/main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/Validator.php b/main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/Validator.php deleted file mode 100755 index f374f6a022..0000000000 --- a/main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/Validator.php +++ /dev/null @@ -1,206 +0,0 @@ -parser = new HTMLPurifier_VarParser(); - } - - /** - * Validates a fully-formed interchange object. Throws an - * HTMLPurifier_ConfigSchema_Exception if there's a problem. - */ - public function validate($interchange) { - $this->interchange = $interchange; - $this->aliases = array(); - // PHP is a bit lax with integer <=> string conversions in - // arrays, so we don't use the identical !== comparison - foreach ($interchange->directives as $i => $directive) { - $id = $directive->id->toString(); - if ($i != $id) $this->error(false, "Integrity violation: key '$i' does not match internal id '$id'"); - $this->validateDirective($directive); - } - return true; - } - - /** - * Validates a HTMLPurifier_ConfigSchema_Interchange_Id object. - */ - public function validateId($id) { - $id_string = $id->toString(); - $this->context[] = "id '$id_string'"; - if (!$id instanceof HTMLPurifier_ConfigSchema_Interchange_Id) { - // handled by InterchangeBuilder - $this->error(false, 'is not an instance of HTMLPurifier_ConfigSchema_Interchange_Id'); - } - // keys are now unconstrained (we might want to narrow down to A-Za-z0-9.) - // we probably should check that it has at least one namespace - $this->with($id, 'key') - ->assertNotEmpty() - ->assertIsString(); // implicit assertIsString handled by InterchangeBuilder - array_pop($this->context); - } - - /** - * Validates a HTMLPurifier_ConfigSchema_Interchange_Directive object. - */ - public function validateDirective($d) { - $id = $d->id->toString(); - $this->context[] = "directive '$id'"; - $this->validateId($d->id); - - $this->with($d, 'description') - ->assertNotEmpty(); - - // BEGIN - handled by InterchangeBuilder - $this->with($d, 'type') - ->assertNotEmpty(); - $this->with($d, 'typeAllowsNull') - ->assertIsBool(); - try { - // This also tests validity of $d->type - $this->parser->parse($d->default, $d->type, $d->typeAllowsNull); - } catch (HTMLPurifier_VarParserException $e) { - $this->error('default', 'had error: ' . $e->getMessage()); - } - // END - handled by InterchangeBuilder - - if (!is_null($d->allowed) || !empty($d->valueAliases)) { - // allowed and valueAliases require that we be dealing with - // strings, so check for that early. - $d_int = HTMLPurifier_VarParser::$types[$d->type]; - if (!isset(HTMLPurifier_VarParser::$stringTypes[$d_int])) { - $this->error('type', 'must be a string type when used with allowed or value aliases'); - } - } - - $this->validateDirectiveAllowed($d); - $this->validateDirectiveValueAliases($d); - $this->validateDirectiveAliases($d); - - array_pop($this->context); - } - - /** - * Extra validation if $allowed member variable of - * HTMLPurifier_ConfigSchema_Interchange_Directive is defined. - */ - public function validateDirectiveAllowed($d) { - if (is_null($d->allowed)) return; - $this->with($d, 'allowed') - ->assertNotEmpty() - ->assertIsLookup(); // handled by InterchangeBuilder - if (is_string($d->default) && !isset($d->allowed[$d->default])) { - $this->error('default', 'must be an allowed value'); - } - $this->context[] = 'allowed'; - foreach ($d->allowed as $val => $x) { - if (!is_string($val)) $this->error("value $val", 'must be a string'); - } - array_pop($this->context); - } - - /** - * Extra validation if $valueAliases member variable of - * HTMLPurifier_ConfigSchema_Interchange_Directive is defined. - */ - public function validateDirectiveValueAliases($d) { - if (is_null($d->valueAliases)) return; - $this->with($d, 'valueAliases') - ->assertIsArray(); // handled by InterchangeBuilder - $this->context[] = 'valueAliases'; - foreach ($d->valueAliases as $alias => $real) { - if (!is_string($alias)) $this->error("alias $alias", 'must be a string'); - if (!is_string($real)) $this->error("alias target $real from alias '$alias'", 'must be a string'); - if ($alias === $real) { - $this->error("alias '$alias'", "must not be an alias to itself"); - } - } - if (!is_null($d->allowed)) { - foreach ($d->valueAliases as $alias => $real) { - if (isset($d->allowed[$alias])) { - $this->error("alias '$alias'", 'must not be an allowed value'); - } elseif (!isset($d->allowed[$real])) { - $this->error("alias '$alias'", 'must be an alias to an allowed value'); - } - } - } - array_pop($this->context); - } - - /** - * Extra validation if $aliases member variable of - * HTMLPurifier_ConfigSchema_Interchange_Directive is defined. - */ - public function validateDirectiveAliases($d) { - $this->with($d, 'aliases') - ->assertIsArray(); // handled by InterchangeBuilder - $this->context[] = 'aliases'; - foreach ($d->aliases as $alias) { - $this->validateId($alias); - $s = $alias->toString(); - if (isset($this->interchange->directives[$s])) { - $this->error("alias '$s'", 'collides with another directive'); - } - if (isset($this->aliases[$s])) { - $other_directive = $this->aliases[$s]; - $this->error("alias '$s'", "collides with alias for directive '$other_directive'"); - } - $this->aliases[$s] = $d->id->toString(); - } - array_pop($this->context); - } - - // protected helper functions - - /** - * Convenience function for generating HTMLPurifier_ConfigSchema_ValidatorAtom - * for validating simple member variables of objects. - */ - protected function with($obj, $member) { - return new HTMLPurifier_ConfigSchema_ValidatorAtom($this->getFormattedContext(), $obj, $member); - } - - /** - * Emits an error, providing helpful context. - */ - protected function error($target, $msg) { - if ($target !== false) $prefix = ucfirst($target) . ' in ' . $this->getFormattedContext(); - else $prefix = ucfirst($this->getFormattedContext()); - throw new HTMLPurifier_ConfigSchema_Exception(trim($prefix . ' ' . $msg)); - } - - /** - * Returns a formatted context string. - */ - protected function getFormattedContext() { - return implode(' in ', array_reverse($this->context)); - } - -} - -// vim: et sw=4 sts=4 diff --git a/main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/ValidatorAtom.php b/main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/ValidatorAtom.php deleted file mode 100755 index b95aea18cc..0000000000 --- a/main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/ValidatorAtom.php +++ /dev/null @@ -1,66 +0,0 @@ -context = $context; - $this->obj = $obj; - $this->member = $member; - $this->contents =& $obj->$member; - } - - public function assertIsString() { - if (!is_string($this->contents)) $this->error('must be a string'); - return $this; - } - - public function assertIsBool() { - if (!is_bool($this->contents)) $this->error('must be a boolean'); - return $this; - } - - public function assertIsArray() { - if (!is_array($this->contents)) $this->error('must be an array'); - return $this; - } - - public function assertNotNull() { - if ($this->contents === null) $this->error('must not be null'); - return $this; - } - - public function assertAlnum() { - $this->assertIsString(); - if (!ctype_alnum($this->contents)) $this->error('must be alphanumeric'); - return $this; - } - - public function assertNotEmpty() { - if (empty($this->contents)) $this->error('must not be empty'); - return $this; - } - - public function assertIsLookup() { - $this->assertIsArray(); - foreach ($this->contents as $v) { - if ($v !== true) $this->error('must be a lookup array'); - } - return $this; - } - - protected function error($msg) { - throw new HTMLPurifier_ConfigSchema_Exception(ucfirst($this->member) . ' in ' . $this->context . ' ' . $msg); - } - -} - -// vim: et sw=4 sts=4 diff --git a/main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/index.html b/main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/index.html deleted file mode 100755 index aa7b9c934b..0000000000 --- a/main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/index.html +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema.ser b/main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema.ser deleted file mode 100755 index 978089c6291e7d828f6233ac632cedd8a98fdfd7..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 13701 zcmeHO+in{<5}i*8JlK~7B1m?!lTn@=*+PW%4VHtMeHyeRTIRadt?i3rZ;*fAbBaYa z)oRI^hh1O+IS4Fu6^q5Xk*q$x9v;6R9(}&Mytt_gdv8tg$0*P4?Q%MQFstNfcryG} z4nGW!7Un*w)2clBm<$K~cYHedb$E1IRYmVKP4lm2F-nuNG~l@USPqZhZ4$>tvNCr` zu{2IbfB5Y?L}2n*#H~p=!7k!cM1)Q9n$g+m-KoyqSK66Vda_EE<}|HZnt5vW zl%#ecOh?chgZbqVqvmi)nJytDa+*SQ<}^lQ(IzXo_c(|O}#Zs^SpMe4>M2B zZVGd6pQ9xYyiGmrBA+L4NMjQ^wXSj~w@RuWKi(uovMiGIgI~dbc58S>by?-BNI!bK zA)ncDohC0AHhcVXI|(wVNW(;`y?^o46B@6f`oLAL-dR5Xa(kin{`oJ6N0^m1+d0Gw zez&>2TeHfa%=v0vz4YAYt6913oj=dby0UpDxp2%(fX%A~r3^S1zKAsj9}(d#WxHj1 z1;lxcnh~?-IAPAUIi~9*D}S@qLta;mDm$wy=AjEIdUZ6Nx-6Zn)_GAS86rlh@JFED z6?Xm@?95mUB(u0F^0g@{>oc5=CK+*VGfRWq8YHN7Mu3k<3}GCP_OUvESIBgkJWp23 z3zIErxN?ZcgX4aGEwRZGK_&_)tf`WsQ4py*N>HdG9k4)&*a2u$Q&^<-zm4SFao}#A z-z1z->J{8J$_vvwT`mh#miEb{FJt?BA(o)p=3m#io^&niqdJFJJRw zArS&QAw;mIRZ`@6#s$K1KY!@+N5ix*2p{)+Joe8qBrlT8l@$&dk5AvbAt1dNR^4V4 z$MGA?m8a0&Q$F-L6Te~5x-QmfMCya6jQ92Yp|pt~MsedYzd_*F2U~?vWBDNk>5|%2 zAaFp?0Y)@ot(?YDFeFQ!;6b-oF4buO!Yr*LS$=vDl7H1fFFtm9flwJ&o@g8ja-yK{ zjD<0tBv_!d>642G4jT3OPuGGn78Ii_N@E5yZk%T`46RUK>Xpf=yBvGklAoAMjF1yp zSU6Gd5g-@l88yjV)vK8)rZ3ril2xX_X2T?5v1ct7{_|{}FKo7?BGA6B?%#gkXO=C; zP|lOJ(Y*}82L-#!9x=WTJIFC^^A~{!ib~+tRCZh)w?>Te|jNH70@w4nb z=c(cPB#fodL7#G7*mYPkv@NR_h7?V}9o?_#0+Czmo(Kh9Fbv={kq_IL!sV(zEy(lB z#AX%#H-^LH8~J&~y@yGCWxl2`ujnpym*t9na%EGEg~Aft<5hDEC@6C#dbXToWmVL3 zt?6o1tSpi?l~vc`S2XgJR{E6Y^T)C$eiC3yuxX**PQBfuR_WSi`eluoI0=}F;8H>wfshW3IjbC zq$jAi-^w8-pNgC7Lc>)m7|&-uLa5&hH@WB;EOa3!EZyB<7v#_HmlvaawL&6o?68B%$D>2ddAi02NBOQIh{7y}M93I1;*LAh7D;zdfEWz#i1}l*CoIbAC*`GiAj?-P~N|lX;%OJ!)*I zf)l(i7jk`MY9}z#H%YXIszQ=F#i0SehT2U-CMc!3XFxHyZ`iSrEZh8QzUp9PjZXb3 zDWg=OGI|Ab%Fss;lUbk(e#Iius)L$|sqxy7EcKZIFpWd6&tfIh~bxii?5QNj1K# z<%H?Wh;Z}K*4zxXK%E-Yi3-PDrv?uyq+R2HRM-VB+tLvTQ9!S=ydet~?oNK=uC3SG z{Rh1%;7*7|y8Z(e`O{y2S|k;Yfrs{kYh}QiNRmVQ;n03Kv>y)bhqyU$Xg>^(4(*3S z`{B@jKxYC+%|rV^&&s^sM=g!eAmG{e(0(|y9~c{l_5*SOH$CkF9NG`AYj9{kus!jA z-hM#+M;l?S4MtXdEC^5Le22(A0woX~BAeZ#4~0I1dvh0F=(k}GcKG%KcMc3;56!o} zHjxf?NS;od!!DA%M3qrcPb9Z64w(2CPK;)ekhRU#z#PCJZ$!Lio*{xTgcr5wt!xO1 zcm(F)-sc7*sHlKyxTX!u%7H(Qa25R~Hgs)kHx@G_t{+6J3I{qDf`oA0Kzu7I>6M{N z#BB%hBJyMc7(HyE7%2_v>!02<&& zGtk3Cu-2_Q5cFu{M7$ozbIj$H|QF@u{*#G%7N^O z)b5_K4Q|l5^@=vg1y|6zKnn~7zs1VroxlZf$wuwh(1BghHQ=q1h;g|eV;39) zD^A3)3%j7wnEnhutt2h%f@(#_=)3>T4P!sbpaCy5n(f3HG|aC=BO-aHkO(i)9g*0( z++eraY_~lAH)_C#yVsy74lN%XnQUT5>Yv#ZWN$4*}L zZ!_ij3wiJ(o9>EC~xndw(VwMJ8 zp$t5p#|)vhh__{&lr`$LG$gm-LKmoLfE+OxEP4R|*^RCw) zytxC^vJ@Drdu=be>#`k3gB6j=58VW`@n+EL?;PE5Y>tM%JZa!mMU^hodAv zkGGCK_UbdS1&5Id6M??I7CV0rE4uqCP6DyVSLd>--SeZtu3AV;7hryuWb5#JVF#W+Az%ML9} klV!Z diff --git a/main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Attr.AllowedClasses.txt b/main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Attr.AllowedClasses.txt deleted file mode 100755 index 0517fed0a1..0000000000 --- a/main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Attr.AllowedClasses.txt +++ /dev/null @@ -1,8 +0,0 @@ -Attr.AllowedClasses -TYPE: lookup/null -VERSION: 4.0.0 -DEFAULT: null ---DESCRIPTION-- -List of allowed class values in the class attribute. By default, this is null, -which means all classes are allowed. ---# vim: et sw=4 sts=4 diff --git a/main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Attr.AllowedFrameTargets.txt b/main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Attr.AllowedFrameTargets.txt deleted file mode 100755 index 249edd647b..0000000000 --- a/main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Attr.AllowedFrameTargets.txt +++ /dev/null @@ -1,12 +0,0 @@ -Attr.AllowedFrameTargets -TYPE: lookup -DEFAULT: array() ---DESCRIPTION-- -Lookup table of all allowed link frame targets. Some commonly used link -targets include _blank, _self, _parent and _top. Values should be -lowercase, as validation will be done in a case-sensitive manner despite -W3C's recommendation. XHTML 1.0 Strict does not permit the target attribute -so this directive will have no effect in that doctype. XHTML 1.1 does not -enable the Target module by default, you will have to manually enable it -(see the module documentation for more details.) ---# vim: et sw=4 sts=4 diff --git a/main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Attr.AllowedRel.txt b/main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Attr.AllowedRel.txt deleted file mode 100755 index 9a8fa6a2e2..0000000000 --- a/main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Attr.AllowedRel.txt +++ /dev/null @@ -1,9 +0,0 @@ -Attr.AllowedRel -TYPE: lookup -VERSION: 1.6.0 -DEFAULT: array() ---DESCRIPTION-- -List of allowed forward document relationships in the rel attribute. Common -values may be nofollow or print. By default, this is empty, meaning that no -document relationships are allowed. ---# vim: et sw=4 sts=4 diff --git a/main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Attr.AllowedRev.txt b/main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Attr.AllowedRev.txt deleted file mode 100755 index b017883485..0000000000 --- a/main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Attr.AllowedRev.txt +++ /dev/null @@ -1,9 +0,0 @@ -Attr.AllowedRev -TYPE: lookup -VERSION: 1.6.0 -DEFAULT: array() ---DESCRIPTION-- -List of allowed reverse document relationships in the rev attribute. This -attribute is a bit of an edge-case; if you don't know what it is for, stay -away. ---# vim: et sw=4 sts=4 diff --git a/main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Attr.ClassUseCDATA.txt b/main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Attr.ClassUseCDATA.txt deleted file mode 100755 index e774b823b1..0000000000 --- a/main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Attr.ClassUseCDATA.txt +++ /dev/null @@ -1,19 +0,0 @@ -Attr.ClassUseCDATA -TYPE: bool/null -DEFAULT: null -VERSION: 4.0.0 ---DESCRIPTION-- -If null, class will auto-detect the doctype and, if matching XHTML 1.1 or -XHTML 2.0, will use the restrictive NMTOKENS specification of class. Otherwise, -it will use a relaxed CDATA definition. If true, the relaxed CDATA definition -is forced; if false, the NMTOKENS definition is forced. To get behavior -of HTML Purifier prior to 4.0.0, set this directive to false. - -Some rational behind the auto-detection: -in previous versions of HTML Purifier, it was assumed that the form of -class was NMTOKENS, as specified by the XHTML Modularization (representing -XHTML 1.1 and XHTML 2.0). The DTDs for HTML 4.01 and XHTML 1.0, however -specify class as CDATA. HTML 5 effectively defines it as CDATA, but -with the additional constraint that each name should be unique (this is not -explicitly outlined in previous specifications). ---# vim: et sw=4 sts=4 diff --git a/main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Attr.DefaultImageAlt.txt b/main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Attr.DefaultImageAlt.txt deleted file mode 100755 index 533165e175..0000000000 --- a/main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Attr.DefaultImageAlt.txt +++ /dev/null @@ -1,11 +0,0 @@ -Attr.DefaultImageAlt -TYPE: string/null -DEFAULT: null -VERSION: 3.2.0 ---DESCRIPTION-- -This is the content of the alt tag of an image if the user had not -previously specified an alt attribute. This applies to all images without -a valid alt attribute, as opposed to %Attr.DefaultInvalidImageAlt, which -only applies to invalid images, and overrides in the case of an invalid image. -Default behavior with null is to use the basename of the src tag for the alt. ---# vim: et sw=4 sts=4 diff --git a/main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Attr.DefaultInvalidImage.txt b/main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Attr.DefaultInvalidImage.txt deleted file mode 100755 index 9eb7e38469..0000000000 --- a/main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Attr.DefaultInvalidImage.txt +++ /dev/null @@ -1,9 +0,0 @@ -Attr.DefaultInvalidImage -TYPE: string -DEFAULT: '' ---DESCRIPTION-- -This is the default image an img tag will be pointed to if it does not have -a valid src attribute. In future versions, we may allow the image tag to -be removed completely, but due to design issues, this is not possible right -now. ---# vim: et sw=4 sts=4 diff --git a/main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Attr.DefaultInvalidImageAlt.txt b/main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Attr.DefaultInvalidImageAlt.txt deleted file mode 100755 index 2f17bf477a..0000000000 --- a/main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Attr.DefaultInvalidImageAlt.txt +++ /dev/null @@ -1,8 +0,0 @@ -Attr.DefaultInvalidImageAlt -TYPE: string -DEFAULT: 'Invalid image' ---DESCRIPTION-- -This is the content of the alt tag of an invalid image if the user had not -previously specified an alt attribute. It has no effect when the image is -valid but there was no alt attribute present. ---# vim: et sw=4 sts=4 diff --git a/main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Attr.DefaultTextDir.txt b/main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Attr.DefaultTextDir.txt deleted file mode 100755 index 52654b53ae..0000000000 --- a/main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Attr.DefaultTextDir.txt +++ /dev/null @@ -1,10 +0,0 @@ -Attr.DefaultTextDir -TYPE: string -DEFAULT: 'ltr' ---DESCRIPTION-- -Defines the default text direction (ltr or rtl) of the document being -parsed. This generally is the same as the value of the dir attribute in -HTML, or ltr if that is not specified. ---ALLOWED-- -'ltr', 'rtl' ---# vim: et sw=4 sts=4 diff --git a/main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Attr.EnableID.txt b/main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Attr.EnableID.txt deleted file mode 100755 index 6440d21032..0000000000 --- a/main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Attr.EnableID.txt +++ /dev/null @@ -1,16 +0,0 @@ -Attr.EnableID -TYPE: bool -DEFAULT: false -VERSION: 1.2.0 ---DESCRIPTION-- -Allows the ID attribute in HTML. This is disabled by default due to the -fact that without proper configuration user input can easily break the -validation of a webpage by specifying an ID that is already on the -surrounding HTML. If you don't mind throwing caution to the wind, enable -this directive, but I strongly recommend you also consider blacklisting IDs -you use (%Attr.IDBlacklist) or prefixing all user supplied IDs -(%Attr.IDPrefix). When set to true HTML Purifier reverts to the behavior of -pre-1.2.0 versions. ---ALIASES-- -HTML.EnableAttrID ---# vim: et sw=4 sts=4 diff --git a/main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Attr.ForbiddenClasses.txt b/main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Attr.ForbiddenClasses.txt deleted file mode 100755 index f31d226f58..0000000000 --- a/main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Attr.ForbiddenClasses.txt +++ /dev/null @@ -1,8 +0,0 @@ -Attr.ForbiddenClasses -TYPE: lookup -VERSION: 4.0.0 -DEFAULT: array() ---DESCRIPTION-- -List of forbidden class values in the class attribute. By default, this is -empty, which means that no classes are forbidden. See also %Attr.AllowedClasses. ---# vim: et sw=4 sts=4 diff --git a/main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Attr.IDBlacklist.txt b/main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Attr.IDBlacklist.txt deleted file mode 100755 index 5f2b5e3d2c..0000000000 --- a/main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Attr.IDBlacklist.txt +++ /dev/null @@ -1,5 +0,0 @@ -Attr.IDBlacklist -TYPE: list -DEFAULT: array() -DESCRIPTION: Array of IDs not allowed in the document. ---# vim: et sw=4 sts=4 diff --git a/main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Attr.IDBlacklistRegexp.txt b/main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Attr.IDBlacklistRegexp.txt deleted file mode 100755 index 6f5824586e..0000000000 --- a/main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Attr.IDBlacklistRegexp.txt +++ /dev/null @@ -1,9 +0,0 @@ -Attr.IDBlacklistRegexp -TYPE: string/null -VERSION: 1.6.0 -DEFAULT: NULL ---DESCRIPTION-- -PCRE regular expression to be matched against all IDs. If the expression is -matches, the ID is rejected. Use this with care: may cause significant -degradation. ID matching is done after all other validation. ---# vim: et sw=4 sts=4 diff --git a/main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Attr.IDPrefix.txt b/main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Attr.IDPrefix.txt deleted file mode 100755 index cc49d43fd0..0000000000 --- a/main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Attr.IDPrefix.txt +++ /dev/null @@ -1,12 +0,0 @@ -Attr.IDPrefix -TYPE: string -VERSION: 1.2.0 -DEFAULT: '' ---DESCRIPTION-- -String to prefix to IDs. If you have no idea what IDs your pages may use, -you may opt to simply add a prefix to all user-submitted ID attributes so -that they are still usable, but will not conflict with core page IDs. -Example: setting the directive to 'user_' will result in a user submitted -'foo' to become 'user_foo' Be sure to set %HTML.EnableAttrID to true -before using this. ---# vim: et sw=4 sts=4 diff --git a/main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Attr.IDPrefixLocal.txt b/main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Attr.IDPrefixLocal.txt deleted file mode 100755 index 2c5924a7ad..0000000000 --- a/main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Attr.IDPrefixLocal.txt +++ /dev/null @@ -1,14 +0,0 @@ -Attr.IDPrefixLocal -TYPE: string -VERSION: 1.2.0 -DEFAULT: '' ---DESCRIPTION-- -Temporary prefix for IDs used in conjunction with %Attr.IDPrefix. If you -need to allow multiple sets of user content on web page, you may need to -have a seperate prefix that changes with each iteration. This way, -seperately submitted user content displayed on the same page doesn't -clobber each other. Ideal values are unique identifiers for the content it -represents (i.e. the id of the row in the database). Be sure to add a -seperator (like an underscore) at the end. Warning: this directive will -not work unless %Attr.IDPrefix is set to a non-empty value! ---# vim: et sw=4 sts=4 diff --git a/main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/AutoFormat.AutoParagraph.txt b/main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/AutoFormat.AutoParagraph.txt deleted file mode 100755 index d5caa1bb97..0000000000 --- a/main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/AutoFormat.AutoParagraph.txt +++ /dev/null @@ -1,31 +0,0 @@ -AutoFormat.AutoParagraph -TYPE: bool -VERSION: 2.0.1 -DEFAULT: false ---DESCRIPTION-- - -

    - This directive turns on auto-paragraphing, where double newlines are - converted in to paragraphs whenever possible. Auto-paragraphing: -

    -
      -
    • Always applies to inline elements or text in the root node,
    • -
    • Applies to inline elements or text with double newlines in nodes - that allow paragraph tags,
    • -
    • Applies to double newlines in paragraph tags
    • -
    -

    - p tags must be allowed for this directive to take effect. - We do not use br tags for paragraphing, as that is - semantically incorrect. -

    -

    - To prevent auto-paragraphing as a content-producer, refrain from using - double-newlines except to specify a new paragraph or in contexts where - it has special meaning (whitespace usually has no meaning except in - tags like pre, so this should not be difficult.) To prevent - the paragraphing of inline text adjacent to block elements, wrap them - in div tags (the behavior is slightly different outside of - the root node.) -

    ---# vim: et sw=4 sts=4 diff --git a/main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/AutoFormat.Custom.txt b/main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/AutoFormat.Custom.txt deleted file mode 100755 index 2a476481af..0000000000 --- a/main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/AutoFormat.Custom.txt +++ /dev/null @@ -1,12 +0,0 @@ -AutoFormat.Custom -TYPE: list -VERSION: 2.0.1 -DEFAULT: array() ---DESCRIPTION-- - -

    - This directive can be used to add custom auto-format injectors. - Specify an array of injector names (class name minus the prefix) - or concrete implementations. Injector class must exist. -

    ---# vim: et sw=4 sts=4 diff --git a/main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/AutoFormat.DisplayLinkURI.txt b/main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/AutoFormat.DisplayLinkURI.txt deleted file mode 100755 index 663064a344..0000000000 --- a/main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/AutoFormat.DisplayLinkURI.txt +++ /dev/null @@ -1,11 +0,0 @@ -AutoFormat.DisplayLinkURI -TYPE: bool -VERSION: 3.2.0 -DEFAULT: false ---DESCRIPTION-- -

    - This directive turns on the in-text display of URIs in <a> tags, and disables - those links. For example, example becomes - example (http://example.com). -

    ---# vim: et sw=4 sts=4 diff --git a/main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/AutoFormat.Linkify.txt b/main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/AutoFormat.Linkify.txt deleted file mode 100755 index 3a48ba960e..0000000000 --- a/main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/AutoFormat.Linkify.txt +++ /dev/null @@ -1,12 +0,0 @@ -AutoFormat.Linkify -TYPE: bool -VERSION: 2.0.1 -DEFAULT: false ---DESCRIPTION-- - -

    - This directive turns on linkification, auto-linking http, ftp and - https URLs. a tags with the href attribute - must be allowed. -

    ---# vim: et sw=4 sts=4 diff --git a/main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/AutoFormat.PurifierLinkify.DocURL.txt b/main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/AutoFormat.PurifierLinkify.DocURL.txt deleted file mode 100755 index db58b13464..0000000000 --- a/main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/AutoFormat.PurifierLinkify.DocURL.txt +++ /dev/null @@ -1,12 +0,0 @@ -AutoFormat.PurifierLinkify.DocURL -TYPE: string -VERSION: 2.0.1 -DEFAULT: '#%s' -ALIASES: AutoFormatParam.PurifierLinkifyDocURL ---DESCRIPTION-- -

    - Location of configuration documentation to link to, let %s substitute - into the configuration's namespace and directive names sans the percent - sign. -

    ---# vim: et sw=4 sts=4 diff --git a/main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/AutoFormat.PurifierLinkify.txt b/main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/AutoFormat.PurifierLinkify.txt deleted file mode 100755 index 7996488be0..0000000000 --- a/main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/AutoFormat.PurifierLinkify.txt +++ /dev/null @@ -1,12 +0,0 @@ -AutoFormat.PurifierLinkify -TYPE: bool -VERSION: 2.0.1 -DEFAULT: false ---DESCRIPTION-- - -

    - Internal auto-formatter that converts configuration directives in - syntax %Namespace.Directive to links. a tags - with the href attribute must be allowed. -

    ---# vim: et sw=4 sts=4 diff --git a/main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/AutoFormat.RemoveEmpty.RemoveNbsp.Exceptions.txt b/main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/AutoFormat.RemoveEmpty.RemoveNbsp.Exceptions.txt deleted file mode 100755 index 35c393b4e6..0000000000 --- a/main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/AutoFormat.RemoveEmpty.RemoveNbsp.Exceptions.txt +++ /dev/null @@ -1,11 +0,0 @@ -AutoFormat.RemoveEmpty.RemoveNbsp.Exceptions -TYPE: lookup -VERSION: 4.0.0 -DEFAULT: array('td' => true, 'th' => true) ---DESCRIPTION-- -

    - When %AutoFormat.RemoveEmpty and %AutoFormat.RemoveEmpty.RemoveNbsp - are enabled, this directive defines what HTML elements should not be - removede if they have only a non-breaking space in them. -

    ---# vim: et sw=4 sts=4 diff --git a/main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/AutoFormat.RemoveEmpty.RemoveNbsp.txt b/main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/AutoFormat.RemoveEmpty.RemoveNbsp.txt deleted file mode 100755 index ca17eb1dc4..0000000000 --- a/main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/AutoFormat.RemoveEmpty.RemoveNbsp.txt +++ /dev/null @@ -1,15 +0,0 @@ -AutoFormat.RemoveEmpty.RemoveNbsp -TYPE: bool -VERSION: 4.0.0 -DEFAULT: false ---DESCRIPTION-- -

    - When enabled, HTML Purifier will treat any elements that contain only - non-breaking spaces as well as regular whitespace as empty, and remove - them when %AutoForamt.RemoveEmpty is enabled. -

    -

    - See %AutoFormat.RemoveEmpty.RemoveNbsp.Exceptions for a list of elements - that don't have this behavior applied to them. -

    ---# vim: et sw=4 sts=4 diff --git a/main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/AutoFormat.RemoveEmpty.txt b/main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/AutoFormat.RemoveEmpty.txt deleted file mode 100755 index 34657ba47b..0000000000 --- a/main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/AutoFormat.RemoveEmpty.txt +++ /dev/null @@ -1,46 +0,0 @@ -AutoFormat.RemoveEmpty -TYPE: bool -VERSION: 3.2.0 -DEFAULT: false ---DESCRIPTION-- -

    - When enabled, HTML Purifier will attempt to remove empty elements that - contribute no semantic information to the document. The following types - of nodes will be removed: -

    -
    • - Tags with no attributes and no content, and that are not empty - elements (remove <a></a> but not - <br />), and -
    • -
    • - Tags with no content, except for:
        -
      • The colgroup element, or
      • -
      • - Elements with the id or name attribute, - when those attributes are permitted on those elements. -
      • -
    • -
    -

    - Please be very careful when using this functionality; while it may not - seem that empty elements contain useful information, they can alter the - layout of a document given appropriate styling. This directive is most - useful when you are processing machine-generated HTML, please avoid using - it on regular user HTML. -

    -

    - Elements that contain only whitespace will be treated as empty. Non-breaking - spaces, however, do not count as whitespace. See - %AutoFormat.RemoveEmpty.RemoveNbsp for alternate behavior. -

    -

    - This algorithm is not perfect; you may still notice some empty tags, - particularly if a node had elements, but those elements were later removed - because they were not permitted in that context, or tags that, after - being auto-closed by another tag, where empty. This is for safety reasons - to prevent clever code from breaking validation. The general rule of thumb: - if a tag looked empty on the way in, it will get removed; if HTML Purifier - made it empty, it will stay. -

    ---# vim: et sw=4 sts=4 diff --git a/main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/AutoFormat.RemoveSpansWithoutAttributes.txt b/main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/AutoFormat.RemoveSpansWithoutAttributes.txt deleted file mode 100755 index dde990ab26..0000000000 --- a/main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/AutoFormat.RemoveSpansWithoutAttributes.txt +++ /dev/null @@ -1,11 +0,0 @@ -AutoFormat.RemoveSpansWithoutAttributes -TYPE: bool -VERSION: 4.0.1 -DEFAULT: false ---DESCRIPTION-- -

    - This directive causes span tags without any attributes - to be removed. It will also remove spans that had all attributes - removed during processing. -

    ---# vim: et sw=4 sts=4 diff --git a/main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/CSS.AllowImportant.txt b/main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/CSS.AllowImportant.txt deleted file mode 100755 index b324608f76..0000000000 --- a/main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/CSS.AllowImportant.txt +++ /dev/null @@ -1,8 +0,0 @@ -CSS.AllowImportant -TYPE: bool -DEFAULT: false -VERSION: 3.1.0 ---DESCRIPTION-- -This parameter determines whether or not !important cascade modifiers should -be allowed in user CSS. If false, !important will stripped. ---# vim: et sw=4 sts=4 diff --git a/main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/CSS.AllowTricky.txt b/main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/CSS.AllowTricky.txt deleted file mode 100755 index 748be0eec8..0000000000 --- a/main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/CSS.AllowTricky.txt +++ /dev/null @@ -1,11 +0,0 @@ -CSS.AllowTricky -TYPE: bool -DEFAULT: false -VERSION: 3.1.0 ---DESCRIPTION-- -This parameter determines whether or not to allow "tricky" CSS properties and -values. Tricky CSS properties/values can drastically modify page layout or -be used for deceptive practices but do not directly constitute a security risk. -For example, display:none; is considered a tricky property that -will only be allowed if this directive is set to true. ---# vim: et sw=4 sts=4 diff --git a/main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/CSS.AllowedProperties.txt b/main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/CSS.AllowedProperties.txt deleted file mode 100755 index 460112ebe0..0000000000 --- a/main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/CSS.AllowedProperties.txt +++ /dev/null @@ -1,18 +0,0 @@ -CSS.AllowedProperties -TYPE: lookup/null -VERSION: 3.1.0 -DEFAULT: NULL ---DESCRIPTION-- - -

    - If HTML Purifier's style attributes set is unsatisfactory for your needs, - you can overload it with your own list of tags to allow. Note that this - method is subtractive: it does its job by taking away from HTML Purifier - usual feature set, so you cannot add an attribute that HTML Purifier never - supported in the first place. -

    -

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

    ---# vim: et sw=4 sts=4 diff --git a/main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/CSS.DefinitionRev.txt b/main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/CSS.DefinitionRev.txt deleted file mode 100755 index 5cb7dda3ba..0000000000 --- a/main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/CSS.DefinitionRev.txt +++ /dev/null @@ -1,11 +0,0 @@ -CSS.DefinitionRev -TYPE: int -VERSION: 2.0.0 -DEFAULT: 1 ---DESCRIPTION-- - -

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

    ---# vim: et sw=4 sts=4 diff --git a/main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/CSS.ForbiddenProperties.txt b/main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/CSS.ForbiddenProperties.txt deleted file mode 100755 index 923e8e995c..0000000000 --- a/main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/CSS.ForbiddenProperties.txt +++ /dev/null @@ -1,13 +0,0 @@ -CSS.ForbiddenProperties -TYPE: lookup -VERSION: 4.2.0 -DEFAULT: array() ---DESCRIPTION-- -

    - This is the logical inverse of %CSS.AllowedProperties, and it will - override that directive or any other directive. If possible, - %CSS.AllowedProperties is recommended over this directive, - because it can sometimes be difficult to tell whether or not you've - forbidden all of the CSS properties you truly would like to disallow. -

    ---# vim: et sw=4 sts=4 diff --git a/main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/CSS.MaxImgLength.txt b/main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/CSS.MaxImgLength.txt deleted file mode 100755 index 7a3291470c..0000000000 --- a/main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/CSS.MaxImgLength.txt +++ /dev/null @@ -1,16 +0,0 @@ -CSS.MaxImgLength -TYPE: string/null -DEFAULT: '1200px' -VERSION: 3.1.1 ---DESCRIPTION-- -

    - This parameter sets the maximum allowed length on img tags, - effectively the width and height properties. - Only absolute units of measurement (in, pt, pc, mm, cm) and pixels (px) are allowed. This is - in place to prevent imagecrash attacks, disable with null at your own risk. - This directive is similar to %HTML.MaxImgLength, and both should be - concurrently edited, although there are - subtle differences in the input format (the CSS max is a number with - a unit). -

    ---# vim: et sw=4 sts=4 diff --git a/main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/CSS.Proprietary.txt b/main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/CSS.Proprietary.txt deleted file mode 100755 index 148eedb8be..0000000000 --- a/main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/CSS.Proprietary.txt +++ /dev/null @@ -1,10 +0,0 @@ -CSS.Proprietary -TYPE: bool -VERSION: 3.0.0 -DEFAULT: false ---DESCRIPTION-- - -

    - Whether or not to allow safe, proprietary CSS values. -

    ---# vim: et sw=4 sts=4 diff --git a/main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Cache.DefinitionImpl.txt b/main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Cache.DefinitionImpl.txt deleted file mode 100755 index c486724c88..0000000000 --- a/main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Cache.DefinitionImpl.txt +++ /dev/null @@ -1,14 +0,0 @@ -Cache.DefinitionImpl -TYPE: string/null -VERSION: 2.0.0 -DEFAULT: 'Serializer' ---DESCRIPTION-- - -This directive defines which method to use when caching definitions, -the complex data-type that makes HTML Purifier tick. Set to null -to disable caching (not recommended, as you will see a definite -performance degradation). - ---ALIASES-- -Core.DefinitionCache ---# vim: et sw=4 sts=4 diff --git a/main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Cache.SerializerPath.txt b/main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Cache.SerializerPath.txt deleted file mode 100755 index 54036507d6..0000000000 --- a/main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Cache.SerializerPath.txt +++ /dev/null @@ -1,13 +0,0 @@ -Cache.SerializerPath -TYPE: string/null -VERSION: 2.0.0 -DEFAULT: NULL ---DESCRIPTION-- - -

    - Absolute path with no trailing slash to store serialized definitions in. - Default is within the - HTML Purifier library inside DefinitionCache/Serializer. This - path must be writable by the webserver. -

    ---# vim: et sw=4 sts=4 diff --git a/main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Core.AggressivelyFixLt.txt b/main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Core.AggressivelyFixLt.txt deleted file mode 100755 index 568cbf3b32..0000000000 --- a/main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Core.AggressivelyFixLt.txt +++ /dev/null @@ -1,18 +0,0 @@ -Core.AggressivelyFixLt -TYPE: bool -VERSION: 2.1.0 -DEFAULT: true ---DESCRIPTION-- -

    - This directive enables aggressive pre-filter fixes HTML Purifier can - perform in order to ensure that open angled-brackets do not get killed - during parsing stage. Enabling this will result in two preg_replace_callback - calls and at least two preg_replace calls for every HTML document parsed; - if your users make very well-formed HTML, you can set this directive false. - This has no effect when DirectLex is used. -

    -

    - Notice: This directive's default turned from false to true - in HTML Purifier 3.2.0. -

    ---# vim: et sw=4 sts=4 diff --git a/main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Core.CollectErrors.txt b/main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Core.CollectErrors.txt deleted file mode 100755 index d7317911fa..0000000000 --- a/main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Core.CollectErrors.txt +++ /dev/null @@ -1,12 +0,0 @@ -Core.CollectErrors -TYPE: bool -VERSION: 2.0.0 -DEFAULT: false ---DESCRIPTION-- - -Whether or not to collect errors found while filtering the document. This -is a useful way to give feedback to your users. Warning: -Currently this feature is very patchy and experimental, with lots of -possible error messages not yet implemented. It will not cause any -problems, but it may not help your users either. ---# vim: et sw=4 sts=4 diff --git a/main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Core.ColorKeywords.txt b/main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Core.ColorKeywords.txt deleted file mode 100755 index 08b381d34c..0000000000 --- a/main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Core.ColorKeywords.txt +++ /dev/null @@ -1,28 +0,0 @@ -Core.ColorKeywords -TYPE: hash -VERSION: 2.0.0 ---DEFAULT-- -array ( - 'maroon' => '#800000', - 'red' => '#FF0000', - 'orange' => '#FFA500', - 'yellow' => '#FFFF00', - 'olive' => '#808000', - 'purple' => '#800080', - 'fuchsia' => '#FF00FF', - 'white' => '#FFFFFF', - 'lime' => '#00FF00', - 'green' => '#008000', - 'navy' => '#000080', - 'blue' => '#0000FF', - 'aqua' => '#00FFFF', - 'teal' => '#008080', - 'black' => '#000000', - 'silver' => '#C0C0C0', - 'gray' => '#808080', -) ---DESCRIPTION-- - -Lookup array of color names to six digit hexadecimal number corresponding -to color, with preceding hash mark. Used when parsing colors. ---# vim: et sw=4 sts=4 diff --git a/main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Core.ConvertDocumentToFragment.txt b/main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Core.ConvertDocumentToFragment.txt deleted file mode 100755 index 64b114fce2..0000000000 --- a/main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Core.ConvertDocumentToFragment.txt +++ /dev/null @@ -1,14 +0,0 @@ -Core.ConvertDocumentToFragment -TYPE: bool -DEFAULT: true ---DESCRIPTION-- - -This parameter determines whether or not the filter should convert -input that is a full document with html and body tags to a fragment -of just the contents of a body tag. This parameter is simply something -HTML Purifier can do during an edge-case: for most inputs, this -processing is not necessary. - ---ALIASES-- -Core.AcceptFullDocuments ---# vim: et sw=4 sts=4 diff --git a/main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Core.DirectLexLineNumberSyncInterval.txt b/main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Core.DirectLexLineNumberSyncInterval.txt deleted file mode 100755 index 36f16e07ea..0000000000 --- a/main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Core.DirectLexLineNumberSyncInterval.txt +++ /dev/null @@ -1,17 +0,0 @@ -Core.DirectLexLineNumberSyncInterval -TYPE: int -VERSION: 2.0.0 -DEFAULT: 0 ---DESCRIPTION-- - -

    - Specifies the number of tokens the DirectLex line number tracking - implementations should process before attempting to resyncronize the - current line count by manually counting all previous new-lines. When - at 0, this functionality is disabled. Lower values will decrease - performance, and this is only strictly necessary if the counting - algorithm is buggy (in which case you should report it as a bug). - This has no effect when %Core.MaintainLineNumbers is disabled or DirectLex is - not being used. -

    ---# vim: et sw=4 sts=4 diff --git a/main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Core.Encoding.txt b/main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Core.Encoding.txt deleted file mode 100755 index 8bfb47c3ac..0000000000 --- a/main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Core.Encoding.txt +++ /dev/null @@ -1,15 +0,0 @@ -Core.Encoding -TYPE: istring -DEFAULT: 'utf-8' ---DESCRIPTION-- -If for some reason you are unable to convert all webpages to UTF-8, you can -use this directive as a stop-gap compatibility change to let HTML Purifier -deal with non UTF-8 input. This technique has notable deficiencies: -absolutely no characters outside of the selected character encoding will be -preserved, not even the ones that have been ampersand escaped (this is due -to a UTF-8 specific feature that automatically resolves all -entities), making it pretty useless for anything except the most I18N-blind -applications, although %Core.EscapeNonASCIICharacters offers fixes this -trouble with another tradeoff. This directive only accepts ISO-8859-1 if -iconv is not enabled. ---# vim: et sw=4 sts=4 diff --git a/main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Core.EscapeInvalidChildren.txt b/main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Core.EscapeInvalidChildren.txt deleted file mode 100755 index 4d5b5055cd..0000000000 --- a/main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Core.EscapeInvalidChildren.txt +++ /dev/null @@ -1,10 +0,0 @@ -Core.EscapeInvalidChildren -TYPE: bool -DEFAULT: false ---DESCRIPTION-- -When true, a child is found that is not allowed in the context of the -parent element will be transformed into text as if it were ASCII. When -false, that element and all internal tags will be dropped, though text will -be preserved. There is no option for dropping the element but preserving -child nodes. ---# vim: et sw=4 sts=4 diff --git a/main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Core.EscapeInvalidTags.txt b/main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Core.EscapeInvalidTags.txt deleted file mode 100755 index a7a5b249bb..0000000000 --- a/main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Core.EscapeInvalidTags.txt +++ /dev/null @@ -1,7 +0,0 @@ -Core.EscapeInvalidTags -TYPE: bool -DEFAULT: false ---DESCRIPTION-- -When true, invalid tags will be written back to the document as plain text. -Otherwise, they are silently dropped. ---# vim: et sw=4 sts=4 diff --git a/main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Core.EscapeNonASCIICharacters.txt b/main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Core.EscapeNonASCIICharacters.txt deleted file mode 100755 index abb499948a..0000000000 --- a/main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Core.EscapeNonASCIICharacters.txt +++ /dev/null @@ -1,13 +0,0 @@ -Core.EscapeNonASCIICharacters -TYPE: bool -VERSION: 1.4.0 -DEFAULT: false ---DESCRIPTION-- -This directive overcomes a deficiency in %Core.Encoding by blindly -converting all non-ASCII characters into decimal numeric entities before -converting it to its native encoding. This means that even characters that -can be expressed in the non-UTF-8 encoding will be entity-ized, which can -be a real downer for encodings like Big5. It also assumes that the ASCII -repetoire is available, although this is the case for almost all encodings. -Anyway, use UTF-8! ---# vim: et sw=4 sts=4 diff --git a/main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Core.HiddenElements.txt b/main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Core.HiddenElements.txt deleted file mode 100755 index 915391edb7..0000000000 --- a/main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Core.HiddenElements.txt +++ /dev/null @@ -1,19 +0,0 @@ -Core.HiddenElements -TYPE: lookup ---DEFAULT-- -array ( - 'script' => true, - 'style' => true, -) ---DESCRIPTION-- - -

    - This directive is a lookup array of elements which should have their - contents removed when they are not allowed by the HTML definition. - For example, the contents of a script tag are not - normally shown in a document, so if script tags are to be removed, - their contents should be removed to. This is opposed to a b - tag, which defines some presentational changes but does not hide its - contents. -

    ---# vim: et sw=4 sts=4 diff --git a/main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Core.Language.txt b/main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Core.Language.txt deleted file mode 100755 index 233fca14f8..0000000000 --- a/main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Core.Language.txt +++ /dev/null @@ -1,10 +0,0 @@ -Core.Language -TYPE: string -VERSION: 2.0.0 -DEFAULT: 'en' ---DESCRIPTION-- - -ISO 639 language code for localizable things in HTML Purifier to use, -which is mainly error reporting. There is currently only an English (en) -translation, so this directive is currently useless. ---# vim: et sw=4 sts=4 diff --git a/main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Core.LexerImpl.txt b/main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Core.LexerImpl.txt deleted file mode 100755 index 8983e2cca9..0000000000 --- a/main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Core.LexerImpl.txt +++ /dev/null @@ -1,34 +0,0 @@ -Core.LexerImpl -TYPE: mixed/null -VERSION: 2.0.0 -DEFAULT: NULL ---DESCRIPTION-- - -

    - This parameter determines what lexer implementation can be used. The - valid values are: -

    -
    -
    null
    -
    - Recommended, the lexer implementation will be auto-detected based on - your PHP-version and configuration. -
    -
    string lexer identifier
    -
    - This is a slim way of manually overridding the implementation. - Currently recognized values are: DOMLex (the default PHP5 -implementation) - and DirectLex (the default PHP4 implementation). Only use this if - you know what you are doing: usually, the auto-detection will - manage things for cases you aren't even aware of. -
    -
    object lexer instance
    -
    - Super-advanced: you can specify your own, custom, implementation that - implements the interface defined by HTMLPurifier_Lexer. - I may remove this option simply because I don't expect anyone - to use it. -
    -
    ---# vim: et sw=4 sts=4 diff --git a/main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Core.MaintainLineNumbers.txt b/main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Core.MaintainLineNumbers.txt deleted file mode 100755 index eb841a7597..0000000000 --- a/main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Core.MaintainLineNumbers.txt +++ /dev/null @@ -1,16 +0,0 @@ -Core.MaintainLineNumbers -TYPE: bool/null -VERSION: 2.0.0 -DEFAULT: NULL ---DESCRIPTION-- - -

    - If true, HTML Purifier will add line number information to all tokens. - This is useful when error reporting is turned on, but can result in - significant performance degradation and should not be used when - unnecessary. This directive must be used with the DirectLex lexer, - as the DOMLex lexer does not (yet) support this functionality. - If the value is null, an appropriate value will be selected based - on other configuration. -

    ---# vim: et sw=4 sts=4 diff --git a/main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Core.NormalizeNewlines.txt b/main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Core.NormalizeNewlines.txt deleted file mode 100755 index 94a88600de..0000000000 --- a/main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Core.NormalizeNewlines.txt +++ /dev/null @@ -1,11 +0,0 @@ -Core.NormalizeNewlines -TYPE: bool -VERSION: 4.2.0 -DEFAULT: true ---DESCRIPTION-- -

    - Whether or not to normalize newlines to the operating - system default. When false, HTML Purifier - will attempt to preserve mixed newline files. -

    ---# vim: et sw=4 sts=4 diff --git a/main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Core.RemoveInvalidImg.txt b/main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Core.RemoveInvalidImg.txt deleted file mode 100755 index 4070c2a0de..0000000000 --- a/main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Core.RemoveInvalidImg.txt +++ /dev/null @@ -1,12 +0,0 @@ -Core.RemoveInvalidImg -TYPE: bool -DEFAULT: true -VERSION: 1.3.0 ---DESCRIPTION-- - -

    - This directive enables pre-emptive URI checking in img - tags, as the attribute validation strategy is not authorized to - remove elements from the document. Revert to pre-1.3.0 behavior by setting to false. -

    ---# vim: et sw=4 sts=4 diff --git a/main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Core.RemoveProcessingInstructions.txt b/main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Core.RemoveProcessingInstructions.txt deleted file mode 100755 index ed6f13425e..0000000000 --- a/main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Core.RemoveProcessingInstructions.txt +++ /dev/null @@ -1,11 +0,0 @@ -Core.RemoveProcessingInstructions -TYPE: bool -VERSION: 4.2.0 -DEFAULT: false ---DESCRIPTION-- -Instead of escaping processing instructions in the form <? ... -?>, remove it out-right. This may be useful if the HTML -you are validating contains XML processing instruction gunk, however, -it can also be user-unfriendly for people attempting to post PHP -snippets. ---# vim: et sw=4 sts=4 diff --git a/main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Core.RemoveScriptContents.txt b/main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Core.RemoveScriptContents.txt deleted file mode 100755 index a4cd966df8..0000000000 --- a/main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Core.RemoveScriptContents.txt +++ /dev/null @@ -1,12 +0,0 @@ -Core.RemoveScriptContents -TYPE: bool/null -DEFAULT: NULL -VERSION: 2.0.0 -DEPRECATED-VERSION: 2.1.0 -DEPRECATED-USE: Core.HiddenElements ---DESCRIPTION-- -

    - This directive enables HTML Purifier to remove not only script tags - but all of their contents. -

    ---# vim: et sw=4 sts=4 diff --git a/main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Filter.Custom.txt b/main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Filter.Custom.txt deleted file mode 100755 index 3db50ef204..0000000000 --- a/main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Filter.Custom.txt +++ /dev/null @@ -1,11 +0,0 @@ -Filter.Custom -TYPE: list -VERSION: 3.1.0 -DEFAULT: array() ---DESCRIPTION-- -

    - This directive can be used to add custom filters; it is nearly the - equivalent of the now deprecated HTMLPurifier->addFilter() - method. Specify an array of concrete implementations. -

    ---# vim: et sw=4 sts=4 diff --git a/main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Filter.ExtractStyleBlocks.Escaping.txt b/main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Filter.ExtractStyleBlocks.Escaping.txt deleted file mode 100755 index 16829bcda0..0000000000 --- a/main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Filter.ExtractStyleBlocks.Escaping.txt +++ /dev/null @@ -1,14 +0,0 @@ -Filter.ExtractStyleBlocks.Escaping -TYPE: bool -VERSION: 3.0.0 -DEFAULT: true -ALIASES: Filter.ExtractStyleBlocksEscaping, FilterParam.ExtractStyleBlocksEscaping ---DESCRIPTION-- - -

    - Whether or not to escape the dangerous characters <, > and & - as \3C, \3E and \26, respectively. This is can be safely set to false - if the contents of StyleBlocks will be placed in an external stylesheet, - where there is no risk of it being interpreted as HTML. -

    ---# vim: et sw=4 sts=4 diff --git a/main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Filter.ExtractStyleBlocks.Scope.txt b/main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Filter.ExtractStyleBlocks.Scope.txt deleted file mode 100755 index 7f95f54d12..0000000000 --- a/main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Filter.ExtractStyleBlocks.Scope.txt +++ /dev/null @@ -1,29 +0,0 @@ -Filter.ExtractStyleBlocks.Scope -TYPE: string/null -VERSION: 3.0.0 -DEFAULT: NULL -ALIASES: Filter.ExtractStyleBlocksScope, FilterParam.ExtractStyleBlocksScope ---DESCRIPTION-- - -

    - If you would like users to be able to define external stylesheets, but - only allow them to specify CSS declarations for a specific node and - prevent them from fiddling with other elements, use this directive. - It accepts any valid CSS selector, and will prepend this to any - CSS declaration extracted from the document. For example, if this - directive is set to #user-content and a user uses the - selector a:hover, the final selector will be - #user-content a:hover. -

    -

    - The comma shorthand may be used; consider the above example, with - #user-content, #user-content2, the final selector will - be #user-content a:hover, #user-content2 a:hover. -

    -

    - Warning: It is possible for users to bypass this measure - using a naughty + selector. This is a bug in CSS Tidy 1.3, not HTML - Purifier, and I am working to get it fixed. Until then, HTML Purifier - performs a basic check to prevent this. -

    ---# vim: et sw=4 sts=4 diff --git a/main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Filter.ExtractStyleBlocks.TidyImpl.txt b/main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Filter.ExtractStyleBlocks.TidyImpl.txt deleted file mode 100755 index 6c231b2d7f..0000000000 --- a/main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Filter.ExtractStyleBlocks.TidyImpl.txt +++ /dev/null @@ -1,16 +0,0 @@ -Filter.ExtractStyleBlocks.TidyImpl -TYPE: mixed/null -VERSION: 3.1.0 -DEFAULT: NULL -ALIASES: FilterParam.ExtractStyleBlocksTidyImpl ---DESCRIPTION-- -

    - If left NULL, HTML Purifier will attempt to instantiate a csstidy - class to use for internal cleaning. This will usually be good enough. -

    -

    - However, for trusted user input, you can set this to false to - disable cleaning. In addition, you can supply your own concrete implementation - of Tidy's interface to use, although I don't know why you'd want to do that. -

    ---# vim: et sw=4 sts=4 diff --git a/main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Filter.ExtractStyleBlocks.txt b/main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Filter.ExtractStyleBlocks.txt deleted file mode 100755 index 078d087417..0000000000 --- a/main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Filter.ExtractStyleBlocks.txt +++ /dev/null @@ -1,74 +0,0 @@ -Filter.ExtractStyleBlocks -TYPE: bool -VERSION: 3.1.0 -DEFAULT: false -EXTERNAL: CSSTidy ---DESCRIPTION-- -

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

    -

    - Sample usage: -

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

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

    ---# vim: et sw=4 sts=4 diff --git a/main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Filter.YouTube.txt b/main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Filter.YouTube.txt deleted file mode 100755 index 8822186685..0000000000 --- a/main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Filter.YouTube.txt +++ /dev/null @@ -1,16 +0,0 @@ -Filter.YouTube -TYPE: bool -VERSION: 3.1.0 -DEFAULT: false ---DESCRIPTION-- -

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

    -

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

    ---# vim: et sw=4 sts=4 diff --git a/main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/HTML.Allowed.txt b/main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/HTML.Allowed.txt deleted file mode 100755 index afd48a0d47..0000000000 --- a/main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/HTML.Allowed.txt +++ /dev/null @@ -1,25 +0,0 @@ -HTML.Allowed -TYPE: itext/null -VERSION: 2.0.0 -DEFAULT: NULL ---DESCRIPTION-- - -

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

    -

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

    ---# vim: et sw=4 sts=4 diff --git a/main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/HTML.AllowedAttributes.txt b/main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/HTML.AllowedAttributes.txt deleted file mode 100755 index fcf093f17d..0000000000 --- a/main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/HTML.AllowedAttributes.txt +++ /dev/null @@ -1,19 +0,0 @@ -HTML.AllowedAttributes -TYPE: lookup/null -VERSION: 1.3.0 -DEFAULT: NULL ---DESCRIPTION-- - -

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

    -

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

    ---# vim: et sw=4 sts=4 diff --git a/main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/HTML.AllowedElements.txt b/main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/HTML.AllowedElements.txt deleted file mode 100755 index ca3c13ddbf..0000000000 --- a/main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/HTML.AllowedElements.txt +++ /dev/null @@ -1,23 +0,0 @@ -HTML.AllowedElements -TYPE: lookup/null -VERSION: 1.3.0 -DEFAULT: NULL ---DESCRIPTION-- -

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

    -

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

    -

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

    ---# vim: et sw=4 sts=4 diff --git a/main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/HTML.AllowedModules.txt b/main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/HTML.AllowedModules.txt deleted file mode 100755 index 5a59a55c08..0000000000 --- a/main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/HTML.AllowedModules.txt +++ /dev/null @@ -1,20 +0,0 @@ -HTML.AllowedModules -TYPE: lookup/null -VERSION: 2.0.0 -DEFAULT: NULL ---DESCRIPTION-- - -

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

    -

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

    ---# vim: et sw=4 sts=4 diff --git a/main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/HTML.Attr.Name.UseCDATA.txt b/main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/HTML.Attr.Name.UseCDATA.txt deleted file mode 100755 index 151fb7b826..0000000000 --- a/main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/HTML.Attr.Name.UseCDATA.txt +++ /dev/null @@ -1,11 +0,0 @@ -HTML.Attr.Name.UseCDATA -TYPE: bool -DEFAULT: false -VERSION: 4.0.0 ---DESCRIPTION-- -The W3C specification DTD defines the name attribute to be CDATA, not ID, due -to limitations of DTD. In certain documents, this relaxed behavior is desired, -whether it is to specify duplicate names, or to specify names that would be -illegal IDs (for example, names that begin with a digit.) Set this configuration -directive to true to use the relaxed parsing rules. ---# vim: et sw=4 sts=4 diff --git a/main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/HTML.BlockWrapper.txt b/main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/HTML.BlockWrapper.txt deleted file mode 100755 index 45ae469ec9..0000000000 --- a/main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/HTML.BlockWrapper.txt +++ /dev/null @@ -1,18 +0,0 @@ -HTML.BlockWrapper -TYPE: string -VERSION: 1.3.0 -DEFAULT: 'p' ---DESCRIPTION-- - -

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

    -

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

    ---# vim: et sw=4 sts=4 diff --git a/main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/HTML.CoreModules.txt b/main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/HTML.CoreModules.txt deleted file mode 100755 index 5246188795..0000000000 --- a/main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/HTML.CoreModules.txt +++ /dev/null @@ -1,23 +0,0 @@ -HTML.CoreModules -TYPE: lookup -VERSION: 2.0.0 ---DEFAULT-- -array ( - 'Structure' => true, - 'Text' => true, - 'Hypertext' => true, - 'List' => true, - 'NonXMLCommonAttributes' => true, - 'XMLCommonAttributes' => true, - 'CommonAttributes' => true, -) ---DESCRIPTION-- - -

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

    ---# vim: et sw=4 sts=4 diff --git a/main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/HTML.CustomDoctype.txt b/main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/HTML.CustomDoctype.txt deleted file mode 100755 index a64e3d7c36..0000000000 --- a/main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/HTML.CustomDoctype.txt +++ /dev/null @@ -1,9 +0,0 @@ -HTML.CustomDoctype -TYPE: string/null -VERSION: 2.0.1 -DEFAULT: NULL ---DESCRIPTION-- - -A custom doctype for power-users who defined there own document -type. This directive only applies when %HTML.Doctype is blank. ---# vim: et sw=4 sts=4 diff --git a/main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/HTML.DefinitionID.txt b/main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/HTML.DefinitionID.txt deleted file mode 100755 index 103db754a2..0000000000 --- a/main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/HTML.DefinitionID.txt +++ /dev/null @@ -1,33 +0,0 @@ -HTML.DefinitionID -TYPE: string/null -DEFAULT: NULL -VERSION: 2.0.0 ---DESCRIPTION-- - -

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

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

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

    -

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

    ---# vim: et sw=4 sts=4 diff --git a/main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/HTML.DefinitionRev.txt b/main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/HTML.DefinitionRev.txt deleted file mode 100755 index 229ae0267a..0000000000 --- a/main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/HTML.DefinitionRev.txt +++ /dev/null @@ -1,16 +0,0 @@ -HTML.DefinitionRev -TYPE: int -VERSION: 2.0.0 -DEFAULT: 1 ---DESCRIPTION-- - -

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

    ---# vim: et sw=4 sts=4 diff --git a/main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/HTML.Doctype.txt b/main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/HTML.Doctype.txt deleted file mode 100755 index 9dab497f2f..0000000000 --- a/main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/HTML.Doctype.txt +++ /dev/null @@ -1,11 +0,0 @@ -HTML.Doctype -TYPE: string/null -DEFAULT: NULL ---DESCRIPTION-- -Doctype to use during filtering. Technically speaking this is not actually -a doctype (as it does not identify a corresponding DTD), but we are using -this name for sake of simplicity. When non-blank, this will override any -older directives like %HTML.XHTML or %HTML.Strict. ---ALLOWED-- -'HTML 4.01 Transitional', 'HTML 4.01 Strict', 'XHTML 1.0 Transitional', 'XHTML 1.0 Strict', 'XHTML 1.1' ---# vim: et sw=4 sts=4 diff --git a/main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/HTML.FlashAllowFullScreen.txt b/main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/HTML.FlashAllowFullScreen.txt deleted file mode 100755 index 08d641f954..0000000000 --- a/main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/HTML.FlashAllowFullScreen.txt +++ /dev/null @@ -1,11 +0,0 @@ -HTML.FlashAllowFullScreen -TYPE: bool -VERSION: 4.2.0 -DEFAULT: false ---DESCRIPTION-- -

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

    ---# vim: et sw=4 sts=4 diff --git a/main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/HTML.ForbiddenAttributes.txt b/main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/HTML.ForbiddenAttributes.txt deleted file mode 100755 index 57358f9bad..0000000000 --- a/main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/HTML.ForbiddenAttributes.txt +++ /dev/null @@ -1,21 +0,0 @@ -HTML.ForbiddenAttributes -TYPE: lookup -VERSION: 3.1.0 -DEFAULT: array() ---DESCRIPTION-- -

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

    -

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

    ---# vim: et sw=4 sts=4 diff --git a/main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/HTML.ForbiddenElements.txt b/main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/HTML.ForbiddenElements.txt deleted file mode 100755 index 93a53e14fb..0000000000 --- a/main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/HTML.ForbiddenElements.txt +++ /dev/null @@ -1,20 +0,0 @@ -HTML.ForbiddenElements -TYPE: lookup -VERSION: 3.1.0 -DEFAULT: array() ---DESCRIPTION-- -

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

    -

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

    ---# vim: et sw=4 sts=4 diff --git a/main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/HTML.MaxImgLength.txt b/main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/HTML.MaxImgLength.txt deleted file mode 100755 index e424c386ec..0000000000 --- a/main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/HTML.MaxImgLength.txt +++ /dev/null @@ -1,14 +0,0 @@ -HTML.MaxImgLength -TYPE: int/null -DEFAULT: 1200 -VERSION: 3.1.1 ---DESCRIPTION-- -

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

    ---# vim: et sw=4 sts=4 diff --git a/main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/HTML.Parent.txt b/main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/HTML.Parent.txt deleted file mode 100755 index 62e8e160c7..0000000000 --- a/main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/HTML.Parent.txt +++ /dev/null @@ -1,12 +0,0 @@ -HTML.Parent -TYPE: string -VERSION: 1.3.0 -DEFAULT: 'div' ---DESCRIPTION-- - -

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

    ---# vim: et sw=4 sts=4 diff --git a/main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/HTML.Proprietary.txt b/main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/HTML.Proprietary.txt deleted file mode 100755 index dfb720496d..0000000000 --- a/main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/HTML.Proprietary.txt +++ /dev/null @@ -1,12 +0,0 @@ -HTML.Proprietary -TYPE: bool -VERSION: 3.1.0 -DEFAULT: false ---DESCRIPTION-- -

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

    ---# vim: et sw=4 sts=4 diff --git a/main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/HTML.SafeEmbed.txt b/main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/HTML.SafeEmbed.txt deleted file mode 100755 index cdda09a4c5..0000000000 --- a/main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/HTML.SafeEmbed.txt +++ /dev/null @@ -1,13 +0,0 @@ -HTML.SafeEmbed -TYPE: bool -VERSION: 3.1.1 -DEFAULT: false ---DESCRIPTION-- -

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

    ---# vim: et sw=4 sts=4 diff --git a/main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/HTML.SafeObject.txt b/main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/HTML.SafeObject.txt deleted file mode 100755 index ceb342e22b..0000000000 --- a/main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/HTML.SafeObject.txt +++ /dev/null @@ -1,13 +0,0 @@ -HTML.SafeObject -TYPE: bool -VERSION: 3.1.1 -DEFAULT: false ---DESCRIPTION-- -

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

    ---# vim: et sw=4 sts=4 diff --git a/main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/HTML.Strict.txt b/main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/HTML.Strict.txt deleted file mode 100755 index a8b1de56be..0000000000 --- a/main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/HTML.Strict.txt +++ /dev/null @@ -1,9 +0,0 @@ -HTML.Strict -TYPE: bool -VERSION: 1.3.0 -DEFAULT: false -DEPRECATED-VERSION: 1.7.0 -DEPRECATED-USE: HTML.Doctype ---DESCRIPTION-- -Determines whether or not to use Transitional (loose) or Strict rulesets. ---# vim: et sw=4 sts=4 diff --git a/main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/HTML.TidyAdd.txt b/main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/HTML.TidyAdd.txt deleted file mode 100755 index b4c271b7fa..0000000000 --- a/main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/HTML.TidyAdd.txt +++ /dev/null @@ -1,8 +0,0 @@ -HTML.TidyAdd -TYPE: lookup -VERSION: 2.0.0 -DEFAULT: array() ---DESCRIPTION-- - -Fixes to add to the default set of Tidy fixes as per your level. ---# vim: et sw=4 sts=4 diff --git a/main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/HTML.TidyLevel.txt b/main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/HTML.TidyLevel.txt deleted file mode 100755 index 4186ccd0d1..0000000000 --- a/main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/HTML.TidyLevel.txt +++ /dev/null @@ -1,24 +0,0 @@ -HTML.TidyLevel -TYPE: string -VERSION: 2.0.0 -DEFAULT: 'medium' ---DESCRIPTION-- - -

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

    -
    -
    none
    -
    No extra tidying should be done
    -
    light
    -
    Only fix elements that would be discarded otherwise due to - lack of support in doctype
    -
    medium
    -
    Enforce best practices
    -
    heavy
    -
    Transform all deprecated elements and attributes to standards - compliant equivalents
    -
    - ---ALLOWED-- -'none', 'light', 'medium', 'heavy' ---# vim: et sw=4 sts=4 diff --git a/main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/HTML.TidyRemove.txt b/main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/HTML.TidyRemove.txt deleted file mode 100755 index 996762bd1d..0000000000 --- a/main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/HTML.TidyRemove.txt +++ /dev/null @@ -1,8 +0,0 @@ -HTML.TidyRemove -TYPE: lookup -VERSION: 2.0.0 -DEFAULT: array() ---DESCRIPTION-- - -Fixes to remove from the default set of Tidy fixes as per your level. ---# vim: et sw=4 sts=4 diff --git a/main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/HTML.Trusted.txt b/main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/HTML.Trusted.txt deleted file mode 100755 index 89133b1a38..0000000000 --- a/main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/HTML.Trusted.txt +++ /dev/null @@ -1,8 +0,0 @@ -HTML.Trusted -TYPE: bool -VERSION: 2.0.0 -DEFAULT: false ---DESCRIPTION-- -Indicates whether or not the user input is trusted or not. If the input is -trusted, a more expansive set of allowed tags and attributes will be used. ---# vim: et sw=4 sts=4 diff --git a/main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/HTML.XHTML.txt b/main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/HTML.XHTML.txt deleted file mode 100755 index 2a47e384f4..0000000000 --- a/main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/HTML.XHTML.txt +++ /dev/null @@ -1,11 +0,0 @@ -HTML.XHTML -TYPE: bool -DEFAULT: true -VERSION: 1.1.0 -DEPRECATED-VERSION: 1.7.0 -DEPRECATED-USE: HTML.Doctype ---DESCRIPTION-- -Determines whether or not output is XHTML 1.0 or HTML 4.01 flavor. ---ALIASES-- -Core.XHTML ---# vim: et sw=4 sts=4 diff --git a/main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Output.CommentScriptContents.txt b/main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Output.CommentScriptContents.txt deleted file mode 100755 index 08921fde70..0000000000 --- a/main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Output.CommentScriptContents.txt +++ /dev/null @@ -1,10 +0,0 @@ -Output.CommentScriptContents -TYPE: bool -VERSION: 2.0.0 -DEFAULT: true ---DESCRIPTION-- -Determines whether or not HTML Purifier should attempt to fix up the -contents of script tags for legacy browsers with comments. ---ALIASES-- -Core.CommentScriptContents ---# vim: et sw=4 sts=4 diff --git a/main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Output.FlashCompat.txt b/main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Output.FlashCompat.txt deleted file mode 100755 index 93398e8598..0000000000 --- a/main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Output.FlashCompat.txt +++ /dev/null @@ -1,11 +0,0 @@ -Output.FlashCompat -TYPE: bool -VERSION: 4.1.0 -DEFAULT: false ---DESCRIPTION-- -

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

    ---# vim: et sw=4 sts=4 diff --git a/main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Output.Newline.txt b/main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Output.Newline.txt deleted file mode 100755 index 79f8ad82cf..0000000000 --- a/main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Output.Newline.txt +++ /dev/null @@ -1,13 +0,0 @@ -Output.Newline -TYPE: string/null -VERSION: 2.0.1 -DEFAULT: NULL ---DESCRIPTION-- - -

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

    ---# vim: et sw=4 sts=4 diff --git a/main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Output.SortAttr.txt b/main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Output.SortAttr.txt deleted file mode 100755 index 232b02362a..0000000000 --- a/main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Output.SortAttr.txt +++ /dev/null @@ -1,14 +0,0 @@ -Output.SortAttr -TYPE: bool -VERSION: 3.2.0 -DEFAULT: false ---DESCRIPTION-- -

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

    ---# vim: et sw=4 sts=4 diff --git a/main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Output.TidyFormat.txt b/main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Output.TidyFormat.txt deleted file mode 100755 index 06bab00a0a..0000000000 --- a/main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Output.TidyFormat.txt +++ /dev/null @@ -1,25 +0,0 @@ -Output.TidyFormat -TYPE: bool -VERSION: 1.1.1 -DEFAULT: false ---DESCRIPTION-- -

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

    -

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

    -

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

    ---ALIASES-- -Core.TidyFormat ---# vim: et sw=4 sts=4 diff --git a/main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Test.ForceNoIconv.txt b/main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Test.ForceNoIconv.txt deleted file mode 100755 index 071bc0295d..0000000000 --- a/main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Test.ForceNoIconv.txt +++ /dev/null @@ -1,7 +0,0 @@ -Test.ForceNoIconv -TYPE: bool -DEFAULT: false ---DESCRIPTION-- -When set to true, HTMLPurifier_Encoder will act as if iconv does not exist -and use only pure PHP implementations. ---# vim: et sw=4 sts=4 diff --git a/main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/URI.AllowedSchemes.txt b/main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/URI.AllowedSchemes.txt deleted file mode 100755 index 47714f5d26..0000000000 --- a/main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/URI.AllowedSchemes.txt +++ /dev/null @@ -1,17 +0,0 @@ -URI.AllowedSchemes -TYPE: lookup ---DEFAULT-- -array ( - 'http' => true, - 'https' => true, - 'mailto' => true, - 'ftp' => true, - 'nntp' => true, - 'news' => true, -) ---DESCRIPTION-- -Whitelist that defines the schemes that a URI is allowed to have. This -prevents XSS attacks from using pseudo-schemes like javascript or mocha. -There is also support for the data and file -URI schemes, but they are not enabled by default. ---# vim: et sw=4 sts=4 diff --git a/main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/URI.Base.txt b/main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/URI.Base.txt deleted file mode 100755 index 876f0680cf..0000000000 --- a/main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/URI.Base.txt +++ /dev/null @@ -1,17 +0,0 @@ -URI.Base -TYPE: string/null -VERSION: 2.1.0 -DEFAULT: NULL ---DESCRIPTION-- - -

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

    ---# vim: et sw=4 sts=4 diff --git a/main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/URI.DefaultScheme.txt b/main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/URI.DefaultScheme.txt deleted file mode 100755 index 728e378cbe..0000000000 --- a/main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/URI.DefaultScheme.txt +++ /dev/null @@ -1,10 +0,0 @@ -URI.DefaultScheme -TYPE: string -DEFAULT: 'http' ---DESCRIPTION-- - -

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

    ---# vim: et sw=4 sts=4 diff --git a/main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/URI.DefinitionID.txt b/main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/URI.DefinitionID.txt deleted file mode 100755 index f05312ba86..0000000000 --- a/main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/URI.DefinitionID.txt +++ /dev/null @@ -1,11 +0,0 @@ -URI.DefinitionID -TYPE: string/null -VERSION: 2.1.0 -DEFAULT: NULL ---DESCRIPTION-- - -

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

    ---# vim: et sw=4 sts=4 diff --git a/main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/URI.DefinitionRev.txt b/main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/URI.DefinitionRev.txt deleted file mode 100755 index 80cfea93f7..0000000000 --- a/main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/URI.DefinitionRev.txt +++ /dev/null @@ -1,11 +0,0 @@ -URI.DefinitionRev -TYPE: int -VERSION: 2.1.0 -DEFAULT: 1 ---DESCRIPTION-- - -

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

    ---# vim: et sw=4 sts=4 diff --git a/main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/URI.Disable.txt b/main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/URI.Disable.txt deleted file mode 100755 index 71ce025a2d..0000000000 --- a/main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/URI.Disable.txt +++ /dev/null @@ -1,14 +0,0 @@ -URI.Disable -TYPE: bool -VERSION: 1.3.0 -DEFAULT: false ---DESCRIPTION-- - -

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

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

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

    -

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

    ---# vim: et sw=4 sts=4 diff --git a/main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/URI.Host.txt b/main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/URI.Host.txt deleted file mode 100755 index ee83b121de..0000000000 --- a/main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/URI.Host.txt +++ /dev/null @@ -1,19 +0,0 @@ -URI.Host -TYPE: string/null -VERSION: 1.2.0 -DEFAULT: NULL ---DESCRIPTION-- - -

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

    ---# vim: et sw=4 sts=4 diff --git a/main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/URI.HostBlacklist.txt b/main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/URI.HostBlacklist.txt deleted file mode 100755 index 0b6df7625d..0000000000 --- a/main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/URI.HostBlacklist.txt +++ /dev/null @@ -1,9 +0,0 @@ -URI.HostBlacklist -TYPE: list -VERSION: 1.3.0 -DEFAULT: array() ---DESCRIPTION-- -List of strings that are forbidden in the host of any URI. Use it to kill -domain names of spam, etc. Note that it will catch anything in the domain, -so moo.com will catch moo.com.example.com. ---# vim: et sw=4 sts=4 diff --git a/main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/URI.MakeAbsolute.txt b/main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/URI.MakeAbsolute.txt deleted file mode 100755 index 4214900a59..0000000000 --- a/main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/URI.MakeAbsolute.txt +++ /dev/null @@ -1,13 +0,0 @@ -URI.MakeAbsolute -TYPE: bool -VERSION: 2.1.0 -DEFAULT: false ---DESCRIPTION-- - -

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

    ---# vim: et sw=4 sts=4 diff --git a/main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/URI.Munge.txt b/main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/URI.Munge.txt deleted file mode 100755 index 58c81dcc44..0000000000 --- a/main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/URI.Munge.txt +++ /dev/null @@ -1,83 +0,0 @@ -URI.Munge -TYPE: string/null -VERSION: 1.3.0 -DEFAULT: NULL ---DESCRIPTION-- - -

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

    -

    - Uses for this directive: -

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

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

    -

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

    -

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

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

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

    ---# vim: et sw=4 sts=4 diff --git a/main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/URI.MungeResources.txt b/main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/URI.MungeResources.txt deleted file mode 100755 index 6fce0fdc37..0000000000 --- a/main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/URI.MungeResources.txt +++ /dev/null @@ -1,17 +0,0 @@ -URI.MungeResources -TYPE: bool -VERSION: 3.1.1 -DEFAULT: false ---DESCRIPTION-- -

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

    -

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

    ---# vim: et sw=4 sts=4 diff --git a/main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/URI.MungeSecretKey.txt b/main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/URI.MungeSecretKey.txt deleted file mode 100755 index 0d00f62ea8..0000000000 --- a/main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/URI.MungeSecretKey.txt +++ /dev/null @@ -1,30 +0,0 @@ -URI.MungeSecretKey -TYPE: string/null -VERSION: 3.1.1 -DEFAULT: NULL ---DESCRIPTION-- -

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

    - -
    $checksum === sha1($secret_key . ':' . $url)
    - -

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

    - -

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

    - -

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

    ---# vim: et sw=4 sts=4 diff --git a/main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/URI.OverrideAllowedSchemes.txt b/main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/URI.OverrideAllowedSchemes.txt deleted file mode 100755 index 23331a4e79..0000000000 --- a/main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/URI.OverrideAllowedSchemes.txt +++ /dev/null @@ -1,9 +0,0 @@ -URI.OverrideAllowedSchemes -TYPE: bool -DEFAULT: true ---DESCRIPTION-- -If this is set to true (which it is by default), you can override -%URI.AllowedSchemes by simply registering a HTMLPurifier_URIScheme to the -registry. If false, you will also have to update that directive in order -to add more schemes. ---# vim: et sw=4 sts=4 diff --git a/main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/index.html b/main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/index.html deleted file mode 100755 index aa7b9c934b..0000000000 --- a/main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/index.html +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/info.ini b/main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/info.ini deleted file mode 100755 index 5de4505e1b..0000000000 --- a/main/inc/lib/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/info.ini +++ /dev/null @@ -1,3 +0,0 @@ -name = "HTML Purifier" - -; vim: et sw=4 sts=4 diff --git a/main/inc/lib/htmlpurifier/library/HTMLPurifier/ContentSets.php b/main/inc/lib/htmlpurifier/library/HTMLPurifier/ContentSets.php deleted file mode 100755 index 3b6e96f5f5..0000000000 --- a/main/inc/lib/htmlpurifier/library/HTMLPurifier/ContentSets.php +++ /dev/null @@ -1,155 +0,0 @@ - true) indexed by name. - * @note This is in HTMLPurifier_HTMLDefinition->info_content_sets - */ - public $lookup = array(); - - /** - * Synchronized list of defined content sets (keys of info) - */ - protected $keys = array(); - /** - * Synchronized list of defined content values (values of info) - */ - protected $values = array(); - - /** - * Merges in module's content sets, expands identifiers in the content - * sets and populates the keys, values and lookup member variables. - * @param $modules List of HTMLPurifier_HTMLModule - */ - public function __construct($modules) { - if (!is_array($modules)) $modules = array($modules); - // populate content_sets based on module hints - // sorry, no way of overloading - foreach ($modules as $module_i => $module) { - foreach ($module->content_sets as $key => $value) { - $temp = $this->convertToLookup($value); - if (isset($this->lookup[$key])) { - // add it into the existing content set - $this->lookup[$key] = array_merge($this->lookup[$key], $temp); - } else { - $this->lookup[$key] = $temp; - } - } - } - $old_lookup = false; - while ($old_lookup !== $this->lookup) { - $old_lookup = $this->lookup; - foreach ($this->lookup as $i => $set) { - $add = array(); - foreach ($set as $element => $x) { - if (isset($this->lookup[$element])) { - $add += $this->lookup[$element]; - unset($this->lookup[$i][$element]); - } - } - $this->lookup[$i] += $add; - } - } - - foreach ($this->lookup as $key => $lookup) { - $this->info[$key] = implode(' | ', array_keys($lookup)); - } - $this->keys = array_keys($this->info); - $this->values = array_values($this->info); - } - - /** - * Accepts a definition; generates and assigns a ChildDef for it - * @param $def HTMLPurifier_ElementDef reference - * @param $module Module that defined the ElementDef - */ - public function generateChildDef(&$def, $module) { - if (!empty($def->child)) return; // already done! - $content_model = $def->content_model; - if (is_string($content_model)) { - // Assume that $this->keys is alphanumeric - $def->content_model = preg_replace_callback( - '/\b(' . implode('|', $this->keys) . ')\b/', - array($this, 'generateChildDefCallback'), - $content_model - ); - //$def->content_model = str_replace( - // $this->keys, $this->values, $content_model); - } - $def->child = $this->getChildDef($def, $module); - } - - public function generateChildDefCallback($matches) { - return $this->info[$matches[0]]; - } - - /** - * Instantiates a ChildDef based on content_model and content_model_type - * member variables in HTMLPurifier_ElementDef - * @note This will also defer to modules for custom HTMLPurifier_ChildDef - * subclasses that need content set expansion - * @param $def HTMLPurifier_ElementDef to have ChildDef extracted - * @return HTMLPurifier_ChildDef corresponding to ElementDef - */ - public function getChildDef($def, $module) { - $value = $def->content_model; - if (is_object($value)) { - trigger_error( - 'Literal object child definitions should be stored in '. - 'ElementDef->child not ElementDef->content_model', - E_USER_NOTICE - ); - return $value; - } - switch ($def->content_model_type) { - case 'required': - return new HTMLPurifier_ChildDef_Required($value); - case 'optional': - return new HTMLPurifier_ChildDef_Optional($value); - case 'empty': - return new HTMLPurifier_ChildDef_Empty(); - case 'custom': - return new HTMLPurifier_ChildDef_Custom($value); - } - // defer to its module - $return = false; - if ($module->defines_child_def) { // save a func call - $return = $module->getChildDef($def); - } - if ($return !== false) return $return; - // error-out - trigger_error( - 'Could not determine which ChildDef class to instantiate', - E_USER_ERROR - ); - return false; - } - - /** - * Converts a string list of elements separated by pipes into - * a lookup array. - * @param $string List of elements - * @return Lookup array of elements - */ - protected function convertToLookup($string) { - $array = explode('|', str_replace(' ', '', $string)); - $ret = array(); - foreach ($array as $i => $k) { - $ret[$k] = true; - } - return $ret; - } - -} - -// vim: et sw=4 sts=4 diff --git a/main/inc/lib/htmlpurifier/library/HTMLPurifier/Context.php b/main/inc/lib/htmlpurifier/library/HTMLPurifier/Context.php deleted file mode 100755 index 9ddf0c5476..0000000000 --- a/main/inc/lib/htmlpurifier/library/HTMLPurifier/Context.php +++ /dev/null @@ -1,82 +0,0 @@ -_storage[$name])) { - trigger_error("Name $name produces collision, cannot re-register", - E_USER_ERROR); - return; - } - $this->_storage[$name] =& $ref; - } - - /** - * Retrieves a variable reference from the context. - * @param $name String name - * @param $ignore_error Boolean whether or not to ignore error - */ - public function &get($name, $ignore_error = false) { - if (!isset($this->_storage[$name])) { - if (!$ignore_error) { - trigger_error("Attempted to retrieve non-existent variable $name", - E_USER_ERROR); - } - $var = null; // so we can return by reference - return $var; - } - return $this->_storage[$name]; - } - - /** - * Destorys a variable in the context. - * @param $name String name - */ - public function destroy($name) { - if (!isset($this->_storage[$name])) { - trigger_error("Attempted to destroy non-existent variable $name", - E_USER_ERROR); - return; - } - unset($this->_storage[$name]); - } - - /** - * Checks whether or not the variable exists. - * @param $name String name - */ - public function exists($name) { - return isset($this->_storage[$name]); - } - - /** - * Loads a series of variables from an associative array - * @param $context_array Assoc array of variables to load - */ - public function loadArray($context_array) { - foreach ($context_array as $key => $discard) { - $this->register($key, $context_array[$key]); - } - } - -} - -// vim: et sw=4 sts=4 diff --git a/main/inc/lib/htmlpurifier/library/HTMLPurifier/Definition.php b/main/inc/lib/htmlpurifier/library/HTMLPurifier/Definition.php deleted file mode 100755 index c7f82eba43..0000000000 --- a/main/inc/lib/htmlpurifier/library/HTMLPurifier/Definition.php +++ /dev/null @@ -1,50 +0,0 @@ -setup) return; - $this->setup = true; - $this->doSetup($config); - } - -} - -// vim: et sw=4 sts=4 diff --git a/main/inc/lib/htmlpurifier/library/HTMLPurifier/DefinitionCache.php b/main/inc/lib/htmlpurifier/library/HTMLPurifier/DefinitionCache.php deleted file mode 100755 index c6e1e388c6..0000000000 --- a/main/inc/lib/htmlpurifier/library/HTMLPurifier/DefinitionCache.php +++ /dev/null @@ -1,108 +0,0 @@ -type = $type; - } - - /** - * Generates a unique identifier for a particular configuration - * @param Instance of HTMLPurifier_Config - */ - public function generateKey($config) { - return $config->version . ',' . // possibly replace with function calls - $config->getBatchSerial($this->type) . ',' . - $config->get($this->type . '.DefinitionRev'); - } - - /** - * Tests whether or not a key is old with respect to the configuration's - * version and revision number. - * @param $key Key to test - * @param $config Instance of HTMLPurifier_Config to test against - */ - public function isOld($key, $config) { - if (substr_count($key, ',') < 2) return true; - list($version, $hash, $revision) = explode(',', $key, 3); - $compare = version_compare($version, $config->version); - // version mismatch, is always old - if ($compare != 0) return true; - // versions match, ids match, check revision number - if ( - $hash == $config->getBatchSerial($this->type) && - $revision < $config->get($this->type . '.DefinitionRev') - ) return true; - return false; - } - - /** - * Checks if a definition's type jives with the cache's type - * @note Throws an error on failure - * @param $def Definition object to check - * @return Boolean true if good, false if not - */ - public function checkDefType($def) { - if ($def->type !== $this->type) { - trigger_error("Cannot use definition of type {$def->type} in cache for {$this->type}"); - return false; - } - return true; - } - - /** - * Adds a definition object to the cache - */ - abstract public function add($def, $config); - - /** - * Unconditionally saves a definition object to the cache - */ - abstract public function set($def, $config); - - /** - * Replace an object in the cache - */ - abstract public function replace($def, $config); - - /** - * Retrieves a definition object from the cache - */ - abstract public function get($config); - - /** - * Removes a definition object to the cache - */ - abstract public function remove($config); - - /** - * Clears all objects from cache - */ - abstract public function flush($config); - - /** - * Clears all expired (older version or revision) objects from cache - * @note Be carefuly implementing this method as flush. Flush must - * not interfere with other Definition types, and cleanup() - * should not be repeatedly called by userland code. - */ - abstract public function cleanup($config); - -} - -// vim: et sw=4 sts=4 diff --git a/main/inc/lib/htmlpurifier/library/HTMLPurifier/DefinitionCache/Decorator.php b/main/inc/lib/htmlpurifier/library/HTMLPurifier/DefinitionCache/Decorator.php deleted file mode 100755 index b0fb6d0cd6..0000000000 --- a/main/inc/lib/htmlpurifier/library/HTMLPurifier/DefinitionCache/Decorator.php +++ /dev/null @@ -1,62 +0,0 @@ -copy(); - // reference is necessary for mocks in PHP 4 - $decorator->cache =& $cache; - $decorator->type = $cache->type; - return $decorator; - } - - /** - * Cross-compatible clone substitute - */ - public function copy() { - return new HTMLPurifier_DefinitionCache_Decorator(); - } - - public function add($def, $config) { - return $this->cache->add($def, $config); - } - - public function set($def, $config) { - return $this->cache->set($def, $config); - } - - public function replace($def, $config) { - return $this->cache->replace($def, $config); - } - - public function get($config) { - return $this->cache->get($config); - } - - public function remove($config) { - return $this->cache->remove($config); - } - - public function flush($config) { - return $this->cache->flush($config); - } - - public function cleanup($config) { - return $this->cache->cleanup($config); - } - -} - -// vim: et sw=4 sts=4 diff --git a/main/inc/lib/htmlpurifier/library/HTMLPurifier/DefinitionCache/Decorator/Cleanup.php b/main/inc/lib/htmlpurifier/library/HTMLPurifier/DefinitionCache/Decorator/Cleanup.php deleted file mode 100755 index d4cc35c4bc..0000000000 --- a/main/inc/lib/htmlpurifier/library/HTMLPurifier/DefinitionCache/Decorator/Cleanup.php +++ /dev/null @@ -1,43 +0,0 @@ -definitions[$this->generateKey($config)] = $def; - return $status; - } - - public function set($def, $config) { - $status = parent::set($def, $config); - if ($status) $this->definitions[$this->generateKey($config)] = $def; - return $status; - } - - public function replace($def, $config) { - $status = parent::replace($def, $config); - if ($status) $this->definitions[$this->generateKey($config)] = $def; - return $status; - } - - public function get($config) { - $key = $this->generateKey($config); - if (isset($this->definitions[$key])) return $this->definitions[$key]; - $this->definitions[$key] = parent::get($config); - return $this->definitions[$key]; - } - -} - -// vim: et sw=4 sts=4 diff --git a/main/inc/lib/htmlpurifier/library/HTMLPurifier/DefinitionCache/Decorator/Template.php.in b/main/inc/lib/htmlpurifier/library/HTMLPurifier/DefinitionCache/Decorator/Template.php.in deleted file mode 100755 index 21a8fcfda2..0000000000 --- a/main/inc/lib/htmlpurifier/library/HTMLPurifier/DefinitionCache/Decorator/Template.php.in +++ /dev/null @@ -1,47 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/main/inc/lib/htmlpurifier/library/HTMLPurifier/DefinitionCache/Null.php b/main/inc/lib/htmlpurifier/library/HTMLPurifier/DefinitionCache/Null.php deleted file mode 100755 index 41d97e734f..0000000000 --- a/main/inc/lib/htmlpurifier/library/HTMLPurifier/DefinitionCache/Null.php +++ /dev/null @@ -1,39 +0,0 @@ -checkDefType($def)) return; - $file = $this->generateFilePath($config); - if (file_exists($file)) return false; - if (!$this->_prepareDir($config)) return false; - return $this->_write($file, serialize($def)); - } - - public function set($def, $config) { - if (!$this->checkDefType($def)) return; - $file = $this->generateFilePath($config); - if (!$this->_prepareDir($config)) return false; - return $this->_write($file, serialize($def)); - } - - public function replace($def, $config) { - if (!$this->checkDefType($def)) return; - $file = $this->generateFilePath($config); - if (!file_exists($file)) return false; - if (!$this->_prepareDir($config)) return false; - return $this->_write($file, serialize($def)); - } - - public function get($config) { - $file = $this->generateFilePath($config); - if (!file_exists($file)) return false; - return unserialize(file_get_contents($file)); - } - - public function remove($config) { - $file = $this->generateFilePath($config); - if (!file_exists($file)) return false; - return unlink($file); - } - - public function flush($config) { - if (!$this->_prepareDir($config)) return false; - $dir = $this->generateDirectoryPath($config); - $dh = opendir($dir); - while (false !== ($filename = readdir($dh))) { - if (empty($filename)) continue; - if ($filename[0] === '.') continue; - unlink($dir . '/' . $filename); - } - } - - public function cleanup($config) { - if (!$this->_prepareDir($config)) return false; - $dir = $this->generateDirectoryPath($config); - $dh = opendir($dir); - while (false !== ($filename = readdir($dh))) { - if (empty($filename)) continue; - if ($filename[0] === '.') continue; - $key = substr($filename, 0, strlen($filename) - 4); - if ($this->isOld($key, $config)) unlink($dir . '/' . $filename); - } - } - - /** - * Generates the file path to the serial file corresponding to - * the configuration and definition name - * @todo Make protected - */ - public function generateFilePath($config) { - $key = $this->generateKey($config); - return $this->generateDirectoryPath($config) . '/' . $key . '.ser'; - } - - /** - * Generates the path to the directory contain this cache's serial files - * @note No trailing slash - * @todo Make protected - */ - public function generateDirectoryPath($config) { - $base = $this->generateBaseDirectoryPath($config); - return $base . '/' . $this->type; - } - - /** - * Generates path to base directory that contains all definition type - * serials - * @todo Make protected - */ - public function generateBaseDirectoryPath($config) { - $base = $config->get('Cache.SerializerPath'); - $base = is_null($base) ? HTMLPURIFIER_PREFIX . '/HTMLPurifier/DefinitionCache/Serializer' : $base; - return $base; - } - - /** - * Convenience wrapper function for file_put_contents - * @param $file File name to write to - * @param $data Data to write into file - * @return Number of bytes written if success, or false if failure. - */ - private function _write($file, $data) { - return file_put_contents($file, $data); - } - - /** - * Prepares the directory that this type stores the serials in - * @return True if successful - */ - private function _prepareDir($config) { - $directory = $this->generateDirectoryPath($config); - if (!is_dir($directory)) { - $base = $this->generateBaseDirectoryPath($config); - if (!is_dir($base)) { - trigger_error('Base directory '.$base.' does not exist, - please create or change using %Cache.SerializerPath', - E_USER_WARNING); - return false; - } elseif (!$this->_testPermissions($base)) { - return false; - } - $old = umask(0022); // disable group and world writes - mkdir($directory); - umask($old); - } elseif (!$this->_testPermissions($directory)) { - return false; - } - return true; - } - - /** - * Tests permissions on a directory and throws out friendly - * error messages and attempts to chmod it itself if possible - */ - private function _testPermissions($dir) { - // early abort, if it is writable, everything is hunky-dory - if (is_writable($dir)) return true; - if (!is_dir($dir)) { - // generally, you'll want to handle this beforehand - // so a more specific error message can be given - trigger_error('Directory '.$dir.' does not exist', - E_USER_WARNING); - return false; - } - if (function_exists('posix_getuid')) { - // POSIX system, we can give more specific advice - if (fileowner($dir) === posix_getuid()) { - // we can chmod it ourselves - chmod($dir, 0755); - return true; - } elseif (filegroup($dir) === posix_getgid()) { - $chmod = '775'; - } else { - // PHP's probably running as nobody, so we'll - // need to give global permissions - $chmod = '777'; - } - trigger_error('Directory '.$dir.' not writable, '. - 'please chmod to ' . $chmod, - E_USER_WARNING); - } else { - // generic error message - trigger_error('Directory '.$dir.' not writable, '. - 'please alter file permissions', - E_USER_WARNING); - } - return false; - } - -} - -// vim: et sw=4 sts=4 diff --git a/main/inc/lib/htmlpurifier/library/HTMLPurifier/DefinitionCache/Serializer/README b/main/inc/lib/htmlpurifier/library/HTMLPurifier/DefinitionCache/Serializer/README deleted file mode 100755 index 2e35c1c3d0..0000000000 --- a/main/inc/lib/htmlpurifier/library/HTMLPurifier/DefinitionCache/Serializer/README +++ /dev/null @@ -1,3 +0,0 @@ -This is a dummy file to prevent Git from ignoring this empty directory. - - vim: et sw=4 sts=4 diff --git a/main/inc/lib/htmlpurifier/library/HTMLPurifier/DefinitionCache/Serializer/index.html b/main/inc/lib/htmlpurifier/library/HTMLPurifier/DefinitionCache/Serializer/index.html deleted file mode 100755 index aa7b9c934b..0000000000 --- a/main/inc/lib/htmlpurifier/library/HTMLPurifier/DefinitionCache/Serializer/index.html +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/main/inc/lib/htmlpurifier/library/HTMLPurifier/DefinitionCache/index.html b/main/inc/lib/htmlpurifier/library/HTMLPurifier/DefinitionCache/index.html deleted file mode 100755 index aa7b9c934b..0000000000 --- a/main/inc/lib/htmlpurifier/library/HTMLPurifier/DefinitionCache/index.html +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/main/inc/lib/htmlpurifier/library/HTMLPurifier/DefinitionCacheFactory.php b/main/inc/lib/htmlpurifier/library/HTMLPurifier/DefinitionCacheFactory.php deleted file mode 100755 index a6ead62818..0000000000 --- a/main/inc/lib/htmlpurifier/library/HTMLPurifier/DefinitionCacheFactory.php +++ /dev/null @@ -1,91 +0,0 @@ - array()); - protected $implementations = array(); - protected $decorators = array(); - - /** - * Initialize default decorators - */ - public function setup() { - $this->addDecorator('Cleanup'); - } - - /** - * Retrieves an instance of global definition cache factory. - */ - public static function instance($prototype = null) { - static $instance; - if ($prototype !== null) { - $instance = $prototype; - } elseif ($instance === null || $prototype === true) { - $instance = new HTMLPurifier_DefinitionCacheFactory(); - $instance->setup(); - } - return $instance; - } - - /** - * Registers a new definition cache object - * @param $short Short name of cache object, for reference - * @param $long Full class name of cache object, for construction - */ - public function register($short, $long) { - $this->implementations[$short] = $long; - } - - /** - * Factory method that creates a cache object based on configuration - * @param $name Name of definitions handled by cache - * @param $config Instance of HTMLPurifier_Config - */ - public function create($type, $config) { - $method = $config->get('Cache.DefinitionImpl'); - if ($method === null) { - return new HTMLPurifier_DefinitionCache_Null($type); - } - if (!empty($this->caches[$method][$type])) { - return $this->caches[$method][$type]; - } - if ( - isset($this->implementations[$method]) && - class_exists($class = $this->implementations[$method], false) - ) { - $cache = new $class($type); - } else { - if ($method != 'Serializer') { - trigger_error("Unrecognized DefinitionCache $method, using Serializer instead", E_USER_WARNING); - } - $cache = new HTMLPurifier_DefinitionCache_Serializer($type); - } - foreach ($this->decorators as $decorator) { - $new_cache = $decorator->decorate($cache); - // prevent infinite recursion in PHP 4 - unset($cache); - $cache = $new_cache; - } - $this->caches[$method][$type] = $cache; - return $this->caches[$method][$type]; - } - - /** - * Registers a decorator to add to all new cache objects - * @param - */ - public function addDecorator($decorator) { - if (is_string($decorator)) { - $class = "HTMLPurifier_DefinitionCache_Decorator_$decorator"; - $decorator = new $class; - } - $this->decorators[$decorator->name] = $decorator; - } - -} - -// vim: et sw=4 sts=4 diff --git a/main/inc/lib/htmlpurifier/library/HTMLPurifier/Doctype.php b/main/inc/lib/htmlpurifier/library/HTMLPurifier/Doctype.php deleted file mode 100755 index 1e3c574c06..0000000000 --- a/main/inc/lib/htmlpurifier/library/HTMLPurifier/Doctype.php +++ /dev/null @@ -1,60 +0,0 @@ -renderDoctype. - * If structure changes, please update that function. - */ -class HTMLPurifier_Doctype -{ - /** - * Full name of doctype - */ - public $name; - - /** - * List of standard modules (string identifiers or literal objects) - * that this doctype uses - */ - public $modules = array(); - - /** - * List of modules to use for tidying up code - */ - public $tidyModules = array(); - - /** - * Is the language derived from XML (i.e. XHTML)? - */ - public $xml = true; - - /** - * List of aliases for this doctype - */ - public $aliases = array(); - - /** - * Public DTD identifier - */ - public $dtdPublic; - - /** - * System DTD identifier - */ - public $dtdSystem; - - public function __construct($name = null, $xml = true, $modules = array(), - $tidyModules = array(), $aliases = array(), $dtd_public = null, $dtd_system = null - ) { - $this->name = $name; - $this->xml = $xml; - $this->modules = $modules; - $this->tidyModules = $tidyModules; - $this->aliases = $aliases; - $this->dtdPublic = $dtd_public; - $this->dtdSystem = $dtd_system; - } -} - -// vim: et sw=4 sts=4 diff --git a/main/inc/lib/htmlpurifier/library/HTMLPurifier/DoctypeRegistry.php b/main/inc/lib/htmlpurifier/library/HTMLPurifier/DoctypeRegistry.php deleted file mode 100755 index 86049e9391..0000000000 --- a/main/inc/lib/htmlpurifier/library/HTMLPurifier/DoctypeRegistry.php +++ /dev/null @@ -1,103 +0,0 @@ -doctypes[$doctype->name] = $doctype; - $name = $doctype->name; - // hookup aliases - foreach ($doctype->aliases as $alias) { - if (isset($this->doctypes[$alias])) continue; - $this->aliases[$alias] = $name; - } - // remove old aliases - if (isset($this->aliases[$name])) unset($this->aliases[$name]); - return $doctype; - } - - /** - * Retrieves reference to a doctype of a certain name - * @note This function resolves aliases - * @note When possible, use the more fully-featured make() - * @param $doctype Name of doctype - * @return Editable doctype object - */ - public function get($doctype) { - if (isset($this->aliases[$doctype])) $doctype = $this->aliases[$doctype]; - if (!isset($this->doctypes[$doctype])) { - trigger_error('Doctype ' . htmlspecialchars($doctype) . ' does not exist', E_USER_ERROR); - $anon = new HTMLPurifier_Doctype($doctype); - return $anon; - } - return $this->doctypes[$doctype]; - } - - /** - * Creates a doctype based on a configuration object, - * will perform initialization on the doctype - * @note Use this function to get a copy of doctype that config - * can hold on to (this is necessary in order to tell - * Generator whether or not the current document is XML - * based or not). - */ - public function make($config) { - return clone $this->get($this->getDoctypeFromConfig($config)); - } - - /** - * Retrieves the doctype from the configuration object - */ - public function getDoctypeFromConfig($config) { - // recommended test - $doctype = $config->get('HTML.Doctype'); - if (!empty($doctype)) return $doctype; - $doctype = $config->get('HTML.CustomDoctype'); - if (!empty($doctype)) return $doctype; - // backwards-compatibility - if ($config->get('HTML.XHTML')) { - $doctype = 'XHTML 1.0'; - } else { - $doctype = 'HTML 4.01'; - } - if ($config->get('HTML.Strict')) { - $doctype .= ' Strict'; - } else { - $doctype .= ' Transitional'; - } - return $doctype; - } - -} - -// vim: et sw=4 sts=4 diff --git a/main/inc/lib/htmlpurifier/library/HTMLPurifier/ElementDef.php b/main/inc/lib/htmlpurifier/library/HTMLPurifier/ElementDef.php deleted file mode 100755 index 5498d95670..0000000000 --- a/main/inc/lib/htmlpurifier/library/HTMLPurifier/ElementDef.php +++ /dev/null @@ -1,183 +0,0 @@ -setup(), this array may also - * contain an array at index 0 that indicates which attribute - * collections to load into the full array. It may also - * contain string indentifiers in lieu of HTMLPurifier_AttrDef, - * see HTMLPurifier_AttrTypes on how they are expanded during - * HTMLPurifier_HTMLDefinition->setup() processing. - */ - public $attr = array(); - - /** - * Indexed list of tag's HTMLPurifier_AttrTransform to be done before validation - */ - public $attr_transform_pre = array(); - - /** - * Indexed list of tag's HTMLPurifier_AttrTransform to be done after validation - */ - public $attr_transform_post = array(); - - /** - * HTMLPurifier_ChildDef of this tag. - */ - public $child; - - /** - * Abstract string representation of internal ChildDef rules. See - * HTMLPurifier_ContentSets for how this is parsed and then transformed - * into an HTMLPurifier_ChildDef. - * @warning This is a temporary variable that is not available after - * being processed by HTMLDefinition - */ - public $content_model; - - /** - * Value of $child->type, used to determine which ChildDef to use, - * used in combination with $content_model. - * @warning This must be lowercase - * @warning This is a temporary variable that is not available after - * being processed by HTMLDefinition - */ - public $content_model_type; - - - - /** - * Does the element have a content model (#PCDATA | Inline)*? This - * is important for chameleon ins and del processing in - * HTMLPurifier_ChildDef_Chameleon. Dynamically set: modules don't - * have to worry about this one. - */ - public $descendants_are_inline = false; - - /** - * List of the names of required attributes this element has. Dynamically - * populated by HTMLPurifier_HTMLDefinition::getElement - */ - public $required_attr = array(); - - /** - * Lookup table of tags excluded from all descendants of this tag. - * @note SGML permits exclusions for all descendants, but this is - * not possible with DTDs or XML Schemas. W3C has elected to - * use complicated compositions of content_models to simulate - * exclusion for children, but we go the simpler, SGML-style - * route of flat-out exclusions, which correctly apply to - * all descendants and not just children. Note that the XHTML - * Modularization Abstract Modules are blithely unaware of such - * distinctions. - */ - public $excludes = array(); - - /** - * This tag is explicitly auto-closed by the following tags. - */ - public $autoclose = array(); - - /** - * If a foreign element is found in this element, test if it is - * allowed by this sub-element; if it is, instead of closing the - * current element, place it inside this element. - */ - public $wrap; - - /** - * Whether or not this is a formatting element affected by the - * "Active Formatting Elements" algorithm. - */ - public $formatting; - - /** - * Low-level factory constructor for creating new standalone element defs - */ - public static function create($content_model, $content_model_type, $attr) { - $def = new HTMLPurifier_ElementDef(); - $def->content_model = $content_model; - $def->content_model_type = $content_model_type; - $def->attr = $attr; - return $def; - } - - /** - * Merges the values of another element definition into this one. - * Values from the new element def take precedence if a value is - * not mergeable. - */ - public function mergeIn($def) { - - // later keys takes precedence - foreach($def->attr as $k => $v) { - if ($k === 0) { - // merge in the includes - // sorry, no way to override an include - foreach ($v as $v2) { - $this->attr[0][] = $v2; - } - continue; - } - if ($v === false) { - if (isset($this->attr[$k])) unset($this->attr[$k]); - continue; - } - $this->attr[$k] = $v; - } - $this->_mergeAssocArray($this->attr_transform_pre, $def->attr_transform_pre); - $this->_mergeAssocArray($this->attr_transform_post, $def->attr_transform_post); - $this->_mergeAssocArray($this->excludes, $def->excludes); - - if(!empty($def->content_model)) { - $this->content_model = - str_replace("#SUPER", $this->content_model, $def->content_model); - $this->child = false; - } - if(!empty($def->content_model_type)) { - $this->content_model_type = $def->content_model_type; - $this->child = false; - } - if(!is_null($def->child)) $this->child = $def->child; - if(!is_null($def->formatting)) $this->formatting = $def->formatting; - if($def->descendants_are_inline) $this->descendants_are_inline = $def->descendants_are_inline; - - } - - /** - * Merges one array into another, removes values which equal false - * @param $a1 Array by reference that is merged into - * @param $a2 Array that merges into $a1 - */ - private function _mergeAssocArray(&$a1, $a2) { - foreach ($a2 as $k => $v) { - if ($v === false) { - if (isset($a1[$k])) unset($a1[$k]); - continue; - } - $a1[$k] = $v; - } - } - -} - -// vim: et sw=4 sts=4 diff --git a/main/inc/lib/htmlpurifier/library/HTMLPurifier/Encoder.php b/main/inc/lib/htmlpurifier/library/HTMLPurifier/Encoder.php deleted file mode 100755 index cc028788b5..0000000000 --- a/main/inc/lib/htmlpurifier/library/HTMLPurifier/Encoder.php +++ /dev/null @@ -1,448 +0,0 @@ - under the - * LGPL license. Notes on what changed are inside, but in general, - * the original code transformed UTF-8 text into an array of integer - * Unicode codepoints. Understandably, transforming that back to - * a string would be somewhat expensive, so the function was modded to - * directly operate on the string. However, this discourages code - * reuse, and the logic enumerated here would be useful for any - * function that needs to be able to understand UTF-8 characters. - * As of right now, only smart lossless character encoding converters - * would need that, and I'm probably not going to implement them. - * Once again, PHP 6 should solve all our problems. - */ - public static function cleanUTF8($str, $force_php = false) { - - // UTF-8 validity is checked since PHP 4.3.5 - // This is an optimization: if the string is already valid UTF-8, no - // need to do PHP stuff. 99% of the time, this will be the case. - // The regexp matches the XML char production, as well as well as excluding - // non-SGML codepoints U+007F to U+009F - if (preg_match('/^[\x{9}\x{A}\x{D}\x{20}-\x{7E}\x{A0}-\x{D7FF}\x{E000}-\x{FFFD}\x{10000}-\x{10FFFF}]*$/Du', $str)) { - return $str; - } - - $mState = 0; // cached expected number of octets after the current octet - // until the beginning of the next UTF8 character sequence - $mUcs4 = 0; // cached Unicode character - $mBytes = 1; // cached expected number of octets in the current sequence - - // original code involved an $out that was an array of Unicode - // codepoints. Instead of having to convert back into UTF-8, we've - // decided to directly append valid UTF-8 characters onto a string - // $out once they're done. $char accumulates raw bytes, while $mUcs4 - // turns into the Unicode code point, so there's some redundancy. - - $out = ''; - $char = ''; - - $len = strlen($str); - for($i = 0; $i < $len; $i++) { - $in = ord($str{$i}); - $char .= $str[$i]; // append byte to char - if (0 == $mState) { - // When mState is zero we expect either a US-ASCII character - // or a multi-octet sequence. - if (0 == (0x80 & ($in))) { - // US-ASCII, pass straight through. - if (($in <= 31 || $in == 127) && - !($in == 9 || $in == 13 || $in == 10) // save \r\t\n - ) { - // control characters, remove - } else { - $out .= $char; - } - // reset - $char = ''; - $mBytes = 1; - } elseif (0xC0 == (0xE0 & ($in))) { - // First octet of 2 octet sequence - $mUcs4 = ($in); - $mUcs4 = ($mUcs4 & 0x1F) << 6; - $mState = 1; - $mBytes = 2; - } elseif (0xE0 == (0xF0 & ($in))) { - // First octet of 3 octet sequence - $mUcs4 = ($in); - $mUcs4 = ($mUcs4 & 0x0F) << 12; - $mState = 2; - $mBytes = 3; - } elseif (0xF0 == (0xF8 & ($in))) { - // First octet of 4 octet sequence - $mUcs4 = ($in); - $mUcs4 = ($mUcs4 & 0x07) << 18; - $mState = 3; - $mBytes = 4; - } elseif (0xF8 == (0xFC & ($in))) { - // First octet of 5 octet sequence. - // - // This is illegal because the encoded codepoint must be - // either: - // (a) not the shortest form or - // (b) outside the Unicode range of 0-0x10FFFF. - // Rather than trying to resynchronize, we will carry on - // until the end of the sequence and let the later error - // handling code catch it. - $mUcs4 = ($in); - $mUcs4 = ($mUcs4 & 0x03) << 24; - $mState = 4; - $mBytes = 5; - } elseif (0xFC == (0xFE & ($in))) { - // First octet of 6 octet sequence, see comments for 5 - // octet sequence. - $mUcs4 = ($in); - $mUcs4 = ($mUcs4 & 1) << 30; - $mState = 5; - $mBytes = 6; - } else { - // Current octet is neither in the US-ASCII range nor a - // legal first octet of a multi-octet sequence. - $mState = 0; - $mUcs4 = 0; - $mBytes = 1; - $char = ''; - } - } else { - // When mState is non-zero, we expect a continuation of the - // multi-octet sequence - if (0x80 == (0xC0 & ($in))) { - // Legal continuation. - $shift = ($mState - 1) * 6; - $tmp = $in; - $tmp = ($tmp & 0x0000003F) << $shift; - $mUcs4 |= $tmp; - - if (0 == --$mState) { - // End of the multi-octet sequence. mUcs4 now contains - // the final Unicode codepoint to be output - - // Check for illegal sequences and codepoints. - - // From Unicode 3.1, non-shortest form is illegal - if (((2 == $mBytes) && ($mUcs4 < 0x0080)) || - ((3 == $mBytes) && ($mUcs4 < 0x0800)) || - ((4 == $mBytes) && ($mUcs4 < 0x10000)) || - (4 < $mBytes) || - // From Unicode 3.2, surrogate characters = illegal - (($mUcs4 & 0xFFFFF800) == 0xD800) || - // Codepoints outside the Unicode range are illegal - ($mUcs4 > 0x10FFFF) - ) { - - } elseif (0xFEFF != $mUcs4 && // omit BOM - // check for valid Char unicode codepoints - ( - 0x9 == $mUcs4 || - 0xA == $mUcs4 || - 0xD == $mUcs4 || - (0x20 <= $mUcs4 && 0x7E >= $mUcs4) || - // 7F-9F is not strictly prohibited by XML, - // but it is non-SGML, and thus we don't allow it - (0xA0 <= $mUcs4 && 0xD7FF >= $mUcs4) || - (0x10000 <= $mUcs4 && 0x10FFFF >= $mUcs4) - ) - ) { - $out .= $char; - } - // initialize UTF8 cache (reset) - $mState = 0; - $mUcs4 = 0; - $mBytes = 1; - $char = ''; - } - } else { - // ((0xC0 & (*in) != 0x80) && (mState != 0)) - // Incomplete multi-octet sequence. - // used to result in complete fail, but we'll reset - $mState = 0; - $mUcs4 = 0; - $mBytes = 1; - $char =''; - } - } - } - return $out; - } - - /** - * Translates a Unicode codepoint into its corresponding UTF-8 character. - * @note Based on Feyd's function at - * , - * which is in public domain. - * @note While we're going to do code point parsing anyway, a good - * optimization would be to refuse to translate code points that - * are non-SGML characters. However, this could lead to duplication. - * @note This is very similar to the unichr function in - * maintenance/generate-entity-file.php (although this is superior, - * due to its sanity checks). - */ - - // +----------+----------+----------+----------+ - // | 33222222 | 22221111 | 111111 | | - // | 10987654 | 32109876 | 54321098 | 76543210 | bit - // +----------+----------+----------+----------+ - // | | | | 0xxxxxxx | 1 byte 0x00000000..0x0000007F - // | | | 110yyyyy | 10xxxxxx | 2 byte 0x00000080..0x000007FF - // | | 1110zzzz | 10yyyyyy | 10xxxxxx | 3 byte 0x00000800..0x0000FFFF - // | 11110www | 10wwzzzz | 10yyyyyy | 10xxxxxx | 4 byte 0x00010000..0x0010FFFF - // +----------+----------+----------+----------+ - // | 00000000 | 00011111 | 11111111 | 11111111 | Theoretical upper limit of legal scalars: 2097151 (0x001FFFFF) - // | 00000000 | 00010000 | 11111111 | 11111111 | Defined upper limit of legal scalar codes - // +----------+----------+----------+----------+ - - public static function unichr($code) { - if($code > 1114111 or $code < 0 or - ($code >= 55296 and $code <= 57343) ) { - // bits are set outside the "valid" range as defined - // by UNICODE 4.1.0 - return ''; - } - - $x = $y = $z = $w = 0; - if ($code < 128) { - // regular ASCII character - $x = $code; - } else { - // set up bits for UTF-8 - $x = ($code & 63) | 128; - if ($code < 2048) { - $y = (($code & 2047) >> 6) | 192; - } else { - $y = (($code & 4032) >> 6) | 128; - if($code < 65536) { - $z = (($code >> 12) & 15) | 224; - } else { - $z = (($code >> 12) & 63) | 128; - $w = (($code >> 18) & 7) | 240; - } - } - } - // set up the actual character - $ret = ''; - if($w) $ret .= chr($w); - if($z) $ret .= chr($z); - if($y) $ret .= chr($y); - $ret .= chr($x); - - return $ret; - } - - /** - * Converts a string to UTF-8 based on configuration. - */ - public static function convertToUTF8($str, $config, $context) { - $encoding = $config->get('Core.Encoding'); - if ($encoding === 'utf-8') return $str; - static $iconv = null; - if ($iconv === null) $iconv = function_exists('iconv'); - set_error_handler(array('HTMLPurifier_Encoder', 'muteErrorHandler')); - if ($iconv && !$config->get('Test.ForceNoIconv')) { - $str = iconv($encoding, 'utf-8//IGNORE', $str); - if ($str === false) { - // $encoding is not a valid encoding - restore_error_handler(); - trigger_error('Invalid encoding ' . $encoding, E_USER_ERROR); - return ''; - } - // If the string is bjorked by Shift_JIS or a similar encoding - // that doesn't support all of ASCII, convert the naughty - // characters to their true byte-wise ASCII/UTF-8 equivalents. - $str = strtr($str, HTMLPurifier_Encoder::testEncodingSupportsASCII($encoding)); - restore_error_handler(); - return $str; - } elseif ($encoding === 'iso-8859-1') { - $str = utf8_encode($str); - restore_error_handler(); - return $str; - } - // Added by Ivan Tcholakov, 25-JUN-2010. - // Using a custom encoding conversion function from Chamilo LMS, - // for some encodings it works even without iconv or mbstring installed. - elseif (function_exists('api_is_encoding_supported')) { - if (api_is_encoding_supported($encoding)) { - $str = api_utf8_encode($str, $encoding); - restore_error_handler(); - return $str; - } - } - // - trigger_error('Encoding not supported, please install iconv', E_USER_ERROR); - } - - /** - * Converts a string from UTF-8 based on configuration. - * @note Currently, this is a lossy conversion, with unexpressable - * characters being omitted. - */ - public static function convertFromUTF8($str, $config, $context) { - $encoding = $config->get('Core.Encoding'); - if ($encoding === 'utf-8') return $str; - static $iconv = null; - if ($iconv === null) $iconv = function_exists('iconv'); - if ($escape = $config->get('Core.EscapeNonASCIICharacters')) { - $str = HTMLPurifier_Encoder::convertToASCIIDumbLossless($str); - } - set_error_handler(array('HTMLPurifier_Encoder', 'muteErrorHandler')); - if ($iconv && !$config->get('Test.ForceNoIconv')) { - // Undo our previous fix in convertToUTF8, otherwise iconv will barf - $ascii_fix = HTMLPurifier_Encoder::testEncodingSupportsASCII($encoding); - if (!$escape && !empty($ascii_fix)) { - $clear_fix = array(); - foreach ($ascii_fix as $utf8 => $native) $clear_fix[$utf8] = ''; - $str = strtr($str, $clear_fix); - } - $str = strtr($str, array_flip($ascii_fix)); - // Normal stuff - $str = iconv('utf-8', $encoding . '//IGNORE', $str); - restore_error_handler(); - return $str; - } elseif ($encoding === 'iso-8859-1') { - $str = utf8_decode($str); - restore_error_handler(); - return $str; - } - // Added by Ivan Tcholakov, 25-JUN-2010. - // Using a custom encoding conversion function from Chamilo LMS, - // for some encodings it works even without iconv or mbstring installed. - elseif (function_exists('api_is_encoding_supported')) { - if (api_is_encoding_supported($encoding)) { - $str = api_utf8_decode($str, $encoding); - restore_error_handler(); - return $str; - } - } - // - trigger_error('Encoding not supported', E_USER_ERROR); - } - - /** - * Lossless (character-wise) conversion of HTML to ASCII - * @param $str UTF-8 string to be converted to ASCII - * @returns ASCII encoded string with non-ASCII character entity-ized - * @warning Adapted from MediaWiki, claiming fair use: this is a common - * algorithm. If you disagree with this license fudgery, - * implement it yourself. - * @note Uses decimal numeric entities since they are best supported. - * @note This is a DUMB function: it has no concept of keeping - * character entities that the projected character encoding - * can allow. We could possibly implement a smart version - * but that would require it to also know which Unicode - * codepoints the charset supported (not an easy task). - * @note Sort of with cleanUTF8() but it assumes that $str is - * well-formed UTF-8 - */ - public static function convertToASCIIDumbLossless($str) { - $bytesleft = 0; - $result = ''; - $working = 0; - $len = strlen($str); - for( $i = 0; $i < $len; $i++ ) { - $bytevalue = ord( $str[$i] ); - if( $bytevalue <= 0x7F ) { //0xxx xxxx - $result .= chr( $bytevalue ); - $bytesleft = 0; - } elseif( $bytevalue <= 0xBF ) { //10xx xxxx - $working = $working << 6; - $working += ($bytevalue & 0x3F); - $bytesleft--; - if( $bytesleft <= 0 ) { - $result .= "&#" . $working . ";"; - } - } elseif( $bytevalue <= 0xDF ) { //110x xxxx - $working = $bytevalue & 0x1F; - $bytesleft = 1; - } elseif( $bytevalue <= 0xEF ) { //1110 xxxx - $working = $bytevalue & 0x0F; - $bytesleft = 2; - } else { //1111 0xxx - $working = $bytevalue & 0x07; - $bytesleft = 3; - } - } - return $result; - } - - /** - * This expensive function tests whether or not a given character - * encoding supports ASCII. 7/8-bit encodings like Shift_JIS will - * fail this test, and require special processing. Variable width - * encodings shouldn't ever fail. - * - * @param string $encoding Encoding name to test, as per iconv format - * @param bool $bypass Whether or not to bypass the precompiled arrays. - * @return Array of UTF-8 characters to their corresponding ASCII, - * which can be used to "undo" any overzealous iconv action. - */ - public static function testEncodingSupportsASCII($encoding, $bypass = false) { - static $encodings = array(); - if (!$bypass) { - if (isset($encodings[$encoding])) return $encodings[$encoding]; - $lenc = strtolower($encoding); - switch ($lenc) { - case 'shift_jis': - return array("\xC2\xA5" => '\\', "\xE2\x80\xBE" => '~'); - case 'johab': - return array("\xE2\x82\xA9" => '\\'); - } - if (strpos($lenc, 'iso-8859-') === 0) return array(); - } - $ret = array(); - set_error_handler(array('HTMLPurifier_Encoder', 'muteErrorHandler')); - if (iconv('UTF-8', $encoding, 'a') === false) return false; - for ($i = 0x20; $i <= 0x7E; $i++) { // all printable ASCII chars - $c = chr($i); // UTF-8 char - $r = iconv('UTF-8', "$encoding//IGNORE", $c); // initial conversion - if ( - $r === '' || - // This line is needed for iconv implementations that do not - // omit characters that do not exist in the target character set - ($r === $c && iconv($encoding, 'UTF-8//IGNORE', $r) !== $c) - ) { - // Reverse engineer: what's the UTF-8 equiv of this byte - // sequence? This assumes that there's no variable width - // encoding that doesn't support ASCII. - $ret[iconv($encoding, 'UTF-8//IGNORE', $c)] = $c; - } - } - restore_error_handler(); - $encodings[$encoding] = $ret; - return $ret; - } - - -} - -// vim: et sw=4 sts=4 diff --git a/main/inc/lib/htmlpurifier/library/HTMLPurifier/EntityLookup.php b/main/inc/lib/htmlpurifier/library/HTMLPurifier/EntityLookup.php deleted file mode 100755 index b4dfce94c3..0000000000 --- a/main/inc/lib/htmlpurifier/library/HTMLPurifier/EntityLookup.php +++ /dev/null @@ -1,44 +0,0 @@ -table = unserialize(file_get_contents($file)); - } - - /** - * Retrieves sole instance of the object. - * @param Optional prototype of custom lookup table to overload with. - */ - public static function instance($prototype = false) { - // no references, since PHP doesn't copy unless modified - static $instance = null; - if ($prototype) { - $instance = $prototype; - } elseif (!$instance) { - $instance = new HTMLPurifier_EntityLookup(); - $instance->setup(); - } - return $instance; - } - -} - -// vim: et sw=4 sts=4 diff --git a/main/inc/lib/htmlpurifier/library/HTMLPurifier/EntityLookup/entities.ser b/main/inc/lib/htmlpurifier/library/HTMLPurifier/EntityLookup/entities.ser deleted file mode 100755 index f2b8b8f2db..0000000000 --- a/main/inc/lib/htmlpurifier/library/HTMLPurifier/EntityLookup/entities.ser +++ /dev/null @@ -1 +0,0 @@ -a:246:{s:4:"nbsp";s:2:" ";s:5:"iexcl";s:2:"¡";s:4:"cent";s:2:"¢";s:5:"pound";s:2:"£";s:6:"curren";s:2:"¤";s:3:"yen";s:2:"¥";s:6:"brvbar";s:2:"¦";s:4:"sect";s:2:"§";s:3:"uml";s:2:"¨";s:4:"copy";s:2:"©";s:4:"ordf";s:2:"ª";s:5:"laquo";s:2:"«";s:3:"not";s:2:"¬";s:3:"shy";s:2:"­";s:3:"reg";s:2:"®";s:4:"macr";s:2:"¯";s:3:"deg";s:2:"°";s:6:"plusmn";s:2:"±";s:5:"acute";s:2:"´";s:5:"micro";s:2:"µ";s:4:"para";s:2:"¶";s:6:"middot";s:2:"·";s:5:"cedil";s:2:"¸";s:4:"ordm";s:2:"º";s:5:"raquo";s:2:"»";s:6:"iquest";s:2:"¿";s:6:"Agrave";s:2:"À";s:6:"Aacute";s:2:"Á";s:5:"Acirc";s:2:"Â";s:6:"Atilde";s:2:"Ã";s:4:"Auml";s:2:"Ä";s:5:"Aring";s:2:"Å";s:5:"AElig";s:2:"Æ";s:6:"Ccedil";s:2:"Ç";s:6:"Egrave";s:2:"È";s:6:"Eacute";s:2:"É";s:5:"Ecirc";s:2:"Ê";s:4:"Euml";s:2:"Ë";s:6:"Igrave";s:2:"Ì";s:6:"Iacute";s:2:"Í";s:5:"Icirc";s:2:"Î";s:4:"Iuml";s:2:"Ï";s:3:"ETH";s:2:"Ð";s:6:"Ntilde";s:2:"Ñ";s:6:"Ograve";s:2:"Ò";s:6:"Oacute";s:2:"Ó";s:5:"Ocirc";s:2:"Ô";s:6:"Otilde";s:2:"Õ";s:4:"Ouml";s:2:"Ö";s:5:"times";s:2:"×";s:6:"Oslash";s:2:"Ø";s:6:"Ugrave";s:2:"Ù";s:6:"Uacute";s:2:"Ú";s:5:"Ucirc";s:2:"Û";s:4:"Uuml";s:2:"Ü";s:6:"Yacute";s:2:"Ý";s:5:"THORN";s:2:"Þ";s:5:"szlig";s:2:"ß";s:6:"agrave";s:2:"à";s:6:"aacute";s:2:"á";s:5:"acirc";s:2:"â";s:6:"atilde";s:2:"ã";s:4:"auml";s:2:"ä";s:5:"aring";s:2:"å";s:5:"aelig";s:2:"æ";s:6:"ccedil";s:2:"ç";s:6:"egrave";s:2:"è";s:6:"eacute";s:2:"é";s:5:"ecirc";s:2:"ê";s:4:"euml";s:2:"ë";s:6:"igrave";s:2:"ì";s:6:"iacute";s:2:"í";s:5:"icirc";s:2:"î";s:4:"iuml";s:2:"ï";s:3:"eth";s:2:"ð";s:6:"ntilde";s:2:"ñ";s:6:"ograve";s:2:"ò";s:6:"oacute";s:2:"ó";s:5:"ocirc";s:2:"ô";s:6:"otilde";s:2:"õ";s:4:"ouml";s:2:"ö";s:6:"divide";s:2:"÷";s:6:"oslash";s:2:"ø";s:6:"ugrave";s:2:"ù";s:6:"uacute";s:2:"ú";s:5:"ucirc";s:2:"û";s:4:"uuml";s:2:"ü";s:6:"yacute";s:2:"ý";s:5:"thorn";s:2:"þ";s:4:"yuml";s:2:"ÿ";s:4:"quot";s:1:""";s:3:"amp";s:1:"&";s:2:"lt";s:1:"<";s:2:"gt";s:1:">";s:4:"apos";s:1:"'";s:5:"OElig";s:2:"Œ";s:5:"oelig";s:2:"œ";s:6:"Scaron";s:2:"Š";s:6:"scaron";s:2:"š";s:4:"Yuml";s:2:"Ÿ";s:4:"circ";s:2:"ˆ";s:5:"tilde";s:2:"˜";s:4:"ensp";s:3:" ";s:4:"emsp";s:3:" ";s:6:"thinsp";s:3:" ";s:4:"zwnj";s:3:"‌";s:3:"zwj";s:3:"‍";s:3:"lrm";s:3:"‎";s:3:"rlm";s:3:"‏";s:5:"ndash";s:3:"–";s:5:"mdash";s:3:"—";s:5:"lsquo";s:3:"‘";s:5:"rsquo";s:3:"’";s:5:"sbquo";s:3:"‚";s:5:"ldquo";s:3:"“";s:5:"rdquo";s:3:"”";s:5:"bdquo";s:3:"„";s:6:"dagger";s:3:"†";s:6:"Dagger";s:3:"‡";s:6:"permil";s:3:"‰";s:6:"lsaquo";s:3:"‹";s:6:"rsaquo";s:3:"›";s:4:"euro";s:3:"€";s:4:"fnof";s:2:"ƒ";s:5:"Alpha";s:2:"Α";s:4:"Beta";s:2:"Β";s:5:"Gamma";s:2:"Γ";s:5:"Delta";s:2:"Δ";s:7:"Epsilon";s:2:"Ε";s:4:"Zeta";s:2:"Ζ";s:3:"Eta";s:2:"Η";s:5:"Theta";s:2:"Θ";s:4:"Iota";s:2:"Ι";s:5:"Kappa";s:2:"Κ";s:6:"Lambda";s:2:"Λ";s:2:"Mu";s:2:"Μ";s:2:"Nu";s:2:"Ν";s:2:"Xi";s:2:"Ξ";s:7:"Omicron";s:2:"Ο";s:2:"Pi";s:2:"Π";s:3:"Rho";s:2:"Ρ";s:5:"Sigma";s:2:"Σ";s:3:"Tau";s:2:"Τ";s:7:"Upsilon";s:2:"Υ";s:3:"Phi";s:2:"Φ";s:3:"Chi";s:2:"Χ";s:3:"Psi";s:2:"Ψ";s:5:"Omega";s:2:"Ω";s:5:"alpha";s:2:"α";s:4:"beta";s:2:"β";s:5:"gamma";s:2:"γ";s:5:"delta";s:2:"δ";s:7:"epsilon";s:2:"ε";s:4:"zeta";s:2:"ζ";s:3:"eta";s:2:"η";s:5:"theta";s:2:"θ";s:4:"iota";s:2:"ι";s:5:"kappa";s:2:"κ";s:6:"lambda";s:2:"λ";s:2:"mu";s:2:"μ";s:2:"nu";s:2:"ν";s:2:"xi";s:2:"ξ";s:7:"omicron";s:2:"ο";s:2:"pi";s:2:"π";s:3:"rho";s:2:"ρ";s:6:"sigmaf";s:2:"ς";s:5:"sigma";s:2:"σ";s:3:"tau";s:2:"τ";s:7:"upsilon";s:2:"υ";s:3:"phi";s:2:"φ";s:3:"chi";s:2:"χ";s:3:"psi";s:2:"ψ";s:5:"omega";s:2:"ω";s:8:"thetasym";s:2:"ϑ";s:5:"upsih";s:2:"ϒ";s:3:"piv";s:2:"ϖ";s:4:"bull";s:3:"•";s:6:"hellip";s:3:"…";s:5:"prime";s:3:"′";s:5:"Prime";s:3:"″";s:5:"oline";s:3:"‾";s:5:"frasl";s:3:"⁄";s:6:"weierp";s:3:"℘";s:5:"image";s:3:"ℑ";s:4:"real";s:3:"ℜ";s:5:"trade";s:3:"™";s:7:"alefsym";s:3:"ℵ";s:4:"larr";s:3:"←";s:4:"uarr";s:3:"↑";s:4:"rarr";s:3:"→";s:4:"darr";s:3:"↓";s:4:"harr";s:3:"↔";s:5:"crarr";s:3:"↵";s:4:"lArr";s:3:"⇐";s:4:"uArr";s:3:"⇑";s:4:"rArr";s:3:"⇒";s:4:"dArr";s:3:"⇓";s:4:"hArr";s:3:"⇔";s:6:"forall";s:3:"∀";s:4:"part";s:3:"∂";s:5:"exist";s:3:"∃";s:5:"empty";s:3:"∅";s:5:"nabla";s:3:"∇";s:4:"isin";s:3:"∈";s:5:"notin";s:3:"∉";s:2:"ni";s:3:"∋";s:4:"prod";s:3:"∏";s:3:"sum";s:3:"∑";s:5:"minus";s:3:"−";s:6:"lowast";s:3:"∗";s:5:"radic";s:3:"√";s:4:"prop";s:3:"∝";s:5:"infin";s:3:"∞";s:3:"ang";s:3:"∠";s:3:"and";s:3:"∧";s:2:"or";s:3:"∨";s:3:"cap";s:3:"∩";s:3:"cup";s:3:"∪";s:3:"int";s:3:"∫";s:3:"sim";s:3:"∼";s:4:"cong";s:3:"≅";s:5:"asymp";s:3:"≈";s:2:"ne";s:3:"≠";s:5:"equiv";s:3:"≡";s:2:"le";s:3:"≤";s:2:"ge";s:3:"≥";s:3:"sub";s:3:"⊂";s:3:"sup";s:3:"⊃";s:4:"nsub";s:3:"⊄";s:4:"sube";s:3:"⊆";s:4:"supe";s:3:"⊇";s:5:"oplus";s:3:"⊕";s:6:"otimes";s:3:"⊗";s:4:"perp";s:3:"⊥";s:4:"sdot";s:3:"⋅";s:5:"lceil";s:3:"⌈";s:5:"rceil";s:3:"⌉";s:6:"lfloor";s:3:"⌊";s:6:"rfloor";s:3:"⌋";s:4:"lang";s:3:"〈";s:4:"rang";s:3:"〉";s:3:"loz";s:3:"◊";s:6:"spades";s:3:"♠";s:5:"clubs";s:3:"♣";s:6:"hearts";s:3:"♥";s:5:"diams";s:3:"♦";} \ No newline at end of file diff --git a/main/inc/lib/htmlpurifier/library/HTMLPurifier/EntityLookup/index.html b/main/inc/lib/htmlpurifier/library/HTMLPurifier/EntityLookup/index.html deleted file mode 100755 index aa7b9c934b..0000000000 --- a/main/inc/lib/htmlpurifier/library/HTMLPurifier/EntityLookup/index.html +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/main/inc/lib/htmlpurifier/library/HTMLPurifier/EntityParser.php b/main/inc/lib/htmlpurifier/library/HTMLPurifier/EntityParser.php deleted file mode 100755 index 8c384472dc..0000000000 --- a/main/inc/lib/htmlpurifier/library/HTMLPurifier/EntityParser.php +++ /dev/null @@ -1,144 +0,0 @@ - '"', - 38 => '&', - 39 => "'", - 60 => '<', - 62 => '>' - ); - - /** - * Stripped entity names to decimal conversion table for special entities. - */ - protected $_special_ent2dec = - array( - 'quot' => 34, - 'amp' => 38, - 'lt' => 60, - 'gt' => 62 - ); - - /** - * Substitutes non-special entities with their parsed equivalents. Since - * running this whenever you have parsed character is t3h 5uck, we run - * it before everything else. - * - * @param $string String to have non-special entities parsed. - * @returns Parsed string. - */ - public function substituteNonSpecialEntities($string) { - // it will try to detect missing semicolons, but don't rely on it - return preg_replace_callback( - $this->_substituteEntitiesRegex, - array($this, 'nonSpecialEntityCallback'), - $string - ); - } - - /** - * Callback function for substituteNonSpecialEntities() that does the work. - * - * @param $matches PCRE matches array, with 0 the entire match, and - * either index 1, 2 or 3 set with a hex value, dec value, - * or string (respectively). - * @returns Replacement string. - */ - - protected function nonSpecialEntityCallback($matches) { - // replaces all but big five - $entity = $matches[0]; - $is_num = (@$matches[0][1] === '#'); - if ($is_num) { - $is_hex = (@$entity[2] === 'x'); - $code = $is_hex ? hexdec($matches[1]) : (int) $matches[2]; - - // abort for special characters - if (isset($this->_special_dec2str[$code])) return $entity; - - return HTMLPurifier_Encoder::unichr($code); - } else { - if (isset($this->_special_ent2dec[$matches[3]])) return $entity; - if (!$this->_entity_lookup) { - $this->_entity_lookup = HTMLPurifier_EntityLookup::instance(); - } - if (isset($this->_entity_lookup->table[$matches[3]])) { - return $this->_entity_lookup->table[$matches[3]]; - } else { - return $entity; - } - } - } - - /** - * Substitutes only special entities with their parsed equivalents. - * - * @notice We try to avoid calling this function because otherwise, it - * would have to be called a lot (for every parsed section). - * - * @param $string String to have non-special entities parsed. - * @returns Parsed string. - */ - public function substituteSpecialEntities($string) { - return preg_replace_callback( - $this->_substituteEntitiesRegex, - array($this, 'specialEntityCallback'), - $string); - } - - /** - * Callback function for substituteSpecialEntities() that does the work. - * - * This callback has same syntax as nonSpecialEntityCallback(). - * - * @param $matches PCRE-style matches array, with 0 the entire match, and - * either index 1, 2 or 3 set with a hex value, dec value, - * or string (respectively). - * @returns Replacement string. - */ - protected function specialEntityCallback($matches) { - $entity = $matches[0]; - $is_num = (@$matches[0][1] === '#'); - if ($is_num) { - $is_hex = (@$entity[2] === 'x'); - $int = $is_hex ? hexdec($matches[1]) : (int) $matches[2]; - return isset($this->_special_dec2str[$int]) ? - $this->_special_dec2str[$int] : - $entity; - } else { - return isset($this->_special_ent2dec[$matches[3]]) ? - $this->_special_ent2dec[$matches[3]] : - $entity; - } - } - -} - -// vim: et sw=4 sts=4 diff --git a/main/inc/lib/htmlpurifier/library/HTMLPurifier/ErrorCollector.php b/main/inc/lib/htmlpurifier/library/HTMLPurifier/ErrorCollector.php deleted file mode 100755 index 6713eaf773..0000000000 --- a/main/inc/lib/htmlpurifier/library/HTMLPurifier/ErrorCollector.php +++ /dev/null @@ -1,209 +0,0 @@ -locale =& $context->get('Locale'); - $this->context = $context; - $this->_current =& $this->_stacks[0]; - $this->errors =& $this->_stacks[0]; - } - - /** - * Sends an error message to the collector for later use - * @param $severity int Error severity, PHP error style (don't use E_USER_) - * @param $msg string Error message text - * @param $subst1 string First substitution for $msg - * @param $subst2 string ... - */ - public function send($severity, $msg) { - - $args = array(); - if (func_num_args() > 2) { - $args = func_get_args(); - array_shift($args); - unset($args[0]); - } - - $token = $this->context->get('CurrentToken', true); - $line = $token ? $token->line : $this->context->get('CurrentLine', true); - $col = $token ? $token->col : $this->context->get('CurrentCol', true); - $attr = $this->context->get('CurrentAttr', true); - - // perform special substitutions, also add custom parameters - $subst = array(); - if (!is_null($token)) { - $args['CurrentToken'] = $token; - } - if (!is_null($attr)) { - $subst['$CurrentAttr.Name'] = $attr; - if (isset($token->attr[$attr])) $subst['$CurrentAttr.Value'] = $token->attr[$attr]; - } - - if (empty($args)) { - $msg = $this->locale->getMessage($msg); - } else { - $msg = $this->locale->formatMessage($msg, $args); - } - - if (!empty($subst)) $msg = strtr($msg, $subst); - - // (numerically indexed) - $error = array( - self::LINENO => $line, - self::SEVERITY => $severity, - self::MESSAGE => $msg, - self::CHILDREN => array() - ); - $this->_current[] = $error; - - - // NEW CODE BELOW ... - - $struct = null; - // Top-level errors are either: - // TOKEN type, if $value is set appropriately, or - // "syntax" type, if $value is null - $new_struct = new HTMLPurifier_ErrorStruct(); - $new_struct->type = HTMLPurifier_ErrorStruct::TOKEN; - if ($token) $new_struct->value = clone $token; - if (is_int($line) && is_int($col)) { - if (isset($this->lines[$line][$col])) { - $struct = $this->lines[$line][$col]; - } else { - $struct = $this->lines[$line][$col] = $new_struct; - } - // These ksorts may present a performance problem - ksort($this->lines[$line], SORT_NUMERIC); - } else { - if (isset($this->lines[-1])) { - $struct = $this->lines[-1]; - } else { - $struct = $this->lines[-1] = $new_struct; - } - } - ksort($this->lines, SORT_NUMERIC); - - // Now, check if we need to operate on a lower structure - if (!empty($attr)) { - $struct = $struct->getChild(HTMLPurifier_ErrorStruct::ATTR, $attr); - if (!$struct->value) { - $struct->value = array($attr, 'PUT VALUE HERE'); - } - } - if (!empty($cssprop)) { - $struct = $struct->getChild(HTMLPurifier_ErrorStruct::CSSPROP, $cssprop); - if (!$struct->value) { - // if we tokenize CSS this might be a little more difficult to do - $struct->value = array($cssprop, 'PUT VALUE HERE'); - } - } - - // Ok, structs are all setup, now time to register the error - $struct->addError($severity, $msg); - } - - /** - * Retrieves raw error data for custom formatter to use - * @param List of arrays in format of array(line of error, - * error severity, error message, - * recursive sub-errors array) - */ - public function getRaw() { - return $this->errors; - } - - /** - * Default HTML formatting implementation for error messages - * @param $config Configuration array, vital for HTML output nature - * @param $errors Errors array to display; used for recursion. - */ - public function getHTMLFormatted($config, $errors = null) { - $ret = array(); - - $this->generator = new HTMLPurifier_Generator($config, $this->context); - if ($errors === null) $errors = $this->errors; - - // 'At line' message needs to be removed - - // generation code for new structure goes here. It needs to be recursive. - foreach ($this->lines as $line => $col_array) { - if ($line == -1) continue; - foreach ($col_array as $col => $struct) { - $this->_renderStruct($ret, $struct, $line, $col); - } - } - if (isset($this->lines[-1])) { - $this->_renderStruct($ret, $this->lines[-1]); - } - - if (empty($errors)) { - return '

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

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

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

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

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

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

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

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

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

    PAR1

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

    PAR1

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      PAR1
      - // ---- - // Terminate early, since we hit a block element - return false; - } - } elseif ($current instanceof HTMLPurifier_Token_Text) { - if (strpos($current->data, "\n\n") !== false) { - //
      PAR1PAR1\n\nPAR2 - // ---- - return true; - } else { - //
      PAR1PAR1... - // ---- - } - } - return null; - } - -} - -// vim: et sw=4 sts=4 diff --git a/main/inc/lib/htmlpurifier/library/HTMLPurifier/Injector/DisplayLinkURI.php b/main/inc/lib/htmlpurifier/library/HTMLPurifier/Injector/DisplayLinkURI.php deleted file mode 100755 index 9dce9bd085..0000000000 --- a/main/inc/lib/htmlpurifier/library/HTMLPurifier/Injector/DisplayLinkURI.php +++ /dev/null @@ -1,26 +0,0 @@ -start->attr['href'])){ - $url = $token->start->attr['href']; - unset($token->start->attr['href']); - $token = array($token, new HTMLPurifier_Token_Text(" ($url)")); - } else { - // nothing to display - } - } -} - -// vim: et sw=4 sts=4 diff --git a/main/inc/lib/htmlpurifier/library/HTMLPurifier/Injector/Linkify.php b/main/inc/lib/htmlpurifier/library/HTMLPurifier/Injector/Linkify.php deleted file mode 100755 index 296dac2829..0000000000 --- a/main/inc/lib/htmlpurifier/library/HTMLPurifier/Injector/Linkify.php +++ /dev/null @@ -1,46 +0,0 @@ - array('href')); - - public function handleText(&$token) { - if (!$this->allowsElement('a')) return; - - if (strpos($token->data, '://') === false) { - // our really quick heuristic failed, abort - // this may not work so well if we want to match things like - // "google.com", but then again, most people don't - return; - } - - // there is/are URL(s). Let's split the string: - // Note: this regex is extremely permissive - $bits = preg_split('#((?:https?|ftp)://[^\s\'"<>()]+)#S', $token->data, -1, PREG_SPLIT_DELIM_CAPTURE); - - $token = array(); - - // $i = index - // $c = count - // $l = is link - for ($i = 0, $c = count($bits), $l = false; $i < $c; $i++, $l = !$l) { - if (!$l) { - if ($bits[$i] === '') continue; - $token[] = new HTMLPurifier_Token_Text($bits[$i]); - } else { - $token[] = new HTMLPurifier_Token_Start('a', array('href' => $bits[$i])); - $token[] = new HTMLPurifier_Token_Text($bits[$i]); - $token[] = new HTMLPurifier_Token_End('a'); - } - } - - } - -} - -// vim: et sw=4 sts=4 diff --git a/main/inc/lib/htmlpurifier/library/HTMLPurifier/Injector/PurifierLinkify.php b/main/inc/lib/htmlpurifier/library/HTMLPurifier/Injector/PurifierLinkify.php deleted file mode 100755 index ad2455a91c..0000000000 --- a/main/inc/lib/htmlpurifier/library/HTMLPurifier/Injector/PurifierLinkify.php +++ /dev/null @@ -1,45 +0,0 @@ - array('href')); - - public function prepare($config, $context) { - $this->docURL = $config->get('AutoFormat.PurifierLinkify.DocURL'); - return parent::prepare($config, $context); - } - - public function handleText(&$token) { - if (!$this->allowsElement('a')) return; - if (strpos($token->data, '%') === false) return; - - $bits = preg_split('#%([a-z0-9]+\.[a-z0-9]+)#Si', $token->data, -1, PREG_SPLIT_DELIM_CAPTURE); - $token = array(); - - // $i = index - // $c = count - // $l = is link - for ($i = 0, $c = count($bits), $l = false; $i < $c; $i++, $l = !$l) { - if (!$l) { - if ($bits[$i] === '') continue; - $token[] = new HTMLPurifier_Token_Text($bits[$i]); - } else { - $token[] = new HTMLPurifier_Token_Start('a', - array('href' => str_replace('%s', $bits[$i], $this->docURL))); - $token[] = new HTMLPurifier_Token_Text('%' . $bits[$i]); - $token[] = new HTMLPurifier_Token_End('a'); - } - } - - } - -} - -// vim: et sw=4 sts=4 diff --git a/main/inc/lib/htmlpurifier/library/HTMLPurifier/Injector/RemoveEmpty.php b/main/inc/lib/htmlpurifier/library/HTMLPurifier/Injector/RemoveEmpty.php deleted file mode 100755 index 638bfca03b..0000000000 --- a/main/inc/lib/htmlpurifier/library/HTMLPurifier/Injector/RemoveEmpty.php +++ /dev/null @@ -1,51 +0,0 @@ -config = $config; - $this->context = $context; - $this->removeNbsp = $config->get('AutoFormat.RemoveEmpty.RemoveNbsp'); - $this->removeNbspExceptions = $config->get('AutoFormat.RemoveEmpty.RemoveNbsp.Exceptions'); - $this->attrValidator = new HTMLPurifier_AttrValidator(); - } - - public function handleElement(&$token) { - if (!$token instanceof HTMLPurifier_Token_Start) return; - $next = false; - for ($i = $this->inputIndex + 1, $c = count($this->inputTokens); $i < $c; $i++) { - $next = $this->inputTokens[$i]; - if ($next instanceof HTMLPurifier_Token_Text) { - if ($next->is_whitespace) continue; - if ($this->removeNbsp && !isset($this->removeNbspExceptions[$token->name])) { - $plain = str_replace("\xC2\xA0", "", $next->data); - $isWsOrNbsp = $plain === '' || ctype_space($plain); - if ($isWsOrNbsp) continue; - } - } - break; - } - if (!$next || ($next instanceof HTMLPurifier_Token_End && $next->name == $token->name)) { - if ($token->name == 'colgroup') return; - $this->attrValidator->validateToken($token, $this->config, $this->context); - $token->armor['ValidateAttributes'] = true; - if (isset($token->attr['id']) || isset($token->attr['name'])) return; - $token = $i - $this->inputIndex + 1; - for ($b = $this->inputIndex - 1; $b > 0; $b--) { - $prev = $this->inputTokens[$b]; - if ($prev instanceof HTMLPurifier_Token_Text && $prev->is_whitespace) continue; - break; - } - // This is safe because we removed the token that triggered this. - $this->rewind($b - 1); - return; - } - } - -} - -// vim: et sw=4 sts=4 diff --git a/main/inc/lib/htmlpurifier/library/HTMLPurifier/Injector/RemoveSpansWithoutAttributes.php b/main/inc/lib/htmlpurifier/library/HTMLPurifier/Injector/RemoveSpansWithoutAttributes.php deleted file mode 100755 index b21313470e..0000000000 --- a/main/inc/lib/htmlpurifier/library/HTMLPurifier/Injector/RemoveSpansWithoutAttributes.php +++ /dev/null @@ -1,60 +0,0 @@ -attrValidator = new HTMLPurifier_AttrValidator(); - $this->config = $config; - $this->context = $context; - return parent::prepare($config, $context); - } - - public function handleElement(&$token) { - if ($token->name !== 'span' || !$token instanceof HTMLPurifier_Token_Start) { - return; - } - - // We need to validate the attributes now since this doesn't normally - // happen until after MakeWellFormed. If all the attributes are removed - // the span needs to be removed too. - $this->attrValidator->validateToken($token, $this->config, $this->context); - $token->armor['ValidateAttributes'] = true; - - if (!empty($token->attr)) { - return; - } - - $nesting = 0; - $spanContentTokens = array(); - while ($this->forwardUntilEndToken($i, $current, $nesting)) {} - - if ($current instanceof HTMLPurifier_Token_End && $current->name === 'span') { - // Mark closing span tag for deletion - $current->markForDeletion = true; - // Delete open span tag - $token = false; - } - } - - public function handleEnd(&$token) { - if ($token->markForDeletion) { - $token = false; - } - } -} - -// vim: et sw=4 sts=4 diff --git a/main/inc/lib/htmlpurifier/library/HTMLPurifier/Injector/SafeObject.php b/main/inc/lib/htmlpurifier/library/HTMLPurifier/Injector/SafeObject.php deleted file mode 100755 index 34765265da..0000000000 --- a/main/inc/lib/htmlpurifier/library/HTMLPurifier/Injector/SafeObject.php +++ /dev/null @@ -1,95 +0,0 @@ - 'never', - 'allowNetworking' => 'internal', - 'allowscriptaccess' => 'never', - 'allownetworking' => 'internal', - - ); - protected $allowedParam = array( - 'wmode' => true, - 'movie' => true, - 'flashvars' => true, - 'src' => true, - 'allowFullScreen' => true, // if omitted, assume to be 'false' - 'allowfullscreen' => true, // if omitted, assume to be 'false' - ); - - public function prepare($config, $context) { - parent::prepare($config, $context); - } - - public function handleElement(&$token) { - if ($token->name == 'object') { - $this->objectStack[] = $token; - $this->paramStack[] = array(); - $new = array($token); - foreach ($this->addParam as $name => $value) { - $new[] = new HTMLPurifier_Token_Empty('param', array('name' => $name, 'value' => $value)); - } - $token = $new; - } elseif ($token->name == 'param') { - $nest = count($this->currentNesting) - 1; - if ($nest >= 0 && $this->currentNesting[$nest]->name === 'object') { - $i = count($this->objectStack) - 1; - if (!isset($token->attr['name'])) { - $token = false; - return; - } - $n = $token->attr['name']; - // We need this fix because YouTube doesn't supply a data - // attribute, which we need if a type is specified. This is - // *very* Flash specific. - if (!isset($this->objectStack[$i]->attr['data']) && - ($token->attr['name'] == 'movie' || $token->attr['name'] == 'src')) { - $this->objectStack[$i]->attr['data'] = $token->attr['value']; - } - // Check if the parameter is the correct value but has not - // already been added - if ( - !isset($this->paramStack[$i][$n]) && - isset($this->addParam[$n]) && - $token->attr['name'] === $this->addParam[$n] - ) { - // keep token, and add to param stack - $this->paramStack[$i][$n] = true; - } elseif (isset($this->allowedParam[$n])) { - // keep token, don't do anything to it - // (could possibly check for duplicates here) - } else { - $token = false; - } - } else { - // not directly inside an object, DENY! - $token = false; - } - } - } - - public function handleEnd(&$token) { - // This is the WRONG way of handling the object and param stacks; - // we should be inserting them directly on the relevant object tokens - // so that the global stack handling handles it. - if ($token->name == 'object') { - array_pop($this->objectStack); - array_pop($this->paramStack); - } - } - -} - -// vim: et sw=4 sts=4 diff --git a/main/inc/lib/htmlpurifier/library/HTMLPurifier/Injector/index.html b/main/inc/lib/htmlpurifier/library/HTMLPurifier/Injector/index.html deleted file mode 100755 index aa7b9c934b..0000000000 --- a/main/inc/lib/htmlpurifier/library/HTMLPurifier/Injector/index.html +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/main/inc/lib/htmlpurifier/library/HTMLPurifier/Language.php b/main/inc/lib/htmlpurifier/library/HTMLPurifier/Language.php deleted file mode 100755 index 3e2be03b58..0000000000 --- a/main/inc/lib/htmlpurifier/library/HTMLPurifier/Language.php +++ /dev/null @@ -1,163 +0,0 @@ -config = $config; - $this->context = $context; - } - - /** - * Loads language object with necessary info from factory cache - * @note This is a lazy loader - */ - public function load() { - if ($this->_loaded) return; - $factory = HTMLPurifier_LanguageFactory::instance(); - $factory->loadLanguage($this->code); - foreach ($factory->keys as $key) { - $this->$key = $factory->cache[$this->code][$key]; - } - $this->_loaded = true; - } - - /** - * Retrieves a localised message. - * @param $key string identifier of message - * @return string localised message - */ - public function getMessage($key) { - if (!$this->_loaded) $this->load(); - if (!isset($this->messages[$key])) return "[$key]"; - return $this->messages[$key]; - } - - /** - * Retrieves a localised error name. - * @param $int integer error number, corresponding to PHP's error - * reporting - * @return string localised message - */ - public function getErrorName($int) { - if (!$this->_loaded) $this->load(); - if (!isset($this->errorNames[$int])) return "[Error: $int]"; - return $this->errorNames[$int]; - } - - /** - * Converts an array list into a string readable representation - */ - public function listify($array) { - $sep = $this->getMessage('Item separator'); - $sep_last = $this->getMessage('Item separator last'); - $ret = ''; - for ($i = 0, $c = count($array); $i < $c; $i++) { - if ($i == 0) { - } elseif ($i + 1 < $c) { - $ret .= $sep; - } else { - $ret .= $sep_last; - } - $ret .= $array[$i]; - } - return $ret; - } - - /** - * Formats a localised message with passed parameters - * @param $key string identifier of message - * @param $args Parameters to substitute in - * @return string localised message - * @todo Implement conditionals? Right now, some messages make - * reference to line numbers, but those aren't always available - */ - public function formatMessage($key, $args = array()) { - if (!$this->_loaded) $this->load(); - if (!isset($this->messages[$key])) return "[$key]"; - $raw = $this->messages[$key]; - $subst = array(); - $generator = false; - foreach ($args as $i => $value) { - if (is_object($value)) { - if ($value instanceof HTMLPurifier_Token) { - // factor this out some time - if (!$generator) $generator = $this->context->get('Generator'); - if (isset($value->name)) $subst['$'.$i.'.Name'] = $value->name; - if (isset($value->data)) $subst['$'.$i.'.Data'] = $value->data; - $subst['$'.$i.'.Compact'] = - $subst['$'.$i.'.Serialized'] = $generator->generateFromToken($value); - // a more complex algorithm for compact representation - // could be introduced for all types of tokens. This - // may need to be factored out into a dedicated class - if (!empty($value->attr)) { - $stripped_token = clone $value; - $stripped_token->attr = array(); - $subst['$'.$i.'.Compact'] = $generator->generateFromToken($stripped_token); - } - $subst['$'.$i.'.Line'] = $value->line ? $value->line : 'unknown'; - } - continue; - } elseif (is_array($value)) { - $keys = array_keys($value); - if (array_keys($keys) === $keys) { - // list - $subst['$'.$i] = $this->listify($value); - } else { - // associative array - // no $i implementation yet, sorry - $subst['$'.$i.'.Keys'] = $this->listify($keys); - $subst['$'.$i.'.Values'] = $this->listify(array_values($value)); - } - continue; - } - $subst['$' . $i] = $value; - } - return strtr($raw, $subst); - } - -} - -// vim: et sw=4 sts=4 diff --git a/main/inc/lib/htmlpurifier/library/HTMLPurifier/Language/classes/en-x-test.php b/main/inc/lib/htmlpurifier/library/HTMLPurifier/Language/classes/en-x-test.php deleted file mode 100755 index d52fcb7ac1..0000000000 --- a/main/inc/lib/htmlpurifier/library/HTMLPurifier/Language/classes/en-x-test.php +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/main/inc/lib/htmlpurifier/library/HTMLPurifier/Language/index.html b/main/inc/lib/htmlpurifier/library/HTMLPurifier/Language/index.html deleted file mode 100755 index aa7b9c934b..0000000000 --- a/main/inc/lib/htmlpurifier/library/HTMLPurifier/Language/index.html +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/main/inc/lib/htmlpurifier/library/HTMLPurifier/Language/messages/en-x-test.php b/main/inc/lib/htmlpurifier/library/HTMLPurifier/Language/messages/en-x-test.php deleted file mode 100755 index 1c046f379e..0000000000 --- a/main/inc/lib/htmlpurifier/library/HTMLPurifier/Language/messages/en-x-test.php +++ /dev/null @@ -1,11 +0,0 @@ - 'HTML Purifier X' -); - -// vim: et sw=4 sts=4 diff --git a/main/inc/lib/htmlpurifier/library/HTMLPurifier/Language/messages/en-x-testmini.php b/main/inc/lib/htmlpurifier/library/HTMLPurifier/Language/messages/en-x-testmini.php deleted file mode 100755 index 806c83fbf7..0000000000 --- a/main/inc/lib/htmlpurifier/library/HTMLPurifier/Language/messages/en-x-testmini.php +++ /dev/null @@ -1,12 +0,0 @@ - 'HTML Purifier XNone' -); - -// vim: et sw=4 sts=4 diff --git a/main/inc/lib/htmlpurifier/library/HTMLPurifier/Language/messages/en.php b/main/inc/lib/htmlpurifier/library/HTMLPurifier/Language/messages/en.php deleted file mode 100755 index 0f9bd73d91..0000000000 --- a/main/inc/lib/htmlpurifier/library/HTMLPurifier/Language/messages/en.php +++ /dev/null @@ -1,63 +0,0 @@ - 'HTML Purifier', - -// for unit testing purposes -'LanguageFactoryTest: Pizza' => 'Pizza', -'LanguageTest: List' => '$1', -'LanguageTest: Hash' => '$1.Keys; $1.Values', - -'Item separator' => ', ', -'Item separator last' => ' and ', // non-Harvard style - -'ErrorCollector: No errors' => 'No errors detected. However, because error reporting is still incomplete, there may have been errors that the error collector was not notified of; please inspect the output HTML carefully.', -'ErrorCollector: At line' => ' at line $line', -'ErrorCollector: Incidental errors' => 'Incidental errors', - -'Lexer: Unclosed comment' => 'Unclosed comment', -'Lexer: Unescaped lt' => 'Unescaped less-than sign (<) should be <', -'Lexer: Missing gt' => 'Missing greater-than sign (>), previous less-than sign (<) should be escaped', -'Lexer: Missing attribute key' => 'Attribute declaration has no key', -'Lexer: Missing end quote' => 'Attribute declaration has no end quote', -'Lexer: Extracted body' => 'Removed document metadata tags', - -'Strategy_RemoveForeignElements: Tag transform' => '<$1> element transformed into $CurrentToken.Serialized', -'Strategy_RemoveForeignElements: Missing required attribute' => '$CurrentToken.Compact element missing required attribute $1', -'Strategy_RemoveForeignElements: Foreign element to text' => 'Unrecognized $CurrentToken.Serialized tag converted to text', -'Strategy_RemoveForeignElements: Foreign element removed' => 'Unrecognized $CurrentToken.Serialized tag removed', -'Strategy_RemoveForeignElements: Comment removed' => 'Comment containing "$CurrentToken.Data" removed', -'Strategy_RemoveForeignElements: Foreign meta element removed' => 'Unrecognized $CurrentToken.Serialized meta tag and all descendants removed', -'Strategy_RemoveForeignElements: Token removed to end' => 'Tags and text starting from $1 element where removed to end', -'Strategy_RemoveForeignElements: Trailing hyphen in comment removed' => 'Trailing hyphen(s) in comment removed', -'Strategy_RemoveForeignElements: Hyphens in comment collapsed' => 'Double hyphens in comments are not allowed, and were collapsed into single hyphens', - -'Strategy_MakeWellFormed: Unnecessary end tag removed' => 'Unnecessary $CurrentToken.Serialized tag removed', -'Strategy_MakeWellFormed: Unnecessary end tag to text' => 'Unnecessary $CurrentToken.Serialized tag converted to text', -'Strategy_MakeWellFormed: Tag auto closed' => '$1.Compact started on line $1.Line auto-closed by $CurrentToken.Compact', -'Strategy_MakeWellFormed: Tag carryover' => '$1.Compact started on line $1.Line auto-continued into $CurrentToken.Compact', -'Strategy_MakeWellFormed: Stray end tag removed' => 'Stray $CurrentToken.Serialized tag removed', -'Strategy_MakeWellFormed: Stray end tag to text' => 'Stray $CurrentToken.Serialized tag converted to text', -'Strategy_MakeWellFormed: Tag closed by element end' => '$1.Compact tag started on line $1.Line closed by end of $CurrentToken.Serialized', -'Strategy_MakeWellFormed: Tag closed by document end' => '$1.Compact tag started on line $1.Line closed by end of document', - -'Strategy_FixNesting: Node removed' => '$CurrentToken.Compact node removed', -'Strategy_FixNesting: Node excluded' => '$CurrentToken.Compact node removed due to descendant exclusion by ancestor element', -'Strategy_FixNesting: Node reorganized' => 'Contents of $CurrentToken.Compact node reorganized to enforce its content model', -'Strategy_FixNesting: Node contents removed' => 'Contents of $CurrentToken.Compact node removed', - -'AttrValidator: Attributes transformed' => 'Attributes on $CurrentToken.Compact transformed from $1.Keys to $2.Keys', -'AttrValidator: Attribute removed' => '$CurrentAttr.Name attribute on $CurrentToken.Compact removed', - -); - -$errorNames = array( - E_ERROR => 'Error', - E_WARNING => 'Warning', - E_NOTICE => 'Notice' -); - -// vim: et sw=4 sts=4 diff --git a/main/inc/lib/htmlpurifier/library/HTMLPurifier/Language/messages/index.html b/main/inc/lib/htmlpurifier/library/HTMLPurifier/Language/messages/index.html deleted file mode 100755 index aa7b9c934b..0000000000 --- a/main/inc/lib/htmlpurifier/library/HTMLPurifier/Language/messages/index.html +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/main/inc/lib/htmlpurifier/library/HTMLPurifier/LanguageFactory.php b/main/inc/lib/htmlpurifier/library/HTMLPurifier/LanguageFactory.php deleted file mode 100755 index 134ef8c745..0000000000 --- a/main/inc/lib/htmlpurifier/library/HTMLPurifier/LanguageFactory.php +++ /dev/null @@ -1,198 +0,0 @@ -cache[$language_code][$key] = $value - * @value array map - */ - public $cache; - - /** - * Valid keys in the HTMLPurifier_Language object. Designates which - * variables to slurp out of a message file. - * @value array list - */ - public $keys = array('fallback', 'messages', 'errorNames'); - - /** - * Instance of HTMLPurifier_AttrDef_Lang to validate language codes - * @value object HTMLPurifier_AttrDef_Lang - */ - protected $validator; - - /** - * Cached copy of dirname(__FILE__), directory of current file without - * trailing slash - * @value string filename - */ - protected $dir; - - /** - * Keys whose contents are a hash map and can be merged - * @value array lookup - */ - protected $mergeable_keys_map = array('messages' => true, 'errorNames' => true); - - /** - * Keys whose contents are a list and can be merged - * @value array lookup - */ - protected $mergeable_keys_list = array(); - - /** - * Retrieve sole instance of the factory. - * @param $prototype Optional prototype to overload sole instance with, - * or bool true to reset to default factory. - */ - public static function instance($prototype = null) { - static $instance = null; - if ($prototype !== null) { - $instance = $prototype; - } elseif ($instance === null || $prototype == true) { - $instance = new HTMLPurifier_LanguageFactory(); - $instance->setup(); - } - return $instance; - } - - /** - * Sets up the singleton, much like a constructor - * @note Prevents people from getting this outside of the singleton - */ - public function setup() { - $this->validator = new HTMLPurifier_AttrDef_Lang(); - $this->dir = HTMLPURIFIER_PREFIX . '/HTMLPurifier'; - } - - /** - * Creates a language object, handles class fallbacks - * @param $config Instance of HTMLPurifier_Config - * @param $context Instance of HTMLPurifier_Context - * @param $code Code to override configuration with. Private parameter. - */ - public function create($config, $context, $code = false) { - - // validate language code - if ($code === false) { - $code = $this->validator->validate( - $config->get('Core.Language'), $config, $context - ); - } else { - $code = $this->validator->validate($code, $config, $context); - } - if ($code === false) $code = 'en'; // malformed code becomes English - - $pcode = str_replace('-', '_', $code); // make valid PHP classname - static $depth = 0; // recursion protection - - if ($code == 'en') { - $lang = new HTMLPurifier_Language($config, $context); - } else { - $class = 'HTMLPurifier_Language_' . $pcode; - $file = $this->dir . '/Language/classes/' . $code . '.php'; - if (file_exists($file) || class_exists($class, false)) { - $lang = new $class($config, $context); - } else { - // Go fallback - $raw_fallback = $this->getFallbackFor($code); - $fallback = $raw_fallback ? $raw_fallback : 'en'; - $depth++; - $lang = $this->create($config, $context, $fallback); - if (!$raw_fallback) { - $lang->error = true; - } - $depth--; - } - } - - $lang->code = $code; - - return $lang; - - } - - /** - * Returns the fallback language for language - * @note Loads the original language into cache - * @param $code string language code - */ - public function getFallbackFor($code) { - $this->loadLanguage($code); - return $this->cache[$code]['fallback']; - } - - /** - * Loads language into the cache, handles message file and fallbacks - * @param $code string language code - */ - public function loadLanguage($code) { - static $languages_seen = array(); // recursion guard - - // abort if we've already loaded it - if (isset($this->cache[$code])) return; - - // generate filename - $filename = $this->dir . '/Language/messages/' . $code . '.php'; - - // default fallback : may be overwritten by the ensuing include - $fallback = ($code != 'en') ? 'en' : false; - - // load primary localisation - if (!file_exists($filename)) { - // skip the include: will rely solely on fallback - $filename = $this->dir . '/Language/messages/en.php'; - $cache = array(); - } else { - include $filename; - $cache = compact($this->keys); - } - - // load fallback localisation - if (!empty($fallback)) { - - // infinite recursion guard - if (isset($languages_seen[$code])) { - trigger_error('Circular fallback reference in language ' . - $code, E_USER_ERROR); - $fallback = 'en'; - } - $language_seen[$code] = true; - - // load the fallback recursively - $this->loadLanguage($fallback); - $fallback_cache = $this->cache[$fallback]; - - // merge fallback with current language - foreach ( $this->keys as $key ) { - if (isset($cache[$key]) && isset($fallback_cache[$key])) { - if (isset($this->mergeable_keys_map[$key])) { - $cache[$key] = $cache[$key] + $fallback_cache[$key]; - } elseif (isset($this->mergeable_keys_list[$key])) { - $cache[$key] = array_merge( $fallback_cache[$key], $cache[$key] ); - } - } else { - $cache[$key] = $fallback_cache[$key]; - } - } - - } - - // save to cache for later retrieval - $this->cache[$code] = $cache; - - return; - } - -} - -// vim: et sw=4 sts=4 diff --git a/main/inc/lib/htmlpurifier/library/HTMLPurifier/Length.php b/main/inc/lib/htmlpurifier/library/HTMLPurifier/Length.php deleted file mode 100755 index 8d2a46b7da..0000000000 --- a/main/inc/lib/htmlpurifier/library/HTMLPurifier/Length.php +++ /dev/null @@ -1,115 +0,0 @@ - true, 'ex' => true, 'px' => true, 'in' => true, - 'cm' => true, 'mm' => true, 'pt' => true, 'pc' => true - ); - - /** - * @param number $n Magnitude - * @param string $u Unit - */ - public function __construct($n = '0', $u = false) { - $this->n = (string) $n; - $this->unit = $u !== false ? (string) $u : false; - } - - /** - * @param string $s Unit string, like '2em' or '3.4in' - * @warning Does not perform validation. - */ - static public function make($s) { - if ($s instanceof HTMLPurifier_Length) return $s; - $n_length = strspn($s, '1234567890.+-'); - $n = substr($s, 0, $n_length); - $unit = substr($s, $n_length); - if ($unit === '') $unit = false; - return new HTMLPurifier_Length($n, $unit); - } - - /** - * Validates the number and unit. - */ - protected function validate() { - // Special case: - if ($this->n === '+0' || $this->n === '-0') $this->n = '0'; - if ($this->n === '0' && $this->unit === false) return true; - if (!ctype_lower($this->unit)) $this->unit = strtolower($this->unit); - if (!isset(HTMLPurifier_Length::$allowedUnits[$this->unit])) return false; - // Hack: - $def = new HTMLPurifier_AttrDef_CSS_Number(); - $result = $def->validate($this->n, false, false); - if ($result === false) return false; - $this->n = $result; - return true; - } - - /** - * Returns string representation of number. - */ - public function toString() { - if (!$this->isValid()) return false; - return $this->n . $this->unit; - } - - /** - * Retrieves string numeric magnitude. - */ - public function getN() {return $this->n;} - - /** - * Retrieves string unit. - */ - public function getUnit() {return $this->unit;} - - /** - * Returns true if this length unit is valid. - */ - public function isValid() { - if ($this->isValid === null) $this->isValid = $this->validate(); - return $this->isValid; - } - - /** - * Compares two lengths, and returns 1 if greater, -1 if less and 0 if equal. - * @warning If both values are too large or small, this calculation will - * not work properly - */ - public function compareTo($l) { - if ($l === false) return false; - if ($l->unit !== $this->unit) { - $converter = new HTMLPurifier_UnitConverter(); - $l = $converter->convert($l, $this->unit); - if ($l === false) return false; - } - return $this->n - $l->n; - } - -} - -// vim: et sw=4 sts=4 diff --git a/main/inc/lib/htmlpurifier/library/HTMLPurifier/Lexer.php b/main/inc/lib/htmlpurifier/library/HTMLPurifier/Lexer.php deleted file mode 100755 index 24a5418b3e..0000000000 --- a/main/inc/lib/htmlpurifier/library/HTMLPurifier/Lexer.php +++ /dev/null @@ -1,326 +0,0 @@ -get('Core.LexerImpl'); - } - - $needs_tracking = - $config->get('Core.MaintainLineNumbers') || - $config->get('Core.CollectErrors'); - - $inst = null; - if (is_object($lexer)) { - $inst = $lexer; - } else { - - if (is_null($lexer)) { do { - // auto-detection algorithm - - if ($needs_tracking) { - $lexer = 'DirectLex'; - break; - } - - if ( - class_exists('DOMDocument') && - method_exists('DOMDocument', 'loadHTML') && - !extension_loaded('domxml') - ) { - // check for DOM support, because while it's part of the - // core, it can be disabled compile time. Also, the PECL - // domxml extension overrides the default DOM, and is evil - // and nasty and we shan't bother to support it - $lexer = 'DOMLex'; - } else { - $lexer = 'DirectLex'; - } - - } while(0); } // do..while so we can break - - // instantiate recognized string names - switch ($lexer) { - case 'DOMLex': - $inst = new HTMLPurifier_Lexer_DOMLex(); - break; - case 'DirectLex': - $inst = new HTMLPurifier_Lexer_DirectLex(); - break; - case 'PH5P': - $inst = new HTMLPurifier_Lexer_PH5P(); - break; - default: - throw new HTMLPurifier_Exception("Cannot instantiate unrecognized Lexer type " . htmlspecialchars($lexer)); - } - } - - if (!$inst) throw new HTMLPurifier_Exception('No lexer was instantiated'); - - // once PHP DOM implements native line numbers, or we - // hack out something using XSLT, remove this stipulation - if ($needs_tracking && !$inst->tracksLineNumbers) { - throw new HTMLPurifier_Exception('Cannot use lexer that does not support line numbers with Core.MaintainLineNumbers or Core.CollectErrors (use DirectLex instead)'); - } - - return $inst; - - } - - // -- CONVENIENCE MEMBERS --------------------------------------------- - - public function __construct() { - $this->_entity_parser = new HTMLPurifier_EntityParser(); - } - - /** - * Most common entity to raw value conversion table for special entities. - */ - protected $_special_entity2str = - array( - '"' => '"', - '&' => '&', - '<' => '<', - '>' => '>', - ''' => "'", - ''' => "'", - ''' => "'" - ); - - /** - * Parses special entities into the proper characters. - * - * This string will translate escaped versions of the special characters - * into the correct ones. - * - * @warning - * You should be able to treat the output of this function as - * completely parsed, but that's only because all other entities should - * have been handled previously in substituteNonSpecialEntities() - * - * @param $string String character data to be parsed. - * @returns Parsed character data. - */ - public function parseData($string) { - - // following functions require at least one character - if ($string === '') return ''; - - // subtracts amps that cannot possibly be escaped - $num_amp = substr_count($string, '&') - substr_count($string, '& ') - - ($string[strlen($string)-1] === '&' ? 1 : 0); - - if (!$num_amp) return $string; // abort if no entities - $num_esc_amp = substr_count($string, '&'); - $string = strtr($string, $this->_special_entity2str); - - // code duplication for sake of optimization, see above - $num_amp_2 = substr_count($string, '&') - substr_count($string, '& ') - - ($string[strlen($string)-1] === '&' ? 1 : 0); - - if ($num_amp_2 <= $num_esc_amp) return $string; - - // hmm... now we have some uncommon entities. Use the callback. - $string = $this->_entity_parser->substituteSpecialEntities($string); - return $string; - } - - /** - * Lexes an HTML string into tokens. - * - * @param $string String HTML. - * @return HTMLPurifier_Token array representation of HTML. - */ - public function tokenizeHTML($string, $config, $context) { - trigger_error('Call to abstract class', E_USER_ERROR); - } - - /** - * Translates CDATA sections into regular sections (through escaping). - * - * @param $string HTML string to process. - * @returns HTML with CDATA sections escaped. - */ - protected static function escapeCDATA($string) { - return preg_replace_callback( - '//s', - array('HTMLPurifier_Lexer', 'CDATACallback'), - $string - ); - } - - /** - * Special CDATA case that is especially convoluted for )#si', - array($this, 'scriptCallback'), $html); - } - - $html = $this->normalize($html, $config, $context); - - $cursor = 0; // our location in the text - $inside_tag = false; // whether or not we're parsing the inside of a tag - $array = array(); // result array - - // This is also treated to mean maintain *column* numbers too - $maintain_line_numbers = $config->get('Core.MaintainLineNumbers'); - - if ($maintain_line_numbers === null) { - // automatically determine line numbering by checking - // if error collection is on - $maintain_line_numbers = $config->get('Core.CollectErrors'); - } - - if ($maintain_line_numbers) { - $current_line = 1; - $current_col = 0; - $length = strlen($html); - } else { - $current_line = false; - $current_col = false; - $length = false; - } - $context->register('CurrentLine', $current_line); - $context->register('CurrentCol', $current_col); - $nl = "\n"; - // how often to manually recalculate. This will ALWAYS be right, - // but it's pretty wasteful. Set to 0 to turn off - $synchronize_interval = $config->get('Core.DirectLexLineNumberSyncInterval'); - - $e = false; - if ($config->get('Core.CollectErrors')) { - $e =& $context->get('ErrorCollector'); - } - - // for testing synchronization - $loops = 0; - - while(++$loops) { - - // $cursor is either at the start of a token, or inside of - // a tag (i.e. there was a < immediately before it), as indicated - // by $inside_tag - - if ($maintain_line_numbers) { - - // $rcursor, however, is always at the start of a token. - $rcursor = $cursor - (int) $inside_tag; - - // Column number is cheap, so we calculate it every round. - // We're interested at the *end* of the newline string, so - // we need to add strlen($nl) == 1 to $nl_pos before subtracting it - // from our "rcursor" position. - $nl_pos = strrpos($html, $nl, $rcursor - $length); - $current_col = $rcursor - (is_bool($nl_pos) ? 0 : $nl_pos + 1); - - // recalculate lines - if ( - $synchronize_interval && // synchronization is on - $cursor > 0 && // cursor is further than zero - $loops % $synchronize_interval === 0 // time to synchronize! - ) { - $current_line = 1 + $this->substrCount($html, $nl, 0, $cursor); - } - - } - - $position_next_lt = strpos($html, '<', $cursor); - $position_next_gt = strpos($html, '>', $cursor); - - // triggers on "asdf" but not "asdf " - // special case to set up context - if ($position_next_lt === $cursor) { - $inside_tag = true; - $cursor++; - } - - if (!$inside_tag && $position_next_lt !== false) { - // We are not inside tag and there still is another tag to parse - $token = new - HTMLPurifier_Token_Text( - $this->parseData( - substr( - $html, $cursor, $position_next_lt - $cursor - ) - ) - ); - if ($maintain_line_numbers) { - $token->rawPosition($current_line, $current_col); - $current_line += $this->substrCount($html, $nl, $cursor, $position_next_lt - $cursor); - } - $array[] = $token; - $cursor = $position_next_lt + 1; - $inside_tag = true; - continue; - } elseif (!$inside_tag) { - // We are not inside tag but there are no more tags - // If we're already at the end, break - if ($cursor === strlen($html)) break; - // Create Text of rest of string - $token = new - HTMLPurifier_Token_Text( - $this->parseData( - substr( - $html, $cursor - ) - ) - ); - if ($maintain_line_numbers) $token->rawPosition($current_line, $current_col); - $array[] = $token; - break; - } elseif ($inside_tag && $position_next_gt !== false) { - // We are in tag and it is well formed - // Grab the internals of the tag - $strlen_segment = $position_next_gt - $cursor; - - if ($strlen_segment < 1) { - // there's nothing to process! - $token = new HTMLPurifier_Token_Text('<'); - $cursor++; - continue; - } - - $segment = substr($html, $cursor, $strlen_segment); - - if ($segment === false) { - // somehow, we attempted to access beyond the end of - // the string, defense-in-depth, reported by Nate Abele - break; - } - - // Check if it's a comment - if ( - substr($segment, 0, 3) === '!--' - ) { - // re-determine segment length, looking for --> - $position_comment_end = strpos($html, '-->', $cursor); - if ($position_comment_end === false) { - // uh oh, we have a comment that extends to - // infinity. Can't be helped: set comment - // end position to end of string - if ($e) $e->send(E_WARNING, 'Lexer: Unclosed comment'); - $position_comment_end = strlen($html); - $end = true; - } else { - $end = false; - } - $strlen_segment = $position_comment_end - $cursor; - $segment = substr($html, $cursor, $strlen_segment); - $token = new - HTMLPurifier_Token_Comment( - substr( - $segment, 3, $strlen_segment - 3 - ) - ); - if ($maintain_line_numbers) { - $token->rawPosition($current_line, $current_col); - $current_line += $this->substrCount($html, $nl, $cursor, $strlen_segment); - } - $array[] = $token; - $cursor = $end ? $position_comment_end : $position_comment_end + 3; - $inside_tag = false; - continue; - } - - // Check if it's an end tag - $is_end_tag = (strpos($segment,'/') === 0); - if ($is_end_tag) { - $type = substr($segment, 1); - $token = new HTMLPurifier_Token_End($type); - if ($maintain_line_numbers) { - $token->rawPosition($current_line, $current_col); - $current_line += $this->substrCount($html, $nl, $cursor, $position_next_gt - $cursor); - } - $array[] = $token; - $inside_tag = false; - $cursor = $position_next_gt + 1; - continue; - } - - // Check leading character is alnum, if not, we may - // have accidently grabbed an emoticon. Translate into - // text and go our merry way - if (!ctype_alpha($segment[0])) { - // XML: $segment[0] !== '_' && $segment[0] !== ':' - if ($e) $e->send(E_NOTICE, 'Lexer: Unescaped lt'); - $token = new HTMLPurifier_Token_Text('<'); - if ($maintain_line_numbers) { - $token->rawPosition($current_line, $current_col); - $current_line += $this->substrCount($html, $nl, $cursor, $position_next_gt - $cursor); - } - $array[] = $token; - $inside_tag = false; - continue; - } - - // Check if it is explicitly self closing, if so, remove - // trailing slash. Remember, we could have a tag like
      , so - // any later token processing scripts must convert improperly - // classified EmptyTags from StartTags. - $is_self_closing = (strrpos($segment,'/') === $strlen_segment-1); - if ($is_self_closing) { - $strlen_segment--; - $segment = substr($segment, 0, $strlen_segment); - } - - // Check if there are any attributes - $position_first_space = strcspn($segment, $this->_whitespace); - - if ($position_first_space >= $strlen_segment) { - if ($is_self_closing) { - $token = new HTMLPurifier_Token_Empty($segment); - } else { - $token = new HTMLPurifier_Token_Start($segment); - } - if ($maintain_line_numbers) { - $token->rawPosition($current_line, $current_col); - $current_line += $this->substrCount($html, $nl, $cursor, $position_next_gt - $cursor); - } - $array[] = $token; - $inside_tag = false; - $cursor = $position_next_gt + 1; - continue; - } - - // Grab out all the data - $type = substr($segment, 0, $position_first_space); - $attribute_string = - trim( - substr( - $segment, $position_first_space - ) - ); - if ($attribute_string) { - $attr = $this->parseAttributeString( - $attribute_string - , $config, $context - ); - } else { - $attr = array(); - } - - if ($is_self_closing) { - $token = new HTMLPurifier_Token_Empty($type, $attr); - } else { - $token = new HTMLPurifier_Token_Start($type, $attr); - } - if ($maintain_line_numbers) { - $token->rawPosition($current_line, $current_col); - $current_line += $this->substrCount($html, $nl, $cursor, $position_next_gt - $cursor); - } - $array[] = $token; - $cursor = $position_next_gt + 1; - $inside_tag = false; - continue; - } else { - // inside tag, but there's no ending > sign - if ($e) $e->send(E_WARNING, 'Lexer: Missing gt'); - $token = new - HTMLPurifier_Token_Text( - '<' . - $this->parseData( - substr($html, $cursor) - ) - ); - if ($maintain_line_numbers) $token->rawPosition($current_line, $current_col); - // no cursor scroll? Hmm... - $array[] = $token; - break; - } - break; - } - - $context->destroy('CurrentLine'); - $context->destroy('CurrentCol'); - return $array; - } - - /** - * PHP 5.0.x compatible substr_count that implements offset and length - */ - protected function substrCount($haystack, $needle, $offset, $length) { - static $oldVersion; - if ($oldVersion === null) { - $oldVersion = version_compare(PHP_VERSION, '5.1', '<'); - } - if ($oldVersion) { - $haystack = substr($haystack, $offset, $length); - return substr_count($haystack, $needle); - } else { - return substr_count($haystack, $needle, $offset, $length); - } - } - - /** - * Takes the inside of an HTML tag and makes an assoc array of attributes. - * - * @param $string Inside of tag excluding name. - * @returns Assoc array of attributes. - */ - public function parseAttributeString($string, $config, $context) { - $string = (string) $string; // quick typecast - - if ($string == '') return array(); // no attributes - - $e = false; - if ($config->get('Core.CollectErrors')) { - $e =& $context->get('ErrorCollector'); - } - - // let's see if we can abort as quickly as possible - // one equal sign, no spaces => one attribute - $num_equal = substr_count($string, '='); - $has_space = strpos($string, ' '); - if ($num_equal === 0 && !$has_space) { - // bool attribute - return array($string => $string); - } elseif ($num_equal === 1 && !$has_space) { - // only one attribute - list($key, $quoted_value) = explode('=', $string); - $quoted_value = trim($quoted_value); - if (!$key) { - if ($e) $e->send(E_ERROR, 'Lexer: Missing attribute key'); - return array(); - } - if (!$quoted_value) return array($key => ''); - $first_char = @$quoted_value[0]; - $last_char = @$quoted_value[strlen($quoted_value)-1]; - - $same_quote = ($first_char == $last_char); - $open_quote = ($first_char == '"' || $first_char == "'"); - - if ( $same_quote && $open_quote) { - // well behaved - $value = substr($quoted_value, 1, strlen($quoted_value) - 2); - } else { - // not well behaved - if ($open_quote) { - if ($e) $e->send(E_ERROR, 'Lexer: Missing end quote'); - $value = substr($quoted_value, 1); - } else { - $value = $quoted_value; - } - } - if ($value === false) $value = ''; - return array($key => $this->parseData($value)); - } - - // setup loop environment - $array = array(); // return assoc array of attributes - $cursor = 0; // current position in string (moves forward) - $size = strlen($string); // size of the string (stays the same) - - // if we have unquoted attributes, the parser expects a terminating - // space, so let's guarantee that there's always a terminating space. - $string .= ' '; - - while(true) { - - if ($cursor >= $size) { - break; - } - - $cursor += ($value = strspn($string, $this->_whitespace, $cursor)); - // grab the key - - $key_begin = $cursor; //we're currently at the start of the key - - // scroll past all characters that are the key (not whitespace or =) - $cursor += strcspn($string, $this->_whitespace . '=', $cursor); - - $key_end = $cursor; // now at the end of the key - - $key = substr($string, $key_begin, $key_end - $key_begin); - - if (!$key) { - if ($e) $e->send(E_ERROR, 'Lexer: Missing attribute key'); - $cursor += strcspn($string, $this->_whitespace, $cursor + 1); // prevent infinite loop - continue; // empty key - } - - // scroll past all whitespace - $cursor += strspn($string, $this->_whitespace, $cursor); - - if ($cursor >= $size) { - $array[$key] = $key; - break; - } - - // if the next character is an equal sign, we've got a regular - // pair, otherwise, it's a bool attribute - $first_char = @$string[$cursor]; - - if ($first_char == '=') { - // key="value" - - $cursor++; - $cursor += strspn($string, $this->_whitespace, $cursor); - - if ($cursor === false) { - $array[$key] = ''; - break; - } - - // we might be in front of a quote right now - - $char = @$string[$cursor]; - - if ($char == '"' || $char == "'") { - // it's quoted, end bound is $char - $cursor++; - $value_begin = $cursor; - $cursor = strpos($string, $char, $cursor); - $value_end = $cursor; - } else { - // it's not quoted, end bound is whitespace - $value_begin = $cursor; - $cursor += strcspn($string, $this->_whitespace, $cursor); - $value_end = $cursor; - } - - // we reached a premature end - if ($cursor === false) { - $cursor = $size; - $value_end = $cursor; - } - - $value = substr($string, $value_begin, $value_end - $value_begin); - if ($value === false) $value = ''; - $array[$key] = $this->parseData($value); - $cursor++; - - } else { - // boolattr - if ($key !== '') { - $array[$key] = $key; - } else { - // purely theoretical - if ($e) $e->send(E_ERROR, 'Lexer: Missing attribute key'); - } - - } - } - return $array; - } - -} - -// vim: et sw=4 sts=4 diff --git a/main/inc/lib/htmlpurifier/library/HTMLPurifier/Lexer/PEARSax3.php b/main/inc/lib/htmlpurifier/library/HTMLPurifier/Lexer/PEARSax3.php deleted file mode 100755 index 1d358c7b6b..0000000000 --- a/main/inc/lib/htmlpurifier/library/HTMLPurifier/Lexer/PEARSax3.php +++ /dev/null @@ -1,139 +0,0 @@ -tokens = array(); - $this->last_token_was_empty = false; - - $string = $this->normalize($string, $config, $context); - - $this->parent_handler = set_error_handler(array($this, 'muteStrictErrorHandler')); - - $parser = new XML_HTMLSax3(); - $parser->set_object($this); - $parser->set_element_handler('openHandler','closeHandler'); - $parser->set_data_handler('dataHandler'); - $parser->set_escape_handler('escapeHandler'); - - // doesn't seem to work correctly for attributes - $parser->set_option('XML_OPTION_ENTITIES_PARSED', 1); - - $parser->parse($string); - - restore_error_handler(); - - return $this->tokens; - - } - - /** - * Open tag event handler, interface is defined by PEAR package. - */ - public function openHandler(&$parser, $name, $attrs, $closed) { - // entities are not resolved in attrs - foreach ($attrs as $key => $attr) { - $attrs[$key] = $this->parseData($attr); - } - if ($closed) { - $this->tokens[] = new HTMLPurifier_Token_Empty($name, $attrs); - $this->last_token_was_empty = true; - } else { - $this->tokens[] = new HTMLPurifier_Token_Start($name, $attrs); - } - $this->stack[] = $name; - return true; - } - - /** - * Close tag event handler, interface is defined by PEAR package. - */ - public function closeHandler(&$parser, $name) { - // HTMLSax3 seems to always send empty tags an extra close tag - // check and ignore if you see it: - // [TESTME] to make sure it doesn't overreach - if ($this->last_token_was_empty) { - $this->last_token_was_empty = false; - return true; - } - $this->tokens[] = new HTMLPurifier_Token_End($name); - if (!empty($this->stack)) array_pop($this->stack); - return true; - } - - /** - * Data event handler, interface is defined by PEAR package. - */ - public function dataHandler(&$parser, $data) { - $this->last_token_was_empty = false; - $this->tokens[] = new HTMLPurifier_Token_Text($data); - return true; - } - - /** - * Escaped text handler, interface is defined by PEAR package. - */ - public function escapeHandler(&$parser, $data) { - if (strpos($data, '--') === 0) { - // remove trailing and leading double-dashes - $data = substr($data, 2); - if (strlen($data) >= 2 && substr($data, -2) == "--") { - $data = substr($data, 0, -2); - } - if (isset($this->stack[sizeof($this->stack) - 1]) && - $this->stack[sizeof($this->stack) - 1] == "style") { - $this->tokens[] = new HTMLPurifier_Token_Text($data); - } else { - $this->tokens[] = new HTMLPurifier_Token_Comment($data); - } - $this->last_token_was_empty = false; - } - // CDATA is handled elsewhere, but if it was handled here: - //if (strpos($data, '[CDATA[') === 0) { - // $this->tokens[] = new HTMLPurifier_Token_Text( - // substr($data, 7, strlen($data) - 9) ); - //} - return true; - } - - /** - * An error handler that mutes strict errors - */ - public function muteStrictErrorHandler($errno, $errstr, $errfile=null, $errline=null, $errcontext=null) { - if ($errno == E_STRICT) return; - return call_user_func($this->parent_handler, $errno, $errstr, $errfile, $errline, $errcontext); - } - -} - -// vim: et sw=4 sts=4 diff --git a/main/inc/lib/htmlpurifier/library/HTMLPurifier/Lexer/PH5P.php b/main/inc/lib/htmlpurifier/library/HTMLPurifier/Lexer/PH5P.php deleted file mode 100755 index a43c56f9e0..0000000000 --- a/main/inc/lib/htmlpurifier/library/HTMLPurifier/Lexer/PH5P.php +++ /dev/null @@ -1,3904 +0,0 @@ -normalize($html, $config, $context); - $new_html = $this->wrapHTML($new_html, $config, $context); - try { - $parser = new HTML5($new_html); - $doc = $parser->save(); - } catch (DOMException $e) { - // Uh oh, it failed. Punt to DirectLex. - $lexer = new HTMLPurifier_Lexer_DirectLex(); - $context->register('PH5PError', $e); // save the error, so we can detect it - return $lexer->tokenizeHTML($html, $config, $context); // use original HTML - } - $tokens = array(); - $this->tokenizeDOM( - $doc->getElementsByTagName('html')->item(0)-> // - getElementsByTagName('body')->item(0)-> // - getElementsByTagName('div')->item(0) //
      - , $tokens); - return $tokens; - } - -} - -/* - -Copyright 2007 Jeroen van der Meer - -Permission is hereby granted, free of charge, to any person obtaining a -copy of this software and associated documentation files (the -"Software"), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be included -in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -*/ - -class HTML5 { - private $data; - private $char; - private $EOF; - private $state; - private $tree; - private $token; - private $content_model; - private $escape = false; - private $entities = array('AElig;','AElig','AMP;','AMP','Aacute;','Aacute', - 'Acirc;','Acirc','Agrave;','Agrave','Alpha;','Aring;','Aring','Atilde;', - 'Atilde','Auml;','Auml','Beta;','COPY;','COPY','Ccedil;','Ccedil','Chi;', - 'Dagger;','Delta;','ETH;','ETH','Eacute;','Eacute','Ecirc;','Ecirc','Egrave;', - 'Egrave','Epsilon;','Eta;','Euml;','Euml','GT;','GT','Gamma;','Iacute;', - 'Iacute','Icirc;','Icirc','Igrave;','Igrave','Iota;','Iuml;','Iuml','Kappa;', - 'LT;','LT','Lambda;','Mu;','Ntilde;','Ntilde','Nu;','OElig;','Oacute;', - 'Oacute','Ocirc;','Ocirc','Ograve;','Ograve','Omega;','Omicron;','Oslash;', - 'Oslash','Otilde;','Otilde','Ouml;','Ouml','Phi;','Pi;','Prime;','Psi;', - 'QUOT;','QUOT','REG;','REG','Rho;','Scaron;','Sigma;','THORN;','THORN', - 'TRADE;','Tau;','Theta;','Uacute;','Uacute','Ucirc;','Ucirc','Ugrave;', - 'Ugrave','Upsilon;','Uuml;','Uuml','Xi;','Yacute;','Yacute','Yuml;','Zeta;', - 'aacute;','aacute','acirc;','acirc','acute;','acute','aelig;','aelig', - 'agrave;','agrave','alefsym;','alpha;','amp;','amp','and;','ang;','apos;', - 'aring;','aring','asymp;','atilde;','atilde','auml;','auml','bdquo;','beta;', - 'brvbar;','brvbar','bull;','cap;','ccedil;','ccedil','cedil;','cedil', - 'cent;','cent','chi;','circ;','clubs;','cong;','copy;','copy','crarr;', - 'cup;','curren;','curren','dArr;','dagger;','darr;','deg;','deg','delta;', - 'diams;','divide;','divide','eacute;','eacute','ecirc;','ecirc','egrave;', - 'egrave','empty;','emsp;','ensp;','epsilon;','equiv;','eta;','eth;','eth', - 'euml;','euml','euro;','exist;','fnof;','forall;','frac12;','frac12', - 'frac14;','frac14','frac34;','frac34','frasl;','gamma;','ge;','gt;','gt', - 'hArr;','harr;','hearts;','hellip;','iacute;','iacute','icirc;','icirc', - 'iexcl;','iexcl','igrave;','igrave','image;','infin;','int;','iota;', - 'iquest;','iquest','isin;','iuml;','iuml','kappa;','lArr;','lambda;','lang;', - 'laquo;','laquo','larr;','lceil;','ldquo;','le;','lfloor;','lowast;','loz;', - 'lrm;','lsaquo;','lsquo;','lt;','lt','macr;','macr','mdash;','micro;','micro', - 'middot;','middot','minus;','mu;','nabla;','nbsp;','nbsp','ndash;','ne;', - 'ni;','not;','not','notin;','nsub;','ntilde;','ntilde','nu;','oacute;', - 'oacute','ocirc;','ocirc','oelig;','ograve;','ograve','oline;','omega;', - 'omicron;','oplus;','or;','ordf;','ordf','ordm;','ordm','oslash;','oslash', - 'otilde;','otilde','otimes;','ouml;','ouml','para;','para','part;','permil;', - 'perp;','phi;','pi;','piv;','plusmn;','plusmn','pound;','pound','prime;', - 'prod;','prop;','psi;','quot;','quot','rArr;','radic;','rang;','raquo;', - 'raquo','rarr;','rceil;','rdquo;','real;','reg;','reg','rfloor;','rho;', - 'rlm;','rsaquo;','rsquo;','sbquo;','scaron;','sdot;','sect;','sect','shy;', - 'shy','sigma;','sigmaf;','sim;','spades;','sub;','sube;','sum;','sup1;', - 'sup1','sup2;','sup2','sup3;','sup3','sup;','supe;','szlig;','szlig','tau;', - 'there4;','theta;','thetasym;','thinsp;','thorn;','thorn','tilde;','times;', - 'times','trade;','uArr;','uacute;','uacute','uarr;','ucirc;','ucirc', - 'ugrave;','ugrave','uml;','uml','upsih;','upsilon;','uuml;','uuml','weierp;', - 'xi;','yacute;','yacute','yen;','yen','yuml;','yuml','zeta;','zwj;','zwnj;'); - - const PCDATA = 0; - const RCDATA = 1; - const CDATA = 2; - const PLAINTEXT = 3; - - const DOCTYPE = 0; - const STARTTAG = 1; - const ENDTAG = 2; - const COMMENT = 3; - const CHARACTR = 4; - const EOF = 5; - - public function __construct($data) { - - $this->data = $data; - $this->char = -1; - $this->EOF = strlen($data); - $this->tree = new HTML5TreeConstructer; - $this->content_model = self::PCDATA; - - $this->state = 'data'; - - while($this->state !== null) { - $this->{$this->state.'State'}(); - } - } - - public function save() { - return $this->tree->save(); - } - - private function char() { - return ($this->char < $this->EOF) - ? $this->data[$this->char] - : false; - } - - private function character($s, $l = 0) { - if($s + $l < $this->EOF) { - if($l === 0) { - return $this->data[$s]; - } else { - return substr($this->data, $s, $l); - } - } - } - - private function characters($char_class, $start) { - return preg_replace('#^(['.$char_class.']+).*#s', '\\1', substr($this->data, $start)); - } - - private function dataState() { - // Consume the next input character - $this->char++; - $char = $this->char(); - - if($char === '&' && ($this->content_model === self::PCDATA || $this->content_model === self::RCDATA)) { - /* U+0026 AMPERSAND (&) - When the content model flag is set to one of the PCDATA or RCDATA - states: switch to the entity data state. Otherwise: treat it as per - the "anything else" entry below. */ - $this->state = 'entityData'; - - } elseif($char === '-') { - /* If the content model flag is set to either the RCDATA state or - the CDATA state, and the escape flag is false, and there are at - least three characters before this one in the input stream, and the - last four characters in the input stream, including this one, are - U+003C LESS-THAN SIGN, U+0021 EXCLAMATION MARK, U+002D HYPHEN-MINUS, - and U+002D HYPHEN-MINUS (""), - set the escape flag to false. */ - if(($this->content_model === self::RCDATA || - $this->content_model === self::CDATA) && $this->escape === true && - $this->character($this->char, 3) === '-->') { - $this->escape = false; - } - - /* In any case, emit the input character as a character token. - Stay in the data state. */ - $this->emitToken(array( - 'type' => self::CHARACTR, - 'data' => $char - )); - - } elseif($this->char === $this->EOF) { - /* EOF - Emit an end-of-file token. */ - $this->EOF(); - - } elseif($this->content_model === self::PLAINTEXT) { - /* When the content model flag is set to the PLAINTEXT state - THIS DIFFERS GREATLY FROM THE SPEC: Get the remaining characters of - the text and emit it as a character token. */ - $this->emitToken(array( - 'type' => self::CHARACTR, - 'data' => substr($this->data, $this->char) - )); - - $this->EOF(); - - } else { - /* Anything else - THIS DIFFERS GREATLY FROM THE SPEC: Get as many character that - otherwise would also be treated as a character token and emit it - as a single character token. Stay in the data state. */ - $len = strcspn($this->data, '<&', $this->char); - $char = substr($this->data, $this->char, $len); - $this->char += $len - 1; - - $this->emitToken(array( - 'type' => self::CHARACTR, - 'data' => $char - )); - - $this->state = 'data'; - } - } - - private function entityDataState() { - // Attempt to consume an entity. - $entity = $this->entity(); - - // If nothing is returned, emit a U+0026 AMPERSAND character token. - // Otherwise, emit the character token that was returned. - $char = (!$entity) ? '&' : $entity; - $this->emitToken(array( - 'type' => self::CHARACTR, - 'data' => $char - )); - - // Finally, switch to the data state. - $this->state = 'data'; - } - - private function tagOpenState() { - switch($this->content_model) { - case self::RCDATA: - case self::CDATA: - /* If the next input character is a U+002F SOLIDUS (/) character, - consume it and switch to the close tag open state. If the next - input character is not a U+002F SOLIDUS (/) character, emit a - U+003C LESS-THAN SIGN character token and switch to the data - state to process the next input character. */ - if($this->character($this->char + 1) === '/') { - $this->char++; - $this->state = 'closeTagOpen'; - - } else { - $this->emitToken(array( - 'type' => self::CHARACTR, - 'data' => '<' - )); - - $this->state = 'data'; - } - break; - - case self::PCDATA: - // If the content model flag is set to the PCDATA state - // Consume the next input character: - $this->char++; - $char = $this->char(); - - if($char === '!') { - /* U+0021 EXCLAMATION MARK (!) - Switch to the markup declaration open state. */ - $this->state = 'markupDeclarationOpen'; - - } elseif($char === '/') { - /* U+002F SOLIDUS (/) - Switch to the close tag open state. */ - $this->state = 'closeTagOpen'; - - } elseif(preg_match('/^[A-Za-z]$/', $char)) { - /* U+0041 LATIN LETTER A through to U+005A LATIN LETTER Z - Create a new start tag token, set its tag name to the lowercase - version of the input character (add 0x0020 to the character's code - point), then switch to the tag name state. (Don't emit the token - yet; further details will be filled in before it is emitted.) */ - $this->token = array( - 'name' => strtolower($char), - 'type' => self::STARTTAG, - 'attr' => array() - ); - - $this->state = 'tagName'; - - } elseif($char === '>') { - /* U+003E GREATER-THAN SIGN (>) - Parse error. Emit a U+003C LESS-THAN SIGN character token and a - U+003E GREATER-THAN SIGN character token. Switch to the data state. */ - $this->emitToken(array( - 'type' => self::CHARACTR, - 'data' => '<>' - )); - - $this->state = 'data'; - - } elseif($char === '?') { - /* U+003F QUESTION MARK (?) - Parse error. Switch to the bogus comment state. */ - $this->state = 'bogusComment'; - - } else { - /* Anything else - Parse error. Emit a U+003C LESS-THAN SIGN character token and - reconsume the current input character in the data state. */ - $this->emitToken(array( - 'type' => self::CHARACTR, - 'data' => '<' - )); - - $this->char--; - $this->state = 'data'; - } - break; - } - } - - private function closeTagOpenState() { - $next_node = strtolower($this->characters('A-Za-z', $this->char + 1)); - $the_same = count($this->tree->stack) > 0 && $next_node === end($this->tree->stack)->nodeName; - - if(($this->content_model === self::RCDATA || $this->content_model === self::CDATA) && - (!$the_same || ($the_same && (!preg_match('/[\t\n\x0b\x0c >\/]/', - $this->character($this->char + 1 + strlen($next_node))) || $this->EOF === $this->char)))) { - /* If the content model flag is set to the RCDATA or CDATA states then - examine the next few characters. If they do not match the tag name of - the last start tag token emitted (case insensitively), or if they do but - they are not immediately followed by one of the following characters: - * U+0009 CHARACTER TABULATION - * U+000A LINE FEED (LF) - * U+000B LINE TABULATION - * U+000C FORM FEED (FF) - * U+0020 SPACE - * U+003E GREATER-THAN SIGN (>) - * U+002F SOLIDUS (/) - * EOF - ...then there is a parse error. Emit a U+003C LESS-THAN SIGN character - token, a U+002F SOLIDUS character token, and switch to the data state - to process the next input character. */ - $this->emitToken(array( - 'type' => self::CHARACTR, - 'data' => 'state = 'data'; - - } else { - /* Otherwise, if the content model flag is set to the PCDATA state, - or if the next few characters do match that tag name, consume the - next input character: */ - $this->char++; - $char = $this->char(); - - if(preg_match('/^[A-Za-z]$/', $char)) { - /* U+0041 LATIN LETTER A through to U+005A LATIN LETTER Z - Create a new end tag token, set its tag name to the lowercase version - of the input character (add 0x0020 to the character's code point), then - switch to the tag name state. (Don't emit the token yet; further details - will be filled in before it is emitted.) */ - $this->token = array( - 'name' => strtolower($char), - 'type' => self::ENDTAG - ); - - $this->state = 'tagName'; - - } elseif($char === '>') { - /* U+003E GREATER-THAN SIGN (>) - Parse error. Switch to the data state. */ - $this->state = 'data'; - - } elseif($this->char === $this->EOF) { - /* EOF - Parse error. Emit a U+003C LESS-THAN SIGN character token and a U+002F - SOLIDUS character token. Reconsume the EOF character in the data state. */ - $this->emitToken(array( - 'type' => self::CHARACTR, - 'data' => 'char--; - $this->state = 'data'; - - } else { - /* Parse error. Switch to the bogus comment state. */ - $this->state = 'bogusComment'; - } - } - } - - private function tagNameState() { - // Consume the next input character: - $this->char++; - $char = $this->character($this->char); - - if(preg_match('/^[\t\n\x0b\x0c ]$/', $char)) { - /* U+0009 CHARACTER TABULATION - U+000A LINE FEED (LF) - U+000B LINE TABULATION - U+000C FORM FEED (FF) - U+0020 SPACE - Switch to the before attribute name state. */ - $this->state = 'beforeAttributeName'; - - } elseif($char === '>') { - /* U+003E GREATER-THAN SIGN (>) - Emit the current tag token. Switch to the data state. */ - $this->emitToken($this->token); - $this->state = 'data'; - - } elseif($this->char === $this->EOF) { - /* EOF - Parse error. Emit the current tag token. Reconsume the EOF - character in the data state. */ - $this->emitToken($this->token); - - $this->char--; - $this->state = 'data'; - - } elseif($char === '/') { - /* U+002F SOLIDUS (/) - Parse error unless this is a permitted slash. Switch to the before - attribute name state. */ - $this->state = 'beforeAttributeName'; - - } else { - /* Anything else - Append the current input character to the current tag token's tag name. - Stay in the tag name state. */ - $this->token['name'] .= strtolower($char); - $this->state = 'tagName'; - } - } - - private function beforeAttributeNameState() { - // Consume the next input character: - $this->char++; - $char = $this->character($this->char); - - if(preg_match('/^[\t\n\x0b\x0c ]$/', $char)) { - /* U+0009 CHARACTER TABULATION - U+000A LINE FEED (LF) - U+000B LINE TABULATION - U+000C FORM FEED (FF) - U+0020 SPACE - Stay in the before attribute name state. */ - $this->state = 'beforeAttributeName'; - - } elseif($char === '>') { - /* U+003E GREATER-THAN SIGN (>) - Emit the current tag token. Switch to the data state. */ - $this->emitToken($this->token); - $this->state = 'data'; - - } elseif($char === '/') { - /* U+002F SOLIDUS (/) - Parse error unless this is a permitted slash. Stay in the before - attribute name state. */ - $this->state = 'beforeAttributeName'; - - } elseif($this->char === $this->EOF) { - /* EOF - Parse error. Emit the current tag token. Reconsume the EOF - character in the data state. */ - $this->emitToken($this->token); - - $this->char--; - $this->state = 'data'; - - } else { - /* Anything else - Start a new attribute in the current tag token. Set that attribute's - name to the current input character, and its value to the empty string. - Switch to the attribute name state. */ - $this->token['attr'][] = array( - 'name' => strtolower($char), - 'value' => null - ); - - $this->state = 'attributeName'; - } - } - - private function attributeNameState() { - // Consume the next input character: - $this->char++; - $char = $this->character($this->char); - - if(preg_match('/^[\t\n\x0b\x0c ]$/', $char)) { - /* U+0009 CHARACTER TABULATION - U+000A LINE FEED (LF) - U+000B LINE TABULATION - U+000C FORM FEED (FF) - U+0020 SPACE - Stay in the before attribute name state. */ - $this->state = 'afterAttributeName'; - - } elseif($char === '=') { - /* U+003D EQUALS SIGN (=) - Switch to the before attribute value state. */ - $this->state = 'beforeAttributeValue'; - - } elseif($char === '>') { - /* U+003E GREATER-THAN SIGN (>) - Emit the current tag token. Switch to the data state. */ - $this->emitToken($this->token); - $this->state = 'data'; - - } elseif($char === '/' && $this->character($this->char + 1) !== '>') { - /* U+002F SOLIDUS (/) - Parse error unless this is a permitted slash. Switch to the before - attribute name state. */ - $this->state = 'beforeAttributeName'; - - } elseif($this->char === $this->EOF) { - /* EOF - Parse error. Emit the current tag token. Reconsume the EOF - character in the data state. */ - $this->emitToken($this->token); - - $this->char--; - $this->state = 'data'; - - } else { - /* Anything else - Append the current input character to the current attribute's name. - Stay in the attribute name state. */ - $last = count($this->token['attr']) - 1; - $this->token['attr'][$last]['name'] .= strtolower($char); - - $this->state = 'attributeName'; - } - } - - private function afterAttributeNameState() { - // Consume the next input character: - $this->char++; - $char = $this->character($this->char); - - if(preg_match('/^[\t\n\x0b\x0c ]$/', $char)) { - /* U+0009 CHARACTER TABULATION - U+000A LINE FEED (LF) - U+000B LINE TABULATION - U+000C FORM FEED (FF) - U+0020 SPACE - Stay in the after attribute name state. */ - $this->state = 'afterAttributeName'; - - } elseif($char === '=') { - /* U+003D EQUALS SIGN (=) - Switch to the before attribute value state. */ - $this->state = 'beforeAttributeValue'; - - } elseif($char === '>') { - /* U+003E GREATER-THAN SIGN (>) - Emit the current tag token. Switch to the data state. */ - $this->emitToken($this->token); - $this->state = 'data'; - - } elseif($char === '/' && $this->character($this->char + 1) !== '>') { - /* U+002F SOLIDUS (/) - Parse error unless this is a permitted slash. Switch to the - before attribute name state. */ - $this->state = 'beforeAttributeName'; - - } elseif($this->char === $this->EOF) { - /* EOF - Parse error. Emit the current tag token. Reconsume the EOF - character in the data state. */ - $this->emitToken($this->token); - - $this->char--; - $this->state = 'data'; - - } else { - /* Anything else - Start a new attribute in the current tag token. Set that attribute's - name to the current input character, and its value to the empty string. - Switch to the attribute name state. */ - $this->token['attr'][] = array( - 'name' => strtolower($char), - 'value' => null - ); - - $this->state = 'attributeName'; - } - } - - private function beforeAttributeValueState() { - // Consume the next input character: - $this->char++; - $char = $this->character($this->char); - - if(preg_match('/^[\t\n\x0b\x0c ]$/', $char)) { - /* U+0009 CHARACTER TABULATION - U+000A LINE FEED (LF) - U+000B LINE TABULATION - U+000C FORM FEED (FF) - U+0020 SPACE - Stay in the before attribute value state. */ - $this->state = 'beforeAttributeValue'; - - } elseif($char === '"') { - /* U+0022 QUOTATION MARK (") - Switch to the attribute value (double-quoted) state. */ - $this->state = 'attributeValueDoubleQuoted'; - - } elseif($char === '&') { - /* U+0026 AMPERSAND (&) - Switch to the attribute value (unquoted) state and reconsume - this input character. */ - $this->char--; - $this->state = 'attributeValueUnquoted'; - - } elseif($char === '\'') { - /* U+0027 APOSTROPHE (') - Switch to the attribute value (single-quoted) state. */ - $this->state = 'attributeValueSingleQuoted'; - - } elseif($char === '>') { - /* U+003E GREATER-THAN SIGN (>) - Emit the current tag token. Switch to the data state. */ - $this->emitToken($this->token); - $this->state = 'data'; - - } else { - /* Anything else - Append the current input character to the current attribute's value. - Switch to the attribute value (unquoted) state. */ - $last = count($this->token['attr']) - 1; - $this->token['attr'][$last]['value'] .= $char; - - $this->state = 'attributeValueUnquoted'; - } - } - - private function attributeValueDoubleQuotedState() { - // Consume the next input character: - $this->char++; - $char = $this->character($this->char); - - if($char === '"') { - /* U+0022 QUOTATION MARK (") - Switch to the before attribute name state. */ - $this->state = 'beforeAttributeName'; - - } elseif($char === '&') { - /* U+0026 AMPERSAND (&) - Switch to the entity in attribute value state. */ - $this->entityInAttributeValueState('double'); - - } elseif($this->char === $this->EOF) { - /* EOF - Parse error. Emit the current tag token. Reconsume the character - in the data state. */ - $this->emitToken($this->token); - - $this->char--; - $this->state = 'data'; - - } else { - /* Anything else - Append the current input character to the current attribute's value. - Stay in the attribute value (double-quoted) state. */ - $last = count($this->token['attr']) - 1; - $this->token['attr'][$last]['value'] .= $char; - - $this->state = 'attributeValueDoubleQuoted'; - } - } - - private function attributeValueSingleQuotedState() { - // Consume the next input character: - $this->char++; - $char = $this->character($this->char); - - if($char === '\'') { - /* U+0022 QUOTATION MARK (') - Switch to the before attribute name state. */ - $this->state = 'beforeAttributeName'; - - } elseif($char === '&') { - /* U+0026 AMPERSAND (&) - Switch to the entity in attribute value state. */ - $this->entityInAttributeValueState('single'); - - } elseif($this->char === $this->EOF) { - /* EOF - Parse error. Emit the current tag token. Reconsume the character - in the data state. */ - $this->emitToken($this->token); - - $this->char--; - $this->state = 'data'; - - } else { - /* Anything else - Append the current input character to the current attribute's value. - Stay in the attribute value (single-quoted) state. */ - $last = count($this->token['attr']) - 1; - $this->token['attr'][$last]['value'] .= $char; - - $this->state = 'attributeValueSingleQuoted'; - } - } - - private function attributeValueUnquotedState() { - // Consume the next input character: - $this->char++; - $char = $this->character($this->char); - - if(preg_match('/^[\t\n\x0b\x0c ]$/', $char)) { - /* U+0009 CHARACTER TABULATION - U+000A LINE FEED (LF) - U+000B LINE TABULATION - U+000C FORM FEED (FF) - U+0020 SPACE - Switch to the before attribute name state. */ - $this->state = 'beforeAttributeName'; - - } elseif($char === '&') { - /* U+0026 AMPERSAND (&) - Switch to the entity in attribute value state. */ - $this->entityInAttributeValueState(); - - } elseif($char === '>') { - /* U+003E GREATER-THAN SIGN (>) - Emit the current tag token. Switch to the data state. */ - $this->emitToken($this->token); - $this->state = 'data'; - - } else { - /* Anything else - Append the current input character to the current attribute's value. - Stay in the attribute value (unquoted) state. */ - $last = count($this->token['attr']) - 1; - $this->token['attr'][$last]['value'] .= $char; - - $this->state = 'attributeValueUnquoted'; - } - } - - private function entityInAttributeValueState() { - // Attempt to consume an entity. - $entity = $this->entity(); - - // If nothing is returned, append a U+0026 AMPERSAND character to the - // current attribute's value. Otherwise, emit the character token that - // was returned. - $char = (!$entity) - ? '&' - : $entity; - - $last = count($this->token['attr']) - 1; - $this->token['attr'][$last]['value'] .= $char; - } - - private function bogusCommentState() { - /* Consume every character up to the first U+003E GREATER-THAN SIGN - character (>) or the end of the file (EOF), whichever comes first. Emit - a comment token whose data is the concatenation of all the characters - starting from and including the character that caused the state machine - to switch into the bogus comment state, up to and including the last - consumed character before the U+003E character, if any, or up to the - end of the file otherwise. (If the comment was started by the end of - the file (EOF), the token is empty.) */ - $data = $this->characters('^>', $this->char); - $this->emitToken(array( - 'data' => $data, - 'type' => self::COMMENT - )); - - $this->char += strlen($data); - - /* Switch to the data state. */ - $this->state = 'data'; - - /* If the end of the file was reached, reconsume the EOF character. */ - if($this->char === $this->EOF) { - $this->char = $this->EOF - 1; - } - } - - private function markupDeclarationOpenState() { - /* If the next two characters are both U+002D HYPHEN-MINUS (-) - characters, consume those two characters, create a comment token whose - data is the empty string, and switch to the comment state. */ - if($this->character($this->char + 1, 2) === '--') { - $this->char += 2; - $this->state = 'comment'; - $this->token = array( - 'data' => null, - 'type' => self::COMMENT - ); - - /* Otherwise if the next seven chacacters are a case-insensitive match - for the word "DOCTYPE", then consume those characters and switch to the - DOCTYPE state. */ - } elseif(strtolower($this->character($this->char + 1, 7)) === 'doctype') { - $this->char += 7; - $this->state = 'doctype'; - - /* Otherwise, is is a parse error. Switch to the bogus comment state. - The next character that is consumed, if any, is the first character - that will be in the comment. */ - } else { - $this->char++; - $this->state = 'bogusComment'; - } - } - - private function commentState() { - /* Consume the next input character: */ - $this->char++; - $char = $this->char(); - - /* U+002D HYPHEN-MINUS (-) */ - if($char === '-') { - /* Switch to the comment dash state */ - $this->state = 'commentDash'; - - /* EOF */ - } elseif($this->char === $this->EOF) { - /* Parse error. Emit the comment token. Reconsume the EOF character - in the data state. */ - $this->emitToken($this->token); - $this->char--; - $this->state = 'data'; - - /* Anything else */ - } else { - /* Append the input character to the comment token's data. Stay in - the comment state. */ - $this->token['data'] .= $char; - } - } - - private function commentDashState() { - /* Consume the next input character: */ - $this->char++; - $char = $this->char(); - - /* U+002D HYPHEN-MINUS (-) */ - if($char === '-') { - /* Switch to the comment end state */ - $this->state = 'commentEnd'; - - /* EOF */ - } elseif($this->char === $this->EOF) { - /* Parse error. Emit the comment token. Reconsume the EOF character - in the data state. */ - $this->emitToken($this->token); - $this->char--; - $this->state = 'data'; - - /* Anything else */ - } else { - /* Append a U+002D HYPHEN-MINUS (-) character and the input - character to the comment token's data. Switch to the comment state. */ - $this->token['data'] .= '-'.$char; - $this->state = 'comment'; - } - } - - private function commentEndState() { - /* Consume the next input character: */ - $this->char++; - $char = $this->char(); - - if($char === '>') { - $this->emitToken($this->token); - $this->state = 'data'; - - } elseif($char === '-') { - $this->token['data'] .= '-'; - - } elseif($this->char === $this->EOF) { - $this->emitToken($this->token); - $this->char--; - $this->state = 'data'; - - } else { - $this->token['data'] .= '--'.$char; - $this->state = 'comment'; - } - } - - private function doctypeState() { - /* Consume the next input character: */ - $this->char++; - $char = $this->char(); - - if(preg_match('/^[\t\n\x0b\x0c ]$/', $char)) { - $this->state = 'beforeDoctypeName'; - - } else { - $this->char--; - $this->state = 'beforeDoctypeName'; - } - } - - private function beforeDoctypeNameState() { - /* Consume the next input character: */ - $this->char++; - $char = $this->char(); - - if(preg_match('/^[\t\n\x0b\x0c ]$/', $char)) { - // Stay in the before DOCTYPE name state. - - } elseif(preg_match('/^[a-z]$/', $char)) { - $this->token = array( - 'name' => strtoupper($char), - 'type' => self::DOCTYPE, - 'error' => true - ); - - $this->state = 'doctypeName'; - - } elseif($char === '>') { - $this->emitToken(array( - 'name' => null, - 'type' => self::DOCTYPE, - 'error' => true - )); - - $this->state = 'data'; - - } elseif($this->char === $this->EOF) { - $this->emitToken(array( - 'name' => null, - 'type' => self::DOCTYPE, - 'error' => true - )); - - $this->char--; - $this->state = 'data'; - - } else { - $this->token = array( - 'name' => $char, - 'type' => self::DOCTYPE, - 'error' => true - ); - - $this->state = 'doctypeName'; - } - } - - private function doctypeNameState() { - /* Consume the next input character: */ - $this->char++; - $char = $this->char(); - - if(preg_match('/^[\t\n\x0b\x0c ]$/', $char)) { - $this->state = 'AfterDoctypeName'; - - } elseif($char === '>') { - $this->emitToken($this->token); - $this->state = 'data'; - - } elseif(preg_match('/^[a-z]$/', $char)) { - $this->token['name'] .= strtoupper($char); - - } elseif($this->char === $this->EOF) { - $this->emitToken($this->token); - $this->char--; - $this->state = 'data'; - - } else { - $this->token['name'] .= $char; - } - - $this->token['error'] = ($this->token['name'] === 'HTML') - ? false - : true; - } - - private function afterDoctypeNameState() { - /* Consume the next input character: */ - $this->char++; - $char = $this->char(); - - if(preg_match('/^[\t\n\x0b\x0c ]$/', $char)) { - // Stay in the DOCTYPE name state. - - } elseif($char === '>') { - $this->emitToken($this->token); - $this->state = 'data'; - - } elseif($this->char === $this->EOF) { - $this->emitToken($this->token); - $this->char--; - $this->state = 'data'; - - } else { - $this->token['error'] = true; - $this->state = 'bogusDoctype'; - } - } - - private function bogusDoctypeState() { - /* Consume the next input character: */ - $this->char++; - $char = $this->char(); - - if($char === '>') { - $this->emitToken($this->token); - $this->state = 'data'; - - } elseif($this->char === $this->EOF) { - $this->emitToken($this->token); - $this->char--; - $this->state = 'data'; - - } else { - // Stay in the bogus DOCTYPE state. - } - } - - private function entity() { - $start = $this->char; - - // This section defines how to consume an entity. This definition is - // used when parsing entities in text and in attributes. - - // The behaviour depends on the identity of the next character (the - // one immediately after the U+0026 AMPERSAND character): - - switch($this->character($this->char + 1)) { - // U+0023 NUMBER SIGN (#) - case '#': - - // The behaviour further depends on the character after the - // U+0023 NUMBER SIGN: - switch($this->character($this->char + 1)) { - // U+0078 LATIN SMALL LETTER X - // U+0058 LATIN CAPITAL LETTER X - case 'x': - case 'X': - // Follow the steps below, but using the range of - // characters U+0030 DIGIT ZERO through to U+0039 DIGIT - // NINE, U+0061 LATIN SMALL LETTER A through to U+0066 - // LATIN SMALL LETTER F, and U+0041 LATIN CAPITAL LETTER - // A, through to U+0046 LATIN CAPITAL LETTER F (in other - // words, 0-9, A-F, a-f). - $char = 1; - $char_class = '0-9A-Fa-f'; - break; - - // Anything else - default: - // Follow the steps below, but using the range of - // characters U+0030 DIGIT ZERO through to U+0039 DIGIT - // NINE (i.e. just 0-9). - $char = 0; - $char_class = '0-9'; - break; - } - - // Consume as many characters as match the range of characters - // given above. - $this->char++; - $e_name = $this->characters($char_class, $this->char + $char + 1); - $entity = $this->character($start, $this->char); - $cond = strlen($e_name) > 0; - - // The rest of the parsing happens bellow. - break; - - // Anything else - default: - // Consume the maximum number of characters possible, with the - // consumed characters case-sensitively matching one of the - // identifiers in the first column of the entities table. - $e_name = $this->characters('0-9A-Za-z;', $this->char + 1); - $len = strlen($e_name); - - for($c = 1; $c <= $len; $c++) { - $id = substr($e_name, 0, $c); - $this->char++; - - if(in_array($id, $this->entities)) { - if ($e_name[$c-1] !== ';') { - if ($c < $len && $e_name[$c] == ';') { - $this->char++; // consume extra semicolon - } - } - $entity = $id; - break; - } - } - - $cond = isset($entity); - // The rest of the parsing happens bellow. - break; - } - - if(!$cond) { - // If no match can be made, then this is a parse error. No - // characters are consumed, and nothing is returned. - $this->char = $start; - return false; - } - - // Return a character token for the character corresponding to the - // entity name (as given by the second column of the entities table). - return html_entity_decode('&'.$entity.';', ENT_QUOTES, 'UTF-8'); - } - - private function emitToken($token) { - $emit = $this->tree->emitToken($token); - - if(is_int($emit)) { - $this->content_model = $emit; - - } elseif($token['type'] === self::ENDTAG) { - $this->content_model = self::PCDATA; - } - } - - private function EOF() { - $this->state = null; - $this->tree->emitToken(array( - 'type' => self::EOF - )); - } -} - -class HTML5TreeConstructer { - public $stack = array(); - - private $phase; - private $mode; - private $dom; - private $foster_parent = null; - private $a_formatting = array(); - - private $head_pointer = null; - private $form_pointer = null; - - private $scoping = array('button','caption','html','marquee','object','table','td','th'); - private $formatting = array('a','b','big','em','font','i','nobr','s','small','strike','strong','tt','u'); - private $special = array('address','area','base','basefont','bgsound', - 'blockquote','body','br','center','col','colgroup','dd','dir','div','dl', - 'dt','embed','fieldset','form','frame','frameset','h1','h2','h3','h4','h5', - 'h6','head','hr','iframe','image','img','input','isindex','li','link', - 'listing','menu','meta','noembed','noframes','noscript','ol','optgroup', - 'option','p','param','plaintext','pre','script','select','spacer','style', - 'tbody','textarea','tfoot','thead','title','tr','ul','wbr'); - - // The different phases. - const INIT_PHASE = 0; - const ROOT_PHASE = 1; - const MAIN_PHASE = 2; - const END_PHASE = 3; - - // The different insertion modes for the main phase. - const BEFOR_HEAD = 0; - const IN_HEAD = 1; - const AFTER_HEAD = 2; - const IN_BODY = 3; - const IN_TABLE = 4; - const IN_CAPTION = 5; - const IN_CGROUP = 6; - const IN_TBODY = 7; - const IN_ROW = 8; - const IN_CELL = 9; - const IN_SELECT = 10; - const AFTER_BODY = 11; - const IN_FRAME = 12; - const AFTR_FRAME = 13; - - // The different types of elements. - const SPECIAL = 0; - const SCOPING = 1; - const FORMATTING = 2; - const PHRASING = 3; - - const MARKER = 0; - - public function __construct() { - $this->phase = self::INIT_PHASE; - $this->mode = self::BEFOR_HEAD; - $this->dom = new DOMDocument; - - $this->dom->encoding = 'UTF-8'; - $this->dom->preserveWhiteSpace = true; - $this->dom->substituteEntities = true; - $this->dom->strictErrorChecking = false; - } - - // Process tag tokens - public function emitToken($token) { - switch($this->phase) { - case self::INIT_PHASE: return $this->initPhase($token); break; - case self::ROOT_PHASE: return $this->rootElementPhase($token); break; - case self::MAIN_PHASE: return $this->mainPhase($token); break; - case self::END_PHASE : return $this->trailingEndPhase($token); break; - } - } - - private function initPhase($token) { - /* Initially, the tree construction stage must handle each token - emitted from the tokenisation stage as follows: */ - - /* A DOCTYPE token that is marked as being in error - A comment token - A start tag token - An end tag token - A character token that is not one of one of U+0009 CHARACTER TABULATION, - U+000A LINE FEED (LF), U+000B LINE TABULATION, U+000C FORM FEED (FF), - or U+0020 SPACE - An end-of-file token */ - if((isset($token['error']) && $token['error']) || - $token['type'] === HTML5::COMMENT || - $token['type'] === HTML5::STARTTAG || - $token['type'] === HTML5::ENDTAG || - $token['type'] === HTML5::EOF || - ($token['type'] === HTML5::CHARACTR && isset($token['data']) && - !preg_match('/^[\t\n\x0b\x0c ]+$/', $token['data']))) { - /* This specification does not define how to handle this case. In - particular, user agents may ignore the entirety of this specification - altogether for such documents, and instead invoke special parse modes - with a greater emphasis on backwards compatibility. */ - - $this->phase = self::ROOT_PHASE; - return $this->rootElementPhase($token); - - /* A DOCTYPE token marked as being correct */ - } elseif(isset($token['error']) && !$token['error']) { - /* Append a DocumentType node to the Document node, with the name - attribute set to the name given in the DOCTYPE token (which will be - "HTML"), and the other attributes specific to DocumentType objects - set to null, empty lists, or the empty string as appropriate. */ - $doctype = new DOMDocumentType(null, null, 'HTML'); - - /* Then, switch to the root element phase of the tree construction - stage. */ - $this->phase = self::ROOT_PHASE; - - /* A character token that is one of one of U+0009 CHARACTER TABULATION, - U+000A LINE FEED (LF), U+000B LINE TABULATION, U+000C FORM FEED (FF), - or U+0020 SPACE */ - } elseif(isset($token['data']) && preg_match('/^[\t\n\x0b\x0c ]+$/', - $token['data'])) { - /* Append that character to the Document node. */ - $text = $this->dom->createTextNode($token['data']); - $this->dom->appendChild($text); - } - } - - private function rootElementPhase($token) { - /* After the initial phase, as each token is emitted from the tokenisation - stage, it must be processed as described in this section. */ - - /* A DOCTYPE token */ - if($token['type'] === HTML5::DOCTYPE) { - // Parse error. Ignore the token. - - /* A comment token */ - } elseif($token['type'] === HTML5::COMMENT) { - /* Append a Comment node to the Document object with the data - attribute set to the data given in the comment token. */ - $comment = $this->dom->createComment($token['data']); - $this->dom->appendChild($comment); - - /* A character token that is one of one of U+0009 CHARACTER TABULATION, - U+000A LINE FEED (LF), U+000B LINE TABULATION, U+000C FORM FEED (FF), - or U+0020 SPACE */ - } elseif($token['type'] === HTML5::CHARACTR && - preg_match('/^[\t\n\x0b\x0c ]+$/', $token['data'])) { - /* Append that character to the Document node. */ - $text = $this->dom->createTextNode($token['data']); - $this->dom->appendChild($text); - - /* A character token that is not one of U+0009 CHARACTER TABULATION, - U+000A LINE FEED (LF), U+000B LINE TABULATION, U+000C FORM FEED - (FF), or U+0020 SPACE - A start tag token - An end tag token - An end-of-file token */ - } elseif(($token['type'] === HTML5::CHARACTR && - !preg_match('/^[\t\n\x0b\x0c ]+$/', $token['data'])) || - $token['type'] === HTML5::STARTTAG || - $token['type'] === HTML5::ENDTAG || - $token['type'] === HTML5::EOF) { - /* Create an HTMLElement node with the tag name html, in the HTML - namespace. Append it to the Document object. Switch to the main - phase and reprocess the current token. */ - $html = $this->dom->createElement('html'); - $this->dom->appendChild($html); - $this->stack[] = $html; - - $this->phase = self::MAIN_PHASE; - return $this->mainPhase($token); - } - } - - private function mainPhase($token) { - /* Tokens in the main phase must be handled as follows: */ - - /* A DOCTYPE token */ - if($token['type'] === HTML5::DOCTYPE) { - // Parse error. Ignore the token. - - /* A start tag token with the tag name "html" */ - } elseif($token['type'] === HTML5::STARTTAG && $token['name'] === 'html') { - /* If this start tag token was not the first start tag token, then - it is a parse error. */ - - /* For each attribute on the token, check to see if the attribute - is already present on the top element of the stack of open elements. - If it is not, add the attribute and its corresponding value to that - element. */ - foreach($token['attr'] as $attr) { - if(!$this->stack[0]->hasAttribute($attr['name'])) { - $this->stack[0]->setAttribute($attr['name'], $attr['value']); - } - } - - /* An end-of-file token */ - } elseif($token['type'] === HTML5::EOF) { - /* Generate implied end tags. */ - $this->generateImpliedEndTags(); - - /* Anything else. */ - } else { - /* Depends on the insertion mode: */ - switch($this->mode) { - case self::BEFOR_HEAD: return $this->beforeHead($token); break; - case self::IN_HEAD: return $this->inHead($token); break; - case self::AFTER_HEAD: return $this->afterHead($token); break; - case self::IN_BODY: return $this->inBody($token); break; - case self::IN_TABLE: return $this->inTable($token); break; - case self::IN_CAPTION: return $this->inCaption($token); break; - case self::IN_CGROUP: return $this->inColumnGroup($token); break; - case self::IN_TBODY: return $this->inTableBody($token); break; - case self::IN_ROW: return $this->inRow($token); break; - case self::IN_CELL: return $this->inCell($token); break; - case self::IN_SELECT: return $this->inSelect($token); break; - case self::AFTER_BODY: return $this->afterBody($token); break; - case self::IN_FRAME: return $this->inFrameset($token); break; - case self::AFTR_FRAME: return $this->afterFrameset($token); break; - case self::END_PHASE: return $this->trailingEndPhase($token); break; - } - } - } - - private function beforeHead($token) { - /* Handle the token as follows: */ - - /* A character token that is one of one of U+0009 CHARACTER TABULATION, - U+000A LINE FEED (LF), U+000B LINE TABULATION, U+000C FORM FEED (FF), - or U+0020 SPACE */ - if($token['type'] === HTML5::CHARACTR && - preg_match('/^[\t\n\x0b\x0c ]+$/', $token['data'])) { - /* Append the character to the current node. */ - $this->insertText($token['data']); - - /* A comment token */ - } elseif($token['type'] === HTML5::COMMENT) { - /* Append a Comment node to the current node with the data attribute - set to the data given in the comment token. */ - $this->insertComment($token['data']); - - /* A start tag token with the tag name "head" */ - } elseif($token['type'] === HTML5::STARTTAG && $token['name'] === 'head') { - /* Create an element for the token, append the new element to the - current node and push it onto the stack of open elements. */ - $element = $this->insertElement($token); - - /* Set the head element pointer to this new element node. */ - $this->head_pointer = $element; - - /* Change the insertion mode to "in head". */ - $this->mode = self::IN_HEAD; - - /* A start tag token whose tag name is one of: "base", "link", "meta", - "script", "style", "title". Or an end tag with the tag name "html". - Or a character token that is not one of U+0009 CHARACTER TABULATION, - U+000A LINE FEED (LF), U+000B LINE TABULATION, U+000C FORM FEED (FF), - or U+0020 SPACE. Or any other start tag token */ - } elseif($token['type'] === HTML5::STARTTAG || - ($token['type'] === HTML5::ENDTAG && $token['name'] === 'html') || - ($token['type'] === HTML5::CHARACTR && !preg_match('/^[\t\n\x0b\x0c ]$/', - $token['data']))) { - /* Act as if a start tag token with the tag name "head" and no - attributes had been seen, then reprocess the current token. */ - $this->beforeHead(array( - 'name' => 'head', - 'type' => HTML5::STARTTAG, - 'attr' => array() - )); - - return $this->inHead($token); - - /* Any other end tag */ - } elseif($token['type'] === HTML5::ENDTAG) { - /* Parse error. Ignore the token. */ - } - } - - private function inHead($token) { - /* Handle the token as follows: */ - - /* A character token that is one of one of U+0009 CHARACTER TABULATION, - U+000A LINE FEED (LF), U+000B LINE TABULATION, U+000C FORM FEED (FF), - or U+0020 SPACE. - - THIS DIFFERS FROM THE SPEC: If the current node is either a title, style - or script element, append the character to the current node regardless - of its content. */ - if(($token['type'] === HTML5::CHARACTR && - preg_match('/^[\t\n\x0b\x0c ]+$/', $token['data'])) || ( - $token['type'] === HTML5::CHARACTR && in_array(end($this->stack)->nodeName, - array('title', 'style', 'script')))) { - /* Append the character to the current node. */ - $this->insertText($token['data']); - - /* A comment token */ - } elseif($token['type'] === HTML5::COMMENT) { - /* Append a Comment node to the current node with the data attribute - set to the data given in the comment token. */ - $this->insertComment($token['data']); - - } elseif($token['type'] === HTML5::ENDTAG && - in_array($token['name'], array('title', 'style', 'script'))) { - array_pop($this->stack); - return HTML5::PCDATA; - - /* A start tag with the tag name "title" */ - } elseif($token['type'] === HTML5::STARTTAG && $token['name'] === 'title') { - /* Create an element for the token and append the new element to the - node pointed to by the head element pointer, or, if that is null - (innerHTML case), to the current node. */ - if($this->head_pointer !== null) { - $element = $this->insertElement($token, false); - $this->head_pointer->appendChild($element); - - } else { - $element = $this->insertElement($token); - } - - /* Switch the tokeniser's content model flag to the RCDATA state. */ - return HTML5::RCDATA; - - /* A start tag with the tag name "style" */ - } elseif($token['type'] === HTML5::STARTTAG && $token['name'] === 'style') { - /* Create an element for the token and append the new element to the - node pointed to by the head element pointer, or, if that is null - (innerHTML case), to the current node. */ - if($this->head_pointer !== null) { - $element = $this->insertElement($token, false); - $this->head_pointer->appendChild($element); - - } else { - $this->insertElement($token); - } - - /* Switch the tokeniser's content model flag to the CDATA state. */ - return HTML5::CDATA; - - /* A start tag with the tag name "script" */ - } elseif($token['type'] === HTML5::STARTTAG && $token['name'] === 'script') { - /* Create an element for the token. */ - $element = $this->insertElement($token, false); - $this->head_pointer->appendChild($element); - - /* Switch the tokeniser's content model flag to the CDATA state. */ - return HTML5::CDATA; - - /* A start tag with the tag name "base", "link", or "meta" */ - } elseif($token['type'] === HTML5::STARTTAG && in_array($token['name'], - array('base', 'link', 'meta'))) { - /* Create an element for the token and append the new element to the - node pointed to by the head element pointer, or, if that is null - (innerHTML case), to the current node. */ - if($this->head_pointer !== null) { - $element = $this->insertElement($token, false); - $this->head_pointer->appendChild($element); - array_pop($this->stack); - - } else { - $this->insertElement($token); - } - - /* An end tag with the tag name "head" */ - } elseif($token['type'] === HTML5::ENDTAG && $token['name'] === 'head') { - /* If the current node is a head element, pop the current node off - the stack of open elements. */ - if($this->head_pointer->isSameNode(end($this->stack))) { - array_pop($this->stack); - - /* Otherwise, this is a parse error. */ - } else { - // k - } - - /* Change the insertion mode to "after head". */ - $this->mode = self::AFTER_HEAD; - - /* A start tag with the tag name "head" or an end tag except "html". */ - } elseif(($token['type'] === HTML5::STARTTAG && $token['name'] === 'head') || - ($token['type'] === HTML5::ENDTAG && $token['name'] !== 'html')) { - // Parse error. Ignore the token. - - /* Anything else */ - } else { - /* If the current node is a head element, act as if an end tag - token with the tag name "head" had been seen. */ - if($this->head_pointer->isSameNode(end($this->stack))) { - $this->inHead(array( - 'name' => 'head', - 'type' => HTML5::ENDTAG - )); - - /* Otherwise, change the insertion mode to "after head". */ - } else { - $this->mode = self::AFTER_HEAD; - } - - /* Then, reprocess the current token. */ - return $this->afterHead($token); - } - } - - private function afterHead($token) { - /* Handle the token as follows: */ - - /* A character token that is one of one of U+0009 CHARACTER TABULATION, - U+000A LINE FEED (LF), U+000B LINE TABULATION, U+000C FORM FEED (FF), - or U+0020 SPACE */ - if($token['type'] === HTML5::CHARACTR && - preg_match('/^[\t\n\x0b\x0c ]+$/', $token['data'])) { - /* Append the character to the current node. */ - $this->insertText($token['data']); - - /* A comment token */ - } elseif($token['type'] === HTML5::COMMENT) { - /* Append a Comment node to the current node with the data attribute - set to the data given in the comment token. */ - $this->insertComment($token['data']); - - /* A start tag token with the tag name "body" */ - } elseif($token['type'] === HTML5::STARTTAG && $token['name'] === 'body') { - /* Insert a body element for the token. */ - $this->insertElement($token); - - /* Change the insertion mode to "in body". */ - $this->mode = self::IN_BODY; - - /* A start tag token with the tag name "frameset" */ - } elseif($token['type'] === HTML5::STARTTAG && $token['name'] === 'frameset') { - /* Insert a frameset element for the token. */ - $this->insertElement($token); - - /* Change the insertion mode to "in frameset". */ - $this->mode = self::IN_FRAME; - - /* A start tag token whose tag name is one of: "base", "link", "meta", - "script", "style", "title" */ - } elseif($token['type'] === HTML5::STARTTAG && in_array($token['name'], - array('base', 'link', 'meta', 'script', 'style', 'title'))) { - /* Parse error. Switch the insertion mode back to "in head" and - reprocess the token. */ - $this->mode = self::IN_HEAD; - return $this->inHead($token); - - /* Anything else */ - } else { - /* Act as if a start tag token with the tag name "body" and no - attributes had been seen, and then reprocess the current token. */ - $this->afterHead(array( - 'name' => 'body', - 'type' => HTML5::STARTTAG, - 'attr' => array() - )); - - return $this->inBody($token); - } - } - - private function inBody($token) { - /* Handle the token as follows: */ - - switch($token['type']) { - /* A character token */ - case HTML5::CHARACTR: - /* Reconstruct the active formatting elements, if any. */ - $this->reconstructActiveFormattingElements(); - - /* Append the token's character to the current node. */ - $this->insertText($token['data']); - break; - - /* A comment token */ - case HTML5::COMMENT: - /* Append a Comment node to the current node with the data - attribute set to the data given in the comment token. */ - $this->insertComment($token['data']); - break; - - case HTML5::STARTTAG: - switch($token['name']) { - /* A start tag token whose tag name is one of: "script", - "style" */ - case 'script': case 'style': - /* Process the token as if the insertion mode had been "in - head". */ - return $this->inHead($token); - break; - - /* A start tag token whose tag name is one of: "base", "link", - "meta", "title" */ - case 'base': case 'link': case 'meta': case 'title': - /* Parse error. Process the token as if the insertion mode - had been "in head". */ - return $this->inHead($token); - break; - - /* A start tag token with the tag name "body" */ - case 'body': - /* Parse error. If the second element on the stack of open - elements is not a body element, or, if the stack of open - elements has only one node on it, then ignore the token. - (innerHTML case) */ - if(count($this->stack) === 1 || $this->stack[1]->nodeName !== 'body') { - // Ignore - - /* Otherwise, for each attribute on the token, check to see - if the attribute is already present on the body element (the - second element) on the stack of open elements. If it is not, - add the attribute and its corresponding value to that - element. */ - } else { - foreach($token['attr'] as $attr) { - if(!$this->stack[1]->hasAttribute($attr['name'])) { - $this->stack[1]->setAttribute($attr['name'], $attr['value']); - } - } - } - break; - - /* A start tag whose tag name is one of: "address", - "blockquote", "center", "dir", "div", "dl", "fieldset", - "listing", "menu", "ol", "p", "ul" */ - case 'address': case 'blockquote': case 'center': case 'dir': - case 'div': case 'dl': case 'fieldset': case 'listing': - case 'menu': case 'ol': case 'p': case 'ul': - /* If the stack of open elements has a p element in scope, - then act as if an end tag with the tag name p had been - seen. */ - if($this->elementInScope('p')) { - $this->emitToken(array( - 'name' => 'p', - 'type' => HTML5::ENDTAG - )); - } - - /* Insert an HTML element for the token. */ - $this->insertElement($token); - break; - - /* A start tag whose tag name is "form" */ - case 'form': - /* If the form element pointer is not null, ignore the - token with a parse error. */ - if($this->form_pointer !== null) { - // Ignore. - - /* Otherwise: */ - } else { - /* If the stack of open elements has a p element in - scope, then act as if an end tag with the tag name p - had been seen. */ - if($this->elementInScope('p')) { - $this->emitToken(array( - 'name' => 'p', - 'type' => HTML5::ENDTAG - )); - } - - /* Insert an HTML element for the token, and set the - form element pointer to point to the element created. */ - $element = $this->insertElement($token); - $this->form_pointer = $element; - } - break; - - /* A start tag whose tag name is "li", "dd" or "dt" */ - case 'li': case 'dd': case 'dt': - /* If the stack of open elements has a p element in scope, - then act as if an end tag with the tag name p had been - seen. */ - if($this->elementInScope('p')) { - $this->emitToken(array( - 'name' => 'p', - 'type' => HTML5::ENDTAG - )); - } - - $stack_length = count($this->stack) - 1; - - for($n = $stack_length; 0 <= $n; $n--) { - /* 1. Initialise node to be the current node (the - bottommost node of the stack). */ - $stop = false; - $node = $this->stack[$n]; - $cat = $this->getElementCategory($node->tagName); - - /* 2. If node is an li, dd or dt element, then pop all - the nodes from the current node up to node, including - node, then stop this algorithm. */ - if($token['name'] === $node->tagName || ($token['name'] !== 'li' - && ($node->tagName === 'dd' || $node->tagName === 'dt'))) { - for($x = $stack_length; $x >= $n ; $x--) { - array_pop($this->stack); - } - - break; - } - - /* 3. If node is not in the formatting category, and is - not in the phrasing category, and is not an address or - div element, then stop this algorithm. */ - if($cat !== self::FORMATTING && $cat !== self::PHRASING && - $node->tagName !== 'address' && $node->tagName !== 'div') { - break; - } - } - - /* Finally, insert an HTML element with the same tag - name as the token's. */ - $this->insertElement($token); - break; - - /* A start tag token whose tag name is "plaintext" */ - case 'plaintext': - /* If the stack of open elements has a p element in scope, - then act as if an end tag with the tag name p had been - seen. */ - if($this->elementInScope('p')) { - $this->emitToken(array( - 'name' => 'p', - 'type' => HTML5::ENDTAG - )); - } - - /* Insert an HTML element for the token. */ - $this->insertElement($token); - - return HTML5::PLAINTEXT; - break; - - /* A start tag whose tag name is one of: "h1", "h2", "h3", "h4", - "h5", "h6" */ - case 'h1': case 'h2': case 'h3': case 'h4': case 'h5': case 'h6': - /* If the stack of open elements has a p element in scope, - then act as if an end tag with the tag name p had been seen. */ - if($this->elementInScope('p')) { - $this->emitToken(array( - 'name' => 'p', - 'type' => HTML5::ENDTAG - )); - } - - /* If the stack of open elements has in scope an element whose - tag name is one of "h1", "h2", "h3", "h4", "h5", or "h6", then - this is a parse error; pop elements from the stack until an - element with one of those tag names has been popped from the - stack. */ - while($this->elementInScope(array('h1', 'h2', 'h3', 'h4', 'h5', 'h6'))) { - array_pop($this->stack); - } - - /* Insert an HTML element for the token. */ - $this->insertElement($token); - break; - - /* A start tag whose tag name is "a" */ - case 'a': - /* If the list of active formatting elements contains - an element whose tag name is "a" between the end of the - list and the last marker on the list (or the start of - the list if there is no marker on the list), then this - is a parse error; act as if an end tag with the tag name - "a" had been seen, then remove that element from the list - of active formatting elements and the stack of open - elements if the end tag didn't already remove it (it - might not have if the element is not in table scope). */ - $leng = count($this->a_formatting); - - for($n = $leng - 1; $n >= 0; $n--) { - if($this->a_formatting[$n] === self::MARKER) { - break; - - } elseif($this->a_formatting[$n]->nodeName === 'a') { - $this->emitToken(array( - 'name' => 'a', - 'type' => HTML5::ENDTAG - )); - break; - } - } - - /* Reconstruct the active formatting elements, if any. */ - $this->reconstructActiveFormattingElements(); - - /* Insert an HTML element for the token. */ - $el = $this->insertElement($token); - - /* Add that element to the list of active formatting - elements. */ - $this->a_formatting[] = $el; - break; - - /* A start tag whose tag name is one of: "b", "big", "em", "font", - "i", "nobr", "s", "small", "strike", "strong", "tt", "u" */ - case 'b': case 'big': case 'em': case 'font': case 'i': - case 'nobr': case 's': case 'small': case 'strike': - case 'strong': case 'tt': case 'u': - /* Reconstruct the active formatting elements, if any. */ - $this->reconstructActiveFormattingElements(); - - /* Insert an HTML element for the token. */ - $el = $this->insertElement($token); - - /* Add that element to the list of active formatting - elements. */ - $this->a_formatting[] = $el; - break; - - /* A start tag token whose tag name is "button" */ - case 'button': - /* If the stack of open elements has a button element in scope, - then this is a parse error; act as if an end tag with the tag - name "button" had been seen, then reprocess the token. (We don't - do that. Unnecessary.) */ - if($this->elementInScope('button')) { - $this->inBody(array( - 'name' => 'button', - 'type' => HTML5::ENDTAG - )); - } - - /* Reconstruct the active formatting elements, if any. */ - $this->reconstructActiveFormattingElements(); - - /* Insert an HTML element for the token. */ - $this->insertElement($token); - - /* Insert a marker at the end of the list of active - formatting elements. */ - $this->a_formatting[] = self::MARKER; - break; - - /* A start tag token whose tag name is one of: "marquee", "object" */ - case 'marquee': case 'object': - /* Reconstruct the active formatting elements, if any. */ - $this->reconstructActiveFormattingElements(); - - /* Insert an HTML element for the token. */ - $this->insertElement($token); - - /* Insert a marker at the end of the list of active - formatting elements. */ - $this->a_formatting[] = self::MARKER; - break; - - /* A start tag token whose tag name is "xmp" */ - case 'xmp': - /* Reconstruct the active formatting elements, if any. */ - $this->reconstructActiveFormattingElements(); - - /* Insert an HTML element for the token. */ - $this->insertElement($token); - - /* Switch the content model flag to the CDATA state. */ - return HTML5::CDATA; - break; - - /* A start tag whose tag name is "table" */ - case 'table': - /* If the stack of open elements has a p element in scope, - then act as if an end tag with the tag name p had been seen. */ - if($this->elementInScope('p')) { - $this->emitToken(array( - 'name' => 'p', - 'type' => HTML5::ENDTAG - )); - } - - /* Insert an HTML element for the token. */ - $this->insertElement($token); - - /* Change the insertion mode to "in table". */ - $this->mode = self::IN_TABLE; - break; - - /* A start tag whose tag name is one of: "area", "basefont", - "bgsound", "br", "embed", "img", "param", "spacer", "wbr" */ - case 'area': case 'basefont': case 'bgsound': case 'br': - case 'embed': case 'img': case 'param': case 'spacer': - case 'wbr': - /* Reconstruct the active formatting elements, if any. */ - $this->reconstructActiveFormattingElements(); - - /* Insert an HTML element for the token. */ - $this->insertElement($token); - - /* Immediately pop the current node off the stack of open elements. */ - array_pop($this->stack); - break; - - /* A start tag whose tag name is "hr" */ - case 'hr': - /* If the stack of open elements has a p element in scope, - then act as if an end tag with the tag name p had been seen. */ - if($this->elementInScope('p')) { - $this->emitToken(array( - 'name' => 'p', - 'type' => HTML5::ENDTAG - )); - } - - /* Insert an HTML element for the token. */ - $this->insertElement($token); - - /* Immediately pop the current node off the stack of open elements. */ - array_pop($this->stack); - break; - - /* A start tag whose tag name is "image" */ - case 'image': - /* Parse error. Change the token's tag name to "img" and - reprocess it. (Don't ask.) */ - $token['name'] = 'img'; - return $this->inBody($token); - break; - - /* A start tag whose tag name is "input" */ - case 'input': - /* Reconstruct the active formatting elements, if any. */ - $this->reconstructActiveFormattingElements(); - - /* Insert an input element for the token. */ - $element = $this->insertElement($token, false); - - /* If the form element pointer is not null, then associate the - input element with the form element pointed to by the form - element pointer. */ - $this->form_pointer !== null - ? $this->form_pointer->appendChild($element) - : end($this->stack)->appendChild($element); - - /* Pop that input element off the stack of open elements. */ - array_pop($this->stack); - break; - - /* A start tag whose tag name is "isindex" */ - case 'isindex': - /* Parse error. */ - // w/e - - /* If the form element pointer is not null, - then ignore the token. */ - if($this->form_pointer === null) { - /* Act as if a start tag token with the tag name "form" had - been seen. */ - $this->inBody(array( - 'name' => 'body', - 'type' => HTML5::STARTTAG, - 'attr' => array() - )); - - /* Act as if a start tag token with the tag name "hr" had - been seen. */ - $this->inBody(array( - 'name' => 'hr', - 'type' => HTML5::STARTTAG, - 'attr' => array() - )); - - /* Act as if a start tag token with the tag name "p" had - been seen. */ - $this->inBody(array( - 'name' => 'p', - 'type' => HTML5::STARTTAG, - 'attr' => array() - )); - - /* Act as if a start tag token with the tag name "label" - had been seen. */ - $this->inBody(array( - 'name' => 'label', - 'type' => HTML5::STARTTAG, - 'attr' => array() - )); - - /* Act as if a stream of character tokens had been seen. */ - $this->insertText('This is a searchable index. '. - 'Insert your search keywords here: '); - - /* Act as if a start tag token with the tag name "input" - had been seen, with all the attributes from the "isindex" - token, except with the "name" attribute set to the value - "isindex" (ignoring any explicit "name" attribute). */ - $attr = $token['attr']; - $attr[] = array('name' => 'name', 'value' => 'isindex'); - - $this->inBody(array( - 'name' => 'input', - 'type' => HTML5::STARTTAG, - 'attr' => $attr - )); - - /* Act as if a stream of character tokens had been seen - (see below for what they should say). */ - $this->insertText('This is a searchable index. '. - 'Insert your search keywords here: '); - - /* Act as if an end tag token with the tag name "label" - had been seen. */ - $this->inBody(array( - 'name' => 'label', - 'type' => HTML5::ENDTAG - )); - - /* Act as if an end tag token with the tag name "p" had - been seen. */ - $this->inBody(array( - 'name' => 'p', - 'type' => HTML5::ENDTAG - )); - - /* Act as if a start tag token with the tag name "hr" had - been seen. */ - $this->inBody(array( - 'name' => 'hr', - 'type' => HTML5::ENDTAG - )); - - /* Act as if an end tag token with the tag name "form" had - been seen. */ - $this->inBody(array( - 'name' => 'form', - 'type' => HTML5::ENDTAG - )); - } - break; - - /* A start tag whose tag name is "textarea" */ - case 'textarea': - $this->insertElement($token); - - /* Switch the tokeniser's content model flag to the - RCDATA state. */ - return HTML5::RCDATA; - break; - - /* A start tag whose tag name is one of: "iframe", "noembed", - "noframes" */ - case 'iframe': case 'noembed': case 'noframes': - $this->insertElement($token); - - /* Switch the tokeniser's content model flag to the CDATA state. */ - return HTML5::CDATA; - break; - - /* A start tag whose tag name is "select" */ - case 'select': - /* Reconstruct the active formatting elements, if any. */ - $this->reconstructActiveFormattingElements(); - - /* Insert an HTML element for the token. */ - $this->insertElement($token); - - /* Change the insertion mode to "in select". */ - $this->mode = self::IN_SELECT; - break; - - /* A start or end tag whose tag name is one of: "caption", "col", - "colgroup", "frame", "frameset", "head", "option", "optgroup", - "tbody", "td", "tfoot", "th", "thead", "tr". */ - case 'caption': case 'col': case 'colgroup': case 'frame': - case 'frameset': case 'head': case 'option': case 'optgroup': - case 'tbody': case 'td': case 'tfoot': case 'th': case 'thead': - case 'tr': - // Parse error. Ignore the token. - break; - - /* A start or end tag whose tag name is one of: "event-source", - "section", "nav", "article", "aside", "header", "footer", - "datagrid", "command" */ - case 'event-source': case 'section': case 'nav': case 'article': - case 'aside': case 'header': case 'footer': case 'datagrid': - case 'command': - // Work in progress! - break; - - /* A start tag token not covered by the previous entries */ - default: - /* Reconstruct the active formatting elements, if any. */ - $this->reconstructActiveFormattingElements(); - - $this->insertElement($token, true, true); - break; - } - break; - - case HTML5::ENDTAG: - switch($token['name']) { - /* An end tag with the tag name "body" */ - case 'body': - /* If the second element in the stack of open elements is - not a body element, this is a parse error. Ignore the token. - (innerHTML case) */ - if(count($this->stack) < 2 || $this->stack[1]->nodeName !== 'body') { - // Ignore. - - /* If the current node is not the body element, then this - is a parse error. */ - } elseif(end($this->stack)->nodeName !== 'body') { - // Parse error. - } - - /* Change the insertion mode to "after body". */ - $this->mode = self::AFTER_BODY; - break; - - /* An end tag with the tag name "html" */ - case 'html': - /* Act as if an end tag with tag name "body" had been seen, - then, if that token wasn't ignored, reprocess the current - token. */ - $this->inBody(array( - 'name' => 'body', - 'type' => HTML5::ENDTAG - )); - - return $this->afterBody($token); - break; - - /* An end tag whose tag name is one of: "address", "blockquote", - "center", "dir", "div", "dl", "fieldset", "listing", "menu", - "ol", "pre", "ul" */ - case 'address': case 'blockquote': case 'center': case 'dir': - case 'div': case 'dl': case 'fieldset': case 'listing': - case 'menu': case 'ol': case 'pre': case 'ul': - /* If the stack of open elements has an element in scope - with the same tag name as that of the token, then generate - implied end tags. */ - if($this->elementInScope($token['name'])) { - $this->generateImpliedEndTags(); - - /* Now, if the current node is not an element with - the same tag name as that of the token, then this - is a parse error. */ - // w/e - - /* If the stack of open elements has an element in - scope with the same tag name as that of the token, - then pop elements from this stack until an element - with that tag name has been popped from the stack. */ - for($n = count($this->stack) - 1; $n >= 0; $n--) { - if($this->stack[$n]->nodeName === $token['name']) { - $n = -1; - } - - array_pop($this->stack); - } - } - break; - - /* An end tag whose tag name is "form" */ - case 'form': - /* If the stack of open elements has an element in scope - with the same tag name as that of the token, then generate - implied end tags. */ - if($this->elementInScope($token['name'])) { - $this->generateImpliedEndTags(); - - } - - if(end($this->stack)->nodeName !== $token['name']) { - /* Now, if the current node is not an element with the - same tag name as that of the token, then this is a parse - error. */ - // w/e - - } else { - /* Otherwise, if the current node is an element with - the same tag name as that of the token pop that element - from the stack. */ - array_pop($this->stack); - } - - /* In any case, set the form element pointer to null. */ - $this->form_pointer = null; - break; - - /* An end tag whose tag name is "p" */ - case 'p': - /* If the stack of open elements has a p element in scope, - then generate implied end tags, except for p elements. */ - if($this->elementInScope('p')) { - $this->generateImpliedEndTags(array('p')); - - /* If the current node is not a p element, then this is - a parse error. */ - // k - - /* If the stack of open elements has a p element in - scope, then pop elements from this stack until the stack - no longer has a p element in scope. */ - for($n = count($this->stack) - 1; $n >= 0; $n--) { - if($this->elementInScope('p')) { - array_pop($this->stack); - - } else { - break; - } - } - } - break; - - /* An end tag whose tag name is "dd", "dt", or "li" */ - case 'dd': case 'dt': case 'li': - /* If the stack of open elements has an element in scope - whose tag name matches the tag name of the token, then - generate implied end tags, except for elements with the - same tag name as the token. */ - if($this->elementInScope($token['name'])) { - $this->generateImpliedEndTags(array($token['name'])); - - /* If the current node is not an element with the same - tag name as the token, then this is a parse error. */ - // w/e - - /* If the stack of open elements has an element in scope - whose tag name matches the tag name of the token, then - pop elements from this stack until an element with that - tag name has been popped from the stack. */ - for($n = count($this->stack) - 1; $n >= 0; $n--) { - if($this->stack[$n]->nodeName === $token['name']) { - $n = -1; - } - - array_pop($this->stack); - } - } - break; - - /* An end tag whose tag name is one of: "h1", "h2", "h3", "h4", - "h5", "h6" */ - case 'h1': case 'h2': case 'h3': case 'h4': case 'h5': case 'h6': - $elements = array('h1', 'h2', 'h3', 'h4', 'h5', 'h6'); - - /* If the stack of open elements has in scope an element whose - tag name is one of "h1", "h2", "h3", "h4", "h5", or "h6", then - generate implied end tags. */ - if($this->elementInScope($elements)) { - $this->generateImpliedEndTags(); - - /* Now, if the current node is not an element with the same - tag name as that of the token, then this is a parse error. */ - // w/e - - /* If the stack of open elements has in scope an element - whose tag name is one of "h1", "h2", "h3", "h4", "h5", or - "h6", then pop elements from the stack until an element - with one of those tag names has been popped from the stack. */ - while($this->elementInScope($elements)) { - array_pop($this->stack); - } - } - break; - - /* An end tag whose tag name is one of: "a", "b", "big", "em", - "font", "i", "nobr", "s", "small", "strike", "strong", "tt", "u" */ - case 'a': case 'b': case 'big': case 'em': case 'font': - case 'i': case 'nobr': case 's': case 'small': case 'strike': - case 'strong': case 'tt': case 'u': - /* 1. Let the formatting element be the last element in - the list of active formatting elements that: - * is between the end of the list and the last scope - marker in the list, if any, or the start of the list - otherwise, and - * has the same tag name as the token. - */ - while(true) { - for($a = count($this->a_formatting) - 1; $a >= 0; $a--) { - if($this->a_formatting[$a] === self::MARKER) { - break; - - } elseif($this->a_formatting[$a]->tagName === $token['name']) { - $formatting_element = $this->a_formatting[$a]; - $in_stack = in_array($formatting_element, $this->stack, true); - $fe_af_pos = $a; - break; - } - } - - /* If there is no such node, or, if that node is - also in the stack of open elements but the element - is not in scope, then this is a parse error. Abort - these steps. The token is ignored. */ - if(!isset($formatting_element) || ($in_stack && - !$this->elementInScope($token['name']))) { - break; - - /* Otherwise, if there is such a node, but that node - is not in the stack of open elements, then this is a - parse error; remove the element from the list, and - abort these steps. */ - } elseif(isset($formatting_element) && !$in_stack) { - unset($this->a_formatting[$fe_af_pos]); - $this->a_formatting = array_merge($this->a_formatting); - break; - } - - /* 2. Let the furthest block be the topmost node in the - stack of open elements that is lower in the stack - than the formatting element, and is not an element in - the phrasing or formatting categories. There might - not be one. */ - $fe_s_pos = array_search($formatting_element, $this->stack, true); - $length = count($this->stack); - - for($s = $fe_s_pos + 1; $s < $length; $s++) { - $category = $this->getElementCategory($this->stack[$s]->nodeName); - - if($category !== self::PHRASING && $category !== self::FORMATTING) { - $furthest_block = $this->stack[$s]; - } - } - - /* 3. If there is no furthest block, then the UA must - skip the subsequent steps and instead just pop all - the nodes from the bottom of the stack of open - elements, from the current node up to the formatting - element, and remove the formatting element from the - list of active formatting elements. */ - if(!isset($furthest_block)) { - for($n = $length - 1; $n >= $fe_s_pos; $n--) { - array_pop($this->stack); - } - - unset($this->a_formatting[$fe_af_pos]); - $this->a_formatting = array_merge($this->a_formatting); - break; - } - - /* 4. Let the common ancestor be the element - immediately above the formatting element in the stack - of open elements. */ - $common_ancestor = $this->stack[$fe_s_pos - 1]; - - /* 5. If the furthest block has a parent node, then - remove the furthest block from its parent node. */ - if($furthest_block->parentNode !== null) { - $furthest_block->parentNode->removeChild($furthest_block); - } - - /* 6. Let a bookmark note the position of the - formatting element in the list of active formatting - elements relative to the elements on either side - of it in the list. */ - $bookmark = $fe_af_pos; - - /* 7. Let node and last node be the furthest block. - Follow these steps: */ - $node = $furthest_block; - $last_node = $furthest_block; - - while(true) { - for($n = array_search($node, $this->stack, true) - 1; $n >= 0; $n--) { - /* 7.1 Let node be the element immediately - prior to node in the stack of open elements. */ - $node = $this->stack[$n]; - - /* 7.2 If node is not in the list of active - formatting elements, then remove node from - the stack of open elements and then go back - to step 1. */ - if(!in_array($node, $this->a_formatting, true)) { - unset($this->stack[$n]); - $this->stack = array_merge($this->stack); - - } else { - break; - } - } - - /* 7.3 Otherwise, if node is the formatting - element, then go to the next step in the overall - algorithm. */ - if($node === $formatting_element) { - break; - - /* 7.4 Otherwise, if last node is the furthest - block, then move the aforementioned bookmark to - be immediately after the node in the list of - active formatting elements. */ - } elseif($last_node === $furthest_block) { - $bookmark = array_search($node, $this->a_formatting, true) + 1; - } - - /* 7.5 If node has any children, perform a - shallow clone of node, replace the entry for - node in the list of active formatting elements - with an entry for the clone, replace the entry - for node in the stack of open elements with an - entry for the clone, and let node be the clone. */ - if($node->hasChildNodes()) { - $clone = $node->cloneNode(); - $s_pos = array_search($node, $this->stack, true); - $a_pos = array_search($node, $this->a_formatting, true); - - $this->stack[$s_pos] = $clone; - $this->a_formatting[$a_pos] = $clone; - $node = $clone; - } - - /* 7.6 Insert last node into node, first removing - it from its previous parent node if any. */ - if($last_node->parentNode !== null) { - $last_node->parentNode->removeChild($last_node); - } - - $node->appendChild($last_node); - - /* 7.7 Let last node be node. */ - $last_node = $node; - } - - /* 8. Insert whatever last node ended up being in - the previous step into the common ancestor node, - first removing it from its previous parent node if - any. */ - if($last_node->parentNode !== null) { - $last_node->parentNode->removeChild($last_node); - } - - $common_ancestor->appendChild($last_node); - - /* 9. Perform a shallow clone of the formatting - element. */ - $clone = $formatting_element->cloneNode(); - - /* 10. Take all of the child nodes of the furthest - block and append them to the clone created in the - last step. */ - while($furthest_block->hasChildNodes()) { - $child = $furthest_block->firstChild; - $furthest_block->removeChild($child); - $clone->appendChild($child); - } - - /* 11. Append that clone to the furthest block. */ - $furthest_block->appendChild($clone); - - /* 12. Remove the formatting element from the list - of active formatting elements, and insert the clone - into the list of active formatting elements at the - position of the aforementioned bookmark. */ - $fe_af_pos = array_search($formatting_element, $this->a_formatting, true); - unset($this->a_formatting[$fe_af_pos]); - $this->a_formatting = array_merge($this->a_formatting); - - $af_part1 = array_slice($this->a_formatting, 0, $bookmark - 1); - $af_part2 = array_slice($this->a_formatting, $bookmark, count($this->a_formatting)); - $this->a_formatting = array_merge($af_part1, array($clone), $af_part2); - - /* 13. Remove the formatting element from the stack - of open elements, and insert the clone into the stack - of open elements immediately after (i.e. in a more - deeply nested position than) the position of the - furthest block in that stack. */ - $fe_s_pos = array_search($formatting_element, $this->stack, true); - $fb_s_pos = array_search($furthest_block, $this->stack, true); - unset($this->stack[$fe_s_pos]); - - $s_part1 = array_slice($this->stack, 0, $fb_s_pos); - $s_part2 = array_slice($this->stack, $fb_s_pos + 1, count($this->stack)); - $this->stack = array_merge($s_part1, array($clone), $s_part2); - - /* 14. Jump back to step 1 in this series of steps. */ - unset($formatting_element, $fe_af_pos, $fe_s_pos, $furthest_block); - } - break; - - /* An end tag token whose tag name is one of: "button", - "marquee", "object" */ - case 'button': case 'marquee': case 'object': - /* If the stack of open elements has an element in scope whose - tag name matches the tag name of the token, then generate implied - tags. */ - if($this->elementInScope($token['name'])) { - $this->generateImpliedEndTags(); - - /* Now, if the current node is not an element with the same - tag name as the token, then this is a parse error. */ - // k - - /* Now, if the stack of open elements has an element in scope - whose tag name matches the tag name of the token, then pop - elements from the stack until that element has been popped from - the stack, and clear the list of active formatting elements up - to the last marker. */ - for($n = count($this->stack) - 1; $n >= 0; $n--) { - if($this->stack[$n]->nodeName === $token['name']) { - $n = -1; - } - - array_pop($this->stack); - } - - $marker = end(array_keys($this->a_formatting, self::MARKER, true)); - - for($n = count($this->a_formatting) - 1; $n > $marker; $n--) { - array_pop($this->a_formatting); - } - } - break; - - /* Or an end tag whose tag name is one of: "area", "basefont", - "bgsound", "br", "embed", "hr", "iframe", "image", "img", - "input", "isindex", "noembed", "noframes", "param", "select", - "spacer", "table", "textarea", "wbr" */ - case 'area': case 'basefont': case 'bgsound': case 'br': - case 'embed': case 'hr': case 'iframe': case 'image': - case 'img': case 'input': case 'isindex': case 'noembed': - case 'noframes': case 'param': case 'select': case 'spacer': - case 'table': case 'textarea': case 'wbr': - // Parse error. Ignore the token. - break; - - /* An end tag token not covered by the previous entries */ - default: - for($n = count($this->stack) - 1; $n >= 0; $n--) { - /* Initialise node to be the current node (the bottommost - node of the stack). */ - $node = end($this->stack); - - /* If node has the same tag name as the end tag token, - then: */ - if($token['name'] === $node->nodeName) { - /* Generate implied end tags. */ - $this->generateImpliedEndTags(); - - /* If the tag name of the end tag token does not - match the tag name of the current node, this is a - parse error. */ - // k - - /* Pop all the nodes from the current node up to - node, including node, then stop this algorithm. */ - for($x = count($this->stack) - $n; $x >= $n; $x--) { - array_pop($this->stack); - } - - } else { - $category = $this->getElementCategory($node); - - if($category !== self::SPECIAL && $category !== self::SCOPING) { - /* Otherwise, if node is in neither the formatting - category nor the phrasing category, then this is a - parse error. Stop this algorithm. The end tag token - is ignored. */ - return false; - } - } - } - break; - } - break; - } - } - - private function inTable($token) { - $clear = array('html', 'table'); - - /* A character token that is one of one of U+0009 CHARACTER TABULATION, - U+000A LINE FEED (LF), U+000B LINE TABULATION, U+000C FORM FEED (FF), - or U+0020 SPACE */ - if($token['type'] === HTML5::CHARACTR && - preg_match('/^[\t\n\x0b\x0c ]+$/', $token['data'])) { - /* Append the character to the current node. */ - $text = $this->dom->createTextNode($token['data']); - end($this->stack)->appendChild($text); - - /* A comment token */ - } elseif($token['type'] === HTML5::COMMENT) { - /* Append a Comment node to the current node with the data - attribute set to the data given in the comment token. */ - $comment = $this->dom->createComment($token['data']); - end($this->stack)->appendChild($comment); - - /* A start tag whose tag name is "caption" */ - } elseif($token['type'] === HTML5::STARTTAG && - $token['name'] === 'caption') { - /* Clear the stack back to a table context. */ - $this->clearStackToTableContext($clear); - - /* Insert a marker at the end of the list of active - formatting elements. */ - $this->a_formatting[] = self::MARKER; - - /* Insert an HTML element for the token, then switch the - insertion mode to "in caption". */ - $this->insertElement($token); - $this->mode = self::IN_CAPTION; - - /* A start tag whose tag name is "colgroup" */ - } elseif($token['type'] === HTML5::STARTTAG && - $token['name'] === 'colgroup') { - /* Clear the stack back to a table context. */ - $this->clearStackToTableContext($clear); - - /* Insert an HTML element for the token, then switch the - insertion mode to "in column group". */ - $this->insertElement($token); - $this->mode = self::IN_CGROUP; - - /* A start tag whose tag name is "col" */ - } elseif($token['type'] === HTML5::STARTTAG && - $token['name'] === 'col') { - $this->inTable(array( - 'name' => 'colgroup', - 'type' => HTML5::STARTTAG, - 'attr' => array() - )); - - $this->inColumnGroup($token); - - /* A start tag whose tag name is one of: "tbody", "tfoot", "thead" */ - } elseif($token['type'] === HTML5::STARTTAG && in_array($token['name'], - array('tbody', 'tfoot', 'thead'))) { - /* Clear the stack back to a table context. */ - $this->clearStackToTableContext($clear); - - /* Insert an HTML element for the token, then switch the insertion - mode to "in table body". */ - $this->insertElement($token); - $this->mode = self::IN_TBODY; - - /* A start tag whose tag name is one of: "td", "th", "tr" */ - } elseif($token['type'] === HTML5::STARTTAG && - in_array($token['name'], array('td', 'th', 'tr'))) { - /* Act as if a start tag token with the tag name "tbody" had been - seen, then reprocess the current token. */ - $this->inTable(array( - 'name' => 'tbody', - 'type' => HTML5::STARTTAG, - 'attr' => array() - )); - - return $this->inTableBody($token); - - /* A start tag whose tag name is "table" */ - } elseif($token['type'] === HTML5::STARTTAG && - $token['name'] === 'table') { - /* Parse error. Act as if an end tag token with the tag name "table" - had been seen, then, if that token wasn't ignored, reprocess the - current token. */ - $this->inTable(array( - 'name' => 'table', - 'type' => HTML5::ENDTAG - )); - - return $this->mainPhase($token); - - /* An end tag whose tag name is "table" */ - } elseif($token['type'] === HTML5::ENDTAG && - $token['name'] === 'table') { - /* If the stack of open elements does not have an element in table - scope with the same tag name as the token, this is a parse error. - Ignore the token. (innerHTML case) */ - if(!$this->elementInScope($token['name'], true)) { - return false; - - /* Otherwise: */ - } else { - /* Generate implied end tags. */ - $this->generateImpliedEndTags(); - - /* Now, if the current node is not a table element, then this - is a parse error. */ - // w/e - - /* Pop elements from this stack until a table element has been - popped from the stack. */ - while(true) { - $current = end($this->stack)->nodeName; - array_pop($this->stack); - - if($current === 'table') { - break; - } - } - - /* Reset the insertion mode appropriately. */ - $this->resetInsertionMode(); - } - - /* An end tag whose tag name is one of: "body", "caption", "col", - "colgroup", "html", "tbody", "td", "tfoot", "th", "thead", "tr" */ - } elseif($token['type'] === HTML5::ENDTAG && in_array($token['name'], - array('body', 'caption', 'col', 'colgroup', 'html', 'tbody', 'td', - 'tfoot', 'th', 'thead', 'tr'))) { - // Parse error. Ignore the token. - - /* Anything else */ - } else { - /* Parse error. Process the token as if the insertion mode was "in - body", with the following exception: */ - - /* If the current node is a table, tbody, tfoot, thead, or tr - element, then, whenever a node would be inserted into the current - node, it must instead be inserted into the foster parent element. */ - if(in_array(end($this->stack)->nodeName, - array('table', 'tbody', 'tfoot', 'thead', 'tr'))) { - /* The foster parent element is the parent element of the last - table element in the stack of open elements, if there is a - table element and it has such a parent element. If there is no - table element in the stack of open elements (innerHTML case), - then the foster parent element is the first element in the - stack of open elements (the html element). Otherwise, if there - is a table element in the stack of open elements, but the last - table element in the stack of open elements has no parent, or - its parent node is not an element, then the foster parent - element is the element before the last table element in the - stack of open elements. */ - for($n = count($this->stack) - 1; $n >= 0; $n--) { - if($this->stack[$n]->nodeName === 'table') { - $table = $this->stack[$n]; - break; - } - } - - if(isset($table) && $table->parentNode !== null) { - $this->foster_parent = $table->parentNode; - - } elseif(!isset($table)) { - $this->foster_parent = $this->stack[0]; - - } elseif(isset($table) && ($table->parentNode === null || - $table->parentNode->nodeType !== XML_ELEMENT_NODE)) { - $this->foster_parent = $this->stack[$n - 1]; - } - } - - $this->inBody($token); - } - } - - private function inCaption($token) { - /* An end tag whose tag name is "caption" */ - if($token['type'] === HTML5::ENDTAG && $token['name'] === 'caption') { - /* If the stack of open elements does not have an element in table - scope with the same tag name as the token, this is a parse error. - Ignore the token. (innerHTML case) */ - if(!$this->elementInScope($token['name'], true)) { - // Ignore - - /* Otherwise: */ - } else { - /* Generate implied end tags. */ - $this->generateImpliedEndTags(); - - /* Now, if the current node is not a caption element, then this - is a parse error. */ - // w/e - - /* Pop elements from this stack until a caption element has - been popped from the stack. */ - while(true) { - $node = end($this->stack)->nodeName; - array_pop($this->stack); - - if($node === 'caption') { - break; - } - } - - /* Clear the list of active formatting elements up to the last - marker. */ - $this->clearTheActiveFormattingElementsUpToTheLastMarker(); - - /* Switch the insertion mode to "in table". */ - $this->mode = self::IN_TABLE; - } - - /* A start tag whose tag name is one of: "caption", "col", "colgroup", - "tbody", "td", "tfoot", "th", "thead", "tr", or an end tag whose tag - name is "table" */ - } elseif(($token['type'] === HTML5::STARTTAG && in_array($token['name'], - array('caption', 'col', 'colgroup', 'tbody', 'td', 'tfoot', 'th', - 'thead', 'tr'))) || ($token['type'] === HTML5::ENDTAG && - $token['name'] === 'table')) { - /* Parse error. Act as if an end tag with the tag name "caption" - had been seen, then, if that token wasn't ignored, reprocess the - current token. */ - $this->inCaption(array( - 'name' => 'caption', - 'type' => HTML5::ENDTAG - )); - - return $this->inTable($token); - - /* An end tag whose tag name is one of: "body", "col", "colgroup", - "html", "tbody", "td", "tfoot", "th", "thead", "tr" */ - } elseif($token['type'] === HTML5::ENDTAG && in_array($token['name'], - array('body', 'col', 'colgroup', 'html', 'tbody', 'tfoot', 'th', - 'thead', 'tr'))) { - // Parse error. Ignore the token. - - /* Anything else */ - } else { - /* Process the token as if the insertion mode was "in body". */ - $this->inBody($token); - } - } - - private function inColumnGroup($token) { - /* A character token that is one of one of U+0009 CHARACTER TABULATION, - U+000A LINE FEED (LF), U+000B LINE TABULATION, U+000C FORM FEED (FF), - or U+0020 SPACE */ - if($token['type'] === HTML5::CHARACTR && - preg_match('/^[\t\n\x0b\x0c ]+$/', $token['data'])) { - /* Append the character to the current node. */ - $text = $this->dom->createTextNode($token['data']); - end($this->stack)->appendChild($text); - - /* A comment token */ - } elseif($token['type'] === HTML5::COMMENT) { - /* Append a Comment node to the current node with the data - attribute set to the data given in the comment token. */ - $comment = $this->dom->createComment($token['data']); - end($this->stack)->appendChild($comment); - - /* A start tag whose tag name is "col" */ - } elseif($token['type'] === HTML5::STARTTAG && $token['name'] === 'col') { - /* Insert a col element for the token. Immediately pop the current - node off the stack of open elements. */ - $this->insertElement($token); - array_pop($this->stack); - - /* An end tag whose tag name is "colgroup" */ - } elseif($token['type'] === HTML5::ENDTAG && - $token['name'] === 'colgroup') { - /* If the current node is the root html element, then this is a - parse error, ignore the token. (innerHTML case) */ - if(end($this->stack)->nodeName === 'html') { - // Ignore - - /* Otherwise, pop the current node (which will be a colgroup - element) from the stack of open elements. Switch the insertion - mode to "in table". */ - } else { - array_pop($this->stack); - $this->mode = self::IN_TABLE; - } - - /* An end tag whose tag name is "col" */ - } elseif($token['type'] === HTML5::ENDTAG && $token['name'] === 'col') { - /* Parse error. Ignore the token. */ - - /* Anything else */ - } else { - /* Act as if an end tag with the tag name "colgroup" had been seen, - and then, if that token wasn't ignored, reprocess the current token. */ - $this->inColumnGroup(array( - 'name' => 'colgroup', - 'type' => HTML5::ENDTAG - )); - - return $this->inTable($token); - } - } - - private function inTableBody($token) { - $clear = array('tbody', 'tfoot', 'thead', 'html'); - - /* A start tag whose tag name is "tr" */ - if($token['type'] === HTML5::STARTTAG && $token['name'] === 'tr') { - /* Clear the stack back to a table body context. */ - $this->clearStackToTableContext($clear); - - /* Insert a tr element for the token, then switch the insertion - mode to "in row". */ - $this->insertElement($token); - $this->mode = self::IN_ROW; - - /* A start tag whose tag name is one of: "th", "td" */ - } elseif($token['type'] === HTML5::STARTTAG && - ($token['name'] === 'th' || $token['name'] === 'td')) { - /* Parse error. Act as if a start tag with the tag name "tr" had - been seen, then reprocess the current token. */ - $this->inTableBody(array( - 'name' => 'tr', - 'type' => HTML5::STARTTAG, - 'attr' => array() - )); - - return $this->inRow($token); - - /* An end tag whose tag name is one of: "tbody", "tfoot", "thead" */ - } elseif($token['type'] === HTML5::ENDTAG && - in_array($token['name'], array('tbody', 'tfoot', 'thead'))) { - /* If the stack of open elements does not have an element in table - scope with the same tag name as the token, this is a parse error. - Ignore the token. */ - if(!$this->elementInScope($token['name'], true)) { - // Ignore - - /* Otherwise: */ - } else { - /* Clear the stack back to a table body context. */ - $this->clearStackToTableContext($clear); - - /* Pop the current node from the stack of open elements. Switch - the insertion mode to "in table". */ - array_pop($this->stack); - $this->mode = self::IN_TABLE; - } - - /* A start tag whose tag name is one of: "caption", "col", "colgroup", - "tbody", "tfoot", "thead", or an end tag whose tag name is "table" */ - } elseif(($token['type'] === HTML5::STARTTAG && in_array($token['name'], - array('caption', 'col', 'colgroup', 'tbody', 'tfoor', 'thead'))) || - ($token['type'] === HTML5::STARTTAG && $token['name'] === 'table')) { - /* If the stack of open elements does not have a tbody, thead, or - tfoot element in table scope, this is a parse error. Ignore the - token. (innerHTML case) */ - if(!$this->elementInScope(array('tbody', 'thead', 'tfoot'), true)) { - // Ignore. - - /* Otherwise: */ - } else { - /* Clear the stack back to a table body context. */ - $this->clearStackToTableContext($clear); - - /* Act as if an end tag with the same tag name as the current - node ("tbody", "tfoot", or "thead") had been seen, then - reprocess the current token. */ - $this->inTableBody(array( - 'name' => end($this->stack)->nodeName, - 'type' => HTML5::ENDTAG - )); - - return $this->mainPhase($token); - } - - /* An end tag whose tag name is one of: "body", "caption", "col", - "colgroup", "html", "td", "th", "tr" */ - } elseif($token['type'] === HTML5::ENDTAG && in_array($token['name'], - array('body', 'caption', 'col', 'colgroup', 'html', 'td', 'th', 'tr'))) { - /* Parse error. Ignore the token. */ - - /* Anything else */ - } else { - /* Process the token as if the insertion mode was "in table". */ - $this->inTable($token); - } - } - - private function inRow($token) { - $clear = array('tr', 'html'); - - /* A start tag whose tag name is one of: "th", "td" */ - if($token['type'] === HTML5::STARTTAG && - ($token['name'] === 'th' || $token['name'] === 'td')) { - /* Clear the stack back to a table row context. */ - $this->clearStackToTableContext($clear); - - /* Insert an HTML element for the token, then switch the insertion - mode to "in cell". */ - $this->insertElement($token); - $this->mode = self::IN_CELL; - - /* Insert a marker at the end of the list of active formatting - elements. */ - $this->a_formatting[] = self::MARKER; - - /* An end tag whose tag name is "tr" */ - } elseif($token['type'] === HTML5::ENDTAG && $token['name'] === 'tr') { - /* If the stack of open elements does not have an element in table - scope with the same tag name as the token, this is a parse error. - Ignore the token. (innerHTML case) */ - if(!$this->elementInScope($token['name'], true)) { - // Ignore. - - /* Otherwise: */ - } else { - /* Clear the stack back to a table row context. */ - $this->clearStackToTableContext($clear); - - /* Pop the current node (which will be a tr element) from the - stack of open elements. Switch the insertion mode to "in table - body". */ - array_pop($this->stack); - $this->mode = self::IN_TBODY; - } - - /* A start tag whose tag name is one of: "caption", "col", "colgroup", - "tbody", "tfoot", "thead", "tr" or an end tag whose tag name is "table" */ - } elseif($token['type'] === HTML5::STARTTAG && in_array($token['name'], - array('caption', 'col', 'colgroup', 'tbody', 'tfoot', 'thead', 'tr'))) { - /* Act as if an end tag with the tag name "tr" had been seen, then, - if that token wasn't ignored, reprocess the current token. */ - $this->inRow(array( - 'name' => 'tr', - 'type' => HTML5::ENDTAG - )); - - return $this->inCell($token); - - /* An end tag whose tag name is one of: "tbody", "tfoot", "thead" */ - } elseif($token['type'] === HTML5::ENDTAG && - in_array($token['name'], array('tbody', 'tfoot', 'thead'))) { - /* If the stack of open elements does not have an element in table - scope with the same tag name as the token, this is a parse error. - Ignore the token. */ - if(!$this->elementInScope($token['name'], true)) { - // Ignore. - - /* Otherwise: */ - } else { - /* Otherwise, act as if an end tag with the tag name "tr" had - been seen, then reprocess the current token. */ - $this->inRow(array( - 'name' => 'tr', - 'type' => HTML5::ENDTAG - )); - - return $this->inCell($token); - } - - /* An end tag whose tag name is one of: "body", "caption", "col", - "colgroup", "html", "td", "th" */ - } elseif($token['type'] === HTML5::ENDTAG && in_array($token['name'], - array('body', 'caption', 'col', 'colgroup', 'html', 'td', 'th', 'tr'))) { - /* Parse error. Ignore the token. */ - - /* Anything else */ - } else { - /* Process the token as if the insertion mode was "in table". */ - $this->inTable($token); - } - } - - private function inCell($token) { - /* An end tag whose tag name is one of: "td", "th" */ - if($token['type'] === HTML5::ENDTAG && - ($token['name'] === 'td' || $token['name'] === 'th')) { - /* If the stack of open elements does not have an element in table - scope with the same tag name as that of the token, then this is a - parse error and the token must be ignored. */ - if(!$this->elementInScope($token['name'], true)) { - // Ignore. - - /* Otherwise: */ - } else { - /* Generate implied end tags, except for elements with the same - tag name as the token. */ - $this->generateImpliedEndTags(array($token['name'])); - - /* Now, if the current node is not an element with the same tag - name as the token, then this is a parse error. */ - // k - - /* Pop elements from this stack until an element with the same - tag name as the token has been popped from the stack. */ - while(true) { - $node = end($this->stack)->nodeName; - array_pop($this->stack); - - if($node === $token['name']) { - break; - } - } - - /* Clear the list of active formatting elements up to the last - marker. */ - $this->clearTheActiveFormattingElementsUpToTheLastMarker(); - - /* Switch the insertion mode to "in row". (The current node - will be a tr element at this point.) */ - $this->mode = self::IN_ROW; - } - - /* A start tag whose tag name is one of: "caption", "col", "colgroup", - "tbody", "td", "tfoot", "th", "thead", "tr" */ - } elseif($token['type'] === HTML5::STARTTAG && in_array($token['name'], - array('caption', 'col', 'colgroup', 'tbody', 'td', 'tfoot', 'th', - 'thead', 'tr'))) { - /* If the stack of open elements does not have a td or th element - in table scope, then this is a parse error; ignore the token. - (innerHTML case) */ - if(!$this->elementInScope(array('td', 'th'), true)) { - // Ignore. - - /* Otherwise, close the cell (see below) and reprocess the current - token. */ - } else { - $this->closeCell(); - return $this->inRow($token); - } - - /* A start tag whose tag name is one of: "caption", "col", "colgroup", - "tbody", "td", "tfoot", "th", "thead", "tr" */ - } elseif($token['type'] === HTML5::STARTTAG && in_array($token['name'], - array('caption', 'col', 'colgroup', 'tbody', 'td', 'tfoot', 'th', - 'thead', 'tr'))) { - /* If the stack of open elements does not have a td or th element - in table scope, then this is a parse error; ignore the token. - (innerHTML case) */ - if(!$this->elementInScope(array('td', 'th'), true)) { - // Ignore. - - /* Otherwise, close the cell (see below) and reprocess the current - token. */ - } else { - $this->closeCell(); - return $this->inRow($token); - } - - /* An end tag whose tag name is one of: "body", "caption", "col", - "colgroup", "html" */ - } elseif($token['type'] === HTML5::ENDTAG && in_array($token['name'], - array('body', 'caption', 'col', 'colgroup', 'html'))) { - /* Parse error. Ignore the token. */ - - /* An end tag whose tag name is one of: "table", "tbody", "tfoot", - "thead", "tr" */ - } elseif($token['type'] === HTML5::ENDTAG && in_array($token['name'], - array('table', 'tbody', 'tfoot', 'thead', 'tr'))) { - /* If the stack of open elements does not have an element in table - scope with the same tag name as that of the token (which can only - happen for "tbody", "tfoot" and "thead", or, in the innerHTML case), - then this is a parse error and the token must be ignored. */ - if(!$this->elementInScope($token['name'], true)) { - // Ignore. - - /* Otherwise, close the cell (see below) and reprocess the current - token. */ - } else { - $this->closeCell(); - return $this->inRow($token); - } - - /* Anything else */ - } else { - /* Process the token as if the insertion mode was "in body". */ - $this->inBody($token); - } - } - - private function inSelect($token) { - /* Handle the token as follows: */ - - /* A character token */ - if($token['type'] === HTML5::CHARACTR) { - /* Append the token's character to the current node. */ - $this->insertText($token['data']); - - /* A comment token */ - } elseif($token['type'] === HTML5::COMMENT) { - /* Append a Comment node to the current node with the data - attribute set to the data given in the comment token. */ - $this->insertComment($token['data']); - - /* A start tag token whose tag name is "option" */ - } elseif($token['type'] === HTML5::STARTTAG && - $token['name'] === 'option') { - /* If the current node is an option element, act as if an end tag - with the tag name "option" had been seen. */ - if(end($this->stack)->nodeName === 'option') { - $this->inSelect(array( - 'name' => 'option', - 'type' => HTML5::ENDTAG - )); - } - - /* Insert an HTML element for the token. */ - $this->insertElement($token); - - /* A start tag token whose tag name is "optgroup" */ - } elseif($token['type'] === HTML5::STARTTAG && - $token['name'] === 'optgroup') { - /* If the current node is an option element, act as if an end tag - with the tag name "option" had been seen. */ - if(end($this->stack)->nodeName === 'option') { - $this->inSelect(array( - 'name' => 'option', - 'type' => HTML5::ENDTAG - )); - } - - /* If the current node is an optgroup element, act as if an end tag - with the tag name "optgroup" had been seen. */ - if(end($this->stack)->nodeName === 'optgroup') { - $this->inSelect(array( - 'name' => 'optgroup', - 'type' => HTML5::ENDTAG - )); - } - - /* Insert an HTML element for the token. */ - $this->insertElement($token); - - /* An end tag token whose tag name is "optgroup" */ - } elseif($token['type'] === HTML5::ENDTAG && - $token['name'] === 'optgroup') { - /* First, if the current node is an option element, and the node - immediately before it in the stack of open elements is an optgroup - element, then act as if an end tag with the tag name "option" had - been seen. */ - $elements_in_stack = count($this->stack); - - if($this->stack[$elements_in_stack - 1]->nodeName === 'option' && - $this->stack[$elements_in_stack - 2]->nodeName === 'optgroup') { - $this->inSelect(array( - 'name' => 'option', - 'type' => HTML5::ENDTAG - )); - } - - /* If the current node is an optgroup element, then pop that node - from the stack of open elements. Otherwise, this is a parse error, - ignore the token. */ - if($this->stack[$elements_in_stack - 1] === 'optgroup') { - array_pop($this->stack); - } - - /* An end tag token whose tag name is "option" */ - } elseif($token['type'] === HTML5::ENDTAG && - $token['name'] === 'option') { - /* If the current node is an option element, then pop that node - from the stack of open elements. Otherwise, this is a parse error, - ignore the token. */ - if(end($this->stack)->nodeName === 'option') { - array_pop($this->stack); - } - - /* An end tag whose tag name is "select" */ - } elseif($token['type'] === HTML5::ENDTAG && - $token['name'] === 'select') { - /* If the stack of open elements does not have an element in table - scope with the same tag name as the token, this is a parse error. - Ignore the token. (innerHTML case) */ - if(!$this->elementInScope($token['name'], true)) { - // w/e - - /* Otherwise: */ - } else { - /* Pop elements from the stack of open elements until a select - element has been popped from the stack. */ - while(true) { - $current = end($this->stack)->nodeName; - array_pop($this->stack); - - if($current === 'select') { - break; - } - } - - /* Reset the insertion mode appropriately. */ - $this->resetInsertionMode(); - } - - /* A start tag whose tag name is "select" */ - } elseif($token['name'] === 'select' && - $token['type'] === HTML5::STARTTAG) { - /* Parse error. Act as if the token had been an end tag with the - tag name "select" instead. */ - $this->inSelect(array( - 'name' => 'select', - 'type' => HTML5::ENDTAG - )); - - /* An end tag whose tag name is one of: "caption", "table", "tbody", - "tfoot", "thead", "tr", "td", "th" */ - } elseif(in_array($token['name'], array('caption', 'table', 'tbody', - 'tfoot', 'thead', 'tr', 'td', 'th')) && $token['type'] === HTML5::ENDTAG) { - /* Parse error. */ - // w/e - - /* If the stack of open elements has an element in table scope with - the same tag name as that of the token, then act as if an end tag - with the tag name "select" had been seen, and reprocess the token. - Otherwise, ignore the token. */ - if($this->elementInScope($token['name'], true)) { - $this->inSelect(array( - 'name' => 'select', - 'type' => HTML5::ENDTAG - )); - - $this->mainPhase($token); - } - - /* Anything else */ - } else { - /* Parse error. Ignore the token. */ - } - } - - private function afterBody($token) { - /* Handle the token as follows: */ - - /* A character token that is one of one of U+0009 CHARACTER TABULATION, - U+000A LINE FEED (LF), U+000B LINE TABULATION, U+000C FORM FEED (FF), - or U+0020 SPACE */ - if($token['type'] === HTML5::CHARACTR && - preg_match('/^[\t\n\x0b\x0c ]+$/', $token['data'])) { - /* Process the token as it would be processed if the insertion mode - was "in body". */ - $this->inBody($token); - - /* A comment token */ - } elseif($token['type'] === HTML5::COMMENT) { - /* Append a Comment node to the first element in the stack of open - elements (the html element), with the data attribute set to the - data given in the comment token. */ - $comment = $this->dom->createComment($token['data']); - $this->stack[0]->appendChild($comment); - - /* An end tag with the tag name "html" */ - } elseif($token['type'] === HTML5::ENDTAG && $token['name'] === 'html') { - /* If the parser was originally created in order to handle the - setting of an element's innerHTML attribute, this is a parse error; - ignore the token. (The element will be an html element in this - case.) (innerHTML case) */ - - /* Otherwise, switch to the trailing end phase. */ - $this->phase = self::END_PHASE; - - /* Anything else */ - } else { - /* Parse error. Set the insertion mode to "in body" and reprocess - the token. */ - $this->mode = self::IN_BODY; - return $this->inBody($token); - } - } - - private function inFrameset($token) { - /* Handle the token as follows: */ - - /* A character token that is one of one of U+0009 CHARACTER TABULATION, - U+000A LINE FEED (LF), U+000B LINE TABULATION, U+000C FORM FEED (FF), - U+000D CARRIAGE RETURN (CR), or U+0020 SPACE */ - if($token['type'] === HTML5::CHARACTR && - preg_match('/^[\t\n\x0b\x0c ]+$/', $token['data'])) { - /* Append the character to the current node. */ - $this->insertText($token['data']); - - /* A comment token */ - } elseif($token['type'] === HTML5::COMMENT) { - /* Append a Comment node to the current node with the data - attribute set to the data given in the comment token. */ - $this->insertComment($token['data']); - - /* A start tag with the tag name "frameset" */ - } elseif($token['name'] === 'frameset' && - $token['type'] === HTML5::STARTTAG) { - $this->insertElement($token); - - /* An end tag with the tag name "frameset" */ - } elseif($token['name'] === 'frameset' && - $token['type'] === HTML5::ENDTAG) { - /* If the current node is the root html element, then this is a - parse error; ignore the token. (innerHTML case) */ - if(end($this->stack)->nodeName === 'html') { - // Ignore - - } else { - /* Otherwise, pop the current node from the stack of open - elements. */ - array_pop($this->stack); - - /* If the parser was not originally created in order to handle - the setting of an element's innerHTML attribute (innerHTML case), - and the current node is no longer a frameset element, then change - the insertion mode to "after frameset". */ - $this->mode = self::AFTR_FRAME; - } - - /* A start tag with the tag name "frame" */ - } elseif($token['name'] === 'frame' && - $token['type'] === HTML5::STARTTAG) { - /* Insert an HTML element for the token. */ - $this->insertElement($token); - - /* Immediately pop the current node off the stack of open elements. */ - array_pop($this->stack); - - /* A start tag with the tag name "noframes" */ - } elseif($token['name'] === 'noframes' && - $token['type'] === HTML5::STARTTAG) { - /* Process the token as if the insertion mode had been "in body". */ - $this->inBody($token); - - /* Anything else */ - } else { - /* Parse error. Ignore the token. */ - } - } - - private function afterFrameset($token) { - /* Handle the token as follows: */ - - /* A character token that is one of one of U+0009 CHARACTER TABULATION, - U+000A LINE FEED (LF), U+000B LINE TABULATION, U+000C FORM FEED (FF), - U+000D CARRIAGE RETURN (CR), or U+0020 SPACE */ - if($token['type'] === HTML5::CHARACTR && - preg_match('/^[\t\n\x0b\x0c ]+$/', $token['data'])) { - /* Append the character to the current node. */ - $this->insertText($token['data']); - - /* A comment token */ - } elseif($token['type'] === HTML5::COMMENT) { - /* Append a Comment node to the current node with the data - attribute set to the data given in the comment token. */ - $this->insertComment($token['data']); - - /* An end tag with the tag name "html" */ - } elseif($token['name'] === 'html' && - $token['type'] === HTML5::ENDTAG) { - /* Switch to the trailing end phase. */ - $this->phase = self::END_PHASE; - - /* A start tag with the tag name "noframes" */ - } elseif($token['name'] === 'noframes' && - $token['type'] === HTML5::STARTTAG) { - /* Process the token as if the insertion mode had been "in body". */ - $this->inBody($token); - - /* Anything else */ - } else { - /* Parse error. Ignore the token. */ - } - } - - private function trailingEndPhase($token) { - /* After the main phase, as each token is emitted from the tokenisation - stage, it must be processed as described in this section. */ - - /* A DOCTYPE token */ - if($token['type'] === HTML5::DOCTYPE) { - // Parse error. Ignore the token. - - /* A comment token */ - } elseif($token['type'] === HTML5::COMMENT) { - /* Append a Comment node to the Document object with the data - attribute set to the data given in the comment token. */ - $comment = $this->dom->createComment($token['data']); - $this->dom->appendChild($comment); - - /* A character token that is one of one of U+0009 CHARACTER TABULATION, - U+000A LINE FEED (LF), U+000B LINE TABULATION, U+000C FORM FEED (FF), - or U+0020 SPACE */ - } elseif($token['type'] === HTML5::CHARACTR && - preg_match('/^[\t\n\x0b\x0c ]+$/', $token['data'])) { - /* Process the token as it would be processed in the main phase. */ - $this->mainPhase($token); - - /* A character token that is not one of U+0009 CHARACTER TABULATION, - U+000A LINE FEED (LF), U+000B LINE TABULATION, U+000C FORM FEED (FF), - or U+0020 SPACE. Or a start tag token. Or an end tag token. */ - } elseif(($token['type'] === HTML5::CHARACTR && - preg_match('/^[\t\n\x0b\x0c ]+$/', $token['data'])) || - $token['type'] === HTML5::STARTTAG || $token['type'] === HTML5::ENDTAG) { - /* Parse error. Switch back to the main phase and reprocess the - token. */ - $this->phase = self::MAIN_PHASE; - return $this->mainPhase($token); - - /* An end-of-file token */ - } elseif($token['type'] === HTML5::EOF) { - /* OMG DONE!! */ - } - } - - private function insertElement($token, $append = true, $check = false) { - // Proprietary workaround for libxml2's limitations with tag names - if ($check) { - // Slightly modified HTML5 tag-name modification, - // removing anything that's not an ASCII letter, digit, or hyphen - $token['name'] = preg_replace('/[^a-z0-9-]/i', '', $token['name']); - // Remove leading hyphens and numbers - $token['name'] = ltrim($token['name'], '-0..9'); - // In theory, this should ever be needed, but just in case - if ($token['name'] === '') $token['name'] = 'span'; // arbitrary generic choice - } - - $el = $this->dom->createElement($token['name']); - - foreach($token['attr'] as $attr) { - if(!$el->hasAttribute($attr['name'])) { - $el->setAttribute($attr['name'], $attr['value']); - } - } - - $this->appendToRealParent($el); - $this->stack[] = $el; - - return $el; - } - - private function insertText($data) { - $text = $this->dom->createTextNode($data); - $this->appendToRealParent($text); - } - - private function insertComment($data) { - $comment = $this->dom->createComment($data); - $this->appendToRealParent($comment); - } - - private function appendToRealParent($node) { - if($this->foster_parent === null) { - end($this->stack)->appendChild($node); - - } elseif($this->foster_parent !== null) { - /* If the foster parent element is the parent element of the - last table element in the stack of open elements, then the new - node must be inserted immediately before the last table element - in the stack of open elements in the foster parent element; - otherwise, the new node must be appended to the foster parent - element. */ - for($n = count($this->stack) - 1; $n >= 0; $n--) { - if($this->stack[$n]->nodeName === 'table' && - $this->stack[$n]->parentNode !== null) { - $table = $this->stack[$n]; - break; - } - } - - if(isset($table) && $this->foster_parent->isSameNode($table->parentNode)) - $this->foster_parent->insertBefore($node, $table); - else - $this->foster_parent->appendChild($node); - - $this->foster_parent = null; - } - } - - private function elementInScope($el, $table = false) { - if(is_array($el)) { - foreach($el as $element) { - if($this->elementInScope($element, $table)) { - return true; - } - } - - return false; - } - - $leng = count($this->stack); - - for($n = 0; $n < $leng; $n++) { - /* 1. Initialise node to be the current node (the bottommost node of - the stack). */ - $node = $this->stack[$leng - 1 - $n]; - - if($node->tagName === $el) { - /* 2. If node is the target node, terminate in a match state. */ - return true; - - } elseif($node->tagName === 'table') { - /* 3. Otherwise, if node is a table element, terminate in a failure - state. */ - return false; - - } elseif($table === true && in_array($node->tagName, array('caption', 'td', - 'th', 'button', 'marquee', 'object'))) { - /* 4. Otherwise, if the algorithm is the "has an element in scope" - variant (rather than the "has an element in table scope" variant), - and node is one of the following, terminate in a failure state. */ - return false; - - } elseif($node === $node->ownerDocument->documentElement) { - /* 5. Otherwise, if node is an html element (root element), terminate - in a failure state. (This can only happen if the node is the topmost - node of the stack of open elements, and prevents the next step from - being invoked if there are no more elements in the stack.) */ - return false; - } - - /* Otherwise, set node to the previous entry in the stack of open - elements and return to step 2. (This will never fail, since the loop - will always terminate in the previous step if the top of the stack - is reached.) */ - } - } - - private function reconstructActiveFormattingElements() { - /* 1. If there are no entries in the list of active formatting elements, - then there is nothing to reconstruct; stop this algorithm. */ - $formatting_elements = count($this->a_formatting); - - if($formatting_elements === 0) { - return false; - } - - /* 3. Let entry be the last (most recently added) element in the list - of active formatting elements. */ - $entry = end($this->a_formatting); - - /* 2. If the last (most recently added) entry in the list of active - formatting elements is a marker, or if it is an element that is in the - stack of open elements, then there is nothing to reconstruct; stop this - algorithm. */ - if($entry === self::MARKER || in_array($entry, $this->stack, true)) { - return false; - } - - for($a = $formatting_elements - 1; $a >= 0; true) { - /* 4. If there are no entries before entry in the list of active - formatting elements, then jump to step 8. */ - if($a === 0) { - $step_seven = false; - break; - } - - /* 5. Let entry be the entry one earlier than entry in the list of - active formatting elements. */ - $a--; - $entry = $this->a_formatting[$a]; - - /* 6. If entry is neither a marker nor an element that is also in - thetack of open elements, go to step 4. */ - if($entry === self::MARKER || in_array($entry, $this->stack, true)) { - break; - } - } - - while(true) { - /* 7. Let entry be the element one later than entry in the list of - active formatting elements. */ - if(isset($step_seven) && $step_seven === true) { - $a++; - $entry = $this->a_formatting[$a]; - } - - /* 8. Perform a shallow clone of the element entry to obtain clone. */ - $clone = $entry->cloneNode(); - - /* 9. Append clone to the current node and push it onto the stack - of open elements so that it is the new current node. */ - end($this->stack)->appendChild($clone); - $this->stack[] = $clone; - - /* 10. Replace the entry for entry in the list with an entry for - clone. */ - $this->a_formatting[$a] = $clone; - - /* 11. If the entry for clone in the list of active formatting - elements is not the last entry in the list, return to step 7. */ - if(end($this->a_formatting) !== $clone) { - $step_seven = true; - } else { - break; - } - } - } - - private function clearTheActiveFormattingElementsUpToTheLastMarker() { - /* When the steps below require the UA to clear the list of active - formatting elements up to the last marker, the UA must perform the - following steps: */ - - while(true) { - /* 1. Let entry be the last (most recently added) entry in the list - of active formatting elements. */ - $entry = end($this->a_formatting); - - /* 2. Remove entry from the list of active formatting elements. */ - array_pop($this->a_formatting); - - /* 3. If entry was a marker, then stop the algorithm at this point. - The list has been cleared up to the last marker. */ - if($entry === self::MARKER) { - break; - } - } - } - - private function generateImpliedEndTags($exclude = array()) { - /* When the steps below require the UA to generate implied end tags, - then, if the current node is a dd element, a dt element, an li element, - a p element, a td element, a th element, or a tr element, the UA must - act as if an end tag with the respective tag name had been seen and - then generate implied end tags again. */ - $node = end($this->stack); - $elements = array_diff(array('dd', 'dt', 'li', 'p', 'td', 'th', 'tr'), $exclude); - - while(in_array(end($this->stack)->nodeName, $elements)) { - array_pop($this->stack); - } - } - - private function getElementCategory($node) { - $name = $node->tagName; - if(in_array($name, $this->special)) - return self::SPECIAL; - - elseif(in_array($name, $this->scoping)) - return self::SCOPING; - - elseif(in_array($name, $this->formatting)) - return self::FORMATTING; - - else - return self::PHRASING; - } - - private function clearStackToTableContext($elements) { - /* When the steps above require the UA to clear the stack back to a - table context, it means that the UA must, while the current node is not - a table element or an html element, pop elements from the stack of open - elements. If this causes any elements to be popped from the stack, then - this is a parse error. */ - while(true) { - $node = end($this->stack)->nodeName; - - if(in_array($node, $elements)) { - break; - } else { - array_pop($this->stack); - } - } - } - - private function resetInsertionMode() { - /* 1. Let last be false. */ - $last = false; - $leng = count($this->stack); - - for($n = $leng - 1; $n >= 0; $n--) { - /* 2. Let node be the last node in the stack of open elements. */ - $node = $this->stack[$n]; - - /* 3. If node is the first node in the stack of open elements, then - set last to true. If the element whose innerHTML attribute is being - set is neither a td element nor a th element, then set node to the - element whose innerHTML attribute is being set. (innerHTML case) */ - if($this->stack[0]->isSameNode($node)) { - $last = true; - } - - /* 4. If node is a select element, then switch the insertion mode to - "in select" and abort these steps. (innerHTML case) */ - if($node->nodeName === 'select') { - $this->mode = self::IN_SELECT; - break; - - /* 5. If node is a td or th element, then switch the insertion mode - to "in cell" and abort these steps. */ - } elseif($node->nodeName === 'td' || $node->nodeName === 'th') { - $this->mode = self::IN_CELL; - break; - - /* 6. If node is a tr element, then switch the insertion mode to - "in row" and abort these steps. */ - } elseif($node->nodeName === 'tr') { - $this->mode = self::IN_ROW; - break; - - /* 7. If node is a tbody, thead, or tfoot element, then switch the - insertion mode to "in table body" and abort these steps. */ - } elseif(in_array($node->nodeName, array('tbody', 'thead', 'tfoot'))) { - $this->mode = self::IN_TBODY; - break; - - /* 8. If node is a caption element, then switch the insertion mode - to "in caption" and abort these steps. */ - } elseif($node->nodeName === 'caption') { - $this->mode = self::IN_CAPTION; - break; - - /* 9. If node is a colgroup element, then switch the insertion mode - to "in column group" and abort these steps. (innerHTML case) */ - } elseif($node->nodeName === 'colgroup') { - $this->mode = self::IN_CGROUP; - break; - - /* 10. If node is a table element, then switch the insertion mode - to "in table" and abort these steps. */ - } elseif($node->nodeName === 'table') { - $this->mode = self::IN_TABLE; - break; - - /* 11. If node is a head element, then switch the insertion mode - to "in body" ("in body"! not "in head"!) and abort these steps. - (innerHTML case) */ - } elseif($node->nodeName === 'head') { - $this->mode = self::IN_BODY; - break; - - /* 12. If node is a body element, then switch the insertion mode to - "in body" and abort these steps. */ - } elseif($node->nodeName === 'body') { - $this->mode = self::IN_BODY; - break; - - /* 13. If node is a frameset element, then switch the insertion - mode to "in frameset" and abort these steps. (innerHTML case) */ - } elseif($node->nodeName === 'frameset') { - $this->mode = self::IN_FRAME; - break; - - /* 14. If node is an html element, then: if the head element - pointer is null, switch the insertion mode to "before head", - otherwise, switch the insertion mode to "after head". In either - case, abort these steps. (innerHTML case) */ - } elseif($node->nodeName === 'html') { - $this->mode = ($this->head_pointer === null) - ? self::BEFOR_HEAD - : self::AFTER_HEAD; - - break; - - /* 15. If last is true, then set the insertion mode to "in body" - and abort these steps. (innerHTML case) */ - } elseif($last) { - $this->mode = self::IN_BODY; - break; - } - } - } - - private function closeCell() { - /* If the stack of open elements has a td or th element in table scope, - then act as if an end tag token with that tag name had been seen. */ - foreach(array('td', 'th') as $cell) { - if($this->elementInScope($cell, true)) { - $this->inCell(array( - 'name' => $cell, - 'type' => HTML5::ENDTAG - )); - - break; - } - } - } - - public function save() { - return $this->dom; - } -} -?> diff --git a/main/inc/lib/htmlpurifier/library/HTMLPurifier/Lexer/index.html b/main/inc/lib/htmlpurifier/library/HTMLPurifier/Lexer/index.html deleted file mode 100755 index aa7b9c934b..0000000000 --- a/main/inc/lib/htmlpurifier/library/HTMLPurifier/Lexer/index.html +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/main/inc/lib/htmlpurifier/library/HTMLPurifier/PercentEncoder.php b/main/inc/lib/htmlpurifier/library/HTMLPurifier/PercentEncoder.php deleted file mode 100755 index a43c44f4c5..0000000000 --- a/main/inc/lib/htmlpurifier/library/HTMLPurifier/PercentEncoder.php +++ /dev/null @@ -1,98 +0,0 @@ -preserve[$i] = true; // digits - for ($i = 65; $i <= 90; $i++) $this->preserve[$i] = true; // upper-case - for ($i = 97; $i <= 122; $i++) $this->preserve[$i] = true; // lower-case - $this->preserve[45] = true; // Dash - - $this->preserve[46] = true; // Period . - $this->preserve[95] = true; // Underscore _ - $this->preserve[126]= true; // Tilde ~ - - // extra letters not to escape - if ($preserve !== false) { - for ($i = 0, $c = strlen($preserve); $i < $c; $i++) { - $this->preserve[ord($preserve[$i])] = true; - } - } - } - - /** - * Our replacement for urlencode, it encodes all non-reserved characters, - * as well as any extra characters that were instructed to be preserved. - * @note - * Assumes that the string has already been normalized, making any - * and all percent escape sequences valid. Percents will not be - * re-escaped, regardless of their status in $preserve - * @param $string String to be encoded - * @return Encoded string. - */ - public function encode($string) { - $ret = ''; - for ($i = 0, $c = strlen($string); $i < $c; $i++) { - if ($string[$i] !== '%' && !isset($this->preserve[$int = ord($string[$i])]) ) { - $ret .= '%' . sprintf('%02X', $int); - } else { - $ret .= $string[$i]; - } - } - return $ret; - } - - /** - * Fix up percent-encoding by decoding unreserved characters and normalizing. - * @warning This function is affected by $preserve, even though the - * usual desired behavior is for this not to preserve those - * characters. Be careful when reusing instances of PercentEncoder! - * @param $string String to normalize - */ - public function normalize($string) { - if ($string == '') return ''; - $parts = explode('%', $string); - $ret = array_shift($parts); - foreach ($parts as $part) { - $length = strlen($part); - if ($length < 2) { - $ret .= '%25' . $part; - continue; - } - $encoding = substr($part, 0, 2); - $text = substr($part, 2); - if (!ctype_xdigit($encoding)) { - $ret .= '%25' . $part; - continue; - } - $int = hexdec($encoding); - if (isset($this->preserve[$int])) { - $ret .= chr($int) . $text; - continue; - } - $encoding = strtoupper($encoding); - $ret .= '%' . $encoding . $text; - } - return $ret; - } - -} - -// vim: et sw=4 sts=4 diff --git a/main/inc/lib/htmlpurifier/library/HTMLPurifier/Printer.php b/main/inc/lib/htmlpurifier/library/HTMLPurifier/Printer.php deleted file mode 100755 index e7eb82e83e..0000000000 --- a/main/inc/lib/htmlpurifier/library/HTMLPurifier/Printer.php +++ /dev/null @@ -1,176 +0,0 @@ -getAll(); - $context = new HTMLPurifier_Context(); - $this->generator = new HTMLPurifier_Generator($config, $context); - } - - /** - * Main function that renders object or aspect of that object - * @note Parameters vary depending on printer - */ - // function render() {} - - /** - * Returns a start tag - * @param $tag Tag name - * @param $attr Attribute array - */ - protected function start($tag, $attr = array()) { - return $this->generator->generateFromToken( - new HTMLPurifier_Token_Start($tag, $attr ? $attr : array()) - ); - } - - /** - * Returns an end teg - * @param $tag Tag name - */ - protected function end($tag) { - return $this->generator->generateFromToken( - new HTMLPurifier_Token_End($tag) - ); - } - - /** - * Prints a complete element with content inside - * @param $tag Tag name - * @param $contents Element contents - * @param $attr Tag attributes - * @param $escape Bool whether or not to escape contents - */ - protected function element($tag, $contents, $attr = array(), $escape = true) { - return $this->start($tag, $attr) . - ($escape ? $this->escape($contents) : $contents) . - $this->end($tag); - } - - protected function elementEmpty($tag, $attr = array()) { - return $this->generator->generateFromToken( - new HTMLPurifier_Token_Empty($tag, $attr) - ); - } - - protected function text($text) { - return $this->generator->generateFromToken( - new HTMLPurifier_Token_Text($text) - ); - } - - /** - * Prints a simple key/value row in a table. - * @param $name Key - * @param $value Value - */ - protected function row($name, $value) { - if (is_bool($value)) $value = $value ? 'On' : 'Off'; - return - $this->start('tr') . "\n" . - $this->element('th', $name) . "\n" . - $this->element('td', $value) . "\n" . - $this->end('tr') - ; - } - - /** - * Escapes a string for HTML output. - * @param $string String to escape - */ - protected function escape($string) { - $string = HTMLPurifier_Encoder::cleanUTF8($string); - $string = htmlspecialchars($string, ENT_COMPAT, 'UTF-8'); - return $string; - } - - /** - * Takes a list of strings and turns them into a single list - * @param $array List of strings - * @param $polite Bool whether or not to add an end before the last - */ - protected function listify($array, $polite = false) { - if (empty($array)) return 'None'; - $ret = ''; - $i = count($array); - foreach ($array as $value) { - $i--; - $ret .= $value; - if ($i > 0 && !($polite && $i == 1)) $ret .= ', '; - if ($polite && $i == 1) $ret .= 'and '; - } - return $ret; - } - - /** - * Retrieves the class of an object without prefixes, as well as metadata - * @param $obj Object to determine class of - * @param $prefix Further prefix to remove - */ - protected function getClass($obj, $sec_prefix = '') { - static $five = null; - if ($five === null) $five = version_compare(PHP_VERSION, '5', '>='); - $prefix = 'HTMLPurifier_' . $sec_prefix; - if (!$five) $prefix = strtolower($prefix); - $class = str_replace($prefix, '', get_class($obj)); - $lclass = strtolower($class); - $class .= '('; - switch ($lclass) { - case 'enum': - $values = array(); - foreach ($obj->valid_values as $value => $bool) { - $values[] = $value; - } - $class .= implode(', ', $values); - break; - case 'css_composite': - $values = array(); - foreach ($obj->defs as $def) { - $values[] = $this->getClass($def, $sec_prefix); - } - $class .= implode(', ', $values); - break; - case 'css_multiple': - $class .= $this->getClass($obj->single, $sec_prefix) . ', '; - $class .= $obj->max; - break; - case 'css_denyelementdecorator': - $class .= $this->getClass($obj->def, $sec_prefix) . ', '; - $class .= $obj->element; - break; - case 'css_importantdecorator': - $class .= $this->getClass($obj->def, $sec_prefix); - if ($obj->allow) $class .= ', !important'; - break; - } - $class .= ')'; - return $class; - } - -} - -// vim: et sw=4 sts=4 diff --git a/main/inc/lib/htmlpurifier/library/HTMLPurifier/Printer/CSSDefinition.php b/main/inc/lib/htmlpurifier/library/HTMLPurifier/Printer/CSSDefinition.php deleted file mode 100755 index 81f9865901..0000000000 --- a/main/inc/lib/htmlpurifier/library/HTMLPurifier/Printer/CSSDefinition.php +++ /dev/null @@ -1,38 +0,0 @@ -def = $config->getCSSDefinition(); - $ret = ''; - - $ret .= $this->start('div', array('class' => 'HTMLPurifier_Printer')); - $ret .= $this->start('table'); - - $ret .= $this->element('caption', 'Properties ($info)'); - - $ret .= $this->start('thead'); - $ret .= $this->start('tr'); - $ret .= $this->element('th', 'Property', array('class' => 'heavy')); - $ret .= $this->element('th', 'Definition', array('class' => 'heavy', 'style' => 'width:auto;')); - $ret .= $this->end('tr'); - $ret .= $this->end('thead'); - - ksort($this->def->info); - foreach ($this->def->info as $property => $obj) { - $name = $this->getClass($obj, 'AttrDef_'); - $ret .= $this->row($property, $name); - } - - $ret .= $this->end('table'); - $ret .= $this->end('div'); - - return $ret; - } - -} - -// vim: et sw=4 sts=4 diff --git a/main/inc/lib/htmlpurifier/library/HTMLPurifier/Printer/ConfigForm.css b/main/inc/lib/htmlpurifier/library/HTMLPurifier/Printer/ConfigForm.css deleted file mode 100755 index 3ff1a88aa4..0000000000 --- a/main/inc/lib/htmlpurifier/library/HTMLPurifier/Printer/ConfigForm.css +++ /dev/null @@ -1,10 +0,0 @@ - -.hp-config {} - -.hp-config tbody th {text-align:right; padding-right:0.5em;} -.hp-config thead, .hp-config .namespace {background:#3C578C; color:#FFF;} -.hp-config .namespace th {text-align:center;} -.hp-config .verbose {display:none;} -.hp-config .controls {text-align:center;} - -/* vim: et sw=4 sts=4 */ diff --git a/main/inc/lib/htmlpurifier/library/HTMLPurifier/Printer/ConfigForm.js b/main/inc/lib/htmlpurifier/library/HTMLPurifier/Printer/ConfigForm.js deleted file mode 100755 index cba00c9b80..0000000000 --- a/main/inc/lib/htmlpurifier/library/HTMLPurifier/Printer/ConfigForm.js +++ /dev/null @@ -1,5 +0,0 @@ -function toggleWriteability(id_of_patient, checked) { - document.getElementById(id_of_patient).disabled = checked; -} - -// vim: et sw=4 sts=4 diff --git a/main/inc/lib/htmlpurifier/library/HTMLPurifier/Printer/ConfigForm.php b/main/inc/lib/htmlpurifier/library/HTMLPurifier/Printer/ConfigForm.php deleted file mode 100755 index 02aa656894..0000000000 --- a/main/inc/lib/htmlpurifier/library/HTMLPurifier/Printer/ConfigForm.php +++ /dev/null @@ -1,368 +0,0 @@ -docURL = $doc_url; - $this->name = $name; - $this->compress = $compress; - // initialize sub-printers - $this->fields[0] = new HTMLPurifier_Printer_ConfigForm_default(); - $this->fields[HTMLPurifier_VarParser::BOOL] = new HTMLPurifier_Printer_ConfigForm_bool(); - } - - /** - * Sets default column and row size for textareas in sub-printers - * @param $cols Integer columns of textarea, null to use default - * @param $rows Integer rows of textarea, null to use default - */ - public function setTextareaDimensions($cols = null, $rows = null) { - if ($cols) $this->fields['default']->cols = $cols; - if ($rows) $this->fields['default']->rows = $rows; - } - - /** - * Retrieves styling, in case it is not accessible by webserver - */ - public static function getCSS() { - return file_get_contents(HTMLPURIFIER_PREFIX . '/HTMLPurifier/Printer/ConfigForm.css'); - } - - /** - * Retrieves JavaScript, in case it is not accessible by webserver - */ - public static function getJavaScript() { - return file_get_contents(HTMLPURIFIER_PREFIX . '/HTMLPurifier/Printer/ConfigForm.js'); - } - - /** - * Returns HTML output for a configuration form - * @param $config Configuration object of current form state, or an array - * where [0] has an HTML namespace and [1] is being rendered. - * @param $allowed Optional namespace(s) and directives to restrict form to. - */ - public function render($config, $allowed = true, $render_controls = true) { - if (is_array($config) && isset($config[0])) { - $gen_config = $config[0]; - $config = $config[1]; - } else { - $gen_config = $config; - } - - $this->config = $config; - $this->genConfig = $gen_config; - $this->prepareGenerator($gen_config); - - $allowed = HTMLPurifier_Config::getAllowedDirectivesForForm($allowed, $config->def); - $all = array(); - foreach ($allowed as $key) { - list($ns, $directive) = $key; - $all[$ns][$directive] = $config->get($ns .'.'. $directive); - } - - $ret = ''; - $ret .= $this->start('table', array('class' => 'hp-config')); - $ret .= $this->start('thead'); - $ret .= $this->start('tr'); - $ret .= $this->element('th', 'Directive', array('class' => 'hp-directive')); - $ret .= $this->element('th', 'Value', array('class' => 'hp-value')); - $ret .= $this->end('tr'); - $ret .= $this->end('thead'); - foreach ($all as $ns => $directives) { - $ret .= $this->renderNamespace($ns, $directives); - } - if ($render_controls) { - $ret .= $this->start('tbody'); - $ret .= $this->start('tr'); - $ret .= $this->start('td', array('colspan' => 2, 'class' => 'controls')); - $ret .= $this->elementEmpty('input', array('type' => 'submit', 'value' => 'Submit')); - $ret .= '[Reset]'; - $ret .= $this->end('td'); - $ret .= $this->end('tr'); - $ret .= $this->end('tbody'); - } - $ret .= $this->end('table'); - return $ret; - } - - /** - * Renders a single namespace - * @param $ns String namespace name - * @param $directive Associative array of directives to values - */ - protected function renderNamespace($ns, $directives) { - $ret = ''; - $ret .= $this->start('tbody', array('class' => 'namespace')); - $ret .= $this->start('tr'); - $ret .= $this->element('th', $ns, array('colspan' => 2)); - $ret .= $this->end('tr'); - $ret .= $this->end('tbody'); - $ret .= $this->start('tbody'); - foreach ($directives as $directive => $value) { - $ret .= $this->start('tr'); - $ret .= $this->start('th'); - if ($this->docURL) { - $url = str_replace('%s', urlencode("$ns.$directive"), $this->docURL); - $ret .= $this->start('a', array('href' => $url)); - } - $attr = array('for' => "{$this->name}:$ns.$directive"); - - // crop directive name if it's too long - if (!$this->compress || (strlen($directive) < $this->compress)) { - $directive_disp = $directive; - } else { - $directive_disp = substr($directive, 0, $this->compress - 2) . '...'; - $attr['title'] = $directive; - } - - $ret .= $this->element( - 'label', - $directive_disp, - // component printers must create an element with this id - $attr - ); - if ($this->docURL) $ret .= $this->end('a'); - $ret .= $this->end('th'); - - $ret .= $this->start('td'); - $def = $this->config->def->info["$ns.$directive"]; - if (is_int($def)) { - $allow_null = $def < 0; - $type = abs($def); - } else { - $type = $def->type; - $allow_null = isset($def->allow_null); - } - if (!isset($this->fields[$type])) $type = 0; // default - $type_obj = $this->fields[$type]; - if ($allow_null) { - $type_obj = new HTMLPurifier_Printer_ConfigForm_NullDecorator($type_obj); - } - $ret .= $type_obj->render($ns, $directive, $value, $this->name, array($this->genConfig, $this->config)); - $ret .= $this->end('td'); - $ret .= $this->end('tr'); - } - $ret .= $this->end('tbody'); - return $ret; - } - -} - -/** - * Printer decorator for directives that accept null - */ -class HTMLPurifier_Printer_ConfigForm_NullDecorator extends HTMLPurifier_Printer { - /** - * Printer being decorated - */ - protected $obj; - /** - * @param $obj Printer to decorate - */ - public function __construct($obj) { - parent::__construct(); - $this->obj = $obj; - } - public function render($ns, $directive, $value, $name, $config) { - if (is_array($config) && isset($config[0])) { - $gen_config = $config[0]; - $config = $config[1]; - } else { - $gen_config = $config; - } - $this->prepareGenerator($gen_config); - - $ret = ''; - $ret .= $this->start('label', array('for' => "$name:Null_$ns.$directive")); - $ret .= $this->element('span', "$ns.$directive:", array('class' => 'verbose')); - $ret .= $this->text(' Null/Disabled'); - $ret .= $this->end('label'); - $attr = array( - 'type' => 'checkbox', - 'value' => '1', - 'class' => 'null-toggle', - 'name' => "$name"."[Null_$ns.$directive]", - 'id' => "$name:Null_$ns.$directive", - 'onclick' => "toggleWriteability('$name:$ns.$directive',checked)" // INLINE JAVASCRIPT!!!! - ); - if ($this->obj instanceof HTMLPurifier_Printer_ConfigForm_bool) { - // modify inline javascript slightly - $attr['onclick'] = "toggleWriteability('$name:Yes_$ns.$directive',checked);toggleWriteability('$name:No_$ns.$directive',checked)"; - } - if ($value === null) $attr['checked'] = 'checked'; - $ret .= $this->elementEmpty('input', $attr); - $ret .= $this->text(' or '); - $ret .= $this->elementEmpty('br'); - $ret .= $this->obj->render($ns, $directive, $value, $name, array($gen_config, $config)); - return $ret; - } -} - -/** - * Swiss-army knife configuration form field printer - */ -class HTMLPurifier_Printer_ConfigForm_default extends HTMLPurifier_Printer { - public $cols = 18; - public $rows = 5; - public function render($ns, $directive, $value, $name, $config) { - if (is_array($config) && isset($config[0])) { - $gen_config = $config[0]; - $config = $config[1]; - } else { - $gen_config = $config; - } - $this->prepareGenerator($gen_config); - // this should probably be split up a little - $ret = ''; - $def = $config->def->info["$ns.$directive"]; - if (is_int($def)) { - $type = abs($def); - } else { - $type = $def->type; - } - if (is_array($value)) { - switch ($type) { - case HTMLPurifier_VarParser::LOOKUP: - $array = $value; - $value = array(); - foreach ($array as $val => $b) { - $value[] = $val; - } - case HTMLPurifier_VarParser::ALIST: - $value = implode(PHP_EOL, $value); - break; - case HTMLPurifier_VarParser::HASH: - $nvalue = ''; - foreach ($value as $i => $v) { - $nvalue .= "$i:$v" . PHP_EOL; - } - $value = $nvalue; - break; - default: - $value = ''; - } - } - if ($type === HTMLPurifier_VarParser::MIXED) { - return 'Not supported'; - $value = serialize($value); - } - $attr = array( - 'name' => "$name"."[$ns.$directive]", - 'id' => "$name:$ns.$directive" - ); - if ($value === null) $attr['disabled'] = 'disabled'; - if (isset($def->allowed)) { - $ret .= $this->start('select', $attr); - foreach ($def->allowed as $val => $b) { - $attr = array(); - if ($value == $val) $attr['selected'] = 'selected'; - $ret .= $this->element('option', $val, $attr); - } - $ret .= $this->end('select'); - } elseif ( - $type === HTMLPurifier_VarParser::TEXT || - $type === HTMLPurifier_VarParser::ITEXT || - $type === HTMLPurifier_VarParser::ALIST || - $type === HTMLPurifier_VarParser::HASH || - $type === HTMLPurifier_VarParser::LOOKUP - ) { - $attr['cols'] = $this->cols; - $attr['rows'] = $this->rows; - $ret .= $this->start('textarea', $attr); - $ret .= $this->text($value); - $ret .= $this->end('textarea'); - } else { - $attr['value'] = $value; - $attr['type'] = 'text'; - $ret .= $this->elementEmpty('input', $attr); - } - return $ret; - } -} - -/** - * Bool form field printer - */ -class HTMLPurifier_Printer_ConfigForm_bool extends HTMLPurifier_Printer { - public function render($ns, $directive, $value, $name, $config) { - if (is_array($config) && isset($config[0])) { - $gen_config = $config[0]; - $config = $config[1]; - } else { - $gen_config = $config; - } - $this->prepareGenerator($gen_config); - $ret = ''; - $ret .= $this->start('div', array('id' => "$name:$ns.$directive")); - - $ret .= $this->start('label', array('for' => "$name:Yes_$ns.$directive")); - $ret .= $this->element('span', "$ns.$directive:", array('class' => 'verbose')); - $ret .= $this->text(' Yes'); - $ret .= $this->end('label'); - - $attr = array( - 'type' => 'radio', - 'name' => "$name"."[$ns.$directive]", - 'id' => "$name:Yes_$ns.$directive", - 'value' => '1' - ); - if ($value === true) $attr['checked'] = 'checked'; - if ($value === null) $attr['disabled'] = 'disabled'; - $ret .= $this->elementEmpty('input', $attr); - - $ret .= $this->start('label', array('for' => "$name:No_$ns.$directive")); - $ret .= $this->element('span', "$ns.$directive:", array('class' => 'verbose')); - $ret .= $this->text(' No'); - $ret .= $this->end('label'); - - $attr = array( - 'type' => 'radio', - 'name' => "$name"."[$ns.$directive]", - 'id' => "$name:No_$ns.$directive", - 'value' => '0' - ); - if ($value === false) $attr['checked'] = 'checked'; - if ($value === null) $attr['disabled'] = 'disabled'; - $ret .= $this->elementEmpty('input', $attr); - - $ret .= $this->end('div'); - - return $ret; - } -} - -// vim: et sw=4 sts=4 diff --git a/main/inc/lib/htmlpurifier/library/HTMLPurifier/Printer/HTMLDefinition.php b/main/inc/lib/htmlpurifier/library/HTMLPurifier/Printer/HTMLDefinition.php deleted file mode 100755 index 8a8f126b81..0000000000 --- a/main/inc/lib/htmlpurifier/library/HTMLPurifier/Printer/HTMLDefinition.php +++ /dev/null @@ -1,272 +0,0 @@ -config =& $config; - - $this->def = $config->getHTMLDefinition(); - - $ret .= $this->start('div', array('class' => 'HTMLPurifier_Printer')); - - $ret .= $this->renderDoctype(); - $ret .= $this->renderEnvironment(); - $ret .= $this->renderContentSets(); - $ret .= $this->renderInfo(); - - $ret .= $this->end('div'); - - return $ret; - } - - /** - * Renders the Doctype table - */ - protected function renderDoctype() { - $doctype = $this->def->doctype; - $ret = ''; - $ret .= $this->start('table'); - $ret .= $this->element('caption', 'Doctype'); - $ret .= $this->row('Name', $doctype->name); - $ret .= $this->row('XML', $doctype->xml ? 'Yes' : 'No'); - $ret .= $this->row('Default Modules', implode($doctype->modules, ', ')); - $ret .= $this->row('Default Tidy Modules', implode($doctype->tidyModules, ', ')); - $ret .= $this->end('table'); - return $ret; - } - - - /** - * Renders environment table, which is miscellaneous info - */ - protected function renderEnvironment() { - $def = $this->def; - - $ret = ''; - - $ret .= $this->start('table'); - $ret .= $this->element('caption', 'Environment'); - - $ret .= $this->row('Parent of fragment', $def->info_parent); - $ret .= $this->renderChildren($def->info_parent_def->child); - $ret .= $this->row('Block wrap name', $def->info_block_wrapper); - - $ret .= $this->start('tr'); - $ret .= $this->element('th', 'Global attributes'); - $ret .= $this->element('td', $this->listifyAttr($def->info_global_attr),0,0); - $ret .= $this->end('tr'); - - $ret .= $this->start('tr'); - $ret .= $this->element('th', 'Tag transforms'); - $list = array(); - foreach ($def->info_tag_transform as $old => $new) { - $new = $this->getClass($new, 'TagTransform_'); - $list[] = "<$old> with $new"; - } - $ret .= $this->element('td', $this->listify($list)); - $ret .= $this->end('tr'); - - $ret .= $this->start('tr'); - $ret .= $this->element('th', 'Pre-AttrTransform'); - $ret .= $this->element('td', $this->listifyObjectList($def->info_attr_transform_pre)); - $ret .= $this->end('tr'); - - $ret .= $this->start('tr'); - $ret .= $this->element('th', 'Post-AttrTransform'); - $ret .= $this->element('td', $this->listifyObjectList($def->info_attr_transform_post)); - $ret .= $this->end('tr'); - - $ret .= $this->end('table'); - return $ret; - } - - /** - * Renders the Content Sets table - */ - protected function renderContentSets() { - $ret = ''; - $ret .= $this->start('table'); - $ret .= $this->element('caption', 'Content Sets'); - foreach ($this->def->info_content_sets as $name => $lookup) { - $ret .= $this->heavyHeader($name); - $ret .= $this->start('tr'); - $ret .= $this->element('td', $this->listifyTagLookup($lookup)); - $ret .= $this->end('tr'); - } - $ret .= $this->end('table'); - return $ret; - } - - /** - * Renders the Elements ($info) table - */ - protected function renderInfo() { - $ret = ''; - $ret .= $this->start('table'); - $ret .= $this->element('caption', 'Elements ($info)'); - ksort($this->def->info); - $ret .= $this->heavyHeader('Allowed tags', 2); - $ret .= $this->start('tr'); - $ret .= $this->element('td', $this->listifyTagLookup($this->def->info), array('colspan' => 2)); - $ret .= $this->end('tr'); - foreach ($this->def->info as $name => $def) { - $ret .= $this->start('tr'); - $ret .= $this->element('th', "<$name>", array('class'=>'heavy', 'colspan' => 2)); - $ret .= $this->end('tr'); - $ret .= $this->start('tr'); - $ret .= $this->element('th', 'Inline content'); - $ret .= $this->element('td', $def->descendants_are_inline ? 'Yes' : 'No'); - $ret .= $this->end('tr'); - if (!empty($def->excludes)) { - $ret .= $this->start('tr'); - $ret .= $this->element('th', 'Excludes'); - $ret .= $this->element('td', $this->listifyTagLookup($def->excludes)); - $ret .= $this->end('tr'); - } - if (!empty($def->attr_transform_pre)) { - $ret .= $this->start('tr'); - $ret .= $this->element('th', 'Pre-AttrTransform'); - $ret .= $this->element('td', $this->listifyObjectList($def->attr_transform_pre)); - $ret .= $this->end('tr'); - } - if (!empty($def->attr_transform_post)) { - $ret .= $this->start('tr'); - $ret .= $this->element('th', 'Post-AttrTransform'); - $ret .= $this->element('td', $this->listifyObjectList($def->attr_transform_post)); - $ret .= $this->end('tr'); - } - if (!empty($def->auto_close)) { - $ret .= $this->start('tr'); - $ret .= $this->element('th', 'Auto closed by'); - $ret .= $this->element('td', $this->listifyTagLookup($def->auto_close)); - $ret .= $this->end('tr'); - } - $ret .= $this->start('tr'); - $ret .= $this->element('th', 'Allowed attributes'); - $ret .= $this->element('td',$this->listifyAttr($def->attr), array(), 0); - $ret .= $this->end('tr'); - - if (!empty($def->required_attr)) { - $ret .= $this->row('Required attributes', $this->listify($def->required_attr)); - } - - $ret .= $this->renderChildren($def->child); - } - $ret .= $this->end('table'); - return $ret; - } - - /** - * Renders a row describing the allowed children of an element - * @param $def HTMLPurifier_ChildDef of pertinent element - */ - protected function renderChildren($def) { - $context = new HTMLPurifier_Context(); - $ret = ''; - $ret .= $this->start('tr'); - $elements = array(); - $attr = array(); - if (isset($def->elements)) { - if ($def->type == 'strictblockquote') { - $def->validateChildren(array(), $this->config, $context); - } - $elements = $def->elements; - } - if ($def->type == 'chameleon') { - $attr['rowspan'] = 2; - } elseif ($def->type == 'empty') { - $elements = array(); - } elseif ($def->type == 'table') { - $elements = array_flip(array('col', 'caption', 'colgroup', 'thead', - 'tfoot', 'tbody', 'tr')); - } - $ret .= $this->element('th', 'Allowed children', $attr); - - if ($def->type == 'chameleon') { - - $ret .= $this->element('td', - 'Block: ' . - $this->escape($this->listifyTagLookup($def->block->elements)),0,0); - $ret .= $this->end('tr'); - $ret .= $this->start('tr'); - $ret .= $this->element('td', - 'Inline: ' . - $this->escape($this->listifyTagLookup($def->inline->elements)),0,0); - - } elseif ($def->type == 'custom') { - - $ret .= $this->element('td', ''.ucfirst($def->type).': ' . - $def->dtd_regex); - - } else { - $ret .= $this->element('td', - ''.ucfirst($def->type).': ' . - $this->escape($this->listifyTagLookup($elements)),0,0); - } - $ret .= $this->end('tr'); - return $ret; - } - - /** - * Listifies a tag lookup table. - * @param $array Tag lookup array in form of array('tagname' => true) - */ - protected function listifyTagLookup($array) { - ksort($array); - $list = array(); - foreach ($array as $name => $discard) { - if ($name !== '#PCDATA' && !isset($this->def->info[$name])) continue; - $list[] = $name; - } - return $this->listify($list); - } - - /** - * Listifies a list of objects by retrieving class names and internal state - * @param $array List of objects - * @todo Also add information about internal state - */ - protected function listifyObjectList($array) { - ksort($array); - $list = array(); - foreach ($array as $discard => $obj) { - $list[] = $this->getClass($obj, 'AttrTransform_'); - } - return $this->listify($list); - } - - /** - * Listifies a hash of attributes to AttrDef classes - * @param $array Array hash in form of array('attrname' => HTMLPurifier_AttrDef) - */ - protected function listifyAttr($array) { - ksort($array); - $list = array(); - foreach ($array as $name => $obj) { - if ($obj === false) continue; - $list[] = "$name = " . $this->getClass($obj, 'AttrDef_') . ''; - } - return $this->listify($list); - } - - /** - * Creates a heavy header row - */ - protected function heavyHeader($text, $num = 1) { - $ret = ''; - $ret .= $this->start('tr'); - $ret .= $this->element('th', $text, array('colspan' => $num, 'class' => 'heavy')); - $ret .= $this->end('tr'); - return $ret; - } - -} - -// vim: et sw=4 sts=4 diff --git a/main/inc/lib/htmlpurifier/library/HTMLPurifier/Printer/index.html b/main/inc/lib/htmlpurifier/library/HTMLPurifier/Printer/index.html deleted file mode 100755 index aa7b9c934b..0000000000 --- a/main/inc/lib/htmlpurifier/library/HTMLPurifier/Printer/index.html +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/main/inc/lib/htmlpurifier/library/HTMLPurifier/PropertyList.php b/main/inc/lib/htmlpurifier/library/HTMLPurifier/PropertyList.php deleted file mode 100755 index 2b99fb7bc3..0000000000 --- a/main/inc/lib/htmlpurifier/library/HTMLPurifier/PropertyList.php +++ /dev/null @@ -1,86 +0,0 @@ -parent = $parent; - } - - /** - * Recursively retrieves the value for a key - */ - public function get($name) { - if ($this->has($name)) return $this->data[$name]; - // possible performance bottleneck, convert to iterative if necessary - if ($this->parent) return $this->parent->get($name); - throw new HTMLPurifier_Exception("Key '$name' not found"); - } - - /** - * Sets the value of a key, for this plist - */ - public function set($name, $value) { - $this->data[$name] = $value; - } - - /** - * Returns true if a given key exists - */ - public function has($name) { - return array_key_exists($name, $this->data); - } - - /** - * Resets a value to the value of it's parent, usually the default. If - * no value is specified, the entire plist is reset. - */ - public function reset($name = null) { - if ($name == null) $this->data = array(); - else unset($this->data[$name]); - } - - /** - * Squashes this property list and all of its property lists into a single - * array, and returns the array. This value is cached by default. - * @param $force If true, ignores the cache and regenerates the array. - */ - public function squash($force = false) { - if ($this->cache !== null && !$force) return $this->cache; - if ($this->parent) { - return $this->cache = array_merge($this->parent->squash($force), $this->data); - } else { - return $this->cache = $this->data; - } - } - - /** - * Returns the parent plist. - */ - public function getParent() { - return $this->parent; - } - - /** - * Sets the parent plist. - */ - public function setParent($plist) { - $this->parent = $plist; - } -} - -// vim: et sw=4 sts=4 diff --git a/main/inc/lib/htmlpurifier/library/HTMLPurifier/PropertyListIterator.php b/main/inc/lib/htmlpurifier/library/HTMLPurifier/PropertyListIterator.php deleted file mode 100755 index 8f250443e4..0000000000 --- a/main/inc/lib/htmlpurifier/library/HTMLPurifier/PropertyListIterator.php +++ /dev/null @@ -1,32 +0,0 @@ -l = strlen($filter); - $this->filter = $filter; - } - - public function accept() { - $key = $this->getInnerIterator()->key(); - if( strncmp($key, $this->filter, $this->l) !== 0 ) { - return false; - } - return true; - } - -} - -// vim: et sw=4 sts=4 diff --git a/main/inc/lib/htmlpurifier/library/HTMLPurifier/Strategy.php b/main/inc/lib/htmlpurifier/library/HTMLPurifier/Strategy.php deleted file mode 100755 index 2462865210..0000000000 --- a/main/inc/lib/htmlpurifier/library/HTMLPurifier/Strategy.php +++ /dev/null @@ -1,26 +0,0 @@ -strategies as $strategy) { - $tokens = $strategy->execute($tokens, $config, $context); - } - return $tokens; - } - -} - -// vim: et sw=4 sts=4 diff --git a/main/inc/lib/htmlpurifier/library/HTMLPurifier/Strategy/Core.php b/main/inc/lib/htmlpurifier/library/HTMLPurifier/Strategy/Core.php deleted file mode 100755 index d90e158606..0000000000 --- a/main/inc/lib/htmlpurifier/library/HTMLPurifier/Strategy/Core.php +++ /dev/null @@ -1,18 +0,0 @@ -strategies[] = new HTMLPurifier_Strategy_RemoveForeignElements(); - $this->strategies[] = new HTMLPurifier_Strategy_MakeWellFormed(); - $this->strategies[] = new HTMLPurifier_Strategy_FixNesting(); - $this->strategies[] = new HTMLPurifier_Strategy_ValidateAttributes(); - } - -} - -// vim: et sw=4 sts=4 diff --git a/main/inc/lib/htmlpurifier/library/HTMLPurifier/Strategy/FixNesting.php b/main/inc/lib/htmlpurifier/library/HTMLPurifier/Strategy/FixNesting.php deleted file mode 100755 index f81802391b..0000000000 --- a/main/inc/lib/htmlpurifier/library/HTMLPurifier/Strategy/FixNesting.php +++ /dev/null @@ -1,328 +0,0 @@ -getHTMLDefinition(); - - // insert implicit "parent" node, will be removed at end. - // DEFINITION CALL - $parent_name = $definition->info_parent; - array_unshift($tokens, new HTMLPurifier_Token_Start($parent_name)); - $tokens[] = new HTMLPurifier_Token_End($parent_name); - - // setup the context variable 'IsInline', for chameleon processing - // is 'false' when we are not inline, 'true' when it must always - // be inline, and an integer when it is inline for a certain - // branch of the document tree - $is_inline = $definition->info_parent_def->descendants_are_inline; - $context->register('IsInline', $is_inline); - - // setup error collector - $e =& $context->get('ErrorCollector', true); - - //####################################################################// - // Loop initialization - - // stack that contains the indexes of all parents, - // $stack[count($stack)-1] being the current parent - $stack = array(); - - // stack that contains all elements that are excluded - // it is organized by parent elements, similar to $stack, - // but it is only populated when an element with exclusions is - // processed, i.e. there won't be empty exclusions. - $exclude_stack = array(); - - // variable that contains the start token while we are processing - // nodes. This enables error reporting to do its job - $start_token = false; - $context->register('CurrentToken', $start_token); - - //####################################################################// - // Loop - - // iterate through all start nodes. Determining the start node - // is complicated so it has been omitted from the loop construct - for ($i = 0, $size = count($tokens) ; $i < $size; ) { - - //################################################################// - // Gather information on children - - // child token accumulator - $child_tokens = array(); - - // scroll to the end of this node, report number, and collect - // all children - for ($j = $i, $depth = 0; ; $j++) { - if ($tokens[$j] instanceof HTMLPurifier_Token_Start) { - $depth++; - // skip token assignment on first iteration, this is the - // token we currently are on - if ($depth == 1) continue; - } elseif ($tokens[$j] instanceof HTMLPurifier_Token_End) { - $depth--; - // skip token assignment on last iteration, this is the - // end token of the token we're currently on - if ($depth == 0) break; - } - $child_tokens[] = $tokens[$j]; - } - - // $i is index of start token - // $j is index of end token - - $start_token = $tokens[$i]; // to make token available via CurrentToken - - //################################################################// - // Gather information on parent - - // calculate parent information - if ($count = count($stack)) { - $parent_index = $stack[$count-1]; - $parent_name = $tokens[$parent_index]->name; - if ($parent_index == 0) { - $parent_def = $definition->info_parent_def; - } else { - $parent_def = $definition->info[$parent_name]; - } - } else { - // processing as if the parent were the "root" node - // unknown info, it won't be used anyway, in the future, - // we may want to enforce one element only (this is - // necessary for HTML Purifier to clean entire documents - $parent_index = $parent_name = $parent_def = null; - } - - // calculate context - if ($is_inline === false) { - // check if conditions make it inline - if (!empty($parent_def) && $parent_def->descendants_are_inline) { - $is_inline = $count - 1; - } - } else { - // check if we're out of inline - if ($count === $is_inline) { - $is_inline = false; - } - } - - //################################################################// - // Determine whether element is explicitly excluded SGML-style - - // determine whether or not element is excluded by checking all - // parent exclusions. The array should not be very large, two - // elements at most. - $excluded = false; - if (!empty($exclude_stack)) { - foreach ($exclude_stack as $lookup) { - if (isset($lookup[$tokens[$i]->name])) { - $excluded = true; - // no need to continue processing - break; - } - } - } - - //################################################################// - // Perform child validation - - if ($excluded) { - // there is an exclusion, remove the entire node - $result = false; - $excludes = array(); // not used, but good to initialize anyway - } else { - // DEFINITION CALL - if ($i === 0) { - // special processing for the first node - $def = $definition->info_parent_def; - } else { - $def = $definition->info[$tokens[$i]->name]; - - } - - if (!empty($def->child)) { - // have DTD child def validate children - $result = $def->child->validateChildren( - $child_tokens, $config, $context); - } else { - // weird, no child definition, get rid of everything - $result = false; - } - - // determine whether or not this element has any exclusions - $excludes = $def->excludes; - } - - // $result is now a bool or array - - //################################################################// - // Process result by interpreting $result - - if ($result === true || $child_tokens === $result) { - // leave the node as is - - // register start token as a parental node start - $stack[] = $i; - - // register exclusions if there are any - if (!empty($excludes)) $exclude_stack[] = $excludes; - - // move cursor to next possible start node - $i++; - - } elseif($result === false) { - // remove entire node - - if ($e) { - if ($excluded) { - $e->send(E_ERROR, 'Strategy_FixNesting: Node excluded'); - } else { - $e->send(E_ERROR, 'Strategy_FixNesting: Node removed'); - } - } - - // calculate length of inner tokens and current tokens - $length = $j - $i + 1; - - // perform removal - array_splice($tokens, $i, $length); - - // update size - $size -= $length; - - // there is no start token to register, - // current node is now the next possible start node - // unless it turns out that we need to do a double-check - - // this is a rought heuristic that covers 100% of HTML's - // cases and 99% of all other cases. A child definition - // that would be tricked by this would be something like: - // ( | a b c) where it's all or nothing. Fortunately, - // our current implementation claims that that case would - // not allow empty, even if it did - if (!$parent_def->child->allow_empty) { - // we need to do a double-check - $i = $parent_index; - array_pop($stack); - } - - // PROJECTED OPTIMIZATION: Process all children elements before - // reprocessing parent node. - - } else { - // replace node with $result - - // calculate length of inner tokens - $length = $j - $i - 1; - - if ($e) { - if (empty($result) && $length) { - $e->send(E_ERROR, 'Strategy_FixNesting: Node contents removed'); - } else { - $e->send(E_WARNING, 'Strategy_FixNesting: Node reorganized'); - } - } - - // perform replacement - array_splice($tokens, $i + 1, $length, $result); - - // update size - $size -= $length; - $size += count($result); - - // register start token as a parental node start - $stack[] = $i; - - // register exclusions if there are any - if (!empty($excludes)) $exclude_stack[] = $excludes; - - // move cursor to next possible start node - $i++; - - } - - //################################################################// - // Scroll to next start node - - // We assume, at this point, that $i is the index of the token - // that is the first possible new start point for a node. - - // Test if the token indeed is a start tag, if not, move forward - // and test again. - $size = count($tokens); - while ($i < $size and !$tokens[$i] instanceof HTMLPurifier_Token_Start) { - if ($tokens[$i] instanceof HTMLPurifier_Token_End) { - // pop a token index off the stack if we ended a node - array_pop($stack); - // pop an exclusion lookup off exclusion stack if - // we ended node and that node had exclusions - if ($i == 0 || $i == $size - 1) { - // use specialized var if it's the super-parent - $s_excludes = $definition->info_parent_def->excludes; - } else { - $s_excludes = $definition->info[$tokens[$i]->name]->excludes; - } - if ($s_excludes) { - array_pop($exclude_stack); - } - } - $i++; - } - - } - - //####################################################################// - // Post-processing - - // remove implicit parent tokens at the beginning and end - array_shift($tokens); - array_pop($tokens); - - // remove context variables - $context->destroy('IsInline'); - $context->destroy('CurrentToken'); - - //####################################################################// - // Return - - return $tokens; - - } - -} - -// vim: et sw=4 sts=4 diff --git a/main/inc/lib/htmlpurifier/library/HTMLPurifier/Strategy/MakeWellFormed.php b/main/inc/lib/htmlpurifier/library/HTMLPurifier/Strategy/MakeWellFormed.php deleted file mode 100755 index 544c797b73..0000000000 --- a/main/inc/lib/htmlpurifier/library/HTMLPurifier/Strategy/MakeWellFormed.php +++ /dev/null @@ -1,475 +0,0 @@ -getHTMLDefinition(); - - // local variables - $generator = new HTMLPurifier_Generator($config, $context); - $escape_invalid_tags = $config->get('Core.EscapeInvalidTags'); - $e = $context->get('ErrorCollector', true); - $t = false; // token index - $i = false; // injector index - $token = false; // the current token - $reprocess = false; // whether or not to reprocess the same token - $stack = array(); - - // member variables - $this->stack =& $stack; - $this->t =& $t; - $this->tokens =& $tokens; - $this->config = $config; - $this->context = $context; - - // context variables - $context->register('CurrentNesting', $stack); - $context->register('InputIndex', $t); - $context->register('InputTokens', $tokens); - $context->register('CurrentToken', $token); - - // -- begin INJECTOR -- - - $this->injectors = array(); - - $injectors = $config->getBatch('AutoFormat'); - $def_injectors = $definition->info_injector; - $custom_injectors = $injectors['Custom']; - unset($injectors['Custom']); // special case - foreach ($injectors as $injector => $b) { - // XXX: Fix with a legitimate lookup table of enabled filters - if (strpos($injector, '.') !== false) continue; - $injector = "HTMLPurifier_Injector_$injector"; - if (!$b) continue; - $this->injectors[] = new $injector; - } - foreach ($def_injectors as $injector) { - // assumed to be objects - $this->injectors[] = $injector; - } - foreach ($custom_injectors as $injector) { - if (!$injector) continue; - if (is_string($injector)) { - $injector = "HTMLPurifier_Injector_$injector"; - $injector = new $injector; - } - $this->injectors[] = $injector; - } - - // give the injectors references to the definition and context - // variables for performance reasons - foreach ($this->injectors as $ix => $injector) { - $error = $injector->prepare($config, $context); - if (!$error) continue; - array_splice($this->injectors, $ix, 1); // rm the injector - trigger_error("Cannot enable {$injector->name} injector because $error is not allowed", E_USER_WARNING); - } - - // -- end INJECTOR -- - - // a note on punting: - // In order to reduce code duplication, whenever some code needs - // to make HTML changes in order to make things "correct", the - // new HTML gets sent through the purifier, regardless of its - // status. This means that if we add a start token, because it - // was totally necessary, we don't have to update nesting; we just - // punt ($reprocess = true; continue;) and it does that for us. - - // isset is in loop because $tokens size changes during loop exec - for ( - $t = 0; - $t == 0 || isset($tokens[$t - 1]); - // only increment if we don't need to reprocess - $reprocess ? $reprocess = false : $t++ - ) { - - // check for a rewind - if (is_int($i) && $i >= 0) { - // possibility: disable rewinding if the current token has a - // rewind set on it already. This would offer protection from - // infinite loop, but might hinder some advanced rewinding. - $rewind_to = $this->injectors[$i]->getRewind(); - if (is_int($rewind_to) && $rewind_to < $t) { - if ($rewind_to < 0) $rewind_to = 0; - while ($t > $rewind_to) { - $t--; - $prev = $tokens[$t]; - // indicate that other injectors should not process this token, - // but we need to reprocess it - unset($prev->skip[$i]); - $prev->rewind = $i; - if ($prev instanceof HTMLPurifier_Token_Start) array_pop($this->stack); - elseif ($prev instanceof HTMLPurifier_Token_End) $this->stack[] = $prev->start; - } - } - $i = false; - } - - // handle case of document end - if (!isset($tokens[$t])) { - // kill processing if stack is empty - if (empty($this->stack)) break; - - // peek - $top_nesting = array_pop($this->stack); - $this->stack[] = $top_nesting; - - // send error - if ($e && !isset($top_nesting->armor['MakeWellFormed_TagClosedError'])) { - $e->send(E_NOTICE, 'Strategy_MakeWellFormed: Tag closed by document end', $top_nesting); - } - - // append, don't splice, since this is the end - $tokens[] = new HTMLPurifier_Token_End($top_nesting->name); - - // punt! - $reprocess = true; - continue; - } - - $token = $tokens[$t]; - - //echo '
      '; printTokens($tokens, $t); printTokens($this->stack); - //flush(); - - // quick-check: if it's not a tag, no need to process - if (empty($token->is_tag)) { - if ($token instanceof HTMLPurifier_Token_Text) { - foreach ($this->injectors as $i => $injector) { - if (isset($token->skip[$i])) continue; - if ($token->rewind !== null && $token->rewind !== $i) continue; - $injector->handleText($token); - $this->processToken($token, $i); - $reprocess = true; - break; - } - } - // another possibility is a comment - continue; - } - - if (isset($definition->info[$token->name])) { - $type = $definition->info[$token->name]->child->type; - } else { - $type = false; // Type is unknown, treat accordingly - } - - // quick tag checks: anything that's *not* an end tag - $ok = false; - if ($type === 'empty' && $token instanceof HTMLPurifier_Token_Start) { - // claims to be a start tag but is empty - $token = new HTMLPurifier_Token_Empty($token->name, $token->attr); - $ok = true; - } elseif ($type && $type !== 'empty' && $token instanceof HTMLPurifier_Token_Empty) { - // claims to be empty but really is a start tag - $this->swap(new HTMLPurifier_Token_End($token->name)); - $this->insertBefore(new HTMLPurifier_Token_Start($token->name, $token->attr)); - // punt (since we had to modify the input stream in a non-trivial way) - $reprocess = true; - continue; - } elseif ($token instanceof HTMLPurifier_Token_Empty) { - // real empty token - $ok = true; - } elseif ($token instanceof HTMLPurifier_Token_Start) { - // start tag - - // ...unless they also have to close their parent - if (!empty($this->stack)) { - - $parent = array_pop($this->stack); - $this->stack[] = $parent; - - if (isset($definition->info[$parent->name])) { - $elements = $definition->info[$parent->name]->child->getAllowedElements($config); - $autoclose = !isset($elements[$token->name]); - } else { - $autoclose = false; - } - - if ($autoclose && $definition->info[$token->name]->wrap) { - // Check if an element can be wrapped by another - // element to make it valid in a context (for - // example,
          needs a
        • in between) - $wrapname = $definition->info[$token->name]->wrap; - $wrapdef = $definition->info[$wrapname]; - $elements = $wrapdef->child->getAllowedElements($config); - $parent_elements = $definition->info[$parent->name]->child->getAllowedElements($config); - if (isset($elements[$token->name]) && isset($parent_elements[$wrapname])) { - $newtoken = new HTMLPurifier_Token_Start($wrapname); - $this->insertBefore($newtoken); - $reprocess = true; - continue; - } - } - - $carryover = false; - if ($autoclose && $definition->info[$parent->name]->formatting) { - $carryover = true; - } - - if ($autoclose) { - // errors need to be updated - $new_token = new HTMLPurifier_Token_End($parent->name); - $new_token->start = $parent; - if ($carryover) { - $element = clone $parent; - $element->armor['MakeWellFormed_TagClosedError'] = true; - $element->carryover = true; - $this->processToken(array($new_token, $token, $element)); - } else { - $this->insertBefore($new_token); - } - if ($e && !isset($parent->armor['MakeWellFormed_TagClosedError'])) { - if (!$carryover) { - $e->send(E_NOTICE, 'Strategy_MakeWellFormed: Tag auto closed', $parent); - } else { - $e->send(E_NOTICE, 'Strategy_MakeWellFormed: Tag carryover', $parent); - } - } - $reprocess = true; - continue; - } - - } - $ok = true; - } - - if ($ok) { - foreach ($this->injectors as $i => $injector) { - if (isset($token->skip[$i])) continue; - if ($token->rewind !== null && $token->rewind !== $i) continue; - $injector->handleElement($token); - $this->processToken($token, $i); - $reprocess = true; - break; - } - if (!$reprocess) { - // ah, nothing interesting happened; do normal processing - $this->swap($token); - if ($token instanceof HTMLPurifier_Token_Start) { - $this->stack[] = $token; - } elseif ($token instanceof HTMLPurifier_Token_End) { - throw new HTMLPurifier_Exception('Improper handling of end tag in start code; possible error in MakeWellFormed'); - } - } - continue; - } - - // sanity check: we should be dealing with a closing tag - if (!$token instanceof HTMLPurifier_Token_End) { - throw new HTMLPurifier_Exception('Unaccounted for tag token in input stream, bug in HTML Purifier'); - } - - // make sure that we have something open - if (empty($this->stack)) { - if ($escape_invalid_tags) { - if ($e) $e->send(E_WARNING, 'Strategy_MakeWellFormed: Unnecessary end tag to text'); - $this->swap(new HTMLPurifier_Token_Text( - $generator->generateFromToken($token) - )); - } else { - $this->remove(); - if ($e) $e->send(E_WARNING, 'Strategy_MakeWellFormed: Unnecessary end tag removed'); - } - $reprocess = true; - continue; - } - - // first, check for the simplest case: everything closes neatly. - // Eventually, everything passes through here; if there are problems - // we modify the input stream accordingly and then punt, so that - // the tokens get processed again. - $current_parent = array_pop($this->stack); - if ($current_parent->name == $token->name) { - $token->start = $current_parent; - foreach ($this->injectors as $i => $injector) { - if (isset($token->skip[$i])) continue; - if ($token->rewind !== null && $token->rewind !== $i) continue; - $injector->handleEnd($token); - $this->processToken($token, $i); - $this->stack[] = $current_parent; - $reprocess = true; - break; - } - continue; - } - - // okay, so we're trying to close the wrong tag - - // undo the pop previous pop - $this->stack[] = $current_parent; - - // scroll back the entire nest, trying to find our tag. - // (feature could be to specify how far you'd like to go) - $size = count($this->stack); - // -2 because -1 is the last element, but we already checked that - $skipped_tags = false; - for ($j = $size - 2; $j >= 0; $j--) { - if ($this->stack[$j]->name == $token->name) { - $skipped_tags = array_slice($this->stack, $j); - break; - } - } - - // we didn't find the tag, so remove - if ($skipped_tags === false) { - if ($escape_invalid_tags) { - $this->swap(new HTMLPurifier_Token_Text( - $generator->generateFromToken($token) - )); - if ($e) $e->send(E_WARNING, 'Strategy_MakeWellFormed: Stray end tag to text'); - } else { - $this->remove(); - if ($e) $e->send(E_WARNING, 'Strategy_MakeWellFormed: Stray end tag removed'); - } - $reprocess = true; - continue; - } - - // do errors, in REVERSE $j order: a,b,c with - $c = count($skipped_tags); - if ($e) { - for ($j = $c - 1; $j > 0; $j--) { - // notice we exclude $j == 0, i.e. the current ending tag, from - // the errors... - if (!isset($skipped_tags[$j]->armor['MakeWellFormed_TagClosedError'])) { - $e->send(E_NOTICE, 'Strategy_MakeWellFormed: Tag closed by element end', $skipped_tags[$j]); - } - } - } - - // insert tags, in FORWARD $j order: c,b,a with - $replace = array($token); - for ($j = 1; $j < $c; $j++) { - // ...as well as from the insertions - $new_token = new HTMLPurifier_Token_End($skipped_tags[$j]->name); - $new_token->start = $skipped_tags[$j]; - array_unshift($replace, $new_token); - if (isset($definition->info[$new_token->name]) && $definition->info[$new_token->name]->formatting) { - $element = clone $skipped_tags[$j]; - $element->carryover = true; - $element->armor['MakeWellFormed_TagClosedError'] = true; - $replace[] = $element; - } - } - $this->processToken($replace); - $reprocess = true; - continue; - } - - $context->destroy('CurrentNesting'); - $context->destroy('InputTokens'); - $context->destroy('InputIndex'); - $context->destroy('CurrentToken'); - - unset($this->injectors, $this->stack, $this->tokens, $this->t); - return $tokens; - } - - /** - * Processes arbitrary token values for complicated substitution patterns. - * In general: - * - * If $token is an array, it is a list of tokens to substitute for the - * current token. These tokens then get individually processed. If there - * is a leading integer in the list, that integer determines how many - * tokens from the stream should be removed. - * - * If $token is a regular token, it is swapped with the current token. - * - * If $token is false, the current token is deleted. - * - * If $token is an integer, that number of tokens (with the first token - * being the current one) will be deleted. - * - * @param $token Token substitution value - * @param $injector Injector that performed the substitution; default is if - * this is not an injector related operation. - */ - protected function processToken($token, $injector = -1) { - - // normalize forms of token - if (is_object($token)) $token = array(1, $token); - if (is_int($token)) $token = array($token); - if ($token === false) $token = array(1); - if (!is_array($token)) throw new HTMLPurifier_Exception('Invalid token type from injector'); - if (!is_int($token[0])) array_unshift($token, 1); - if ($token[0] === 0) throw new HTMLPurifier_Exception('Deleting zero tokens is not valid'); - - // $token is now an array with the following form: - // array(number nodes to delete, new node 1, new node 2, ...) - - $delete = array_shift($token); - $old = array_splice($this->tokens, $this->t, $delete, $token); - - if ($injector > -1) { - // determine appropriate skips - $oldskip = isset($old[0]) ? $old[0]->skip : array(); - foreach ($token as $object) { - $object->skip = $oldskip; - $object->skip[$injector] = true; - } - } - - } - - /** - * Inserts a token before the current token. Cursor now points to this token - */ - private function insertBefore($token) { - array_splice($this->tokens, $this->t, 0, array($token)); - } - - /** - * Removes current token. Cursor now points to new token occupying previously - * occupied space. - */ - private function remove() { - array_splice($this->tokens, $this->t, 1); - } - - /** - * Swap current token with new token. Cursor points to new token (no change). - */ - private function swap($token) { - $this->tokens[$this->t] = $token; - } - -} - -// vim: et sw=4 sts=4 diff --git a/main/inc/lib/htmlpurifier/library/HTMLPurifier/Strategy/RemoveForeignElements.php b/main/inc/lib/htmlpurifier/library/HTMLPurifier/Strategy/RemoveForeignElements.php deleted file mode 100755 index cf3a33e406..0000000000 --- a/main/inc/lib/htmlpurifier/library/HTMLPurifier/Strategy/RemoveForeignElements.php +++ /dev/null @@ -1,171 +0,0 @@ -getHTMLDefinition(); - $generator = new HTMLPurifier_Generator($config, $context); - $result = array(); - - $escape_invalid_tags = $config->get('Core.EscapeInvalidTags'); - $remove_invalid_img = $config->get('Core.RemoveInvalidImg'); - - // currently only used to determine if comments should be kept - $trusted = $config->get('HTML.Trusted'); - - $remove_script_contents = $config->get('Core.RemoveScriptContents'); - $hidden_elements = $config->get('Core.HiddenElements'); - - // remove script contents compatibility - if ($remove_script_contents === true) { - $hidden_elements['script'] = true; - } elseif ($remove_script_contents === false && isset($hidden_elements['script'])) { - unset($hidden_elements['script']); - } - - $attr_validator = new HTMLPurifier_AttrValidator(); - - // removes tokens until it reaches a closing tag with its value - $remove_until = false; - - // converts comments into text tokens when this is equal to a tag name - $textify_comments = false; - - $token = false; - $context->register('CurrentToken', $token); - - $e = false; - if ($config->get('Core.CollectErrors')) { - $e =& $context->get('ErrorCollector'); - } - - foreach($tokens as $token) { - if ($remove_until) { - if (empty($token->is_tag) || $token->name !== $remove_until) { - continue; - } - } - if (!empty( $token->is_tag )) { - // DEFINITION CALL - - // before any processing, try to transform the element - if ( - isset($definition->info_tag_transform[$token->name]) - ) { - $original_name = $token->name; - // there is a transformation for this tag - // DEFINITION CALL - $token = $definition-> - info_tag_transform[$token->name]-> - transform($token, $config, $context); - if ($e) $e->send(E_NOTICE, 'Strategy_RemoveForeignElements: Tag transform', $original_name); - } - - if (isset($definition->info[$token->name])) { - - // mostly everything's good, but - // we need to make sure required attributes are in order - if ( - ($token instanceof HTMLPurifier_Token_Start || $token instanceof HTMLPurifier_Token_Empty) && - $definition->info[$token->name]->required_attr && - ($token->name != 'img' || $remove_invalid_img) // ensure config option still works - ) { - $attr_validator->validateToken($token, $config, $context); - $ok = true; - foreach ($definition->info[$token->name]->required_attr as $name) { - if (!isset($token->attr[$name])) { - $ok = false; - break; - } - } - if (!$ok) { - if ($e) $e->send(E_ERROR, 'Strategy_RemoveForeignElements: Missing required attribute', $name); - continue; - } - $token->armor['ValidateAttributes'] = true; - } - - if (isset($hidden_elements[$token->name]) && $token instanceof HTMLPurifier_Token_Start) { - $textify_comments = $token->name; - } elseif ($token->name === $textify_comments && $token instanceof HTMLPurifier_Token_End) { - $textify_comments = false; - } - - } elseif ($escape_invalid_tags) { - // invalid tag, generate HTML representation and insert in - if ($e) $e->send(E_WARNING, 'Strategy_RemoveForeignElements: Foreign element to text'); - $token = new HTMLPurifier_Token_Text( - $generator->generateFromToken($token) - ); - } else { - // check if we need to destroy all of the tag's children - // CAN BE GENERICIZED - if (isset($hidden_elements[$token->name])) { - if ($token instanceof HTMLPurifier_Token_Start) { - $remove_until = $token->name; - } elseif ($token instanceof HTMLPurifier_Token_Empty) { - // do nothing: we're still looking - } else { - $remove_until = false; - } - if ($e) $e->send(E_ERROR, 'Strategy_RemoveForeignElements: Foreign meta element removed'); - } else { - if ($e) $e->send(E_ERROR, 'Strategy_RemoveForeignElements: Foreign element removed'); - } - continue; - } - } elseif ($token instanceof HTMLPurifier_Token_Comment) { - // textify comments in script tags when they are allowed - if ($textify_comments !== false) { - $data = $token->data; - $token = new HTMLPurifier_Token_Text($data); - } elseif ($trusted) { - // keep, but perform comment cleaning - if ($e) { - // perform check whether or not there's a trailing hyphen - if (substr($token->data, -1) == '-') { - $e->send(E_NOTICE, 'Strategy_RemoveForeignElements: Trailing hyphen in comment removed'); - } - } - $token->data = rtrim($token->data, '-'); - $found_double_hyphen = false; - while (strpos($token->data, '--') !== false) { - if ($e && !$found_double_hyphen) { - $e->send(E_NOTICE, 'Strategy_RemoveForeignElements: Hyphens in comment collapsed'); - } - $found_double_hyphen = true; // prevent double-erroring - $token->data = str_replace('--', '-', $token->data); - } - } else { - // strip comments - if ($e) $e->send(E_NOTICE, 'Strategy_RemoveForeignElements: Comment removed'); - continue; - } - } elseif ($token instanceof HTMLPurifier_Token_Text) { - } else { - continue; - } - $result[] = $token; - } - if ($remove_until && $e) { - // we removed tokens until the end, throw error - $e->send(E_ERROR, 'Strategy_RemoveForeignElements: Token removed to end', $remove_until); - } - - $context->destroy('CurrentToken'); - - return $result; - } - -} - -// vim: et sw=4 sts=4 diff --git a/main/inc/lib/htmlpurifier/library/HTMLPurifier/Strategy/ValidateAttributes.php b/main/inc/lib/htmlpurifier/library/HTMLPurifier/Strategy/ValidateAttributes.php deleted file mode 100755 index c3328a9d44..0000000000 --- a/main/inc/lib/htmlpurifier/library/HTMLPurifier/Strategy/ValidateAttributes.php +++ /dev/null @@ -1,39 +0,0 @@ -register('CurrentToken', $token); - - foreach ($tokens as $key => $token) { - - // only process tokens that have attributes, - // namely start and empty tags - if (!$token instanceof HTMLPurifier_Token_Start && !$token instanceof HTMLPurifier_Token_Empty) continue; - - // skip tokens that are armored - if (!empty($token->armor['ValidateAttributes'])) continue; - - // note that we have no facilities here for removing tokens - $validator->validateToken($token, $config, $context); - - $tokens[$key] = $token; // for PHP 4 - } - $context->destroy('CurrentToken'); - - return $tokens; - } - -} - -// vim: et sw=4 sts=4 diff --git a/main/inc/lib/htmlpurifier/library/HTMLPurifier/Strategy/index.html b/main/inc/lib/htmlpurifier/library/HTMLPurifier/Strategy/index.html deleted file mode 100755 index aa7b9c934b..0000000000 --- a/main/inc/lib/htmlpurifier/library/HTMLPurifier/Strategy/index.html +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/main/inc/lib/htmlpurifier/library/HTMLPurifier/StringHash.php b/main/inc/lib/htmlpurifier/library/HTMLPurifier/StringHash.php deleted file mode 100755 index 62085c5c2f..0000000000 --- a/main/inc/lib/htmlpurifier/library/HTMLPurifier/StringHash.php +++ /dev/null @@ -1,39 +0,0 @@ -accessed[$index] = true; - return parent::offsetGet($index); - } - - /** - * Returns a lookup array of all array indexes that have been accessed. - * @return Array in form array($index => true). - */ - public function getAccessed() { - return $this->accessed; - } - - /** - * Resets the access array. - */ - public function resetAccessed() { - $this->accessed = array(); - } -} - -// vim: et sw=4 sts=4 diff --git a/main/inc/lib/htmlpurifier/library/HTMLPurifier/StringHashParser.php b/main/inc/lib/htmlpurifier/library/HTMLPurifier/StringHashParser.php deleted file mode 100755 index f3e70c712f..0000000000 --- a/main/inc/lib/htmlpurifier/library/HTMLPurifier/StringHashParser.php +++ /dev/null @@ -1,110 +0,0 @@ - 'DefaultKeyValue', - * 'KEY' => 'Value', - * 'KEY2' => 'Value2', - * 'MULTILINE-KEY' => "Multiline\nvalue.\n", - * ) - * - * We use this as an easy to use file-format for configuration schema - * files, but the class itself is usage agnostic. - * - * You can use ---- to forcibly terminate parsing of a single string-hash; - * this marker is used in multi string-hashes to delimit boundaries. - */ -class HTMLPurifier_StringHashParser -{ - - public $default = 'ID'; - - /** - * Parses a file that contains a single string-hash. - */ - public function parseFile($file) { - if (!file_exists($file)) return false; - $fh = fopen($file, 'r'); - if (!$fh) return false; - $ret = $this->parseHandle($fh); - fclose($fh); - return $ret; - } - - /** - * Parses a file that contains multiple string-hashes delimited by '----' - */ - public function parseMultiFile($file) { - if (!file_exists($file)) return false; - $ret = array(); - $fh = fopen($file, 'r'); - if (!$fh) return false; - while (!feof($fh)) { - $ret[] = $this->parseHandle($fh); - } - fclose($fh); - return $ret; - } - - /** - * Internal parser that acepts a file handle. - * @note While it's possible to simulate in-memory parsing by using - * custom stream wrappers, if such a use-case arises we should - * factor out the file handle into its own class. - * @param $fh File handle with pointer at start of valid string-hash - * block. - */ - protected function parseHandle($fh) { - $state = false; - $single = false; - $ret = array(); - do { - $line = fgets($fh); - if ($line === false) break; - $line = rtrim($line, "\n\r"); - if (!$state && $line === '') continue; - if ($line === '----') break; - if (strncmp('--#', $line, 3) === 0) { - // Comment - continue; - } elseif (strncmp('--', $line, 2) === 0) { - // Multiline declaration - $state = trim($line, '- '); - if (!isset($ret[$state])) $ret[$state] = ''; - continue; - } elseif (!$state) { - $single = true; - if (strpos($line, ':') !== false) { - // Single-line declaration - list($state, $line) = explode(':', $line, 2); - $line = trim($line); - } else { - // Use default declaration - $state = $this->default; - } - } - if ($single) { - $ret[$state] = $line; - $single = false; - $state = false; - } else { - $ret[$state] .= "$line\n"; - } - } while (!feof($fh)); - return $ret; - } - -} - -// vim: et sw=4 sts=4 diff --git a/main/inc/lib/htmlpurifier/library/HTMLPurifier/TagTransform.php b/main/inc/lib/htmlpurifier/library/HTMLPurifier/TagTransform.php deleted file mode 100755 index 210a447217..0000000000 --- a/main/inc/lib/htmlpurifier/library/HTMLPurifier/TagTransform.php +++ /dev/null @@ -1,36 +0,0 @@ - 'xx-small', - '1' => 'xx-small', - '2' => 'small', - '3' => 'medium', - '4' => 'large', - '5' => 'x-large', - '6' => 'xx-large', - '7' => '300%', - '-1' => 'smaller', - '-2' => '60%', - '+1' => 'larger', - '+2' => '150%', - '+3' => '200%', - '+4' => '300%' - ); - - public function transform($tag, $config, $context) { - - if ($tag instanceof HTMLPurifier_Token_End) { - $new_tag = clone $tag; - $new_tag->name = $this->transform_to; - return $new_tag; - } - - $attr = $tag->attr; - $prepend_style = ''; - - // handle color transform - if (isset($attr['color'])) { - $prepend_style .= 'color:' . $attr['color'] . ';'; - unset($attr['color']); - } - - // handle face transform - if (isset($attr['face'])) { - $prepend_style .= 'font-family:' . $attr['face'] . ';'; - unset($attr['face']); - } - - // handle size transform - if (isset($attr['size'])) { - // normalize large numbers - if ($attr['size']{0} == '+' || $attr['size']{0} == '-') { - $size = (int) $attr['size']; - if ($size < -2) $attr['size'] = '-2'; - if ($size > 4) $attr['size'] = '+4'; - } else { - $size = (int) $attr['size']; - if ($size > 7) $attr['size'] = '7'; - } - if (isset($this->_size_lookup[$attr['size']])) { - $prepend_style .= 'font-size:' . - $this->_size_lookup[$attr['size']] . ';'; - } - unset($attr['size']); - } - - if ($prepend_style) { - $attr['style'] = isset($attr['style']) ? - $prepend_style . $attr['style'] : - $prepend_style; - } - - $new_tag = clone $tag; - $new_tag->name = $this->transform_to; - $new_tag->attr = $attr; - - return $new_tag; - - } -} - -// vim: et sw=4 sts=4 diff --git a/main/inc/lib/htmlpurifier/library/HTMLPurifier/TagTransform/Simple.php b/main/inc/lib/htmlpurifier/library/HTMLPurifier/TagTransform/Simple.php deleted file mode 100755 index 0e36130f25..0000000000 --- a/main/inc/lib/htmlpurifier/library/HTMLPurifier/TagTransform/Simple.php +++ /dev/null @@ -1,35 +0,0 @@ -transform_to = $transform_to; - $this->style = $style; - } - - public function transform($tag, $config, $context) { - $new_tag = clone $tag; - $new_tag->name = $this->transform_to; - if (!is_null($this->style) && - ($new_tag instanceof HTMLPurifier_Token_Start || $new_tag instanceof HTMLPurifier_Token_Empty) - ) { - $this->prependCSS($new_tag->attr, $this->style); - } - return $new_tag; - } - -} - -// vim: et sw=4 sts=4 diff --git a/main/inc/lib/htmlpurifier/library/HTMLPurifier/TagTransform/index.html b/main/inc/lib/htmlpurifier/library/HTMLPurifier/TagTransform/index.html deleted file mode 100755 index aa7b9c934b..0000000000 --- a/main/inc/lib/htmlpurifier/library/HTMLPurifier/TagTransform/index.html +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/main/inc/lib/htmlpurifier/library/HTMLPurifier/Token.php b/main/inc/lib/htmlpurifier/library/HTMLPurifier/Token.php deleted file mode 100755 index 7900e6cb10..0000000000 --- a/main/inc/lib/htmlpurifier/library/HTMLPurifier/Token.php +++ /dev/null @@ -1,57 +0,0 @@ -line = $l; - $this->col = $c; - } - - /** - * Convenience function for DirectLex settings line/col position. - */ - public function rawPosition($l, $c) { - if ($c === -1) $l++; - $this->line = $l; - $this->col = $c; - } - -} - -// vim: et sw=4 sts=4 diff --git a/main/inc/lib/htmlpurifier/library/HTMLPurifier/Token/Comment.php b/main/inc/lib/htmlpurifier/library/HTMLPurifier/Token/Comment.php deleted file mode 100755 index dc6bdcabb8..0000000000 --- a/main/inc/lib/htmlpurifier/library/HTMLPurifier/Token/Comment.php +++ /dev/null @@ -1,22 +0,0 @@ -data = $data; - $this->line = $line; - $this->col = $col; - } -} - -// vim: et sw=4 sts=4 diff --git a/main/inc/lib/htmlpurifier/library/HTMLPurifier/Token/Empty.php b/main/inc/lib/htmlpurifier/library/HTMLPurifier/Token/Empty.php deleted file mode 100755 index 2a82b47ad1..0000000000 --- a/main/inc/lib/htmlpurifier/library/HTMLPurifier/Token/Empty.php +++ /dev/null @@ -1,11 +0,0 @@ -!empty($obj->is_tag) - * without having to use a function call is_a(). - */ - public $is_tag = true; - - /** - * The lower-case name of the tag, like 'a', 'b' or 'blockquote'. - * - * @note Strictly speaking, XML tags are case sensitive, so we shouldn't - * be lower-casing them, but these tokens cater to HTML tags, which are - * insensitive. - */ - public $name; - - /** - * Associative array of the tag's attributes. - */ - public $attr = array(); - - /** - * Non-overloaded constructor, which lower-cases passed tag name. - * - * @param $name String name. - * @param $attr Associative array of attributes. - */ - public function __construct($name, $attr = array(), $line = null, $col = null) { - $this->name = ctype_lower($name) ? $name : strtolower($name); - foreach ($attr as $key => $value) { - // normalization only necessary when key is not lowercase - if (!ctype_lower($key)) { - $new_key = strtolower($key); - if (!isset($attr[$new_key])) { - $attr[$new_key] = $attr[$key]; - } - if ($new_key !== $key) { - unset($attr[$key]); - } - } - } - $this->attr = $attr; - $this->line = $line; - $this->col = $col; - } -} - -// vim: et sw=4 sts=4 diff --git a/main/inc/lib/htmlpurifier/library/HTMLPurifier/Token/Text.php b/main/inc/lib/htmlpurifier/library/HTMLPurifier/Token/Text.php deleted file mode 100755 index 82efd823d6..0000000000 --- a/main/inc/lib/htmlpurifier/library/HTMLPurifier/Token/Text.php +++ /dev/null @@ -1,33 +0,0 @@ -data = $data; - $this->is_whitespace = ctype_space($data); - $this->line = $line; - $this->col = $col; - } - -} - -// vim: et sw=4 sts=4 diff --git a/main/inc/lib/htmlpurifier/library/HTMLPurifier/Token/index.html b/main/inc/lib/htmlpurifier/library/HTMLPurifier/Token/index.html deleted file mode 100755 index aa7b9c934b..0000000000 --- a/main/inc/lib/htmlpurifier/library/HTMLPurifier/Token/index.html +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/main/inc/lib/htmlpurifier/library/HTMLPurifier/TokenFactory.php b/main/inc/lib/htmlpurifier/library/HTMLPurifier/TokenFactory.php deleted file mode 100755 index 7cf48fb41c..0000000000 --- a/main/inc/lib/htmlpurifier/library/HTMLPurifier/TokenFactory.php +++ /dev/null @@ -1,94 +0,0 @@ -p_start = new HTMLPurifier_Token_Start('', array()); - $this->p_end = new HTMLPurifier_Token_End(''); - $this->p_empty = new HTMLPurifier_Token_Empty('', array()); - $this->p_text = new HTMLPurifier_Token_Text(''); - $this->p_comment= new HTMLPurifier_Token_Comment(''); - } - - /** - * Creates a HTMLPurifier_Token_Start. - * @param $name Tag name - * @param $attr Associative array of attributes - * @return Generated HTMLPurifier_Token_Start - */ - public function createStart($name, $attr = array()) { - $p = clone $this->p_start; - $p->__construct($name, $attr); - return $p; - } - - /** - * Creates a HTMLPurifier_Token_End. - * @param $name Tag name - * @return Generated HTMLPurifier_Token_End - */ - public function createEnd($name) { - $p = clone $this->p_end; - $p->__construct($name); - return $p; - } - - /** - * Creates a HTMLPurifier_Token_Empty. - * @param $name Tag name - * @param $attr Associative array of attributes - * @return Generated HTMLPurifier_Token_Empty - */ - public function createEmpty($name, $attr = array()) { - $p = clone $this->p_empty; - $p->__construct($name, $attr); - return $p; - } - - /** - * Creates a HTMLPurifier_Token_Text. - * @param $data Data of text token - * @return Generated HTMLPurifier_Token_Text - */ - public function createText($data) { - $p = clone $this->p_text; - $p->__construct($data); - return $p; - } - - /** - * Creates a HTMLPurifier_Token_Comment. - * @param $data Data of comment token - * @return Generated HTMLPurifier_Token_Comment - */ - public function createComment($data) { - $p = clone $this->p_comment; - $p->__construct($data); - return $p; - } - -} - -// vim: et sw=4 sts=4 diff --git a/main/inc/lib/htmlpurifier/library/HTMLPurifier/URI.php b/main/inc/lib/htmlpurifier/library/HTMLPurifier/URI.php deleted file mode 100755 index 8b50d0d18d..0000000000 --- a/main/inc/lib/htmlpurifier/library/HTMLPurifier/URI.php +++ /dev/null @@ -1,173 +0,0 @@ -scheme = is_null($scheme) || ctype_lower($scheme) ? $scheme : strtolower($scheme); - $this->userinfo = $userinfo; - $this->host = $host; - $this->port = is_null($port) ? $port : (int) $port; - $this->path = $path; - $this->query = $query; - $this->fragment = $fragment; - } - - /** - * Retrieves a scheme object corresponding to the URI's scheme/default - * @param $config Instance of HTMLPurifier_Config - * @param $context Instance of HTMLPurifier_Context - * @return Scheme object appropriate for validating this URI - */ - public function getSchemeObj($config, $context) { - $registry = HTMLPurifier_URISchemeRegistry::instance(); - if ($this->scheme !== null) { - $scheme_obj = $registry->getScheme($this->scheme, $config, $context); - if (!$scheme_obj) return false; // invalid scheme, clean it out - } else { - // no scheme: retrieve the default one - $def = $config->getDefinition('URI'); - $scheme_obj = $registry->getScheme($def->defaultScheme, $config, $context); - if (!$scheme_obj) { - // something funky happened to the default scheme object - trigger_error( - 'Default scheme object "' . $def->defaultScheme . '" was not readable', - E_USER_WARNING - ); - return false; - } - } - return $scheme_obj; - } - - /** - * Generic validation method applicable for all schemes. May modify - * this URI in order to get it into a compliant form. - * @param $config Instance of HTMLPurifier_Config - * @param $context Instance of HTMLPurifier_Context - * @return True if validation/filtering succeeds, false if failure - */ - public function validate($config, $context) { - - // ABNF definitions from RFC 3986 - $chars_sub_delims = '!$&\'()*+,;='; - $chars_gen_delims = ':/?#[]@'; - $chars_pchar = $chars_sub_delims . ':@'; - - // validate scheme (MUST BE FIRST!) - if (!is_null($this->scheme) && is_null($this->host)) { - $def = $config->getDefinition('URI'); - if ($def->defaultScheme === $this->scheme) { - $this->scheme = null; - } - } - - // validate host - if (!is_null($this->host)) { - $host_def = new HTMLPurifier_AttrDef_URI_Host(); - $this->host = $host_def->validate($this->host, $config, $context); - if ($this->host === false) $this->host = null; - } - - // validate username - if (!is_null($this->userinfo)) { - $encoder = new HTMLPurifier_PercentEncoder($chars_sub_delims . ':'); - $this->userinfo = $encoder->encode($this->userinfo); - } - - // validate port - if (!is_null($this->port)) { - if ($this->port < 1 || $this->port > 65535) $this->port = null; - } - - // validate path - $path_parts = array(); - $segments_encoder = new HTMLPurifier_PercentEncoder($chars_pchar . '/'); - if (!is_null($this->host)) { - // path-abempty (hier and relative) - $this->path = $segments_encoder->encode($this->path); - } elseif ($this->path !== '' && $this->path[0] === '/') { - // path-absolute (hier and relative) - if (strlen($this->path) >= 2 && $this->path[1] === '/') { - // This shouldn't ever happen! - $this->path = ''; - } else { - $this->path = $segments_encoder->encode($this->path); - } - } elseif (!is_null($this->scheme) && $this->path !== '') { - // path-rootless (hier) - // Short circuit evaluation means we don't need to check nz - $this->path = $segments_encoder->encode($this->path); - } elseif (is_null($this->scheme) && $this->path !== '') { - // path-noscheme (relative) - // (once again, not checking nz) - $segment_nc_encoder = new HTMLPurifier_PercentEncoder($chars_sub_delims . '@'); - $c = strpos($this->path, '/'); - if ($c !== false) { - $this->path = - $segment_nc_encoder->encode(substr($this->path, 0, $c)) . - $segments_encoder->encode(substr($this->path, $c)); - } else { - $this->path = $segment_nc_encoder->encode($this->path); - } - } else { - // path-empty (hier and relative) - $this->path = ''; // just to be safe - } - - // qf = query and fragment - $qf_encoder = new HTMLPurifier_PercentEncoder($chars_pchar . '/?'); - - if (!is_null($this->query)) { - $this->query = $qf_encoder->encode($this->query); - } - - if (!is_null($this->fragment)) { - $this->fragment = $qf_encoder->encode($this->fragment); - } - - return true; - - } - - /** - * Convert URI back to string - * @return String URI appropriate for output - */ - public function toString() { - // reconstruct authority - $authority = null; - if (!is_null($this->host)) { - $authority = ''; - if(!is_null($this->userinfo)) $authority .= $this->userinfo . '@'; - $authority .= $this->host; - if(!is_null($this->port)) $authority .= ':' . $this->port; - } - - // reconstruct the result - $result = ''; - if (!is_null($this->scheme)) $result .= $this->scheme . ':'; - if (!is_null($authority)) $result .= '//' . $authority; - $result .= $this->path; - if (!is_null($this->query)) $result .= '?' . $this->query; - if (!is_null($this->fragment)) $result .= '#' . $this->fragment; - - return $result; - } - -} - -// vim: et sw=4 sts=4 diff --git a/main/inc/lib/htmlpurifier/library/HTMLPurifier/URIDefinition.php b/main/inc/lib/htmlpurifier/library/HTMLPurifier/URIDefinition.php deleted file mode 100755 index ea2b8fe245..0000000000 --- a/main/inc/lib/htmlpurifier/library/HTMLPurifier/URIDefinition.php +++ /dev/null @@ -1,93 +0,0 @@ -registerFilter(new HTMLPurifier_URIFilter_DisableExternal()); - $this->registerFilter(new HTMLPurifier_URIFilter_DisableExternalResources()); - $this->registerFilter(new HTMLPurifier_URIFilter_HostBlacklist()); - $this->registerFilter(new HTMLPurifier_URIFilter_MakeAbsolute()); - $this->registerFilter(new HTMLPurifier_URIFilter_Munge()); - } - - public function registerFilter($filter) { - $this->registeredFilters[$filter->name] = $filter; - } - - public function addFilter($filter, $config) { - $r = $filter->prepare($config); - if ($r === false) return; // null is ok, for backwards compat - if ($filter->post) { - $this->postFilters[$filter->name] = $filter; - } else { - $this->filters[$filter->name] = $filter; - } - } - - protected function doSetup($config) { - $this->setupMemberVariables($config); - $this->setupFilters($config); - } - - protected function setupFilters($config) { - foreach ($this->registeredFilters as $name => $filter) { - $conf = $config->get('URI.' . $name); - if ($conf !== false && $conf !== null) { - $this->addFilter($filter, $config); - } - } - unset($this->registeredFilters); - } - - protected function setupMemberVariables($config) { - $this->host = $config->get('URI.Host'); - $base_uri = $config->get('URI.Base'); - if (!is_null($base_uri)) { - $parser = new HTMLPurifier_URIParser(); - $this->base = $parser->parse($base_uri); - $this->defaultScheme = $this->base->scheme; - if (is_null($this->host)) $this->host = $this->base->host; - } - if (is_null($this->defaultScheme)) $this->defaultScheme = $config->get('URI.DefaultScheme'); - } - - public function filter(&$uri, $config, $context) { - foreach ($this->filters as $name => $f) { - $result = $f->filter($uri, $config, $context); - if (!$result) return false; - } - return true; - } - - public function postFilter(&$uri, $config, $context) { - foreach ($this->postFilters as $name => $f) { - $result = $f->filter($uri, $config, $context); - if (!$result) return false; - } - return true; - } - -} - -// vim: et sw=4 sts=4 diff --git a/main/inc/lib/htmlpurifier/library/HTMLPurifier/URIFilter.php b/main/inc/lib/htmlpurifier/library/HTMLPurifier/URIFilter.php deleted file mode 100755 index c116f93dff..0000000000 --- a/main/inc/lib/htmlpurifier/library/HTMLPurifier/URIFilter.php +++ /dev/null @@ -1,45 +0,0 @@ -getDefinition('URI')->host; - if ($our_host !== null) $this->ourHostParts = array_reverse(explode('.', $our_host)); - } - public function filter(&$uri, $config, $context) { - if (is_null($uri->host)) return true; - if ($this->ourHostParts === false) return false; - $host_parts = array_reverse(explode('.', $uri->host)); - foreach ($this->ourHostParts as $i => $x) { - if (!isset($host_parts[$i])) return false; - if ($host_parts[$i] != $this->ourHostParts[$i]) return false; - } - return true; - } -} - -// vim: et sw=4 sts=4 diff --git a/main/inc/lib/htmlpurifier/library/HTMLPurifier/URIFilter/DisableExternalResources.php b/main/inc/lib/htmlpurifier/library/HTMLPurifier/URIFilter/DisableExternalResources.php deleted file mode 100755 index 881abc43cf..0000000000 --- a/main/inc/lib/htmlpurifier/library/HTMLPurifier/URIFilter/DisableExternalResources.php +++ /dev/null @@ -1,12 +0,0 @@ -get('EmbeddedURI', true)) return true; - return parent::filter($uri, $config, $context); - } -} - -// vim: et sw=4 sts=4 diff --git a/main/inc/lib/htmlpurifier/library/HTMLPurifier/URIFilter/DisableResources.php b/main/inc/lib/htmlpurifier/library/HTMLPurifier/URIFilter/DisableResources.php deleted file mode 100755 index 5f7c3a04d3..0000000000 --- a/main/inc/lib/htmlpurifier/library/HTMLPurifier/URIFilter/DisableResources.php +++ /dev/null @@ -1,11 +0,0 @@ -get('EmbeddedURI', true); - } -} - -// vim: et sw=4 sts=4 diff --git a/main/inc/lib/htmlpurifier/library/HTMLPurifier/URIFilter/HostBlacklist.php b/main/inc/lib/htmlpurifier/library/HTMLPurifier/URIFilter/HostBlacklist.php deleted file mode 100755 index 045aa0992c..0000000000 --- a/main/inc/lib/htmlpurifier/library/HTMLPurifier/URIFilter/HostBlacklist.php +++ /dev/null @@ -1,21 +0,0 @@ -blacklist = $config->get('URI.HostBlacklist'); - return true; - } - public function filter(&$uri, $config, $context) { - foreach($this->blacklist as $blacklisted_host_fragment) { - if (strpos($uri->host, $blacklisted_host_fragment) !== false) { - return false; - } - } - return true; - } -} - -// vim: et sw=4 sts=4 diff --git a/main/inc/lib/htmlpurifier/library/HTMLPurifier/URIFilter/MakeAbsolute.php b/main/inc/lib/htmlpurifier/library/HTMLPurifier/URIFilter/MakeAbsolute.php deleted file mode 100755 index f46ab2630d..0000000000 --- a/main/inc/lib/htmlpurifier/library/HTMLPurifier/URIFilter/MakeAbsolute.php +++ /dev/null @@ -1,114 +0,0 @@ -getDefinition('URI'); - $this->base = $def->base; - if (is_null($this->base)) { - trigger_error('URI.MakeAbsolute is being ignored due to lack of value for URI.Base configuration', E_USER_WARNING); - return false; - } - $this->base->fragment = null; // fragment is invalid for base URI - $stack = explode('/', $this->base->path); - array_pop($stack); // discard last segment - $stack = $this->_collapseStack($stack); // do pre-parsing - $this->basePathStack = $stack; - return true; - } - public function filter(&$uri, $config, $context) { - if (is_null($this->base)) return true; // abort early - if ( - $uri->path === '' && is_null($uri->scheme) && - is_null($uri->host) && is_null($uri->query) && is_null($uri->fragment) - ) { - // reference to current document - $uri = clone $this->base; - return true; - } - if (!is_null($uri->scheme)) { - // absolute URI already: don't change - if (!is_null($uri->host)) return true; - $scheme_obj = $uri->getSchemeObj($config, $context); - if (!$scheme_obj) { - // scheme not recognized - return false; - } - if (!$scheme_obj->hierarchical) { - // non-hierarchal URI with explicit scheme, don't change - return true; - } - // special case: had a scheme but always is hierarchical and had no authority - } - if (!is_null($uri->host)) { - // network path, don't bother - return true; - } - if ($uri->path === '') { - $uri->path = $this->base->path; - } elseif ($uri->path[0] !== '/') { - // relative path, needs more complicated processing - $stack = explode('/', $uri->path); - $new_stack = array_merge($this->basePathStack, $stack); - if ($new_stack[0] !== '' && !is_null($this->base->host)) { - array_unshift($new_stack, ''); - } - $new_stack = $this->_collapseStack($new_stack); - $uri->path = implode('/', $new_stack); - } else { - // absolute path, but still we should collapse - $uri->path = implode('/', $this->_collapseStack(explode('/', $uri->path))); - } - // re-combine - $uri->scheme = $this->base->scheme; - if (is_null($uri->userinfo)) $uri->userinfo = $this->base->userinfo; - if (is_null($uri->host)) $uri->host = $this->base->host; - if (is_null($uri->port)) $uri->port = $this->base->port; - return true; - } - - /** - * Resolve dots and double-dots in a path stack - */ - private function _collapseStack($stack) { - $result = array(); - $is_folder = false; - for ($i = 0; isset($stack[$i]); $i++) { - $is_folder = false; - // absorb an internally duplicated slash - if ($stack[$i] == '' && $i && isset($stack[$i+1])) continue; - if ($stack[$i] == '..') { - if (!empty($result)) { - $segment = array_pop($result); - if ($segment === '' && empty($result)) { - // error case: attempted to back out too far: - // restore the leading slash - $result[] = ''; - } elseif ($segment === '..') { - $result[] = '..'; // cannot remove .. with .. - } - } else { - // relative path, preserve the double-dots - $result[] = '..'; - } - $is_folder = true; - continue; - } - if ($stack[$i] == '.') { - // silently absorb - $is_folder = true; - continue; - } - $result[] = $stack[$i]; - } - if ($is_folder) $result[] = ''; - return $result; - } -} - -// vim: et sw=4 sts=4 diff --git a/main/inc/lib/htmlpurifier/library/HTMLPurifier/URIFilter/Munge.php b/main/inc/lib/htmlpurifier/library/HTMLPurifier/URIFilter/Munge.php deleted file mode 100755 index efa10a6458..0000000000 --- a/main/inc/lib/htmlpurifier/library/HTMLPurifier/URIFilter/Munge.php +++ /dev/null @@ -1,58 +0,0 @@ -target = $config->get('URI.' . $this->name); - $this->parser = new HTMLPurifier_URIParser(); - $this->doEmbed = $config->get('URI.MungeResources'); - $this->secretKey = $config->get('URI.MungeSecretKey'); - return true; - } - public function filter(&$uri, $config, $context) { - if ($context->get('EmbeddedURI', true) && !$this->doEmbed) return true; - - $scheme_obj = $uri->getSchemeObj($config, $context); - if (!$scheme_obj) return true; // ignore unknown schemes, maybe another postfilter did it - if (is_null($uri->host) || empty($scheme_obj->browsable)) { - return true; - } - // don't redirect if target host is our host - if ($uri->host === $config->getDefinition('URI')->host) { - return true; - } - - $this->makeReplace($uri, $config, $context); - $this->replace = array_map('rawurlencode', $this->replace); - - $new_uri = strtr($this->target, $this->replace); - $new_uri = $this->parser->parse($new_uri); - // don't redirect if the target host is the same as the - // starting host - if ($uri->host === $new_uri->host) return true; - $uri = $new_uri; // overwrite - return true; - } - - protected function makeReplace($uri, $config, $context) { - $string = $uri->toString(); - // always available - $this->replace['%s'] = $string; - $this->replace['%r'] = $context->get('EmbeddedURI', true); - $token = $context->get('CurrentToken', true); - $this->replace['%n'] = $token ? $token->name : null; - $this->replace['%m'] = $context->get('CurrentAttr', true); - $this->replace['%p'] = $context->get('CurrentCSSProperty', true); - // not always available - if ($this->secretKey) $this->replace['%t'] = sha1($this->secretKey . ':' . $string); - } - -} - -// vim: et sw=4 sts=4 diff --git a/main/inc/lib/htmlpurifier/library/HTMLPurifier/URIFilter/index.html b/main/inc/lib/htmlpurifier/library/HTMLPurifier/URIFilter/index.html deleted file mode 100755 index aa7b9c934b..0000000000 --- a/main/inc/lib/htmlpurifier/library/HTMLPurifier/URIFilter/index.html +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/main/inc/lib/htmlpurifier/library/HTMLPurifier/URIParser.php b/main/inc/lib/htmlpurifier/library/HTMLPurifier/URIParser.php deleted file mode 100755 index 7179e4ab89..0000000000 --- a/main/inc/lib/htmlpurifier/library/HTMLPurifier/URIParser.php +++ /dev/null @@ -1,70 +0,0 @@ -percentEncoder = new HTMLPurifier_PercentEncoder(); - } - - /** - * Parses a URI. - * @param $uri string URI to parse - * @return HTMLPurifier_URI representation of URI. This representation has - * not been validated yet and may not conform to RFC. - */ - public function parse($uri) { - - $uri = $this->percentEncoder->normalize($uri); - - // Regexp is as per Appendix B. - // Note that ["<>] are an addition to the RFC's recommended - // characters, because they represent external delimeters. - $r_URI = '!'. - '(([^:/?#"<>]+):)?'. // 2. Scheme - '(//([^/?#"<>]*))?'. // 4. Authority - '([^?#"<>]*)'. // 5. Path - '(\?([^#"<>]*))?'. // 7. Query - '(#([^"<>]*))?'. // 8. Fragment - '!'; - - $matches = array(); - $result = preg_match($r_URI, $uri, $matches); - - if (!$result) return false; // *really* invalid URI - - // seperate out parts - $scheme = !empty($matches[1]) ? $matches[2] : null; - $authority = !empty($matches[3]) ? $matches[4] : null; - $path = $matches[5]; // always present, can be empty - $query = !empty($matches[6]) ? $matches[7] : null; - $fragment = !empty($matches[8]) ? $matches[9] : null; - - // further parse authority - if ($authority !== null) { - $r_authority = "/^((.+?)@)?(\[[^\]]+\]|[^:]*)(:(\d*))?/"; - $matches = array(); - preg_match($r_authority, $authority, $matches); - $userinfo = !empty($matches[1]) ? $matches[2] : null; - $host = !empty($matches[3]) ? $matches[3] : ''; - $port = !empty($matches[4]) ? (int) $matches[5] : null; - } else { - $port = $host = $userinfo = null; - } - - return new HTMLPurifier_URI( - $scheme, $userinfo, $host, $port, $path, $query, $fragment); - } - -} - -// vim: et sw=4 sts=4 diff --git a/main/inc/lib/htmlpurifier/library/HTMLPurifier/URIScheme.php b/main/inc/lib/htmlpurifier/library/HTMLPurifier/URIScheme.php deleted file mode 100755 index 039710fd15..0000000000 --- a/main/inc/lib/htmlpurifier/library/HTMLPurifier/URIScheme.php +++ /dev/null @@ -1,42 +0,0 @@ -, resolves edge cases - * with making relative URIs absolute - */ - public $hierarchical = false; - - /** - * Validates the components of a URI - * @note This implementation should be called by children if they define - * a default port, as it does port processing. - * @param $uri Instance of HTMLPurifier_URI - * @param $config HTMLPurifier_Config object - * @param $context HTMLPurifier_Context object - * @return Bool success or failure - */ - public function validate(&$uri, $config, $context) { - if ($this->default_port == $uri->port) $uri->port = null; - return true; - } - -} - -// vim: et sw=4 sts=4 diff --git a/main/inc/lib/htmlpurifier/library/HTMLPurifier/URIScheme/data.php b/main/inc/lib/htmlpurifier/library/HTMLPurifier/URIScheme/data.php deleted file mode 100755 index b7f1989cbf..0000000000 --- a/main/inc/lib/htmlpurifier/library/HTMLPurifier/URIScheme/data.php +++ /dev/null @@ -1,93 +0,0 @@ - true, - 'image/gif' => true, - 'image/png' => true, - ); - - public function validate(&$uri, $config, $context) { - $result = explode(',', $uri->path, 2); - $is_base64 = false; - $charset = null; - $content_type = null; - if (count($result) == 2) { - list($metadata, $data) = $result; - // do some legwork on the metadata - $metas = explode(';', $metadata); - while(!empty($metas)) { - $cur = array_shift($metas); - if ($cur == 'base64') { - $is_base64 = true; - break; - } - if (substr($cur, 0, 8) == 'charset=') { - // doesn't match if there are arbitrary spaces, but - // whatever dude - if ($charset !== null) continue; // garbage - $charset = substr($cur, 8); // not used - } else { - if ($content_type !== null) continue; // garbage - $content_type = $cur; - } - } - } else { - $data = $result[0]; - } - if ($content_type !== null && empty($this->allowed_types[$content_type])) { - return false; - } - if ($charset !== null) { - // error; we don't allow plaintext stuff - $charset = null; - } - $data = rawurldecode($data); - if ($is_base64) { - $raw_data = base64_decode($data); - } else { - $raw_data = $data; - } - // XXX probably want to refactor this into a general mechanism - // for filtering arbitrary content types - $file = tempnam("/tmp", ""); - file_put_contents($file, $raw_data); - if (function_exists('exif_imagetype')) { - $image_code = exif_imagetype($file); - } elseif (function_exists('getimagesize')) { - set_error_handler(array($this, 'muteErrorHandler')); - $info = getimagesize($file); - restore_error_handler(); - if ($info == false) return false; - $image_code = $info[2]; - } else { - trigger_error("could not find exif_imagetype or getimagesize functions", E_USER_ERROR); - } - $real_content_type = image_type_to_mime_type($image_code); - if ($real_content_type != $content_type) { - // we're nice guys; if the content type is something else we - // support, change it over - if (empty($this->allowed_types[$real_content_type])) return false; - $content_type = $real_content_type; - } - // ok, it's kosher, rewrite what we need - $uri->userinfo = null; - $uri->host = null; - $uri->port = null; - $uri->fragment = null; - $uri->query = null; - $uri->path = "$content_type;base64," . base64_encode($raw_data); - return true; - } - - public function muteErrorHandler($errno, $errstr) {} - -} - diff --git a/main/inc/lib/htmlpurifier/library/HTMLPurifier/URIScheme/file.php b/main/inc/lib/htmlpurifier/library/HTMLPurifier/URIScheme/file.php deleted file mode 100755 index f9fb8e61ab..0000000000 --- a/main/inc/lib/htmlpurifier/library/HTMLPurifier/URIScheme/file.php +++ /dev/null @@ -1,26 +0,0 @@ -userinfo = null; - // file:// makes no provisions for accessing the resource - $uri->port = null; - // While it seems to work on Firefox, the querystring has - // no possible effect and is thus stripped. - $uri->query = null; - return true; - } - -} - -// vim: et sw=4 sts=4 diff --git a/main/inc/lib/htmlpurifier/library/HTMLPurifier/URIScheme/ftp.php b/main/inc/lib/htmlpurifier/library/HTMLPurifier/URIScheme/ftp.php deleted file mode 100755 index 5849bf7ff0..0000000000 --- a/main/inc/lib/htmlpurifier/library/HTMLPurifier/URIScheme/ftp.php +++ /dev/null @@ -1,43 +0,0 @@ -query = null; - - // typecode check - $semicolon_pos = strrpos($uri->path, ';'); // reverse - if ($semicolon_pos !== false) { - $type = substr($uri->path, $semicolon_pos + 1); // no semicolon - $uri->path = substr($uri->path, 0, $semicolon_pos); - $type_ret = ''; - if (strpos($type, '=') !== false) { - // figure out whether or not the declaration is correct - list($key, $typecode) = explode('=', $type, 2); - if ($key !== 'type') { - // invalid key, tack it back on encoded - $uri->path .= '%3B' . $type; - } elseif ($typecode === 'a' || $typecode === 'i' || $typecode === 'd') { - $type_ret = ";type=$typecode"; - } - } else { - $uri->path .= '%3B' . $type; - } - $uri->path = str_replace(';', '%3B', $uri->path); - $uri->path .= $type_ret; - } - - return true; - } - -} - -// vim: et sw=4 sts=4 diff --git a/main/inc/lib/htmlpurifier/library/HTMLPurifier/URIScheme/http.php b/main/inc/lib/htmlpurifier/library/HTMLPurifier/URIScheme/http.php deleted file mode 100755 index b097a31d6a..0000000000 --- a/main/inc/lib/htmlpurifier/library/HTMLPurifier/URIScheme/http.php +++ /dev/null @@ -1,20 +0,0 @@ -userinfo = null; - return true; - } - -} - -// vim: et sw=4 sts=4 diff --git a/main/inc/lib/htmlpurifier/library/HTMLPurifier/URIScheme/https.php b/main/inc/lib/htmlpurifier/library/HTMLPurifier/URIScheme/https.php deleted file mode 100755 index 29e380919f..0000000000 --- a/main/inc/lib/htmlpurifier/library/HTMLPurifier/URIScheme/https.php +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/main/inc/lib/htmlpurifier/library/HTMLPurifier/URIScheme/mailto.php b/main/inc/lib/htmlpurifier/library/HTMLPurifier/URIScheme/mailto.php deleted file mode 100755 index c1e2cd5aae..0000000000 --- a/main/inc/lib/htmlpurifier/library/HTMLPurifier/URIScheme/mailto.php +++ /dev/null @@ -1,27 +0,0 @@ -userinfo = null; - $uri->host = null; - $uri->port = null; - // we need to validate path against RFC 2368's addr-spec - return true; - } - -} - -// vim: et sw=4 sts=4 diff --git a/main/inc/lib/htmlpurifier/library/HTMLPurifier/URIScheme/news.php b/main/inc/lib/htmlpurifier/library/HTMLPurifier/URIScheme/news.php deleted file mode 100755 index f5f54f4f56..0000000000 --- a/main/inc/lib/htmlpurifier/library/HTMLPurifier/URIScheme/news.php +++ /dev/null @@ -1,22 +0,0 @@ -userinfo = null; - $uri->host = null; - $uri->port = null; - $uri->query = null; - // typecode check needed on path - return true; - } - -} - -// vim: et sw=4 sts=4 diff --git a/main/inc/lib/htmlpurifier/library/HTMLPurifier/URIScheme/nntp.php b/main/inc/lib/htmlpurifier/library/HTMLPurifier/URIScheme/nntp.php deleted file mode 100755 index 5bf93ea784..0000000000 --- a/main/inc/lib/htmlpurifier/library/HTMLPurifier/URIScheme/nntp.php +++ /dev/null @@ -1,20 +0,0 @@ -userinfo = null; - $uri->query = null; - return true; - } - -} - -// vim: et sw=4 sts=4 diff --git a/main/inc/lib/htmlpurifier/library/HTMLPurifier/URISchemeRegistry.php b/main/inc/lib/htmlpurifier/library/HTMLPurifier/URISchemeRegistry.php deleted file mode 100755 index 576bf7b6d1..0000000000 --- a/main/inc/lib/htmlpurifier/library/HTMLPurifier/URISchemeRegistry.php +++ /dev/null @@ -1,68 +0,0 @@ -get('URI.AllowedSchemes'); - if (!$config->get('URI.OverrideAllowedSchemes') && - !isset($allowed_schemes[$scheme]) - ) { - return; - } - - if (isset($this->schemes[$scheme])) return $this->schemes[$scheme]; - if (!isset($allowed_schemes[$scheme])) return; - - $class = 'HTMLPurifier_URIScheme_' . $scheme; - if (!class_exists($class)) return; - $this->schemes[$scheme] = new $class(); - return $this->schemes[$scheme]; - } - - /** - * Registers a custom scheme to the cache, bypassing reflection. - * @param $scheme Scheme name - * @param $scheme_obj HTMLPurifier_URIScheme object - */ - public function register($scheme, $scheme_obj) { - $this->schemes[$scheme] = $scheme_obj; - } - -} - -// vim: et sw=4 sts=4 diff --git a/main/inc/lib/htmlpurifier/library/HTMLPurifier/UnitConverter.php b/main/inc/lib/htmlpurifier/library/HTMLPurifier/UnitConverter.php deleted file mode 100755 index 545d426220..0000000000 --- a/main/inc/lib/htmlpurifier/library/HTMLPurifier/UnitConverter.php +++ /dev/null @@ -1,254 +0,0 @@ - array( - 'px' => 3, // This is as per CSS 2.1 and Firefox. Your mileage may vary - 'pt' => 4, - 'pc' => 48, - 'in' => 288, - self::METRIC => array('pt', '0.352777778', 'mm'), - ), - self::METRIC => array( - 'mm' => 1, - 'cm' => 10, - self::ENGLISH => array('mm', '2.83464567', 'pt'), - ), - ); - - /** - * Minimum bcmath precision for output. - */ - protected $outputPrecision; - - /** - * Bcmath precision for internal calculations. - */ - protected $internalPrecision; - - /** - * Whether or not BCMath is available - */ - private $bcmath; - - public function __construct($output_precision = 4, $internal_precision = 10, $force_no_bcmath = false) { - $this->outputPrecision = $output_precision; - $this->internalPrecision = $internal_precision; - $this->bcmath = !$force_no_bcmath && function_exists('bcmul'); - } - - /** - * Converts a length object of one unit into another unit. - * @param HTMLPurifier_Length $length - * Instance of HTMLPurifier_Length to convert. You must validate() - * it before passing it here! - * @param string $to_unit - * Unit to convert to. - * @note - * About precision: This conversion function pays very special - * attention to the incoming precision of values and attempts - * to maintain a number of significant figure. Results are - * fairly accurate up to nine digits. Some caveats: - * - If a number is zero-padded as a result of this significant - * figure tracking, the zeroes will be eliminated. - * - If a number contains less than four sigfigs ($outputPrecision) - * and this causes some decimals to be excluded, those - * decimals will be added on. - */ - public function convert($length, $to_unit) { - - if (!$length->isValid()) return false; - - $n = $length->getN(); - $unit = $length->getUnit(); - - if ($n === '0' || $unit === false) { - return new HTMLPurifier_Length('0', false); - } - - $state = $dest_state = false; - foreach (self::$units as $k => $x) { - if (isset($x[$unit])) $state = $k; - if (isset($x[$to_unit])) $dest_state = $k; - } - if (!$state || !$dest_state) return false; - - // Some calculations about the initial precision of the number; - // this will be useful when we need to do final rounding. - $sigfigs = $this->getSigFigs($n); - if ($sigfigs < $this->outputPrecision) $sigfigs = $this->outputPrecision; - - // BCMath's internal precision deals only with decimals. Use - // our default if the initial number has no decimals, or increase - // it by how ever many decimals, thus, the number of guard digits - // will always be greater than or equal to internalPrecision. - $log = (int) floor(log(abs($n), 10)); - $cp = ($log < 0) ? $this->internalPrecision - $log : $this->internalPrecision; // internal precision - - for ($i = 0; $i < 2; $i++) { - - // Determine what unit IN THIS SYSTEM we need to convert to - if ($dest_state === $state) { - // Simple conversion - $dest_unit = $to_unit; - } else { - // Convert to the smallest unit, pending a system shift - $dest_unit = self::$units[$state][$dest_state][0]; - } - - // Do the conversion if necessary - if ($dest_unit !== $unit) { - $factor = $this->div(self::$units[$state][$unit], self::$units[$state][$dest_unit], $cp); - $n = $this->mul($n, $factor, $cp); - $unit = $dest_unit; - } - - // Output was zero, so bail out early. Shouldn't ever happen. - if ($n === '') { - $n = '0'; - $unit = $to_unit; - break; - } - - // It was a simple conversion, so bail out - if ($dest_state === $state) { - break; - } - - if ($i !== 0) { - // Conversion failed! Apparently, the system we forwarded - // to didn't have this unit. This should never happen! - return false; - } - - // Pre-condition: $i == 0 - - // Perform conversion to next system of units - $n = $this->mul($n, self::$units[$state][$dest_state][1], $cp); - $unit = self::$units[$state][$dest_state][2]; - $state = $dest_state; - - // One more loop around to convert the unit in the new system. - - } - - // Post-condition: $unit == $to_unit - if ($unit !== $to_unit) return false; - - // Useful for debugging: - //echo "
          n";
          -        //echo "$n\nsigfigs = $sigfigs\nnew_log = $new_log\nlog = $log\nrp = $rp\n
          \n"; - - $n = $this->round($n, $sigfigs); - if (strpos($n, '.') !== false) $n = rtrim($n, '0'); - $n = rtrim($n, '.'); - - return new HTMLPurifier_Length($n, $unit); - } - - /** - * Returns the number of significant figures in a string number. - * @param string $n Decimal number - * @return int number of sigfigs - */ - public function getSigFigs($n) { - $n = ltrim($n, '0+-'); - $dp = strpos($n, '.'); // decimal position - if ($dp === false) { - $sigfigs = strlen(rtrim($n, '0')); - } else { - $sigfigs = strlen(ltrim($n, '0.')); // eliminate extra decimal character - if ($dp !== 0) $sigfigs--; - } - return $sigfigs; - } - - /** - * Adds two numbers, using arbitrary precision when available. - */ - private function add($s1, $s2, $scale) { - if ($this->bcmath) return bcadd($s1, $s2, $scale); - else return $this->scale($s1 + $s2, $scale); - } - - /** - * Multiples two numbers, using arbitrary precision when available. - */ - private function mul($s1, $s2, $scale) { - if ($this->bcmath) return bcmul($s1, $s2, $scale); - else return $this->scale($s1 * $s2, $scale); - } - - /** - * Divides two numbers, using arbitrary precision when available. - */ - private function div($s1, $s2, $scale) { - if ($this->bcmath) return bcdiv($s1, $s2, $scale); - else return $this->scale($s1 / $s2, $scale); - } - - /** - * Rounds a number according to the number of sigfigs it should have, - * using arbitrary precision when available. - */ - private function round($n, $sigfigs) { - $new_log = (int) floor(log(abs($n), 10)); // Number of digits left of decimal - 1 - $rp = $sigfigs - $new_log - 1; // Number of decimal places needed - $neg = $n < 0 ? '-' : ''; // Negative sign - if ($this->bcmath) { - if ($rp >= 0) { - $n = bcadd($n, $neg . '0.' . str_repeat('0', $rp) . '5', $rp + 1); - $n = bcdiv($n, '1', $rp); - } else { - // This algorithm partially depends on the standardized - // form of numbers that comes out of bcmath. - $n = bcadd($n, $neg . '5' . str_repeat('0', $new_log - $sigfigs), 0); - $n = substr($n, 0, $sigfigs + strlen($neg)) . str_repeat('0', $new_log - $sigfigs + 1); - } - return $n; - } else { - return $this->scale(round($n, $sigfigs - $new_log - 1), $rp + 1); - } - } - - /** - * Scales a float to $scale digits right of decimal point, like BCMath. - */ - private function scale($r, $scale) { - if ($scale < 0) { - // The f sprintf type doesn't support negative numbers, so we - // need to cludge things manually. First get the string. - $r = sprintf('%.0f', (float) $r); - // Due to floating point precision loss, $r will more than likely - // look something like 4652999999999.9234. We grab one more digit - // than we need to precise from $r and then use that to round - // appropriately. - $precise = (string) round(substr($r, 0, strlen($r) + $scale), -1); - // Now we return it, truncating the zero that was rounded off. - return substr($precise, 0, -1) . str_repeat('0', -$scale + 1); - } - return sprintf('%.' . $scale . 'f', (float) $r); - } - -} - -// vim: et sw=4 sts=4 diff --git a/main/inc/lib/htmlpurifier/library/HTMLPurifier/VarParser.php b/main/inc/lib/htmlpurifier/library/HTMLPurifier/VarParser.php deleted file mode 100755 index 68e72ae869..0000000000 --- a/main/inc/lib/htmlpurifier/library/HTMLPurifier/VarParser.php +++ /dev/null @@ -1,154 +0,0 @@ - self::STRING, - 'istring' => self::ISTRING, - 'text' => self::TEXT, - 'itext' => self::ITEXT, - 'int' => self::INT, - 'float' => self::FLOAT, - 'bool' => self::BOOL, - 'lookup' => self::LOOKUP, - 'list' => self::ALIST, - 'hash' => self::HASH, - 'mixed' => self::MIXED - ); - - /** - * Lookup table of types that are string, and can have aliases or - * allowed value lists. - */ - static public $stringTypes = array( - self::STRING => true, - self::ISTRING => true, - self::TEXT => true, - self::ITEXT => true, - ); - - /** - * Validate a variable according to type. Throws - * HTMLPurifier_VarParserException if invalid. - * It may return NULL as a valid type if $allow_null is true. - * - * @param $var Variable to validate - * @param $type Type of variable, see HTMLPurifier_VarParser->types - * @param $allow_null Whether or not to permit null as a value - * @return Validated and type-coerced variable - */ - final public function parse($var, $type, $allow_null = false) { - if (is_string($type)) { - if (!isset(HTMLPurifier_VarParser::$types[$type])) { - throw new HTMLPurifier_VarParserException("Invalid type '$type'"); - } else { - $type = HTMLPurifier_VarParser::$types[$type]; - } - } - $var = $this->parseImplementation($var, $type, $allow_null); - if ($allow_null && $var === null) return null; - // These are basic checks, to make sure nothing horribly wrong - // happened in our implementations. - switch ($type) { - case (self::STRING): - case (self::ISTRING): - case (self::TEXT): - case (self::ITEXT): - if (!is_string($var)) break; - if ($type == self::ISTRING || $type == self::ITEXT) $var = strtolower($var); - return $var; - case (self::INT): - if (!is_int($var)) break; - return $var; - case (self::FLOAT): - if (!is_float($var)) break; - return $var; - case (self::BOOL): - if (!is_bool($var)) break; - return $var; - case (self::LOOKUP): - case (self::ALIST): - case (self::HASH): - if (!is_array($var)) break; - if ($type === self::LOOKUP) { - foreach ($var as $k) if ($k !== true) $this->error('Lookup table contains value other than true'); - } elseif ($type === self::ALIST) { - $keys = array_keys($var); - if (array_keys($keys) !== $keys) $this->error('Indices for list are not uniform'); - } - return $var; - case (self::MIXED): - return $var; - default: - $this->errorInconsistent(get_class($this), $type); - } - $this->errorGeneric($var, $type); - } - - /** - * Actually implements the parsing. Base implementation is to not - * do anything to $var. Subclasses should overload this! - */ - protected function parseImplementation($var, $type, $allow_null) { - return $var; - } - - /** - * Throws an exception. - */ - protected function error($msg) { - throw new HTMLPurifier_VarParserException($msg); - } - - /** - * Throws an inconsistency exception. - * @note This should not ever be called. It would be called if we - * extend the allowed values of HTMLPurifier_VarParser without - * updating subclasses. - */ - protected function errorInconsistent($class, $type) { - throw new HTMLPurifier_Exception("Inconsistency in $class: ".HTMLPurifier_VarParser::getTypeName($type)." not implemented"); - } - - /** - * Generic error for if a type didn't work. - */ - protected function errorGeneric($var, $type) { - $vtype = gettype($var); - $this->error("Expected type ".HTMLPurifier_VarParser::getTypeName($type).", got $vtype"); - } - - static public function getTypeName($type) { - static $lookup; - if (!$lookup) { - // Lazy load the alternative lookup table - $lookup = array_flip(HTMLPurifier_VarParser::$types); - } - if (!isset($lookup[$type])) return 'unknown'; - return $lookup[$type]; - } - -} - -// vim: et sw=4 sts=4 diff --git a/main/inc/lib/htmlpurifier/library/HTMLPurifier/VarParser/Flexible.php b/main/inc/lib/htmlpurifier/library/HTMLPurifier/VarParser/Flexible.php deleted file mode 100755 index a424edb013..0000000000 --- a/main/inc/lib/htmlpurifier/library/HTMLPurifier/VarParser/Flexible.php +++ /dev/null @@ -1,103 +0,0 @@ - $j) $var[$i] = trim($j); - if ($type === self::HASH) { - // key:value,key2:value2 - $nvar = array(); - foreach ($var as $keypair) { - $c = explode(':', $keypair, 2); - if (!isset($c[1])) continue; - $nvar[trim($c[0])] = trim($c[1]); - } - $var = $nvar; - } - } - if (!is_array($var)) break; - $keys = array_keys($var); - if ($keys === array_keys($keys)) { - if ($type == self::ALIST) return $var; - elseif ($type == self::LOOKUP) { - $new = array(); - foreach ($var as $key) { - $new[$key] = true; - } - return $new; - } else break; - } - if ($type === self::ALIST) { - trigger_error("Array list did not have consecutive integer indexes", E_USER_WARNING); - return array_values($var); - } - if ($type === self::LOOKUP) { - foreach ($var as $key => $value) { - if ($value !== true) { - trigger_error("Lookup array has non-true value at key '$key'; maybe your input array was not indexed numerically", E_USER_WARNING); - } - $var[$key] = true; - } - } - return $var; - default: - $this->errorInconsistent(__CLASS__, $type); - } - $this->errorGeneric($var, $type); - } - -} - -// vim: et sw=4 sts=4 diff --git a/main/inc/lib/htmlpurifier/library/HTMLPurifier/VarParser/Native.php b/main/inc/lib/htmlpurifier/library/HTMLPurifier/VarParser/Native.php deleted file mode 100755 index b02a6de54c..0000000000 --- a/main/inc/lib/htmlpurifier/library/HTMLPurifier/VarParser/Native.php +++ /dev/null @@ -1,26 +0,0 @@ -evalExpression($var); - } - - protected function evalExpression($expr) { - $var = null; - $result = eval("\$var = $expr;"); - if ($result === false) { - throw new HTMLPurifier_VarParserException("Fatal error in evaluated code"); - } - return $var; - } - -} - -// vim: et sw=4 sts=4 diff --git a/main/inc/lib/htmlpurifier/library/HTMLPurifier/VarParser/index.html b/main/inc/lib/htmlpurifier/library/HTMLPurifier/VarParser/index.html deleted file mode 100755 index aa7b9c934b..0000000000 --- a/main/inc/lib/htmlpurifier/library/HTMLPurifier/VarParser/index.html +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/main/inc/lib/htmlpurifier/library/HTMLPurifier/VarParserException.php b/main/inc/lib/htmlpurifier/library/HTMLPurifier/VarParserException.php deleted file mode 100755 index 5df3414959..0000000000 --- a/main/inc/lib/htmlpurifier/library/HTMLPurifier/VarParserException.php +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/main/inc/lib/htmlpurifier/library/index.html b/main/inc/lib/htmlpurifier/library/index.html deleted file mode 100755 index aa7b9c934b..0000000000 --- a/main/inc/lib/htmlpurifier/library/index.html +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/main/inc/lib/htmlpurifier/maintenance/.htaccess b/main/inc/lib/htmlpurifier/maintenance/.htaccess deleted file mode 100755 index 3a42882788..0000000000 --- a/main/inc/lib/htmlpurifier/maintenance/.htaccess +++ /dev/null @@ -1 +0,0 @@ -Deny from all diff --git a/main/inc/lib/htmlpurifier/maintenance/PH5P.patch b/main/inc/lib/htmlpurifier/maintenance/PH5P.patch deleted file mode 100755 index 763709509b..0000000000 --- a/main/inc/lib/htmlpurifier/maintenance/PH5P.patch +++ /dev/null @@ -1,102 +0,0 @@ ---- C:\Users\Edward\Webs\htmlpurifier\maintenance\PH5P.php 2008-07-07 09:12:12.000000000 -0400 -+++ C:\Users\Edward\Webs\htmlpurifier\maintenance/PH5P.new.php 2008-12-06 02:29:34.988800000 -0500 -@@ -65,7 +65,7 @@ - - public function __construct($data) { - $data = str_replace("\r\n", "\n", $data); -- $date = str_replace("\r", null, $data); -+ $data = str_replace("\r", null, $data); - - $this->data = $data; - $this->char = -1; -@@ -211,7 +211,10 @@ - // If nothing is returned, emit a U+0026 AMPERSAND character token. - // Otherwise, emit the character token that was returned. - $char = (!$entity) ? '&' : $entity; -- $this->emitToken($char); -+ $this->emitToken(array( -+ 'type' => self::CHARACTR, -+ 'data' => $char -+ )); - - // Finally, switch to the data state. - $this->state = 'data'; -@@ -708,7 +711,7 @@ - } elseif($char === '&') { - /* U+0026 AMPERSAND (&) - Switch to the entity in attribute value state. */ -- $this->entityInAttributeValueState('non'); -+ $this->entityInAttributeValueState(); - - } elseif($char === '>') { - /* U+003E GREATER-THAN SIGN (>) -@@ -738,7 +741,8 @@ - ? '&' - : $entity; - -- $this->emitToken($char); -+ $last = count($this->token['attr']) - 1; -+ $this->token['attr'][$last]['value'] .= $char; - } - - private function bogusCommentState() { -@@ -1066,6 +1070,11 @@ - $this->char++; - - if(in_array($id, $this->entities)) { -+ if ($e_name[$c-1] !== ';') { -+ if ($c < $len && $e_name[$c] == ';') { -+ $this->char++; // consume extra semicolon -+ } -+ } - $entity = $id; - break; - } -@@ -2084,7 +2093,7 @@ - /* Reconstruct the active formatting elements, if any. */ - $this->reconstructActiveFormattingElements(); - -- $this->insertElement($token); -+ $this->insertElement($token, true, true); - break; - } - break; -@@ -3465,7 +3474,18 @@ - } - } - -- private function insertElement($token, $append = true) { -+ private function insertElement($token, $append = true, $check = false) { -+ // Proprietary workaround for libxml2's limitations with tag names -+ if ($check) { -+ // Slightly modified HTML5 tag-name modification, -+ // removing anything that's not an ASCII letter, digit, or hyphen -+ $token['name'] = preg_replace('/[^a-z0-9-]/i', '', $token['name']); -+ // Remove leading hyphens and numbers -+ $token['name'] = ltrim($token['name'], '-0..9'); -+ // In theory, this should ever be needed, but just in case -+ if ($token['name'] === '') $token['name'] = 'span'; // arbitrary generic choice -+ } -+ - $el = $this->dom->createElement($token['name']); - - foreach($token['attr'] as $attr) { -@@ -3659,7 +3679,7 @@ - } - } - -- private function generateImpliedEndTags(array $exclude = array()) { -+ private function generateImpliedEndTags($exclude = array()) { - /* When the steps below require the UA to generate implied end tags, - then, if the current node is a dd element, a dt element, an li element, - a p element, a td element, a th element, or a tr element, the UA must -@@ -3673,7 +3693,8 @@ - } - } - -- private function getElementCategory($name) { -+ private function getElementCategory($node) { -+ $name = $node->tagName; - if(in_array($name, $this->special)) - return self::SPECIAL; - diff --git a/main/inc/lib/htmlpurifier/maintenance/PH5P.php b/main/inc/lib/htmlpurifier/maintenance/PH5P.php deleted file mode 100755 index 96d0d13f92..0000000000 --- a/main/inc/lib/htmlpurifier/maintenance/PH5P.php +++ /dev/null @@ -1,3824 +0,0 @@ -data = $data; - $this->char = -1; - $this->EOF = strlen($data); - $this->tree = new HTML5TreeConstructer; - $this->content_model = self::PCDATA; - - $this->state = 'data'; - - while($this->state !== null) { - $this->{$this->state.'State'}(); - } - } - - public function save() { - return $this->tree->save(); - } - - private function char() { - return ($this->char < $this->EOF) - ? $this->data[$this->char] - : false; - } - - private function character($s, $l = 0) { - if($s + $l < $this->EOF) { - if($l === 0) { - return $this->data[$s]; - } else { - return substr($this->data, $s, $l); - } - } - } - - private function characters($char_class, $start) { - return preg_replace('#^(['.$char_class.']+).*#s', '\\1', substr($this->data, $start)); - } - - private function dataState() { - // Consume the next input character - $this->char++; - $char = $this->char(); - - if($char === '&' && ($this->content_model === self::PCDATA || $this->content_model === self::RCDATA)) { - /* U+0026 AMPERSAND (&) - When the content model flag is set to one of the PCDATA or RCDATA - states: switch to the entity data state. Otherwise: treat it as per - the "anything else" entry below. */ - $this->state = 'entityData'; - - } elseif($char === '-') { - /* If the content model flag is set to either the RCDATA state or - the CDATA state, and the escape flag is false, and there are at - least three characters before this one in the input stream, and the - last four characters in the input stream, including this one, are - U+003C LESS-THAN SIGN, U+0021 EXCLAMATION MARK, U+002D HYPHEN-MINUS, - and U+002D HYPHEN-MINUS (""), - set the escape flag to false. */ - if(($this->content_model === self::RCDATA || - $this->content_model === self::CDATA) && $this->escape === true && - $this->character($this->char, 3) === '-->') { - $this->escape = false; - } - - /* In any case, emit the input character as a character token. - Stay in the data state. */ - $this->emitToken(array( - 'type' => self::CHARACTR, - 'data' => $char - )); - - } elseif($this->char === $this->EOF) { - /* EOF - Emit an end-of-file token. */ - $this->EOF(); - - } elseif($this->content_model === self::PLAINTEXT) { - /* When the content model flag is set to the PLAINTEXT state - THIS DIFFERS GREATLY FROM THE SPEC: Get the remaining characters of - the text and emit it as a character token. */ - $this->emitToken(array( - 'type' => self::CHARACTR, - 'data' => substr($this->data, $this->char) - )); - - $this->EOF(); - - } else { - /* Anything else - THIS DIFFERS GREATLY FROM THE SPEC: Get as many character that - otherwise would also be treated as a character token and emit it - as a single character token. Stay in the data state. */ - $len = strcspn($this->data, '<&', $this->char); - $char = substr($this->data, $this->char, $len); - $this->char += $len - 1; - - $this->emitToken(array( - 'type' => self::CHARACTR, - 'data' => $char - )); - - $this->state = 'data'; - } - } - - private function entityDataState() { - // Attempt to consume an entity. - $entity = $this->entity(); - - // If nothing is returned, emit a U+0026 AMPERSAND character token. - // Otherwise, emit the character token that was returned. - $char = (!$entity) ? '&' : $entity; - $this->emitToken($char); - - // Finally, switch to the data state. - $this->state = 'data'; - } - - private function tagOpenState() { - switch($this->content_model) { - case self::RCDATA: - case self::CDATA: - /* If the next input character is a U+002F SOLIDUS (/) character, - consume it and switch to the close tag open state. If the next - input character is not a U+002F SOLIDUS (/) character, emit a - U+003C LESS-THAN SIGN character token and switch to the data - state to process the next input character. */ - if($this->character($this->char + 1) === '/') { - $this->char++; - $this->state = 'closeTagOpen'; - - } else { - $this->emitToken(array( - 'type' => self::CHARACTR, - 'data' => '<' - )); - - $this->state = 'data'; - } - break; - - case self::PCDATA: - // If the content model flag is set to the PCDATA state - // Consume the next input character: - $this->char++; - $char = $this->char(); - - if($char === '!') { - /* U+0021 EXCLAMATION MARK (!) - Switch to the markup declaration open state. */ - $this->state = 'markupDeclarationOpen'; - - } elseif($char === '/') { - /* U+002F SOLIDUS (/) - Switch to the close tag open state. */ - $this->state = 'closeTagOpen'; - - } elseif(preg_match('/^[A-Za-z]$/', $char)) { - /* U+0041 LATIN LETTER A through to U+005A LATIN LETTER Z - Create a new start tag token, set its tag name to the lowercase - version of the input character (add 0x0020 to the character's code - point), then switch to the tag name state. (Don't emit the token - yet; further details will be filled in before it is emitted.) */ - $this->token = array( - 'name' => strtolower($char), - 'type' => self::STARTTAG, - 'attr' => array() - ); - - $this->state = 'tagName'; - - } elseif($char === '>') { - /* U+003E GREATER-THAN SIGN (>) - Parse error. Emit a U+003C LESS-THAN SIGN character token and a - U+003E GREATER-THAN SIGN character token. Switch to the data state. */ - $this->emitToken(array( - 'type' => self::CHARACTR, - 'data' => '<>' - )); - - $this->state = 'data'; - - } elseif($char === '?') { - /* U+003F QUESTION MARK (?) - Parse error. Switch to the bogus comment state. */ - $this->state = 'bogusComment'; - - } else { - /* Anything else - Parse error. Emit a U+003C LESS-THAN SIGN character token and - reconsume the current input character in the data state. */ - $this->emitToken(array( - 'type' => self::CHARACTR, - 'data' => '<' - )); - - $this->char--; - $this->state = 'data'; - } - break; - } - } - - private function closeTagOpenState() { - $next_node = strtolower($this->characters('A-Za-z', $this->char + 1)); - $the_same = count($this->tree->stack) > 0 && $next_node === end($this->tree->stack)->nodeName; - - if(($this->content_model === self::RCDATA || $this->content_model === self::CDATA) && - (!$the_same || ($the_same && (!preg_match('/[\t\n\x0b\x0c >\/]/', - $this->character($this->char + 1 + strlen($next_node))) || $this->EOF === $this->char)))) { - /* If the content model flag is set to the RCDATA or CDATA states then - examine the next few characters. If they do not match the tag name of - the last start tag token emitted (case insensitively), or if they do but - they are not immediately followed by one of the following characters: - * U+0009 CHARACTER TABULATION - * U+000A LINE FEED (LF) - * U+000B LINE TABULATION - * U+000C FORM FEED (FF) - * U+0020 SPACE - * U+003E GREATER-THAN SIGN (>) - * U+002F SOLIDUS (/) - * EOF - ...then there is a parse error. Emit a U+003C LESS-THAN SIGN character - token, a U+002F SOLIDUS character token, and switch to the data state - to process the next input character. */ - $this->emitToken(array( - 'type' => self::CHARACTR, - 'data' => 'state = 'data'; - - } else { - /* Otherwise, if the content model flag is set to the PCDATA state, - or if the next few characters do match that tag name, consume the - next input character: */ - $this->char++; - $char = $this->char(); - - if(preg_match('/^[A-Za-z]$/', $char)) { - /* U+0041 LATIN LETTER A through to U+005A LATIN LETTER Z - Create a new end tag token, set its tag name to the lowercase version - of the input character (add 0x0020 to the character's code point), then - switch to the tag name state. (Don't emit the token yet; further details - will be filled in before it is emitted.) */ - $this->token = array( - 'name' => strtolower($char), - 'type' => self::ENDTAG - ); - - $this->state = 'tagName'; - - } elseif($char === '>') { - /* U+003E GREATER-THAN SIGN (>) - Parse error. Switch to the data state. */ - $this->state = 'data'; - - } elseif($this->char === $this->EOF) { - /* EOF - Parse error. Emit a U+003C LESS-THAN SIGN character token and a U+002F - SOLIDUS character token. Reconsume the EOF character in the data state. */ - $this->emitToken(array( - 'type' => self::CHARACTR, - 'data' => 'char--; - $this->state = 'data'; - - } else { - /* Parse error. Switch to the bogus comment state. */ - $this->state = 'bogusComment'; - } - } - } - - private function tagNameState() { - // Consume the next input character: - $this->char++; - $char = $this->character($this->char); - - if(preg_match('/^[\t\n\x0b\x0c ]$/', $char)) { - /* U+0009 CHARACTER TABULATION - U+000A LINE FEED (LF) - U+000B LINE TABULATION - U+000C FORM FEED (FF) - U+0020 SPACE - Switch to the before attribute name state. */ - $this->state = 'beforeAttributeName'; - - } elseif($char === '>') { - /* U+003E GREATER-THAN SIGN (>) - Emit the current tag token. Switch to the data state. */ - $this->emitToken($this->token); - $this->state = 'data'; - - } elseif($this->char === $this->EOF) { - /* EOF - Parse error. Emit the current tag token. Reconsume the EOF - character in the data state. */ - $this->emitToken($this->token); - - $this->char--; - $this->state = 'data'; - - } elseif($char === '/') { - /* U+002F SOLIDUS (/) - Parse error unless this is a permitted slash. Switch to the before - attribute name state. */ - $this->state = 'beforeAttributeName'; - - } else { - /* Anything else - Append the current input character to the current tag token's tag name. - Stay in the tag name state. */ - $this->token['name'] .= strtolower($char); - $this->state = 'tagName'; - } - } - - private function beforeAttributeNameState() { - // Consume the next input character: - $this->char++; - $char = $this->character($this->char); - - if(preg_match('/^[\t\n\x0b\x0c ]$/', $char)) { - /* U+0009 CHARACTER TABULATION - U+000A LINE FEED (LF) - U+000B LINE TABULATION - U+000C FORM FEED (FF) - U+0020 SPACE - Stay in the before attribute name state. */ - $this->state = 'beforeAttributeName'; - - } elseif($char === '>') { - /* U+003E GREATER-THAN SIGN (>) - Emit the current tag token. Switch to the data state. */ - $this->emitToken($this->token); - $this->state = 'data'; - - } elseif($char === '/') { - /* U+002F SOLIDUS (/) - Parse error unless this is a permitted slash. Stay in the before - attribute name state. */ - $this->state = 'beforeAttributeName'; - - } elseif($this->char === $this->EOF) { - /* EOF - Parse error. Emit the current tag token. Reconsume the EOF - character in the data state. */ - $this->emitToken($this->token); - - $this->char--; - $this->state = 'data'; - - } else { - /* Anything else - Start a new attribute in the current tag token. Set that attribute's - name to the current input character, and its value to the empty string. - Switch to the attribute name state. */ - $this->token['attr'][] = array( - 'name' => strtolower($char), - 'value' => null - ); - - $this->state = 'attributeName'; - } - } - - private function attributeNameState() { - // Consume the next input character: - $this->char++; - $char = $this->character($this->char); - - if(preg_match('/^[\t\n\x0b\x0c ]$/', $char)) { - /* U+0009 CHARACTER TABULATION - U+000A LINE FEED (LF) - U+000B LINE TABULATION - U+000C FORM FEED (FF) - U+0020 SPACE - Stay in the before attribute name state. */ - $this->state = 'afterAttributeName'; - - } elseif($char === '=') { - /* U+003D EQUALS SIGN (=) - Switch to the before attribute value state. */ - $this->state = 'beforeAttributeValue'; - - } elseif($char === '>') { - /* U+003E GREATER-THAN SIGN (>) - Emit the current tag token. Switch to the data state. */ - $this->emitToken($this->token); - $this->state = 'data'; - - } elseif($char === '/' && $this->character($this->char + 1) !== '>') { - /* U+002F SOLIDUS (/) - Parse error unless this is a permitted slash. Switch to the before - attribute name state. */ - $this->state = 'beforeAttributeName'; - - } elseif($this->char === $this->EOF) { - /* EOF - Parse error. Emit the current tag token. Reconsume the EOF - character in the data state. */ - $this->emitToken($this->token); - - $this->char--; - $this->state = 'data'; - - } else { - /* Anything else - Append the current input character to the current attribute's name. - Stay in the attribute name state. */ - $last = count($this->token['attr']) - 1; - $this->token['attr'][$last]['name'] .= strtolower($char); - - $this->state = 'attributeName'; - } - } - - private function afterAttributeNameState() { - // Consume the next input character: - $this->char++; - $char = $this->character($this->char); - - if(preg_match('/^[\t\n\x0b\x0c ]$/', $char)) { - /* U+0009 CHARACTER TABULATION - U+000A LINE FEED (LF) - U+000B LINE TABULATION - U+000C FORM FEED (FF) - U+0020 SPACE - Stay in the after attribute name state. */ - $this->state = 'afterAttributeName'; - - } elseif($char === '=') { - /* U+003D EQUALS SIGN (=) - Switch to the before attribute value state. */ - $this->state = 'beforeAttributeValue'; - - } elseif($char === '>') { - /* U+003E GREATER-THAN SIGN (>) - Emit the current tag token. Switch to the data state. */ - $this->emitToken($this->token); - $this->state = 'data'; - - } elseif($char === '/' && $this->character($this->char + 1) !== '>') { - /* U+002F SOLIDUS (/) - Parse error unless this is a permitted slash. Switch to the - before attribute name state. */ - $this->state = 'beforeAttributeName'; - - } elseif($this->char === $this->EOF) { - /* EOF - Parse error. Emit the current tag token. Reconsume the EOF - character in the data state. */ - $this->emitToken($this->token); - - $this->char--; - $this->state = 'data'; - - } else { - /* Anything else - Start a new attribute in the current tag token. Set that attribute's - name to the current input character, and its value to the empty string. - Switch to the attribute name state. */ - $this->token['attr'][] = array( - 'name' => strtolower($char), - 'value' => null - ); - - $this->state = 'attributeName'; - } - } - - private function beforeAttributeValueState() { - // Consume the next input character: - $this->char++; - $char = $this->character($this->char); - - if(preg_match('/^[\t\n\x0b\x0c ]$/', $char)) { - /* U+0009 CHARACTER TABULATION - U+000A LINE FEED (LF) - U+000B LINE TABULATION - U+000C FORM FEED (FF) - U+0020 SPACE - Stay in the before attribute value state. */ - $this->state = 'beforeAttributeValue'; - - } elseif($char === '"') { - /* U+0022 QUOTATION MARK (") - Switch to the attribute value (double-quoted) state. */ - $this->state = 'attributeValueDoubleQuoted'; - - } elseif($char === '&') { - /* U+0026 AMPERSAND (&) - Switch to the attribute value (unquoted) state and reconsume - this input character. */ - $this->char--; - $this->state = 'attributeValueUnquoted'; - - } elseif($char === '\'') { - /* U+0027 APOSTROPHE (') - Switch to the attribute value (single-quoted) state. */ - $this->state = 'attributeValueSingleQuoted'; - - } elseif($char === '>') { - /* U+003E GREATER-THAN SIGN (>) - Emit the current tag token. Switch to the data state. */ - $this->emitToken($this->token); - $this->state = 'data'; - - } else { - /* Anything else - Append the current input character to the current attribute's value. - Switch to the attribute value (unquoted) state. */ - $last = count($this->token['attr']) - 1; - $this->token['attr'][$last]['value'] .= $char; - - $this->state = 'attributeValueUnquoted'; - } - } - - private function attributeValueDoubleQuotedState() { - // Consume the next input character: - $this->char++; - $char = $this->character($this->char); - - if($char === '"') { - /* U+0022 QUOTATION MARK (") - Switch to the before attribute name state. */ - $this->state = 'beforeAttributeName'; - - } elseif($char === '&') { - /* U+0026 AMPERSAND (&) - Switch to the entity in attribute value state. */ - $this->entityInAttributeValueState('double'); - - } elseif($this->char === $this->EOF) { - /* EOF - Parse error. Emit the current tag token. Reconsume the character - in the data state. */ - $this->emitToken($this->token); - - $this->char--; - $this->state = 'data'; - - } else { - /* Anything else - Append the current input character to the current attribute's value. - Stay in the attribute value (double-quoted) state. */ - $last = count($this->token['attr']) - 1; - $this->token['attr'][$last]['value'] .= $char; - - $this->state = 'attributeValueDoubleQuoted'; - } - } - - private function attributeValueSingleQuotedState() { - // Consume the next input character: - $this->char++; - $char = $this->character($this->char); - - if($char === '\'') { - /* U+0022 QUOTATION MARK (') - Switch to the before attribute name state. */ - $this->state = 'beforeAttributeName'; - - } elseif($char === '&') { - /* U+0026 AMPERSAND (&) - Switch to the entity in attribute value state. */ - $this->entityInAttributeValueState('single'); - - } elseif($this->char === $this->EOF) { - /* EOF - Parse error. Emit the current tag token. Reconsume the character - in the data state. */ - $this->emitToken($this->token); - - $this->char--; - $this->state = 'data'; - - } else { - /* Anything else - Append the current input character to the current attribute's value. - Stay in the attribute value (single-quoted) state. */ - $last = count($this->token['attr']) - 1; - $this->token['attr'][$last]['value'] .= $char; - - $this->state = 'attributeValueSingleQuoted'; - } - } - - private function attributeValueUnquotedState() { - // Consume the next input character: - $this->char++; - $char = $this->character($this->char); - - if(preg_match('/^[\t\n\x0b\x0c ]$/', $char)) { - /* U+0009 CHARACTER TABULATION - U+000A LINE FEED (LF) - U+000B LINE TABULATION - U+000C FORM FEED (FF) - U+0020 SPACE - Switch to the before attribute name state. */ - $this->state = 'beforeAttributeName'; - - } elseif($char === '&') { - /* U+0026 AMPERSAND (&) - Switch to the entity in attribute value state. */ - $this->entityInAttributeValueState('non'); - - } elseif($char === '>') { - /* U+003E GREATER-THAN SIGN (>) - Emit the current tag token. Switch to the data state. */ - $this->emitToken($this->token); - $this->state = 'data'; - - } else { - /* Anything else - Append the current input character to the current attribute's value. - Stay in the attribute value (unquoted) state. */ - $last = count($this->token['attr']) - 1; - $this->token['attr'][$last]['value'] .= $char; - - $this->state = 'attributeValueUnquoted'; - } - } - - private function entityInAttributeValueState() { - // Attempt to consume an entity. - $entity = $this->entity(); - - // If nothing is returned, append a U+0026 AMPERSAND character to the - // current attribute's value. Otherwise, emit the character token that - // was returned. - $char = (!$entity) - ? '&' - : $entity; - - $this->emitToken($char); - } - - private function bogusCommentState() { - /* Consume every character up to the first U+003E GREATER-THAN SIGN - character (>) or the end of the file (EOF), whichever comes first. Emit - a comment token whose data is the concatenation of all the characters - starting from and including the character that caused the state machine - to switch into the bogus comment state, up to and including the last - consumed character before the U+003E character, if any, or up to the - end of the file otherwise. (If the comment was started by the end of - the file (EOF), the token is empty.) */ - $data = $this->characters('^>', $this->char); - $this->emitToken(array( - 'data' => $data, - 'type' => self::COMMENT - )); - - $this->char += strlen($data); - - /* Switch to the data state. */ - $this->state = 'data'; - - /* If the end of the file was reached, reconsume the EOF character. */ - if($this->char === $this->EOF) { - $this->char = $this->EOF - 1; - } - } - - private function markupDeclarationOpenState() { - /* If the next two characters are both U+002D HYPHEN-MINUS (-) - characters, consume those two characters, create a comment token whose - data is the empty string, and switch to the comment state. */ - if($this->character($this->char + 1, 2) === '--') { - $this->char += 2; - $this->state = 'comment'; - $this->token = array( - 'data' => null, - 'type' => self::COMMENT - ); - - /* Otherwise if the next seven chacacters are a case-insensitive match - for the word "DOCTYPE", then consume those characters and switch to the - DOCTYPE state. */ - } elseif(strtolower($this->character($this->char + 1, 7)) === 'doctype') { - $this->char += 7; - $this->state = 'doctype'; - - /* Otherwise, is is a parse error. Switch to the bogus comment state. - The next character that is consumed, if any, is the first character - that will be in the comment. */ - } else { - $this->char++; - $this->state = 'bogusComment'; - } - } - - private function commentState() { - /* Consume the next input character: */ - $this->char++; - $char = $this->char(); - - /* U+002D HYPHEN-MINUS (-) */ - if($char === '-') { - /* Switch to the comment dash state */ - $this->state = 'commentDash'; - - /* EOF */ - } elseif($this->char === $this->EOF) { - /* Parse error. Emit the comment token. Reconsume the EOF character - in the data state. */ - $this->emitToken($this->token); - $this->char--; - $this->state = 'data'; - - /* Anything else */ - } else { - /* Append the input character to the comment token's data. Stay in - the comment state. */ - $this->token['data'] .= $char; - } - } - - private function commentDashState() { - /* Consume the next input character: */ - $this->char++; - $char = $this->char(); - - /* U+002D HYPHEN-MINUS (-) */ - if($char === '-') { - /* Switch to the comment end state */ - $this->state = 'commentEnd'; - - /* EOF */ - } elseif($this->char === $this->EOF) { - /* Parse error. Emit the comment token. Reconsume the EOF character - in the data state. */ - $this->emitToken($this->token); - $this->char--; - $this->state = 'data'; - - /* Anything else */ - } else { - /* Append a U+002D HYPHEN-MINUS (-) character and the input - character to the comment token's data. Switch to the comment state. */ - $this->token['data'] .= '-'.$char; - $this->state = 'comment'; - } - } - - private function commentEndState() { - /* Consume the next input character: */ - $this->char++; - $char = $this->char(); - - if($char === '>') { - $this->emitToken($this->token); - $this->state = 'data'; - - } elseif($char === '-') { - $this->token['data'] .= '-'; - - } elseif($this->char === $this->EOF) { - $this->emitToken($this->token); - $this->char--; - $this->state = 'data'; - - } else { - $this->token['data'] .= '--'.$char; - $this->state = 'comment'; - } - } - - private function doctypeState() { - /* Consume the next input character: */ - $this->char++; - $char = $this->char(); - - if(preg_match('/^[\t\n\x0b\x0c ]$/', $char)) { - $this->state = 'beforeDoctypeName'; - - } else { - $this->char--; - $this->state = 'beforeDoctypeName'; - } - } - - private function beforeDoctypeNameState() { - /* Consume the next input character: */ - $this->char++; - $char = $this->char(); - - if(preg_match('/^[\t\n\x0b\x0c ]$/', $char)) { - // Stay in the before DOCTYPE name state. - - } elseif(preg_match('/^[a-z]$/', $char)) { - $this->token = array( - 'name' => strtoupper($char), - 'type' => self::DOCTYPE, - 'error' => true - ); - - $this->state = 'doctypeName'; - - } elseif($char === '>') { - $this->emitToken(array( - 'name' => null, - 'type' => self::DOCTYPE, - 'error' => true - )); - - $this->state = 'data'; - - } elseif($this->char === $this->EOF) { - $this->emitToken(array( - 'name' => null, - 'type' => self::DOCTYPE, - 'error' => true - )); - - $this->char--; - $this->state = 'data'; - - } else { - $this->token = array( - 'name' => $char, - 'type' => self::DOCTYPE, - 'error' => true - ); - - $this->state = 'doctypeName'; - } - } - - private function doctypeNameState() { - /* Consume the next input character: */ - $this->char++; - $char = $this->char(); - - if(preg_match('/^[\t\n\x0b\x0c ]$/', $char)) { - $this->state = 'AfterDoctypeName'; - - } elseif($char === '>') { - $this->emitToken($this->token); - $this->state = 'data'; - - } elseif(preg_match('/^[a-z]$/', $char)) { - $this->token['name'] .= strtoupper($char); - - } elseif($this->char === $this->EOF) { - $this->emitToken($this->token); - $this->char--; - $this->state = 'data'; - - } else { - $this->token['name'] .= $char; - } - - $this->token['error'] = ($this->token['name'] === 'HTML') - ? false - : true; - } - - private function afterDoctypeNameState() { - /* Consume the next input character: */ - $this->char++; - $char = $this->char(); - - if(preg_match('/^[\t\n\x0b\x0c ]$/', $char)) { - // Stay in the DOCTYPE name state. - - } elseif($char === '>') { - $this->emitToken($this->token); - $this->state = 'data'; - - } elseif($this->char === $this->EOF) { - $this->emitToken($this->token); - $this->char--; - $this->state = 'data'; - - } else { - $this->token['error'] = true; - $this->state = 'bogusDoctype'; - } - } - - private function bogusDoctypeState() { - /* Consume the next input character: */ - $this->char++; - $char = $this->char(); - - if($char === '>') { - $this->emitToken($this->token); - $this->state = 'data'; - - } elseif($this->char === $this->EOF) { - $this->emitToken($this->token); - $this->char--; - $this->state = 'data'; - - } else { - // Stay in the bogus DOCTYPE state. - } - } - - private function entity() { - $start = $this->char; - - // This section defines how to consume an entity. This definition is - // used when parsing entities in text and in attributes. - - // The behaviour depends on the identity of the next character (the - // one immediately after the U+0026 AMPERSAND character): - - switch($this->character($this->char + 1)) { - // U+0023 NUMBER SIGN (#) - case '#': - - // The behaviour further depends on the character after the - // U+0023 NUMBER SIGN: - switch($this->character($this->char + 1)) { - // U+0078 LATIN SMALL LETTER X - // U+0058 LATIN CAPITAL LETTER X - case 'x': - case 'X': - // Follow the steps below, but using the range of - // characters U+0030 DIGIT ZERO through to U+0039 DIGIT - // NINE, U+0061 LATIN SMALL LETTER A through to U+0066 - // LATIN SMALL LETTER F, and U+0041 LATIN CAPITAL LETTER - // A, through to U+0046 LATIN CAPITAL LETTER F (in other - // words, 0-9, A-F, a-f). - $char = 1; - $char_class = '0-9A-Fa-f'; - break; - - // Anything else - default: - // Follow the steps below, but using the range of - // characters U+0030 DIGIT ZERO through to U+0039 DIGIT - // NINE (i.e. just 0-9). - $char = 0; - $char_class = '0-9'; - break; - } - - // Consume as many characters as match the range of characters - // given above. - $this->char++; - $e_name = $this->characters($char_class, $this->char + $char + 1); - $entity = $this->character($start, $this->char); - $cond = strlen($e_name) > 0; - - // The rest of the parsing happens bellow. - break; - - // Anything else - default: - // Consume the maximum number of characters possible, with the - // consumed characters case-sensitively matching one of the - // identifiers in the first column of the entities table. - $e_name = $this->characters('0-9A-Za-z;', $this->char + 1); - $len = strlen($e_name); - - for($c = 1; $c <= $len; $c++) { - $id = substr($e_name, 0, $c); - $this->char++; - - if(in_array($id, $this->entities)) { - $entity = $id; - break; - } - } - - $cond = isset($entity); - // The rest of the parsing happens bellow. - break; - } - - if(!$cond) { - // If no match can be made, then this is a parse error. No - // characters are consumed, and nothing is returned. - $this->char = $start; - return false; - } - - // Return a character token for the character corresponding to the - // entity name (as given by the second column of the entities table). - return html_entity_decode('&'.$entity.';', ENT_QUOTES, 'UTF-8'); - } - - private function emitToken($token) { - $emit = $this->tree->emitToken($token); - - if(is_int($emit)) { - $this->content_model = $emit; - - } elseif($token['type'] === self::ENDTAG) { - $this->content_model = self::PCDATA; - } - } - - private function EOF() { - $this->state = null; - $this->tree->emitToken(array( - 'type' => self::EOF - )); - } -} - -class HTML5TreeConstructer { - public $stack = array(); - - private $phase; - private $mode; - private $dom; - private $foster_parent = null; - private $a_formatting = array(); - - private $head_pointer = null; - private $form_pointer = null; - - private $scoping = array('button','caption','html','marquee','object','table','td','th'); - private $formatting = array('a','b','big','em','font','i','nobr','s','small','strike','strong','tt','u'); - private $special = array('address','area','base','basefont','bgsound', - 'blockquote','body','br','center','col','colgroup','dd','dir','div','dl', - 'dt','embed','fieldset','form','frame','frameset','h1','h2','h3','h4','h5', - 'h6','head','hr','iframe','image','img','input','isindex','li','link', - 'listing','menu','meta','noembed','noframes','noscript','ol','optgroup', - 'option','p','param','plaintext','pre','script','select','spacer','style', - 'tbody','textarea','tfoot','thead','title','tr','ul','wbr'); - - // The different phases. - const INIT_PHASE = 0; - const ROOT_PHASE = 1; - const MAIN_PHASE = 2; - const END_PHASE = 3; - - // The different insertion modes for the main phase. - const BEFOR_HEAD = 0; - const IN_HEAD = 1; - const AFTER_HEAD = 2; - const IN_BODY = 3; - const IN_TABLE = 4; - const IN_CAPTION = 5; - const IN_CGROUP = 6; - const IN_TBODY = 7; - const IN_ROW = 8; - const IN_CELL = 9; - const IN_SELECT = 10; - const AFTER_BODY = 11; - const IN_FRAME = 12; - const AFTR_FRAME = 13; - - // The different types of elements. - const SPECIAL = 0; - const SCOPING = 1; - const FORMATTING = 2; - const PHRASING = 3; - - const MARKER = 0; - - public function __construct() { - $this->phase = self::INIT_PHASE; - $this->mode = self::BEFOR_HEAD; - $this->dom = new DOMDocument; - - $this->dom->encoding = 'UTF-8'; - $this->dom->preserveWhiteSpace = true; - $this->dom->substituteEntities = true; - $this->dom->strictErrorChecking = false; - } - - // Process tag tokens - public function emitToken($token) { - switch($this->phase) { - case self::INIT_PHASE: return $this->initPhase($token); break; - case self::ROOT_PHASE: return $this->rootElementPhase($token); break; - case self::MAIN_PHASE: return $this->mainPhase($token); break; - case self::END_PHASE : return $this->trailingEndPhase($token); break; - } - } - - private function initPhase($token) { - /* Initially, the tree construction stage must handle each token - emitted from the tokenisation stage as follows: */ - - /* A DOCTYPE token that is marked as being in error - A comment token - A start tag token - An end tag token - A character token that is not one of one of U+0009 CHARACTER TABULATION, - U+000A LINE FEED (LF), U+000B LINE TABULATION, U+000C FORM FEED (FF), - or U+0020 SPACE - An end-of-file token */ - if((isset($token['error']) && $token['error']) || - $token['type'] === HTML5::COMMENT || - $token['type'] === HTML5::STARTTAG || - $token['type'] === HTML5::ENDTAG || - $token['type'] === HTML5::EOF || - ($token['type'] === HTML5::CHARACTR && isset($token['data']) && - !preg_match('/^[\t\n\x0b\x0c ]+$/', $token['data']))) { - /* This specification does not define how to handle this case. In - particular, user agents may ignore the entirety of this specification - altogether for such documents, and instead invoke special parse modes - with a greater emphasis on backwards compatibility. */ - - $this->phase = self::ROOT_PHASE; - return $this->rootElementPhase($token); - - /* A DOCTYPE token marked as being correct */ - } elseif(isset($token['error']) && !$token['error']) { - /* Append a DocumentType node to the Document node, with the name - attribute set to the name given in the DOCTYPE token (which will be - "HTML"), and the other attributes specific to DocumentType objects - set to null, empty lists, or the empty string as appropriate. */ - $doctype = new DOMDocumentType(null, null, 'HTML'); - - /* Then, switch to the root element phase of the tree construction - stage. */ - $this->phase = self::ROOT_PHASE; - - /* A character token that is one of one of U+0009 CHARACTER TABULATION, - U+000A LINE FEED (LF), U+000B LINE TABULATION, U+000C FORM FEED (FF), - or U+0020 SPACE */ - } elseif(isset($token['data']) && preg_match('/^[\t\n\x0b\x0c ]+$/', - $token['data'])) { - /* Append that character to the Document node. */ - $text = $this->dom->createTextNode($token['data']); - $this->dom->appendChild($text); - } - } - - private function rootElementPhase($token) { - /* After the initial phase, as each token is emitted from the tokenisation - stage, it must be processed as described in this section. */ - - /* A DOCTYPE token */ - if($token['type'] === HTML5::DOCTYPE) { - // Parse error. Ignore the token. - - /* A comment token */ - } elseif($token['type'] === HTML5::COMMENT) { - /* Append a Comment node to the Document object with the data - attribute set to the data given in the comment token. */ - $comment = $this->dom->createComment($token['data']); - $this->dom->appendChild($comment); - - /* A character token that is one of one of U+0009 CHARACTER TABULATION, - U+000A LINE FEED (LF), U+000B LINE TABULATION, U+000C FORM FEED (FF), - or U+0020 SPACE */ - } elseif($token['type'] === HTML5::CHARACTR && - preg_match('/^[\t\n\x0b\x0c ]+$/', $token['data'])) { - /* Append that character to the Document node. */ - $text = $this->dom->createTextNode($token['data']); - $this->dom->appendChild($text); - - /* A character token that is not one of U+0009 CHARACTER TABULATION, - U+000A LINE FEED (LF), U+000B LINE TABULATION, U+000C FORM FEED - (FF), or U+0020 SPACE - A start tag token - An end tag token - An end-of-file token */ - } elseif(($token['type'] === HTML5::CHARACTR && - !preg_match('/^[\t\n\x0b\x0c ]+$/', $token['data'])) || - $token['type'] === HTML5::STARTTAG || - $token['type'] === HTML5::ENDTAG || - $token['type'] === HTML5::EOF) { - /* Create an HTMLElement node with the tag name html, in the HTML - namespace. Append it to the Document object. Switch to the main - phase and reprocess the current token. */ - $html = $this->dom->createElement('html'); - $this->dom->appendChild($html); - $this->stack[] = $html; - - $this->phase = self::MAIN_PHASE; - return $this->mainPhase($token); - } - } - - private function mainPhase($token) { - /* Tokens in the main phase must be handled as follows: */ - - /* A DOCTYPE token */ - if($token['type'] === HTML5::DOCTYPE) { - // Parse error. Ignore the token. - - /* A start tag token with the tag name "html" */ - } elseif($token['type'] === HTML5::STARTTAG && $token['name'] === 'html') { - /* If this start tag token was not the first start tag token, then - it is a parse error. */ - - /* For each attribute on the token, check to see if the attribute - is already present on the top element of the stack of open elements. - If it is not, add the attribute and its corresponding value to that - element. */ - foreach($token['attr'] as $attr) { - if(!$this->stack[0]->hasAttribute($attr['name'])) { - $this->stack[0]->setAttribute($attr['name'], $attr['value']); - } - } - - /* An end-of-file token */ - } elseif($token['type'] === HTML5::EOF) { - /* Generate implied end tags. */ - $this->generateImpliedEndTags(); - - /* Anything else. */ - } else { - /* Depends on the insertion mode: */ - switch($this->mode) { - case self::BEFOR_HEAD: return $this->beforeHead($token); break; - case self::IN_HEAD: return $this->inHead($token); break; - case self::AFTER_HEAD: return $this->afterHead($token); break; - case self::IN_BODY: return $this->inBody($token); break; - case self::IN_TABLE: return $this->inTable($token); break; - case self::IN_CAPTION: return $this->inCaption($token); break; - case self::IN_CGROUP: return $this->inColumnGroup($token); break; - case self::IN_TBODY: return $this->inTableBody($token); break; - case self::IN_ROW: return $this->inRow($token); break; - case self::IN_CELL: return $this->inCell($token); break; - case self::IN_SELECT: return $this->inSelect($token); break; - case self::AFTER_BODY: return $this->afterBody($token); break; - case self::IN_FRAME: return $this->inFrameset($token); break; - case self::AFTR_FRAME: return $this->afterFrameset($token); break; - case self::END_PHASE: return $this->trailingEndPhase($token); break; - } - } - } - - private function beforeHead($token) { - /* Handle the token as follows: */ - - /* A character token that is one of one of U+0009 CHARACTER TABULATION, - U+000A LINE FEED (LF), U+000B LINE TABULATION, U+000C FORM FEED (FF), - or U+0020 SPACE */ - if($token['type'] === HTML5::CHARACTR && - preg_match('/^[\t\n\x0b\x0c ]+$/', $token['data'])) { - /* Append the character to the current node. */ - $this->insertText($token['data']); - - /* A comment token */ - } elseif($token['type'] === HTML5::COMMENT) { - /* Append a Comment node to the current node with the data attribute - set to the data given in the comment token. */ - $this->insertComment($token['data']); - - /* A start tag token with the tag name "head" */ - } elseif($token['type'] === HTML5::STARTTAG && $token['name'] === 'head') { - /* Create an element for the token, append the new element to the - current node and push it onto the stack of open elements. */ - $element = $this->insertElement($token); - - /* Set the head element pointer to this new element node. */ - $this->head_pointer = $element; - - /* Change the insertion mode to "in head". */ - $this->mode = self::IN_HEAD; - - /* A start tag token whose tag name is one of: "base", "link", "meta", - "script", "style", "title". Or an end tag with the tag name "html". - Or a character token that is not one of U+0009 CHARACTER TABULATION, - U+000A LINE FEED (LF), U+000B LINE TABULATION, U+000C FORM FEED (FF), - or U+0020 SPACE. Or any other start tag token */ - } elseif($token['type'] === HTML5::STARTTAG || - ($token['type'] === HTML5::ENDTAG && $token['name'] === 'html') || - ($token['type'] === HTML5::CHARACTR && !preg_match('/^[\t\n\x0b\x0c ]$/', - $token['data']))) { - /* Act as if a start tag token with the tag name "head" and no - attributes had been seen, then reprocess the current token. */ - $this->beforeHead(array( - 'name' => 'head', - 'type' => HTML5::STARTTAG, - 'attr' => array() - )); - - return $this->inHead($token); - - /* Any other end tag */ - } elseif($token['type'] === HTML5::ENDTAG) { - /* Parse error. Ignore the token. */ - } - } - - private function inHead($token) { - /* Handle the token as follows: */ - - /* A character token that is one of one of U+0009 CHARACTER TABULATION, - U+000A LINE FEED (LF), U+000B LINE TABULATION, U+000C FORM FEED (FF), - or U+0020 SPACE. - - THIS DIFFERS FROM THE SPEC: If the current node is either a title, style - or script element, append the character to the current node regardless - of its content. */ - if(($token['type'] === HTML5::CHARACTR && - preg_match('/^[\t\n\x0b\x0c ]+$/', $token['data'])) || ( - $token['type'] === HTML5::CHARACTR && in_array(end($this->stack)->nodeName, - array('title', 'style', 'script')))) { - /* Append the character to the current node. */ - $this->insertText($token['data']); - - /* A comment token */ - } elseif($token['type'] === HTML5::COMMENT) { - /* Append a Comment node to the current node with the data attribute - set to the data given in the comment token. */ - $this->insertComment($token['data']); - - } elseif($token['type'] === HTML5::ENDTAG && - in_array($token['name'], array('title', 'style', 'script'))) { - array_pop($this->stack); - return HTML5::PCDATA; - - /* A start tag with the tag name "title" */ - } elseif($token['type'] === HTML5::STARTTAG && $token['name'] === 'title') { - /* Create an element for the token and append the new element to the - node pointed to by the head element pointer, or, if that is null - (innerHTML case), to the current node. */ - if($this->head_pointer !== null) { - $element = $this->insertElement($token, false); - $this->head_pointer->appendChild($element); - - } else { - $element = $this->insertElement($token); - } - - /* Switch the tokeniser's content model flag to the RCDATA state. */ - return HTML5::RCDATA; - - /* A start tag with the tag name "style" */ - } elseif($token['type'] === HTML5::STARTTAG && $token['name'] === 'style') { - /* Create an element for the token and append the new element to the - node pointed to by the head element pointer, or, if that is null - (innerHTML case), to the current node. */ - if($this->head_pointer !== null) { - $element = $this->insertElement($token, false); - $this->head_pointer->appendChild($element); - - } else { - $this->insertElement($token); - } - - /* Switch the tokeniser's content model flag to the CDATA state. */ - return HTML5::CDATA; - - /* A start tag with the tag name "script" */ - } elseif($token['type'] === HTML5::STARTTAG && $token['name'] === 'script') { - /* Create an element for the token. */ - $element = $this->insertElement($token, false); - $this->head_pointer->appendChild($element); - - /* Switch the tokeniser's content model flag to the CDATA state. */ - return HTML5::CDATA; - - /* A start tag with the tag name "base", "link", or "meta" */ - } elseif($token['type'] === HTML5::STARTTAG && in_array($token['name'], - array('base', 'link', 'meta'))) { - /* Create an element for the token and append the new element to the - node pointed to by the head element pointer, or, if that is null - (innerHTML case), to the current node. */ - if($this->head_pointer !== null) { - $element = $this->insertElement($token, false); - $this->head_pointer->appendChild($element); - array_pop($this->stack); - - } else { - $this->insertElement($token); - } - - /* An end tag with the tag name "head" */ - } elseif($token['type'] === HTML5::ENDTAG && $token['name'] === 'head') { - /* If the current node is a head element, pop the current node off - the stack of open elements. */ - if($this->head_pointer->isSameNode(end($this->stack))) { - array_pop($this->stack); - - /* Otherwise, this is a parse error. */ - } else { - // k - } - - /* Change the insertion mode to "after head". */ - $this->mode = self::AFTER_HEAD; - - /* A start tag with the tag name "head" or an end tag except "html". */ - } elseif(($token['type'] === HTML5::STARTTAG && $token['name'] === 'head') || - ($token['type'] === HTML5::ENDTAG && $token['name'] !== 'html')) { - // Parse error. Ignore the token. - - /* Anything else */ - } else { - /* If the current node is a head element, act as if an end tag - token with the tag name "head" had been seen. */ - if($this->head_pointer->isSameNode(end($this->stack))) { - $this->inHead(array( - 'name' => 'head', - 'type' => HTML5::ENDTAG - )); - - /* Otherwise, change the insertion mode to "after head". */ - } else { - $this->mode = self::AFTER_HEAD; - } - - /* Then, reprocess the current token. */ - return $this->afterHead($token); - } - } - - private function afterHead($token) { - /* Handle the token as follows: */ - - /* A character token that is one of one of U+0009 CHARACTER TABULATION, - U+000A LINE FEED (LF), U+000B LINE TABULATION, U+000C FORM FEED (FF), - or U+0020 SPACE */ - if($token['type'] === HTML5::CHARACTR && - preg_match('/^[\t\n\x0b\x0c ]+$/', $token['data'])) { - /* Append the character to the current node. */ - $this->insertText($token['data']); - - /* A comment token */ - } elseif($token['type'] === HTML5::COMMENT) { - /* Append a Comment node to the current node with the data attribute - set to the data given in the comment token. */ - $this->insertComment($token['data']); - - /* A start tag token with the tag name "body" */ - } elseif($token['type'] === HTML5::STARTTAG && $token['name'] === 'body') { - /* Insert a body element for the token. */ - $this->insertElement($token); - - /* Change the insertion mode to "in body". */ - $this->mode = self::IN_BODY; - - /* A start tag token with the tag name "frameset" */ - } elseif($token['type'] === HTML5::STARTTAG && $token['name'] === 'frameset') { - /* Insert a frameset element for the token. */ - $this->insertElement($token); - - /* Change the insertion mode to "in frameset". */ - $this->mode = self::IN_FRAME; - - /* A start tag token whose tag name is one of: "base", "link", "meta", - "script", "style", "title" */ - } elseif($token['type'] === HTML5::STARTTAG && in_array($token['name'], - array('base', 'link', 'meta', 'script', 'style', 'title'))) { - /* Parse error. Switch the insertion mode back to "in head" and - reprocess the token. */ - $this->mode = self::IN_HEAD; - return $this->inHead($token); - - /* Anything else */ - } else { - /* Act as if a start tag token with the tag name "body" and no - attributes had been seen, and then reprocess the current token. */ - $this->afterHead(array( - 'name' => 'body', - 'type' => HTML5::STARTTAG, - 'attr' => array() - )); - - return $this->inBody($token); - } - } - - private function inBody($token) { - /* Handle the token as follows: */ - - switch($token['type']) { - /* A character token */ - case HTML5::CHARACTR: - /* Reconstruct the active formatting elements, if any. */ - $this->reconstructActiveFormattingElements(); - - /* Append the token's character to the current node. */ - $this->insertText($token['data']); - break; - - /* A comment token */ - case HTML5::COMMENT: - /* Append a Comment node to the current node with the data - attribute set to the data given in the comment token. */ - $this->insertComment($token['data']); - break; - - case HTML5::STARTTAG: - switch($token['name']) { - /* A start tag token whose tag name is one of: "script", - "style" */ - case 'script': case 'style': - /* Process the token as if the insertion mode had been "in - head". */ - return $this->inHead($token); - break; - - /* A start tag token whose tag name is one of: "base", "link", - "meta", "title" */ - case 'base': case 'link': case 'meta': case 'title': - /* Parse error. Process the token as if the insertion mode - had been "in head". */ - return $this->inHead($token); - break; - - /* A start tag token with the tag name "body" */ - case 'body': - /* Parse error. If the second element on the stack of open - elements is not a body element, or, if the stack of open - elements has only one node on it, then ignore the token. - (innerHTML case) */ - if(count($this->stack) === 1 || $this->stack[1]->nodeName !== 'body') { - // Ignore - - /* Otherwise, for each attribute on the token, check to see - if the attribute is already present on the body element (the - second element) on the stack of open elements. If it is not, - add the attribute and its corresponding value to that - element. */ - } else { - foreach($token['attr'] as $attr) { - if(!$this->stack[1]->hasAttribute($attr['name'])) { - $this->stack[1]->setAttribute($attr['name'], $attr['value']); - } - } - } - break; - - /* A start tag whose tag name is one of: "address", - "blockquote", "center", "dir", "div", "dl", "fieldset", - "listing", "menu", "ol", "p", "ul" */ - case 'address': case 'blockquote': case 'center': case 'dir': - case 'div': case 'dl': case 'fieldset': case 'listing': - case 'menu': case 'ol': case 'p': case 'ul': - /* If the stack of open elements has a p element in scope, - then act as if an end tag with the tag name p had been - seen. */ - if($this->elementInScope('p')) { - $this->emitToken(array( - 'name' => 'p', - 'type' => HTML5::ENDTAG - )); - } - - /* Insert an HTML element for the token. */ - $this->insertElement($token); - break; - - /* A start tag whose tag name is "form" */ - case 'form': - /* If the form element pointer is not null, ignore the - token with a parse error. */ - if($this->form_pointer !== null) { - // Ignore. - - /* Otherwise: */ - } else { - /* If the stack of open elements has a p element in - scope, then act as if an end tag with the tag name p - had been seen. */ - if($this->elementInScope('p')) { - $this->emitToken(array( - 'name' => 'p', - 'type' => HTML5::ENDTAG - )); - } - - /* Insert an HTML element for the token, and set the - form element pointer to point to the element created. */ - $element = $this->insertElement($token); - $this->form_pointer = $element; - } - break; - - /* A start tag whose tag name is "li", "dd" or "dt" */ - case 'li': case 'dd': case 'dt': - /* If the stack of open elements has a p element in scope, - then act as if an end tag with the tag name p had been - seen. */ - if($this->elementInScope('p')) { - $this->emitToken(array( - 'name' => 'p', - 'type' => HTML5::ENDTAG - )); - } - - $stack_length = count($this->stack) - 1; - - for($n = $stack_length; 0 <= $n; $n--) { - /* 1. Initialise node to be the current node (the - bottommost node of the stack). */ - $stop = false; - $node = $this->stack[$n]; - $cat = $this->getElementCategory($node->tagName); - - /* 2. If node is an li, dd or dt element, then pop all - the nodes from the current node up to node, including - node, then stop this algorithm. */ - if($token['name'] === $node->tagName || ($token['name'] !== 'li' - && ($node->tagName === 'dd' || $node->tagName === 'dt'))) { - for($x = $stack_length; $x >= $n ; $x--) { - array_pop($this->stack); - } - - break; - } - - /* 3. If node is not in the formatting category, and is - not in the phrasing category, and is not an address or - div element, then stop this algorithm. */ - if($cat !== self::FORMATTING && $cat !== self::PHRASING && - $node->tagName !== 'address' && $node->tagName !== 'div') { - break; - } - } - - /* Finally, insert an HTML element with the same tag - name as the token's. */ - $this->insertElement($token); - break; - - /* A start tag token whose tag name is "plaintext" */ - case 'plaintext': - /* If the stack of open elements has a p element in scope, - then act as if an end tag with the tag name p had been - seen. */ - if($this->elementInScope('p')) { - $this->emitToken(array( - 'name' => 'p', - 'type' => HTML5::ENDTAG - )); - } - - /* Insert an HTML element for the token. */ - $this->insertElement($token); - - return HTML5::PLAINTEXT; - break; - - /* A start tag whose tag name is one of: "h1", "h2", "h3", "h4", - "h5", "h6" */ - case 'h1': case 'h2': case 'h3': case 'h4': case 'h5': case 'h6': - /* If the stack of open elements has a p element in scope, - then act as if an end tag with the tag name p had been seen. */ - if($this->elementInScope('p')) { - $this->emitToken(array( - 'name' => 'p', - 'type' => HTML5::ENDTAG - )); - } - - /* If the stack of open elements has in scope an element whose - tag name is one of "h1", "h2", "h3", "h4", "h5", or "h6", then - this is a parse error; pop elements from the stack until an - element with one of those tag names has been popped from the - stack. */ - while($this->elementInScope(array('h1', 'h2', 'h3', 'h4', 'h5', 'h6'))) { - array_pop($this->stack); - } - - /* Insert an HTML element for the token. */ - $this->insertElement($token); - break; - - /* A start tag whose tag name is "a" */ - case 'a': - /* If the list of active formatting elements contains - an element whose tag name is "a" between the end of the - list and the last marker on the list (or the start of - the list if there is no marker on the list), then this - is a parse error; act as if an end tag with the tag name - "a" had been seen, then remove that element from the list - of active formatting elements and the stack of open - elements if the end tag didn't already remove it (it - might not have if the element is not in table scope). */ - $leng = count($this->a_formatting); - - for($n = $leng - 1; $n >= 0; $n--) { - if($this->a_formatting[$n] === self::MARKER) { - break; - - } elseif($this->a_formatting[$n]->nodeName === 'a') { - $this->emitToken(array( - 'name' => 'a', - 'type' => HTML5::ENDTAG - )); - break; - } - } - - /* Reconstruct the active formatting elements, if any. */ - $this->reconstructActiveFormattingElements(); - - /* Insert an HTML element for the token. */ - $el = $this->insertElement($token); - - /* Add that element to the list of active formatting - elements. */ - $this->a_formatting[] = $el; - break; - - /* A start tag whose tag name is one of: "b", "big", "em", "font", - "i", "nobr", "s", "small", "strike", "strong", "tt", "u" */ - case 'b': case 'big': case 'em': case 'font': case 'i': - case 'nobr': case 's': case 'small': case 'strike': - case 'strong': case 'tt': case 'u': - /* Reconstruct the active formatting elements, if any. */ - $this->reconstructActiveFormattingElements(); - - /* Insert an HTML element for the token. */ - $el = $this->insertElement($token); - - /* Add that element to the list of active formatting - elements. */ - $this->a_formatting[] = $el; - break; - - /* A start tag token whose tag name is "button" */ - case 'button': - /* If the stack of open elements has a button element in scope, - then this is a parse error; act as if an end tag with the tag - name "button" had been seen, then reprocess the token. (We don't - do that. Unnecessary.) */ - if($this->elementInScope('button')) { - $this->inBody(array( - 'name' => 'button', - 'type' => HTML5::ENDTAG - )); - } - - /* Reconstruct the active formatting elements, if any. */ - $this->reconstructActiveFormattingElements(); - - /* Insert an HTML element for the token. */ - $this->insertElement($token); - - /* Insert a marker at the end of the list of active - formatting elements. */ - $this->a_formatting[] = self::MARKER; - break; - - /* A start tag token whose tag name is one of: "marquee", "object" */ - case 'marquee': case 'object': - /* Reconstruct the active formatting elements, if any. */ - $this->reconstructActiveFormattingElements(); - - /* Insert an HTML element for the token. */ - $this->insertElement($token); - - /* Insert a marker at the end of the list of active - formatting elements. */ - $this->a_formatting[] = self::MARKER; - break; - - /* A start tag token whose tag name is "xmp" */ - case 'xmp': - /* Reconstruct the active formatting elements, if any. */ - $this->reconstructActiveFormattingElements(); - - /* Insert an HTML element for the token. */ - $this->insertElement($token); - - /* Switch the content model flag to the CDATA state. */ - return HTML5::CDATA; - break; - - /* A start tag whose tag name is "table" */ - case 'table': - /* If the stack of open elements has a p element in scope, - then act as if an end tag with the tag name p had been seen. */ - if($this->elementInScope('p')) { - $this->emitToken(array( - 'name' => 'p', - 'type' => HTML5::ENDTAG - )); - } - - /* Insert an HTML element for the token. */ - $this->insertElement($token); - - /* Change the insertion mode to "in table". */ - $this->mode = self::IN_TABLE; - break; - - /* A start tag whose tag name is one of: "area", "basefont", - "bgsound", "br", "embed", "img", "param", "spacer", "wbr" */ - case 'area': case 'basefont': case 'bgsound': case 'br': - case 'embed': case 'img': case 'param': case 'spacer': - case 'wbr': - /* Reconstruct the active formatting elements, if any. */ - $this->reconstructActiveFormattingElements(); - - /* Insert an HTML element for the token. */ - $this->insertElement($token); - - /* Immediately pop the current node off the stack of open elements. */ - array_pop($this->stack); - break; - - /* A start tag whose tag name is "hr" */ - case 'hr': - /* If the stack of open elements has a p element in scope, - then act as if an end tag with the tag name p had been seen. */ - if($this->elementInScope('p')) { - $this->emitToken(array( - 'name' => 'p', - 'type' => HTML5::ENDTAG - )); - } - - /* Insert an HTML element for the token. */ - $this->insertElement($token); - - /* Immediately pop the current node off the stack of open elements. */ - array_pop($this->stack); - break; - - /* A start tag whose tag name is "image" */ - case 'image': - /* Parse error. Change the token's tag name to "img" and - reprocess it. (Don't ask.) */ - $token['name'] = 'img'; - return $this->inBody($token); - break; - - /* A start tag whose tag name is "input" */ - case 'input': - /* Reconstruct the active formatting elements, if any. */ - $this->reconstructActiveFormattingElements(); - - /* Insert an input element for the token. */ - $element = $this->insertElement($token, false); - - /* If the form element pointer is not null, then associate the - input element with the form element pointed to by the form - element pointer. */ - $this->form_pointer !== null - ? $this->form_pointer->appendChild($element) - : end($this->stack)->appendChild($element); - - /* Pop that input element off the stack of open elements. */ - array_pop($this->stack); - break; - - /* A start tag whose tag name is "isindex" */ - case 'isindex': - /* Parse error. */ - // w/e - - /* If the form element pointer is not null, - then ignore the token. */ - if($this->form_pointer === null) { - /* Act as if a start tag token with the tag name "form" had - been seen. */ - $this->inBody(array( - 'name' => 'body', - 'type' => HTML5::STARTTAG, - 'attr' => array() - )); - - /* Act as if a start tag token with the tag name "hr" had - been seen. */ - $this->inBody(array( - 'name' => 'hr', - 'type' => HTML5::STARTTAG, - 'attr' => array() - )); - - /* Act as if a start tag token with the tag name "p" had - been seen. */ - $this->inBody(array( - 'name' => 'p', - 'type' => HTML5::STARTTAG, - 'attr' => array() - )); - - /* Act as if a start tag token with the tag name "label" - had been seen. */ - $this->inBody(array( - 'name' => 'label', - 'type' => HTML5::STARTTAG, - 'attr' => array() - )); - - /* Act as if a stream of character tokens had been seen. */ - $this->insertText('This is a searchable index. '. - 'Insert your search keywords here: '); - - /* Act as if a start tag token with the tag name "input" - had been seen, with all the attributes from the "isindex" - token, except with the "name" attribute set to the value - "isindex" (ignoring any explicit "name" attribute). */ - $attr = $token['attr']; - $attr[] = array('name' => 'name', 'value' => 'isindex'); - - $this->inBody(array( - 'name' => 'input', - 'type' => HTML5::STARTTAG, - 'attr' => $attr - )); - - /* Act as if a stream of character tokens had been seen - (see below for what they should say). */ - $this->insertText('This is a searchable index. '. - 'Insert your search keywords here: '); - - /* Act as if an end tag token with the tag name "label" - had been seen. */ - $this->inBody(array( - 'name' => 'label', - 'type' => HTML5::ENDTAG - )); - - /* Act as if an end tag token with the tag name "p" had - been seen. */ - $this->inBody(array( - 'name' => 'p', - 'type' => HTML5::ENDTAG - )); - - /* Act as if a start tag token with the tag name "hr" had - been seen. */ - $this->inBody(array( - 'name' => 'hr', - 'type' => HTML5::ENDTAG - )); - - /* Act as if an end tag token with the tag name "form" had - been seen. */ - $this->inBody(array( - 'name' => 'form', - 'type' => HTML5::ENDTAG - )); - } - break; - - /* A start tag whose tag name is "textarea" */ - case 'textarea': - $this->insertElement($token); - - /* Switch the tokeniser's content model flag to the - RCDATA state. */ - return HTML5::RCDATA; - break; - - /* A start tag whose tag name is one of: "iframe", "noembed", - "noframes" */ - case 'iframe': case 'noembed': case 'noframes': - $this->insertElement($token); - - /* Switch the tokeniser's content model flag to the CDATA state. */ - return HTML5::CDATA; - break; - - /* A start tag whose tag name is "select" */ - case 'select': - /* Reconstruct the active formatting elements, if any. */ - $this->reconstructActiveFormattingElements(); - - /* Insert an HTML element for the token. */ - $this->insertElement($token); - - /* Change the insertion mode to "in select". */ - $this->mode = self::IN_SELECT; - break; - - /* A start or end tag whose tag name is one of: "caption", "col", - "colgroup", "frame", "frameset", "head", "option", "optgroup", - "tbody", "td", "tfoot", "th", "thead", "tr". */ - case 'caption': case 'col': case 'colgroup': case 'frame': - case 'frameset': case 'head': case 'option': case 'optgroup': - case 'tbody': case 'td': case 'tfoot': case 'th': case 'thead': - case 'tr': - // Parse error. Ignore the token. - break; - - /* A start or end tag whose tag name is one of: "event-source", - "section", "nav", "article", "aside", "header", "footer", - "datagrid", "command" */ - case 'event-source': case 'section': case 'nav': case 'article': - case 'aside': case 'header': case 'footer': case 'datagrid': - case 'command': - // Work in progress! - break; - - /* A start tag token not covered by the previous entries */ - default: - /* Reconstruct the active formatting elements, if any. */ - $this->reconstructActiveFormattingElements(); - - $this->insertElement($token); - break; - } - break; - - case HTML5::ENDTAG: - switch($token['name']) { - /* An end tag with the tag name "body" */ - case 'body': - /* If the second element in the stack of open elements is - not a body element, this is a parse error. Ignore the token. - (innerHTML case) */ - if(count($this->stack) < 2 || $this->stack[1]->nodeName !== 'body') { - // Ignore. - - /* If the current node is not the body element, then this - is a parse error. */ - } elseif(end($this->stack)->nodeName !== 'body') { - // Parse error. - } - - /* Change the insertion mode to "after body". */ - $this->mode = self::AFTER_BODY; - break; - - /* An end tag with the tag name "html" */ - case 'html': - /* Act as if an end tag with tag name "body" had been seen, - then, if that token wasn't ignored, reprocess the current - token. */ - $this->inBody(array( - 'name' => 'body', - 'type' => HTML5::ENDTAG - )); - - return $this->afterBody($token); - break; - - /* An end tag whose tag name is one of: "address", "blockquote", - "center", "dir", "div", "dl", "fieldset", "listing", "menu", - "ol", "pre", "ul" */ - case 'address': case 'blockquote': case 'center': case 'dir': - case 'div': case 'dl': case 'fieldset': case 'listing': - case 'menu': case 'ol': case 'pre': case 'ul': - /* If the stack of open elements has an element in scope - with the same tag name as that of the token, then generate - implied end tags. */ - if($this->elementInScope($token['name'])) { - $this->generateImpliedEndTags(); - - /* Now, if the current node is not an element with - the same tag name as that of the token, then this - is a parse error. */ - // w/e - - /* If the stack of open elements has an element in - scope with the same tag name as that of the token, - then pop elements from this stack until an element - with that tag name has been popped from the stack. */ - for($n = count($this->stack) - 1; $n >= 0; $n--) { - if($this->stack[$n]->nodeName === $token['name']) { - $n = -1; - } - - array_pop($this->stack); - } - } - break; - - /* An end tag whose tag name is "form" */ - case 'form': - /* If the stack of open elements has an element in scope - with the same tag name as that of the token, then generate - implied end tags. */ - if($this->elementInScope($token['name'])) { - $this->generateImpliedEndTags(); - - } - - if(end($this->stack)->nodeName !== $token['name']) { - /* Now, if the current node is not an element with the - same tag name as that of the token, then this is a parse - error. */ - // w/e - - } else { - /* Otherwise, if the current node is an element with - the same tag name as that of the token pop that element - from the stack. */ - array_pop($this->stack); - } - - /* In any case, set the form element pointer to null. */ - $this->form_pointer = null; - break; - - /* An end tag whose tag name is "p" */ - case 'p': - /* If the stack of open elements has a p element in scope, - then generate implied end tags, except for p elements. */ - if($this->elementInScope('p')) { - $this->generateImpliedEndTags(array('p')); - - /* If the current node is not a p element, then this is - a parse error. */ - // k - - /* If the stack of open elements has a p element in - scope, then pop elements from this stack until the stack - no longer has a p element in scope. */ - for($n = count($this->stack) - 1; $n >= 0; $n--) { - if($this->elementInScope('p')) { - array_pop($this->stack); - - } else { - break; - } - } - } - break; - - /* An end tag whose tag name is "dd", "dt", or "li" */ - case 'dd': case 'dt': case 'li': - /* If the stack of open elements has an element in scope - whose tag name matches the tag name of the token, then - generate implied end tags, except for elements with the - same tag name as the token. */ - if($this->elementInScope($token['name'])) { - $this->generateImpliedEndTags(array($token['name'])); - - /* If the current node is not an element with the same - tag name as the token, then this is a parse error. */ - // w/e - - /* If the stack of open elements has an element in scope - whose tag name matches the tag name of the token, then - pop elements from this stack until an element with that - tag name has been popped from the stack. */ - for($n = count($this->stack) - 1; $n >= 0; $n--) { - if($this->stack[$n]->nodeName === $token['name']) { - $n = -1; - } - - array_pop($this->stack); - } - } - break; - - /* An end tag whose tag name is one of: "h1", "h2", "h3", "h4", - "h5", "h6" */ - case 'h1': case 'h2': case 'h3': case 'h4': case 'h5': case 'h6': - $elements = array('h1', 'h2', 'h3', 'h4', 'h5', 'h6'); - - /* If the stack of open elements has in scope an element whose - tag name is one of "h1", "h2", "h3", "h4", "h5", or "h6", then - generate implied end tags. */ - if($this->elementInScope($elements)) { - $this->generateImpliedEndTags(); - - /* Now, if the current node is not an element with the same - tag name as that of the token, then this is a parse error. */ - // w/e - - /* If the stack of open elements has in scope an element - whose tag name is one of "h1", "h2", "h3", "h4", "h5", or - "h6", then pop elements from the stack until an element - with one of those tag names has been popped from the stack. */ - while($this->elementInScope($elements)) { - array_pop($this->stack); - } - } - break; - - /* An end tag whose tag name is one of: "a", "b", "big", "em", - "font", "i", "nobr", "s", "small", "strike", "strong", "tt", "u" */ - case 'a': case 'b': case 'big': case 'em': case 'font': - case 'i': case 'nobr': case 's': case 'small': case 'strike': - case 'strong': case 'tt': case 'u': - /* 1. Let the formatting element be the last element in - the list of active formatting elements that: - * is between the end of the list and the last scope - marker in the list, if any, or the start of the list - otherwise, and - * has the same tag name as the token. - */ - while(true) { - for($a = count($this->a_formatting) - 1; $a >= 0; $a--) { - if($this->a_formatting[$a] === self::MARKER) { - break; - - } elseif($this->a_formatting[$a]->tagName === $token['name']) { - $formatting_element = $this->a_formatting[$a]; - $in_stack = in_array($formatting_element, $this->stack, true); - $fe_af_pos = $a; - break; - } - } - - /* If there is no such node, or, if that node is - also in the stack of open elements but the element - is not in scope, then this is a parse error. Abort - these steps. The token is ignored. */ - if(!isset($formatting_element) || ($in_stack && - !$this->elementInScope($token['name']))) { - break; - - /* Otherwise, if there is such a node, but that node - is not in the stack of open elements, then this is a - parse error; remove the element from the list, and - abort these steps. */ - } elseif(isset($formatting_element) && !$in_stack) { - unset($this->a_formatting[$fe_af_pos]); - $this->a_formatting = array_merge($this->a_formatting); - break; - } - - /* 2. Let the furthest block be the topmost node in the - stack of open elements that is lower in the stack - than the formatting element, and is not an element in - the phrasing or formatting categories. There might - not be one. */ - $fe_s_pos = array_search($formatting_element, $this->stack, true); - $length = count($this->stack); - - for($s = $fe_s_pos + 1; $s < $length; $s++) { - $category = $this->getElementCategory($this->stack[$s]->nodeName); - - if($category !== self::PHRASING && $category !== self::FORMATTING) { - $furthest_block = $this->stack[$s]; - } - } - - /* 3. If there is no furthest block, then the UA must - skip the subsequent steps and instead just pop all - the nodes from the bottom of the stack of open - elements, from the current node up to the formatting - element, and remove the formatting element from the - list of active formatting elements. */ - if(!isset($furthest_block)) { - for($n = $length - 1; $n >= $fe_s_pos; $n--) { - array_pop($this->stack); - } - - unset($this->a_formatting[$fe_af_pos]); - $this->a_formatting = array_merge($this->a_formatting); - break; - } - - /* 4. Let the common ancestor be the element - immediately above the formatting element in the stack - of open elements. */ - $common_ancestor = $this->stack[$fe_s_pos - 1]; - - /* 5. If the furthest block has a parent node, then - remove the furthest block from its parent node. */ - if($furthest_block->parentNode !== null) { - $furthest_block->parentNode->removeChild($furthest_block); - } - - /* 6. Let a bookmark note the position of the - formatting element in the list of active formatting - elements relative to the elements on either side - of it in the list. */ - $bookmark = $fe_af_pos; - - /* 7. Let node and last node be the furthest block. - Follow these steps: */ - $node = $furthest_block; - $last_node = $furthest_block; - - while(true) { - for($n = array_search($node, $this->stack, true) - 1; $n >= 0; $n--) { - /* 7.1 Let node be the element immediately - prior to node in the stack of open elements. */ - $node = $this->stack[$n]; - - /* 7.2 If node is not in the list of active - formatting elements, then remove node from - the stack of open elements and then go back - to step 1. */ - if(!in_array($node, $this->a_formatting, true)) { - unset($this->stack[$n]); - $this->stack = array_merge($this->stack); - - } else { - break; - } - } - - /* 7.3 Otherwise, if node is the formatting - element, then go to the next step in the overall - algorithm. */ - if($node === $formatting_element) { - break; - - /* 7.4 Otherwise, if last node is the furthest - block, then move the aforementioned bookmark to - be immediately after the node in the list of - active formatting elements. */ - } elseif($last_node === $furthest_block) { - $bookmark = array_search($node, $this->a_formatting, true) + 1; - } - - /* 7.5 If node has any children, perform a - shallow clone of node, replace the entry for - node in the list of active formatting elements - with an entry for the clone, replace the entry - for node in the stack of open elements with an - entry for the clone, and let node be the clone. */ - if($node->hasChildNodes()) { - $clone = $node->cloneNode(); - $s_pos = array_search($node, $this->stack, true); - $a_pos = array_search($node, $this->a_formatting, true); - - $this->stack[$s_pos] = $clone; - $this->a_formatting[$a_pos] = $clone; - $node = $clone; - } - - /* 7.6 Insert last node into node, first removing - it from its previous parent node if any. */ - if($last_node->parentNode !== null) { - $last_node->parentNode->removeChild($last_node); - } - - $node->appendChild($last_node); - - /* 7.7 Let last node be node. */ - $last_node = $node; - } - - /* 8. Insert whatever last node ended up being in - the previous step into the common ancestor node, - first removing it from its previous parent node if - any. */ - if($last_node->parentNode !== null) { - $last_node->parentNode->removeChild($last_node); - } - - $common_ancestor->appendChild($last_node); - - /* 9. Perform a shallow clone of the formatting - element. */ - $clone = $formatting_element->cloneNode(); - - /* 10. Take all of the child nodes of the furthest - block and append them to the clone created in the - last step. */ - while($furthest_block->hasChildNodes()) { - $child = $furthest_block->firstChild; - $furthest_block->removeChild($child); - $clone->appendChild($child); - } - - /* 11. Append that clone to the furthest block. */ - $furthest_block->appendChild($clone); - - /* 12. Remove the formatting element from the list - of active formatting elements, and insert the clone - into the list of active formatting elements at the - position of the aforementioned bookmark. */ - $fe_af_pos = array_search($formatting_element, $this->a_formatting, true); - unset($this->a_formatting[$fe_af_pos]); - $this->a_formatting = array_merge($this->a_formatting); - - $af_part1 = array_slice($this->a_formatting, 0, $bookmark - 1); - $af_part2 = array_slice($this->a_formatting, $bookmark, count($this->a_formatting)); - $this->a_formatting = array_merge($af_part1, array($clone), $af_part2); - - /* 13. Remove the formatting element from the stack - of open elements, and insert the clone into the stack - of open elements immediately after (i.e. in a more - deeply nested position than) the position of the - furthest block in that stack. */ - $fe_s_pos = array_search($formatting_element, $this->stack, true); - $fb_s_pos = array_search($furthest_block, $this->stack, true); - unset($this->stack[$fe_s_pos]); - - $s_part1 = array_slice($this->stack, 0, $fb_s_pos); - $s_part2 = array_slice($this->stack, $fb_s_pos + 1, count($this->stack)); - $this->stack = array_merge($s_part1, array($clone), $s_part2); - - /* 14. Jump back to step 1 in this series of steps. */ - unset($formatting_element, $fe_af_pos, $fe_s_pos, $furthest_block); - } - break; - - /* An end tag token whose tag name is one of: "button", - "marquee", "object" */ - case 'button': case 'marquee': case 'object': - /* If the stack of open elements has an element in scope whose - tag name matches the tag name of the token, then generate implied - tags. */ - if($this->elementInScope($token['name'])) { - $this->generateImpliedEndTags(); - - /* Now, if the current node is not an element with the same - tag name as the token, then this is a parse error. */ - // k - - /* Now, if the stack of open elements has an element in scope - whose tag name matches the tag name of the token, then pop - elements from the stack until that element has been popped from - the stack, and clear the list of active formatting elements up - to the last marker. */ - for($n = count($this->stack) - 1; $n >= 0; $n--) { - if($this->stack[$n]->nodeName === $token['name']) { - $n = -1; - } - - array_pop($this->stack); - } - - $marker = end(array_keys($this->a_formatting, self::MARKER, true)); - - for($n = count($this->a_formatting) - 1; $n > $marker; $n--) { - array_pop($this->a_formatting); - } - } - break; - - /* Or an end tag whose tag name is one of: "area", "basefont", - "bgsound", "br", "embed", "hr", "iframe", "image", "img", - "input", "isindex", "noembed", "noframes", "param", "select", - "spacer", "table", "textarea", "wbr" */ - case 'area': case 'basefont': case 'bgsound': case 'br': - case 'embed': case 'hr': case 'iframe': case 'image': - case 'img': case 'input': case 'isindex': case 'noembed': - case 'noframes': case 'param': case 'select': case 'spacer': - case 'table': case 'textarea': case 'wbr': - // Parse error. Ignore the token. - break; - - /* An end tag token not covered by the previous entries */ - default: - for($n = count($this->stack) - 1; $n >= 0; $n--) { - /* Initialise node to be the current node (the bottommost - node of the stack). */ - $node = end($this->stack); - - /* If node has the same tag name as the end tag token, - then: */ - if($token['name'] === $node->nodeName) { - /* Generate implied end tags. */ - $this->generateImpliedEndTags(); - - /* If the tag name of the end tag token does not - match the tag name of the current node, this is a - parse error. */ - // k - - /* Pop all the nodes from the current node up to - node, including node, then stop this algorithm. */ - for($x = count($this->stack) - $n; $x >= $n; $x--) { - array_pop($this->stack); - } - - } else { - $category = $this->getElementCategory($node); - - if($category !== self::SPECIAL && $category !== self::SCOPING) { - /* Otherwise, if node is in neither the formatting - category nor the phrasing category, then this is a - parse error. Stop this algorithm. The end tag token - is ignored. */ - return false; - } - } - } - break; - } - break; - } - } - - private function inTable($token) { - $clear = array('html', 'table'); - - /* A character token that is one of one of U+0009 CHARACTER TABULATION, - U+000A LINE FEED (LF), U+000B LINE TABULATION, U+000C FORM FEED (FF), - or U+0020 SPACE */ - if($token['type'] === HTML5::CHARACTR && - preg_match('/^[\t\n\x0b\x0c ]+$/', $token['data'])) { - /* Append the character to the current node. */ - $text = $this->dom->createTextNode($token['data']); - end($this->stack)->appendChild($text); - - /* A comment token */ - } elseif($token['type'] === HTML5::COMMENT) { - /* Append a Comment node to the current node with the data - attribute set to the data given in the comment token. */ - $comment = $this->dom->createComment($token['data']); - end($this->stack)->appendChild($comment); - - /* A start tag whose tag name is "caption" */ - } elseif($token['type'] === HTML5::STARTTAG && - $token['name'] === 'caption') { - /* Clear the stack back to a table context. */ - $this->clearStackToTableContext($clear); - - /* Insert a marker at the end of the list of active - formatting elements. */ - $this->a_formatting[] = self::MARKER; - - /* Insert an HTML element for the token, then switch the - insertion mode to "in caption". */ - $this->insertElement($token); - $this->mode = self::IN_CAPTION; - - /* A start tag whose tag name is "colgroup" */ - } elseif($token['type'] === HTML5::STARTTAG && - $token['name'] === 'colgroup') { - /* Clear the stack back to a table context. */ - $this->clearStackToTableContext($clear); - - /* Insert an HTML element for the token, then switch the - insertion mode to "in column group". */ - $this->insertElement($token); - $this->mode = self::IN_CGROUP; - - /* A start tag whose tag name is "col" */ - } elseif($token['type'] === HTML5::STARTTAG && - $token['name'] === 'col') { - $this->inTable(array( - 'name' => 'colgroup', - 'type' => HTML5::STARTTAG, - 'attr' => array() - )); - - $this->inColumnGroup($token); - - /* A start tag whose tag name is one of: "tbody", "tfoot", "thead" */ - } elseif($token['type'] === HTML5::STARTTAG && in_array($token['name'], - array('tbody', 'tfoot', 'thead'))) { - /* Clear the stack back to a table context. */ - $this->clearStackToTableContext($clear); - - /* Insert an HTML element for the token, then switch the insertion - mode to "in table body". */ - $this->insertElement($token); - $this->mode = self::IN_TBODY; - - /* A start tag whose tag name is one of: "td", "th", "tr" */ - } elseif($token['type'] === HTML5::STARTTAG && - in_array($token['name'], array('td', 'th', 'tr'))) { - /* Act as if a start tag token with the tag name "tbody" had been - seen, then reprocess the current token. */ - $this->inTable(array( - 'name' => 'tbody', - 'type' => HTML5::STARTTAG, - 'attr' => array() - )); - - return $this->inTableBody($token); - - /* A start tag whose tag name is "table" */ - } elseif($token['type'] === HTML5::STARTTAG && - $token['name'] === 'table') { - /* Parse error. Act as if an end tag token with the tag name "table" - had been seen, then, if that token wasn't ignored, reprocess the - current token. */ - $this->inTable(array( - 'name' => 'table', - 'type' => HTML5::ENDTAG - )); - - return $this->mainPhase($token); - - /* An end tag whose tag name is "table" */ - } elseif($token['type'] === HTML5::ENDTAG && - $token['name'] === 'table') { - /* If the stack of open elements does not have an element in table - scope with the same tag name as the token, this is a parse error. - Ignore the token. (innerHTML case) */ - if(!$this->elementInScope($token['name'], true)) { - return false; - - /* Otherwise: */ - } else { - /* Generate implied end tags. */ - $this->generateImpliedEndTags(); - - /* Now, if the current node is not a table element, then this - is a parse error. */ - // w/e - - /* Pop elements from this stack until a table element has been - popped from the stack. */ - while(true) { - $current = end($this->stack)->nodeName; - array_pop($this->stack); - - if($current === 'table') { - break; - } - } - - /* Reset the insertion mode appropriately. */ - $this->resetInsertionMode(); - } - - /* An end tag whose tag name is one of: "body", "caption", "col", - "colgroup", "html", "tbody", "td", "tfoot", "th", "thead", "tr" */ - } elseif($token['type'] === HTML5::ENDTAG && in_array($token['name'], - array('body', 'caption', 'col', 'colgroup', 'html', 'tbody', 'td', - 'tfoot', 'th', 'thead', 'tr'))) { - // Parse error. Ignore the token. - - /* Anything else */ - } else { - /* Parse error. Process the token as if the insertion mode was "in - body", with the following exception: */ - - /* If the current node is a table, tbody, tfoot, thead, or tr - element, then, whenever a node would be inserted into the current - node, it must instead be inserted into the foster parent element. */ - if(in_array(end($this->stack)->nodeName, - array('table', 'tbody', 'tfoot', 'thead', 'tr'))) { - /* The foster parent element is the parent element of the last - table element in the stack of open elements, if there is a - table element and it has such a parent element. If there is no - table element in the stack of open elements (innerHTML case), - then the foster parent element is the first element in the - stack of open elements (the html element). Otherwise, if there - is a table element in the stack of open elements, but the last - table element in the stack of open elements has no parent, or - its parent node is not an element, then the foster parent - element is the element before the last table element in the - stack of open elements. */ - for($n = count($this->stack) - 1; $n >= 0; $n--) { - if($this->stack[$n]->nodeName === 'table') { - $table = $this->stack[$n]; - break; - } - } - - if(isset($table) && $table->parentNode !== null) { - $this->foster_parent = $table->parentNode; - - } elseif(!isset($table)) { - $this->foster_parent = $this->stack[0]; - - } elseif(isset($table) && ($table->parentNode === null || - $table->parentNode->nodeType !== XML_ELEMENT_NODE)) { - $this->foster_parent = $this->stack[$n - 1]; - } - } - - $this->inBody($token); - } - } - - private function inCaption($token) { - /* An end tag whose tag name is "caption" */ - if($token['type'] === HTML5::ENDTAG && $token['name'] === 'caption') { - /* If the stack of open elements does not have an element in table - scope with the same tag name as the token, this is a parse error. - Ignore the token. (innerHTML case) */ - if(!$this->elementInScope($token['name'], true)) { - // Ignore - - /* Otherwise: */ - } else { - /* Generate implied end tags. */ - $this->generateImpliedEndTags(); - - /* Now, if the current node is not a caption element, then this - is a parse error. */ - // w/e - - /* Pop elements from this stack until a caption element has - been popped from the stack. */ - while(true) { - $node = end($this->stack)->nodeName; - array_pop($this->stack); - - if($node === 'caption') { - break; - } - } - - /* Clear the list of active formatting elements up to the last - marker. */ - $this->clearTheActiveFormattingElementsUpToTheLastMarker(); - - /* Switch the insertion mode to "in table". */ - $this->mode = self::IN_TABLE; - } - - /* A start tag whose tag name is one of: "caption", "col", "colgroup", - "tbody", "td", "tfoot", "th", "thead", "tr", or an end tag whose tag - name is "table" */ - } elseif(($token['type'] === HTML5::STARTTAG && in_array($token['name'], - array('caption', 'col', 'colgroup', 'tbody', 'td', 'tfoot', 'th', - 'thead', 'tr'))) || ($token['type'] === HTML5::ENDTAG && - $token['name'] === 'table')) { - /* Parse error. Act as if an end tag with the tag name "caption" - had been seen, then, if that token wasn't ignored, reprocess the - current token. */ - $this->inCaption(array( - 'name' => 'caption', - 'type' => HTML5::ENDTAG - )); - - return $this->inTable($token); - - /* An end tag whose tag name is one of: "body", "col", "colgroup", - "html", "tbody", "td", "tfoot", "th", "thead", "tr" */ - } elseif($token['type'] === HTML5::ENDTAG && in_array($token['name'], - array('body', 'col', 'colgroup', 'html', 'tbody', 'tfoot', 'th', - 'thead', 'tr'))) { - // Parse error. Ignore the token. - - /* Anything else */ - } else { - /* Process the token as if the insertion mode was "in body". */ - $this->inBody($token); - } - } - - private function inColumnGroup($token) { - /* A character token that is one of one of U+0009 CHARACTER TABULATION, - U+000A LINE FEED (LF), U+000B LINE TABULATION, U+000C FORM FEED (FF), - or U+0020 SPACE */ - if($token['type'] === HTML5::CHARACTR && - preg_match('/^[\t\n\x0b\x0c ]+$/', $token['data'])) { - /* Append the character to the current node. */ - $text = $this->dom->createTextNode($token['data']); - end($this->stack)->appendChild($text); - - /* A comment token */ - } elseif($token['type'] === HTML5::COMMENT) { - /* Append a Comment node to the current node with the data - attribute set to the data given in the comment token. */ - $comment = $this->dom->createComment($token['data']); - end($this->stack)->appendChild($comment); - - /* A start tag whose tag name is "col" */ - } elseif($token['type'] === HTML5::STARTTAG && $token['name'] === 'col') { - /* Insert a col element for the token. Immediately pop the current - node off the stack of open elements. */ - $this->insertElement($token); - array_pop($this->stack); - - /* An end tag whose tag name is "colgroup" */ - } elseif($token['type'] === HTML5::ENDTAG && - $token['name'] === 'colgroup') { - /* If the current node is the root html element, then this is a - parse error, ignore the token. (innerHTML case) */ - if(end($this->stack)->nodeName === 'html') { - // Ignore - - /* Otherwise, pop the current node (which will be a colgroup - element) from the stack of open elements. Switch the insertion - mode to "in table". */ - } else { - array_pop($this->stack); - $this->mode = self::IN_TABLE; - } - - /* An end tag whose tag name is "col" */ - } elseif($token['type'] === HTML5::ENDTAG && $token['name'] === 'col') { - /* Parse error. Ignore the token. */ - - /* Anything else */ - } else { - /* Act as if an end tag with the tag name "colgroup" had been seen, - and then, if that token wasn't ignored, reprocess the current token. */ - $this->inColumnGroup(array( - 'name' => 'colgroup', - 'type' => HTML5::ENDTAG - )); - - return $this->inTable($token); - } - } - - private function inTableBody($token) { - $clear = array('tbody', 'tfoot', 'thead', 'html'); - - /* A start tag whose tag name is "tr" */ - if($token['type'] === HTML5::STARTTAG && $token['name'] === 'tr') { - /* Clear the stack back to a table body context. */ - $this->clearStackToTableContext($clear); - - /* Insert a tr element for the token, then switch the insertion - mode to "in row". */ - $this->insertElement($token); - $this->mode = self::IN_ROW; - - /* A start tag whose tag name is one of: "th", "td" */ - } elseif($token['type'] === HTML5::STARTTAG && - ($token['name'] === 'th' || $token['name'] === 'td')) { - /* Parse error. Act as if a start tag with the tag name "tr" had - been seen, then reprocess the current token. */ - $this->inTableBody(array( - 'name' => 'tr', - 'type' => HTML5::STARTTAG, - 'attr' => array() - )); - - return $this->inRow($token); - - /* An end tag whose tag name is one of: "tbody", "tfoot", "thead" */ - } elseif($token['type'] === HTML5::ENDTAG && - in_array($token['name'], array('tbody', 'tfoot', 'thead'))) { - /* If the stack of open elements does not have an element in table - scope with the same tag name as the token, this is a parse error. - Ignore the token. */ - if(!$this->elementInScope($token['name'], true)) { - // Ignore - - /* Otherwise: */ - } else { - /* Clear the stack back to a table body context. */ - $this->clearStackToTableContext($clear); - - /* Pop the current node from the stack of open elements. Switch - the insertion mode to "in table". */ - array_pop($this->stack); - $this->mode = self::IN_TABLE; - } - - /* A start tag whose tag name is one of: "caption", "col", "colgroup", - "tbody", "tfoot", "thead", or an end tag whose tag name is "table" */ - } elseif(($token['type'] === HTML5::STARTTAG && in_array($token['name'], - array('caption', 'col', 'colgroup', 'tbody', 'tfoor', 'thead'))) || - ($token['type'] === HTML5::STARTTAG && $token['name'] === 'table')) { - /* If the stack of open elements does not have a tbody, thead, or - tfoot element in table scope, this is a parse error. Ignore the - token. (innerHTML case) */ - if(!$this->elementInScope(array('tbody', 'thead', 'tfoot'), true)) { - // Ignore. - - /* Otherwise: */ - } else { - /* Clear the stack back to a table body context. */ - $this->clearStackToTableContext($clear); - - /* Act as if an end tag with the same tag name as the current - node ("tbody", "tfoot", or "thead") had been seen, then - reprocess the current token. */ - $this->inTableBody(array( - 'name' => end($this->stack)->nodeName, - 'type' => HTML5::ENDTAG - )); - - return $this->mainPhase($token); - } - - /* An end tag whose tag name is one of: "body", "caption", "col", - "colgroup", "html", "td", "th", "tr" */ - } elseif($token['type'] === HTML5::ENDTAG && in_array($token['name'], - array('body', 'caption', 'col', 'colgroup', 'html', 'td', 'th', 'tr'))) { - /* Parse error. Ignore the token. */ - - /* Anything else */ - } else { - /* Process the token as if the insertion mode was "in table". */ - $this->inTable($token); - } - } - - private function inRow($token) { - $clear = array('tr', 'html'); - - /* A start tag whose tag name is one of: "th", "td" */ - if($token['type'] === HTML5::STARTTAG && - ($token['name'] === 'th' || $token['name'] === 'td')) { - /* Clear the stack back to a table row context. */ - $this->clearStackToTableContext($clear); - - /* Insert an HTML element for the token, then switch the insertion - mode to "in cell". */ - $this->insertElement($token); - $this->mode = self::IN_CELL; - - /* Insert a marker at the end of the list of active formatting - elements. */ - $this->a_formatting[] = self::MARKER; - - /* An end tag whose tag name is "tr" */ - } elseif($token['type'] === HTML5::ENDTAG && $token['name'] === 'tr') { - /* If the stack of open elements does not have an element in table - scope with the same tag name as the token, this is a parse error. - Ignore the token. (innerHTML case) */ - if(!$this->elementInScope($token['name'], true)) { - // Ignore. - - /* Otherwise: */ - } else { - /* Clear the stack back to a table row context. */ - $this->clearStackToTableContext($clear); - - /* Pop the current node (which will be a tr element) from the - stack of open elements. Switch the insertion mode to "in table - body". */ - array_pop($this->stack); - $this->mode = self::IN_TBODY; - } - - /* A start tag whose tag name is one of: "caption", "col", "colgroup", - "tbody", "tfoot", "thead", "tr" or an end tag whose tag name is "table" */ - } elseif($token['type'] === HTML5::STARTTAG && in_array($token['name'], - array('caption', 'col', 'colgroup', 'tbody', 'tfoot', 'thead', 'tr'))) { - /* Act as if an end tag with the tag name "tr" had been seen, then, - if that token wasn't ignored, reprocess the current token. */ - $this->inRow(array( - 'name' => 'tr', - 'type' => HTML5::ENDTAG - )); - - return $this->inCell($token); - - /* An end tag whose tag name is one of: "tbody", "tfoot", "thead" */ - } elseif($token['type'] === HTML5::ENDTAG && - in_array($token['name'], array('tbody', 'tfoot', 'thead'))) { - /* If the stack of open elements does not have an element in table - scope with the same tag name as the token, this is a parse error. - Ignore the token. */ - if(!$this->elementInScope($token['name'], true)) { - // Ignore. - - /* Otherwise: */ - } else { - /* Otherwise, act as if an end tag with the tag name "tr" had - been seen, then reprocess the current token. */ - $this->inRow(array( - 'name' => 'tr', - 'type' => HTML5::ENDTAG - )); - - return $this->inCell($token); - } - - /* An end tag whose tag name is one of: "body", "caption", "col", - "colgroup", "html", "td", "th" */ - } elseif($token['type'] === HTML5::ENDTAG && in_array($token['name'], - array('body', 'caption', 'col', 'colgroup', 'html', 'td', 'th', 'tr'))) { - /* Parse error. Ignore the token. */ - - /* Anything else */ - } else { - /* Process the token as if the insertion mode was "in table". */ - $this->inTable($token); - } - } - - private function inCell($token) { - /* An end tag whose tag name is one of: "td", "th" */ - if($token['type'] === HTML5::ENDTAG && - ($token['name'] === 'td' || $token['name'] === 'th')) { - /* If the stack of open elements does not have an element in table - scope with the same tag name as that of the token, then this is a - parse error and the token must be ignored. */ - if(!$this->elementInScope($token['name'], true)) { - // Ignore. - - /* Otherwise: */ - } else { - /* Generate implied end tags, except for elements with the same - tag name as the token. */ - $this->generateImpliedEndTags(array($token['name'])); - - /* Now, if the current node is not an element with the same tag - name as the token, then this is a parse error. */ - // k - - /* Pop elements from this stack until an element with the same - tag name as the token has been popped from the stack. */ - while(true) { - $node = end($this->stack)->nodeName; - array_pop($this->stack); - - if($node === $token['name']) { - break; - } - } - - /* Clear the list of active formatting elements up to the last - marker. */ - $this->clearTheActiveFormattingElementsUpToTheLastMarker(); - - /* Switch the insertion mode to "in row". (The current node - will be a tr element at this point.) */ - $this->mode = self::IN_ROW; - } - - /* A start tag whose tag name is one of: "caption", "col", "colgroup", - "tbody", "td", "tfoot", "th", "thead", "tr" */ - } elseif($token['type'] === HTML5::STARTTAG && in_array($token['name'], - array('caption', 'col', 'colgroup', 'tbody', 'td', 'tfoot', 'th', - 'thead', 'tr'))) { - /* If the stack of open elements does not have a td or th element - in table scope, then this is a parse error; ignore the token. - (innerHTML case) */ - if(!$this->elementInScope(array('td', 'th'), true)) { - // Ignore. - - /* Otherwise, close the cell (see below) and reprocess the current - token. */ - } else { - $this->closeCell(); - return $this->inRow($token); - } - - /* A start tag whose tag name is one of: "caption", "col", "colgroup", - "tbody", "td", "tfoot", "th", "thead", "tr" */ - } elseif($token['type'] === HTML5::STARTTAG && in_array($token['name'], - array('caption', 'col', 'colgroup', 'tbody', 'td', 'tfoot', 'th', - 'thead', 'tr'))) { - /* If the stack of open elements does not have a td or th element - in table scope, then this is a parse error; ignore the token. - (innerHTML case) */ - if(!$this->elementInScope(array('td', 'th'), true)) { - // Ignore. - - /* Otherwise, close the cell (see below) and reprocess the current - token. */ - } else { - $this->closeCell(); - return $this->inRow($token); - } - - /* An end tag whose tag name is one of: "body", "caption", "col", - "colgroup", "html" */ - } elseif($token['type'] === HTML5::ENDTAG && in_array($token['name'], - array('body', 'caption', 'col', 'colgroup', 'html'))) { - /* Parse error. Ignore the token. */ - - /* An end tag whose tag name is one of: "table", "tbody", "tfoot", - "thead", "tr" */ - } elseif($token['type'] === HTML5::ENDTAG && in_array($token['name'], - array('table', 'tbody', 'tfoot', 'thead', 'tr'))) { - /* If the stack of open elements does not have an element in table - scope with the same tag name as that of the token (which can only - happen for "tbody", "tfoot" and "thead", or, in the innerHTML case), - then this is a parse error and the token must be ignored. */ - if(!$this->elementInScope($token['name'], true)) { - // Ignore. - - /* Otherwise, close the cell (see below) and reprocess the current - token. */ - } else { - $this->closeCell(); - return $this->inRow($token); - } - - /* Anything else */ - } else { - /* Process the token as if the insertion mode was "in body". */ - $this->inBody($token); - } - } - - private function inSelect($token) { - /* Handle the token as follows: */ - - /* A character token */ - if($token['type'] === HTML5::CHARACTR) { - /* Append the token's character to the current node. */ - $this->insertText($token['data']); - - /* A comment token */ - } elseif($token['type'] === HTML5::COMMENT) { - /* Append a Comment node to the current node with the data - attribute set to the data given in the comment token. */ - $this->insertComment($token['data']); - - /* A start tag token whose tag name is "option" */ - } elseif($token['type'] === HTML5::STARTTAG && - $token['name'] === 'option') { - /* If the current node is an option element, act as if an end tag - with the tag name "option" had been seen. */ - if(end($this->stack)->nodeName === 'option') { - $this->inSelect(array( - 'name' => 'option', - 'type' => HTML5::ENDTAG - )); - } - - /* Insert an HTML element for the token. */ - $this->insertElement($token); - - /* A start tag token whose tag name is "optgroup" */ - } elseif($token['type'] === HTML5::STARTTAG && - $token['name'] === 'optgroup') { - /* If the current node is an option element, act as if an end tag - with the tag name "option" had been seen. */ - if(end($this->stack)->nodeName === 'option') { - $this->inSelect(array( - 'name' => 'option', - 'type' => HTML5::ENDTAG - )); - } - - /* If the current node is an optgroup element, act as if an end tag - with the tag name "optgroup" had been seen. */ - if(end($this->stack)->nodeName === 'optgroup') { - $this->inSelect(array( - 'name' => 'optgroup', - 'type' => HTML5::ENDTAG - )); - } - - /* Insert an HTML element for the token. */ - $this->insertElement($token); - - /* An end tag token whose tag name is "optgroup" */ - } elseif($token['type'] === HTML5::ENDTAG && - $token['name'] === 'optgroup') { - /* First, if the current node is an option element, and the node - immediately before it in the stack of open elements is an optgroup - element, then act as if an end tag with the tag name "option" had - been seen. */ - $elements_in_stack = count($this->stack); - - if($this->stack[$elements_in_stack - 1]->nodeName === 'option' && - $this->stack[$elements_in_stack - 2]->nodeName === 'optgroup') { - $this->inSelect(array( - 'name' => 'option', - 'type' => HTML5::ENDTAG - )); - } - - /* If the current node is an optgroup element, then pop that node - from the stack of open elements. Otherwise, this is a parse error, - ignore the token. */ - if($this->stack[$elements_in_stack - 1] === 'optgroup') { - array_pop($this->stack); - } - - /* An end tag token whose tag name is "option" */ - } elseif($token['type'] === HTML5::ENDTAG && - $token['name'] === 'option') { - /* If the current node is an option element, then pop that node - from the stack of open elements. Otherwise, this is a parse error, - ignore the token. */ - if(end($this->stack)->nodeName === 'option') { - array_pop($this->stack); - } - - /* An end tag whose tag name is "select" */ - } elseif($token['type'] === HTML5::ENDTAG && - $token['name'] === 'select') { - /* If the stack of open elements does not have an element in table - scope with the same tag name as the token, this is a parse error. - Ignore the token. (innerHTML case) */ - if(!$this->elementInScope($token['name'], true)) { - // w/e - - /* Otherwise: */ - } else { - /* Pop elements from the stack of open elements until a select - element has been popped from the stack. */ - while(true) { - $current = end($this->stack)->nodeName; - array_pop($this->stack); - - if($current === 'select') { - break; - } - } - - /* Reset the insertion mode appropriately. */ - $this->resetInsertionMode(); - } - - /* A start tag whose tag name is "select" */ - } elseif($token['name'] === 'select' && - $token['type'] === HTML5::STARTTAG) { - /* Parse error. Act as if the token had been an end tag with the - tag name "select" instead. */ - $this->inSelect(array( - 'name' => 'select', - 'type' => HTML5::ENDTAG - )); - - /* An end tag whose tag name is one of: "caption", "table", "tbody", - "tfoot", "thead", "tr", "td", "th" */ - } elseif(in_array($token['name'], array('caption', 'table', 'tbody', - 'tfoot', 'thead', 'tr', 'td', 'th')) && $token['type'] === HTML5::ENDTAG) { - /* Parse error. */ - // w/e - - /* If the stack of open elements has an element in table scope with - the same tag name as that of the token, then act as if an end tag - with the tag name "select" had been seen, and reprocess the token. - Otherwise, ignore the token. */ - if($this->elementInScope($token['name'], true)) { - $this->inSelect(array( - 'name' => 'select', - 'type' => HTML5::ENDTAG - )); - - $this->mainPhase($token); - } - - /* Anything else */ - } else { - /* Parse error. Ignore the token. */ - } - } - - private function afterBody($token) { - /* Handle the token as follows: */ - - /* A character token that is one of one of U+0009 CHARACTER TABULATION, - U+000A LINE FEED (LF), U+000B LINE TABULATION, U+000C FORM FEED (FF), - or U+0020 SPACE */ - if($token['type'] === HTML5::CHARACTR && - preg_match('/^[\t\n\x0b\x0c ]+$/', $token['data'])) { - /* Process the token as it would be processed if the insertion mode - was "in body". */ - $this->inBody($token); - - /* A comment token */ - } elseif($token['type'] === HTML5::COMMENT) { - /* Append a Comment node to the first element in the stack of open - elements (the html element), with the data attribute set to the - data given in the comment token. */ - $comment = $this->dom->createComment($token['data']); - $this->stack[0]->appendChild($comment); - - /* An end tag with the tag name "html" */ - } elseif($token['type'] === HTML5::ENDTAG && $token['name'] === 'html') { - /* If the parser was originally created in order to handle the - setting of an element's innerHTML attribute, this is a parse error; - ignore the token. (The element will be an html element in this - case.) (innerHTML case) */ - - /* Otherwise, switch to the trailing end phase. */ - $this->phase = self::END_PHASE; - - /* Anything else */ - } else { - /* Parse error. Set the insertion mode to "in body" and reprocess - the token. */ - $this->mode = self::IN_BODY; - return $this->inBody($token); - } - } - - private function inFrameset($token) { - /* Handle the token as follows: */ - - /* A character token that is one of one of U+0009 CHARACTER TABULATION, - U+000A LINE FEED (LF), U+000B LINE TABULATION, U+000C FORM FEED (FF), - U+000D CARRIAGE RETURN (CR), or U+0020 SPACE */ - if($token['type'] === HTML5::CHARACTR && - preg_match('/^[\t\n\x0b\x0c ]+$/', $token['data'])) { - /* Append the character to the current node. */ - $this->insertText($token['data']); - - /* A comment token */ - } elseif($token['type'] === HTML5::COMMENT) { - /* Append a Comment node to the current node with the data - attribute set to the data given in the comment token. */ - $this->insertComment($token['data']); - - /* A start tag with the tag name "frameset" */ - } elseif($token['name'] === 'frameset' && - $token['type'] === HTML5::STARTTAG) { - $this->insertElement($token); - - /* An end tag with the tag name "frameset" */ - } elseif($token['name'] === 'frameset' && - $token['type'] === HTML5::ENDTAG) { - /* If the current node is the root html element, then this is a - parse error; ignore the token. (innerHTML case) */ - if(end($this->stack)->nodeName === 'html') { - // Ignore - - } else { - /* Otherwise, pop the current node from the stack of open - elements. */ - array_pop($this->stack); - - /* If the parser was not originally created in order to handle - the setting of an element's innerHTML attribute (innerHTML case), - and the current node is no longer a frameset element, then change - the insertion mode to "after frameset". */ - $this->mode = self::AFTR_FRAME; - } - - /* A start tag with the tag name "frame" */ - } elseif($token['name'] === 'frame' && - $token['type'] === HTML5::STARTTAG) { - /* Insert an HTML element for the token. */ - $this->insertElement($token); - - /* Immediately pop the current node off the stack of open elements. */ - array_pop($this->stack); - - /* A start tag with the tag name "noframes" */ - } elseif($token['name'] === 'noframes' && - $token['type'] === HTML5::STARTTAG) { - /* Process the token as if the insertion mode had been "in body". */ - $this->inBody($token); - - /* Anything else */ - } else { - /* Parse error. Ignore the token. */ - } - } - - private function afterFrameset($token) { - /* Handle the token as follows: */ - - /* A character token that is one of one of U+0009 CHARACTER TABULATION, - U+000A LINE FEED (LF), U+000B LINE TABULATION, U+000C FORM FEED (FF), - U+000D CARRIAGE RETURN (CR), or U+0020 SPACE */ - if($token['type'] === HTML5::CHARACTR && - preg_match('/^[\t\n\x0b\x0c ]+$/', $token['data'])) { - /* Append the character to the current node. */ - $this->insertText($token['data']); - - /* A comment token */ - } elseif($token['type'] === HTML5::COMMENT) { - /* Append a Comment node to the current node with the data - attribute set to the data given in the comment token. */ - $this->insertComment($token['data']); - - /* An end tag with the tag name "html" */ - } elseif($token['name'] === 'html' && - $token['type'] === HTML5::ENDTAG) { - /* Switch to the trailing end phase. */ - $this->phase = self::END_PHASE; - - /* A start tag with the tag name "noframes" */ - } elseif($token['name'] === 'noframes' && - $token['type'] === HTML5::STARTTAG) { - /* Process the token as if the insertion mode had been "in body". */ - $this->inBody($token); - - /* Anything else */ - } else { - /* Parse error. Ignore the token. */ - } - } - - private function trailingEndPhase($token) { - /* After the main phase, as each token is emitted from the tokenisation - stage, it must be processed as described in this section. */ - - /* A DOCTYPE token */ - if($token['type'] === HTML5::DOCTYPE) { - // Parse error. Ignore the token. - - /* A comment token */ - } elseif($token['type'] === HTML5::COMMENT) { - /* Append a Comment node to the Document object with the data - attribute set to the data given in the comment token. */ - $comment = $this->dom->createComment($token['data']); - $this->dom->appendChild($comment); - - /* A character token that is one of one of U+0009 CHARACTER TABULATION, - U+000A LINE FEED (LF), U+000B LINE TABULATION, U+000C FORM FEED (FF), - or U+0020 SPACE */ - } elseif($token['type'] === HTML5::CHARACTR && - preg_match('/^[\t\n\x0b\x0c ]+$/', $token['data'])) { - /* Process the token as it would be processed in the main phase. */ - $this->mainPhase($token); - - /* A character token that is not one of U+0009 CHARACTER TABULATION, - U+000A LINE FEED (LF), U+000B LINE TABULATION, U+000C FORM FEED (FF), - or U+0020 SPACE. Or a start tag token. Or an end tag token. */ - } elseif(($token['type'] === HTML5::CHARACTR && - preg_match('/^[\t\n\x0b\x0c ]+$/', $token['data'])) || - $token['type'] === HTML5::STARTTAG || $token['type'] === HTML5::ENDTAG) { - /* Parse error. Switch back to the main phase and reprocess the - token. */ - $this->phase = self::MAIN_PHASE; - return $this->mainPhase($token); - - /* An end-of-file token */ - } elseif($token['type'] === HTML5::EOF) { - /* OMG DONE!! */ - } - } - - private function insertElement($token, $append = true) { - $el = $this->dom->createElement($token['name']); - - foreach($token['attr'] as $attr) { - if(!$el->hasAttribute($attr['name'])) { - $el->setAttribute($attr['name'], $attr['value']); - } - } - - $this->appendToRealParent($el); - $this->stack[] = $el; - - return $el; - } - - private function insertText($data) { - $text = $this->dom->createTextNode($data); - $this->appendToRealParent($text); - } - - private function insertComment($data) { - $comment = $this->dom->createComment($data); - $this->appendToRealParent($comment); - } - - private function appendToRealParent($node) { - if($this->foster_parent === null) { - end($this->stack)->appendChild($node); - - } elseif($this->foster_parent !== null) { - /* If the foster parent element is the parent element of the - last table element in the stack of open elements, then the new - node must be inserted immediately before the last table element - in the stack of open elements in the foster parent element; - otherwise, the new node must be appended to the foster parent - element. */ - for($n = count($this->stack) - 1; $n >= 0; $n--) { - if($this->stack[$n]->nodeName === 'table' && - $this->stack[$n]->parentNode !== null) { - $table = $this->stack[$n]; - break; - } - } - - if(isset($table) && $this->foster_parent->isSameNode($table->parentNode)) - $this->foster_parent->insertBefore($node, $table); - else - $this->foster_parent->appendChild($node); - - $this->foster_parent = null; - } - } - - private function elementInScope($el, $table = false) { - if(is_array($el)) { - foreach($el as $element) { - if($this->elementInScope($element, $table)) { - return true; - } - } - - return false; - } - - $leng = count($this->stack); - - for($n = 0; $n < $leng; $n++) { - /* 1. Initialise node to be the current node (the bottommost node of - the stack). */ - $node = $this->stack[$leng - 1 - $n]; - - if($node->tagName === $el) { - /* 2. If node is the target node, terminate in a match state. */ - return true; - - } elseif($node->tagName === 'table') { - /* 3. Otherwise, if node is a table element, terminate in a failure - state. */ - return false; - - } elseif($table === true && in_array($node->tagName, array('caption', 'td', - 'th', 'button', 'marquee', 'object'))) { - /* 4. Otherwise, if the algorithm is the "has an element in scope" - variant (rather than the "has an element in table scope" variant), - and node is one of the following, terminate in a failure state. */ - return false; - - } elseif($node === $node->ownerDocument->documentElement) { - /* 5. Otherwise, if node is an html element (root element), terminate - in a failure state. (This can only happen if the node is the topmost - node of the stack of open elements, and prevents the next step from - being invoked if there are no more elements in the stack.) */ - return false; - } - - /* Otherwise, set node to the previous entry in the stack of open - elements and return to step 2. (This will never fail, since the loop - will always terminate in the previous step if the top of the stack - is reached.) */ - } - } - - private function reconstructActiveFormattingElements() { - /* 1. If there are no entries in the list of active formatting elements, - then there is nothing to reconstruct; stop this algorithm. */ - $formatting_elements = count($this->a_formatting); - - if($formatting_elements === 0) { - return false; - } - - /* 3. Let entry be the last (most recently added) element in the list - of active formatting elements. */ - $entry = end($this->a_formatting); - - /* 2. If the last (most recently added) entry in the list of active - formatting elements is a marker, or if it is an element that is in the - stack of open elements, then there is nothing to reconstruct; stop this - algorithm. */ - if($entry === self::MARKER || in_array($entry, $this->stack, true)) { - return false; - } - - for($a = $formatting_elements - 1; $a >= 0; true) { - /* 4. If there are no entries before entry in the list of active - formatting elements, then jump to step 8. */ - if($a === 0) { - $step_seven = false; - break; - } - - /* 5. Let entry be the entry one earlier than entry in the list of - active formatting elements. */ - $a--; - $entry = $this->a_formatting[$a]; - - /* 6. If entry is neither a marker nor an element that is also in - thetack of open elements, go to step 4. */ - if($entry === self::MARKER || in_array($entry, $this->stack, true)) { - break; - } - } - - while(true) { - /* 7. Let entry be the element one later than entry in the list of - active formatting elements. */ - if(isset($step_seven) && $step_seven === true) { - $a++; - $entry = $this->a_formatting[$a]; - } - - /* 8. Perform a shallow clone of the element entry to obtain clone. */ - $clone = $entry->cloneNode(); - - /* 9. Append clone to the current node and push it onto the stack - of open elements so that it is the new current node. */ - end($this->stack)->appendChild($clone); - $this->stack[] = $clone; - - /* 10. Replace the entry for entry in the list with an entry for - clone. */ - $this->a_formatting[$a] = $clone; - - /* 11. If the entry for clone in the list of active formatting - elements is not the last entry in the list, return to step 7. */ - if(end($this->a_formatting) !== $clone) { - $step_seven = true; - } else { - break; - } - } - } - - private function clearTheActiveFormattingElementsUpToTheLastMarker() { - /* When the steps below require the UA to clear the list of active - formatting elements up to the last marker, the UA must perform the - following steps: */ - - while(true) { - /* 1. Let entry be the last (most recently added) entry in the list - of active formatting elements. */ - $entry = end($this->a_formatting); - - /* 2. Remove entry from the list of active formatting elements. */ - array_pop($this->a_formatting); - - /* 3. If entry was a marker, then stop the algorithm at this point. - The list has been cleared up to the last marker. */ - if($entry === self::MARKER) { - break; - } - } - } - - private function generateImpliedEndTags(array $exclude = array()) { - /* When the steps below require the UA to generate implied end tags, - then, if the current node is a dd element, a dt element, an li element, - a p element, a td element, a th element, or a tr element, the UA must - act as if an end tag with the respective tag name had been seen and - then generate implied end tags again. */ - $node = end($this->stack); - $elements = array_diff(array('dd', 'dt', 'li', 'p', 'td', 'th', 'tr'), $exclude); - - while(in_array(end($this->stack)->nodeName, $elements)) { - array_pop($this->stack); - } - } - - private function getElementCategory($name) { - if(in_array($name, $this->special)) - return self::SPECIAL; - - elseif(in_array($name, $this->scoping)) - return self::SCOPING; - - elseif(in_array($name, $this->formatting)) - return self::FORMATTING; - - else - return self::PHRASING; - } - - private function clearStackToTableContext($elements) { - /* When the steps above require the UA to clear the stack back to a - table context, it means that the UA must, while the current node is not - a table element or an html element, pop elements from the stack of open - elements. If this causes any elements to be popped from the stack, then - this is a parse error. */ - while(true) { - $node = end($this->stack)->nodeName; - - if(in_array($node, $elements)) { - break; - } else { - array_pop($this->stack); - } - } - } - - private function resetInsertionMode() { - /* 1. Let last be false. */ - $last = false; - $leng = count($this->stack); - - for($n = $leng - 1; $n >= 0; $n--) { - /* 2. Let node be the last node in the stack of open elements. */ - $node = $this->stack[$n]; - - /* 3. If node is the first node in the stack of open elements, then - set last to true. If the element whose innerHTML attribute is being - set is neither a td element nor a th element, then set node to the - element whose innerHTML attribute is being set. (innerHTML case) */ - if($this->stack[0]->isSameNode($node)) { - $last = true; - } - - /* 4. If node is a select element, then switch the insertion mode to - "in select" and abort these steps. (innerHTML case) */ - if($node->nodeName === 'select') { - $this->mode = self::IN_SELECT; - break; - - /* 5. If node is a td or th element, then switch the insertion mode - to "in cell" and abort these steps. */ - } elseif($node->nodeName === 'td' || $node->nodeName === 'th') { - $this->mode = self::IN_CELL; - break; - - /* 6. If node is a tr element, then switch the insertion mode to - "in row" and abort these steps. */ - } elseif($node->nodeName === 'tr') { - $this->mode = self::IN_ROW; - break; - - /* 7. If node is a tbody, thead, or tfoot element, then switch the - insertion mode to "in table body" and abort these steps. */ - } elseif(in_array($node->nodeName, array('tbody', 'thead', 'tfoot'))) { - $this->mode = self::IN_TBODY; - break; - - /* 8. If node is a caption element, then switch the insertion mode - to "in caption" and abort these steps. */ - } elseif($node->nodeName === 'caption') { - $this->mode = self::IN_CAPTION; - break; - - /* 9. If node is a colgroup element, then switch the insertion mode - to "in column group" and abort these steps. (innerHTML case) */ - } elseif($node->nodeName === 'colgroup') { - $this->mode = self::IN_CGROUP; - break; - - /* 10. If node is a table element, then switch the insertion mode - to "in table" and abort these steps. */ - } elseif($node->nodeName === 'table') { - $this->mode = self::IN_TABLE; - break; - - /* 11. If node is a head element, then switch the insertion mode - to "in body" ("in body"! not "in head"!) and abort these steps. - (innerHTML case) */ - } elseif($node->nodeName === 'head') { - $this->mode = self::IN_BODY; - break; - - /* 12. If node is a body element, then switch the insertion mode to - "in body" and abort these steps. */ - } elseif($node->nodeName === 'body') { - $this->mode = self::IN_BODY; - break; - - /* 13. If node is a frameset element, then switch the insertion - mode to "in frameset" and abort these steps. (innerHTML case) */ - } elseif($node->nodeName === 'frameset') { - $this->mode = self::IN_FRAME; - break; - - /* 14. If node is an html element, then: if the head element - pointer is null, switch the insertion mode to "before head", - otherwise, switch the insertion mode to "after head". In either - case, abort these steps. (innerHTML case) */ - } elseif($node->nodeName === 'html') { - $this->mode = ($this->head_pointer === null) - ? self::BEFOR_HEAD - : self::AFTER_HEAD; - - break; - - /* 15. If last is true, then set the insertion mode to "in body" - and abort these steps. (innerHTML case) */ - } elseif($last) { - $this->mode = self::IN_BODY; - break; - } - } - } - - private function closeCell() { - /* If the stack of open elements has a td or th element in table scope, - then act as if an end tag token with that tag name had been seen. */ - foreach(array('td', 'th') as $cell) { - if($this->elementInScope($cell, true)) { - $this->inCell(array( - 'name' => $cell, - 'type' => HTML5::ENDTAG - )); - - break; - } - } - } - - public function save() { - return $this->dom; - } -} -?> diff --git a/main/inc/lib/htmlpurifier/maintenance/add-vimline.php b/main/inc/lib/htmlpurifier/maintenance/add-vimline.php deleted file mode 100755 index 34a177f210..0000000000 --- a/main/inc/lib/htmlpurifier/maintenance/add-vimline.php +++ /dev/null @@ -1,131 +0,0 @@ -#!/usr/bin/php -globr('.', '*'); -foreach ($files as $file) { - if ( - !is_file($file) || - prefix_is('./docs/doxygen', $file) || - prefix_is('./library/standalone', $file) || - prefix_is('./docs/specimens', $file) || - postfix_is('.ser', $file) || - postfix_is('.tgz', $file) || - postfix_is('.patch', $file) || - postfix_is('.dtd', $file) || - postfix_is('.ent', $file) || - postfix_is('.png', $file) || - postfix_is('.ico', $file) || - // wontfix - postfix_is('.vtest', $file) || - postfix_is('.svg', $file) || - postfix_is('.phpt', $file) || - postfix_is('VERSION', $file) || - postfix_is('WHATSNEW', $file) || - postfix_is('FOCUS', $file) || - postfix_is('configdoc/usage.xml', $file) || - postfix_is('library/HTMLPurifier.includes.php', $file) || - postfix_is('library/HTMLPurifier.safe-includes.php', $file) || - postfix_is('smoketests/xssAttacks.xml', $file) || - // phpt files - postfix_is('.diff', $file) || - postfix_is('.exp', $file) || - postfix_is('.log', $file) || - postfix_is('.out', $file) || - - $file == './library/HTMLPurifier/Lexer/PH5P.php' || - $file == './maintenance/PH5P.php' - ) continue; - $ext = strrchr($file, '.'); - if ( - postfix_is('README', $file) || - postfix_is('LICENSE', $file) || - postfix_is('CREDITS', $file) || - postfix_is('INSTALL', $file) || - postfix_is('NEWS', $file) || - postfix_is('TODO', $file) || - postfix_is('WYSIWYG', $file) || - postfix_is('Changelog', $file) - ) $ext = '.txt'; - if (postfix_is('Doxyfile', $file)) $ext = 'Doxyfile'; - if (postfix_is('.php.in', $file)) $ext = '.php'; - $no_nl = false; - switch ($ext) { - case '.php': - case '.inc': - case '.js': - $line = '// %s'; - break; - case '.html': - case '.xsl': - case '.xml': - case '.htc': - $line = ""; - break; - case '.htmlt': - $no_nl = true; - $line = '--# %s'; - break; - case '.ini': - $line = '; %s'; - break; - case '.css': - $line = '/* %s */'; - break; - case '.bat': - $line = 'rem %s'; - break; - case '.txt': - case '.utf8': - if ( - prefix_is('./library/HTMLPurifier/ConfigSchema', $file) || - prefix_is('./smoketests/test-schema', $file) || - prefix_is('./tests/HTMLPurifier/StringHashParser', $file) - ) { - $no_nl = true; - $line = '--# %s'; - } else { - $line = ' %s'; - } - break; - case 'Doxyfile': - $line = '# %s'; - break; - default: - throw new Exception('Unknown file: ' . $file); - } - - echo "$file\n"; - $contents = file_get_contents($file); - - $regex = '~' . str_replace('%s', 'vim: .+', preg_quote($line, '~')) . '~m'; - $contents = preg_replace($regex, '', $contents); - - $contents = rtrim($contents); - - if (strpos($contents, "\r\n") !== false) $nl = "\r\n"; - elseif (strpos($contents, "\n") !== false) $nl = "\n"; - elseif (strpos($contents, "\r") !== false) $nl = "\r"; - else $nl = PHP_EOL; - - if (!$no_nl) $contents .= $nl; - $contents .= $nl . str_replace('%s', $vimline, $line) . $nl; - - file_put_contents($file, $contents); - -} - -// vim: et sw=4 sts=4 diff --git a/main/inc/lib/htmlpurifier/maintenance/common.php b/main/inc/lib/htmlpurifier/maintenance/common.php deleted file mode 100755 index 888c7daf94..0000000000 --- a/main/inc/lib/htmlpurifier/maintenance/common.php +++ /dev/null @@ -1,22 +0,0 @@ -docs/doxygen/info.log 2>docs/doxygen/errors.log -if [ "$?" != 0 ]; then - cat docs/doxygen/errors.log - exit -fi -cd docs -tar czf doxygen.tgz doxygen diff --git a/main/inc/lib/htmlpurifier/maintenance/config-scanner.php b/main/inc/lib/htmlpurifier/maintenance/config-scanner.php deleted file mode 100755 index 2b4efa3f85..0000000000 --- a/main/inc/lib/htmlpurifier/maintenance/config-scanner.php +++ /dev/null @@ -1,153 +0,0 @@ -#!/usr/bin/php -globr('.', '*.php'); -$files = array(); -foreach ($raw_files as $file) { - $file = substr($file, 2); // rm leading './' - if (strncmp('standalone/', $file, 11) === 0) continue; // rm generated files - if (substr_count($file, '.') > 1) continue; // rm meta files - $files[] = $file; -} - -/** - * Moves the $i cursor to the next non-whitespace token - */ -function consumeWhitespace($tokens, &$i) { - do {$i++;} while (is_array($tokens[$i]) && $tokens[$i][0] === T_WHITESPACE); -} - -/** - * Tests whether or not a token is a particular type. There are three run-cases: - * - ($token, $expect_token): tests if the token is $expect_token type; - * - ($token, $expect_value): tests if the token is the string $expect_value; - * - ($token, $expect_token, $expect_value): tests if token is $expect_token type, and - * its string representation is $expect_value - */ -function testToken($token, $value_or_token, $value = null) { - if (is_null($value)) { - if (is_int($value_or_token)) return is_array($token) && $token[0] === $value_or_token; - else return $token === $value_or_token; - } else { - return is_array($token) && $token[0] === $value_or_token && $token[1] === $value; - } -} - -$counter = 0; -$full_counter = 0; -$tracker = array(); - -foreach ($files as $file) { - $tokens = token_get_all(file_get_contents($file)); - $file = str_replace('\\', '/', $file); - for ($i = 0, $c = count($tokens); $i < $c; $i++) { - $ok = false; - // Match $config - if (!$ok && testToken($tokens[$i], T_VARIABLE, '$config')) $ok = true; - // Match $this->config - while (!$ok && testToken($tokens[$i], T_VARIABLE, '$this')) { - consumeWhitespace($tokens, $i); - if (!testToken($tokens[$i], T_OBJECT_OPERATOR)) break; - consumeWhitespace($tokens, $i); - if (testToken($tokens[$i], T_STRING, 'config')) $ok = true; - break; - } - if (!$ok) continue; - - $ok = false; - for($i++; $i < $c; $i++) { - if ($tokens[$i] === ',' || $tokens[$i] === ')' || $tokens[$i] === ';') { - break; - } - if (is_string($tokens[$i])) continue; - if ($tokens[$i][0] === T_OBJECT_OPERATOR) { - $ok = true; - break; - } - } - if (!$ok) continue; - - $line = $tokens[$i][2]; - - consumeWhitespace($tokens, $i); - if (!testToken($tokens[$i], T_STRING, 'get')) continue; - - consumeWhitespace($tokens, $i); - if (!testToken($tokens[$i], '(')) continue; - - $full_counter++; - - $matched = false; - do { - - // What we currently don't match are batch retrievals, and - // wildcard retrievals. This data might be useful in the future, - // which is why we have a do {} while loop that doesn't actually - // do anything. - - consumeWhitespace($tokens, $i); - if (!testToken($tokens[$i], T_CONSTANT_ENCAPSED_STRING)) continue; - $id = substr($tokens[$i][1], 1, -1); - - $counter++; - $matched = true; - - if (!isset($tracker[$id])) $tracker[$id] = array(); - if (!isset($tracker[$id][$file])) $tracker[$id][$file] = array(); - $tracker[$id][$file][] = $line; - - } while (0); - - //echo "$file:$line uses $namespace.$directive\n"; - } -} - -echo "\n$counter/$full_counter instances of \$config or \$this->config found in source code.\n"; - -echo "Generating XML... "; - -$xw = new XMLWriter(); -$xw->openURI('../configdoc/usage.xml'); -$xw->setIndent(true); -$xw->startDocument('1.0', 'UTF-8'); -$xw->startElement('usage'); -foreach ($tracker as $id => $files) { - $xw->startElement('directive'); - $xw->writeAttribute('id', $id); - foreach ($files as $file => $lines) { - $xw->startElement('file'); - $xw->writeAttribute('name', $file); - foreach ($lines as $line) { - $xw->writeElement('line', $line); - } - $xw->endElement(); - } - $xw->endElement(); -} -$xw->endElement(); -$xw->flush(); - -echo "done!\n"; - -// vim: et sw=4 sts=4 diff --git a/main/inc/lib/htmlpurifier/maintenance/flush-definition-cache.php b/main/inc/lib/htmlpurifier/maintenance/flush-definition-cache.php deleted file mode 100755 index 138badb659..0000000000 --- a/main/inc/lib/htmlpurifier/maintenance/flush-definition-cache.php +++ /dev/null @@ -1,42 +0,0 @@ -#!/usr/bin/php -flush($config); -} - -echo "Cache flushed successfully.\n"; - -// vim: et sw=4 sts=4 diff --git a/main/inc/lib/htmlpurifier/maintenance/flush.php b/main/inc/lib/htmlpurifier/maintenance/flush.php deleted file mode 100755 index ff95be9476..0000000000 --- a/main/inc/lib/htmlpurifier/maintenance/flush.php +++ /dev/null @@ -1,29 +0,0 @@ -#!/usr/bin/php -/'; - -foreach ( $entity_files as $file ) { - $contents = file_get_contents($entity_dir . $file); - $matches = array(); - preg_match_all($regexp, $contents, $matches, PREG_SET_ORDER); - foreach ($matches as $match) { - $entity_table[$match[1]] = unichr($match[2]); - } -} - -$output = serialize($entity_table); - -$fh = fopen($output_file, 'w'); -fwrite($fh, $output); -fclose($fh); - -echo "Completed successfully."; - -// vim: et sw=4 sts=4 diff --git a/main/inc/lib/htmlpurifier/maintenance/generate-includes.php b/main/inc/lib/htmlpurifier/maintenance/generate-includes.php deleted file mode 100755 index 20bed360bc..0000000000 --- a/main/inc/lib/htmlpurifier/maintenance/generate-includes.php +++ /dev/null @@ -1,190 +0,0 @@ -#!/usr/bin/php -globr('.', '*.php'); -if (!$raw_files) throw new Exception('Did not find any PHP source files'); -$files = array(); -foreach ($raw_files as $file) { - $file = substr($file, 2); // rm leading './' - if (strncmp('standalone/', $file, 11) === 0) continue; // rm generated files - if (substr_count($file, '.') > 1) continue; // rm meta files - $ok = true; - foreach ($exclude_dirs as $dir) { - if (strncmp($dir, $file, strlen($dir)) === 0) { - $ok = false; - break; - } - } - if (!$ok) continue; // rm excluded directories - if (in_array($file, $exclude_files)) continue; // rm excluded files - $files[] = $file; -} -echo "done!\n"; - -// Reorder list so that dependencies are included first: - -/** - * Returns a lookup array of dependencies for a file. - * - * @note This function expects that format $name extends $parent on one line - * - * @param $file - * File to check dependencies of. - * @return - * Lookup array of files the file is dependent on, sorted accordingly. - */ -function get_dependency_lookup($file) { - static $cache = array(); - if (isset($cache[$file])) return $cache[$file]; - if (!file_exists($file)) { - echo "File doesn't exist: $file\n"; - return array(); - } - $fh = fopen($file, 'r'); - $deps = array(); - while (!feof($fh)) { - $line = fgets($fh); - if (strncmp('class', $line, 5) === 0) { - // The implementation here is fragile and will break if we attempt - // to use interfaces. Beware! - $arr = explode(' extends ', trim($line, ' {'."\n\r"), 2); - if (count($arr) < 2) break; - $parent = $arr[1]; - $dep_file = HTMLPurifier_Bootstrap::getPath($parent); - if (!$dep_file) break; - $deps[$dep_file] = true; - break; - } - } - fclose($fh); - foreach (array_keys($deps) as $file) { - // Extra dependencies must come *before* base dependencies - $deps = get_dependency_lookup($file) + $deps; - } - $cache[$file] = $deps; - return $deps; -} - -/** - * Sorts files based on dependencies. This function is lazy and will not - * group files with dependencies together; it will merely ensure that a file - * is never included before its dependencies are. - * - * @param $files - * Files array to sort. - * @return - * Sorted array ($files is not modified by reference!) - */ -function dep_sort($files) { - $ret = array(); - $cache = array(); - foreach ($files as $file) { - if (isset($cache[$file])) continue; - $deps = get_dependency_lookup($file); - foreach (array_keys($deps) as $dep) { - if (!isset($cache[$dep])) { - $ret[] = $dep; - $cache[$dep] = true; - } - } - $cache[$file] = true; - $ret[] = $file; - } - return $ret; -} - -$files = dep_sort($files); - -// Build the actual include stub: - -$version = trim(file_get_contents('../VERSION')); - -// stub -$php = " PH5P.patch"); -unlink($newt); - -// vim: et sw=4 sts=4 diff --git a/main/inc/lib/htmlpurifier/maintenance/generate-schema-cache.php b/main/inc/lib/htmlpurifier/maintenance/generate-schema-cache.php deleted file mode 100755 index 339ff12dae..0000000000 --- a/main/inc/lib/htmlpurifier/maintenance/generate-schema-cache.php +++ /dev/null @@ -1,45 +0,0 @@ -#!/usr/bin/php -buildDir($interchange); - -$loader = dirname(__FILE__) . '/../config-schema.php'; -if (file_exists($loader)) include $loader; -foreach ($_SERVER['argv'] as $i => $dir) { - if ($i === 0) continue; - $builder->buildDir($interchange, realpath($dir)); -} - -$interchange->validate(); - -$schema_builder = new HTMLPurifier_ConfigSchema_Builder_ConfigSchema(); -$schema = $schema_builder->build($interchange); - -echo "Saving schema... "; -file_put_contents($target, serialize($schema)); -echo "done!\n"; - -// vim: et sw=4 sts=4 diff --git a/main/inc/lib/htmlpurifier/maintenance/generate-standalone.php b/main/inc/lib/htmlpurifier/maintenance/generate-standalone.php deleted file mode 100755 index 9fe5354a20..0000000000 --- a/main/inc/lib/htmlpurifier/maintenance/generate-standalone.php +++ /dev/null @@ -1,152 +0,0 @@ -#!/usr/bin/php -copyr($dir, 'standalone/' . $dir); -} - -/** - * Copies the contents of a file to the standalone directory - * @param string $file File to copy - */ -function make_file_standalone($file) { - global $FS; - $FS->mkdirr('standalone/' . dirname($file)); - copy_and_remove_includes($file, 'standalone/' . $file); - return true; -} - -/** - * Copies a file to another location recursively, if it is a PHP file - * remove includes - * @param string $file Original file - * @param string $sfile New location of file - */ -function copy_and_remove_includes($file, $sfile) { - $contents = file_get_contents($file); - if (strrchr($file, '.') === '.php') $contents = replace_includes($contents); - return file_put_contents($sfile, $contents); -} - -/** - * @param $matches preg_replace_callback matches array, where index 1 - * is the filename to include - */ -function replace_includes_callback($matches) { - $file = $matches[1]; - $preserve = array( - // PEAR (external) - 'XML/HTMLSax3.php' => 1 - ); - if (isset($preserve[$file])) { - return $matches[0]; - } - if (isset($GLOBALS['loaded'][$file])) return ''; - $GLOBALS['loaded'][$file] = true; - return replace_includes(remove_php_tags(file_get_contents($file))); -} - -echo 'Generating includes file... '; -shell_exec('php generate-includes.php'); -echo "done!\n"; - -chdir(dirname(__FILE__) . '/../library/'); - -echo 'Creating full file...'; -$contents = replace_includes(file_get_contents('HTMLPurifier.includes.php')); -$contents = str_replace( - // Note that bootstrap is now inside the standalone file - "define('HTMLPURIFIER_PREFIX', realpath(dirname(__FILE__) . '/..'));", - "define('HTMLPURIFIER_PREFIX', dirname(__FILE__) . '/standalone'); - set_include_path(HTMLPURIFIER_PREFIX . PATH_SEPARATOR . get_include_path());", - $contents -); -file_put_contents('HTMLPurifier.standalone.php', $contents); -echo ' done!' . PHP_EOL; - -echo 'Creating standalone directory...'; -$FS->rmdirr('standalone'); // ensure a clean copy - -// data files -$FS->mkdirr('standalone/HTMLPurifier/DefinitionCache/Serializer'); -make_file_standalone('HTMLPurifier/EntityLookup/entities.ser'); -make_file_standalone('HTMLPurifier/ConfigSchema/schema.ser'); - -// non-standard inclusion setup -make_dir_standalone('HTMLPurifier/ConfigSchema'); -make_dir_standalone('HTMLPurifier/Language'); -make_dir_standalone('HTMLPurifier/Filter'); -make_dir_standalone('HTMLPurifier/Printer'); -make_file_standalone('HTMLPurifier/Printer.php'); -make_file_standalone('HTMLPurifier/Lexer/PH5P.php'); -make_file_standalone('HTMLPurifier/Lexer/PEARSax3.php'); - -echo ' done!' . PHP_EOL; - -// vim: et sw=4 sts=4 diff --git a/main/inc/lib/htmlpurifier/maintenance/index.html b/main/inc/lib/htmlpurifier/maintenance/index.html deleted file mode 100755 index aa7b9c934b..0000000000 --- a/main/inc/lib/htmlpurifier/maintenance/index.html +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/main/inc/lib/htmlpurifier/maintenance/merge-library.php b/main/inc/lib/htmlpurifier/maintenance/merge-library.php deleted file mode 100755 index de2eecdc08..0000000000 --- a/main/inc/lib/htmlpurifier/maintenance/merge-library.php +++ /dev/null @@ -1,11 +0,0 @@ -#!/usr/bin/php -open('w'); - $multiline = false; - foreach ($hash as $key => $value) { - $multiline = $multiline || (strpos($value, "\n") !== false); - if ($multiline) { - $file->put("--$key--" . PHP_EOL); - $file->put(str_replace("\n", PHP_EOL, $value) . PHP_EOL); - } else { - if ($key == 'ID') { - $file->put("$value" . PHP_EOL); - } else { - $file->put("$key: $value" . PHP_EOL); - } - } - } - $file->close(); -} - -$schema = HTMLPurifier_ConfigSchema::instance(); -$adapter = new HTMLPurifier_ConfigSchema_StringHashReverseAdapter($schema); - -foreach ($schema->info as $ns => $ns_array) { - saveHash($adapter->get($ns)); - foreach ($ns_array as $dir => $x) { - saveHash($adapter->get($ns, $dir)); - } -} - -// vim: et sw=4 sts=4 diff --git a/main/inc/lib/htmlpurifier/maintenance/old-remove-require-once.php b/main/inc/lib/htmlpurifier/maintenance/old-remove-require-once.php deleted file mode 100755 index f47c7d0f1a..0000000000 --- a/main/inc/lib/htmlpurifier/maintenance/old-remove-require-once.php +++ /dev/null @@ -1,32 +0,0 @@ -#!/usr/bin/php -globr('.', '*.php'); -foreach ($files as $file) { - if (substr_count(basename($file), '.') > 1) continue; - $old_code = file_get_contents($file); - $new_code = preg_replace("#^require_once .+[\n\r]*#m", '', $old_code); - if ($old_code !== $new_code) { - file_put_contents($file, $new_code); - } -} - -// vim: et sw=4 sts=4 diff --git a/main/inc/lib/htmlpurifier/maintenance/old-remove-schema-def.php b/main/inc/lib/htmlpurifier/maintenance/old-remove-schema-def.php deleted file mode 100755 index 5ae0319736..0000000000 --- a/main/inc/lib/htmlpurifier/maintenance/old-remove-schema-def.php +++ /dev/null @@ -1,32 +0,0 @@ -#!/usr/bin/php -globr('.', '*.php'); -foreach ($files as $file) { - if (substr_count(basename($file), '.') > 1) continue; - $old_code = file_get_contents($file); - $new_code = preg_replace("#^HTMLPurifier_ConfigSchema::.+?\);[\n\r]*#ms", '', $old_code); - if ($old_code !== $new_code) { - file_put_contents($file, $new_code); - } - if (preg_match('#^\s+HTMLPurifier_ConfigSchema::#m', $new_code)) { - echo "Indented ConfigSchema call in $file\n"; - } -} - -// vim: et sw=4 sts=4 diff --git a/main/inc/lib/htmlpurifier/maintenance/phpt-modifications.patch b/main/inc/lib/htmlpurifier/maintenance/phpt-modifications.patch deleted file mode 100755 index 4d135dc6c0..0000000000 --- a/main/inc/lib/htmlpurifier/maintenance/phpt-modifications.patch +++ /dev/null @@ -1,367 +0,0 @@ -Index: src/PHPT/Case.php -=================================================================== ---- src/PHPT/Case.php (revision 691) -+++ src/PHPT/Case.php (working copy) -@@ -28,17 +28,14 @@ - { - $reporter->onCaseStart($this); - try { -- if ($this->sections->filterByInterface('RunnableBefore')->valid()) { -- foreach ($this->sections as $section) { -- $section->run($this); -- } -+ $runnable_before = $this->sections->filterByInterface('RunnableBefore'); -+ foreach ($runnable_before as $section) { -+ $section->run($this); - } -- $this->sections->filterByInterface(); - $this->sections->FILE->run($this); -- if ($this->sections->filterByInterface('RunnableAfter')->valid()) { -- foreach ($this->sections as $section) { -- $section->run($this); -- } -+ $runnable_after = $this->sections->filterByInterface('RunnableAfter'); -+ foreach ($runnable_after as $section) { -+ $section->run($this); - } - $reporter->onCasePass($this); - } catch (PHPT_Case_VetoException $veto) { -@@ -46,7 +43,6 @@ - } catch (PHPT_Case_FailureException $failure) { - $reporter->onCaseFail($this, $failure); - } -- $this->sections->filterByInterface(); - $reporter->onCaseEnd($this); - } - -Index: src/PHPT/Case/Validator/CgiRequired.php -=================================================================== ---- src/PHPT/Case/Validator/CgiRequired.php (revision 691) -+++ src/PHPT/Case/Validator/CgiRequired.php (working copy) -@@ -17,7 +17,6 @@ - public function is(PHPT_Case $case) - { - $return = $case->sections->filterByInterface('CgiExecutable')->valid(); -- $case->sections->filterByInterface(); - return $return; - } - } -Index: src/PHPT/CodeRunner/CommandLine.php -=================================================================== ---- src/PHPT/CodeRunner/CommandLine.php (revision 691) -+++ src/PHPT/CodeRunner/CommandLine.php (working copy) -@@ -13,7 +13,7 @@ - $this->_filename = $runner->filename; - $this->_ini = (string)$runner->ini; - $this->_args = (string)$runner->args; -- $this->_executable = str_replace(' ', '\ ', (string)$runner->executable); -+ $this->_executable = $runner->executable; - $this->_post_filename = (string)$runner->post_filename; - } - -Index: src/PHPT/CodeRunner/Driver/WScriptShell.php -=================================================================== ---- src/PHPT/CodeRunner/Driver/WScriptShell.php (revision 691) -+++ src/PHPT/CodeRunner/Driver/WScriptShell.php (working copy) -@@ -23,9 +23,9 @@ - } - } - if ($found == false) { -- throw new PHPT_CodeRunner_InvalidExecutableException( -- 'unable to locate PHP executable: ' . $this->executable -- ); -+ //throw new PHPT_CodeRunner_InvalidExecutableException( -+ // 'unable to locate PHP executable: ' . $this->executable -+ //); - } - } - -@@ -69,7 +69,7 @@ - - $error = $this->_process->StdErr->ReadAll(); - if (!empty($error)) { -- throw new PHPT_CodeRunner_ExecutionException($error); -+ throw new PHPT_CodeRunner_ExecutionException($error, $this->_commandFactory()); - } - - return $this->_process->StdOut->ReadAll(); -@@ -93,6 +93,7 @@ - { - $return = ''; - foreach ($this->environment as $key => $value) { -+ $value = str_replace('&', '^&', $value); - $return .= "set {$key}={$value} & "; - } - return $return; -Index: src/PHPT/CodeRunner/Factory.php -=================================================================== ---- src/PHPT/CodeRunner/Factory.php (revision 691) -+++ src/PHPT/CodeRunner/Factory.php (working copy) -@@ -33,7 +33,13 @@ - 'php-cgi'; - } - -- if (strtoupper(substr(PHP_OS, 0, 3)) == 'WIN') { -+ if ( -+ strtoupper(substr(PHP_OS, 0, 3)) == 'WIN' && -+ ( -+ $runner->executable == 'php' || -+ $runner->executable == 'php-cgi' -+ ) -+ ) { - $runner->executable = $runner->executable . '.exe'; - } - try { -Index: src/PHPT/Section/ModifiableAbstract.php -=================================================================== ---- src/PHPT/Section/ModifiableAbstract.php (revision 691) -+++ src/PHPT/Section/ModifiableAbstract.php (working copy) -@@ -15,12 +15,10 @@ - - public function run(PHPT_Case $case) - { -- $sections = clone $case->sections; -- if ($sections->filterByInterface($this->_modifier_name . 'Modifier')->valid()) { -- $modifyMethod = 'modify' . $this->_modifier_name; -- foreach ($sections as $section) { -- $section->$modifyMethod($this); -- } -+ $modifiers = $case->sections->filterByInterface($this->_modifier_name . 'Modifier'); -+ $modifyMethod = 'modify' . $this->_modifier_name; -+ foreach ($modifiers as $section) { -+ $section->$modifyMethod($this); - } - } - -Index: src/PHPT/Section/SKIPIF.php -=================================================================== ---- src/PHPT/Section/SKIPIF.php (revision 691) -+++ src/PHPT/Section/SKIPIF.php (working copy) -@@ -3,10 +3,12 @@ - class PHPT_Section_SKIPIF implements PHPT_Section_RunnableBefore - { - private $_data = null; -+ private $_runner_factory = null; - - public function __construct($data) - { - $this->_data = $data; -+ $this->_runner_factory = new PHPT_CodeRunner_Factory(); - } - - public function run(PHPT_Case $case) -@@ -16,9 +18,7 @@ - - // @todo refactor to PHPT_CodeRunner - file_put_contents($filename, $this->_data); -- $response = array(); -- exec('php -f ' . $filename, $response); -- $response = implode("\n", $response); -+ $response = $this->_runner_factory->factory($case)->run($filename)->output; - unlink($filename); - - if (preg_match('/^skip( - (.*))?/', $response, $matches)) { -Index: src/PHPT/SectionList.php -=================================================================== ---- src/PHPT/SectionList.php (revision 691) -+++ src/PHPT/SectionList.php (working copy) -@@ -2,7 +2,6 @@ - - class PHPT_SectionList implements Iterator - { -- private $_raw_sections = array(); - private $_sections = array(); - private $_section_map = array(); - private $_key_map = array(); -@@ -15,14 +14,12 @@ - } - $name = strtoupper(str_replace('PHPT_Section_', '', get_class($section))); - $key = $section instanceof PHPT_Section_Runnable ? $section->getPriority() . '.' . $name : $name; -- $this->_raw_sections[$key] = $section; -+ $this->_sections[$key] = $section; - $this->_section_map[$name] = $key; - $this->_key_map[$key] = $name; - } - -- ksort($this->_raw_sections); -- -- $this->_sections = $this->_raw_sections; -+ ksort($this->_sections); - } - - public function current() -@@ -52,21 +49,23 @@ - - public function filterByInterface($interface = null) - { -+ $ret = new PHPT_SectionList(); -+ - if (is_null($interface)) { -- $this->_sections = $this->_raw_sections; -- return $this; -+ $ret->_sections = $this->_sections; -+ return $ret; - } - - $full_interface = 'PHPT_Section_' . $interface; -- $this->_sections = array(); -- foreach ($this->_raw_sections as $name => $section) { -+ $ret->_sections = array(); -+ foreach ($this->_sections as $name => $section) { - if (!$section instanceof $full_interface) { - continue; - } -- $this->_sections[$name] = $section; -+ $ret->_sections[$name] = $section; - } - -- return $this; -+ return $ret; - } - - public function has($name) -@@ -74,11 +73,11 @@ - if (!isset($this->_section_map[$name])) { - return false; - } -- return isset($this->_raw_sections[$this->_section_map[$name]]); -+ return isset($this->_sections[$this->_section_map[$name]]); - } - - public function __get($key) - { -- return $this->_raw_sections[$this->_section_map[$key]]; -+ return $this->_sections[$this->_section_map[$key]]; - } - } -Index: tests/CodeRunner/Driver/WScriptShell/injects-ini-settings.phpt -=================================================================== ---- tests/CodeRunner/Driver/WScriptShell/injects-ini-settings.phpt (revision 691) -+++ tests/CodeRunner/Driver/WScriptShell/injects-ini-settings.phpt (working copy) -@@ -17,9 +17,9 @@ - - // sanity check - $obj = new FoobarIni(); --assert('(string)$obj == " -d display_errors=1 "'); -+assert('(string)$obj == " -d \"display_errors=1\" "'); - $obj->display_errors = 0; --assert('(string)$obj == " -d display_errors=0 "'); -+assert('(string)$obj == " -d \"display_errors=0\" "'); - unset($obj); - - -Index: tests/Section/File/restores-case-sections.phpt -=================================================================== ---- tests/Section/File/restores-case-sections.phpt (revision 691) -+++ tests/Section/File/restores-case-sections.phpt (working copy) -@@ -1,24 +0,0 @@ ----TEST-- --After PHPT_Section_FILE::run(), the sections property of the provide $case object --is restored to its unfiltered state ----FILE-- --sections = new PHPT_SectionList(array( -- new PHPT_Section_ARGS('foo=bar'), --)); -- --$section = new PHPT_Section_FILE('hello world'); --$section->run($case); -- --assert('$case->sections->valid()'); -- --?> --===DONE=== ----EXPECT-- --===DONE=== -Index: tests/SectionList/filter-by-interface.phpt -=================================================================== ---- tests/SectionList/filter-by-interface.phpt (revision 691) -+++ tests/SectionList/filter-by-interface.phpt (working copy) -@@ -17,10 +17,10 @@ - - $data = array_merge($runnable, $non_runnable); - $list = new PHPT_SectionList($data); --$list->filterByInterface('Runnable'); --assert('$list->valid()'); --$list->filterByInterface('EnvModifier'); --assert('$list->valid() == false'); -+$runnable = $list->filterByInterface('Runnable'); -+assert('$runnable->valid()'); -+$env_modifier = $list->filterByInterface('EnvModifier'); -+assert('$env_modifier->valid() == false'); - - ?> - ===DONE=== -Index: tests/SectionList/filter-resets-with-null.phpt -=================================================================== ---- tests/SectionList/filter-resets-with-null.phpt (revision 691) -+++ tests/SectionList/filter-resets-with-null.phpt (working copy) -@@ -1,36 +0,0 @@ ----TEST-- --If you call filterByInterface() with null or no-value, the full dataset is restored ----FILE-- -- new PHPT_Section_ENV(''), -- 'CLEAN' => new PHPT_Section_CLEAN(''), --); -- --class PHPT_Section_FOO implements PHPT_Section { } --$non_runnable = array( -- 'FOO' => new PHPT_Section_FOO(), --); -- --$data = array_merge($runnable, $non_runnable); --$list = new PHPT_SectionList($data); --$list->filterByInterface('Runnable'); -- --// sanity check --foreach ($list as $key => $value) { -- assert('$runnable[$key] == $value'); --} -- --$list->filterByInterface(); -- --foreach ($list as $key => $value) { -- assert('$data[$key] == $value'); --} -- --?> --===DONE=== ----EXPECT-- --===DONE=== -Index: tests/Util/Code/runAsFile-executes-in-file.phpt -=================================================================== ---- tests/Util/Code/runAsFile-executes-in-file.phpt (revision 691) -+++ tests/Util/Code/runAsFile-executes-in-file.phpt (working copy) -@@ -10,7 +10,7 @@ - - $util = new PHPT_Util_Code($code); - --$file = dirname(__FILE__) . '/foobar.php'; -+$file = dirname(__FILE__) . DIRECTORY_SEPARATOR . 'foobar.php'; - $result = $util->runAsFile($file); - - assert('$result == $file'); -Index: tests/Util/Code/runAsFile-returns-output-if-no-return.phpt -=================================================================== ---- tests/Util/Code/runAsFile-returns-output-if-no-return.phpt (revision 691) -+++ tests/Util/Code/runAsFile-returns-output-if-no-return.phpt (working copy) -@@ -9,7 +9,7 @@ - - $util = new PHPT_Util_Code($code); - --$file = dirname(__FILE__) . '/foobar.php'; -+$file = dirname(__FILE__) . DIRECTORY_SEPARATOR . 'foobar.php'; - $result = $util->runAsFile($file); - - assert('$result == $file'); diff --git a/main/inc/lib/htmlpurifier/maintenance/regenerate-docs.sh b/main/inc/lib/htmlpurifier/maintenance/regenerate-docs.sh deleted file mode 100755 index 6f4d720ff3..0000000000 --- a/main/inc/lib/htmlpurifier/maintenance/regenerate-docs.sh +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/bash -e -./compile-doxygen.sh -cd ../docs -scp doxygen.tgz htmlpurifier.org:/home/ezyang/htmlpurifier.org -ssh htmlpurifier.org "cd /home/ezyang/htmlpurifier.org && ./reload-docs.sh" diff --git a/main/inc/lib/htmlpurifier/maintenance/remove-trailing-whitespace.php b/main/inc/lib/htmlpurifier/maintenance/remove-trailing-whitespace.php deleted file mode 100755 index 857870546a..0000000000 --- a/main/inc/lib/htmlpurifier/maintenance/remove-trailing-whitespace.php +++ /dev/null @@ -1,37 +0,0 @@ -#!/usr/bin/php -globr('.', '{,.}*', GLOB_BRACE); -foreach ($files as $file) { - if ( - !is_file($file) || - prefix_is('./.git', $file) || - prefix_is('./docs/doxygen', $file) || - postfix_is('.ser', $file) || - postfix_is('.tgz', $file) || - postfix_is('.patch', $file) || - postfix_is('.dtd', $file) || - postfix_is('.ent', $file) || - $file == './library/HTMLPurifier/Lexer/PH5P.php' || - $file == './maintenance/PH5P.php' - ) continue; - $contents = file_get_contents($file); - $result = preg_replace('/^(.*?)[ \t]+(\r?)$/m', '\1\2', $contents, -1, $count); - if (!$count) continue; - echo "$file\n"; - file_put_contents($file, $result); -} - -// vim: et sw=4 sts=4 diff --git a/main/inc/lib/htmlpurifier/maintenance/rename-config.php b/main/inc/lib/htmlpurifier/maintenance/rename-config.php deleted file mode 100755 index 6e59e2a791..0000000000 --- a/main/inc/lib/htmlpurifier/maintenance/rename-config.php +++ /dev/null @@ -1,84 +0,0 @@ -#!/usr/bin/php -buildFile($interchange, $file); -$contents = file_get_contents($file); - -if (strpos($contents, "\r\n") !== false) { - $nl = "\r\n"; -} elseif (strpos($contents, "\r") !== false) { - $nl = "\r"; -} else { - $nl = "\n"; -} - -// replace name with new name -$contents = str_replace($old, $new, $contents); - -if ($interchange->directives[$old]->aliases) { - $pos_alias = strpos($contents, 'ALIASES:'); - $pos_ins = strpos($contents, $nl, $pos_alias); - if ($pos_ins === false) $pos_ins = strlen($contents); - $contents = - substr($contents, 0, $pos_ins) . ", $old" . substr($contents, $pos_ins); - file_put_contents($file, $contents); -} else { - $lines = explode($nl, $contents); - $insert = false; - foreach ($lines as $n => $line) { - if (strncmp($line, '--', 2) === 0) { - $insert = $n; - break; - } - } - if (!$insert) { - $lines[] = "ALIASES: $old"; - } else { - array_splice($lines, $insert, 0, "ALIASES: $old"); - } - file_put_contents($file, implode($nl, $lines)); -} - -rename("$old.txt", "$new.txt") || exit(1); diff --git a/main/inc/lib/htmlpurifier/maintenance/update-config.php b/main/inc/lib/htmlpurifier/maintenance/update-config.php deleted file mode 100755 index 2d8a7a9c10..0000000000 --- a/main/inc/lib/htmlpurifier/maintenance/update-config.php +++ /dev/null @@ -1,34 +0,0 @@ -#!/usr/bin/php -set and $config->get to the new - * format, as described by docs/dev-config-bcbreaks.txt - */ - -$FS = new FSTools(); -chdir(dirname(__FILE__) . '/..'); -$raw_files = $FS->globr('.', '*.php'); -foreach ($raw_files as $file) { - $file = substr($file, 2); // rm leading './' - if (strpos($file, 'library/standalone/') === 0) continue; - if (strpos($file, 'maintenance/update-config.php') === 0) continue; - if (strpos($file, 'test-settings.php') === 0) continue; - if (substr_count($file, '.') > 1) continue; // rm meta files - // process the file - $contents = file_get_contents($file); - $contents = preg_replace( - "#config->(set|get)\('(.+?)', '(.+?)'#", - "config->\\1('\\2.\\3'", - $contents - ); - if ($contents === '') continue; - file_put_contents($file, $contents); -} - -// vim: et sw=4 sts=4 diff --git a/main/inc/lib/htmlpurifier/maintenance/update-freshmeat.php b/main/inc/lib/htmlpurifier/maintenance/update-freshmeat.php deleted file mode 100755 index 5295c04300..0000000000 --- a/main/inc/lib/htmlpurifier/maintenance/update-freshmeat.php +++ /dev/null @@ -1,156 +0,0 @@ -#!/usr/bin/php - 'utf-8', - ); - - /** - * This array defines shortcut method signatures for dealing with simple - * XML RPC methods. More complex ones (publish_release) should use the named parameter - * syntax. - */ - public $signatures = array( - 'login' => array('username', 'password'), - 'fetch_branch_list' => array('project_name'), - 'fetch_release' => array('project_name', 'branch_name', 'version'), - 'withdraw_release' => array('project_name', 'branch_name', 'version'), - ); - - protected $sid = null; - - /** - * @param $username Username to login with - * @param $password Password to login with - */ - public function __construct($username = null, $password = null) { - if ($username && $password) { - $this->login($username, $password); - } - } - - /** - * Performs a raw XML RPC call to self::URL - */ - protected function call($method, $params) { - $request = xmlrpc_encode_request($method, $params, $this->encodeOptions); - $ch = curl_init(); - curl_setopt($ch, CURLOPT_URL, self::URL); - curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); - curl_setopt($ch, CURLOPT_TIMEOUT, 1); - curl_setopt($ch, CURLOPT_HTTPHEADER, array( - 'Content-type: text/xml', - 'Content-length: ' . strlen($request) - )); - curl_setopt($ch, CURLOPT_POSTFIELDS, $request); - $data = curl_exec($ch); - if ($errno = curl_errno($ch)) { - throw new Exception("Curl error [$errno]: " . curl_error($ch)); - } else { - curl_close($ch); - return xmlrpc_decode($data); - } - } - - /** - * Performs an XML RPC call to Freshmeat. - * @param $name Name of method to call, can be methodName or method_name - * @param $args Arguments of call, in form array('key1', 'val1', 'key2' ...) - */ - public function __call($name, $args) { - $method = $this->camelToUnderscore($name); - $params = array(); - if ($this->sid) $params['SID'] = $this->sid; - if (isset($this->signatures[$method])) { - for ($i = 0, $c = count($this->signatures[$method]); $i < $c; $i++) { - $params[$this->signatures[$method][$i]] = $args[$i]; - } - } else { - for ($i = 0, $c = count($args); $i + 1 < $c; $i += 2) { - $params[$args[$i]] = $args[$i + 1]; - } - } - $result = $this->call($method, $params); - switch ($method) { - case 'login': - $this->sid = $result['SID']; - break; - case 'logout': - $this->sid = null; - break; - } - if ($this->chatty) print_r($result); - return $result; - } - - /** - * Munge methodName to method_name - */ - private function camelToUnderscore($name) { - $method = ''; - for ($i = 0, $c = strlen($name); $i < $c; $i++) { - $v = $name[$i]; - if (ctype_lower($v)) $method .= $v; - else $method .= '_' . strtolower($v); - } - return $method; - } - - /** - * Automatically logout at end of scope - */ - public function __destruct() { - if ($this->sid) $this->logout(); - } - -} - -$rpc = new XmlRpc_Freshmeat($argv[1], $argv[2]); -$rpc->chatty = true; - -$project = 'htmlpurifier'; -$branch = 'Default'; -$version = file_get_contents('../VERSION'); - -$result = $rpc->fetchRelease($project, $branch, $version); -if (!isset($result['faultCode'])) { - echo "Freshmeat release already exists.\n"; - exit(0); -} - -$changes = strtr(file_get_contents('../WHATSNEW'), array("\r" => '', "\n" => ' ')); -$focus = (int) trim(file_get_contents('../FOCUS')); - -if (strlen($changes) > 600) { - echo "WHATSNEW entry is too long.\n"; - exit(1); -} - -$rpc->publishRelease( - 'project_name', $project, - 'branch_name', $branch, - 'version', $version, - 'changes', $changes, - 'release_focus', $focus, - 'url_tgz', "http://htmlpurifier.org/releases/htmlpurifier-$version.tar.gz", - 'url_zip', "http://htmlpurifier.org/releases/htmlpurifier-$version.zip", - 'url_changelog', "http://htmlpurifier.org/svnroot/htmlpurifier/tags/$version/NEWS" -); - -// vim: et sw=4 sts=4 diff --git a/main/inc/lib/htmlpurifier/plugins/index.html b/main/inc/lib/htmlpurifier/plugins/index.html deleted file mode 100755 index aa7b9c934b..0000000000 --- a/main/inc/lib/htmlpurifier/plugins/index.html +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/main/inc/lib/htmlpurifier/plugins/modx.txt b/main/inc/lib/htmlpurifier/plugins/modx.txt deleted file mode 100755 index 0763821b50..0000000000 --- a/main/inc/lib/htmlpurifier/plugins/modx.txt +++ /dev/null @@ -1,112 +0,0 @@ - -MODx Plugin - -MODx is an open source PHP application framework. -I first came across them in my referrer logs when tillda asked if anyone -could implement an HTML Purifier plugin. This forum thread - eventually resulted -in the fruition of this plugin that davidm says, "is on top of my favorite -list." HTML Purifier goes great with WYSIWYG editors! - - - -1. Credits - -PaulGregory wrote the overall structure of the code. I added the -slashes hack. - - - -2. Install - -First, you need to place HTML Purifier library somewhere. The code here -assumes that you've placed in MODx's assets/plugins/htmlpurifier (no version -number). - -Log into the manager, and navigate: - -Resources > Manage Resources > Plugins tab > New Plugin - -Type in a name (probably HTML Purifier), and copy paste this code into the -textarea: - --------------------------------------------------------------------------------- -$e = &$modx->Event; -if ($e->name == 'OnBeforeDocFormSave') { - global $content; - - include_once '../assets/plugins/htmlpurifier/library/HTMLPurifier.auto.php'; - $purifier = new HTMLPurifier(); - - static $magic_quotes = null; - if ($magic_quotes === null) { - // this is an ugly hack because this hook hasn't - // had the backslashes removed yet when magic_quotes_gpc is on, - // but HTMLPurifier must not have the quotes slashed. - $magic_quotes = get_magic_quotes_gpc(); - } - - if ($magic_quotes) $content = stripslashes($content); - $content = $purifier->purify($content); - if ($magic_quotes) $content = addslashes($content); -} --------------------------------------------------------------------------------- - -Then navigate to the System Events tab and check "OnBeforeDocFormSave". -Save the plugin. HTML Purifier now is integrated! - - - -3. Making sure it works - -You can test HTML Purifier by deliberately putting in crappy HTML and seeing -whether or not it gets fixed. A better way is to put in something like this: - -

          Il est bon

          - -...and seeing whether or not the content comes out as: - -

          Il est bon

          - -(lang to xml:lang synchronization is one of the many features HTML Purifier -has). - - - -4. Caveat Emptor - -This code does not intercept save requests from the QuickEdit plugin, this may -be added in a later version. It also modifies things on save, so there's a -slight chance that HTML Purifier may make a boo-boo and accidently mess things -up (the original version is not saved). - -Finally, make sure that MODx is using UTF-8. If you are using, say, a French -localisation, you may be using Latin-1, if that's the case, configure -HTML Purifier properly like this: - -$config = HTMLPurifier_Config::createDefault(); -$config->set('Core', 'Encoding', 'ISO-8859-1'); // or whatever encoding -$purifier = new HTMLPurifier($config); - - - -5. Known Bugs - -'rn' characters sometimes mysteriously appear after purification. We are -currently investigating this issue. See: - - - -6. See Also - -A modified version of Jot 1.1.3 is available, which integrates with HTML -Purifier. You can check it out here: - - -X. Changelog - -2008-06-16 -- Updated code to work with 3.1.0 and later -- Add Known Bugs and See Also section - - vim: et sw=4 sts=4 diff --git a/main/inc/lib/htmlpurifier/plugins/phorum/.gitignore b/main/inc/lib/htmlpurifier/plugins/phorum/.gitignore deleted file mode 100755 index 8325e09020..0000000000 --- a/main/inc/lib/htmlpurifier/plugins/phorum/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -migrate.php -htmlpurifier/* diff --git a/main/inc/lib/htmlpurifier/plugins/phorum/Changelog b/main/inc/lib/htmlpurifier/plugins/phorum/Changelog deleted file mode 100755 index 9f939e54ae..0000000000 --- a/main/inc/lib/htmlpurifier/plugins/phorum/Changelog +++ /dev/null @@ -1,27 +0,0 @@ -Changelog HTMLPurifier : Phorum Mod -||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| - -= KEY ==================== - # Breaks back-compat - ! Feature - - Bugfix - + Sub-comment - . Internal change -========================== - -Version 4.0.0 for Phorum 5.2, released July 9, 2009 -# Works only with HTML Purifier 4.0.0 -! Better installation documentation -- Fixed double encoded quotes -- Fixed fatal error when migrate.php is blank - -Version 3.0.0 for Phorum 5.2, released January 12, 2008 -# WYSIWYG and suppress_message options are now configurable via web - interface. -- Module now compatible with Phorum 5.2, primary bugs were in migration - code as well as signature and edit message handling. This module is NOT - compatible with Phorum 5.1. -- Buggy WYSIWYG mode refined -. AutoFormatParam added to list of default configuration namespaces - - vim: et sw=4 sts=4 diff --git a/main/inc/lib/htmlpurifier/plugins/phorum/INSTALL b/main/inc/lib/htmlpurifier/plugins/phorum/INSTALL deleted file mode 100755 index 23c76fc5c6..0000000000 --- a/main/inc/lib/htmlpurifier/plugins/phorum/INSTALL +++ /dev/null @@ -1,84 +0,0 @@ - -Install - How to install the Phorum HTML Purifier plugin - -0. PREREQUISITES ----------------- -This Phorum module only works on PHP5 and with HTML Purifier 4.0.0 -or later. - -1. UNZIP --------- -Unzip phorum-htmlpurifier-x.y.z, producing an htmlpurifier folder. -You've already done this step if you're reading this! - -2. MOVE -------- -Move the htmlpurifier folder to the mods/ folder of your Phorum -installation, so the directory structure looks like: - -phorum/ - mods/ - htmlpurifier/ - INSTALL - this install file - info.txt, ... - the module files - htmlpurifier/ - -3. INSTALL HTML PURIFIER ------------------------- -Download and unzip HTML Purifier . Place the contents of -the library/ folder in the htmlpurifier/htmlpurifier folder. Your directory -structure will look like: - -phorum/ - mods/ - htmlpurifier/ - htmlpurifier/ - HTMLPurifier.auto.php - ... - other files - HTMLPurifier/ - -Advanced users: - If you have HTML Purifier installed elsewhere on your server, - all you need is an HTMLPurifier.auto.php file in the library folder which - includes the HTMLPurifier.auto.php file in your install. - -4. MIGRATE ----------- -If you're setting up a new Phorum installation, all you need to do is create -a blank migrate.php file in the htmlpurifier module folder (NOT the library -folder. - -If you have an old Phorum installation and was using BBCode, -copy migrate.bbcode.php to migrate.php. If you were using a different input -format, follow the instructions in migrate.bbcode.php to create your own custom -migrate.php file. - -Your directory structure should now look like this: - -phorum/ - mods/ - htmlpurifier/ - migrate.php - -5. ENABLE ---------- -Navigate to your Phorum admin panel at http://example.com/phorum/admin.php, -click on Global Settings > Modules, scroll to "HTML Purifier Phorum Mod" and -turn it On. - -6. MIGRATE SIGNATURES ---------------------- -If you're setting up a new Phorum installation, skip this step. - -If you allowed your users to make signatures, navigate to the module settings -page of HTML Purifier (Global Settings > Modules > HTML Purifier Phorum Mod > -Configure), type in "yes" in the "Confirm" box, and press "Migrate." - -ONLY DO THIS ONCE! BE SURE TO BACK UP YOUR DATABASE! - -7. CONFIGURE ------------- -Configure using Edit settings. See that page for more information. - - vim: et sw=4 sts=4 diff --git a/main/inc/lib/htmlpurifier/plugins/phorum/README b/main/inc/lib/htmlpurifier/plugins/phorum/README deleted file mode 100755 index 0524ed39db..0000000000 --- a/main/inc/lib/htmlpurifier/plugins/phorum/README +++ /dev/null @@ -1,45 +0,0 @@ - -HTML Purifier Phorum Mod - Filter your HTML the Standards-Compliant Way! - -This Phorum mod enables HTML posting on Phorum. Under normal circumstances, -this would cause a huge security risk, but because we are running -HTML through HTML Purifier, output is guaranteed to be XSS free and -standards-compliant. - -This mod requires HTML input, and previous markup languages need to be -converted accordingly. Thus, it is vital that you create a 'migrate.php' -file that works with your installation. If you're using the built-in -BBCode formatting, simply move migrate.bbcode.php to that place; for -other markup languages, consult said file for instructions on how -to adapt it to your needs. - - -- NOTE ------------------------------------------------- - You can also run this module in parallel with another - formatting module; this module attempts to place itself - at the end of the filtering chain. However, if any - previous modules produce insecure HTML (for instance, - a JavaScript email obfuscator) they will get cleaned. - -This module will not work if 'migrate.php' is not created, and an improperly -made migration file may *CORRUPT* Phorum, so please take your time to -do this correctly. It should go without saying to *BACKUP YOUR DATABASE* -before attempting anything here. If no migration is necessary, you can -simply create a blank migrate.php file. HTML Purifier is smart and will -not re-migrate already processed messages. However, the original code -is irretrievably lost (we may change this in the future.) - -This module will not automatically migrate user signatures, because this -process may take a long time. After installing the HTML Purifier module and -then configuring 'migrate.php', navigate to Settings and click 'Migrate -Signatures' to migrate all user signatures to HTML. - -All of HTML Purifier's usual functions are configurable via the mod settings -page. If you require custom configuration, create config.php file in -the mod directory that edits a $config variable. Be sure, also, to -set $PHORUM['mod_htmlpurifier']['wysiwyg'] to TRUE if you are using a -WYSIWYG editor (you can do this through a common hook or the web -configuration form). - -Visit HTML Purifier at . - - vim: et sw=4 sts=4 diff --git a/main/inc/lib/htmlpurifier/plugins/phorum/config.default.php b/main/inc/lib/htmlpurifier/plugins/phorum/config.default.php deleted file mode 100755 index e047c0b423..0000000000 --- a/main/inc/lib/htmlpurifier/plugins/phorum/config.default.php +++ /dev/null @@ -1,57 +0,0 @@ -set('HTML.Allowed', - // alphabetically sorted -'a[href|title] -abbr[title] -acronym[title] -b -blockquote[cite] -br -caption -cite -code -dd -del -dfn -div -dl -dt -em -i -img[src|alt|title|class] -ins -kbd -li -ol -p -pre -s -strike -strong -sub -sup -table -tbody -td -tfoot -th -thead -tr -tt -u -ul -var'); -$config->set('AutoFormat.AutoParagraph', true); -$config->set('AutoFormat.Linkify', true); -$config->set('HTML.Doctype', 'XHTML 1.0 Transitional'); -$config->set('Core.AggressivelyFixLt', true); -$config->set('Core.Encoding', $GLOBALS['PHORUM']['DATA']['CHARSET']); // we'll change this eventually -if (strtolower($GLOBALS['PHORUM']['DATA']['CHARSET']) !== 'utf-8') { - $config->set('Core.EscapeNonASCIICharacters', true); -} - -// vim: et sw=4 sts=4 diff --git a/main/inc/lib/htmlpurifier/plugins/phorum/htmlpurifier.php b/main/inc/lib/htmlpurifier/plugins/phorum/htmlpurifier.php deleted file mode 100755 index 6f74fc8c98..0000000000 --- a/main/inc/lib/htmlpurifier/plugins/phorum/htmlpurifier.php +++ /dev/null @@ -1,309 +0,0 @@ - $message){ - if(isset($message['body'])) { - - if ($message_id) { - // we're dealing with a real message, not a fake, so - // there a number of shortcuts that can be taken - - if (isset($message['meta']['htmlpurifier_light'])) { - // format hook was called outside of Phorum's normal - // functions, do the abridged purification - $data[$message_id]['body'] = $purifier->purify($message['body']); - continue; - } - - if (!empty($PHORUM['args']['purge'])) { - // purge the cache, must be below the following if - unset($message['meta']['body_cache']); - } - - if ( - isset($message['meta']['body_cache']) && - isset($message['meta']['body_cache_serial']) && - $message['meta']['body_cache_serial'] == $cache_serial - ) { - // cached version is present, bail out early - $data[$message_id]['body'] = base64_decode($message['meta']['body_cache']); - continue; - } - } - - // migration might edit this array, that's why it's defined - // so early - $updated_message = array(); - - // create the $body variable - if ( - $message_id && // message must be real to migrate - !isset($message['meta']['body_cache_serial']) - ) { - // perform migration - $fake_data = array(); - list($signature, $edit_message) = phorum_htmlpurifier_remove_sig_and_editmessage($message); - $fake_data[$message_id] = $message; - $fake_data = phorum_htmlpurifier_migrate($fake_data); - $body = $fake_data[$message_id]['body']; - $body = str_replace("\n", "\n", $body); - $updated_message['body'] = $body; // save it in - $body .= $signature . $edit_message; // add it back in - } else { - // reverse Phorum's pre-processing - $body = $message['body']; - // order is important - $body = str_replace("\n", "\n", $body); - $body = str_replace(array('<','>','&', '"'), array('<','>','&','"'), $body); - if (!$message_id && defined('PHORUM_CONTROL_CENTER')) { - // we're in control.php, so it was double-escaped - $body = str_replace(array('<','>','&', '"'), array('<','>','&','"'), $body); - } - } - - $body = $purifier->purify($body); - - // dynamically update the cache (MUST BE DONE HERE!) - // this is inefficient because it's one db call per - // cache miss, but once the cache is in place things are - // a lot zippier. - - if ($message_id) { // make sure it's not a fake id - $updated_message['meta'] = $message['meta']; - $updated_message['meta']['body_cache'] = base64_encode($body); - $updated_message['meta']['body_cache_serial'] = $cache_serial; - phorum_db_update_message($message_id, $updated_message); - } - - // must not get overloaded until after we cache it, otherwise - // we'll inadvertently change the original text - $data[$message_id]['body'] = $body; - - } - } - - return $data; -} - -// ----------------------------------------------------------------------- -// This is fragile code, copied from read.php:596 (Phorum 5.2.6). Please -// keep this code in-sync with Phorum - -/** - * Generates a signature based on a message array - */ -function phorum_htmlpurifier_generate_sig($row) { - $phorum_sig = ''; - if(isset($row["user"]["signature"]) - && isset($row['meta']['show_signature']) && $row['meta']['show_signature']==1){ - $phorum_sig=trim($row["user"]["signature"]); - if(!empty($phorum_sig)){ - $phorum_sig="\n\n$phorum_sig"; - } - } - return $phorum_sig; -} - -/** - * Generates an edit message based on a message array - */ -function phorum_htmlpurifier_generate_editmessage($row) { - $PHORUM = $GLOBALS['PHORUM']; - $editmessage = ''; - if(isset($row['meta']['edit_count']) && $row['meta']['edit_count'] > 0) { - $editmessage = str_replace ("%count%", $row['meta']['edit_count'], $PHORUM["DATA"]["LANG"]["EditedMessage"]); - $editmessage = str_replace ("%lastedit%", phorum_date($PHORUM["short_date_time"],$row['meta']['edit_date']), $editmessage); - $editmessage = str_replace ("%lastuser%", $row['meta']['edit_username'], $editmessage); - $editmessage = "\n\n\n\n$editmessage"; - } - return $editmessage; -} - -// End fragile code -// ----------------------------------------------------------------------- - -/** - * Removes the signature and edit message from a message - * @param $row Message passed by reference - */ -function phorum_htmlpurifier_remove_sig_and_editmessage(&$row) { - $signature = phorum_htmlpurifier_generate_sig($row); - $editmessage = phorum_htmlpurifier_generate_editmessage($row); - $replacements = array(); - // we need to remove add as that is the form these - // extra bits are in. - if ($signature) $replacements[str_replace("\n", "\n", $signature)] = ''; - if ($editmessage) $replacements[str_replace("\n", "\n", $editmessage)] = ''; - $row['body'] = strtr($row['body'], $replacements); - return array($signature, $editmessage); -} - -/** - * Indicate that data is fully HTML and not from migration, invalidate - * previous caches - * @note This function could generate the actual cache entries, but - * since there's data missing that must be deferred to the first read - */ -function phorum_htmlpurifier_posting($message) { - $PHORUM = $GLOBALS["PHORUM"]; - unset($message['meta']['body_cache']); // invalidate the cache - $message['meta']['body_cache_serial'] = $PHORUM['mod_htmlpurifier']['body_cache_serial']; - return $message; -} - -/** - * Overload quoting mechanism to prevent default, mail-style quote from happening - */ -function phorum_htmlpurifier_quote($array) { - $PHORUM = $GLOBALS["PHORUM"]; - $purifier =& HTMLPurifier::getInstance(); - $text = $purifier->purify($array[1]); - $source = htmlspecialchars($array[0]); - return "
          \n$text\n
          "; -} - -/** - * Ensure that our format hook is processed last. Also, loads the library. - * @credits - */ -function phorum_htmlpurifier_common() { - - require_once(dirname(__FILE__).'/htmlpurifier/HTMLPurifier.auto.php'); - require(dirname(__FILE__).'/init-config.php'); - - $config = phorum_htmlpurifier_get_config(); - HTMLPurifier::getInstance($config); - - // increment revision.txt if you want to invalidate the cache - $GLOBALS['PHORUM']['mod_htmlpurifier']['body_cache_serial'] = $config->getSerial(); - - // load migration - if (file_exists(dirname(__FILE__) . '/migrate.php')) { - include(dirname(__FILE__) . '/migrate.php'); - } else { - echo 'Error: No migration path specified for HTML Purifier, please check - modes/htmlpurifier/migrate.bbcode.php for instructions on - how to migrate from your previous markup language.'; - exit; - } - - if (!function_exists('phorum_htmlpurifier_migrate')) { - // Dummy function - function phorum_htmlpurifier_migrate($data) {return $data;} - } - -} - -/** - * Pre-emptively performs purification if it looks like a WYSIWYG editor - * is being used - */ -function phorum_htmlpurifier_before_editor($message) { - if (!empty($GLOBALS['PHORUM']['mod_htmlpurifier']['wysiwyg'])) { - if (!empty($message['body'])) { - $body = $message['body']; - // de-entity-ize contents - $body = str_replace(array('<','>','&'), array('<','>','&'), $body); - $purifier =& HTMLPurifier::getInstance(); - $body = $purifier->purify($body); - // re-entity-ize contents - $body = htmlspecialchars($body, ENT_QUOTES, $GLOBALS['PHORUM']['DATA']['CHARSET']); - $message['body'] = $body; - } - } - return $message; -} - -function phorum_htmlpurifier_editor_after_subject() { - // don't show this message if it's a WYSIWYG editor, since it will - // then be handled automatically - if (!empty($GLOBALS['PHORUM']['mod_htmlpurifier']['wysiwyg'])) { - $i = $GLOBALS['PHORUM']['DATA']['MODE']; - if ($i == 'quote' || $i == 'edit' || $i == 'moderation') { - ?> -
          -

          - Notice: HTML has been scrubbed for your safety. - If you would like to see the original, turn off WYSIWYG mode - (consult your administrator for details.) -

          -
          -
          -

          - HTML input is enabled. Make sure you escape all HTML and - angled brackets with &lt; and &gt;. -

          config; - if ($config->get('AutoFormat.AutoParagraph')) { - ?>

          - Auto-paragraphing is enabled. Double - newlines will be converted to paragraphs; for single - newlines, use the pre tag. -

          getDefinition('HTML'); - $allowed = array(); - foreach ($html_definition->info as $name => $x) $allowed[] = "$name"; - sort($allowed); - $allowed_text = implode(', ', $allowed); - ?>

          Allowed tags: .

          -

          -

          - For inputting literal code such as HTML and PHP for display, use - CDATA tags to auto-escape your angled brackets, and pre - to preserve newlines: -

          -
          <pre><![CDATA[
          -Place code here
          -]]></pre>
          -

          - Power users, you can hide this notice with: -

          .htmlpurifier-help {display:none;}
          -

          -
          - Copyright (C) - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - -Also add information on how to contact you by electronic and paper mail. - -You should also get your employer (if you work as a programmer) or your -school, if any, to sign a "copyright disclaimer" for the library, if -necessary. Here is a sample; alter the names: - - Yoyodyne, Inc., hereby disclaims all copyright interest in the - library `Frob' (a library for tweaking knobs) written by James Random Hacker. - - , 1 April 1990 - Ty Coon, President of Vice - -That's all there is to it! - - vim: et sw=4 sts=4 diff --git a/main/inc/lib/htmlpurifier/plugins/phorum/htmlpurifier/README b/main/inc/lib/htmlpurifier/plugins/phorum/htmlpurifier/README deleted file mode 100755 index 7df1ebeda8..0000000000 --- a/main/inc/lib/htmlpurifier/plugins/phorum/htmlpurifier/README +++ /dev/null @@ -1,3 +0,0 @@ -The contents of the library/ folder should be here. - - vim: et sw=4 sts=4 diff --git a/main/inc/lib/htmlpurifier/plugins/phorum/htmlpurifier/index.html b/main/inc/lib/htmlpurifier/plugins/phorum/htmlpurifier/index.html deleted file mode 100755 index aa7b9c934b..0000000000 --- a/main/inc/lib/htmlpurifier/plugins/phorum/htmlpurifier/index.html +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/main/inc/lib/htmlpurifier/plugins/phorum/index.html b/main/inc/lib/htmlpurifier/plugins/phorum/index.html deleted file mode 100755 index aa7b9c934b..0000000000 --- a/main/inc/lib/htmlpurifier/plugins/phorum/index.html +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/main/inc/lib/htmlpurifier/plugins/phorum/info.txt b/main/inc/lib/htmlpurifier/plugins/phorum/info.txt deleted file mode 100755 index 7234654901..0000000000 --- a/main/inc/lib/htmlpurifier/plugins/phorum/info.txt +++ /dev/null @@ -1,18 +0,0 @@ -title: HTML Purifier Phorum Mod -desc: This module enables standards-compliant HTML filtering on Phorum. Please check migrate.bbcode.php before enabling this mod. -author: Edward Z. Yang -url: http://htmlpurifier.org/ -version: 4.0.0 - -hook: format|phorum_htmlpurifier_format -hook: quote|phorum_htmlpurifier_quote -hook: posting_custom_action|phorum_htmlpurifier_posting -hook: common|phorum_htmlpurifier_common -hook: before_editor|phorum_htmlpurifier_before_editor -hook: tpl_editor_after_subject|phorum_htmlpurifier_editor_after_subject - -# This module is meant to be a drop-in for bbcode, so make it run last. -priority: run module after * -priority: run hook format after * - - vim: et sw=4 sts=4 diff --git a/main/inc/lib/htmlpurifier/plugins/phorum/init-config.php b/main/inc/lib/htmlpurifier/plugins/phorum/init-config.php deleted file mode 100755 index aa7b15599a..0000000000 --- a/main/inc/lib/htmlpurifier/plugins/phorum/init-config.php +++ /dev/null @@ -1,28 +0,0 @@ -'; -phorum_htmlpurifier_show_form(); - -// vim: et sw=4 sts=4 diff --git a/main/inc/lib/htmlpurifier/plugins/phorum/settings/form.php b/main/inc/lib/htmlpurifier/plugins/phorum/settings/form.php deleted file mode 100755 index a47a5fae7d..0000000000 --- a/main/inc/lib/htmlpurifier/plugins/phorum/settings/form.php +++ /dev/null @@ -1,93 +0,0 @@ -hidden("module", "modsettings"); - $frm->hidden("mod", "htmlpurifier"); // this is the directory name that the Settings file lives in - - if (!empty($error)){ - echo "$error
          "; - } - - $frm->addbreak("Edit settings for the HTML Purifier module"); - - $frm->addMessage('

          The box below sets $PHORUM[\'mod_htmlpurifier\'][\'wysiwyg\']. - When checked, contents sent for edit are now purified and the - informative message is disabled. If your WYSIWYG editor is disabled for - admin edits, you can safely keep this unchecked.

          '); - $frm->addRow('Use WYSIWYG?', $frm->checkbox('wysiwyg', '1', '', $PHORUM['mod_htmlpurifier']['wysiwyg'])); - - $frm->addMessage('

          The box below sets $PHORUM[\'mod_htmlpurifier\'][\'suppress_message\'], - which removes the big how-to use - HTML Purifier message.

          '); - $frm->addRow('Suppress information?', $frm->checkbox('suppress_message', '1', '', $PHORUM['mod_htmlpurifier']['suppress_message'])); - - $frm->addMessage('

          Click on directive links to read what each option does - (links do not open in new windows).

          -

          For more flexibility (for instance, you want to edit the full - range of configuration directives), you can create a config.php - file in your mods/htmlpurifier/ directory. Doing so will, - however, make the web configuration interface unavailable.

          '); - - require_once 'HTMLPurifier/Printer/ConfigForm.php'; - $htmlpurifier_form = new HTMLPurifier_Printer_ConfigForm('config', 'http://htmlpurifier.org/live/configdoc/plain.html#%s'); - $htmlpurifier_form->setTextareaDimensions(23, 7); // widen a little, since we have space - - $frm->addMessage($htmlpurifier_form->render( - $config, $PHORUM['mod_htmlpurifier']['directives'], false)); - - $frm->addMessage("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."); - - $frm->addrow('Reset to defaults:', $frm->checkbox("reset", "1", "", false)); - - // hack to include extra styling - echo ''; - $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. -

          - - - - - - \ No newline at end of file diff --git a/main/inc/lib/htmlpurifier/plugins/phorum/settings/migrate-sigs-form.php b/main/inc/lib/htmlpurifier/plugins/phorum/settings/migrate-sigs-form.php deleted file mode 100755 index 2d63ebe483..0000000000 --- a/main/inc/lib/htmlpurifier/plugins/phorum/settings/migrate-sigs-form.php +++ /dev/null @@ -1,22 +0,0 @@ -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/main/inc/lib/htmlpurifier/plugins/phorum/settings/migrate-sigs.php b/main/inc/lib/htmlpurifier/plugins/phorum/settings/migrate-sigs.php deleted file mode 100755 index 81c1f0ba91..0000000000 --- a/main/inc/lib/htmlpurifier/plugins/phorum/settings/migrate-sigs.php +++ /dev/null @@ -1,77 +0,0 @@ -$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/main/inc/lib/htmlpurifier/plugins/phorum/settings/save.php b/main/inc/lib/htmlpurifier/plugins/phorum/settings/save.php deleted file mode 100755 index 7dbb767d0f..0000000000 --- a/main/inc/lib/htmlpurifier/plugins/phorum/settings/save.php +++ /dev/null @@ -1,27 +0,0 @@ -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/main/inc/lib/security.lib.php b/main/inc/lib/security.lib.php index 04e937cf1f..e9f864974b 100755 --- a/main/inc/lib/security.lib.php +++ b/main/inc/lib/security.lib.php @@ -314,10 +314,6 @@ class Security static $purifier = array(); if (!isset($purifier[$user_status])) { - if (!class_exists('HTMLPurifier')) { - // Lazy loading. - require realpath(__DIR__).'/htmlpurifier/library/HTMLPurifier.auto.php'; - } $cache_dir = api_get_path(SYS_ARCHIVE_PATH).'Serializer'; if (!file_exists($cache_dir)) { mkdir($cache_dir, 0777); diff --git a/main/install/index.php b/main/install/index.php index c66e9bf160..c7e537b6f5 100755 --- a/main/install/index.php +++ b/main/install/index.php @@ -39,7 +39,7 @@ api_check_php_version('../inc/'); ob_implicit_flush(true); session_start(); -require_once api_get_path(SYS_PATH).'main/inc/autoload.inc.php'; +require_once api_get_path(SYS_PATH).'vendor/autoload.php'; require_once api_get_path(LIBRARY_PATH).'database.lib.php'; require_once api_get_path(LIBRARY_PATH).'log.class.php'; require_once 'install.lib.php'; @@ -477,8 +477,8 @@ if ($encryptPassForm == '1') {

      - -

      '.get_lang('ChamiloInstallation').' – '.get_lang('Version_').' '.$new_version.'

      '; ?>
      @@ -500,11 +500,11 @@ if ($encryptPassForm == '1') {
      - +
      - +
      -'.display_step_sequence().$msg.'
      '.get_lang('PleaseWaitThisCouldTakeAWhile').'
      '; - - + + // Push the web server to send these strings before we start the real // installation process flush(); @@ -753,7 +753,7 @@ if (@$_POST['step2']) { if (!empty($f)) { ob_flush(); //#5565 } - + if ($installType == 'update') { require_once api_get_path(LIBRARY_PATH).'fileUpload.lib.php'; @@ -778,16 +778,16 @@ if (@$_POST['step2']) { } elseif ($userPasswordCrypted == '0') { $userPasswordCrypted = 'none'; } - + //Setting the single db form - if (in_array($_POST['old_version'], $update_from_version_6)) { - $singleDbForm = get_config_param('singleDbEnabled'); + if (in_array($_POST['old_version'], $update_from_version_6)) { + $singleDbForm = get_config_param('singleDbEnabled'); } else { - $singleDbForm = isset($_configuration['single_database']) ? $_configuration['single_database'] : false; + $singleDbForm = isset($_configuration['single_database']) ? $_configuration['single_database'] : false; } - + Log::notice("singledbForm: '$singleDbForm'"); - + Database::query("SET storage_engine = MYISAM;"); if (version_compare($my_old_version, '1.8.7', '>=')) { diff --git a/main/work/file.php b/main/work/file.php index 42549187bc..6b8abe1833 100755 --- a/main/work/file.php +++ b/main/work/file.php @@ -4,25 +4,25 @@ Use Model\StudentPublication; Use Model\Course; /** - * Return either - * + * Return either + * * - one work item (file) * - several work items (files) zipped together - * + * * Used to transfer files to another application through http. - * + * * Script parameters: - * - * - id id(s) of the work item id=1 or id=1,2,4 + * + * - id id(s) of the work item id=1 or id=1,2,4 * - cidReq course code - * + * * Note this script enables key authentication so access with a key token is possible. - * + * * @package chamilo.document * @license see /license.txt * @author Laurent Opprecht for the Univesity of Geneva */ -require_once __DIR__ . '/../inc/autoload.inc.php'; +require_once __DIR__ . '/../../vendor/autoload.php'; KeyAuth::enable(); require_once __DIR__ . '/../inc/global.inc.php'; @@ -41,7 +41,7 @@ $course = Course::current(); /** * No files requested. We make sure we return 404 error to tell the client - * that the call failed. + * that the call failed. */ if (count($ids) == 0 || empty($course)) { Response::not_found(); @@ -69,7 +69,7 @@ if (count($ids) == 1) { } /** - * one folder requested + * one folder requested */ $items = array(); $children = $pub->get_children(); @@ -93,7 +93,7 @@ if (count($ids) == 1) { } /** - * Several files requested. In this case we zip them together. + * Several files requested. In this case we zip them together. */ $items = array(); foreach ($ids as $id) { @@ -105,19 +105,19 @@ foreach ($ids as $id) { $items[] = $pub; } /** - * We ignore folders + * We ignore folders */ } /** - * Requested files may not be accessible. + * Requested files may not be accessible. */ if (count($items) == 0) { Response::not_found(); } /** - * Zip files together. + * Zip files together. */ $zip = Chamilo::temp_zip(); foreach ($items as $item) { @@ -127,7 +127,7 @@ foreach ($items as $item) { } /** - * Send file for download + * Send file for download */ event_download(Uri::here()); -DocumentManager::file_send_for_download($zip->get_path(), false, get_lang('StudentPublications') . '.zip'); \ No newline at end of file +DocumentManager::file_send_for_download($zip->get_path(), false, get_lang('StudentPublications') . '.zip'); diff --git a/tests/phpunit/autoload.php b/tests/phpunit/autoload.php index 74a7bd9db6..d0c8660866 100755 --- a/tests/phpunit/autoload.php +++ b/tests/phpunit/autoload.php @@ -1,2 +1,2 @@ prefixesPsr0)) { return call_user_func_array('array_merge', $this->prefixesPsr0); } + return array(); } diff --git a/vendor/composer/autoload_classmap.php b/vendor/composer/autoload_classmap.php index 7a91153b0d..c80b0f0c37 100755 --- a/vendor/composer/autoload_classmap.php +++ b/vendor/composer/autoload_classmap.php @@ -6,4 +6,1409 @@ $vendorDir = dirname(dirname(__FILE__)); $baseDir = dirname($vendorDir); return array( + 'AMFReader' => $baseDir . '/main/inc/lib/getid3/module.audio-video.flv.php', + 'AMFStream' => $baseDir . '/main/inc/lib/getid3/module.audio-video.flv.php', + 'Absolute_Positioner' => $baseDir . '/main/inc/lib/phpdocx/pdf/include/absolute_positioner.cls.php', + 'AbstractLink' => $baseDir . '/main/gradebook/lib/be/abstractlink.class.php', + 'AbstractVM' => $baseDir . '/plugin/bbb/lib/vm/AbstractVM.php', + 'Abstract_Renderer' => $baseDir . '/main/inc/lib/phpdocx/pdf/include/abstract_renderer.cls.php', + 'Access' => $baseDir . '/main/inc/lib/access.class.php', + 'AccessAll' => $baseDir . '/main/inc/lib/access.class.php', + 'AccessForbidden' => $baseDir . '/main/inc/lib/access.class.php', + 'AccessToken' => $baseDir . '/main/inc/lib/access_token.class.php', + 'Accessurleditcoursestourl' => $baseDir . '/main/inc/lib/access_url_edit_courses_to_url_functions.lib.php', + 'Accessurleditsessionstourl' => $baseDir . '/main/inc/lib/access_url_edit_sessions_to_url_functions.lib.php', + 'Accessurledituserstourl' => $baseDir . '/main/inc/lib/access_url_edit_users_to_url_functions.lib.php', + 'AddCourseToSession' => $baseDir . '/main/inc/lib/add_courses_to_session_functions.lib.php', + 'AddManySessionToCategoryFunctions' => $baseDir . '/main/inc/lib/add_many_session_to_category_functions.lib.php', + 'AdminPage' => $baseDir . '/main/admin/admin_page.class.php', + 'Adminer' => $baseDir . '/main/admin/db.php', + 'Aiken2Question' => $baseDir . '/main/exercice/export/aiken/aiken_classes.php', + 'AikenAnswerMultipleChoice' => $baseDir . '/main/exercice/export/aiken/aiken_classes.php', + 'AjaxController' => $baseDir . '/main/inc/lib/ajax_controller.class.php', + 'AmazonVM' => $baseDir . '/plugin/bbb/lib/vm/AmazonVM.php', + 'Announcement' => $baseDir . '/main/coursecopy/classes/Announcement.class.php', + 'Answer' => $baseDir . '/main/exercice/answer.class.php', + 'AppPlugin' => $baseDir . '/main/inc/lib/plugin.lib.php', + 'AssetAggregatedRenderer' => $baseDir . '/main/inc/lib/system/media/renderer/asset_aggregated_renderer.class.php', + 'AssetGoogleCalendarRenderer' => $baseDir . '/main/inc/lib/system/media/renderer/lab/asset_google_calendar_renderer.class.php', + 'AssetGoogleDocumentRenderer' => $baseDir . '/main/inc/lib/system/media/renderer/protocol/asset_google_document_renderer.class.php', + 'AssetGoogleDocumentViewerRenderer' => $baseDir . '/main/inc/lib/system/media/renderer/protocol/asset_google_document_viewer_renderer.class.php', + 'AssetGoogleMapRenderer' => $baseDir . '/main/inc/lib/system/media/renderer/protocol/asset_google_map_renderer.class.php', + 'AssetGoogleWidgetRenderer' => $baseDir . '/main/inc/lib/system/media/renderer/protocol/asset_google_widget_renderer.class.php', + 'AssetImageRenderer' => $baseDir . '/main/inc/lib/system/media/renderer/protocol/asset_image_renderer.class.php', + 'AssetMaharaGroupRenderer' => $baseDir . '/main/inc/lib/system/media/renderer/lab/asset_mahara_group_renderer.class.php', + 'AssetMaharaPersonRenderer' => $baseDir . '/main/inc/lib/system/media/renderer/lab/asset_mahara_person_renderer.class.php', + 'AssetMediaRenderer' => $baseDir . '/main/inc/lib/system/media/renderer/protocol/asset_media_renderer.class.php', + 'AssetMediaserverRenderer' => $baseDir . '/main/inc/lib/system/media/renderer/protocol/asset_mediaserver_renderer.class.php', + 'AssetOembedRenderer' => $baseDir . '/main/inc/lib/system/media/renderer/protocol/asset_oembed_renderer.class.php', + 'AssetOgRenderer' => $baseDir . '/main/inc/lib/system/media/renderer/protocol/asset_og_renderer.class.php', + 'AssetPageRenderer' => $baseDir . '/main/inc/lib/system/media/renderer/protocol/asset_page_renderer.class.php', + 'AssetRenderer' => $baseDir . '/main/inc/lib/system/media/renderer/asset_renderer.class.php', + 'AssetRssRenderer' => $baseDir . '/main/inc/lib/system/media/renderer/protocol/asset_rss_renderer.class.php', + 'AssetScratchRenderer' => $baseDir . '/main/inc/lib/system/media/renderer/protocol/asset_scratch_renderer.class.php', + 'AssetWikiRenderer' => $baseDir . '/main/inc/lib/system/media/renderer/lab/asset_wiki_renderer.class.php', + 'Attendance' => $baseDir . '/main/inc/lib/attendance.lib.php', + 'AttendanceLink' => $baseDir . '/main/gradebook/lib/be/attendancelink.class.php', + 'Attribute_Translator' => $baseDir . '/main/inc/lib/phpdocx/pdf/include/attribute_translator.cls.php', + 'Auth' => $baseDir . '/main/inc/lib/auth.lib.php', + 'AutoLoader' => $baseDir . '/main/inc/lib/phpdocx/classes/AutoLoader.inc', + 'Autoload' => $baseDir . '/main/inc/lib/autoload.class.php', + 'AutoloadClassFinder' => $baseDir . '/main/inc/lib/autoload.class.php', + 'BBBPlugin' => $baseDir . '/plugin/bbb/lib/bbb_plugin.class.php', + 'BaseFacebook' => $baseDir . '/main/auth/external_login/facebook-php-sdk/src/base_facebook.php', + 'BigBlueButtonBN' => $baseDir . '/plugin/bbb/lib/bbb_api.php', + 'BlockCourse' => $baseDir . '/plugin/dashboard/block_course/block_course.class.php', + 'BlockDaily' => $baseDir . '/plugin/dashboard/block_daily/block_daily.class.php', + 'BlockEvaluationGraph' => $baseDir . '/plugin/dashboard/block_evaluation_graph/block_evaluation_graph.class.php', + 'BlockGlobalInfo' => $baseDir . '/plugin/dashboard/block_global_info/block_global_info.class.php', + 'BlockSession' => $baseDir . '/plugin/dashboard/block_session/block_session.class.php', + 'BlockStudent' => $baseDir . '/plugin/dashboard/block_student/block_student.class.php', + 'BlockStudentGraph' => $baseDir . '/plugin/dashboard/block_student_graph/block_student_graph.class.php', + 'BlockTeacher' => $baseDir . '/plugin/dashboard/block_teacher/block_teacher.class.php', + 'BlockTeacherGraph' => $baseDir . '/plugin/dashboard/block_teacher_graph/block_teacher_graph.class.php', + 'Block_Frame_Decorator' => $baseDir . '/main/inc/lib/phpdocx/pdf/include/block_frame_decorator.cls.php', + 'Block_Frame_Reflower' => $baseDir . '/main/inc/lib/phpdocx/pdf/include/block_frame_reflower.cls.php', + 'Block_Positioner' => $baseDir . '/main/inc/lib/phpdocx/pdf/include/block_positioner.cls.php', + 'Block_Renderer' => $baseDir . '/main/inc/lib/phpdocx/pdf/include/block_renderer.cls.php', + 'Blog' => $baseDir . '/main/inc/lib/blog.lib.php', + 'Browser' => $baseDir . '/main/inc/lib/browser/Browser.php', + 'BuyCoursesPlugin' => $baseDir . '/plugin/buycourses/src/buy_course_plugin.class.php', + 'CASClient' => $baseDir . '/main/auth/cas/lib/CAS/client.php', + 'CGIF' => $baseDir . '/main/inc/lib/mpdf/classes/gif.php', + 'CGIFCOLORTABLE' => $baseDir . '/main/inc/lib/mpdf/classes/gif.php', + 'CGIFFILEHEADER' => $baseDir . '/main/inc/lib/mpdf/classes/gif.php', + 'CGIFIMAGE' => $baseDir . '/main/inc/lib/mpdf/classes/gif.php', + 'CGIFIMAGEHEADER' => $baseDir . '/main/inc/lib/mpdf/classes/gif.php', + 'CGIFLZW' => $baseDir . '/main/inc/lib/mpdf/classes/gif.php', + 'CPDF_Adapter' => $baseDir . '/main/inc/lib/phpdocx/pdf/include/cpdf_adapter.cls.php', + 'CSS_Color' => $baseDir . '/main/inc/lib/phpdocx/pdf/include/css_color.cls.php', + 'Cache' => $baseDir . '/main/inc/lib/cache.class.php', + 'Cached_PDF_Decorator' => $baseDir . '/main/inc/lib/phpdocx/pdf/include/cached_pdf_decorator.cls.php', + 'CalculatedAnswer' => $baseDir . '/main/exercice/calculated_answer.class.php', + 'Canvas' => $baseDir . '/main/inc/lib/phpdocx/pdf/include/canvas.cls.php', + 'Canvas_Factory' => $baseDir . '/main/inc/lib/phpdocx/pdf/include/canvas_factory.cls.php', + 'Career' => $baseDir . '/main/inc/lib/career.lib.php', + 'CatForm' => $baseDir . '/main/gradebook/lib/fe/catform.class.php', + 'Category' => $baseDir . '/main/gradebook/lib/be/category.class.php', + 'Cellmap' => $baseDir . '/main/inc/lib/phpdocx/pdf/include/cellmap.cls.php', + 'Certificate' => $baseDir . '/main/inc/lib/certificate.lib.php', + 'Cezpdf' => $baseDir . '/main/inc/lib/ezpdf/class.ezpdf.php', + 'Chamilo' => $baseDir . '/main/inc/lib/chamilo.class.php', + 'ChamiloIndexer' => $baseDir . '/main/inc/lib/search/ChamiloIndexer.class.php', + 'ChamiloSession' => $baseDir . '/main/inc/lib/chamilo_session.class.php', + 'Chamilo\\Plugin\\OpenMeetings\\OpenMeetings' => $baseDir . '/plugin/openmeetings/lib/openmeetings.class.php', + 'Chamilo\\Plugin\\OpenMeetings\\Room' => $baseDir . '/plugin/openmeetings/lib/room.class.php', + 'Chamilo\\Plugin\\OpenMeetings\\Session' => $baseDir . '/plugin/openmeetings/lib/session.class.php', + 'Chamilo\\Plugin\\OpenMeetings\\User' => $baseDir . '/plugin/openmeetings/lib/user.class.php', + 'Chat' => $baseDir . '/main/inc/lib/chat.lib.php', + 'ClassManager' => $baseDir . '/main/inc/lib/classmanager.lib.php', + 'Clockwork' => $baseDir . '/plugin/clockworksms/vendor/clockworksms_api.php', + 'ClockworkException' => $baseDir . '/plugin/clockworksms/vendor/exception.php', + 'Clockworksms' => $baseDir . '/plugin/clockworksms/lib/clockworksms.lib.php', + 'ClockworksmsPlugin' => $baseDir . '/plugin/clockworksms/lib/clockworksms_plugin.class.php', + 'ClosureCompiler' => $baseDir . '/main/inc/lib/system/closure_compiler.class.php', + 'CodeUtilities' => $baseDir . '/main/inc/lib/system/code_utilities.class.php', + 'ConditionalLogin' => $baseDir . '/main/inc/lib/conditional_login.class.php', + 'Controller' => $baseDir . '/main/inc/lib/controller.class.php', + 'Converter' => $baseDir . '/main/inc/lib/system/text/converter.class.php', + 'Course' => $baseDir . '/main/coursecopy/classes/Course.class.php', + 'CourseArchiver' => $baseDir . '/main/coursecopy/classes/CourseArchiver.class.php', + 'CourseBuilder' => $baseDir . '/main/coursecopy/classes/CourseBuilder.class.php', + 'CourseCopyLearnpath' => $baseDir . '/main/coursecopy/classes/CourseCopyLearnpath.class.php', + 'CourseCopyTestcategory' => $baseDir . '/main/coursecopy/classes/CourseCopyTestCategory.php', + 'CourseDescription' => $baseDir . '/main/inc/lib/course_description.lib.php', + 'CourseEntity' => $baseDir . '/main/inc/lib/course_entity.class.php', + 'CourseEntityRepository' => $baseDir . '/main/inc/lib/course_entity_repository.class.php', + 'CourseHome' => $baseDir . '/main/inc/lib/course_home.lib.php', + 'CourseLegalPlugin' => $baseDir . '/plugin/courselegal/CourseLegalPlugin.php', + 'CourseManager' => $baseDir . '/main/inc/lib/course.lib.php', + 'CourseRecycler' => $baseDir . '/main/coursecopy/classes/CourseRecycler.class.php', + 'CourseRequestManager' => $baseDir . '/main/inc/lib/course_request.lib.php', + 'CourseRestorer' => $baseDir . '/main/coursecopy/classes/CourseRestorer.class.php', + 'CourseSelectForm' => $baseDir . '/main/coursecopy/classes/CourseSelectForm.class.php', + 'CourseSession' => $baseDir . '/main/coursecopy/classes/CourseSession.class.php', + 'CoursesAndSessionsCatalog' => $baseDir . '/main/inc/lib/CoursesAndSessionsCatalog.class.php', + 'CoursesController' => $baseDir . '/main/auth/courses_controller.php', + 'Cpdf' => $baseDir . '/main/inc/lib/phpdocx/pdf/lib/class.pdf.php', + 'CreateChartRels' => $baseDir . '/main/inc/lib/phpdocx/classes/CreateChartRels.inc', + 'CreateDocx' => $baseDir . '/main/inc/lib/phpdocx/classes/CreateDocx.inc', + 'CreateElement' => $baseDir . '/main/inc/lib/phpdocx/classes/CreateElement.inc', + 'CreateExcelSharedStrings' => $baseDir . '/main/inc/lib/phpdocx/classes/CreateExcelSharedStrings.inc', + 'CreateExcelSheet' => $baseDir . '/main/inc/lib/phpdocx/classes/CreateExcelSheet.inc', + 'CreateExcelTable' => $baseDir . '/main/inc/lib/phpdocx/classes/CreateExcelTable.inc', + 'CreateFontTable' => $baseDir . '/main/inc/lib/phpdocx/classes/CreateFontTable.inc', + 'CreateFooter' => $baseDir . '/main/inc/lib/phpdocx/classes/CreateFooter.inc', + 'CreateFootnote' => $baseDir . '/main/inc/lib/phpdocx/classes/CreateFootnote.inc', + 'CreateGraphic' => $baseDir . '/main/inc/lib/phpdocx/classes/CreateGraphic.inc', + 'CreateHeader' => $baseDir . '/main/inc/lib/phpdocx/classes/CreateHeader.inc', + 'CreateImage' => $baseDir . '/main/inc/lib/phpdocx/classes/CreateImage.inc', + 'CreateLink' => $baseDir . '/main/inc/lib/phpdocx/classes/CreateLink.inc', + 'CreateList' => $baseDir . '/main/inc/lib/phpdocx/classes/CreateList.inc', + 'CreatePage' => $baseDir . '/main/inc/lib/phpdocx/classes/CreatePage.inc', + 'CreateSettings' => $baseDir . '/main/inc/lib/phpdocx/classes/CreateSettings.inc', + 'CreateStyle' => $baseDir . '/main/inc/lib/phpdocx/classes/CreateStyle.inc', + 'CreateStyleTable' => $baseDir . '/main/inc/lib/phpdocx/classes/CreateStyleTable.inc', + 'CreateTable' => $baseDir . '/main/inc/lib/phpdocx/classes/CreateTable.inc', + 'CreateTableContents' => $baseDir . '/main/inc/lib/phpdocx/classes/CreateTableContents.inc', + 'CreateText' => $baseDir . '/main/inc/lib/phpdocx/classes/CreateText.inc', + 'CreateTheme1' => $baseDir . '/main/inc/lib/phpdocx/classes/CreateTheme1.inc', + 'CreateWebSettings' => $baseDir . '/main/inc/lib/phpdocx/classes/CreateWebSettings.inc', + 'CreateXlsx' => $baseDir . '/main/inc/lib/phpdocx/classes/CreateXlsx.inc', + 'Crypt_AES' => $baseDir . '/main/inc/lib/phpseclib/Crypt/AES.php', + 'Crypt_Blowfish' => $baseDir . '/main/inc/lib/phpseclib/Crypt/Blowfish.php', + 'Crypt_DES' => $baseDir . '/main/inc/lib/phpseclib/Crypt/DES.php', + 'Crypt_Hash' => $baseDir . '/main/inc/lib/phpseclib/Crypt/Hash.php', + 'Crypt_RC4' => $baseDir . '/main/inc/lib/phpseclib/Crypt/RC4.php', + 'Crypt_RSA' => $baseDir . '/main/inc/lib/phpseclib/Crypt/RSA.php', + 'Crypt_Rijndael' => $baseDir . '/main/inc/lib/phpseclib/Crypt/Rijndael.php', + 'Crypt_TripleDES' => $baseDir . '/main/inc/lib/phpseclib/Crypt/TripleDES.php', + 'Crypt_Twofish' => $baseDir . '/main/inc/lib/phpseclib/Crypt/Twofish.php', + 'CsvObjectWriter' => $baseDir . '/main/inc/lib/system/io/csv_object_writer.class.php', + 'CsvReader' => $baseDir . '/main/inc/lib/system/io/csv_reader.class.php', + 'CsvWriter' => $baseDir . '/main/inc/lib/system/io/csv_writer.class.php', + 'Curl' => $baseDir . '/main/inc/lib/system/net/curl.class.php', + 'CurrentCourse' => $baseDir . '/main/inc/lib/current_course.class.php', + 'CurrentUser' => $baseDir . '/main/inc/lib/current_user.class.php', + 'CustomPages' => $baseDir . '/main/inc/lib/custom_pages.class.php', + 'CustomServer' => $baseDir . '/plugin/sepe/ws/service.php', + 'DOMPDF' => $baseDir . '/main/inc/lib/phpdocx/pdf/include/dompdf.cls.php', + 'DOMPDF_Exception' => $baseDir . '/main/inc/lib/phpdocx/pdf/include/dompdf_exception.cls.php', + 'DOMPDF_Internal_Exception' => $baseDir . '/main/inc/lib/phpdocx/pdf/include/dompdf_internal_exception.cls.php', + 'DashboardManager' => $baseDir . '/main/inc/lib/dashboard.lib.php', + 'DataForm' => $baseDir . '/main/gradebook/lib/fe/dataform.class.php', + 'Database' => $baseDir . '/main/inc/lib/database.lib.php', + 'DatePicker' => $baseDir . '/main/inc/lib/formvalidator/Element/DatePicker.php', + 'DateRangePicker' => $baseDir . '/main/inc/lib/formvalidator/Element/DateRangePicker.php', + 'DateTimePicker' => $baseDir . '/main/inc/lib/formvalidator/Element/DateTimePicker.php', + 'DateTimeRule' => $baseDir . '/main/inc/lib/formvalidator/Rule/DateTimeRule.php', + 'Debug' => $baseDir . '/main/inc/lib/debug.lib.php', + 'Diagnoser' => $baseDir . '/main/inc/lib/diagnoser.lib.php', + 'DigitalOceanVM' => $baseDir . '/plugin/bbb/lib/vm/DigitalOceanVM.php', + 'Display' => $baseDir . '/main/inc/lib/display.lib.php', + 'DisplayGradebook' => $baseDir . '/main/gradebook/lib/fe/displaygradebook.php', + 'Doctrine\\Common\\Annotations\\Annotation' => $baseDir . '/main/inc/lib/symfony/Doctrine/Common/Annotations/Annotation.php', + 'Doctrine\\Common\\Annotations\\AnnotationException' => $baseDir . '/main/inc/lib/symfony/Doctrine/Common/Annotations/AnnotationException.php', + 'Doctrine\\Common\\Annotations\\AnnotationReader' => $baseDir . '/main/inc/lib/symfony/Doctrine/Common/Annotations/AnnotationReader.php', + 'Doctrine\\Common\\Annotations\\AnnotationRegistry' => $baseDir . '/main/inc/lib/symfony/Doctrine/Common/Annotations/AnnotationRegistry.php', + 'Doctrine\\Common\\Annotations\\Annotation\\Attribute' => $baseDir . '/main/inc/lib/symfony/Doctrine/Common/Annotations/Annotation/Attribute.php', + 'Doctrine\\Common\\Annotations\\Annotation\\Attributes' => $baseDir . '/main/inc/lib/symfony/Doctrine/Common/Annotations/Annotation/Attributes.php', + 'Doctrine\\Common\\Annotations\\Annotation\\IgnoreAnnotation' => $baseDir . '/main/inc/lib/symfony/Doctrine/Common/Annotations/Annotation/IgnoreAnnotation.php', + 'Doctrine\\Common\\Annotations\\Annotation\\Required' => $baseDir . '/main/inc/lib/symfony/Doctrine/Common/Annotations/Annotation/Required.php', + 'Doctrine\\Common\\Annotations\\Annotation\\Target' => $baseDir . '/main/inc/lib/symfony/Doctrine/Common/Annotations/Annotation/Target.php', + 'Doctrine\\Common\\Annotations\\CachedReader' => $baseDir . '/main/inc/lib/symfony/Doctrine/Common/Annotations/CachedReader.php', + 'Doctrine\\Common\\Annotations\\DocLexer' => $baseDir . '/main/inc/lib/symfony/Doctrine/Common/Annotations/DocLexer.php', + 'Doctrine\\Common\\Annotations\\DocParser' => $baseDir . '/main/inc/lib/symfony/Doctrine/Common/Annotations/DocParser.php', + 'Doctrine\\Common\\Annotations\\FileCacheReader' => $baseDir . '/main/inc/lib/symfony/Doctrine/Common/Annotations/FileCacheReader.php', + 'Doctrine\\Common\\Annotations\\IndexedReader' => $baseDir . '/main/inc/lib/symfony/Doctrine/Common/Annotations/IndexedReader.php', + 'Doctrine\\Common\\Annotations\\PhpParser' => $baseDir . '/main/inc/lib/symfony/Doctrine/Common/Annotations/PhpParser.php', + 'Doctrine\\Common\\Annotations\\Reader' => $baseDir . '/main/inc/lib/symfony/Doctrine/Common/Annotations/Reader.php', + 'Doctrine\\Common\\Annotations\\SimpleAnnotationReader' => $baseDir . '/main/inc/lib/symfony/Doctrine/Common/Annotations/SimpleAnnotationReader.php', + 'Doctrine\\Common\\Cache\\ApcCache' => $baseDir . '/main/inc/lib/symfony/Doctrine/Common/Cache/ApcCache.php', + 'Doctrine\\Common\\Cache\\ArrayCache' => $baseDir . '/main/inc/lib/symfony/Doctrine/Common/Cache/ArrayCache.php', + 'Doctrine\\Common\\Cache\\Cache' => $baseDir . '/main/inc/lib/symfony/Doctrine/Common/Cache/Cache.php', + 'Doctrine\\Common\\Cache\\CacheProvider' => $baseDir . '/main/inc/lib/symfony/Doctrine/Common/Cache/CacheProvider.php', + 'Doctrine\\Common\\Cache\\MemcacheCache' => $baseDir . '/main/inc/lib/symfony/Doctrine/Common/Cache/MemcacheCache.php', + 'Doctrine\\Common\\Cache\\MemcachedCache' => $baseDir . '/main/inc/lib/symfony/Doctrine/Common/Cache/MemcachedCache.php', + 'Doctrine\\Common\\Cache\\WincacheCache' => $baseDir . '/main/inc/lib/symfony/Doctrine/Common/Cache/WinCacheCache.php', + 'Doctrine\\Common\\Cache\\XcacheCache' => $baseDir . '/main/inc/lib/symfony/Doctrine/Common/Cache/XcacheCache.php', + 'Doctrine\\Common\\Cache\\ZendDataCache' => $baseDir . '/main/inc/lib/symfony/Doctrine/Common/Cache/ZendDataCache.php', + 'Doctrine\\Common\\ClassLoader' => $baseDir . '/main/inc/lib/symfony/Doctrine/Common/ClassLoader.php', + 'Doctrine\\Common\\Collections\\ArrayCollection' => $baseDir . '/main/inc/lib/symfony/Doctrine/Common/Collections/ArrayCollection.php', + 'Doctrine\\Common\\Collections\\Collection' => $baseDir . '/main/inc/lib/symfony/Doctrine/Common/Collections/Collection.php', + 'Doctrine\\Common\\CommonException' => $baseDir . '/main/inc/lib/symfony/Doctrine/Common/CommonException.php', + 'Doctrine\\Common\\Comparable' => $baseDir . '/main/inc/lib/symfony/Doctrine/Common/Comparable.php', + 'Doctrine\\Common\\EventArgs' => $baseDir . '/main/inc/lib/symfony/Doctrine/Common/EventArgs.php', + 'Doctrine\\Common\\EventManager' => $baseDir . '/main/inc/lib/symfony/Doctrine/Common/EventManager.php', + 'Doctrine\\Common\\EventSubscriber' => $baseDir . '/main/inc/lib/symfony/Doctrine/Common/EventSubscriber.php', + 'Doctrine\\Common\\Lexer' => $baseDir . '/main/inc/lib/symfony/Doctrine/Common/Lexer.php', + 'Doctrine\\Common\\NotifyPropertyChanged' => $baseDir . '/main/inc/lib/symfony/Doctrine/Common/NotifyPropertyChanged.php', + 'Doctrine\\Common\\Persistence\\AbstractManagerRegistry' => $baseDir . '/main/inc/lib/symfony/Doctrine/Common/Persistence/AbstractManagerRegistry.php', + 'Doctrine\\Common\\Persistence\\ConnectionRegistry' => $baseDir . '/main/inc/lib/symfony/Doctrine/Common/Persistence/ConnectionRegistry.php', + 'Doctrine\\Common\\Persistence\\Event\\LifecycleEventArgs' => $baseDir . '/main/inc/lib/symfony/Doctrine/Common/Persistence/Event/LifecycleEventArgs.php', + 'Doctrine\\Common\\Persistence\\Event\\LoadClassMetadataEventArgs' => $baseDir . '/main/inc/lib/symfony/Doctrine/Common/Persistence/Event/LoadClassMetadataEventArgs.php', + 'Doctrine\\Common\\Persistence\\Event\\ManagerEventArgs' => $baseDir . '/main/inc/lib/symfony/Doctrine/Common/Persistence/Event/ManagerEventArgs.php', + 'Doctrine\\Common\\Persistence\\Event\\OnClearEventArgs' => $baseDir . '/main/inc/lib/symfony/Doctrine/Common/Persistence/Event/OnClearEventArgs.php', + 'Doctrine\\Common\\Persistence\\Event\\PreUpdateEventArgs' => $baseDir . '/main/inc/lib/symfony/Doctrine/Common/Persistence/Event/PreUpdateEventArgs.php', + 'Doctrine\\Common\\Persistence\\ManagerRegistry' => $baseDir . '/main/inc/lib/symfony/Doctrine/Common/Persistence/ManagerRegistry.php', + 'Doctrine\\Common\\Persistence\\Mapping\\AbstractClassMetadataFactory' => $baseDir . '/main/inc/lib/symfony/Doctrine/Common/Persistence/Mapping/AbstractClassMetadataFactory.php', + 'Doctrine\\Common\\Persistence\\Mapping\\ClassMetadata' => $baseDir . '/main/inc/lib/symfony/Doctrine/Common/Persistence/Mapping/ClassMetadata.php', + 'Doctrine\\Common\\Persistence\\Mapping\\ClassMetadataFactory' => $baseDir . '/main/inc/lib/symfony/Doctrine/Common/Persistence/Mapping/ClassMetadataFactory.php', + 'Doctrine\\Common\\Persistence\\Mapping\\Driver\\AnnotationDriver' => $baseDir . '/main/inc/lib/symfony/Doctrine/Common/Persistence/Mapping/Driver/AnnotationDriver.php', + 'Doctrine\\Common\\Persistence\\Mapping\\Driver\\DefaultFileLocator' => $baseDir . '/main/inc/lib/symfony/Doctrine/Common/Persistence/Mapping/Driver/DefaultFileLocator.php', + 'Doctrine\\Common\\Persistence\\Mapping\\Driver\\FileDriver' => $baseDir . '/main/inc/lib/symfony/Doctrine/Common/Persistence/Mapping/Driver/FileDriver.php', + 'Doctrine\\Common\\Persistence\\Mapping\\Driver\\FileLocator' => $baseDir . '/main/inc/lib/symfony/Doctrine/Common/Persistence/Mapping/Driver/FileLocator.php', + 'Doctrine\\Common\\Persistence\\Mapping\\Driver\\MappingDriver' => $baseDir . '/main/inc/lib/symfony/Doctrine/Common/Persistence/Mapping/Driver/MappingDriver.php', + 'Doctrine\\Common\\Persistence\\Mapping\\Driver\\MappingDriverChain' => $baseDir . '/main/inc/lib/symfony/Doctrine/Common/Persistence/Mapping/Driver/MappingDriverChain.php', + 'Doctrine\\Common\\Persistence\\Mapping\\Driver\\PHPDriver' => $baseDir . '/main/inc/lib/symfony/Doctrine/Common/Persistence/Mapping/Driver/PHPDriver.php', + 'Doctrine\\Common\\Persistence\\Mapping\\Driver\\StaticPHPDriver' => $baseDir . '/main/inc/lib/symfony/Doctrine/Common/Persistence/Mapping/Driver/StaticPHPDriver.php', + 'Doctrine\\Common\\Persistence\\Mapping\\Driver\\SymfonyFileLocator' => $baseDir . '/main/inc/lib/symfony/Doctrine/Common/Persistence/Mapping/Driver/SymfonyFileLocator.php', + 'Doctrine\\Common\\Persistence\\Mapping\\MappingException' => $baseDir . '/main/inc/lib/symfony/Doctrine/Common/Persistence/Mapping/MappingException.php', + 'Doctrine\\Common\\Persistence\\Mapping\\ReflectionService' => $baseDir . '/main/inc/lib/symfony/Doctrine/Common/Persistence/Mapping/ReflectionService.php', + 'Doctrine\\Common\\Persistence\\Mapping\\RuntimeReflectionService' => $baseDir . '/main/inc/lib/symfony/Doctrine/Common/Persistence/Mapping/RuntimeReflectionService.php', + 'Doctrine\\Common\\Persistence\\Mapping\\StaticReflectionService' => $baseDir . '/main/inc/lib/symfony/Doctrine/Common/Persistence/Mapping/StaticReflectionService.php', + 'Doctrine\\Common\\Persistence\\ObjectManager' => $baseDir . '/main/inc/lib/symfony/Doctrine/Common/Persistence/ObjectManager.php', + 'Doctrine\\Common\\Persistence\\ObjectManagerAware' => $baseDir . '/main/inc/lib/symfony/Doctrine/Common/Persistence/ObjectManagerAware.php', + 'Doctrine\\Common\\Persistence\\ObjectRepository' => $baseDir . '/main/inc/lib/symfony/Doctrine/Common/Persistence/ObjectRepository.php', + 'Doctrine\\Common\\Persistence\\PersistentObject' => $baseDir . '/main/inc/lib/symfony/Doctrine/Common/Persistence/PersistentObject.php', + 'Doctrine\\Common\\Persistence\\Proxy' => $baseDir . '/main/inc/lib/symfony/Doctrine/Common/Persistence/Proxy.php', + 'Doctrine\\Common\\PropertyChangedListener' => $baseDir . '/main/inc/lib/symfony/Doctrine/Common/PropertyChangedListener.php', + 'Doctrine\\Common\\Util\\ClassUtils' => $baseDir . '/main/inc/lib/symfony/Doctrine/Common/Util/ClassUtils.php', + 'Doctrine\\Common\\Util\\Debug' => $baseDir . '/main/inc/lib/symfony/Doctrine/Common/Util/Debug.php', + 'Doctrine\\Common\\Util\\Inflector' => $baseDir . '/main/inc/lib/symfony/Doctrine/Common/Util/Inflector.php', + 'Doctrine\\Common\\Version' => $baseDir . '/main/inc/lib/symfony/Doctrine/Common/Version.php', + 'Doctrine\\DBAL\\Cache\\ArrayStatement' => $baseDir . '/main/inc/lib/symfony/Doctrine/DBAL/Cache/ArrayStatement.php', + 'Doctrine\\DBAL\\Cache\\CacheException' => $baseDir . '/main/inc/lib/symfony/Doctrine/DBAL/Cache/CacheException.php', + 'Doctrine\\DBAL\\Cache\\QueryCacheProfile' => $baseDir . '/main/inc/lib/symfony/Doctrine/DBAL/Cache/QueryCacheProfile.php', + 'Doctrine\\DBAL\\Cache\\ResultCacheStatement' => $baseDir . '/main/inc/lib/symfony/Doctrine/DBAL/Cache/ResultCacheStatement.php', + 'Doctrine\\DBAL\\Configuration' => $baseDir . '/main/inc/lib/symfony/Doctrine/DBAL/Configuration.php', + 'Doctrine\\DBAL\\Connection' => $baseDir . '/main/inc/lib/symfony/Doctrine/DBAL/Connection.php', + 'Doctrine\\DBAL\\ConnectionException' => $baseDir . '/main/inc/lib/symfony/Doctrine/DBAL/ConnectionException.php', + 'Doctrine\\DBAL\\Connections\\MasterSlaveConnection' => $baseDir . '/main/inc/lib/symfony/Doctrine/DBAL/Connections/MasterSlaveConnection.php', + 'Doctrine\\DBAL\\DBALException' => $baseDir . '/main/inc/lib/symfony/Doctrine/DBAL/DBALException.php', + 'Doctrine\\DBAL\\Driver' => $baseDir . '/main/inc/lib/symfony/Doctrine/DBAL/Driver.php', + 'Doctrine\\DBAL\\DriverManager' => $baseDir . '/main/inc/lib/symfony/Doctrine/DBAL/DriverManager.php', + 'Doctrine\\DBAL\\Driver\\Connection' => $baseDir . '/main/inc/lib/symfony/Doctrine/DBAL/Driver/Connection.php', + 'Doctrine\\DBAL\\Driver\\IBMDB2\\DB2Connection' => $baseDir . '/main/inc/lib/symfony/Doctrine/DBAL/Driver/IBMDB2/DB2Connection.php', + 'Doctrine\\DBAL\\Driver\\IBMDB2\\DB2Driver' => $baseDir . '/main/inc/lib/symfony/Doctrine/DBAL/Driver/IBMDB2/DB2Driver.php', + 'Doctrine\\DBAL\\Driver\\IBMDB2\\DB2Exception' => $baseDir . '/main/inc/lib/symfony/Doctrine/DBAL/Driver/IBMDB2/DB2Exception.php', + 'Doctrine\\DBAL\\Driver\\IBMDB2\\DB2Statement' => $baseDir . '/main/inc/lib/symfony/Doctrine/DBAL/Driver/IBMDB2/DB2Statement.php', + 'Doctrine\\DBAL\\Driver\\Mysqli\\Driver' => $baseDir . '/main/inc/lib/symfony/Doctrine/DBAL/Driver/Mysqli/Driver.php', + 'Doctrine\\DBAL\\Driver\\Mysqli\\MysqliConnection' => $baseDir . '/main/inc/lib/symfony/Doctrine/DBAL/Driver/Mysqli/MysqliConnection.php', + 'Doctrine\\DBAL\\Driver\\Mysqli\\MysqliException' => $baseDir . '/main/inc/lib/symfony/Doctrine/DBAL/Driver/Mysqli/MysqliException.php', + 'Doctrine\\DBAL\\Driver\\Mysqli\\MysqliStatement' => $baseDir . '/main/inc/lib/symfony/Doctrine/DBAL/Driver/Mysqli/MysqliStatement.php', + 'Doctrine\\DBAL\\Driver\\OCI8\\Driver' => $baseDir . '/main/inc/lib/symfony/Doctrine/DBAL/Driver/OCI8/Driver.php', + 'Doctrine\\DBAL\\Driver\\OCI8\\OCI8Connection' => $baseDir . '/main/inc/lib/symfony/Doctrine/DBAL/Driver/OCI8/OCI8Connection.php', + 'Doctrine\\DBAL\\Driver\\OCI8\\OCI8Exception' => $baseDir . '/main/inc/lib/symfony/Doctrine/DBAL/Driver/OCI8/OCI8Exception.php', + 'Doctrine\\DBAL\\Driver\\OCI8\\OCI8Statement' => $baseDir . '/main/inc/lib/symfony/Doctrine/DBAL/Driver/OCI8/OCI8Statement.php', + 'Doctrine\\DBAL\\Driver\\PDOConnection' => $baseDir . '/main/inc/lib/symfony/Doctrine/DBAL/Driver/PDOConnection.php', + 'Doctrine\\DBAL\\Driver\\PDOIbm\\Driver' => $baseDir . '/main/inc/lib/symfony/Doctrine/DBAL/Driver/PDOIbm/Driver.php', + 'Doctrine\\DBAL\\Driver\\PDOMySql\\Driver' => $baseDir . '/main/inc/lib/symfony/Doctrine/DBAL/Driver/PDOMySql/Driver.php', + 'Doctrine\\DBAL\\Driver\\PDOOracle\\Driver' => $baseDir . '/main/inc/lib/symfony/Doctrine/DBAL/Driver/PDOOracle/Driver.php', + 'Doctrine\\DBAL\\Driver\\PDOPgSql\\Driver' => $baseDir . '/main/inc/lib/symfony/Doctrine/DBAL/Driver/PDOPgSql/Driver.php', + 'Doctrine\\DBAL\\Driver\\PDOSqlite\\Driver' => $baseDir . '/main/inc/lib/symfony/Doctrine/DBAL/Driver/PDOSqlite/Driver.php', + 'Doctrine\\DBAL\\Driver\\PDOSqlsrv\\Connection' => $baseDir . '/main/inc/lib/symfony/Doctrine/DBAL/Driver/PDOSqlsrv/Connection.php', + 'Doctrine\\DBAL\\Driver\\PDOSqlsrv\\Driver' => $baseDir . '/main/inc/lib/symfony/Doctrine/DBAL/Driver/PDOSqlsrv/Driver.php', + 'Doctrine\\DBAL\\Driver\\PDOStatement' => $baseDir . '/main/inc/lib/symfony/Doctrine/DBAL/Driver/PDOStatement.php', + 'Doctrine\\DBAL\\Driver\\ResultStatement' => $baseDir . '/main/inc/lib/symfony/Doctrine/DBAL/Driver/ResultStatement.php', + 'Doctrine\\DBAL\\Driver\\Statement' => $baseDir . '/main/inc/lib/symfony/Doctrine/DBAL/Driver/Statement.php', + 'Doctrine\\DBAL\\Event\\ConnectionEventArgs' => $baseDir . '/main/inc/lib/symfony/Doctrine/DBAL/Event/ConnectionEventArgs.php', + 'Doctrine\\DBAL\\Event\\Listeners\\MysqlSessionInit' => $baseDir . '/main/inc/lib/symfony/Doctrine/DBAL/Event/Listeners/MysqlSessionInit.php', + 'Doctrine\\DBAL\\Event\\Listeners\\OracleSessionInit' => $baseDir . '/main/inc/lib/symfony/Doctrine/DBAL/Event/Listeners/OracleSessionInit.php', + 'Doctrine\\DBAL\\Event\\Listeners\\SQLSessionInit' => $baseDir . '/main/inc/lib/symfony/Doctrine/DBAL/Event/Listeners/SQLSessionInit.php', + 'Doctrine\\DBAL\\Event\\SchemaAlterTableAddColumnEventArgs' => $baseDir . '/main/inc/lib/symfony/Doctrine/DBAL/Event/SchemaAlterTableAddColumnEventArgs.php', + 'Doctrine\\DBAL\\Event\\SchemaAlterTableChangeColumnEventArgs' => $baseDir . '/main/inc/lib/symfony/Doctrine/DBAL/Event/SchemaAlterTableChangeColumnEventArgs.php', + 'Doctrine\\DBAL\\Event\\SchemaAlterTableEventArgs' => $baseDir . '/main/inc/lib/symfony/Doctrine/DBAL/Event/SchemaAlterTableEventArgs.php', + 'Doctrine\\DBAL\\Event\\SchemaAlterTableRemoveColumnEventArgs' => $baseDir . '/main/inc/lib/symfony/Doctrine/DBAL/Event/SchemaAlterTableRemoveColumnEventArgs.php', + 'Doctrine\\DBAL\\Event\\SchemaAlterTableRenameColumnEventArgs' => $baseDir . '/main/inc/lib/symfony/Doctrine/DBAL/Event/SchemaAlterTableRenameColumnEventArgs.php', + 'Doctrine\\DBAL\\Event\\SchemaColumnDefinitionEventArgs' => $baseDir . '/main/inc/lib/symfony/Doctrine/DBAL/Event/SchemaColumnDefinitionEventArgs.php', + 'Doctrine\\DBAL\\Event\\SchemaCreateTableColumnEventArgs' => $baseDir . '/main/inc/lib/symfony/Doctrine/DBAL/Event/SchemaCreateTableColumnEventArgs.php', + 'Doctrine\\DBAL\\Event\\SchemaCreateTableEventArgs' => $baseDir . '/main/inc/lib/symfony/Doctrine/DBAL/Event/SchemaCreateTableEventArgs.php', + 'Doctrine\\DBAL\\Event\\SchemaDropTableEventArgs' => $baseDir . '/main/inc/lib/symfony/Doctrine/DBAL/Event/SchemaDropTableEventArgs.php', + 'Doctrine\\DBAL\\Event\\SchemaEventArgs' => $baseDir . '/main/inc/lib/symfony/Doctrine/DBAL/Event/SchemaEventArgs.php', + 'Doctrine\\DBAL\\Event\\SchemaIndexDefinitionEventArgs' => $baseDir . '/main/inc/lib/symfony/Doctrine/DBAL/Event/SchemaIndexDefinitionEventArgs.php', + 'Doctrine\\DBAL\\Events' => $baseDir . '/main/inc/lib/symfony/Doctrine/DBAL/Events.php', + 'Doctrine\\DBAL\\LockMode' => $baseDir . '/main/inc/lib/symfony/Doctrine/DBAL/LockMode.php', + 'Doctrine\\DBAL\\Logging\\DebugStack' => $baseDir . '/main/inc/lib/symfony/Doctrine/DBAL/Logging/DebugStack.php', + 'Doctrine\\DBAL\\Logging\\EchoSQLLogger' => $baseDir . '/main/inc/lib/symfony/Doctrine/DBAL/Logging/EchoSQLLogger.php', + 'Doctrine\\DBAL\\Logging\\LoggerChain' => $baseDir . '/main/inc/lib/symfony/Doctrine/DBAL/Logging/LoggerChain.php', + 'Doctrine\\DBAL\\Logging\\SQLLogger' => $baseDir . '/main/inc/lib/symfony/Doctrine/DBAL/Logging/SQLLogger.php', + 'Doctrine\\DBAL\\Platforms\\AbstractPlatform' => $baseDir . '/main/inc/lib/symfony/Doctrine/DBAL/Platforms/AbstractPlatform.php', + 'Doctrine\\DBAL\\Platforms\\DB2Platform' => $baseDir . '/main/inc/lib/symfony/Doctrine/DBAL/Platforms/DB2Platform.php', + 'Doctrine\\DBAL\\Platforms\\Keywords\\DB2Keywords' => $baseDir . '/main/inc/lib/symfony/Doctrine/DBAL/Platforms/Keywords/DB2Keywords.php', + 'Doctrine\\DBAL\\Platforms\\Keywords\\KeywordList' => $baseDir . '/main/inc/lib/symfony/Doctrine/DBAL/Platforms/Keywords/KeywordList.php', + 'Doctrine\\DBAL\\Platforms\\Keywords\\MsSQLKeywords' => $baseDir . '/main/inc/lib/symfony/Doctrine/DBAL/Platforms/Keywords/MsSQLKeywords.php', + 'Doctrine\\DBAL\\Platforms\\Keywords\\MySQLKeywords' => $baseDir . '/main/inc/lib/symfony/Doctrine/DBAL/Platforms/Keywords/MySQLKeywords.php', + 'Doctrine\\DBAL\\Platforms\\Keywords\\OracleKeywords' => $baseDir . '/main/inc/lib/symfony/Doctrine/DBAL/Platforms/Keywords/OracleKeywords.php', + 'Doctrine\\DBAL\\Platforms\\Keywords\\PostgreSQLKeywords' => $baseDir . '/main/inc/lib/symfony/Doctrine/DBAL/Platforms/Keywords/PostgreSQLKeywords.php', + 'Doctrine\\DBAL\\Platforms\\Keywords\\ReservedKeywordsValidator' => $baseDir . '/main/inc/lib/symfony/Doctrine/DBAL/Platforms/Keywords/ReservedKeywordsValidator.php', + 'Doctrine\\DBAL\\Platforms\\Keywords\\SQLiteKeywords' => $baseDir . '/main/inc/lib/symfony/Doctrine/DBAL/Platforms/Keywords/SQLiteKeywords.php', + 'Doctrine\\DBAL\\Platforms\\MySqlPlatform' => $baseDir . '/main/inc/lib/symfony/Doctrine/DBAL/Platforms/MySqlPlatform.php', + 'Doctrine\\DBAL\\Platforms\\OraclePlatform' => $baseDir . '/main/inc/lib/symfony/Doctrine/DBAL/Platforms/OraclePlatform.php', + 'Doctrine\\DBAL\\Platforms\\PostgreSqlPlatform' => $baseDir . '/main/inc/lib/symfony/Doctrine/DBAL/Platforms/PostgreSqlPlatform.php', + 'Doctrine\\DBAL\\Platforms\\SQLServer2005Platform' => $baseDir . '/main/inc/lib/symfony/Doctrine/DBAL/Platforms/SQLServer2005Platform.php', + 'Doctrine\\DBAL\\Platforms\\SQLServer2008Platform' => $baseDir . '/main/inc/lib/symfony/Doctrine/DBAL/Platforms/SQLServer2008Platform.php', + 'Doctrine\\DBAL\\Platforms\\SQLServerPlatform' => $baseDir . '/main/inc/lib/symfony/Doctrine/DBAL/Platforms/SQLServerPlatform.php', + 'Doctrine\\DBAL\\Platforms\\SqlitePlatform' => $baseDir . '/main/inc/lib/symfony/Doctrine/DBAL/Platforms/SqlitePlatform.php', + 'Doctrine\\DBAL\\Portability\\Connection' => $baseDir . '/main/inc/lib/symfony/Doctrine/DBAL/Portability/Connection.php', + 'Doctrine\\DBAL\\Portability\\Statement' => $baseDir . '/main/inc/lib/symfony/Doctrine/DBAL/Portability/Statement.php', + 'Doctrine\\DBAL\\Query\\Expression\\CompositeExpression' => $baseDir . '/main/inc/lib/symfony/Doctrine/DBAL/Query/Expression/CompositeExpression.php', + 'Doctrine\\DBAL\\Query\\Expression\\ExpressionBuilder' => $baseDir . '/main/inc/lib/symfony/Doctrine/DBAL/Query/Expression/ExpressionBuilder.php', + 'Doctrine\\DBAL\\Query\\QueryBuilder' => $baseDir . '/main/inc/lib/symfony/Doctrine/DBAL/Query/QueryBuilder.php', + 'Doctrine\\DBAL\\Query\\QueryException' => $baseDir . '/main/inc/lib/symfony/Doctrine/DBAL/Query/QueryException.php', + 'Doctrine\\DBAL\\SQLParserUtils' => $baseDir . '/main/inc/lib/symfony/Doctrine/DBAL/SQLParserUtils.php', + 'Doctrine\\DBAL\\Schema\\AbstractAsset' => $baseDir . '/main/inc/lib/symfony/Doctrine/DBAL/Schema/AbstractAsset.php', + 'Doctrine\\DBAL\\Schema\\AbstractSchemaManager' => $baseDir . '/main/inc/lib/symfony/Doctrine/DBAL/Schema/AbstractSchemaManager.php', + 'Doctrine\\DBAL\\Schema\\Column' => $baseDir . '/main/inc/lib/symfony/Doctrine/DBAL/Schema/Column.php', + 'Doctrine\\DBAL\\Schema\\ColumnDiff' => $baseDir . '/main/inc/lib/symfony/Doctrine/DBAL/Schema/ColumnDiff.php', + 'Doctrine\\DBAL\\Schema\\Comparator' => $baseDir . '/main/inc/lib/symfony/Doctrine/DBAL/Schema/Comparator.php', + 'Doctrine\\DBAL\\Schema\\Constraint' => $baseDir . '/main/inc/lib/symfony/Doctrine/DBAL/Schema/Constraint.php', + 'Doctrine\\DBAL\\Schema\\DB2SchemaManager' => $baseDir . '/main/inc/lib/symfony/Doctrine/DBAL/Schema/DB2SchemaManager.php', + 'Doctrine\\DBAL\\Schema\\ForeignKeyConstraint' => $baseDir . '/main/inc/lib/symfony/Doctrine/DBAL/Schema/ForeignKeyConstraint.php', + 'Doctrine\\DBAL\\Schema\\Index' => $baseDir . '/main/inc/lib/symfony/Doctrine/DBAL/Schema/Index.php', + 'Doctrine\\DBAL\\Schema\\MySqlSchemaManager' => $baseDir . '/main/inc/lib/symfony/Doctrine/DBAL/Schema/MySqlSchemaManager.php', + 'Doctrine\\DBAL\\Schema\\OracleSchemaManager' => $baseDir . '/main/inc/lib/symfony/Doctrine/DBAL/Schema/OracleSchemaManager.php', + 'Doctrine\\DBAL\\Schema\\PostgreSqlSchemaManager' => $baseDir . '/main/inc/lib/symfony/Doctrine/DBAL/Schema/PostgreSqlSchemaManager.php', + 'Doctrine\\DBAL\\Schema\\SQLServerSchemaManager' => $baseDir . '/main/inc/lib/symfony/Doctrine/DBAL/Schema/SQLServerSchemaManager.php', + 'Doctrine\\DBAL\\Schema\\Schema' => $baseDir . '/main/inc/lib/symfony/Doctrine/DBAL/Schema/Schema.php', + 'Doctrine\\DBAL\\Schema\\SchemaConfig' => $baseDir . '/main/inc/lib/symfony/Doctrine/DBAL/Schema/SchemaConfig.php', + 'Doctrine\\DBAL\\Schema\\SchemaDiff' => $baseDir . '/main/inc/lib/symfony/Doctrine/DBAL/Schema/SchemaDiff.php', + 'Doctrine\\DBAL\\Schema\\SchemaException' => $baseDir . '/main/inc/lib/symfony/Doctrine/DBAL/Schema/SchemaException.php', + 'Doctrine\\DBAL\\Schema\\Sequence' => $baseDir . '/main/inc/lib/symfony/Doctrine/DBAL/Schema/Sequence.php', + 'Doctrine\\DBAL\\Schema\\SqliteSchemaManager' => $baseDir . '/main/inc/lib/symfony/Doctrine/DBAL/Schema/SqliteSchemaManager.php', + 'Doctrine\\DBAL\\Schema\\Table' => $baseDir . '/main/inc/lib/symfony/Doctrine/DBAL/Schema/Table.php', + 'Doctrine\\DBAL\\Schema\\TableDiff' => $baseDir . '/main/inc/lib/symfony/Doctrine/DBAL/Schema/TableDiff.php', + 'Doctrine\\DBAL\\Schema\\View' => $baseDir . '/main/inc/lib/symfony/Doctrine/DBAL/Schema/View.php', + 'Doctrine\\DBAL\\Schema\\Visitor\\CreateSchemaSqlCollector' => $baseDir . '/main/inc/lib/symfony/Doctrine/DBAL/Schema/Visitor/CreateSchemaSqlCollector.php', + 'Doctrine\\DBAL\\Schema\\Visitor\\DropSchemaSqlCollector' => $baseDir . '/main/inc/lib/symfony/Doctrine/DBAL/Schema/Visitor/DropSchemaSqlCollector.php', + 'Doctrine\\DBAL\\Schema\\Visitor\\Graphviz' => $baseDir . '/main/inc/lib/symfony/Doctrine/DBAL/Schema/Visitor/Graphviz.php', + 'Doctrine\\DBAL\\Schema\\Visitor\\RemoveNamespacedAssets' => $baseDir . '/main/inc/lib/symfony/Doctrine/DBAL/Schema/Visitor/RemoveNamespacedAssets.php', + 'Doctrine\\DBAL\\Schema\\Visitor\\Visitor' => $baseDir . '/main/inc/lib/symfony/Doctrine/DBAL/Schema/Visitor/Visitor.php', + 'Doctrine\\DBAL\\Statement' => $baseDir . '/main/inc/lib/symfony/Doctrine/DBAL/Statement.php', + 'Doctrine\\DBAL\\Tools\\Console\\Command\\ImportCommand' => $baseDir . '/main/inc/lib/symfony/Doctrine/DBAL/Tools/Console/Command/ImportCommand.php', + 'Doctrine\\DBAL\\Tools\\Console\\Command\\ReservedWordsCommand' => $baseDir . '/main/inc/lib/symfony/Doctrine/DBAL/Tools/Console/Command/ReservedWordsCommand.php', + 'Doctrine\\DBAL\\Tools\\Console\\Command\\RunSqlCommand' => $baseDir . '/main/inc/lib/symfony/Doctrine/DBAL/Tools/Console/Command/RunSqlCommand.php', + 'Doctrine\\DBAL\\Tools\\Console\\Helper\\ConnectionHelper' => $baseDir . '/main/inc/lib/symfony/Doctrine/DBAL/Tools/Console/Helper/ConnectionHelper.php', + 'Doctrine\\DBAL\\Types\\ArrayType' => $baseDir . '/main/inc/lib/symfony/Doctrine/DBAL/Types/ArrayType.php', + 'Doctrine\\DBAL\\Types\\BigIntType' => $baseDir . '/main/inc/lib/symfony/Doctrine/DBAL/Types/BigIntType.php', + 'Doctrine\\DBAL\\Types\\BlobType' => $baseDir . '/main/inc/lib/symfony/Doctrine/DBAL/Types/BlobType.php', + 'Doctrine\\DBAL\\Types\\BooleanType' => $baseDir . '/main/inc/lib/symfony/Doctrine/DBAL/Types/BooleanType.php', + 'Doctrine\\DBAL\\Types\\ConversionException' => $baseDir . '/main/inc/lib/symfony/Doctrine/DBAL/Types/ConversionException.php', + 'Doctrine\\DBAL\\Types\\DateTimeType' => $baseDir . '/main/inc/lib/symfony/Doctrine/DBAL/Types/DateTimeType.php', + 'Doctrine\\DBAL\\Types\\DateTimeTzType' => $baseDir . '/main/inc/lib/symfony/Doctrine/DBAL/Types/DateTimeTzType.php', + 'Doctrine\\DBAL\\Types\\DateType' => $baseDir . '/main/inc/lib/symfony/Doctrine/DBAL/Types/DateType.php', + 'Doctrine\\DBAL\\Types\\DecimalType' => $baseDir . '/main/inc/lib/symfony/Doctrine/DBAL/Types/DecimalType.php', + 'Doctrine\\DBAL\\Types\\FloatType' => $baseDir . '/main/inc/lib/symfony/Doctrine/DBAL/Types/FloatType.php', + 'Doctrine\\DBAL\\Types\\IntegerType' => $baseDir . '/main/inc/lib/symfony/Doctrine/DBAL/Types/IntegerType.php', + 'Doctrine\\DBAL\\Types\\ObjectType' => $baseDir . '/main/inc/lib/symfony/Doctrine/DBAL/Types/ObjectType.php', + 'Doctrine\\DBAL\\Types\\SmallIntType' => $baseDir . '/main/inc/lib/symfony/Doctrine/DBAL/Types/SmallIntType.php', + 'Doctrine\\DBAL\\Types\\StringType' => $baseDir . '/main/inc/lib/symfony/Doctrine/DBAL/Types/StringType.php', + 'Doctrine\\DBAL\\Types\\TextType' => $baseDir . '/main/inc/lib/symfony/Doctrine/DBAL/Types/TextType.php', + 'Doctrine\\DBAL\\Types\\TimeType' => $baseDir . '/main/inc/lib/symfony/Doctrine/DBAL/Types/TimeType.php', + 'Doctrine\\DBAL\\Types\\Type' => $baseDir . '/main/inc/lib/symfony/Doctrine/DBAL/Types/Type.php', + 'Doctrine\\DBAL\\Types\\VarDateTimeType' => $baseDir . '/main/inc/lib/symfony/Doctrine/DBAL/Types/VarDateTimeType.php', + 'Doctrine\\DBAL\\Version' => $baseDir . '/main/inc/lib/symfony/Doctrine/DBAL/Version.php', + 'Doctrine\\ORM\\AbstractQuery' => $baseDir . '/main/inc/lib/symfony/Doctrine/ORM/AbstractQuery.php', + 'Doctrine\\ORM\\Configuration' => $baseDir . '/main/inc/lib/symfony/Doctrine/ORM/Configuration.php', + 'Doctrine\\ORM\\EntityManager' => $baseDir . '/main/inc/lib/symfony/Doctrine/ORM/EntityManager.php', + 'Doctrine\\ORM\\EntityNotFoundException' => $baseDir . '/main/inc/lib/symfony/Doctrine/ORM/EntityNotFoundException.php', + 'Doctrine\\ORM\\EntityRepository' => $baseDir . '/main/inc/lib/symfony/Doctrine/ORM/EntityRepository.php', + 'Doctrine\\ORM\\Event\\LifecycleEventArgs' => $baseDir . '/main/inc/lib/symfony/Doctrine/ORM/Event/LifecycleEventArgs.php', + 'Doctrine\\ORM\\Event\\LoadClassMetadataEventArgs' => $baseDir . '/main/inc/lib/symfony/Doctrine/ORM/Event/LoadClassMetadataEventArgs.php', + 'Doctrine\\ORM\\Event\\OnClearEventArgs' => $baseDir . '/main/inc/lib/symfony/Doctrine/ORM/Event/OnClearEventArgs.php', + 'Doctrine\\ORM\\Event\\OnFlushEventArgs' => $baseDir . '/main/inc/lib/symfony/Doctrine/ORM/Event/OnFlushEventArgs.php', + 'Doctrine\\ORM\\Event\\PostFlushEventArgs' => $baseDir . '/main/inc/lib/symfony/Doctrine/ORM/Event/PostFlushEventArgs.php', + 'Doctrine\\ORM\\Event\\PreFlushEventArgs' => $baseDir . '/main/inc/lib/symfony/Doctrine/ORM/Event/PreFlushEventArgs.php', + 'Doctrine\\ORM\\Event\\PreUpdateEventArgs' => $baseDir . '/main/inc/lib/symfony/Doctrine/ORM/Event/PreUpdateEventArgs.php', + 'Doctrine\\ORM\\Events' => $baseDir . '/main/inc/lib/symfony/Doctrine/ORM/Events.php', + 'Doctrine\\ORM\\Id\\AbstractIdGenerator' => $baseDir . '/main/inc/lib/symfony/Doctrine/ORM/Id/AbstractIdGenerator.php', + 'Doctrine\\ORM\\Id\\AssignedGenerator' => $baseDir . '/main/inc/lib/symfony/Doctrine/ORM/Id/AssignedGenerator.php', + 'Doctrine\\ORM\\Id\\IdentityGenerator' => $baseDir . '/main/inc/lib/symfony/Doctrine/ORM/Id/IdentityGenerator.php', + 'Doctrine\\ORM\\Id\\SequenceGenerator' => $baseDir . '/main/inc/lib/symfony/Doctrine/ORM/Id/SequenceGenerator.php', + 'Doctrine\\ORM\\Id\\TableGenerator' => $baseDir . '/main/inc/lib/symfony/Doctrine/ORM/Id/TableGenerator.php', + 'Doctrine\\ORM\\Internal\\CommitOrderCalculator' => $baseDir . '/main/inc/lib/symfony/Doctrine/ORM/Internal/CommitOrderCalculator.php', + 'Doctrine\\ORM\\Internal\\Hydration\\AbstractHydrator' => $baseDir . '/main/inc/lib/symfony/Doctrine/ORM/Internal/Hydration/AbstractHydrator.php', + 'Doctrine\\ORM\\Internal\\Hydration\\ArrayHydrator' => $baseDir . '/main/inc/lib/symfony/Doctrine/ORM/Internal/Hydration/ArrayHydrator.php', + 'Doctrine\\ORM\\Internal\\Hydration\\HydrationException' => $baseDir . '/main/inc/lib/symfony/Doctrine/ORM/Internal/Hydration/HydrationException.php', + 'Doctrine\\ORM\\Internal\\Hydration\\IterableResult' => $baseDir . '/main/inc/lib/symfony/Doctrine/ORM/Internal/Hydration/IterableResult.php', + 'Doctrine\\ORM\\Internal\\Hydration\\ObjectHydrator' => $baseDir . '/main/inc/lib/symfony/Doctrine/ORM/Internal/Hydration/ObjectHydrator.php', + 'Doctrine\\ORM\\Internal\\Hydration\\ScalarHydrator' => $baseDir . '/main/inc/lib/symfony/Doctrine/ORM/Internal/Hydration/ScalarHydrator.php', + 'Doctrine\\ORM\\Internal\\Hydration\\SimpleObjectHydrator' => $baseDir . '/main/inc/lib/symfony/Doctrine/ORM/Internal/Hydration/SimpleObjectHydrator.php', + 'Doctrine\\ORM\\Internal\\Hydration\\SingleScalarHydrator' => $baseDir . '/main/inc/lib/symfony/Doctrine/ORM/Internal/Hydration/SingleScalarHydrator.php', + 'Doctrine\\ORM\\Mapping\\Annotation' => $baseDir . '/main/inc/lib/symfony/Doctrine/ORM/Mapping/Annotation.php', + 'Doctrine\\ORM\\Mapping\\Builder\\AssociationBuilder' => $baseDir . '/main/inc/lib/symfony/Doctrine/ORM/Mapping/Builder/AssociationBuilder.php', + 'Doctrine\\ORM\\Mapping\\Builder\\ClassMetadataBuilder' => $baseDir . '/main/inc/lib/symfony/Doctrine/ORM/Mapping/Builder/ClassMetadataBuilder.php', + 'Doctrine\\ORM\\Mapping\\Builder\\FieldBuilder' => $baseDir . '/main/inc/lib/symfony/Doctrine/ORM/Mapping/Builder/FieldBuilder.php', + 'Doctrine\\ORM\\Mapping\\Builder\\ManyToManyAssociationBuilder' => $baseDir . '/main/inc/lib/symfony/Doctrine/ORM/Mapping/Builder/ManyToManyAssociationBuilder.php', + 'Doctrine\\ORM\\Mapping\\Builder\\OneToManyAssociationBuilder' => $baseDir . '/main/inc/lib/symfony/Doctrine/ORM/Mapping/Builder/OneToManyAssociationBuilder.php', + 'Doctrine\\ORM\\Mapping\\ChangeTrackingPolicy' => $baseDir . '/main/inc/lib/symfony/Doctrine/ORM/Mapping/ChangeTrackingPolicy.php', + 'Doctrine\\ORM\\Mapping\\ClassMetadata' => $baseDir . '/main/inc/lib/symfony/Doctrine/ORM/Mapping/ClassMetadata.php', + 'Doctrine\\ORM\\Mapping\\ClassMetadataFactory' => $baseDir . '/main/inc/lib/symfony/Doctrine/ORM/Mapping/ClassMetadataFactory.php', + 'Doctrine\\ORM\\Mapping\\ClassMetadataInfo' => $baseDir . '/main/inc/lib/symfony/Doctrine/ORM/Mapping/ClassMetadataInfo.php', + 'Doctrine\\ORM\\Mapping\\Column' => $baseDir . '/main/inc/lib/symfony/Doctrine/ORM/Mapping/Column.php', + 'Doctrine\\ORM\\Mapping\\DiscriminatorColumn' => $baseDir . '/main/inc/lib/symfony/Doctrine/ORM/Mapping/DiscriminatorColumn.php', + 'Doctrine\\ORM\\Mapping\\DiscriminatorMap' => $baseDir . '/main/inc/lib/symfony/Doctrine/ORM/Mapping/DiscriminatorMap.php', + 'Doctrine\\ORM\\Mapping\\Driver\\AbstractFileDriver' => $baseDir . '/main/inc/lib/symfony/Doctrine/ORM/Mapping/Driver/AbstractFileDriver.php', + 'Doctrine\\ORM\\Mapping\\Driver\\AnnotationDriver' => $baseDir . '/main/inc/lib/symfony/Doctrine/ORM/Mapping/Driver/AnnotationDriver.php', + 'Doctrine\\ORM\\Mapping\\Driver\\DatabaseDriver' => $baseDir . '/main/inc/lib/symfony/Doctrine/ORM/Mapping/Driver/DatabaseDriver.php', + 'Doctrine\\ORM\\Mapping\\Driver\\Driver' => $baseDir . '/main/inc/lib/symfony/Doctrine/ORM/Mapping/Driver/Driver.php', + 'Doctrine\\ORM\\Mapping\\Driver\\DriverChain' => $baseDir . '/main/inc/lib/symfony/Doctrine/ORM/Mapping/Driver/DriverChain.php', + 'Doctrine\\ORM\\Mapping\\Driver\\PHPDriver' => $baseDir . '/main/inc/lib/symfony/Doctrine/ORM/Mapping/Driver/PHPDriver.php', + 'Doctrine\\ORM\\Mapping\\Driver\\SimplifiedXmlDriver' => $baseDir . '/main/inc/lib/symfony/Doctrine/ORM/Mapping/Driver/SimplifiedXmlDriver.php', + 'Doctrine\\ORM\\Mapping\\Driver\\SimplifiedYamlDriver' => $baseDir . '/main/inc/lib/symfony/Doctrine/ORM/Mapping/Driver/SimplifiedYamlDriver.php', + 'Doctrine\\ORM\\Mapping\\Driver\\StaticPHPDriver' => $baseDir . '/main/inc/lib/symfony/Doctrine/ORM/Mapping/Driver/StaticPHPDriver.php', + 'Doctrine\\ORM\\Mapping\\Driver\\XmlDriver' => $baseDir . '/main/inc/lib/symfony/Doctrine/ORM/Mapping/Driver/XmlDriver.php', + 'Doctrine\\ORM\\Mapping\\Driver\\YamlDriver' => $baseDir . '/main/inc/lib/symfony/Doctrine/ORM/Mapping/Driver/YamlDriver.php', + 'Doctrine\\ORM\\Mapping\\ElementCollection' => $baseDir . '/main/inc/lib/symfony/Doctrine/ORM/Mapping/ElementCollection.php', + 'Doctrine\\ORM\\Mapping\\Entity' => $baseDir . '/main/inc/lib/symfony/Doctrine/ORM/Mapping/Entity.php', + 'Doctrine\\ORM\\Mapping\\GeneratedValue' => $baseDir . '/main/inc/lib/symfony/Doctrine/ORM/Mapping/GeneratedValue.php', + 'Doctrine\\ORM\\Mapping\\HasLifecycleCallbacks' => $baseDir . '/main/inc/lib/symfony/Doctrine/ORM/Mapping/HasLifecycleCallbacks.php', + 'Doctrine\\ORM\\Mapping\\Id' => $baseDir . '/main/inc/lib/symfony/Doctrine/ORM/Mapping/Id.php', + 'Doctrine\\ORM\\Mapping\\Index' => $baseDir . '/main/inc/lib/symfony/Doctrine/ORM/Mapping/Index.php', + 'Doctrine\\ORM\\Mapping\\InheritanceType' => $baseDir . '/main/inc/lib/symfony/Doctrine/ORM/Mapping/InheritanceType.php', + 'Doctrine\\ORM\\Mapping\\JoinColumn' => $baseDir . '/main/inc/lib/symfony/Doctrine/ORM/Mapping/JoinColumn.php', + 'Doctrine\\ORM\\Mapping\\JoinColumns' => $baseDir . '/main/inc/lib/symfony/Doctrine/ORM/Mapping/JoinColumns.php', + 'Doctrine\\ORM\\Mapping\\JoinTable' => $baseDir . '/main/inc/lib/symfony/Doctrine/ORM/Mapping/JoinTable.php', + 'Doctrine\\ORM\\Mapping\\ManyToMany' => $baseDir . '/main/inc/lib/symfony/Doctrine/ORM/Mapping/ManyToMany.php', + 'Doctrine\\ORM\\Mapping\\ManyToOne' => $baseDir . '/main/inc/lib/symfony/Doctrine/ORM/Mapping/ManyToOne.php', + 'Doctrine\\ORM\\Mapping\\MappedSuperclass' => $baseDir . '/main/inc/lib/symfony/Doctrine/ORM/Mapping/MappedSuperclass.php', + 'Doctrine\\ORM\\Mapping\\MappingException' => $baseDir . '/main/inc/lib/symfony/Doctrine/ORM/Mapping/MappingException.php', + 'Doctrine\\ORM\\Mapping\\NamedQueries' => $baseDir . '/main/inc/lib/symfony/Doctrine/ORM/Mapping/NamedQueries.php', + 'Doctrine\\ORM\\Mapping\\NamedQuery' => $baseDir . '/main/inc/lib/symfony/Doctrine/ORM/Mapping/NamedQuery.php', + 'Doctrine\\ORM\\Mapping\\OneToMany' => $baseDir . '/main/inc/lib/symfony/Doctrine/ORM/Mapping/OneToMany.php', + 'Doctrine\\ORM\\Mapping\\OneToOne' => $baseDir . '/main/inc/lib/symfony/Doctrine/ORM/Mapping/OneToOne.php', + 'Doctrine\\ORM\\Mapping\\OrderBy' => $baseDir . '/main/inc/lib/symfony/Doctrine/ORM/Mapping/OrderBy.php', + 'Doctrine\\ORM\\Mapping\\PostLoad' => $baseDir . '/main/inc/lib/symfony/Doctrine/ORM/Mapping/PostLoad.php', + 'Doctrine\\ORM\\Mapping\\PostPersist' => $baseDir . '/main/inc/lib/symfony/Doctrine/ORM/Mapping/PostPersist.php', + 'Doctrine\\ORM\\Mapping\\PostRemove' => $baseDir . '/main/inc/lib/symfony/Doctrine/ORM/Mapping/PostRemove.php', + 'Doctrine\\ORM\\Mapping\\PostUpdate' => $baseDir . '/main/inc/lib/symfony/Doctrine/ORM/Mapping/PostUpdate.php', + 'Doctrine\\ORM\\Mapping\\PreFlush' => $baseDir . '/main/inc/lib/symfony/Doctrine/ORM/Mapping/PreFlush.php', + 'Doctrine\\ORM\\Mapping\\PrePersist' => $baseDir . '/main/inc/lib/symfony/Doctrine/ORM/Mapping/PrePersist.php', + 'Doctrine\\ORM\\Mapping\\PreRemove' => $baseDir . '/main/inc/lib/symfony/Doctrine/ORM/Mapping/PreRemove.php', + 'Doctrine\\ORM\\Mapping\\PreUpdate' => $baseDir . '/main/inc/lib/symfony/Doctrine/ORM/Mapping/PreUpdate.php', + 'Doctrine\\ORM\\Mapping\\SequenceGenerator' => $baseDir . '/main/inc/lib/symfony/Doctrine/ORM/Mapping/SequenceGenerator.php', + 'Doctrine\\ORM\\Mapping\\Table' => $baseDir . '/main/inc/lib/symfony/Doctrine/ORM/Mapping/Table.php', + 'Doctrine\\ORM\\Mapping\\UniqueConstraint' => $baseDir . '/main/inc/lib/symfony/Doctrine/ORM/Mapping/UniqueConstraint.php', + 'Doctrine\\ORM\\Mapping\\Version' => $baseDir . '/main/inc/lib/symfony/Doctrine/ORM/Mapping/Version.php', + 'Doctrine\\ORM\\NativeQuery' => $baseDir . '/main/inc/lib/symfony/Doctrine/ORM/NativeQuery.php', + 'Doctrine\\ORM\\NoResultException' => $baseDir . '/main/inc/lib/symfony/Doctrine/ORM/NoResultException.php', + 'Doctrine\\ORM\\NonUniqueResultException' => $baseDir . '/main/inc/lib/symfony/Doctrine/ORM/NonUniqueResultException.php', + 'Doctrine\\ORM\\ORMException' => $baseDir . '/main/inc/lib/symfony/Doctrine/ORM/ORMException.php', + 'Doctrine\\ORM\\ORMInvalidArgumentException' => $baseDir . '/main/inc/lib/symfony/Doctrine/ORM/ORMInvalidArgumentException.php', + 'Doctrine\\ORM\\OptimisticLockException' => $baseDir . '/main/inc/lib/symfony/Doctrine/ORM/OptimisticLockException.php', + 'Doctrine\\ORM\\PersistentCollection' => $baseDir . '/main/inc/lib/symfony/Doctrine/ORM/PersistentCollection.php', + 'Doctrine\\ORM\\Persisters\\AbstractCollectionPersister' => $baseDir . '/main/inc/lib/symfony/Doctrine/ORM/Persisters/AbstractCollectionPersister.php', + 'Doctrine\\ORM\\Persisters\\AbstractEntityInheritancePersister' => $baseDir . '/main/inc/lib/symfony/Doctrine/ORM/Persisters/AbstractEntityInheritancePersister.php', + 'Doctrine\\ORM\\Persisters\\BasicEntityPersister' => $baseDir . '/main/inc/lib/symfony/Doctrine/ORM/Persisters/BasicEntityPersister.php', + 'Doctrine\\ORM\\Persisters\\ElementCollectionPersister' => $baseDir . '/main/inc/lib/symfony/Doctrine/ORM/Persisters/ElementCollectionPersister.php', + 'Doctrine\\ORM\\Persisters\\JoinedSubclassPersister' => $baseDir . '/main/inc/lib/symfony/Doctrine/ORM/Persisters/JoinedSubclassPersister.php', + 'Doctrine\\ORM\\Persisters\\ManyToManyPersister' => $baseDir . '/main/inc/lib/symfony/Doctrine/ORM/Persisters/ManyToManyPersister.php', + 'Doctrine\\ORM\\Persisters\\OneToManyPersister' => $baseDir . '/main/inc/lib/symfony/Doctrine/ORM/Persisters/OneToManyPersister.php', + 'Doctrine\\ORM\\Persisters\\SingleTablePersister' => $baseDir . '/main/inc/lib/symfony/Doctrine/ORM/Persisters/SingleTablePersister.php', + 'Doctrine\\ORM\\Persisters\\UnionSubclassPersister' => $baseDir . '/main/inc/lib/symfony/Doctrine/ORM/Persisters/UnionSubclassPersister.php', + 'Doctrine\\ORM\\PessimisticLockException' => $baseDir . '/main/inc/lib/symfony/Doctrine/ORM/PessimisticLockException.php', + 'Doctrine\\ORM\\Proxy\\Autoloader' => $baseDir . '/main/inc/lib/symfony/Doctrine/ORM/Proxy/Autoloader.php', + 'Doctrine\\ORM\\Proxy\\Proxy' => $baseDir . '/main/inc/lib/symfony/Doctrine/ORM/Proxy/Proxy.php', + 'Doctrine\\ORM\\Proxy\\ProxyException' => $baseDir . '/main/inc/lib/symfony/Doctrine/ORM/Proxy/ProxyException.php', + 'Doctrine\\ORM\\Proxy\\ProxyFactory' => $baseDir . '/main/inc/lib/symfony/Doctrine/ORM/Proxy/ProxyFactory.php', + 'Doctrine\\ORM\\Query' => $baseDir . '/main/inc/lib/symfony/Doctrine/ORM/Query.php', + 'Doctrine\\ORM\\QueryBuilder' => $baseDir . '/main/inc/lib/symfony/Doctrine/ORM/QueryBuilder.php', + 'Doctrine\\ORM\\Query\\AST\\ASTException' => $baseDir . '/main/inc/lib/symfony/Doctrine/ORM/Query/AST/ASTException.php', + 'Doctrine\\ORM\\Query\\AST\\AggregateExpression' => $baseDir . '/main/inc/lib/symfony/Doctrine/ORM/Query/AST/AggregateExpression.php', + 'Doctrine\\ORM\\Query\\AST\\ArithmeticExpression' => $baseDir . '/main/inc/lib/symfony/Doctrine/ORM/Query/AST/ArithmeticExpression.php', + 'Doctrine\\ORM\\Query\\AST\\ArithmeticFactor' => $baseDir . '/main/inc/lib/symfony/Doctrine/ORM/Query/AST/ArithmeticFactor.php', + 'Doctrine\\ORM\\Query\\AST\\ArithmeticTerm' => $baseDir . '/main/inc/lib/symfony/Doctrine/ORM/Query/AST/ArithmeticTerm.php', + 'Doctrine\\ORM\\Query\\AST\\BetweenExpression' => $baseDir . '/main/inc/lib/symfony/Doctrine/ORM/Query/AST/BetweenExpression.php', + 'Doctrine\\ORM\\Query\\AST\\CoalesceExpression' => $baseDir . '/main/inc/lib/symfony/Doctrine/ORM/Query/AST/CoalesceExpression.php', + 'Doctrine\\ORM\\Query\\AST\\CollectionMemberExpression' => $baseDir . '/main/inc/lib/symfony/Doctrine/ORM/Query/AST/CollectionMemberExpression.php', + 'Doctrine\\ORM\\Query\\AST\\ComparisonExpression' => $baseDir . '/main/inc/lib/symfony/Doctrine/ORM/Query/AST/ComparisonExpression.php', + 'Doctrine\\ORM\\Query\\AST\\ConditionalExpression' => $baseDir . '/main/inc/lib/symfony/Doctrine/ORM/Query/AST/ConditionalExpression.php', + 'Doctrine\\ORM\\Query\\AST\\ConditionalFactor' => $baseDir . '/main/inc/lib/symfony/Doctrine/ORM/Query/AST/ConditionalFactor.php', + 'Doctrine\\ORM\\Query\\AST\\ConditionalPrimary' => $baseDir . '/main/inc/lib/symfony/Doctrine/ORM/Query/AST/ConditionalPrimary.php', + 'Doctrine\\ORM\\Query\\AST\\ConditionalTerm' => $baseDir . '/main/inc/lib/symfony/Doctrine/ORM/Query/AST/ConditionalTerm.php', + 'Doctrine\\ORM\\Query\\AST\\DeleteClause' => $baseDir . '/main/inc/lib/symfony/Doctrine/ORM/Query/AST/DeleteClause.php', + 'Doctrine\\ORM\\Query\\AST\\DeleteStatement' => $baseDir . '/main/inc/lib/symfony/Doctrine/ORM/Query/AST/DeleteStatement.php', + 'Doctrine\\ORM\\Query\\AST\\EmptyCollectionComparisonExpression' => $baseDir . '/main/inc/lib/symfony/Doctrine/ORM/Query/AST/EmptyCollectionComparisonExpression.php', + 'Doctrine\\ORM\\Query\\AST\\ExistsExpression' => $baseDir . '/main/inc/lib/symfony/Doctrine/ORM/Query/AST/ExistsExpression.php', + 'Doctrine\\ORM\\Query\\AST\\FromClause' => $baseDir . '/main/inc/lib/symfony/Doctrine/ORM/Query/AST/FromClause.php', + 'Doctrine\\ORM\\Query\\AST\\Functions\\AbsFunction' => $baseDir . '/main/inc/lib/symfony/Doctrine/ORM/Query/AST/Functions/AbsFunction.php', + 'Doctrine\\ORM\\Query\\AST\\Functions\\BitAndFunction' => $baseDir . '/main/inc/lib/symfony/Doctrine/ORM/Query/AST/Functions/BitAndFunction.php', + 'Doctrine\\ORM\\Query\\AST\\Functions\\BitOrFunction' => $baseDir . '/main/inc/lib/symfony/Doctrine/ORM/Query/AST/Functions/BitOrFunction.php', + 'Doctrine\\ORM\\Query\\AST\\Functions\\ConcatFunction' => $baseDir . '/main/inc/lib/symfony/Doctrine/ORM/Query/AST/Functions/ConcatFunction.php', + 'Doctrine\\ORM\\Query\\AST\\Functions\\CurrentDateFunction' => $baseDir . '/main/inc/lib/symfony/Doctrine/ORM/Query/AST/Functions/CurrentDateFunction.php', + 'Doctrine\\ORM\\Query\\AST\\Functions\\CurrentTimeFunction' => $baseDir . '/main/inc/lib/symfony/Doctrine/ORM/Query/AST/Functions/CurrentTimeFunction.php', + 'Doctrine\\ORM\\Query\\AST\\Functions\\CurrentTimestampFunction' => $baseDir . '/main/inc/lib/symfony/Doctrine/ORM/Query/AST/Functions/CurrentTimestampFunction.php', + 'Doctrine\\ORM\\Query\\AST\\Functions\\DateAddFunction' => $baseDir . '/main/inc/lib/symfony/Doctrine/ORM/Query/AST/Functions/DateAddFunction.php', + 'Doctrine\\ORM\\Query\\AST\\Functions\\DateDiffFunction' => $baseDir . '/main/inc/lib/symfony/Doctrine/ORM/Query/AST/Functions/DateDiffFunction.php', + 'Doctrine\\ORM\\Query\\AST\\Functions\\DateSubFunction' => $baseDir . '/main/inc/lib/symfony/Doctrine/ORM/Query/AST/Functions/DateSubFunction.php', + 'Doctrine\\ORM\\Query\\AST\\Functions\\FunctionNode' => $baseDir . '/main/inc/lib/symfony/Doctrine/ORM/Query/AST/Functions/FunctionNode.php', + 'Doctrine\\ORM\\Query\\AST\\Functions\\IdentityFunction' => $baseDir . '/main/inc/lib/symfony/Doctrine/ORM/Query/AST/Functions/IdentityFunction.php', + 'Doctrine\\ORM\\Query\\AST\\Functions\\LengthFunction' => $baseDir . '/main/inc/lib/symfony/Doctrine/ORM/Query/AST/Functions/LengthFunction.php', + 'Doctrine\\ORM\\Query\\AST\\Functions\\LocateFunction' => $baseDir . '/main/inc/lib/symfony/Doctrine/ORM/Query/AST/Functions/LocateFunction.php', + 'Doctrine\\ORM\\Query\\AST\\Functions\\LowerFunction' => $baseDir . '/main/inc/lib/symfony/Doctrine/ORM/Query/AST/Functions/LowerFunction.php', + 'Doctrine\\ORM\\Query\\AST\\Functions\\ModFunction' => $baseDir . '/main/inc/lib/symfony/Doctrine/ORM/Query/AST/Functions/ModFunction.php', + 'Doctrine\\ORM\\Query\\AST\\Functions\\SizeFunction' => $baseDir . '/main/inc/lib/symfony/Doctrine/ORM/Query/AST/Functions/SizeFunction.php', + 'Doctrine\\ORM\\Query\\AST\\Functions\\SqrtFunction' => $baseDir . '/main/inc/lib/symfony/Doctrine/ORM/Query/AST/Functions/SqrtFunction.php', + 'Doctrine\\ORM\\Query\\AST\\Functions\\SubstringFunction' => $baseDir . '/main/inc/lib/symfony/Doctrine/ORM/Query/AST/Functions/SubstringFunction.php', + 'Doctrine\\ORM\\Query\\AST\\Functions\\TrimFunction' => $baseDir . '/main/inc/lib/symfony/Doctrine/ORM/Query/AST/Functions/TrimFunction.php', + 'Doctrine\\ORM\\Query\\AST\\Functions\\UpperFunction' => $baseDir . '/main/inc/lib/symfony/Doctrine/ORM/Query/AST/Functions/UpperFunction.php', + 'Doctrine\\ORM\\Query\\AST\\GeneralCaseExpression' => $baseDir . '/main/inc/lib/symfony/Doctrine/ORM/Query/AST/GeneralCaseExpression.php', + 'Doctrine\\ORM\\Query\\AST\\GroupByClause' => $baseDir . '/main/inc/lib/symfony/Doctrine/ORM/Query/AST/GroupByClause.php', + 'Doctrine\\ORM\\Query\\AST\\HavingClause' => $baseDir . '/main/inc/lib/symfony/Doctrine/ORM/Query/AST/HavingClause.php', + 'Doctrine\\ORM\\Query\\AST\\IdentificationVariableDeclaration' => $baseDir . '/main/inc/lib/symfony/Doctrine/ORM/Query/AST/IdentificationVariableDeclaration.php', + 'Doctrine\\ORM\\Query\\AST\\InExpression' => $baseDir . '/main/inc/lib/symfony/Doctrine/ORM/Query/AST/InExpression.php', + 'Doctrine\\ORM\\Query\\AST\\IndexBy' => $baseDir . '/main/inc/lib/symfony/Doctrine/ORM/Query/AST/IndexBy.php', + 'Doctrine\\ORM\\Query\\AST\\InputParameter' => $baseDir . '/main/inc/lib/symfony/Doctrine/ORM/Query/AST/InputParameter.php', + 'Doctrine\\ORM\\Query\\AST\\InstanceOfExpression' => $baseDir . '/main/inc/lib/symfony/Doctrine/ORM/Query/AST/InstanceOfExpression.php', + 'Doctrine\\ORM\\Query\\AST\\Join' => $baseDir . '/main/inc/lib/symfony/Doctrine/ORM/Query/AST/Join.php', + 'Doctrine\\ORM\\Query\\AST\\JoinAssociationPathExpression' => $baseDir . '/main/inc/lib/symfony/Doctrine/ORM/Query/AST/JoinAssociationPathExpression.php', + 'Doctrine\\ORM\\Query\\AST\\JoinVariableDeclaration' => $baseDir . '/main/inc/lib/symfony/Doctrine/ORM/Query/AST/JoinVariableDeclaration.php', + 'Doctrine\\ORM\\Query\\AST\\LikeExpression' => $baseDir . '/main/inc/lib/symfony/Doctrine/ORM/Query/AST/LikeExpression.php', + 'Doctrine\\ORM\\Query\\AST\\Literal' => $baseDir . '/main/inc/lib/symfony/Doctrine/ORM/Query/AST/Literal.php', + 'Doctrine\\ORM\\Query\\AST\\Node' => $baseDir . '/main/inc/lib/symfony/Doctrine/ORM/Query/AST/Node.php', + 'Doctrine\\ORM\\Query\\AST\\NullComparisonExpression' => $baseDir . '/main/inc/lib/symfony/Doctrine/ORM/Query/AST/NullComparisonExpression.php', + 'Doctrine\\ORM\\Query\\AST\\NullIfExpression' => $baseDir . '/main/inc/lib/symfony/Doctrine/ORM/Query/AST/NullIfExpression.php', + 'Doctrine\\ORM\\Query\\AST\\OrderByClause' => $baseDir . '/main/inc/lib/symfony/Doctrine/ORM/Query/AST/OrderByClause.php', + 'Doctrine\\ORM\\Query\\AST\\OrderByItem' => $baseDir . '/main/inc/lib/symfony/Doctrine/ORM/Query/AST/OrderByItem.php', + 'Doctrine\\ORM\\Query\\AST\\PartialObjectExpression' => $baseDir . '/main/inc/lib/symfony/Doctrine/ORM/Query/AST/PartialObjectExpression.php', + 'Doctrine\\ORM\\Query\\AST\\PathExpression' => $baseDir . '/main/inc/lib/symfony/Doctrine/ORM/Query/AST/PathExpression.php', + 'Doctrine\\ORM\\Query\\AST\\QuantifiedExpression' => $baseDir . '/main/inc/lib/symfony/Doctrine/ORM/Query/AST/QuantifiedExpression.php', + 'Doctrine\\ORM\\Query\\AST\\RangeVariableDeclaration' => $baseDir . '/main/inc/lib/symfony/Doctrine/ORM/Query/AST/RangeVariableDeclaration.php', + 'Doctrine\\ORM\\Query\\AST\\SelectClause' => $baseDir . '/main/inc/lib/symfony/Doctrine/ORM/Query/AST/SelectClause.php', + 'Doctrine\\ORM\\Query\\AST\\SelectExpression' => $baseDir . '/main/inc/lib/symfony/Doctrine/ORM/Query/AST/SelectExpression.php', + 'Doctrine\\ORM\\Query\\AST\\SelectStatement' => $baseDir . '/main/inc/lib/symfony/Doctrine/ORM/Query/AST/SelectStatement.php', + 'Doctrine\\ORM\\Query\\AST\\SimpleArithmeticExpression' => $baseDir . '/main/inc/lib/symfony/Doctrine/ORM/Query/AST/SimpleArithmeticExpression.php', + 'Doctrine\\ORM\\Query\\AST\\SimpleCaseExpression' => $baseDir . '/main/inc/lib/symfony/Doctrine/ORM/Query/AST/SimpleCaseExpression.php', + 'Doctrine\\ORM\\Query\\AST\\SimpleSelectClause' => $baseDir . '/main/inc/lib/symfony/Doctrine/ORM/Query/AST/SimpleSelectClause.php', + 'Doctrine\\ORM\\Query\\AST\\SimpleSelectExpression' => $baseDir . '/main/inc/lib/symfony/Doctrine/ORM/Query/AST/SimpleSelectExpression.php', + 'Doctrine\\ORM\\Query\\AST\\SimpleWhenClause' => $baseDir . '/main/inc/lib/symfony/Doctrine/ORM/Query/AST/SimpleWhenClause.php', + 'Doctrine\\ORM\\Query\\AST\\Subselect' => $baseDir . '/main/inc/lib/symfony/Doctrine/ORM/Query/AST/Subselect.php', + 'Doctrine\\ORM\\Query\\AST\\SubselectFromClause' => $baseDir . '/main/inc/lib/symfony/Doctrine/ORM/Query/AST/SubselectFromClause.php', + 'Doctrine\\ORM\\Query\\AST\\UpdateClause' => $baseDir . '/main/inc/lib/symfony/Doctrine/ORM/Query/AST/UpdateClause.php', + 'Doctrine\\ORM\\Query\\AST\\UpdateItem' => $baseDir . '/main/inc/lib/symfony/Doctrine/ORM/Query/AST/UpdateItem.php', + 'Doctrine\\ORM\\Query\\AST\\UpdateStatement' => $baseDir . '/main/inc/lib/symfony/Doctrine/ORM/Query/AST/UpdateStatement.php', + 'Doctrine\\ORM\\Query\\AST\\WhenClause' => $baseDir . '/main/inc/lib/symfony/Doctrine/ORM/Query/AST/WhenClause.php', + 'Doctrine\\ORM\\Query\\AST\\WhereClause' => $baseDir . '/main/inc/lib/symfony/Doctrine/ORM/Query/AST/WhereClause.php', + 'Doctrine\\ORM\\Query\\Exec\\AbstractSqlExecutor' => $baseDir . '/main/inc/lib/symfony/Doctrine/ORM/Query/Exec/AbstractSqlExecutor.php', + 'Doctrine\\ORM\\Query\\Exec\\MultiTableDeleteExecutor' => $baseDir . '/main/inc/lib/symfony/Doctrine/ORM/Query/Exec/MultiTableDeleteExecutor.php', + 'Doctrine\\ORM\\Query\\Exec\\MultiTableUpdateExecutor' => $baseDir . '/main/inc/lib/symfony/Doctrine/ORM/Query/Exec/MultiTableUpdateExecutor.php', + 'Doctrine\\ORM\\Query\\Exec\\SingleSelectExecutor' => $baseDir . '/main/inc/lib/symfony/Doctrine/ORM/Query/Exec/SingleSelectExecutor.php', + 'Doctrine\\ORM\\Query\\Exec\\SingleTableDeleteUpdateExecutor' => $baseDir . '/main/inc/lib/symfony/Doctrine/ORM/Query/Exec/SingleTableDeleteUpdateExecutor.php', + 'Doctrine\\ORM\\Query\\Expr' => $baseDir . '/main/inc/lib/symfony/Doctrine/ORM/Query/Expr.php', + 'Doctrine\\ORM\\Query\\Expr\\Andx' => $baseDir . '/main/inc/lib/symfony/Doctrine/ORM/Query/Expr/Andx.php', + 'Doctrine\\ORM\\Query\\Expr\\Base' => $baseDir . '/main/inc/lib/symfony/Doctrine/ORM/Query/Expr/Base.php', + 'Doctrine\\ORM\\Query\\Expr\\Comparison' => $baseDir . '/main/inc/lib/symfony/Doctrine/ORM/Query/Expr/Comparison.php', + 'Doctrine\\ORM\\Query\\Expr\\Composite' => $baseDir . '/main/inc/lib/symfony/Doctrine/ORM/Query/Expr/Composite.php', + 'Doctrine\\ORM\\Query\\Expr\\From' => $baseDir . '/main/inc/lib/symfony/Doctrine/ORM/Query/Expr/From.php', + 'Doctrine\\ORM\\Query\\Expr\\Func' => $baseDir . '/main/inc/lib/symfony/Doctrine/ORM/Query/Expr/Func.php', + 'Doctrine\\ORM\\Query\\Expr\\GroupBy' => $baseDir . '/main/inc/lib/symfony/Doctrine/ORM/Query/Expr/GroupBy.php', + 'Doctrine\\ORM\\Query\\Expr\\Join' => $baseDir . '/main/inc/lib/symfony/Doctrine/ORM/Query/Expr/Join.php', + 'Doctrine\\ORM\\Query\\Expr\\Literal' => $baseDir . '/main/inc/lib/symfony/Doctrine/ORM/Query/Expr/Literal.php', + 'Doctrine\\ORM\\Query\\Expr\\Math' => $baseDir . '/main/inc/lib/symfony/Doctrine/ORM/Query/Expr/Math.php', + 'Doctrine\\ORM\\Query\\Expr\\OrderBy' => $baseDir . '/main/inc/lib/symfony/Doctrine/ORM/Query/Expr/OrderBy.php', + 'Doctrine\\ORM\\Query\\Expr\\Orx' => $baseDir . '/main/inc/lib/symfony/Doctrine/ORM/Query/Expr/Orx.php', + 'Doctrine\\ORM\\Query\\Expr\\Select' => $baseDir . '/main/inc/lib/symfony/Doctrine/ORM/Query/Expr/Select.php', + 'Doctrine\\ORM\\Query\\FilterCollection' => $baseDir . '/main/inc/lib/symfony/Doctrine/ORM/Query/FilterCollection.php', + 'Doctrine\\ORM\\Query\\Filter\\SQLFilter' => $baseDir . '/main/inc/lib/symfony/Doctrine/ORM/Query/Filter/SQLFilter.php', + 'Doctrine\\ORM\\Query\\Lexer' => $baseDir . '/main/inc/lib/symfony/Doctrine/ORM/Query/Lexer.php', + 'Doctrine\\ORM\\Query\\ParameterTypeInferer' => $baseDir . '/main/inc/lib/symfony/Doctrine/ORM/Query/ParameterTypeInferer.php', + 'Doctrine\\ORM\\Query\\Parser' => $baseDir . '/main/inc/lib/symfony/Doctrine/ORM/Query/Parser.php', + 'Doctrine\\ORM\\Query\\ParserResult' => $baseDir . '/main/inc/lib/symfony/Doctrine/ORM/Query/ParserResult.php', + 'Doctrine\\ORM\\Query\\Printer' => $baseDir . '/main/inc/lib/symfony/Doctrine/ORM/Query/Printer.php', + 'Doctrine\\ORM\\Query\\QueryException' => $baseDir . '/main/inc/lib/symfony/Doctrine/ORM/Query/QueryException.php', + 'Doctrine\\ORM\\Query\\ResultSetMapping' => $baseDir . '/main/inc/lib/symfony/Doctrine/ORM/Query/ResultSetMapping.php', + 'Doctrine\\ORM\\Query\\ResultSetMappingBuilder' => $baseDir . '/main/inc/lib/symfony/Doctrine/ORM/Query/ResultSetMappingBuilder.php', + 'Doctrine\\ORM\\Query\\SqlWalker' => $baseDir . '/main/inc/lib/symfony/Doctrine/ORM/Query/SqlWalker.php', + 'Doctrine\\ORM\\Query\\TreeWalker' => $baseDir . '/main/inc/lib/symfony/Doctrine/ORM/Query/TreeWalker.php', + 'Doctrine\\ORM\\Query\\TreeWalkerAdapter' => $baseDir . '/main/inc/lib/symfony/Doctrine/ORM/Query/TreeWalkerAdapter.php', + 'Doctrine\\ORM\\Query\\TreeWalkerChain' => $baseDir . '/main/inc/lib/symfony/Doctrine/ORM/Query/TreeWalkerChain.php', + 'Doctrine\\ORM\\Tools\\Console\\Command\\ClearCache\\MetadataCommand' => $baseDir . '/main/inc/lib/symfony/Doctrine/ORM/Tools/Console/Command/ClearCache/MetadataCommand.php', + 'Doctrine\\ORM\\Tools\\Console\\Command\\ClearCache\\QueryCommand' => $baseDir . '/main/inc/lib/symfony/Doctrine/ORM/Tools/Console/Command/ClearCache/QueryCommand.php', + 'Doctrine\\ORM\\Tools\\Console\\Command\\ClearCache\\ResultCommand' => $baseDir . '/main/inc/lib/symfony/Doctrine/ORM/Tools/Console/Command/ClearCache/ResultCommand.php', + 'Doctrine\\ORM\\Tools\\Console\\Command\\ConvertDoctrine1SchemaCommand' => $baseDir . '/main/inc/lib/symfony/Doctrine/ORM/Tools/Console/Command/ConvertDoctrine1SchemaCommand.php', + 'Doctrine\\ORM\\Tools\\Console\\Command\\ConvertMappingCommand' => $baseDir . '/main/inc/lib/symfony/Doctrine/ORM/Tools/Console/Command/ConvertMappingCommand.php', + 'Doctrine\\ORM\\Tools\\Console\\Command\\EnsureProductionSettingsCommand' => $baseDir . '/main/inc/lib/symfony/Doctrine/ORM/Tools/Console/Command/EnsureProductionSettingsCommand.php', + 'Doctrine\\ORM\\Tools\\Console\\Command\\GenerateEntitiesCommand' => $baseDir . '/main/inc/lib/symfony/Doctrine/ORM/Tools/Console/Command/GenerateEntitiesCommand.php', + 'Doctrine\\ORM\\Tools\\Console\\Command\\GenerateProxiesCommand' => $baseDir . '/main/inc/lib/symfony/Doctrine/ORM/Tools/Console/Command/GenerateProxiesCommand.php', + 'Doctrine\\ORM\\Tools\\Console\\Command\\GenerateRepositoriesCommand' => $baseDir . '/main/inc/lib/symfony/Doctrine/ORM/Tools/Console/Command/GenerateRepositoriesCommand.php', + 'Doctrine\\ORM\\Tools\\Console\\Command\\InfoCommand' => $baseDir . '/main/inc/lib/symfony/Doctrine/ORM/Tools/Console/Command/InfoCommand.php', + 'Doctrine\\ORM\\Tools\\Console\\Command\\RunDqlCommand' => $baseDir . '/main/inc/lib/symfony/Doctrine/ORM/Tools/Console/Command/RunDqlCommand.php', + 'Doctrine\\ORM\\Tools\\Console\\Command\\SchemaTool\\AbstractCommand' => $baseDir . '/main/inc/lib/symfony/Doctrine/ORM/Tools/Console/Command/SchemaTool/AbstractCommand.php', + 'Doctrine\\ORM\\Tools\\Console\\Command\\SchemaTool\\CreateCommand' => $baseDir . '/main/inc/lib/symfony/Doctrine/ORM/Tools/Console/Command/SchemaTool/CreateCommand.php', + 'Doctrine\\ORM\\Tools\\Console\\Command\\SchemaTool\\DropCommand' => $baseDir . '/main/inc/lib/symfony/Doctrine/ORM/Tools/Console/Command/SchemaTool/DropCommand.php', + 'Doctrine\\ORM\\Tools\\Console\\Command\\SchemaTool\\UpdateCommand' => $baseDir . '/main/inc/lib/symfony/Doctrine/ORM/Tools/Console/Command/SchemaTool/UpdateCommand.php', + 'Doctrine\\ORM\\Tools\\Console\\Command\\ValidateSchemaCommand' => $baseDir . '/main/inc/lib/symfony/Doctrine/ORM/Tools/Console/Command/ValidateSchemaCommand.php', + 'Doctrine\\ORM\\Tools\\Console\\ConsoleRunner' => $baseDir . '/main/inc/lib/symfony/Doctrine/ORM/Tools/Console/ConsoleRunner.php', + 'Doctrine\\ORM\\Tools\\Console\\Helper\\EntityManagerHelper' => $baseDir . '/main/inc/lib/symfony/Doctrine/ORM/Tools/Console/Helper/EntityManagerHelper.php', + 'Doctrine\\ORM\\Tools\\Console\\MetadataFilter' => $baseDir . '/main/inc/lib/symfony/Doctrine/ORM/Tools/Console/MetadataFilter.php', + 'Doctrine\\ORM\\Tools\\ConvertDoctrine1Schema' => $baseDir . '/main/inc/lib/symfony/Doctrine/ORM/Tools/ConvertDoctrine1Schema.php', + 'Doctrine\\ORM\\Tools\\DebugUnitOfWorkListener' => $baseDir . '/main/inc/lib/symfony/Doctrine/ORM/Tools/DebugUnitOfWorkListener.php', + 'Doctrine\\ORM\\Tools\\DisconnectedClassMetadataFactory' => $baseDir . '/main/inc/lib/symfony/Doctrine/ORM/Tools/DisconnectedClassMetadataFactory.php', + 'Doctrine\\ORM\\Tools\\EntityGenerator' => $baseDir . '/main/inc/lib/symfony/Doctrine/ORM/Tools/EntityGenerator.php', + 'Doctrine\\ORM\\Tools\\EntityRepositoryGenerator' => $baseDir . '/main/inc/lib/symfony/Doctrine/ORM/Tools/EntityRepositoryGenerator.php', + 'Doctrine\\ORM\\Tools\\Event\\GenerateSchemaEventArgs' => $baseDir . '/main/inc/lib/symfony/Doctrine/ORM/Tools/Event/GenerateSchemaEventArgs.php', + 'Doctrine\\ORM\\Tools\\Event\\GenerateSchemaTableEventArgs' => $baseDir . '/main/inc/lib/symfony/Doctrine/ORM/Tools/Event/GenerateSchemaTableEventArgs.php', + 'Doctrine\\ORM\\Tools\\Export\\ClassMetadataExporter' => $baseDir . '/main/inc/lib/symfony/Doctrine/ORM/Tools/Export/ClassMetadataExporter.php', + 'Doctrine\\ORM\\Tools\\Export\\Driver\\AbstractExporter' => $baseDir . '/main/inc/lib/symfony/Doctrine/ORM/Tools/Export/Driver/AbstractExporter.php', + 'Doctrine\\ORM\\Tools\\Export\\Driver\\AnnotationExporter' => $baseDir . '/main/inc/lib/symfony/Doctrine/ORM/Tools/Export/Driver/AnnotationExporter.php', + 'Doctrine\\ORM\\Tools\\Export\\Driver\\PhpExporter' => $baseDir . '/main/inc/lib/symfony/Doctrine/ORM/Tools/Export/Driver/PhpExporter.php', + 'Doctrine\\ORM\\Tools\\Export\\Driver\\XmlExporter' => $baseDir . '/main/inc/lib/symfony/Doctrine/ORM/Tools/Export/Driver/XmlExporter.php', + 'Doctrine\\ORM\\Tools\\Export\\Driver\\YamlExporter' => $baseDir . '/main/inc/lib/symfony/Doctrine/ORM/Tools/Export/Driver/YamlExporter.php', + 'Doctrine\\ORM\\Tools\\Export\\ExportException' => $baseDir . '/main/inc/lib/symfony/Doctrine/ORM/Tools/Export/ExportException.php', + 'Doctrine\\ORM\\Tools\\Pagination\\CountWalker' => $baseDir . '/main/inc/lib/symfony/Doctrine/ORM/Tools/Pagination/CountWalker.php', + 'Doctrine\\ORM\\Tools\\Pagination\\LimitSubqueryWalker' => $baseDir . '/main/inc/lib/symfony/Doctrine/ORM/Tools/Pagination/LimitSubqueryWalker.php', + 'Doctrine\\ORM\\Tools\\Pagination\\Paginator' => $baseDir . '/main/inc/lib/symfony/Doctrine/ORM/Tools/Pagination/Paginator.php', + 'Doctrine\\ORM\\Tools\\Pagination\\WhereInWalker' => $baseDir . '/main/inc/lib/symfony/Doctrine/ORM/Tools/Pagination/WhereInWalker.php', + 'Doctrine\\ORM\\Tools\\ResolveTargetEntityListener' => $baseDir . '/main/inc/lib/symfony/Doctrine/ORM/Tools/ResolveTargetEntityListener.php', + 'Doctrine\\ORM\\Tools\\SchemaTool' => $baseDir . '/main/inc/lib/symfony/Doctrine/ORM/Tools/SchemaTool.php', + 'Doctrine\\ORM\\Tools\\SchemaValidator' => $baseDir . '/main/inc/lib/symfony/Doctrine/ORM/Tools/SchemaValidator.php', + 'Doctrine\\ORM\\Tools\\Setup' => $baseDir . '/main/inc/lib/symfony/Doctrine/ORM/Tools/Setup.php', + 'Doctrine\\ORM\\Tools\\ToolEvents' => $baseDir . '/main/inc/lib/symfony/Doctrine/ORM/Tools/ToolEvents.php', + 'Doctrine\\ORM\\Tools\\ToolsException' => $baseDir . '/main/inc/lib/symfony/Doctrine/ORM/Tools/ToolsException.php', + 'Doctrine\\ORM\\TransactionRequiredException' => $baseDir . '/main/inc/lib/symfony/Doctrine/ORM/TransactionRequiredException.php', + 'Doctrine\\ORM\\UnitOfWork' => $baseDir . '/main/inc/lib/symfony/Doctrine/ORM/UnitOfWork.php', + 'Doctrine\\ORM\\Version' => $baseDir . '/main/inc/lib/symfony/Doctrine/ORM/Version.php', + 'Document' => $baseDir . '/main/coursecopy/classes/Document.class.php', + 'DocumentManager' => $baseDir . '/main/inc/lib/document.lib.php', + 'DropboxLink' => $baseDir . '/main/gradebook/lib/be/dropboxlink.class.php', + 'DummyCourseCreator' => $baseDir . '/main/coursecopy/classes/DummyCourseCreator.class.php', + 'Encoding' => $baseDir . '/main/inc/lib/system/text/encoding.class.php', + 'EncodingConverter' => $baseDir . '/main/inc/lib/system/text/encoding_converter.class.php', + 'Entity' => $baseDir . '/main/inc/lib/entity.class.php', + 'EntityRepository' => $baseDir . '/main/inc/lib/entity_repository.class.php', + 'EvalForm' => $baseDir . '/main/gradebook/lib/fe/evalform.class.php', + 'EvalLink' => $baseDir . '/main/gradebook/lib/be/evallink.class.php', + 'EvalMath' => $baseDir . '/main/inc/lib/evalmath.class.php', + 'EvalMathStack' => $baseDir . '/main/inc/lib/evalmath.class.php', + 'Evaluation' => $baseDir . '/main/gradebook/lib/be/evaluation.class.php', + 'Event' => $baseDir . '/main/coursecopy/classes/Event.class.php', + 'EventEmailTemplate' => $baseDir . '/main/inc/lib/event_email_template.class.php', + 'EventsDispatcher' => $baseDir . '/main/inc/lib/events_dispatcher.class.php', + 'EventsMail' => $baseDir . '/main/inc/lib/events_email.class.php', + 'Exercise' => $baseDir . '/main/exercice/exercise.class.php', + 'ExerciseLink' => $baseDir . '/main/gradebook/lib/be/exerciselink.class.php', + 'ExerciseResult' => $baseDir . '/main/exercice/exercise_result.class.php', + 'ExerciseShowFunctions' => $baseDir . '/main/inc/lib/exercise_show_functions.lib.php', + 'Export' => $baseDir . '/main/inc/lib/export.lib.inc.php', + 'ExtraField' => $baseDir . '/main/inc/lib/extra_field.lib.php', + 'ExtraFieldOption' => $baseDir . '/main/inc/lib/extra_field_option.lib.php', + 'ExtraFieldValue' => $baseDir . '/main/inc/lib/extra_field_value.lib.php', + 'FCKeditor' => $baseDir . '/main/inc/lib/fckeditor/fckeditor.php', + 'Facebook' => $baseDir . '/main/auth/external_login/facebook-php-sdk/src/facebook.php', + 'FacebookApiException' => $baseDir . '/main/auth/external_login/facebook-php-sdk/src/base_facebook.php', + 'FileManager' => $baseDir . '/main/inc/lib/fileManage.lib.php', + 'FileReader' => $baseDir . '/main/inc/lib/system/io/file_reader.class.php', + 'FileStore' => $baseDir . '/main/inc/lib/file_store.class.php', + 'FileWriter' => $baseDir . '/main/inc/lib/system/io/file_writer.class.php', + 'File_ANSI' => $baseDir . '/main/inc/lib/phpseclib/File/ANSI.php', + 'File_ASN1' => $baseDir . '/main/inc/lib/phpseclib/File/ASN1.php', + 'File_ASN1_Element' => $baseDir . '/main/inc/lib/phpseclib/File/ASN1.php', + 'File_X509' => $baseDir . '/main/inc/lib/phpseclib/File/X509.php', + 'Files' => $baseDir . '/main/inc/lib/fckeditor/editor/plugins/ImageManager/Classes/Files.php', + 'FillBlanks' => $baseDir . '/main/exercice/fill_blanks.class.php', + 'FilterASCII85' => $baseDir . '/main/inc/lib/mpdf/mpdfi/filters/FilterASCII85.php', + 'FilterLZW' => $baseDir . '/main/inc/lib/mpdf/mpdfi/filters/FilterLZW.php', + 'FlatViewDataGenerator' => $baseDir . '/main/gradebook/lib/flatview_data_generator.class.php', + 'FlatViewTable' => $baseDir . '/main/gradebook/lib/fe/flatviewtable.class.php', + 'Font_Metrics' => $baseDir . '/main/inc/lib/phpdocx/pdf/include/font_metrics.cls.php', + 'FormValidator' => $baseDir . '/main/inc/lib/formvalidator/FormValidator.class.php', + 'Forum' => $baseDir . '/main/coursecopy/classes/Forum.class.php', + 'ForumCategory' => $baseDir . '/main/coursecopy/classes/ForumCategory.class.php', + 'ForumPost' => $baseDir . '/main/coursecopy/classes/ForumPost.class.php', + 'ForumThreadLink' => $baseDir . '/main/gradebook/lib/be/forumthreadlink.class.php', + 'ForumTopic' => $baseDir . '/main/coursecopy/classes/ForumTopic.class.php', + 'Frame' => $baseDir . '/main/inc/lib/phpdocx/pdf/include/frame.cls.php', + 'FrameFiller' => $baseDir . '/main/inc/lib/phpqrcode/phpqrcode.php', + 'FrameList' => $baseDir . '/main/inc/lib/phpdocx/pdf/include/frame.cls.php', + 'FrameListIterator' => $baseDir . '/main/inc/lib/phpdocx/pdf/include/frame.cls.php', + 'FrameTreeIterator' => $baseDir . '/main/inc/lib/phpdocx/pdf/include/frame.cls.php', + 'FrameTreeList' => $baseDir . '/main/inc/lib/phpdocx/pdf/include/frame.cls.php', + 'Frame_Decorator' => $baseDir . '/main/inc/lib/phpdocx/pdf/include/frame_decorator.cls.php', + 'Frame_Factory' => $baseDir . '/main/inc/lib/phpdocx/pdf/include/frame_factory.cls.php', + 'Frame_Reflower' => $baseDir . '/main/inc/lib/phpdocx/pdf/include/frame_reflower.cls.php', + 'Frame_Tree' => $baseDir . '/main/inc/lib/phpdocx/pdf/include/frame_tree.cls.php', + 'FreeAnswer' => $baseDir . '/main/exercice/freeanswer.class.php', + 'GDWrapper' => $baseDir . '/main/inc/lib/image.lib.php', + 'GD_Adapter' => $baseDir . '/main/inc/lib/phpdocx/pdf/include/gd_adapter.cls.php', + 'Generated_Frame_Reflower' => $baseDir . '/main/inc/lib/phpdocx/pdf/include/generated_frame_reflower.cls.php', + 'GlobalMultipleAnswer' => $baseDir . '/main/exercice/global_multiple_answer.class.php', + 'Glossary' => $baseDir . '/main/coursecopy/classes/Glossary.class.php', + 'GlossaryManager' => $baseDir . '/main/inc/lib/glossary.lib.php', + 'GradeModel' => $baseDir . '/main/inc/lib/grade_model.lib.php', + 'GradeModelComponents' => $baseDir . '/main/inc/lib/grade_model.lib.php', + 'Gradebook' => $baseDir . '/main/inc/lib/gradebook.lib.php', + 'GradebookDataGenerator' => $baseDir . '/main/gradebook/lib/gradebook_data_generator.class.php', + 'GradebookItem' => $baseDir . '/main/gradebook/lib/be/gradebookitem.class.php', + 'GradebookTable' => $baseDir . '/main/gradebook/lib/fe/gradebooktable.class.php', + 'GroupManager' => $baseDir . '/main/inc/lib/groupmanager.lib.php', + 'GroupPortalManager' => $baseDir . '/main/inc/lib/group_portal_manager.lib.php', + 'HTML_Common' => $baseDir . '/main/inc/lib/pear/HTML/Common.php', + 'HTML_QuickForm' => $baseDir . '/main/inc/lib/pear/HTML/QuickForm.php', + 'HTML_QuickForm_Action' => $baseDir . '/main/inc/lib/pear/HTML/QuickForm/Action.php', + 'HTML_QuickForm_Action_Back' => $baseDir . '/main/inc/lib/pear/HTML/QuickForm/Action/Back.php', + 'HTML_QuickForm_Action_Direct' => $baseDir . '/main/inc/lib/pear/HTML/QuickForm/Action/Direct.php', + 'HTML_QuickForm_Action_Display' => $baseDir . '/main/inc/lib/pear/HTML/QuickForm/Action/Display.php', + 'HTML_QuickForm_Action_Jump' => $baseDir . '/main/inc/lib/pear/HTML/QuickForm/Action/Jump.php', + 'HTML_QuickForm_Action_Next' => $baseDir . '/main/inc/lib/pear/HTML/QuickForm/Action/Next.php', + 'HTML_QuickForm_Action_Submit' => $baseDir . '/main/inc/lib/pear/HTML/QuickForm/Action/Submit.php', + 'HTML_QuickForm_CAPTCHA' => $baseDir . '/main/inc/lib/pear/HTML/QuickForm/CAPTCHA.php', + 'HTML_QuickForm_CAPTCHA_Equation' => $baseDir . '/main/inc/lib/pear/HTML/QuickForm/CAPTCHA/Equation.php', + 'HTML_QuickForm_CAPTCHA_Figlet' => $baseDir . '/main/inc/lib/pear/HTML/QuickForm/CAPTCHA/Figlet.php', + 'HTML_QuickForm_CAPTCHA_Image' => $baseDir . '/main/inc/lib/pear/HTML/QuickForm/CAPTCHA/Image.php', + 'HTML_QuickForm_CAPTCHA_Word' => $baseDir . '/main/inc/lib/pear/HTML/QuickForm/CAPTCHA/Word.php', + 'HTML_QuickForm_Compare_Fields' => $baseDir . '/main/inc/lib/formvalidator/Rule/CompareFields.php', + 'HTML_QuickForm_Controller' => $baseDir . '/main/inc/lib/pear/HTML/QuickForm/Controller.php', + 'HTML_QuickForm_Error' => $baseDir . '/main/inc/lib/pear/HTML/QuickForm.php', + 'HTML_QuickForm_Page' => $baseDir . '/main/inc/lib/pear/HTML/QuickForm/Page.php', + 'HTML_QuickForm_Renderer' => $baseDir . '/main/inc/lib/pear/HTML/QuickForm/Renderer.php', + 'HTML_QuickForm_Renderer_Array' => $baseDir . '/main/inc/lib/pear/HTML/QuickForm/Renderer/Array.php', + 'HTML_QuickForm_Renderer_ArraySmarty' => $baseDir . '/main/inc/lib/pear/HTML/QuickForm/Renderer/ArraySmarty.php', + 'HTML_QuickForm_Renderer_Default' => $baseDir . '/main/inc/lib/pear/HTML/QuickForm/Renderer/Default.php', + 'HTML_QuickForm_Renderer_ITDynamic' => $baseDir . '/main/inc/lib/pear/HTML/QuickForm/Renderer/ITDynamic.php', + 'HTML_QuickForm_Renderer_ITStatic' => $baseDir . '/main/inc/lib/pear/HTML/QuickForm/Renderer/ITStatic.php', + 'HTML_QuickForm_Renderer_Object' => $baseDir . '/main/inc/lib/pear/HTML/QuickForm/Renderer/Object.php', + 'HTML_QuickForm_Renderer_ObjectFlexy' => $baseDir . '/main/inc/lib/pear/HTML/QuickForm/Renderer/ObjectFlexy.php', + 'HTML_QuickForm_Renderer_QuickHtml' => $baseDir . '/main/inc/lib/pear/HTML/QuickForm/Renderer/QuickHtml.php', + 'HTML_QuickForm_Rule' => $baseDir . '/main/inc/lib/pear/HTML/QuickForm/Rule.php', + 'HTML_QuickForm_RuleRegistry' => $baseDir . '/main/inc/lib/pear/HTML/QuickForm/RuleRegistry.php', + 'HTML_QuickForm_Rule_CAPTCHA' => $baseDir . '/main/inc/lib/pear/HTML/QuickForm/Rule/CAPTCHA.php', + 'HTML_QuickForm_Rule_Callback' => $baseDir . '/main/inc/lib/pear/HTML/QuickForm/Rule/Callback.php', + 'HTML_QuickForm_Rule_Compare' => $baseDir . '/main/inc/lib/pear/HTML/QuickForm/Rule/Compare.php', + 'HTML_QuickForm_Rule_CompareDate' => $baseDir . '/main/inc/lib/pear/HTML/QuickForm/Rule/CompareDate.php', + 'HTML_QuickForm_Rule_Date' => $baseDir . '/main/inc/lib/formvalidator/Rule/Date.php', + 'HTML_QuickForm_Rule_DateCompare' => $baseDir . '/main/inc/lib/formvalidator/Rule/DateCompare.php', + 'HTML_QuickForm_Rule_Email' => $baseDir . '/main/inc/lib/pear/HTML/QuickForm/Rule/Email.php', + 'HTML_QuickForm_Rule_Filetype' => $baseDir . '/main/inc/lib/formvalidator/Rule/Filetype.php', + 'HTML_QuickForm_Rule_HTML' => $baseDir . '/main/inc/lib/formvalidator/Rule/HTML.php', + 'HTML_QuickForm_Rule_Mobile_Phone_Number' => $baseDir . '/main/inc/lib/formvalidator/Rule/MobilePhoneNumber.php', + 'HTML_QuickForm_Rule_MultipleRequired' => $baseDir . '/main/inc/lib/formvalidator/Rule/MultipleRequired.php', + 'HTML_QuickForm_Rule_Range' => $baseDir . '/main/inc/lib/pear/HTML/QuickForm/Rule/Range.php', + 'HTML_QuickForm_Rule_Regex' => $baseDir . '/main/inc/lib/pear/HTML/QuickForm/Rule/Regex.php', + 'HTML_QuickForm_Rule_Required' => $baseDir . '/main/inc/lib/pear/HTML/QuickForm/Rule/Required.php', + 'HTML_QuickForm_Rule_Url' => $baseDir . '/main/inc/lib/formvalidator/Rule/Url.php', + 'HTML_QuickForm_Rule_Username' => $baseDir . '/main/inc/lib/formvalidator/Rule/Username.php', + 'HTML_QuickForm_Rule_UsernameAvailable' => $baseDir . '/main/inc/lib/formvalidator/Rule/UsernameAvailable.php', + 'HTML_QuickForm_Select_Ajax' => $baseDir . '/main/inc/lib/formvalidator/Element/select_ajax.php', + 'HTML_QuickForm_Select_Language' => $baseDir . '/main/inc/lib/formvalidator/Element/select_language.php', + 'HTML_QuickForm_Select_Theme' => $baseDir . '/main/inc/lib/formvalidator/Element/select_theme.php', + 'HTML_QuickForm_advanced_settings' => $baseDir . '/main/inc/lib/pear/HTML/QuickForm/advanced_settings.php', + 'HTML_QuickForm_advcheckbox' => $baseDir . '/main/inc/lib/pear/HTML/QuickForm/advcheckbox.php', + 'HTML_QuickForm_advmultiselect' => $baseDir . '/main/inc/lib/pear/HTML/QuickForm/advmultiselect.php', + 'HTML_QuickForm_autocomplete' => $baseDir . '/main/inc/lib/pear/HTML/QuickForm/autocomplete.php', + 'HTML_QuickForm_button' => $baseDir . '/main/inc/lib/pear/HTML/QuickForm/button.php', + 'HTML_QuickForm_checkbox' => $baseDir . '/main/inc/lib/pear/HTML/QuickForm/checkbox.php', + 'HTML_QuickForm_date' => $baseDir . '/main/inc/lib/pear/HTML/QuickForm/date.php', + 'HTML_QuickForm_datepicker' => $baseDir . '/main/inc/lib/formvalidator/Element/datepicker_old.php', + 'HTML_QuickForm_datepickerdate' => $baseDir . '/main/inc/lib/formvalidator/Element/datepickerdate.php', + 'HTML_QuickForm_element' => $baseDir . '/main/inc/lib/pear/HTML/QuickForm/element.php', + 'HTML_QuickForm_email' => $baseDir . '/main/inc/lib/pear/HTML/QuickForm/email.php', + 'HTML_QuickForm_file' => $baseDir . '/main/inc/lib/pear/HTML/QuickForm/file.php', + 'HTML_QuickForm_group' => $baseDir . '/main/inc/lib/pear/HTML/QuickForm/group.php', + 'HTML_QuickForm_header' => $baseDir . '/main/inc/lib/pear/HTML/QuickForm/header.php', + 'HTML_QuickForm_hidden' => $baseDir . '/main/inc/lib/pear/HTML/QuickForm/hidden.php', + 'HTML_QuickForm_hiddenselect' => $baseDir . '/main/inc/lib/pear/HTML/QuickForm/hiddenselect.php', + 'HTML_QuickForm_hierselect' => $baseDir . '/main/inc/lib/pear/HTML/QuickForm/hierselect.php', + 'HTML_QuickForm_html' => $baseDir . '/main/inc/lib/pear/HTML/QuickForm/html.php', + 'HTML_QuickForm_html_editor' => $baseDir . '/main/inc/lib/formvalidator/Element/html_editor.php', + 'HTML_QuickForm_image' => $baseDir . '/main/inc/lib/pear/HTML/QuickForm/image.php', + 'HTML_QuickForm_input' => $baseDir . '/main/inc/lib/pear/HTML/QuickForm/input.php', + 'HTML_QuickForm_label' => $baseDir . '/main/inc/lib/pear/HTML/QuickForm/label.php', + 'HTML_QuickForm_link' => $baseDir . '/main/inc/lib/pear/HTML/QuickForm/link.php', + 'HTML_QuickForm_password' => $baseDir . '/main/inc/lib/pear/HTML/QuickForm/password.php', + 'HTML_QuickForm_radio' => $baseDir . '/main/inc/lib/pear/HTML/QuickForm/radio.php', + 'HTML_QuickForm_receivers' => $baseDir . '/main/inc/lib/formvalidator/Element/receivers.php', + 'HTML_QuickForm_reset' => $baseDir . '/main/inc/lib/pear/HTML/QuickForm/reset.php', + 'HTML_QuickForm_select' => $baseDir . '/main/inc/lib/pear/HTML/QuickForm/select.php', + 'HTML_QuickForm_static' => $baseDir . '/main/inc/lib/pear/HTML/QuickForm/static.php', + 'HTML_QuickForm_stylebutton' => $baseDir . '/main/inc/lib/formvalidator/Element/style_button.php', + 'HTML_QuickForm_styleresetbutton' => $baseDir . '/main/inc/lib/formvalidator/Element/style_reset_button.php', + 'HTML_QuickForm_stylesubmitbutton' => $baseDir . '/main/inc/lib/formvalidator/Element/style_submit_button.php', + 'HTML_QuickForm_submit' => $baseDir . '/main/inc/lib/pear/HTML/QuickForm/submit.php', + 'HTML_QuickForm_text' => $baseDir . '/main/inc/lib/pear/HTML/QuickForm/text.php', + 'HTML_QuickForm_textarea' => $baseDir . '/main/inc/lib/pear/HTML/QuickForm/textarea.php', + 'HTML_QuickForm_xbutton' => $baseDir . '/main/inc/lib/pear/HTML/QuickForm/xbutton.php', + 'HTML_Table' => $baseDir . '/main/inc/lib/pear/HTML/Table.php', + 'HTML_Table_Storage' => $baseDir . '/main/inc/lib/pear/HTML/Table/Storage.php', + 'Header' => $baseDir . '/main/inc/lib/system/web/header.class.php', + 'History' => $baseDir . '/main/inc/lib/fckeditor/editor/plugins/ajaxfilemanager/inc/class.history.php', + 'HotSpot' => $baseDir . '/main/exercice/hotspot.class.php', + 'HotSpotDelineation' => $baseDir . '/main/exercice/hotspot.class.php', + 'HotpotatoesExerciseResult' => $baseDir . '/main/exercice/hotpotatoes_exercise_result.class.php', + 'Html_Quickform_Rule_Date' => $baseDir . '/main/inc/lib/pear/HTML/QuickForm/Rule/Date.php', + 'HttpResource' => $baseDir . '/main/inc/lib/system/media/renderer/http_resource.class.php', + 'Image' => $baseDir . '/main/inc/lib/image.lib.php', + 'ImageAjaxFileManager' => $baseDir . '/main/inc/lib/fckeditor/editor/plugins/ajaxfilemanager/inc/class.image.php', + 'ImageEditor' => $baseDir . '/main/inc/lib/fckeditor/editor/plugins/ImageManager/Classes/ImageEditor.php', + 'ImageManager' => $baseDir . '/main/inc/lib/fckeditor/editor/plugins/ImageManager/Classes/ImageManager.php', + 'ImageWrapper' => $baseDir . '/main/inc/lib/image.lib.php', + 'Image_Cache' => $baseDir . '/main/inc/lib/phpdocx/pdf/include/image_cache.cls.php', + 'Image_Frame_Decorator' => $baseDir . '/main/inc/lib/phpdocx/pdf/include/image_frame_decorator.cls.php', + 'Image_Frame_Reflower' => $baseDir . '/main/inc/lib/phpdocx/pdf/include/image_frame_reflower.cls.php', + 'Image_Renderer' => $baseDir . '/main/inc/lib/phpdocx/pdf/include/image_renderer.cls.php', + 'Image_Text' => $baseDir . '/main/inc/lib/pear/Image/Text.php', + 'Image_Text_Exception' => $baseDir . '/main/inc/lib/pear/Image/Text/Exception.php', + 'Image_Transform' => $baseDir . '/main/inc/lib/fckeditor/editor/plugins/ImageManager/Classes/Transform.php', + 'Image_Transform_Driver_GD' => $baseDir . '/main/inc/lib/fckeditor/editor/plugins/ImageManager/Classes/GD.php', + 'Image_Transform_Driver_IM' => $baseDir . '/main/inc/lib/fckeditor/editor/plugins/ImageManager/Classes/IM.php', + 'Image_Transform_Driver_NetPBM' => $baseDir . '/main/inc/lib/fckeditor/editor/plugins/ImageManager/Classes/NetPBM.php', + 'ImagickWrapper' => $baseDir . '/main/inc/lib/image.lib.php', + 'Import' => $baseDir . '/main/inc/lib/import.lib.php', + 'Ims2Question' => $baseDir . '/main/exercice/export/qti2/qti2_classes.php', + 'ImsAnswerFillInBlanks' => $baseDir . '/main/exercice/export/qti2/qti2_classes.php', + 'ImsAnswerFree' => $baseDir . '/main/exercice/export/qti2/qti2_classes.php', + 'ImsAnswerHotspot' => $baseDir . '/main/exercice/export/qti2/qti2_classes.php', + 'ImsAnswerMatching' => $baseDir . '/main/exercice/export/qti2/qti2_classes.php', + 'ImsAnswerMultipleChoice' => $baseDir . '/main/exercice/export/qti2/qti2_classes.php', + 'ImsAnswerTrueFalse' => $baseDir . '/main/exercice/export/qti/qti_classes.php', + 'ImsAssessmentItem' => $baseDir . '/main/exercice/export/qti2/qti2_export.php', + 'ImsItem' => $baseDir . '/main/exercice/export/qti2/qti2_export.php', + 'ImsQuestion' => $baseDir . '/main/exercice/export/qti/qti_classes.php', + 'ImsSection' => $baseDir . '/main/exercice/export/qti2/qti2_export.php', + 'IndexManager' => $baseDir . '/main/inc/lib/userportal.lib.php', + 'IndexableChunk' => $baseDir . '/main/inc/lib/search/IndexableChunk.class.php', + 'Informe_sepe' => $baseDir . '/plugin/sepe/src/informe-curso.php', + 'Inline_Frame_Decorator' => $baseDir . '/main/inc/lib/phpdocx/pdf/include/inline_frame_decorator.cls.php', + 'Inline_Frame_Reflower' => $baseDir . '/main/inc/lib/phpdocx/pdf/include/inline_frame_reflower.cls.php', + 'Inline_Positioner' => $baseDir . '/main/inc/lib/phpdocx/pdf/include/inline_positioner.cls.php', + 'Inline_Renderer' => $baseDir . '/main/inc/lib/phpdocx/pdf/include/inline_renderer.cls.php', + 'Install' => $baseDir . '/main/install/install.class.php', + 'Javascript' => $baseDir . '/main/inc/lib/javascript.class.php', + 'Javascript_Embedder' => $baseDir . '/main/inc/lib/phpdocx/pdf/include/javascript_embedder.cls.php', + 'KeyAuth' => $baseDir . '/main/auth/key/key_auth.class.php', + 'LearnpathLink' => $baseDir . '/main/gradebook/lib/be/learnpathlink.class.php', + 'LegalManager' => $baseDir . '/main/inc/lib/legal.lib.php', + 'Link' => $baseDir . '/main/inc/lib/link.lib.php', + 'LinkAddEditForm' => $baseDir . '/main/gradebook/lib/fe/linkaddeditform.class.php', + 'LinkCategory' => $baseDir . '/main/coursecopy/classes/LinkCategory.class.php', + 'LinkFactory' => $baseDir . '/main/gradebook/lib/be/linkfactory.class.php', + 'LinkForm' => $baseDir . '/main/gradebook/lib/fe/linkform.class.php', + 'List_Bullet_Frame_Decorator' => $baseDir . '/main/inc/lib/phpdocx/pdf/include/list_bullet_frame_decorator.cls.php', + 'List_Bullet_Frame_Reflower' => $baseDir . '/main/inc/lib/phpdocx/pdf/include/list_bullet_frame_reflower.cls.php', + 'List_Bullet_Image_Frame_Decorator' => $baseDir . '/main/inc/lib/phpdocx/pdf/include/list_bullet_image_frame_decorator.cls.php', + 'List_Bullet_Positioner' => $baseDir . '/main/inc/lib/phpdocx/pdf/include/list_bullet_positioner.cls.php', + 'List_Bullet_Renderer' => $baseDir . '/main/inc/lib/phpdocx/pdf/include/list_bullet_renderer.cls.php', + 'Log' => $baseDir . '/main/inc/lib/log.class.php', + 'Logger' => $baseDir . '/main/inc/lib/phpdocx/lib/log4php/Logger.php', + 'LoggerAppender' => $baseDir . '/main/inc/lib/phpdocx/lib/log4php/LoggerAppender.php', + 'LoggerAppenderAdodb' => $baseDir . '/main/inc/lib/phpdocx/lib/log4php/appenders/LoggerAppenderAdodb.php', + 'LoggerAppenderConsole' => $baseDir . '/main/inc/lib/phpdocx/lib/log4php/appenders/LoggerAppenderConsole.php', + 'LoggerAppenderDailyFile' => $baseDir . '/main/inc/lib/phpdocx/lib/log4php/appenders/LoggerAppenderDailyFile.php', + 'LoggerAppenderEcho' => $baseDir . '/main/inc/lib/phpdocx/lib/log4php/appenders/LoggerAppenderEcho.php', + 'LoggerAppenderFile' => $baseDir . '/main/inc/lib/phpdocx/lib/log4php/appenders/LoggerAppenderFile.php', + 'LoggerAppenderMail' => $baseDir . '/main/inc/lib/phpdocx/lib/log4php/appenders/LoggerAppenderMail.php', + 'LoggerAppenderMailEvent' => $baseDir . '/main/inc/lib/phpdocx/lib/log4php/appenders/LoggerAppenderMailEvent.php', + 'LoggerAppenderNull' => $baseDir . '/main/inc/lib/phpdocx/lib/log4php/appenders/LoggerAppenderNull.php', + 'LoggerAppenderPDO' => $baseDir . '/main/inc/lib/phpdocx/lib/log4php/appenders/LoggerAppenderPDO.php', + 'LoggerAppenderPhp' => $baseDir . '/main/inc/lib/phpdocx/lib/log4php/appenders/LoggerAppenderPhp.php', + 'LoggerAppenderPool' => $baseDir . '/main/inc/lib/phpdocx/lib/log4php/LoggerAppenderPool.php', + 'LoggerAppenderRollingFile' => $baseDir . '/main/inc/lib/phpdocx/lib/log4php/appenders/LoggerAppenderRollingFile.php', + 'LoggerAppenderSocket' => $baseDir . '/main/inc/lib/phpdocx/lib/log4php/appenders/LoggerAppenderSocket.php', + 'LoggerAppenderSyslog' => $baseDir . '/main/inc/lib/phpdocx/lib/log4php/appenders/LoggerAppenderSyslog.php', + 'LoggerBasicPatternConverter' => $baseDir . '/main/inc/lib/phpdocx/lib/log4php/helpers/LoggerBasicPatternConverter.php', + 'LoggerCategoryPatternConverter' => $baseDir . '/main/inc/lib/phpdocx/lib/log4php/helpers/LoggerCategoryPatternConverter.php', + 'LoggerClassNamePatternConverter' => $baseDir . '/main/inc/lib/phpdocx/lib/log4php/helpers/LoggerClassNamePatternConverter.php', + 'LoggerConfigurator' => $baseDir . '/main/inc/lib/phpdocx/lib/log4php/LoggerConfigurator.php', + 'LoggerConfiguratorBasic' => $baseDir . '/main/inc/lib/phpdocx/lib/log4php/configurators/LoggerConfiguratorBasic.php', + 'LoggerConfiguratorIni' => $baseDir . '/main/inc/lib/phpdocx/lib/log4php/configurators/LoggerConfiguratorIni.php', + 'LoggerConfiguratorPhp' => $baseDir . '/main/inc/lib/phpdocx/lib/log4php/configurators/LoggerConfiguratorPhp.php', + 'LoggerConfiguratorXml' => $baseDir . '/main/inc/lib/phpdocx/lib/log4php/configurators/LoggerConfiguratorXml.php', + 'LoggerDatePatternConverter' => $baseDir . '/main/inc/lib/phpdocx/lib/log4php/helpers/LoggerDatePatternConverter.php', + 'LoggerException' => $baseDir . '/main/inc/lib/phpdocx/lib/log4php/LoggerException.php', + 'LoggerFilter' => $baseDir . '/main/inc/lib/phpdocx/lib/log4php/LoggerFilter.php', + 'LoggerFilterDenyAll' => $baseDir . '/main/inc/lib/phpdocx/lib/log4php/filters/LoggerFilterDenyAll.php', + 'LoggerFilterLevelMatch' => $baseDir . '/main/inc/lib/phpdocx/lib/log4php/filters/LoggerFilterLevelMatch.php', + 'LoggerFilterLevelRange' => $baseDir . '/main/inc/lib/phpdocx/lib/log4php/filters/LoggerFilterLevelRange.php', + 'LoggerFilterStringMatch' => $baseDir . '/main/inc/lib/phpdocx/lib/log4php/filters/LoggerFilterStringMatch.php', + 'LoggerFormattingInfo' => $baseDir . '/main/inc/lib/phpdocx/lib/log4php/helpers/LoggerFormattingInfo.php', + 'LoggerHierarchy' => $baseDir . '/main/inc/lib/phpdocx/lib/log4php/LoggerHierarchy.php', + 'LoggerLayout' => $baseDir . '/main/inc/lib/phpdocx/lib/log4php/LoggerLayout.php', + 'LoggerLayoutHtml' => $baseDir . '/main/inc/lib/phpdocx/lib/log4php/layouts/LoggerLayoutHtml.php', + 'LoggerLayoutPattern' => $baseDir . '/main/inc/lib/phpdocx/lib/log4php/layouts/LoggerLayoutPattern.php', + 'LoggerLayoutSimple' => $baseDir . '/main/inc/lib/phpdocx/lib/log4php/layouts/LoggerLayoutSimple.php', + 'LoggerLayoutTTCC' => $baseDir . '/main/inc/lib/phpdocx/lib/log4php/layouts/LoggerLayoutTTCC.php', + 'LoggerLayoutXml' => $baseDir . '/main/inc/lib/phpdocx/lib/log4php/layouts/LoggerLayoutXml.php', + 'LoggerLevel' => $baseDir . '/main/inc/lib/phpdocx/lib/log4php/LoggerLevel.php', + 'LoggerLiteralPatternConverter' => $baseDir . '/main/inc/lib/phpdocx/lib/log4php/helpers/LoggerLiteralPatternConverter.php', + 'LoggerLocationInfo' => $baseDir . '/main/inc/lib/phpdocx/lib/log4php/LoggerLocationInfo.php', + 'LoggerLocationPatternConverter' => $baseDir . '/main/inc/lib/phpdocx/lib/log4php/helpers/LoggerLocationPatternConverter.php', + 'LoggerLoggingEvent' => $baseDir . '/main/inc/lib/phpdocx/lib/log4php/LoggerLoggingEvent.php', + 'LoggerMDC' => $baseDir . '/main/inc/lib/phpdocx/lib/log4php/LoggerMDC.php', + 'LoggerMDCPatternConverter' => $baseDir . '/main/inc/lib/phpdocx/lib/log4php/helpers/LoggerMDCPatternConverter.php', + 'LoggerNDC' => $baseDir . '/main/inc/lib/phpdocx/lib/log4php/LoggerNDC.php', + 'LoggerNamedPatternConverter' => $baseDir . '/main/inc/lib/phpdocx/lib/log4php/helpers/LoggerNamedPatternConverter.php', + 'LoggerOptionConverter' => $baseDir . '/main/inc/lib/phpdocx/lib/log4php/helpers/LoggerOptionConverter.php', + 'LoggerPatternConverter' => $baseDir . '/main/inc/lib/phpdocx/lib/log4php/helpers/LoggerPatternConverter.php', + 'LoggerPatternParser' => $baseDir . '/main/inc/lib/phpdocx/lib/log4php/helpers/LoggerPatternParser.php', + 'LoggerReflectionUtils' => $baseDir . '/main/inc/lib/phpdocx/lib/log4php/LoggerReflectionUtils.php', + 'LoggerRendererDefault' => $baseDir . '/main/inc/lib/phpdocx/lib/log4php/renderers/LoggerRendererDefault.php', + 'LoggerRendererMap' => $baseDir . '/main/inc/lib/phpdocx/lib/log4php/renderers/LoggerRendererMap.php', + 'LoggerRendererObject' => $baseDir . '/main/inc/lib/phpdocx/lib/log4php/renderers/LoggerRendererObject.php', + 'LoggerRoot' => $baseDir . '/main/inc/lib/phpdocx/lib/log4php/LoggerRoot.php', + 'Login' => $baseDir . '/main/inc/lib/login.lib.php', + 'LoginRedirection' => $baseDir . '/main/inc/lib/login_redirection.class.php', + 'LpItem' => $baseDir . '/main/inc/lib/lp_item.lib.php', + 'MagpieRSS' => $baseDir . '/main/inc/lib/magpierss/rss_parse.inc', + 'Matching' => $baseDir . '/main/exercice/matching.class.php', + 'Math_BigInteger' => $baseDir . '/main/inc/lib/phpseclib/Math/BigInteger.php', + 'MessageManager' => $baseDir . '/main/inc/lib/message.lib.php', + 'MessagesWebService' => $baseDir . '/main/inc/lib/webservices/MessagesWebService.class.php', + 'Min_DB' => $baseDir . '/main/admin/db.php', + 'Min_Driver' => $baseDir . '/main/admin/db.php', + 'Min_PDO' => $baseDir . '/main/admin/db.php', + 'Min_PDOStatement' => $baseDir . '/main/admin/db.php', + 'Min_Result' => $baseDir . '/main/admin/db.php', + 'Min_SQL' => $baseDir . '/main/admin/db.php', + 'Model' => $baseDir . '/main/inc/lib/model.lib.php', + 'Model\\Course' => $baseDir . '/main/inc/lib/course.class.php', + 'Model\\Document' => $baseDir . '/main/inc/lib/document.class.php', + 'Model\\ItemProperty' => $baseDir . '/main/inc/lib/item_property.class.php', + 'Model\\ItemPropertyRepository' => $baseDir . '/main/inc/lib/item_property.class.php', + 'Model\\StudentPublication' => $baseDir . '/main/inc/lib/student_publication.class.php', + 'Model\\StudentPublicationRepository' => $baseDir . '/main/inc/lib/student_publication.class.php', + 'Monolog\\Formatter\\FormatterInterface' => $baseDir . '/main/inc/lib/symfony/Monolog/Formatter/FormatterInterface.php', + 'Monolog\\Formatter\\JsonFormatter' => $baseDir . '/main/inc/lib/symfony/Monolog/Formatter/JsonFormatter.php', + 'Monolog\\Formatter\\LineFormatter' => $baseDir . '/main/inc/lib/symfony/Monolog/Formatter/LineFormatter.php', + 'Monolog\\Formatter\\WildfireFormatter' => $baseDir . '/main/inc/lib/symfony/Monolog/Formatter/WildfireFormatter.php', + 'Monolog\\Handler\\AbstractHandler' => $baseDir . '/main/inc/lib/symfony/Monolog/Handler/AbstractHandler.php', + 'Monolog\\Handler\\AbstractProcessingHandler' => $baseDir . '/main/inc/lib/symfony/Monolog/Handler/AbstractProcessingHandler.php', + 'Monolog\\Handler\\BufferHandler' => $baseDir . '/main/inc/lib/symfony/Monolog/Handler/BufferHandler.php', + 'Monolog\\Handler\\FingersCrossedHandler' => $baseDir . '/main/inc/lib/symfony/Monolog/Handler/FingersCrossedHandler.php', + 'Monolog\\Handler\\FirePHPHandler' => $baseDir . '/main/inc/lib/symfony/Monolog/Handler/FirePHPHandler.php', + 'Monolog\\Handler\\GroupHandler' => $baseDir . '/main/inc/lib/symfony/Monolog/Handler/GroupHandler.php', + 'Monolog\\Handler\\HandlerInterface' => $baseDir . '/main/inc/lib/symfony/Monolog/Handler/HandlerInterface.php', + 'Monolog\\Handler\\MailHandler' => $baseDir . '/main/inc/lib/symfony/Monolog/Handler/MailHandler.php', + 'Monolog\\Handler\\NativeMailerHandler' => $baseDir . '/main/inc/lib/symfony/Monolog/Handler/NativeMailerHandler.php', + 'Monolog\\Handler\\NullHandler' => $baseDir . '/main/inc/lib/symfony/Monolog/Handler/NullHandler.php', + 'Monolog\\Handler\\RotatingFileHandler' => $baseDir . '/main/inc/lib/symfony/Monolog/Handler/RotatingFileHandler.php', + 'Monolog\\Handler\\StreamHandler' => $baseDir . '/main/inc/lib/symfony/Monolog/Handler/StreamHandler.php', + 'Monolog\\Handler\\SwiftMailerHandler' => $baseDir . '/main/inc/lib/symfony/Monolog/Handler/SwiftMailerHandler.php', + 'Monolog\\Handler\\SyslogHandler' => $baseDir . '/main/inc/lib/symfony/Monolog/Handler/SyslogHandler.php', + 'Monolog\\Handler\\TestHandler' => $baseDir . '/main/inc/lib/symfony/Monolog/Handler/TestHandler.php', + 'Monolog\\Logger' => $baseDir . '/main/inc/lib/symfony/Monolog/Logger.php', + 'Monolog\\Processor\\IntrospectionProcessor' => $baseDir . '/main/inc/lib/symfony/Monolog/Processor/IntrospectionProcessor.php', + 'Monolog\\Processor\\MemoryPeakUsageProcessor' => $baseDir . '/main/inc/lib/symfony/Monolog/Processor/MemoryPeakUsageProcessor.php', + 'Monolog\\Processor\\MemoryProcessor' => $baseDir . '/main/inc/lib/symfony/Monolog/Processor/MemoryProcessor.php', + 'Monolog\\Processor\\MemoryUsageProcessor' => $baseDir . '/main/inc/lib/symfony/Monolog/Processor/MemoryUsageProcessor.php', + 'Monolog\\Processor\\WebProcessor' => $baseDir . '/main/inc/lib/symfony/Monolog/Processor/WebProcessor.php', + 'MultipleAnswer' => $baseDir . '/main/exercice/multiple_answer.class.php', + 'MultipleAnswerCombination' => $baseDir . '/main/exercice/multiple_answer_combination.class.php', + 'MultipleAnswerCombinationTrueFalse' => $baseDir . '/main/exercice/multiple_answer_combination_true_false.class.php', + 'MultipleAnswerTrueFalse' => $baseDir . '/main/exercice/multiple_answer_true_false.class.php', + 'MyHorBar' => $baseDir . '/main/inc/lib/pchart/MyHorBar.class.php', + 'MySQLIDatabase' => $baseDir . '/main/inc/lib/database.mysqli.lib.php', + 'Nanogong' => $baseDir . '/main/inc/lib/nanogong.lib.php', + 'Net_SCP' => $baseDir . '/main/inc/lib/phpseclib/Net/SCP.php', + 'Net_SFTP' => $baseDir . '/main/inc/lib/phpseclib/Net/SFTP.php', + 'Net_SFTP_Stream' => $baseDir . '/main/inc/lib/phpseclib/Net/SFTP/Stream.php', + 'Net_SSH1' => $baseDir . '/main/inc/lib/phpseclib/Net/SSH1.php', + 'Net_SSH2' => $baseDir . '/main/inc/lib/phpseclib/Net/SSH2.php', + 'NotebookManager' => $baseDir . '/main/inc/lib/notebook.lib.php', + 'Notification' => $baseDir . '/main/inc/lib/notification.lib.php', + 'Null_Frame_Decorator' => $baseDir . '/main/inc/lib/phpdocx/pdf/include/null_frame_decorator.cls.php', + 'Null_Frame_Reflower' => $baseDir . '/main/inc/lib/phpdocx/pdf/include/null_frame_reflower.cls.php', + 'Null_Positioner' => $baseDir . '/main/inc/lib/phpdocx/pdf/include/null_positioner.cls.php', + 'OLE' => $baseDir . '/main/inc/lib/pear/OLE/OLE.php', + 'OLERead' => $baseDir . '/main/inc/lib/pear/excelreader/OLERead.inc', + 'OLE_ChainedBlockStream' => $baseDir . '/main/inc/lib/pear/OLE/ChainedBlockStream.php', + 'OLE_PPS' => $baseDir . '/main/inc/lib/pear/OLE/PPS.php', + 'OLE_PPS_File' => $baseDir . '/main/inc/lib/pear/OLE/PPS/File.php', + 'OLE_PPS_Root' => $baseDir . '/main/inc/lib/pear/OLE/PPS/Root.php', + 'OLPC_Peru_FilterPlugin' => $baseDir . '/plugin/olpc_peru_filter/lib/olpc_peru_filter_plugin.class.php', + 'OpenGraph' => $baseDir . '/main/inc/lib/opengraph/OpenGraph.php', + 'OpenMeetingsAPI' => $baseDir . '/plugin/openmeetings/lib/openmeetings_api.php', + 'OpenMeetingsGateway' => $baseDir . '/plugin/openmeetings/lib/openmeetings_gateway.php', + 'OpenMeetingsPlugin' => $baseDir . '/plugin/openmeetings/lib/openmeetings_plugin.class.php', + 'OpenMeetingsRestService' => $baseDir . '/plugin/openmeetings/lib/openmeetings_rest_service.php', + 'OpenOfficeTextDocument' => $baseDir . '/main/newscorm/openoffice_text_document.class.php', + 'OpenofficeDocument' => $baseDir . '/main/newscorm/openoffice_document.class.php', + 'OpenofficePresentation' => $baseDir . '/main/newscorm/openoffice_presentation.class.php', + 'OpenofficeText' => $baseDir . '/main/newscorm/openoffice_text.class.php', + 'OralExpression' => $baseDir . '/main/exercice/oral_expression.class.php', + 'PDF' => $baseDir . '/main/inc/lib/pdf.lib.php', + 'PDFBarcode' => $baseDir . '/main/inc/lib/mpdf/classes/barcode.php', + 'PDFLib_Adapter' => $baseDir . '/main/inc/lib/phpdocx/pdf/include/pdflib_adapter.cls.php', + 'PEAR' => $baseDir . '/main/inc/lib/pear/PEAR.php', + 'PEAR5' => $baseDir . '/main/inc/lib/pear/PEAR5.php', + 'PEAR_Error' => $baseDir . '/main/inc/lib/pear/PEAR.php', + 'PEAR_Exception' => $baseDir . '/main/inc/lib/pear/Exception.php', + 'PGTStorage' => $baseDir . '/main/auth/cas/lib/CAS/PGTStorage/pgt-main.php', + 'PGTStorageDB' => $baseDir . '/main/auth/cas/lib/CAS/PGTStorage/pgt-db.php', + 'PGTStorageFile' => $baseDir . '/main/auth/cas/lib/CAS/PGTStorage/pgt-file.php', + 'PHPMailer' => $baseDir . '/main/inc/lib/phpmailer/class.phpmailer.php', + 'PHP_Evaluator' => $baseDir . '/main/inc/lib/phpdocx/pdf/include/php_evaluator.cls.php', + 'POP3' => $baseDir . '/main/inc/lib/phpmailer/class.pop3.php', + 'Page' => $baseDir . '/main/inc/lib/page.class.php', + 'Page_Cache' => $baseDir . '/main/inc/lib/phpdocx/pdf/include/page_cache.cls.php', + 'Page_Frame_Decorator' => $baseDir . '/main/inc/lib/phpdocx/pdf/include/page_frame_decorator.cls.php', + 'Page_Frame_Reflower' => $baseDir . '/main/inc/lib/phpdocx/pdf/include/page_frame_reflower.cls.php', + 'Pager' => $baseDir . '/main/inc/lib/pear/Pager/Pager.php', + 'Pager_Common' => $baseDir . '/main/inc/lib/pear/Pager/Common.php', + 'Pager_HtmlWidgets' => $baseDir . '/main/inc/lib/pear/Pager/HtmlWidgets.php', + 'Pager_Jumping' => $baseDir . '/main/inc/lib/pear/Pager/Jumping.php', + 'Pager_Sliding' => $baseDir . '/main/inc/lib/pear/Pager/Sliding.php', + 'PclZip' => $baseDir . '/main/inc/lib/pclzip/pclzip.lib.php', + 'Plugin' => $baseDir . '/main/inc/lib/plugin.class.php', + 'Portfolio' => $baseDir . '/main/inc/lib/portfolio.class.php', + 'PortfolioBulkAction' => $baseDir . '/main/inc/lib/portfolio.class.php', + 'PortfolioController' => $baseDir . '/main/inc/lib/portfolio.class.php', + 'PortfolioShare' => $baseDir . '/main/inc/lib/portfolio.class.php', + 'Portfolio\\Artefact' => $baseDir . '/main/inc/lib/system/portfolio/artefact.class.php', + 'Portfolio\\Download' => $baseDir . '/main/inc/lib/system/portfolio/download.class.php', + 'Portfolio\\Mahara' => $baseDir . '/main/inc/lib/system/portfolio/mahara.class.php', + 'Portfolio\\Portfolio' => $baseDir . '/main/inc/lib/system/portfolio/portfolio.class.php', + 'Portfolio\\User' => $baseDir . '/main/inc/lib/system/portfolio/user.class.php', + 'Positioner' => $baseDir . '/main/inc/lib/phpdocx/pdf/include/positioner.cls.php', + 'Promotion' => $baseDir . '/main/inc/lib/promotion.lib.php', + 'QRbitstream' => $baseDir . '/main/inc/lib/phpqrcode/qrbitstream.php', + 'QRcode' => $baseDir . '/main/inc/lib/phpqrcode/phpqrcode.php', + 'QRencode' => $baseDir . '/main/inc/lib/phpqrcode/phpqrcode.php', + 'QRimage' => $baseDir . '/main/inc/lib/phpqrcode/phpqrcode.php', + 'QRinput' => $baseDir . '/main/inc/lib/phpqrcode/phpqrcode.php', + 'QRinputItem' => $baseDir . '/main/inc/lib/phpqrcode/phpqrcode.php', + 'QRmask' => $baseDir . '/main/inc/lib/phpqrcode/qrmask.php', + 'QRrawcode' => $baseDir . '/main/inc/lib/phpqrcode/phpqrcode.php', + 'QRrs' => $baseDir . '/main/inc/lib/phpqrcode/qrrscode.php', + 'QRrsItem' => $baseDir . '/main/inc/lib/phpqrcode/qrrscode.php', + 'QRrsblock' => $baseDir . '/main/inc/lib/phpqrcode/phpqrcode.php', + 'QRspec' => $baseDir . '/main/inc/lib/phpqrcode/phpqrcode.php', + 'QRsplit' => $baseDir . '/main/inc/lib/phpqrcode/qrsplit.php', + 'QRtools' => $baseDir . '/main/inc/lib/phpqrcode/phpqrcode.php', + 'Question' => $baseDir . '/main/exercice/question.class.php', + 'QuickformElement' => $baseDir . '/main/inc/lib/pear/HTML/QuickForm/Renderer/Object.php', + 'QuickformFlexyElement' => $baseDir . '/main/inc/lib/pear/HTML/QuickForm/Renderer/ObjectFlexy.php', + 'QuickformFlexyForm' => $baseDir . '/main/inc/lib/pear/HTML/QuickForm/Renderer/ObjectFlexy.php', + 'QuickformForm' => $baseDir . '/main/inc/lib/pear/HTML/QuickForm/Renderer/Object.php', + 'Quiz' => $baseDir . '/main/coursecopy/classes/Quiz.class.php', + 'QuizQuestion' => $baseDir . '/main/coursecopy/classes/QuizQuestion.class.php', + 'QuizQuestionOption' => $baseDir . '/main/coursecopy/classes/QuizQuestionOption.class.php', + 'RSSCache' => $baseDir . '/main/inc/lib/magpierss/rss_cache.inc', + 'Redirect' => $baseDir . '/main/inc/lib/redirect.class.php', + 'RegisterCourseWidget' => $baseDir . '/plugin/search_course/lib/register_course_widget.class.php', + 'Renderer' => $baseDir . '/main/inc/lib/phpdocx/pdf/include/renderer.cls.php', + 'Request' => $baseDir . '/main/inc/lib/system/web/request.class.php', + 'RequestServer' => $baseDir . '/main/inc/lib/system/web/request_server.class.php', + 'Resource' => $baseDir . '/main/coursecopy/classes/Resource.class.php', + 'Response' => $baseDir . '/main/inc/lib/response.class.php', + 'Result' => $baseDir . '/main/gradebook/lib/be/result.class.php', + 'ResultSet' => $baseDir . '/main/inc/lib/result_set.class.php', + 'ResultTable' => $baseDir . '/main/gradebook/lib/fe/resulttable.class.php', + 'ResultsDataGenerator' => $baseDir . '/main/gradebook/lib/results_data_generator.class.php', + 'Rights' => $baseDir . '/main/inc/lib/rights.lib.php', + 'RssPlugin' => $baseDir . '/plugin/rss/lib/rss_plugin.class.php', + 'SMTP' => $baseDir . '/main/inc/lib/phpmailer/class.smtp.php', + 'SVG' => $baseDir . '/main/inc/lib/mpdf/classes/svg.php', + 'ScoreDisplay' => $baseDir . '/main/gradebook/lib/scoredisplay.class.php', + 'ScoreDisplayForm' => $baseDir . '/main/gradebook/lib/fe/scoredisplayform.class.php', + 'ScormAnswerFillInBlanks' => $baseDir . '/main/exercice/export/scorm/scorm_classes.php', + 'ScormAnswerFree' => $baseDir . '/main/exercice/export/scorm/scorm_classes.php', + 'ScormAnswerHotspot' => $baseDir . '/main/exercice/export/scorm/scorm_classes.php', + 'ScormAnswerMatching' => $baseDir . '/main/exercice/export/scorm/scorm_classes.php', + 'ScormAnswerMultipleChoice' => $baseDir . '/main/exercice/export/scorm/scorm_classes.php', + 'ScormAnswerTrueFalse' => $baseDir . '/main/exercice/export/scorm/scorm_classes.php', + 'ScormAssessmentItem' => $baseDir . '/main/exercice/export/scorm/scorm_export.php', + 'ScormDocument' => $baseDir . '/main/coursecopy/classes/ScormDocument.class.php', + 'ScormQuestion' => $baseDir . '/main/exercice/export/scorm/scorm_classes.php', + 'ScormSection' => $baseDir . '/main/exercice/export/scorm/scorm_export.php', + 'Search' => $baseDir . '/main/inc/lib/fckeditor/editor/plugins/ajaxfilemanager/inc/class.search.php', + 'SearchCoursePlugin' => $baseDir . '/plugin/search_course/lib/search_course_plugin.class.php', + 'SearchCourseWidget' => $baseDir . '/plugin/search_course/lib/search_course_widget.class.php', + 'Security' => $baseDir . '/main/inc/lib/security.lib.php', + 'Sepe' => $baseDir . '/plugin/sepe/ws/Sepe.php', + 'SepePlugin' => $baseDir . '/plugin/sepe/lib/sepe_plugin.class.php', + 'Session' => $baseDir . '/main/inc/lib/fckeditor/editor/plugins/ajaxfilemanager/inc/class.session.php', + 'SessionAction' => $baseDir . '/main/inc/lib/fckeditor/editor/plugins/ajaxfilemanager/inc/class.sessionaction.php', + 'SessionHandlerDatabase' => $baseDir . '/main/inc/lib/session_handler.class.php', + 'SessionHandlerMemcache' => $baseDir . '/main/inc/lib/session_handler_memcache.class.php', + 'SessionManager' => $baseDir . '/main/inc/lib/sessionmanager.lib.php', + 'Shibboleth\\Admin' => $baseDir . '/main/auth/shibboleth/app/model/admin.class.php', + 'Shibboleth\\AdminStore' => $baseDir . '/main/auth/shibboleth/app/model/admin.class.php', + 'Shibboleth\\Model' => $baseDir . '/main/auth/shibboleth/lib/model.class.php', + 'Shibboleth\\Scaffolder' => $baseDir . '/main/auth/shibboleth/lib/scaffolder/scaffolder.class.php', + 'Shibboleth\\Shibboleth' => $baseDir . '/main/auth/shibboleth/app/shibboleth.class.php', + 'Shibboleth\\ShibbolethConfig' => $baseDir . '/main/auth/shibboleth/lib/shibboleth_config.class.php', + 'Shibboleth\\ShibbolethController' => $baseDir . '/main/auth/shibboleth/app/controller/shibboleth_controller.class.php', + 'Shibboleth\\ShibbolethDisplay' => $baseDir . '/main/auth/shibboleth/app/view/shibboleth_display.class.php', + 'Shibboleth\\ShibbolethEmailForm' => $baseDir . '/main/auth/shibboleth/app/view/shibboleth_email_form.class.php', + 'Shibboleth\\ShibbolethSession' => $baseDir . '/main/auth/shibboleth/lib/shibboleth_session.class.php', + 'Shibboleth\\ShibbolethStatusRequestForm' => $baseDir . '/main/auth/shibboleth/app/view/shibboleth_status_request_form.class.php', + 'Shibboleth\\ShibbolethStore' => $baseDir . '/main/auth/shibboleth/app/model/shibboleth_store.class.php', + 'Shibboleth\\ShibbolethTest' => $baseDir . '/main/auth/shibboleth/test/shibboleth_test.class.php', + 'Shibboleth\\ShibbolethTestHelper' => $baseDir . '/main/auth/shibboleth/test/shibboleth_test_helper.class.php', + 'Shibboleth\\ShibbolethUpgrade' => $baseDir . '/main/auth/shibboleth/db/shibboleth_upgrade.class.php', + 'Shibboleth\\ShibbolethUser' => $baseDir . '/main/auth/shibboleth/app/model/shibboleth_user.class.php', + 'Shibboleth\\Store' => $baseDir . '/main/auth/shibboleth/lib/store.class.php', + 'Shibboleth\\User' => $baseDir . '/main/auth/shibboleth/app/model/user.class.php', + 'Shibboleth\\UserStore' => $baseDir . '/main/auth/shibboleth/app/model/user.class.php', + 'Shibboleth\\_Admin' => $baseDir . '/main/auth/shibboleth/app/model/scaffold/admin.class.php', + 'Shibboleth\\_AdminStore' => $baseDir . '/main/auth/shibboleth/app/model/scaffold/admin.class.php', + 'Shibboleth\\_User' => $baseDir . '/main/auth/shibboleth/app/model/scaffold/user.class.php', + 'Shibboleth\\_UserStore' => $baseDir . '/main/auth/shibboleth/app/model/scaffold/user.class.php', + 'Shibboleth\\aai' => $baseDir . '/main/auth/shibboleth/config/aai.class.php', + 'Skill' => $baseDir . '/main/inc/lib/skill.lib.php', + 'SkillProfile' => $baseDir . '/main/inc/lib/skill.lib.php', + 'SkillRelGradebook' => $baseDir . '/main/inc/lib/skill.lib.php', + 'SkillRelProfile' => $baseDir . '/main/inc/lib/skill.lib.php', + 'SkillRelSkill' => $baseDir . '/main/inc/lib/skill.lib.php', + 'SkillRelUser' => $baseDir . '/main/inc/lib/skill.lib.php', + 'SkillVisualizer' => $baseDir . '/main/inc/lib/skill.visualizer.lib.php', + 'Snoopy' => $baseDir . '/main/inc/lib/magpierss/extlib/Snoopy.class.inc', + 'SocialManager' => $baseDir . '/main/inc/lib/social.lib.php', + 'SortableTable' => $baseDir . '/main/inc/lib/sortable_table.class.php', + 'SortableTableFromArray' => $baseDir . '/main/inc/lib/sortable_table.class.php', + 'SortableTableFromArrayConfig' => $baseDir . '/main/inc/lib/sortable_table.class.php', + 'Spreadsheet_Excel_Reader' => $baseDir . '/main/inc/lib/pear/excelreader/reader.php', + 'Spreadsheet_Excel_Writer' => $baseDir . '/main/inc/lib/pear/Spreadsheet_Excel_Writer/Writer.php', + 'Spreadsheet_Excel_Writer_BIFFwriter' => $baseDir . '/main/inc/lib/pear/Spreadsheet_Excel_Writer/Writer/BIFFwriter.php', + 'Spreadsheet_Excel_Writer_Format' => $baseDir . '/main/inc/lib/pear/Spreadsheet_Excel_Writer/Writer/Format.php', + 'Spreadsheet_Excel_Writer_Parser' => $baseDir . '/main/inc/lib/pear/Spreadsheet_Excel_Writer/Writer/Parser.php', + 'Spreadsheet_Excel_Writer_Validator' => $baseDir . '/main/inc/lib/pear/Spreadsheet_Excel_Writer/Writer/Validator.php', + 'Spreadsheet_Excel_Writer_Workbook' => $baseDir . '/main/inc/lib/pear/Spreadsheet_Excel_Writer/Writer/Workbook.php', + 'Spreadsheet_Excel_Writer_Worksheet' => $baseDir . '/main/inc/lib/pear/Spreadsheet_Excel_Writer/Writer/Worksheet.php', + 'StaticPlugin' => $baseDir . '/plugin/static/lib/static_plugin.class.php', + 'Statistics' => $baseDir . '/main/admin/statistics/statistics.lib.php', + 'StudentPublicationLink' => $baseDir . '/main/gradebook/lib/be/studentpublicationlink.class.php', + 'Style' => $baseDir . '/main/inc/lib/phpdocx/pdf/include/style.cls.php', + 'Stylesheet' => $baseDir . '/main/inc/lib/phpdocx/pdf/include/stylesheet.cls.php', + 'SubLanguageManager' => $baseDir . '/main/admin/sub_language.class.php', + 'Survey' => $baseDir . '/main/coursecopy/classes/Survey.class.php', + 'SurveyInvitation' => $baseDir . '/main/coursecopy/classes/SurveyInvitation.class.php', + 'SurveyLink' => $baseDir . '/main/gradebook/lib/be/surveylink.class.php', + 'SurveyQuestion' => $baseDir . '/main/coursecopy/classes/SurveyQuestion.class.php', + 'SurveyTree' => $baseDir . '/main/inc/lib/surveymanager.lib.php', + 'SurveyUtil' => $baseDir . '/main/survey/survey.lib.php', + 'Symfony\\Component\\ClassLoader\\ApcUniversalClassLoader' => $baseDir . '/main/inc/lib/symfony/symfony/Component/ClassLoader/ApcUniversalClassLoader.php', + 'Symfony\\Component\\ClassLoader\\ClassCollectionLoader' => $baseDir . '/main/inc/lib/symfony/symfony/Component/ClassLoader/ClassCollectionLoader.php', + 'Symfony\\Component\\ClassLoader\\DebugUniversalClassLoader' => $baseDir . '/main/inc/lib/symfony/symfony/Component/ClassLoader/DebugUniversalClassLoader.php', + 'Symfony\\Component\\ClassLoader\\MapClassLoader' => $baseDir . '/main/inc/lib/symfony/symfony/Component/ClassLoader/MapClassLoader.php', + 'Symfony\\Component\\ClassLoader\\UniversalClassLoader' => $baseDir . '/main/inc/lib/symfony/symfony/Component/ClassLoader/UniversalClassLoader.php', + 'Symfony\\Component\\Console\\Application' => $baseDir . '/main/inc/lib/symfony/symfony/Component/Console/Application.php', + 'Symfony\\Component\\Console\\Command\\Command' => $baseDir . '/main/inc/lib/symfony/symfony/Component/Console/Command/Command.php', + 'Symfony\\Component\\Console\\Command\\HelpCommand' => $baseDir . '/main/inc/lib/symfony/symfony/Component/Console/Command/HelpCommand.php', + 'Symfony\\Component\\Console\\Command\\ListCommand' => $baseDir . '/main/inc/lib/symfony/symfony/Component/Console/Command/ListCommand.php', + 'Symfony\\Component\\Console\\Formatter\\OutputFormatter' => $baseDir . '/main/inc/lib/symfony/symfony/Component/Console/Formatter/OutputFormatter.php', + 'Symfony\\Component\\Console\\Formatter\\OutputFormatterInterface' => $baseDir . '/main/inc/lib/symfony/symfony/Component/Console/Formatter/OutputFormatterInterface.php', + 'Symfony\\Component\\Console\\Formatter\\OutputFormatterStyle' => $baseDir . '/main/inc/lib/symfony/symfony/Component/Console/Formatter/OutputFormatterStyle.php', + 'Symfony\\Component\\Console\\Formatter\\OutputFormatterStyleInterface' => $baseDir . '/main/inc/lib/symfony/symfony/Component/Console/Formatter/OutputFormatterStyleInterface.php', + 'Symfony\\Component\\Console\\Helper\\DialogHelper' => $baseDir . '/main/inc/lib/symfony/symfony/Component/Console/Helper/DialogHelper.php', + 'Symfony\\Component\\Console\\Helper\\FormatterHelper' => $baseDir . '/main/inc/lib/symfony/symfony/Component/Console/Helper/FormatterHelper.php', + 'Symfony\\Component\\Console\\Helper\\Helper' => $baseDir . '/main/inc/lib/symfony/symfony/Component/Console/Helper/Helper.php', + 'Symfony\\Component\\Console\\Helper\\HelperInterface' => $baseDir . '/main/inc/lib/symfony/symfony/Component/Console/Helper/HelperInterface.php', + 'Symfony\\Component\\Console\\Helper\\HelperSet' => $baseDir . '/main/inc/lib/symfony/symfony/Component/Console/Helper/HelperSet.php', + 'Symfony\\Component\\Console\\Input\\ArgvInput' => $baseDir . '/main/inc/lib/symfony/symfony/Component/Console/Input/ArgvInput.php', + 'Symfony\\Component\\Console\\Input\\ArrayInput' => $baseDir . '/main/inc/lib/symfony/symfony/Component/Console/Input/ArrayInput.php', + 'Symfony\\Component\\Console\\Input\\Input' => $baseDir . '/main/inc/lib/symfony/symfony/Component/Console/Input/Input.php', + 'Symfony\\Component\\Console\\Input\\InputArgument' => $baseDir . '/main/inc/lib/symfony/symfony/Component/Console/Input/InputArgument.php', + 'Symfony\\Component\\Console\\Input\\InputDefinition' => $baseDir . '/main/inc/lib/symfony/symfony/Component/Console/Input/InputDefinition.php', + 'Symfony\\Component\\Console\\Input\\InputInterface' => $baseDir . '/main/inc/lib/symfony/symfony/Component/Console/Input/InputInterface.php', + 'Symfony\\Component\\Console\\Input\\InputOption' => $baseDir . '/main/inc/lib/symfony/symfony/Component/Console/Input/InputOption.php', + 'Symfony\\Component\\Console\\Input\\StringInput' => $baseDir . '/main/inc/lib/symfony/symfony/Component/Console/Input/StringInput.php', + 'Symfony\\Component\\Console\\Output\\ConsoleOutput' => $baseDir . '/main/inc/lib/symfony/symfony/Component/Console/Output/ConsoleOutput.php', + 'Symfony\\Component\\Console\\Output\\NullOutput' => $baseDir . '/main/inc/lib/symfony/symfony/Component/Console/Output/NullOutput.php', + 'Symfony\\Component\\Console\\Output\\Output' => $baseDir . '/main/inc/lib/symfony/symfony/Component/Console/Output/Output.php', + 'Symfony\\Component\\Console\\Output\\OutputInterface' => $baseDir . '/main/inc/lib/symfony/symfony/Component/Console/Output/OutputInterface.php', + 'Symfony\\Component\\Console\\Output\\StreamOutput' => $baseDir . '/main/inc/lib/symfony/symfony/Component/Console/Output/StreamOutput.php', + 'Symfony\\Component\\Console\\Shell' => $baseDir . '/main/inc/lib/symfony/symfony/Component/Console/Shell.php', + 'Symfony\\Component\\Console\\Tester\\ApplicationTester' => $baseDir . '/main/inc/lib/symfony/symfony/Component/Console/Tester/ApplicationTester.php', + 'Symfony\\Component\\Console\\Tester\\CommandTester' => $baseDir . '/main/inc/lib/symfony/symfony/Component/Console/Tester/CommandTester.php', + 'Symfony\\Component\\Yaml\\Dumper' => $baseDir . '/main/inc/lib/symfony/symfony/Component/Yaml/Dumper.php', + 'Symfony\\Component\\Yaml\\Escaper' => $baseDir . '/main/inc/lib/symfony/symfony/Component/Yaml/Escaper.php', + 'Symfony\\Component\\Yaml\\Exception\\DumpException' => $baseDir . '/main/inc/lib/symfony/symfony/Component/Yaml/Exception/DumpException.php', + 'Symfony\\Component\\Yaml\\Exception\\ExceptionInterface' => $baseDir . '/main/inc/lib/symfony/symfony/Component/Yaml/Exception/ExceptionInterface.php', + 'Symfony\\Component\\Yaml\\Exception\\ParseException' => $baseDir . '/main/inc/lib/symfony/symfony/Component/Yaml/Exception/ParseException.php', + 'Symfony\\Component\\Yaml\\Inline' => $baseDir . '/main/inc/lib/symfony/symfony/Component/Yaml/Inline.php', + 'Symfony\\Component\\Yaml\\Parser' => $baseDir . '/main/inc/lib/symfony/symfony/Component/Yaml/Parser.php', + 'Symfony\\Component\\Yaml\\Unescaper' => $baseDir . '/main/inc/lib/symfony/symfony/Component/Yaml/Unescaper.php', + 'Symfony\\Component\\Yaml\\Yaml' => $baseDir . '/main/inc/lib/symfony/symfony/Component/Yaml/Yaml.php', + 'SystemAnnouncementManager' => $baseDir . '/main/inc/lib/system_announcements.lib.php', + 'SystemManagementPage' => $baseDir . '/main/admin/system_management.php', + 'System\\Session' => $baseDir . '/main/inc/lib/system/session.class.php', + 'TCPDF_Adapter' => $baseDir . '/main/inc/lib/phpdocx/pdf/include/tcpdf_adapter.cls.php', + 'TableSort' => $baseDir . '/main/inc/lib/table_sort.class.php', + 'Table_Cell_Frame_Decorator' => $baseDir . '/main/inc/lib/phpdocx/pdf/include/table_cell_frame_decorator.cls.php', + 'Table_Cell_Frame_Reflower' => $baseDir . '/main/inc/lib/phpdocx/pdf/include/table_cell_frame_reflower.cls.php', + 'Table_Cell_Positioner' => $baseDir . '/main/inc/lib/phpdocx/pdf/include/table_cell_positioner.cls.php', + 'Table_Cell_Renderer' => $baseDir . '/main/inc/lib/phpdocx/pdf/include/table_cell_renderer.cls.php', + 'Table_Frame_Decorator' => $baseDir . '/main/inc/lib/phpdocx/pdf/include/table_frame_decorator.cls.php', + 'Table_Frame_Reflower' => $baseDir . '/main/inc/lib/phpdocx/pdf/include/table_frame_reflower.cls.php', + 'Table_Row_Frame_Decorator' => $baseDir . '/main/inc/lib/phpdocx/pdf/include/table_row_frame_decorator.cls.php', + 'Table_Row_Frame_Reflower' => $baseDir . '/main/inc/lib/phpdocx/pdf/include/table_row_frame_reflower.cls.php', + 'Table_Row_Group_Frame_Decorator' => $baseDir . '/main/inc/lib/phpdocx/pdf/include/table_row_group_frame_decorator.cls.php', + 'Table_Row_Group_Frame_Reflower' => $baseDir . '/main/inc/lib/phpdocx/pdf/include/table_row_group_frame_reflower.cls.php', + 'Table_Row_Positioner' => $baseDir . '/main/inc/lib/phpdocx/pdf/include/table_row_positioner.cls.php', + 'Temp' => $baseDir . '/main/inc/lib/system/io/temp.class.php', + 'Template' => $baseDir . '/main/inc/lib/template.lib.php', + 'Testcategory' => $baseDir . '/main/exercice/testcategory.class.php', + 'Text_CAPTCHA' => $baseDir . '/main/inc/lib/pear/Text/CAPTCHA.php', + 'Text_CAPTCHA_Driver' => $baseDir . '/main/inc/lib/pear/Text/CAPTCHA/Driver.php', + 'Text_CAPTCHA_Driver_Base' => $baseDir . '/main/inc/lib/pear/Text/CAPTCHA/Driver/Base.php', + 'Text_CAPTCHA_Driver_Equation' => $baseDir . '/main/inc/lib/pear/Text/CAPTCHA/Driver/Equation.php', + 'Text_CAPTCHA_Driver_Figlet' => $baseDir . '/main/inc/lib/pear/Text/CAPTCHA/Driver/Figlet.php', + 'Text_CAPTCHA_Driver_Image' => $baseDir . '/main/inc/lib/pear/Text/CAPTCHA/Driver/Image.php', + 'Text_CAPTCHA_Driver_Numeral' => $baseDir . '/main/inc/lib/pear/Text/CAPTCHA/Driver/Numeral.php', + 'Text_CAPTCHA_Driver_Word' => $baseDir . '/main/inc/lib/pear/Text/CAPTCHA/Driver/Word.php', + 'Text_CAPTCHA_Exception' => $baseDir . '/main/inc/lib/pear/Text/CAPTCHA/Exception.php', + 'Text_Diff' => $baseDir . '/main/inc/lib/pear/Text/Diff.php', + 'Text_Diff3' => $baseDir . '/main/inc/lib/pear/Text/Diff3.php', + 'Text_Diff3_BlockBuilder' => $baseDir . '/main/inc/lib/pear/Text/Diff3.php', + 'Text_Diff3_Op' => $baseDir . '/main/inc/lib/pear/Text/Diff3.php', + 'Text_Diff3_Op_copy' => $baseDir . '/main/inc/lib/pear/Text/Diff3.php', + 'Text_Diff_Engine_native' => $baseDir . '/main/inc/lib/pear/Text/Diff/Engine/native.php', + 'Text_Diff_Engine_shell' => $baseDir . '/main/inc/lib/pear/Text/Diff/Engine/shell.php', + 'Text_Diff_Engine_string' => $baseDir . '/main/inc/lib/pear/Text/Diff/Engine/string.php', + 'Text_Diff_Engine_xdiff' => $baseDir . '/main/inc/lib/pear/Text/Diff/Engine/xdiff.php', + 'Text_Diff_Mapped' => $baseDir . '/main/inc/lib/pear/Text/Diff/Mapped.php', + 'Text_Diff_Op' => $baseDir . '/main/inc/lib/pear/Text/Diff.php', + 'Text_Diff_Op_add' => $baseDir . '/main/inc/lib/pear/Text/Diff.php', + 'Text_Diff_Op_change' => $baseDir . '/main/inc/lib/pear/Text/Diff.php', + 'Text_Diff_Op_copy' => $baseDir . '/main/inc/lib/pear/Text/Diff.php', + 'Text_Diff_Op_delete' => $baseDir . '/main/inc/lib/pear/Text/Diff.php', + 'Text_Diff_Renderer' => $baseDir . '/main/inc/lib/pear/Text/Diff/Renderer.php', + 'Text_Diff_Renderer_context' => $baseDir . '/main/inc/lib/pear/Text/Diff/Renderer/context.php', + 'Text_Diff_Renderer_inline' => $baseDir . '/main/inc/lib/pear/Text/Diff/Renderer/inline.php', + 'Text_Diff_Renderer_unified' => $baseDir . '/main/inc/lib/pear/Text/Diff/Renderer/unified.php', + 'Text_Diff_ThreeWay' => $baseDir . '/main/inc/lib/pear/Text/Diff/ThreeWay.php', + 'Text_Diff_ThreeWay_BlockBuilder' => $baseDir . '/main/inc/lib/pear/Text/Diff/ThreeWay.php', + 'Text_Diff_ThreeWay_Op' => $baseDir . '/main/inc/lib/pear/Text/Diff/ThreeWay.php', + 'Text_Diff_ThreeWay_Op_copy' => $baseDir . '/main/inc/lib/pear/Text/Diff/ThreeWay.php', + 'Text_Frame_Decorator' => $baseDir . '/main/inc/lib/phpdocx/pdf/include/text_frame_decorator.cls.php', + 'Text_Frame_Reflower' => $baseDir . '/main/inc/lib/phpdocx/pdf/include/text_frame_reflower.cls.php', + 'Text_MappedDiff' => $baseDir . '/main/inc/lib/pear/Text/Diff.php', + 'Text_Password' => $baseDir . '/main/inc/lib/pear/Text/Password.php', + 'Text_Renderer' => $baseDir . '/main/inc/lib/phpdocx/pdf/include/text_renderer.cls.php', + 'Thematic' => $baseDir . '/main/inc/lib/thematic.lib.php', + 'Thumbnail' => $baseDir . '/main/inc/lib/fckeditor/editor/plugins/ImageManager/Classes/Thumbnail.php', + 'TicketManager' => $baseDir . '/plugin/ticket/src/ticket.class.php', + 'TicketPlugin' => $baseDir . '/plugin/ticket/src/ticket_plugin.class.php', + 'Timeline' => $baseDir . '/main/inc/lib/timeline.lib.php', + 'ToolIntro' => $baseDir . '/main/coursecopy/classes/ToolIntro.class.php', + 'Tools\\EntityGenerator' => $baseDir . '/main/inc/lib/tools/entity_generator.class.php', + 'Tools\\EntityRepositoryGenerator' => $baseDir . '/main/inc/lib/tools/entity_repository_generator.class.php', + 'Tools\\YamlExporter' => $baseDir . '/main/inc/lib/tools/yaml_exporter.class.php', + 'Tour' => $baseDir . '/plugin/tour/src/tour_plugin.class.php', + 'Tracking' => $baseDir . '/main/inc/lib/tracking.lib.php', + 'TrackingCourseLog' => $baseDir . '/main/inc/lib/tracking.lib.php', + 'TrackingUserLog' => $baseDir . '/main/inc/lib/tracking.lib.php', + 'TrackingUserLogCSV' => $baseDir . '/main/inc/lib/tracking.lib.php', + 'TransformDoc' => $baseDir . '/main/inc/lib/phpdocx/classes/TransformDoc.inc', + 'UniqueAnswer' => $baseDir . '/main/exercice/unique_answer.class.php', + 'UniqueAnswerNoOption' => $baseDir . '/main/exercice/unique_answer_no_option.class.php', + 'Upload' => $baseDir . '/main/inc/lib/fckeditor/editor/plugins/ajaxfilemanager/inc/class.upload.php', + 'Uri' => $baseDir . '/main/inc/lib/uri.class.php', + 'UrlManager' => $baseDir . '/main/inc/lib/urlmanager.lib.php', + 'UserApiKeyManager' => $baseDir . '/main/inc/lib/user_api_key_manager.class.php', + 'UserDataGenerator' => $baseDir . '/main/gradebook/lib/user_data_generator.class.php', + 'UserForm' => $baseDir . '/main/gradebook/lib/fe/userform.class.php', + 'UserGroup' => $baseDir . '/main/inc/lib/usergroup.lib.php', + 'UserManager' => $baseDir . '/main/inc/lib/usermanager.lib.php', + 'UserTable' => $baseDir . '/main/gradebook/lib/fe/usertable.class.php', + 'Utf8' => $baseDir . '/main/inc/lib/system/text/utf8.class.php', + 'Utf8Decoder' => $baseDir . '/main/inc/lib/system/text/utf8_decoder.class.php', + 'Utf8Encoder' => $baseDir . '/main/inc/lib/system/text/utf8_encoder.class.php', + 'VM' => $baseDir . '/plugin/bbb/lib/VM.php', + 'View' => $baseDir . '/main/inc/lib/app_view.php', + 'ViewException' => $baseDir . '/main/inc/lib/app_view.php', + 'VirtualMachineInterface' => $baseDir . '/plugin/bbb/lib/vm/VMInterface.php', + 'WCAG_Rendering' => $baseDir . '/main/inc/lib/WCAG/WCAG_rendering.php', + 'WSASoap' => $baseDir . '/plugin/sepe/src/wsse/soap-wsa.php', + 'WSSESoap' => $baseDir . '/plugin/sepe/src/wsse/soap-wsse.php', + 'WSSESoapServer' => $baseDir . '/plugin/sepe/src/wsse/soap-server-wsse.php', + 'WebService' => $baseDir . '/main/inc/lib/webservices/WebService.class.php', + 'Wiki' => $baseDir . '/main/coursecopy/classes/wiki.class.php', + 'Work' => $baseDir . '/main/coursecopy/classes/Work.class.php', + 'XMLSchema' => $baseDir . '/main/inc/lib/nusoap/class.xmlschema.php', + 'XMLSecEnc' => $baseDir . '/plugin/sepe/src/wsse/xmlseclibs.php', + 'XMLSecurityDSig' => $baseDir . '/plugin/sepe/src/wsse/xmlseclibs.php', + 'XMLSecurityKey' => $baseDir . '/plugin/sepe/src/wsse/xmlseclibs.php', + 'XapianIndexer' => $baseDir . '/main/inc/lib/search/xapian/XapianIndexer.class.php', + 'Zip' => $baseDir . '/main/inc/lib/zip.class.php', + 'ZombieManager' => $baseDir . '/main/inc/lib/zombie/zombie_manager.class.php', + 'ZombieReport' => $baseDir . '/main/inc/lib/zombie/zombie_report.class.php', + '_IndexableChunk' => $baseDir . '/main/inc/lib/search/IndexableChunk.class.php', + 'action_plugin_jcapture' => $baseDir . '/plugin/jcapture/action.php', + 'aicc' => $baseDir . '/main/newscorm/aicc.class.php', + 'aiccBlock' => $baseDir . '/main/newscorm/aiccBlock.class.php', + 'aiccItem' => $baseDir . '/main/newscorm/aiccItem.class.php', + 'aiccObjective' => $baseDir . '/main/newscorm/aiccObjective.class.php', + 'aiccResource' => $baseDir . '/main/newscorm/aiccResource.class.php', + 'api_failure' => $baseDir . '/main/inc/lib/main_api.lib.php', + 'bbb' => $baseDir . '/plugin/bbb/lib/bbb.lib.php', + 'calendarComponent' => $baseDir . '/main/inc/lib/icalcreator/iCalcreator.class.php', + 'ch_comment' => $baseDir . '/main/survey/survey.lib.php', + 'ch_dropdown' => $baseDir . '/main/survey/survey.lib.php', + 'ch_multiplechoice' => $baseDir . '/main/survey/survey.lib.php', + 'ch_multipleresponse' => $baseDir . '/main/survey/survey.lib.php', + 'ch_open' => $baseDir . '/main/survey/survey.lib.php', + 'ch_pagebreak' => $baseDir . '/main/survey/survey.lib.php', + 'ch_percentage' => $baseDir . '/main/survey/survey.lib.php', + 'ch_personality' => $baseDir . '/main/survey/survey.lib.php', + 'ch_score' => $baseDir . '/main/survey/survey.lib.php', + 'ch_yesno' => $baseDir . '/main/survey/survey.lib.php', + 'db' => $baseDir . '/main/inc/lib/db.class.php', + 'document_processor' => $baseDir . '/main/inc/lib/search/tool_processors/document_processor.class.php', + 'eventController' => $baseDir . '/main/admin/event_controller.php', + 'file' => $baseDir . '/main/inc/lib/fckeditor/editor/plugins/ajaxfilemanager/inc/class.file.php', + 'fpdi_pdf_parser' => $baseDir . '/main/inc/lib/mpdf/mpdfi/fpdi_pdf_parser.php', + 'getid3' => $baseDir . '/main/inc/lib/getid3/getid3.php', + 'getid3_exception' => $baseDir . '/main/inc/lib/getid3/getid3.php', + 'getid3_flv' => $baseDir . '/main/inc/lib/getid3/module.audio-video.flv.php', + 'getid3_handler' => $baseDir . '/main/inc/lib/getid3/getid3.php', + 'getid3_handler_write' => $baseDir . '/main/inc/lib/getid3/getid3.php', + 'getid3_lib' => $baseDir . '/main/inc/lib/getid3/getid3.php', + 'getid3_lib_replaygain' => $baseDir . '/main/inc/lib/getid3/getid3.php', + 'iDatabase' => $baseDir . '/main/install/i_database.class.php', + 'indic' => $baseDir . '/main/inc/lib/mpdf/classes/indic.php', + 'instances' => $baseDir . '/plugin/sepe/src/wsse/examples/ws-amazon.php', + 'kses4' => $baseDir . '/main/inc/lib/kses-0.2.2/oop/php4.class.kses.php', + 'kses5' => $baseDir . '/main/inc/lib/kses-0.2.2/oop/php5.class.kses.php', + 'langstats' => $baseDir . '/main/cron/lang/langstats.class.php', + 'learnpath' => $baseDir . '/main/newscorm/learnpath.class.php', + 'learnpathItem' => $baseDir . '/main/newscorm/learnpathItem.class.php', + 'learnpathList' => $baseDir . '/main/newscorm/learnpathList.class.php', + 'learnpath_processor' => $baseDir . '/main/inc/lib/search/tool_processors/learnpath_processor.class.php', + 'link_processor' => $baseDir . '/main/inc/lib/search/tool_processors/link_processor.class.php', + 'mPDF' => $baseDir . '/main/inc/lib/mpdf/mpdf.php', + 'manager' => $baseDir . '/main/inc/lib/fckeditor/editor/plugins/ajaxfilemanager/inc/class.manager.php', + 'mySoap' => $baseDir . '/plugin/sepe/src/wsse/examples/username-sign.php', + 'net\\HttpChannel' => $baseDir . '/main/inc/lib/system/net/http_channel.class.php', + 'nusoap_base' => $baseDir . '/main/inc/lib/nusoap/nusoap.php', + 'nusoap_client' => $baseDir . '/main/inc/lib/nusoap/class.soapclient.php', + 'nusoap_client_mime' => $baseDir . '/main/inc/lib/nusoap/nusoapmime.php', + 'nusoap_fault' => $baseDir . '/main/inc/lib/nusoap/class.soap_fault.php', + 'nusoap_parser' => $baseDir . '/main/inc/lib/nusoap/class.soap_parser.php', + 'nusoap_server' => $baseDir . '/main/inc/lib/nusoap/class.soap_server.php', + 'nusoap_server_mime' => $baseDir . '/main/inc/lib/nusoap/nusoapmime.php', + 'nusoap_wsdlcache' => $baseDir . '/main/inc/lib/nusoap/class.wsdlcache.php', + 'nusoap_xmlschema' => $baseDir . '/main/inc/lib/nusoap/class.xmlschema.php', + 'nusoapservermime' => $baseDir . '/main/inc/lib/nusoap/nusoapmime.php', + 'pCache' => $baseDir . '/main/inc/lib/pchart/pCache.class.php', + 'pChart' => $baseDir . '/main/inc/lib/pchart/pChart.class.php', + 'pData' => $baseDir . '/main/inc/lib/pchart/pData.class.php', + 'pagination' => $baseDir . '/main/inc/lib/fckeditor/editor/plugins/ajaxfilemanager/inc/class.pagination.php', + 'pdf_context' => $baseDir . '/main/inc/lib/mpdf/mpdfi/pdf_context.php', + 'pdf_parser' => $baseDir . '/main/inc/lib/mpdf/mpdfi/pdf_parser.php', + 'php4DOMAttr' => $baseDir . '/main/auth/cas/lib/CAS/domxml-php4-to-php5.php', + 'php4DOMDocument' => $baseDir . '/main/auth/cas/lib/CAS/domxml-php4-to-php5.php', + 'php4DOMElement' => $baseDir . '/main/auth/cas/lib/CAS/domxml-php4-to-php5.php', + 'php4DOMNode' => $baseDir . '/main/auth/cas/lib/CAS/domxml-php4-to-php5.php', + 'php4DOMNodelist' => $baseDir . '/main/auth/cas/lib/CAS/domxml-php4-to-php5.php', + 'php4DOMText' => $baseDir . '/main/auth/cas/lib/CAS/domxml-php4-to-php5.php', + 'php4DOMXPath' => $baseDir . '/main/auth/cas/lib/CAS/domxml-php4-to-php5.php', + 'php4DomProcessingInstruction' => $baseDir . '/main/auth/cas/lib/CAS/domxml-php4-to-php5.php', + 'php4DomXsltStylesheet' => $baseDir . '/main/auth/cas/lib/CAS/domxml-php4-to-php5.php', + 'phpCAS' => $baseDir . '/main/auth/cas/lib/CAS.php', + 'phpmailerException' => $baseDir . '/main/inc/lib/phpmailer/class.phpmailer.php', + 'qrstr' => $baseDir . '/main/inc/lib/phpqrcode/qrconst.php', + 'quiz_processor' => $baseDir . '/main/inc/lib/search/tool_processors/quiz_processor.class.php', + 'scorm' => $baseDir . '/main/newscorm/scorm.class.php', + 'scormItem' => $baseDir . '/main/newscorm/scormItem.class.php', + 'scormMetadata' => $baseDir . '/main/newscorm/scormMetadata.class.php', + 'scormOrganization' => $baseDir . '/main/newscorm/scormOrganization.class.php', + 'scormResource' => $baseDir . '/main/newscorm/scormResource.class.php', + 'search_processor' => $baseDir . '/main/inc/lib/search/tool_processors/search_processor.class.php', + 'soap_fault' => $baseDir . '/main/inc/lib/nusoap/class.soap_fault.php', + 'soap_parser' => $baseDir . '/main/inc/lib/nusoap/class.soap_parser.php', + 'soap_server' => $baseDir . '/main/inc/lib/nusoap/class.soap_server.php', + 'soap_transport_http' => $baseDir . '/main/inc/lib/nusoap/class.soap_transport_http.php', + 'soapclient' => $baseDir . '/main/inc/lib/nusoap/class.soapclient.php', + 'soapclientmime' => $baseDir . '/main/inc/lib/nusoap/nusoapmime.php', + 'soapval' => $baseDir . '/main/inc/lib/nusoap/class.soap_val.php', + 'sso' => $baseDir . '/main/auth/sso/sso.class.php', + 'ssoDrupal' => $baseDir . '/main/auth/sso/sso.Drupal.class.php', + 'survey_manager' => $baseDir . '/main/survey/survey.lib.php', + 'survey_question' => $baseDir . '/main/survey/survey.lib.php', + 't1asm' => $baseDir . '/main/inc/lib/mpdf/classes/t1asm.php', + 'valarm' => $baseDir . '/main/inc/lib/icalcreator/iCalcreator.class.php', + 'vcalendar' => $baseDir . '/main/inc/lib/icalcreator/iCalcreator.class.php', + 'vevent' => $baseDir . '/main/inc/lib/icalcreator/iCalcreator.class.php', + 'vfreebusy' => $baseDir . '/main/inc/lib/icalcreator/iCalcreator.class.php', + 'vjournal' => $baseDir . '/main/inc/lib/icalcreator/iCalcreator.class.php', + 'vtimezone' => $baseDir . '/main/inc/lib/icalcreator/iCalcreator.class.php', + 'vtodo' => $baseDir . '/main/inc/lib/icalcreator/iCalcreator.class.php', + 'watermark' => $baseDir . '/main/inc/lib/fckeditor/editor/plugins/ImageManager/Classes/api.watermark.php', + 'wsdl' => $baseDir . '/main/inc/lib/nusoap/class.wsdl.php', + 'wsdlcache' => $baseDir . '/main/inc/lib/nusoap/class.wsdlcache.php', + 'xajax' => $baseDir . '/main/inc/lib/xajax/xajax.inc.php', + 'xajaxResponse' => $baseDir . '/main/inc/lib/xajax/xajaxResponse.inc.php', + 'xhtdoc' => $baseDir . '/main/inc/lib/xht.lib.php', + 'xmddoc' => $baseDir . '/main/inc/lib/xmd.lib.php', ); diff --git a/vendor/composer/autoload_files.php b/vendor/composer/autoload_files.php index 84aa62c21a..915496bea7 100644 --- a/vendor/composer/autoload_files.php +++ b/vendor/composer/autoload_files.php @@ -6,5 +6,5 @@ $vendorDir = dirname(dirname(__FILE__)); $baseDir = dirname($vendorDir); return array( - $vendorDir . '/brainsware/php-markdown-extra-extended/markdown_extended.php', + $vendorDir . '/ezyang/htmlpurifier/library/HTMLPurifier.composer.php', ); diff --git a/vendor/composer/autoload_namespaces.php b/vendor/composer/autoload_namespaces.php index 04434c4739..2dbda5b18b 100755 --- a/vendor/composer/autoload_namespaces.php +++ b/vendor/composer/autoload_namespaces.php @@ -17,6 +17,7 @@ return array( 'Neutron' => array($vendorDir . '/neutron/temporary-filesystem/src'), 'Michelf' => array($vendorDir . '/michelf/php-markdown'), 'HttpAdapter' => array($vendorDir . '/toin0u/http-adapter/src'), + 'HTMLPurifier' => array($vendorDir . '/ezyang/htmlpurifier/library'), 'FFMpeg' => array($vendorDir . '/php-ffmpeg/php-ffmpeg/src'), 'Evenement' => array($vendorDir . '/evenement/evenement/src'), 'Doctrine\\Common\\Cache\\' => array($vendorDir . '/doctrine/cache/lib'), diff --git a/vendor/composer/autoload_real.php b/vendor/composer/autoload_real.php index 8130548c55..3857811e74 100755 --- a/vendor/composer/autoload_real.php +++ b/vendor/composer/autoload_real.php @@ -2,7 +2,7 @@ // autoload_real.php @generated by Composer -class ComposerAutoloaderInit6960ef7dac86925470234c7bd58c9074 +class ComposerAutoloaderInit8a248dac32b5be509bcda820da2b8ea9 { private static $loader; @@ -19,9 +19,9 @@ class ComposerAutoloaderInit6960ef7dac86925470234c7bd58c9074 return self::$loader; } - spl_autoload_register(array('ComposerAutoloaderInit6960ef7dac86925470234c7bd58c9074', 'loadClassLoader'), true, true); + spl_autoload_register(array('ComposerAutoloaderInit8a248dac32b5be509bcda820da2b8ea9', 'loadClassLoader'), true, true); self::$loader = $loader = new \Composer\Autoload\ClassLoader(); - spl_autoload_unregister(array('ComposerAutoloaderInit6960ef7dac86925470234c7bd58c9074', 'loadClassLoader')); + spl_autoload_unregister(array('ComposerAutoloaderInit8a248dac32b5be509bcda820da2b8ea9', 'loadClassLoader')); $map = require __DIR__ . '/autoload_namespaces.php'; foreach ($map as $namespace => $path) { @@ -40,11 +40,16 @@ class ComposerAutoloaderInit6960ef7dac86925470234c7bd58c9074 $loader->register(true); + $includeFiles = require __DIR__ . '/autoload_files.php'; + foreach ($includeFiles as $file) { + composerRequire8a248dac32b5be509bcda820da2b8ea9($file); + } + return $loader; } } -function composerRequire6960ef7dac86925470234c7bd58c9074($file) +function composerRequire8a248dac32b5be509bcda820da2b8ea9($file) { require $file; } diff --git a/vendor/composer/installed.json b/vendor/composer/installed.json index fcc0a89ad4..5d495cf9cf 100755 --- a/vendor/composer/installed.json +++ b/vendor/composer/installed.json @@ -377,210 +377,6 @@ "vps" ] }, - { - "name": "doctrine/cache", - "version": "v1.3.1", - "version_normalized": "1.3.1.0", - "source": { - "type": "git", - "url": "https://github.com/doctrine/cache.git", - "reference": "cf483685798a72c93bf4206e3dd6358ea07d64e7" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/doctrine/cache/zipball/cf483685798a72c93bf4206e3dd6358ea07d64e7", - "reference": "cf483685798a72c93bf4206e3dd6358ea07d64e7", - "shasum": "" - }, - "require": { - "php": ">=5.3.2" - }, - "conflict": { - "doctrine/common": ">2.2,<2.4" - }, - "require-dev": { - "phpunit/phpunit": ">=3.7", - "satooshi/php-coveralls": "~0.6" - }, - "time": "2014-09-17 14:24:04", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.4.x-dev" - } - }, - "installation-source": "dist", - "autoload": { - "psr-0": { - "Doctrine\\Common\\Cache\\": "lib/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Roman Borschel", - "email": "roman@code-factory.org" - }, - { - "name": "Benjamin Eberlei", - "email": "kontakt@beberlei.de" - }, - { - "name": "Guilherme Blanco", - "email": "guilhermeblanco@gmail.com" - }, - { - "name": "Jonathan Wage", - "email": "jonwage@gmail.com" - }, - { - "name": "Johannes Schmitt", - "email": "schmittjoh@gmail.com" - } - ], - "description": "Caching library offering an object-oriented API for many cache backends", - "homepage": "http://www.doctrine-project.org", - "keywords": [ - "cache", - "caching" - ] - }, - { - "name": "monolog/monolog", - "version": "1.11.0", - "version_normalized": "1.11.0.0", - "source": { - "type": "git", - "url": "https://github.com/Seldaek/monolog.git", - "reference": "ec3961874c43840e96da3a8a1ed20d8c73d7e5aa" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/Seldaek/monolog/zipball/ec3961874c43840e96da3a8a1ed20d8c73d7e5aa", - "reference": "ec3961874c43840e96da3a8a1ed20d8c73d7e5aa", - "shasum": "" - }, - "require": { - "php": ">=5.3.0", - "psr/log": "~1.0" - }, - "provide": { - "psr/log-implementation": "1.0.0" - }, - "require-dev": { - "aws/aws-sdk-php": "~2.4, >2.4.8", - "doctrine/couchdb": "~1.0@dev", - "graylog2/gelf-php": "~1.0", - "phpunit/phpunit": "~3.7.0", - "raven/raven": "~0.5", - "ruflin/elastica": "0.90.*", - "videlalvaro/php-amqplib": "~2.4" - }, - "suggest": { - "aws/aws-sdk-php": "Allow sending log messages to AWS services like DynamoDB", - "doctrine/couchdb": "Allow sending log messages to a CouchDB server", - "ext-amqp": "Allow sending log messages to an AMQP server (1.0+ required)", - "ext-mongo": "Allow sending log messages to a MongoDB server", - "graylog2/gelf-php": "Allow sending log messages to a GrayLog2 server", - "raven/raven": "Allow sending log messages to a Sentry server", - "rollbar/rollbar": "Allow sending log messages to Rollbar", - "ruflin/elastica": "Allow sending log messages to an Elastic Search server", - "videlalvaro/php-amqplib": "Allow sending log messages to an AMQP server using php-amqplib" - }, - "time": "2014-09-30 13:30:58", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.11.x-dev" - } - }, - "installation-source": "dist", - "autoload": { - "psr-4": { - "Monolog\\": "src/Monolog" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Jordi Boggiano", - "email": "j.boggiano@seld.be", - "homepage": "http://seld.be" - } - ], - "description": "Sends your logs to files, sockets, inboxes, databases and various web services", - "homepage": "http://github.com/Seldaek/monolog", - "keywords": [ - "log", - "logging", - "psr-3" - ] - }, - { - "name": "twig/twig", - "version": "v1.16.2", - "version_normalized": "1.16.2.0", - "source": { - "type": "git", - "url": "https://github.com/fabpot/Twig.git", - "reference": "42f758d9fe2146d1f0470604fc05ee43580873fc" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/fabpot/Twig/zipball/42f758d9fe2146d1f0470604fc05ee43580873fc", - "reference": "42f758d9fe2146d1f0470604fc05ee43580873fc", - "shasum": "" - }, - "require": { - "php": ">=5.2.4" - }, - "time": "2014-10-17 12:53:44", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.16-dev" - } - }, - "installation-source": "dist", - "autoload": { - "psr-0": { - "Twig_": "lib/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com", - "homepage": "http://fabien.potencier.org", - "role": "Lead Developer" - }, - { - "name": "Armin Ronacher", - "email": "armin.ronacher@active-4.com", - "role": "Project Founder" - }, - { - "name": "Twig Team", - "homepage": "https://github.com/fabpot/Twig/graphs/contributors", - "role": "Contributors" - } - ], - "description": "Twig, the flexible, fast, and secure template language for PHP", - "homepage": "http://twig.sensiolabs.org", - "keywords": [ - "templating" - ] - }, { "name": "emojione/emojione", "version": "v1.3.0", @@ -727,19 +523,76 @@ "zf2" ] }, + { + "name": "zendframework/zend-config", + "version": "2.3.3", + "version_normalized": "2.3.3.0", + "target-dir": "Zend/Config", + "source": { + "type": "git", + "url": "https://github.com/zendframework/Component_ZendConfig.git", + "reference": "a9ad512e1482461a5b500ee3fcf2d06ec9c7c7e8" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/zendframework/Component_ZendConfig/zipball/a9ad512e1482461a5b500ee3fcf2d06ec9c7c7e8", + "reference": "a9ad512e1482461a5b500ee3fcf2d06ec9c7c7e8", + "shasum": "" + }, + "require": { + "php": ">=5.3.23", + "zendframework/zend-stdlib": "self.version" + }, + "require-dev": { + "zendframework/zend-filter": "self.version", + "zendframework/zend-i18n": "self.version", + "zendframework/zend-json": "self.version", + "zendframework/zend-servicemanager": "self.version" + }, + "suggest": { + "zendframework/zend-filter": "Zend\\Filter component", + "zendframework/zend-i18n": "Zend\\I18n component", + "zendframework/zend-json": "Zend\\Json to use the Json reader or writer classes", + "zendframework/zend-servicemanager": "Zend\\ServiceManager for use with the Config Factory to retrieve reader and writer instances" + }, + "time": "2014-09-16 22:58:11", + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.3-dev", + "dev-develop": "2.4-dev" + } + }, + "installation-source": "dist", + "autoload": { + "psr-0": { + "Zend\\Config\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "description": "provides a nested object property based user interface for accessing this configuration data within application code", + "homepage": "https://github.com/zendframework/zf2", + "keywords": [ + "config", + "zf2" + ] + }, { "name": "sabre/vobject", - "version": "3.3.4", - "version_normalized": "3.3.4.0", + "version": "3.3.5", + "version_normalized": "3.3.5.0", "source": { "type": "git", "url": "https://github.com/fruux/sabre-vobject.git", - "reference": "e7cbc59a7a77325dfa32924865e1802c9216a3e0" + "reference": "77cb636a5bde4c19d7522c2c548b258859ddd1ef" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/fruux/sabre-vobject/zipball/e7cbc59a7a77325dfa32924865e1802c9216a3e0", - "reference": "e7cbc59a7a77325dfa32924865e1802c9216a3e0", + "url": "https://api.github.com/repos/fruux/sabre-vobject/zipball/77cb636a5bde4c19d7522c2c548b258859ddd1ef", + "reference": "77cb636a5bde4c19d7522c2c548b258859ddd1ef", "shasum": "" }, "require": { @@ -750,7 +603,7 @@ "phpunit/phpunit": "*", "squizlabs/php_codesniffer": "*" }, - "time": "2014-11-19 22:15:24", + "time": "2015-01-10 00:54:52", "bin": [ "bin/vobject", "bin/generate_vcards" @@ -795,26 +648,157 @@ "vCard" ] }, + { + "name": "twig/twig", + "version": "v1.18.0", + "version_normalized": "1.18.0.0", + "source": { + "type": "git", + "url": "https://github.com/twigphp/Twig.git", + "reference": "4cf7464348e7f9893a93f7096a90b73722be99cf" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/twigphp/Twig/zipball/4cf7464348e7f9893a93f7096a90b73722be99cf", + "reference": "4cf7464348e7f9893a93f7096a90b73722be99cf", + "shasum": "" + }, + "require": { + "php": ">=5.2.4" + }, + "time": "2015-01-25 17:32:08", + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.18-dev" + } + }, + "installation-source": "dist", + "autoload": { + "psr-0": { + "Twig_": "lib/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com", + "homepage": "http://fabien.potencier.org", + "role": "Lead Developer" + }, + { + "name": "Armin Ronacher", + "email": "armin.ronacher@active-4.com", + "role": "Project Founder" + }, + { + "name": "Twig Team", + "homepage": "http://twig.sensiolabs.org/contributors", + "role": "Contributors" + } + ], + "description": "Twig, the flexible, fast, and secure template language for PHP", + "homepage": "http://twig.sensiolabs.org", + "keywords": [ + "templating" + ] + }, + { + "name": "doctrine/cache", + "version": "v1.4.0", + "version_normalized": "1.4.0.0", + "source": { + "type": "git", + "url": "https://github.com/doctrine/cache.git", + "reference": "2346085d2b027b233ae1d5de59b07440b9f288c8" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/doctrine/cache/zipball/2346085d2b027b233ae1d5de59b07440b9f288c8", + "reference": "2346085d2b027b233ae1d5de59b07440b9f288c8", + "shasum": "" + }, + "require": { + "php": ">=5.3.2" + }, + "conflict": { + "doctrine/common": ">2.2,<2.4" + }, + "require-dev": { + "phpunit/phpunit": ">=3.7", + "predis/predis": "~0.8", + "satooshi/php-coveralls": "~0.6" + }, + "time": "2015-01-15 20:38:55", + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.4.x-dev" + } + }, + "installation-source": "dist", + "autoload": { + "psr-0": { + "Doctrine\\Common\\Cache\\": "lib/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Roman Borschel", + "email": "roman@code-factory.org" + }, + { + "name": "Benjamin Eberlei", + "email": "kontakt@beberlei.de" + }, + { + "name": "Guilherme Blanco", + "email": "guilhermeblanco@gmail.com" + }, + { + "name": "Jonathan Wage", + "email": "jonwage@gmail.com" + }, + { + "name": "Johannes Schmitt", + "email": "schmittjoh@gmail.com" + } + ], + "description": "Caching library offering an object-oriented API for many cache backends", + "homepage": "http://www.doctrine-project.org", + "keywords": [ + "cache", + "caching" + ] + }, { "name": "symfony/filesystem", - "version": "v2.6.1", - "version_normalized": "2.6.1.0", + "version": "v2.6.3", + "version_normalized": "2.6.3.0", "target-dir": "Symfony/Component/Filesystem", "source": { "type": "git", "url": "https://github.com/symfony/Filesystem.git", - "reference": "ff6efc95256cb33031933729e68b01d720b5436b" + "reference": "a1f566d1f92e142fa1593f4555d6d89e3044a9b7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/Filesystem/zipball/ff6efc95256cb33031933729e68b01d720b5436b", - "reference": "ff6efc95256cb33031933729e68b01d720b5436b", + "url": "https://api.github.com/repos/symfony/Filesystem/zipball/a1f566d1f92e142fa1593f4555d6d89e3044a9b7", + "reference": "a1f566d1f92e142fa1593f4555d6d89e3044a9b7", "shasum": "" }, "require": { "php": ">=5.3.3" }, - "time": "2014-12-02 20:19:20", + "time": "2015-01-03 21:13:09", "type": "library", "extra": { "branch-alias": { @@ -846,18 +830,18 @@ }, { "name": "symfony/console", - "version": "v2.6.1", - "version_normalized": "2.6.1.0", + "version": "v2.6.3", + "version_normalized": "2.6.3.0", "target-dir": "Symfony/Component/Console", "source": { "type": "git", "url": "https://github.com/symfony/Console.git", - "reference": "ef825fd9f809d275926547c9e57cbf14968793e8" + "reference": "6ac6491ff60c0e5a941db3ccdc75a07adbb61476" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/Console/zipball/ef825fd9f809d275926547c9e57cbf14968793e8", - "reference": "ef825fd9f809d275926547c9e57cbf14968793e8", + "url": "https://api.github.com/repos/symfony/Console/zipball/6ac6491ff60c0e5a941db3ccdc75a07adbb61476", + "reference": "6ac6491ff60c0e5a941db3ccdc75a07adbb61476", "shasum": "" }, "require": { @@ -873,7 +857,7 @@ "symfony/event-dispatcher": "", "symfony/process": "" }, - "time": "2014-12-02 20:19:20", + "time": "2015-01-06 17:50:02", "type": "library", "extra": { "branch-alias": { @@ -905,24 +889,24 @@ }, { "name": "symfony/yaml", - "version": "v2.6.1", - "version_normalized": "2.6.1.0", + "version": "v2.6.3", + "version_normalized": "2.6.3.0", "target-dir": "Symfony/Component/Yaml", "source": { "type": "git", "url": "https://github.com/symfony/Yaml.git", - "reference": "3346fc090a3eb6b53d408db2903b241af51dcb20" + "reference": "82462a90848a52c2533aa6b598b107d68076b018" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/Yaml/zipball/3346fc090a3eb6b53d408db2903b241af51dcb20", - "reference": "3346fc090a3eb6b53d408db2903b241af51dcb20", + "url": "https://api.github.com/repos/symfony/Yaml/zipball/82462a90848a52c2533aa6b598b107d68076b018", + "reference": "82462a90848a52c2533aa6b598b107d68076b018", "shasum": "" }, "require": { "php": ">=5.3.3" }, - "time": "2014-12-02 20:19:20", + "time": "2015-01-03 15:33:07", "type": "library", "extra": { "branch-alias": { @@ -952,26 +936,100 @@ "description": "Symfony Yaml Component", "homepage": "http://symfony.com" }, + { + "name": "monolog/monolog", + "version": "1.12.0", + "version_normalized": "1.12.0.0", + "source": { + "type": "git", + "url": "https://github.com/Seldaek/monolog.git", + "reference": "1fbe8c2641f2b163addf49cc5e18f144bec6b19f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Seldaek/monolog/zipball/1fbe8c2641f2b163addf49cc5e18f144bec6b19f", + "reference": "1fbe8c2641f2b163addf49cc5e18f144bec6b19f", + "shasum": "" + }, + "require": { + "php": ">=5.3.0", + "psr/log": "~1.0" + }, + "provide": { + "psr/log-implementation": "1.0.0" + }, + "require-dev": { + "aws/aws-sdk-php": "~2.4, >2.4.8", + "doctrine/couchdb": "~1.0@dev", + "graylog2/gelf-php": "~1.0", + "phpunit/phpunit": "~4.0", + "raven/raven": "~0.5", + "ruflin/elastica": "0.90.*", + "videlalvaro/php-amqplib": "~2.4" + }, + "suggest": { + "aws/aws-sdk-php": "Allow sending log messages to AWS services like DynamoDB", + "doctrine/couchdb": "Allow sending log messages to a CouchDB server", + "ext-amqp": "Allow sending log messages to an AMQP server (1.0+ required)", + "ext-mongo": "Allow sending log messages to a MongoDB server", + "graylog2/gelf-php": "Allow sending log messages to a GrayLog2 server", + "raven/raven": "Allow sending log messages to a Sentry server", + "rollbar/rollbar": "Allow sending log messages to Rollbar", + "ruflin/elastica": "Allow sending log messages to an Elastic Search server", + "videlalvaro/php-amqplib": "Allow sending log messages to an AMQP server using php-amqplib" + }, + "time": "2014-12-29 21:29:35", + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.12.x-dev" + } + }, + "installation-source": "dist", + "autoload": { + "psr-4": { + "Monolog\\": "src/Monolog" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Jordi Boggiano", + "email": "j.boggiano@seld.be", + "homepage": "http://seld.be" + } + ], + "description": "Sends your logs to files, sockets, inboxes, databases and various web services", + "homepage": "http://github.com/Seldaek/monolog", + "keywords": [ + "log", + "logging", + "psr-3" + ] + }, { "name": "symfony/process", - "version": "v2.6.1", - "version_normalized": "2.6.1.0", + "version": "v2.6.3", + "version_normalized": "2.6.3.0", "target-dir": "Symfony/Component/Process", "source": { "type": "git", "url": "https://github.com/symfony/Process.git", - "reference": "bf0c9bd625f13b0b0bbe39919225cf145dfb935a" + "reference": "319794f611bd8bdefbac72beb3f05e847f8ebc92" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/Process/zipball/bf0c9bd625f13b0b0bbe39919225cf145dfb935a", - "reference": "bf0c9bd625f13b0b0bbe39919225cf145dfb935a", + "url": "https://api.github.com/repos/symfony/Process/zipball/319794f611bd8bdefbac72beb3f05e847f8ebc92", + "reference": "319794f611bd8bdefbac72beb3f05e847f8ebc92", "shasum": "" }, "require": { "php": ">=5.3.3" }, - "time": "2014-12-02 20:19:20", + "time": "2015-01-06 22:47:52", "type": "library", "extra": { "branch-alias": { @@ -1002,60 +1060,49 @@ "homepage": "http://symfony.com" }, { - "name": "zendframework/zend-config", - "version": "2.3.3", - "version_normalized": "2.3.3.0", - "target-dir": "Zend/Config", + "name": "ezyang/htmlpurifier", + "version": "v4.6.0", + "version_normalized": "4.6.0.0", "source": { "type": "git", - "url": "https://github.com/zendframework/Component_ZendConfig.git", - "reference": "a9ad512e1482461a5b500ee3fcf2d06ec9c7c7e8" + "url": "https://github.com/ezyang/htmlpurifier.git", + "reference": "6f389f0f25b90d0b495308efcfa073981177f0fd" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/zendframework/Component_ZendConfig/zipball/a9ad512e1482461a5b500ee3fcf2d06ec9c7c7e8", - "reference": "a9ad512e1482461a5b500ee3fcf2d06ec9c7c7e8", + "url": "https://api.github.com/repos/ezyang/htmlpurifier/zipball/6f389f0f25b90d0b495308efcfa073981177f0fd", + "reference": "6f389f0f25b90d0b495308efcfa073981177f0fd", "shasum": "" }, "require": { - "php": ">=5.3.23", - "zendframework/zend-stdlib": "self.version" + "php": ">=5.2" }, - "require-dev": { - "zendframework/zend-filter": "self.version", - "zendframework/zend-i18n": "self.version", - "zendframework/zend-json": "self.version", - "zendframework/zend-servicemanager": "self.version" - }, - "suggest": { - "zendframework/zend-filter": "Zend\\Filter component", - "zendframework/zend-i18n": "Zend\\I18n component", - "zendframework/zend-json": "Zend\\Json to use the Json reader or writer classes", - "zendframework/zend-servicemanager": "Zend\\ServiceManager for use with the Config Factory to retrieve reader and writer instances" - }, - "time": "2014-09-16 22:58:11", + "time": "2013-11-30 08:25:19", "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.3-dev", - "dev-develop": "2.4-dev" - } - }, "installation-source": "dist", "autoload": { "psr-0": { - "Zend\\Config\\": "" - } + "HTMLPurifier": "library/" + }, + "files": [ + "library/HTMLPurifier.composer.php" + ] }, "notification-url": "https://packagist.org/downloads/", "license": [ - "BSD-3-Clause" + "LGPL" ], - "description": "provides a nested object property based user interface for accessing this configuration data within application code", - "homepage": "https://github.com/zendframework/zf2", + "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": [ - "config", - "zf2" + "html" ] } ] diff --git a/vendor/doctrine/cache/composer.json b/vendor/doctrine/cache/composer.json index 25b9de8f53..ee7ab07200 100644 --- a/vendor/doctrine/cache/composer.json +++ b/vendor/doctrine/cache/composer.json @@ -17,7 +17,8 @@ }, "require-dev": { "phpunit/phpunit": ">=3.7", - "satooshi/php-coveralls": "~0.6" + "satooshi/php-coveralls": "~0.6", + "predis/predis": "~0.8" }, "conflict": { "doctrine/common": ">2.2,<2.4" diff --git a/vendor/doctrine/cache/lib/Doctrine/Common/Cache/ApcCache.php b/vendor/doctrine/cache/lib/Doctrine/Common/Cache/ApcCache.php index 1f19db675b..abd5e71c2a 100644 --- a/vendor/doctrine/cache/lib/Doctrine/Common/Cache/ApcCache.php +++ b/vendor/doctrine/cache/lib/Doctrine/Common/Cache/ApcCache.php @@ -72,12 +72,20 @@ class ApcCache extends CacheProvider return apc_clear_cache() && apc_clear_cache('user'); } + /** + * {@inheritdoc} + */ + protected function doFetchMultiple(array $keys) + { + return apc_fetch($keys); + } + /** * {@inheritdoc} */ protected function doGetStats() { - $info = apc_cache_info(); + $info = apc_cache_info('', true); $sma = apc_sma_info(); // @TODO - Temporary fix @see https://github.com/krakjoe/apcu/pull/42 diff --git a/vendor/doctrine/cache/lib/Doctrine/Common/Cache/ArrayCache.php b/vendor/doctrine/cache/lib/Doctrine/Common/Cache/ArrayCache.php index e8243775cd..31a0729011 100644 --- a/vendor/doctrine/cache/lib/Doctrine/Common/Cache/ArrayCache.php +++ b/vendor/doctrine/cache/lib/Doctrine/Common/Cache/ArrayCache.php @@ -50,6 +50,7 @@ class ArrayCache extends CacheProvider */ protected function doContains($id) { + // isset() is required for performance optimizations, to avoid unnecessary function calls to array_key_exists. return isset($this->data[$id]) || array_key_exists($id, $this->data); } diff --git a/vendor/doctrine/cache/lib/Doctrine/Common/Cache/Cache.php b/vendor/doctrine/cache/lib/Doctrine/Common/Cache/Cache.php index 0785f263b7..205a12327e 100644 --- a/vendor/doctrine/cache/lib/Doctrine/Common/Cache/Cache.php +++ b/vendor/doctrine/cache/lib/Doctrine/Common/Cache/Cache.php @@ -29,6 +29,7 @@ namespace Doctrine\Common\Cache; * @author Jonathan Wage * @author Roman Borschel * @author Fabio B. Silva + * @author Kévin Dunglas */ interface Cache { @@ -51,7 +52,7 @@ interface Cache * * @return mixed The cached data or FALSE, if no cache entry exists for the given id. */ - function fetch($id); + public function fetch($id); /** * Tests if an entry exists in the cache. @@ -60,7 +61,7 @@ interface Cache * * @return boolean TRUE if a cache entry exists for the given cache id, FALSE otherwise. */ - function contains($id); + public function contains($id); /** * Puts data into the cache. @@ -72,7 +73,7 @@ interface Cache * * @return boolean TRUE if the entry was successfully stored in the cache, FALSE otherwise. */ - function save($id, $data, $lifeTime = 0); + public function save($id, $data, $lifeTime = 0); /** * Deletes a cache entry. @@ -81,7 +82,7 @@ interface Cache * * @return boolean TRUE if the cache entry was successfully deleted, FALSE otherwise. */ - function delete($id); + public function delete($id); /** * Retrieves cached information from the data store. @@ -107,5 +108,5 @@ interface Cache * * @return array|null An associative array with server's statistics if available, NULL otherwise. */ - function getStats(); + public function getStats(); } diff --git a/vendor/doctrine/cache/lib/Doctrine/Common/Cache/CacheProvider.php b/vendor/doctrine/cache/lib/Doctrine/Common/Cache/CacheProvider.php index f896bc7082..d7e94435e5 100644 --- a/vendor/doctrine/cache/lib/Doctrine/Common/Cache/CacheProvider.php +++ b/vendor/doctrine/cache/lib/Doctrine/Common/Cache/CacheProvider.php @@ -29,7 +29,7 @@ namespace Doctrine\Common\Cache; * @author Roman Borschel * @author Fabio B. Silva */ -abstract class CacheProvider implements Cache +abstract class CacheProvider implements Cache, FlushableCache, ClearableCache, MultiGetCache { const DOCTRINE_NAMESPACE_CACHEKEY = 'DoctrineNamespaceCacheKey[%s]'; @@ -78,6 +78,27 @@ abstract class CacheProvider implements Cache return $this->doFetch($this->getNamespacedId($id)); } + /** + * {@inheritdoc} + */ + public function fetchMultiple(array $keys) + { + // note: the array_combine() is in place to keep an association between our $keys and the $namespacedKeys + $namespacedKeys = array_combine($keys, array_map(array($this, 'getNamespacedId'), $keys)); + $items = $this->doFetchMultiple($namespacedKeys); + $foundItems = array(); + + // no internal array function supports this sort of mapping: needs to be iterative + // this filters and combines keys in one pass + foreach ($namespacedKeys as $requestedKey => $namespacedKey) { + if (isset($items[$namespacedKey])) { + $foundItems[$requestedKey] = $items[$namespacedKey]; + } + } + + return $foundItems; + } + /** * {@inheritdoc} */ @@ -111,9 +132,7 @@ abstract class CacheProvider implements Cache } /** - * Flushes all cache entries. - * - * @return boolean TRUE if the cache entries were successfully flushed, FALSE otherwise. + * {@inheritDoc} */ public function flushAll() { @@ -121,9 +140,7 @@ abstract class CacheProvider implements Cache } /** - * Deletes all cache entries. - * - * @return boolean TRUE if the cache entries were successfully deleted, FALSE otherwise. + * {@inheritDoc} */ public function deleteAll() { @@ -184,6 +201,25 @@ abstract class CacheProvider implements Cache return $this->namespaceVersion; } + /** + * Default implementation of doFetchMultiple. Each driver that supports multi-get should owerwrite it. + * + * @param array $keys Array of keys to retrieve from cache + * @return array Array of values retrieved for the given keys. + */ + protected function doFetchMultiple(array $keys) + { + $returnValues = array(); + + foreach ($keys as $index => $key) { + if (false !== ($item = $this->doFetch($key))) { + $returnValues[$key] = $item; + } + } + + return $returnValues; + } + /** * Fetches an entry from the cache. * diff --git a/vendor/doctrine/cache/lib/Doctrine/Common/Cache/FileCache.php b/vendor/doctrine/cache/lib/Doctrine/Common/Cache/FileCache.php index d91d0bc6d6..243c28ce82 100644 --- a/vendor/doctrine/cache/lib/Doctrine/Common/Cache/FileCache.php +++ b/vendor/doctrine/cache/lib/Doctrine/Common/Cache/FileCache.php @@ -37,19 +37,32 @@ abstract class FileCache extends CacheProvider /** * The cache file extension. * - * @var string|null + * @var string */ - protected $extension; + private $extension; + + /** + * @var string[] regular expressions for replacing disallowed characters in file name + */ + private $disallowedCharacterPatterns = array( + '/\-/', // replaced to disambiguate original `-` and `-` derived from replacements + '/[^a-zA-Z0-9\-_\[\]]/' // also excludes non-ascii chars (not supported, depending on FS) + ); + + /** + * @var string[] replacements for disallowed file characters + */ + private $replacementCharacters = array('__', '-'); /** * Constructor. * - * @param string $directory The cache directory. - * @param string|null $extension The cache file extension. + * @param string $directory The cache directory. + * @param string $extension The cache file extension. * * @throws \InvalidArgumentException */ - public function __construct($directory, $extension = null) + public function __construct($directory, $extension = '') { if ( ! is_dir($directory) && ! @mkdir($directory, 0777, true)) { throw new \InvalidArgumentException(sprintf( @@ -66,7 +79,7 @@ abstract class FileCache extends CacheProvider } $this->directory = realpath($directory); - $this->extension = $extension ?: $this->extension; + $this->extension = (string) $extension; } /** @@ -96,12 +109,12 @@ abstract class FileCache extends CacheProvider */ protected function getFilename($id) { - $hash = hash('sha256', $id); - $path = implode(str_split($hash, 16), DIRECTORY_SEPARATOR); - $path = $this->directory . DIRECTORY_SEPARATOR . $path; - $id = preg_replace('@[\\\/:"*?<>|]+@', '', $id); - - return $path . DIRECTORY_SEPARATOR . $id . $this->extension; + return $this->directory + . DIRECTORY_SEPARATOR + . implode(str_split(hash('sha256', $id), 2), DIRECTORY_SEPARATOR) + . DIRECTORY_SEPARATOR + . preg_replace($this->disallowedCharacterPatterns, $this->replacementCharacters, $id) + . $this->extension; } /** @@ -145,14 +158,66 @@ abstract class FileCache extends CacheProvider ); } + /** + * Create path if needed. + * + * @param string $path + * @return bool TRUE on success or if path already exists, FALSE if path cannot be created. + */ + private function createPathIfNeeded($path) + { + if ( ! is_dir($path)) { + if (false === @mkdir($path, 0777, true) && !is_dir($path)) { + return false; + } + } + + return true; + } + + /** + * Writes a string content to file in an atomic way. + * + * @param string $filename Path to the file where to write the data. + * @param string $content The content to write + * + * @return bool TRUE on success, FALSE if path cannot be created, if path is not writable or an any other error. + */ + protected function writeFile($filename, $content) + { + $filepath = pathinfo($filename, PATHINFO_DIRNAME); + + if ( ! $this->createPathIfNeeded($filepath)) { + return false; + } + + if ( ! is_writable($filepath)) { + return false; + } + + $tmpFile = tempnam($filepath, 'swap'); + + if (file_put_contents($tmpFile, $content) !== false) { + if (@rename($tmpFile, $filename)) { + @chmod($filename, 0666 & ~umask()); + + return true; + } + + @unlink($tmpFile); + } + + return false; + } + /** * @return \Iterator */ private function getIterator() { - $pattern = '/^.+\\' . $this->extension . '$/i'; - $iterator = new \RecursiveDirectoryIterator($this->directory); - $iterator = new \RecursiveIteratorIterator($iterator); - return new \RegexIterator($iterator, $pattern); + return new \RegexIterator( + new \RecursiveIteratorIterator(new \RecursiveDirectoryIterator($this->directory)), + '/^.+' . preg_quote($this->extension, '/') . '$/i' + ); } } diff --git a/vendor/doctrine/cache/lib/Doctrine/Common/Cache/FilesystemCache.php b/vendor/doctrine/cache/lib/Doctrine/Common/Cache/FilesystemCache.php index 07eda8e874..6b44aa05a5 100644 --- a/vendor/doctrine/cache/lib/Doctrine/Common/Cache/FilesystemCache.php +++ b/vendor/doctrine/cache/lib/Doctrine/Common/Cache/FilesystemCache.php @@ -32,7 +32,10 @@ class FilesystemCache extends FileCache /** * {@inheritdoc} */ - protected $extension = self::EXTENSION; + public function __construct($directory, $extension = self::EXTENSION) + { + parent::__construct($directory, $extension); + } /** * {@inheritdoc} @@ -100,26 +103,9 @@ class FilesystemCache extends FileCache $lifeTime = time() + $lifeTime; } - $data = serialize($data); - $filename = $this->getFilename($id); - $filepath = pathinfo($filename, PATHINFO_DIRNAME); - - if ( ! is_dir($filepath)) { - if (false === @mkdir($filepath, 0777, true) && !is_dir($filepath)) { - return false; - } - } elseif ( ! is_writable($filepath)) { - return false; - } - - $tmpFile = tempnam($filepath, basename($filename)); - - if ((file_put_contents($tmpFile, $lifeTime . PHP_EOL . $data) !== false) && @rename($tmpFile, $filename)) { - @chmod($filename, 0666 & ~umask()); - - return true; - } + $data = serialize($data); + $filename = $this->getFilename($id); - return false; + return $this->writeFile($filename, $lifeTime . PHP_EOL . $data); } } diff --git a/vendor/doctrine/cache/lib/Doctrine/Common/Cache/MemcachedCache.php b/vendor/doctrine/cache/lib/Doctrine/Common/Cache/MemcachedCache.php index f7e5500a1c..040c26c02c 100644 --- a/vendor/doctrine/cache/lib/Doctrine/Common/Cache/MemcachedCache.php +++ b/vendor/doctrine/cache/lib/Doctrine/Common/Cache/MemcachedCache.php @@ -69,6 +69,14 @@ class MemcachedCache extends CacheProvider return $this->memcached->get($id); } + /** + * {@inheritdoc} + */ + protected function doFetchMultiple(array $keys) + { + return $this->memcached->getMulti($keys); + } + /** * {@inheritdoc} */ diff --git a/vendor/doctrine/cache/lib/Doctrine/Common/Cache/PhpFileCache.php b/vendor/doctrine/cache/lib/Doctrine/Common/Cache/PhpFileCache.php index f017d83326..bbe766cf5f 100644 --- a/vendor/doctrine/cache/lib/Doctrine/Common/Cache/PhpFileCache.php +++ b/vendor/doctrine/cache/lib/Doctrine/Common/Cache/PhpFileCache.php @@ -29,10 +29,13 @@ class PhpFileCache extends FileCache { const EXTENSION = '.doctrinecache.php'; - /** + /** * {@inheritdoc} */ - protected $extension = self::EXTENSION; + public function __construct($directory, $extension = self::EXTENSION) + { + parent::__construct($directory, $extension); + } /** * {@inheritdoc} @@ -64,6 +67,10 @@ class PhpFileCache extends FileCache if ( ! is_file($filename)) { return false; } + + if ( ! is_readable($filename)) { + return false; + } $value = include $filename; @@ -87,12 +94,7 @@ class PhpFileCache extends FileCache ); } - $filename = $this->getFilename($id); - $filepath = pathinfo($filename, PATHINFO_DIRNAME); - - if ( ! is_dir($filepath)) { - mkdir($filepath, 0777, true); - } + $filename = $this->getFilename($id); $value = array( 'lifetime' => $lifeTime, @@ -102,6 +104,6 @@ class PhpFileCache extends FileCache $value = var_export($value, true); $code = sprintf('writeFile($filename, $code); } } diff --git a/vendor/doctrine/cache/lib/Doctrine/Common/Cache/RedisCache.php b/vendor/doctrine/cache/lib/Doctrine/Common/Cache/RedisCache.php index 8d00a3b956..1643732a2c 100644 --- a/vendor/doctrine/cache/lib/Doctrine/Common/Cache/RedisCache.php +++ b/vendor/doctrine/cache/lib/Doctrine/Common/Cache/RedisCache.php @@ -126,6 +126,9 @@ class RedisCache extends CacheProvider */ protected function getSerializerValue() { + if (defined('HHVM_VERSION')) { + return Redis::SERIALIZER_PHP; + } return defined('Redis::SERIALIZER_IGBINARY') ? Redis::SERIALIZER_IGBINARY : Redis::SERIALIZER_PHP; } } diff --git a/vendor/doctrine/cache/lib/Doctrine/Common/Cache/XcacheCache.php b/vendor/doctrine/cache/lib/Doctrine/Common/Cache/XcacheCache.php index 833b02a89b..a2c4ca5662 100644 --- a/vendor/doctrine/cache/lib/Doctrine/Common/Cache/XcacheCache.php +++ b/vendor/doctrine/cache/lib/Doctrine/Common/Cache/XcacheCache.php @@ -71,7 +71,7 @@ class XcacheCache extends CacheProvider { $this->checkAuthorization(); - xcache_clear_cache(XC_TYPE_VAR, 0); + xcache_clear_cache(XC_TYPE_VAR); return true; } @@ -86,7 +86,10 @@ class XcacheCache extends CacheProvider protected function checkAuthorization() { if (ini_get('xcache.admin.enable_auth')) { - throw new \BadMethodCallException('To use all features of \Doctrine\Common\Cache\XcacheCache, you must set "xcache.admin.enable_auth" to "Off" in your php.ini.'); + throw new \BadMethodCallException( + 'To use all features of \Doctrine\Common\Cache\XcacheCache, ' + . 'you must set "xcache.admin.enable_auth" to "Off" in your php.ini.' + ); } } diff --git a/vendor/doctrine/cache/tests/Doctrine/Tests/Common/Cache/CacheTest.php b/vendor/doctrine/cache/tests/Doctrine/Tests/Common/Cache/CacheTest.php index 59ca4dc775..b089456e67 100644 --- a/vendor/doctrine/cache/tests/Doctrine/Tests/Common/Cache/CacheTest.php +++ b/vendor/doctrine/cache/tests/Doctrine/Tests/Common/Cache/CacheTest.php @@ -29,6 +29,57 @@ abstract class CacheTest extends \Doctrine\Tests\DoctrineTestCase $this->assertFalse($cache->contains('key')); } + public function testFetchMulti() + { + $cache = $this->_getCacheDriver(); + + // Test saving some values, checking if it exists, and fetching it back with multiGet + $this->assertTrue($cache->save('key1', 'value1')); + $this->assertTrue($cache->save('key2', 'value2')); + + $this->assertEquals( + array('key1' => 'value1', 'key2' => 'value2'), + $cache->fetchMultiple(array('key1', 'key2')) + ); + $this->assertEquals( + array('key1' => 'value1', 'key2' => 'value2'), + $cache->fetchMultiple(array('key1', 'key3', 'key2')) + ); + $this->assertEquals( + array('key1' => 'value1', 'key2' => 'value2'), + $cache->fetchMultiple(array('key1', 'key2', 'key3')) + ); + } + + public function testFetchMultiWillFilterNonRequestedKeys() + { + /* @var $cache \Doctrine\Common\Cache\CacheProvider|\PHPUnit_Framework_MockObject_MockObject */ + $cache = $this->getMockForAbstractClass( + 'Doctrine\Common\Cache\CacheProvider', + array(), + '', + true, + true, + true, + array('doFetchMultiple') + ); + + $cache + ->expects($this->once()) + ->method('doFetchMultiple') + ->will($this->returnValue(array( + '[foo][]' => 'bar', + '[bar][]' => 'baz', + '[baz][]' => 'tab', + ))); + + $this->assertEquals( + array('foo' => 'bar', 'bar' => 'baz'), + $cache->fetchMultiple(array('foo', 'bar')) + ); + } + + public function provideCrudValues() { return array( diff --git a/vendor/doctrine/cache/tests/Doctrine/Tests/Common/Cache/FileCacheTest.php b/vendor/doctrine/cache/tests/Doctrine/Tests/Common/Cache/FileCacheTest.php index 6f9df8158e..8868321419 100644 --- a/vendor/doctrine/cache/tests/Doctrine/Tests/Common/Cache/FileCacheTest.php +++ b/vendor/doctrine/cache/tests/Doctrine/Tests/Common/Cache/FileCacheTest.php @@ -2,6 +2,8 @@ namespace Doctrine\Tests\Common\Cache; +use Doctrine\Common\Cache\Cache; + /** * @group DCOM-101 */ @@ -25,16 +27,19 @@ class FileCacheTest extends \Doctrine\Tests\DoctrineTestCase { return array( //The characters :\/<>"*?| are not valid in Windows filenames. - array('key:1', 'key1'), - array('key\2', 'key2'), - array('key/3', 'key3'), - array('key<4', 'key4'), - array('key>5', 'key5'), - array('key"6', 'key6'), - array('key*7', 'key7'), - array('key?8', 'key8'), - array('key|9', 'key9'), - array('key[0]','key[0]'), + array('key:1', 'key-1'), + array('key\2', 'key-2'), + array('key/3', 'key-3'), + array('key<4', 'key-4'), + array('key>5', 'key-5'), + array('key"6', 'key-6'), + array('key*7', 'key-7'), + array('key?8', 'key-8'), + array('key|9', 'key-9'), + array('key[10]', 'key[10]'), + array('keyä11', 'key--11'), + array('../key12', '---key12'), + array('key-13', 'key__13'), ); } @@ -56,15 +61,19 @@ class FileCacheTest extends \Doctrine\Tests\DoctrineTestCase public function testFilenameCollision() { - $data['key:0'] = 'key0'; - $data['key\0'] = 'key0'; - $data['key/0'] = 'key0'; - $data['key<0'] = 'key0'; - $data['key>0'] = 'key0'; - $data['key"0'] = 'key0'; - $data['key*0'] = 'key0'; - $data['key?0'] = 'key0'; - $data['key|0'] = 'key0'; + $data = array( + 'key:0' => 'key-0', + 'key\0' => 'key-0', + 'key/0' => 'key-0', + 'key<0' => 'key-0', + 'key>0' => 'key-0', + 'key"0' => 'key-0', + 'key*0' => 'key-0', + 'key?0' => 'key-0', + 'key|0' => 'key-0', + 'key-0' => 'key__0', + 'keyä0' => 'key--0', + ); $paths = array(); $cache = $this->driver; @@ -88,10 +97,11 @@ class FileCacheTest extends \Doctrine\Tests\DoctrineTestCase $cache = $this->driver; $method = new \ReflectionMethod($cache, 'getFilename'); $key = 'item-key'; - $expectedDir[] = '84e0e2e893febb73'; - $expectedDir[] = '7a0fee0c89d53f4b'; - $expectedDir[] = 'b7fcb44c57cdf3d3'; - $expectedDir[] = '2ce7363f5d597760'; + $expectedDir = array( + '84', 'e0', 'e2', 'e8', '93', 'fe', 'bb', '73', '7a', '0f', 'ee', + '0c', '89', 'd5', '3f', '4b', 'b7', 'fc', 'b4', '4c', '57', 'cd', + 'f3', 'd3', '2c', 'e7', '36', '3f', '5d', '59', '77', '60' + ); $expectedDir = implode(DIRECTORY_SEPARATOR, $expectedDir); $method->setAccessible(true); @@ -100,8 +110,52 @@ class FileCacheTest extends \Doctrine\Tests\DoctrineTestCase $filename = pathinfo($path, PATHINFO_FILENAME); $dirname = pathinfo($path, PATHINFO_DIRNAME); - $this->assertEquals('item-key', $filename); + $this->assertEquals('item__key', $filename); $this->assertEquals(DIRECTORY_SEPARATOR . $expectedDir, $dirname); - $this->assertEquals(DIRECTORY_SEPARATOR . $expectedDir . DIRECTORY_SEPARATOR . $key, $path); + $this->assertEquals(DIRECTORY_SEPARATOR . $expectedDir . DIRECTORY_SEPARATOR . 'item__key', $path); + } + + public function testFileExtensionCorrectlyEscaped() + { + $driver1 = $this->getMock( + 'Doctrine\Common\Cache\FileCache', + array('doFetch', 'doContains', 'doSave'), + array(__DIR__, '.*') + ); + $driver2 = $this->getMock( + 'Doctrine\Common\Cache\FileCache', + array('doFetch', 'doContains', 'doSave'), + array(__DIR__, '.php') + ); + + $doGetStats = new \ReflectionMethod($driver1, 'doGetStats'); + + $doGetStats->setAccessible(true); + + $stats1 = $doGetStats->invoke($driver1); + $stats2 = $doGetStats->invoke($driver2); + + $this->assertSame(0, $stats1[Cache::STATS_MEMORY_USAGE]); + $this->assertGreaterThan(0, $stats2[Cache::STATS_MEMORY_USAGE]); + } + + /** + * @group DCOM-266 + */ + public function testFileExtensionSlashCorrectlyEscaped() + { + $driver = $this->getMock( + 'Doctrine\Common\Cache\FileCache', + array('doFetch', 'doContains', 'doSave'), + array(__DIR__ . '/../', '/' . basename(__FILE__)) + ); + + $doGetStats = new \ReflectionMethod($driver, 'doGetStats'); + + $doGetStats->setAccessible(true); + + $stats = $doGetStats->invoke($driver); + + $this->assertGreaterThan(0, $stats[Cache::STATS_MEMORY_USAGE]); } -} \ No newline at end of file +} diff --git a/vendor/monolog/monolog/CHANGELOG.mdown b/vendor/monolog/monolog/CHANGELOG.mdown index 4d45c6afbe..47042c73df 100644 --- a/vendor/monolog/monolog/CHANGELOG.mdown +++ b/vendor/monolog/monolog/CHANGELOG.mdown @@ -1,3 +1,17 @@ +### 1.12.0 (2014-12-29) + + * Break: HandlerInterface::isHandling now receives a partial record containing only a level key. This was always the intent and does not break any Monolog handler but is strictly speaking a BC break and you should check if you relied on any other field in your own handlers. + * Added PsrHandler to forward records to another PSR-3 logger + * Added SamplingHandler to wrap around a handler and include only every Nth record + * Added MongoDBFormatter to support better storage with MongoDBHandler (it must be enabled manually for now) + * Added exception codes in the output of most formatters + * Added LineFormatter::includeStacktraces to enable exception stack traces in logs (uses more than one line) + * Added $useShortAttachment to SlackHandler to minify attachment size and $includeExtra to append extra data + * Added $host to HipChatHandler for users of private instances + * Added $transactionName to NewRelicHandler and support for a transaction_name context value + * Fixed MandrillHandler to avoid outputing API call responses + * Fixed some non-standard behaviors in SyslogUdpHandler + ### 1.11.0 (2014-09-30) * Break: The NewRelicHandler extra and context data are now prefixed with extra_ and context_ to avoid clashes. Watch out if you have scripts reading those from the API and rely on names diff --git a/vendor/monolog/monolog/README.mdown b/vendor/monolog/monolog/README.mdown index 43d9bcfc9b..add476a836 100644 --- a/vendor/monolog/monolog/README.mdown +++ b/vendor/monolog/monolog/README.mdown @@ -20,6 +20,8 @@ Internally Monolog still uses its own level scheme since it predates PSR-3. Usage ----- +Install the latest version with `composer require monolog/monolog` + ```php setAdditional($this->contextPrefix . $key, is_scalar($val) ? $val : $this->toJson($val)); } - if (null === $message->getFile() && isset($record['context']['exception'])) { + if (null === $message->getFile() && isset($record['context']['exception']['file'])) { if (preg_match("/^(.+):([0-9]+)$/", $record['context']['exception']['file'], $matches)) { $message->setFile($matches[1]); $message->setLine($matches[2]); diff --git a/vendor/monolog/monolog/src/Monolog/Formatter/HtmlFormatter.php b/vendor/monolog/monolog/src/Monolog/Formatter/HtmlFormatter.php index f7d9bc4148..255d2887f7 100644 --- a/vendor/monolog/monolog/src/Monolog/Formatter/HtmlFormatter.php +++ b/vendor/monolog/monolog/src/Monolog/Formatter/HtmlFormatter.php @@ -72,7 +72,7 @@ class HtmlFormatter extends NormalizerFormatter { $title = htmlspecialchars($title, ENT_NOQUOTES, 'UTF-8'); - return '

      '.$title.'

      '; + return '

      '.$title.'

      '; } /** * Formats a log record. @@ -83,7 +83,7 @@ class HtmlFormatter extends NormalizerFormatter public function format(array $record) { $output = $this->addTitle($record['level_name'], $record['level']); - $output .= ''; + $output .= '
      '; $output .= $this->addRow('Message', (string) $record['message']); $output .= $this->addRow('Time', $record['datetime']->format($this->dateFormat)); diff --git a/vendor/monolog/monolog/src/Monolog/Formatter/JsonFormatter.php b/vendor/monolog/monolog/src/Monolog/Formatter/JsonFormatter.php index ac6f58c0de..7963dbf188 100644 --- a/vendor/monolog/monolog/src/Monolog/Formatter/JsonFormatter.php +++ b/vendor/monolog/monolog/src/Monolog/Formatter/JsonFormatter.php @@ -20,12 +20,12 @@ namespace Monolog\Formatter; */ class JsonFormatter implements FormatterInterface { - protected $batchMode; - protected $appendNewline; - const BATCH_MODE_JSON = 1; const BATCH_MODE_NEWLINES = 2; + protected $batchMode; + protected $appendNewline; + /** * @param int $batchMode */ diff --git a/vendor/monolog/monolog/src/Monolog/Formatter/LineFormatter.php b/vendor/monolog/monolog/src/Monolog/Formatter/LineFormatter.php index a21ba79dbe..6983d1a591 100644 --- a/vendor/monolog/monolog/src/Monolog/Formatter/LineFormatter.php +++ b/vendor/monolog/monolog/src/Monolog/Formatter/LineFormatter.php @@ -28,6 +28,7 @@ class LineFormatter extends NormalizerFormatter protected $format; protected $allowInlineLineBreaks; protected $ignoreEmptyContextAndExtra; + protected $includeStacktraces; /** * @param string $format The format of the message @@ -43,6 +44,24 @@ class LineFormatter extends NormalizerFormatter parent::__construct($dateFormat); } + public function includeStacktraces($include = true) + { + $this->includeStacktraces = $include; + if ($this->includeStacktraces) { + $this->allowInlineLineBreaks = true; + } + } + + public function allowInlineLineBreaks($allow = true) + { + $this->allowInlineLineBreaks = $allow; + } + + public function ignoreEmptyContextAndExtra($ignore = true) + { + $this->ignoreEmptyContextAndExtra = $ignore; + } + /** * {@inheritdoc} */ @@ -54,7 +73,7 @@ class LineFormatter extends NormalizerFormatter foreach ($vars['extra'] as $var => $val) { if (false !== strpos($output, '%extra.'.$var.'%')) { - $output = str_replace('%extra.'.$var.'%', $this->replaceNewlines($this->convertToString($val)), $output); + $output = str_replace('%extra.'.$var.'%', $this->stringify($val), $output); unset($vars['extra'][$var]); } } @@ -73,7 +92,7 @@ class LineFormatter extends NormalizerFormatter foreach ($vars as $var => $val) { if (false !== strpos($output, '%'.$var.'%')) { - $output = str_replace('%'.$var.'%', $this->replaceNewlines($this->convertToString($val)), $output); + $output = str_replace('%'.$var.'%', $this->stringify($val), $output); } } @@ -90,16 +109,26 @@ class LineFormatter extends NormalizerFormatter return $message; } + public function stringify($value) + { + return $this->replaceNewlines($this->convertToString($value)); + } + protected function normalizeException(Exception $e) { $previousText = ''; if ($previous = $e->getPrevious()) { do { - $previousText .= ', '.get_class($previous).': '.$previous->getMessage().' at '.$previous->getFile().':'.$previous->getLine(); + $previousText .= ', '.get_class($previous).'(code: '.$previous->getCode().'): '.$previous->getMessage().' at '.$previous->getFile().':'.$previous->getLine(); } while ($previous = $previous->getPrevious()); } - return '[object] ('.get_class($e).': '.$e->getMessage().' at '.$e->getFile().':'.$e->getLine().$previousText.')'; + $str = '[object] ('.get_class($e).'(code: '.$e->getCode().'): '.$e->getMessage().' at '.$e->getFile().':'.$e->getLine().$previousText.')'; + if ($this->includeStacktraces) { + $str .= "\n[stacktrace]\n".$e->getTraceAsString(); + } + + return $str; } protected function convertToString($data) diff --git a/vendor/monolog/monolog/src/Monolog/Formatter/NormalizerFormatter.php b/vendor/monolog/monolog/src/Monolog/Formatter/NormalizerFormatter.php index 95b3de36b3..beafea64a4 100644 --- a/vendor/monolog/monolog/src/Monolog/Formatter/NormalizerFormatter.php +++ b/vendor/monolog/monolog/src/Monolog/Formatter/NormalizerFormatter.php @@ -100,6 +100,7 @@ class NormalizerFormatter implements FormatterInterface $data = array( 'class' => get_class($e), 'message' => $e->getMessage(), + 'code' => $e->getCode(), 'file' => $e->getFile().':'.$e->getLine(), ); @@ -108,7 +109,8 @@ class NormalizerFormatter implements FormatterInterface if (isset($frame['file'])) { $data['trace'][] = $frame['file'].':'.$frame['line']; } else { - $data['trace'][] = json_encode($frame); + // We should again normalize the frames, because it might contain invalid items + $data['trace'][] = $this->toJson($this->normalize($frame), true); } } diff --git a/vendor/monolog/monolog/src/Monolog/Handler/ExceptionTestHandler.php b/vendor/monolog/monolog/src/Monolog/Handler/ExceptionTestHandler.php deleted file mode 100644 index f16db609a8..0000000000 --- a/vendor/monolog/monolog/src/Monolog/Handler/ExceptionTestHandler.php +++ /dev/null @@ -1,34 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog\Handler; - -use Monolog\Logger; - -/** - * Used for testing purposes. - * - * It records all records and gives you access to them for verification. It - * throws an exception from handle and handleBatch to test the - * WhatFailureGroupHandler Class. - * - * @author Craig D'Amelio - */ -class ExceptionTestHandler extends TestHandler -{ - /** - * {@inheritdoc} - */ - public function handle(array $record) { - $return = parent::handle($record); - throw new \Exception("ExceptionTestHandler::handle"); - } -} diff --git a/vendor/monolog/monolog/src/Monolog/Handler/FilterHandler.php b/vendor/monolog/monolog/src/Monolog/Handler/FilterHandler.php index dc81067672..dad8227396 100644 --- a/vendor/monolog/monolog/src/Monolog/Handler/FilterHandler.php +++ b/vendor/monolog/monolog/src/Monolog/Handler/FilterHandler.php @@ -55,6 +55,10 @@ class FilterHandler extends AbstractHandler $this->handler = $handler; $this->bubble = $bubble; $this->setAcceptedLevels($minLevelOrList, $maxLevel); + + if (!$this->handler instanceof HandlerInterface && !is_callable($this->handler)) { + throw new \RuntimeException("The given handler (".json_encode($this->handler).") is not a callable nor a Monolog\Handler\HandlerInterface object"); + } } /** @@ -102,12 +106,6 @@ class FilterHandler extends AbstractHandler // The same logic as in FingersCrossedHandler if (!$this->handler instanceof HandlerInterface) { - if (!is_callable($this->handler)) { - throw new \RuntimeException( - "The given handler (" . json_encode($this->handler) - . ") is not a callable nor a Monolog\\Handler\\HandlerInterface object" - ); - } $this->handler = call_user_func($this->handler, $record, $this); if (!$this->handler instanceof HandlerInterface) { throw new \RuntimeException("The factory callable should return a HandlerInterface"); diff --git a/vendor/monolog/monolog/src/Monolog/Handler/FingersCrossedHandler.php b/vendor/monolog/monolog/src/Monolog/Handler/FingersCrossedHandler.php index 981e524cee..a81c9e6487 100644 --- a/vendor/monolog/monolog/src/Monolog/Handler/FingersCrossedHandler.php +++ b/vendor/monolog/monolog/src/Monolog/Handler/FingersCrossedHandler.php @@ -62,6 +62,10 @@ class FingersCrossedHandler extends AbstractHandler $this->bubble = $bubble; $this->stopBuffering = $stopBuffering; $this->passthruLevel = $passthruLevel; + + if (!$this->handler instanceof HandlerInterface && !is_callable($this->handler)) { + throw new \RuntimeException("The given handler (".json_encode($this->handler).") is not a callable nor a Monolog\Handler\HandlerInterface object"); + } } /** @@ -93,9 +97,6 @@ class FingersCrossedHandler extends AbstractHandler $this->buffering = false; } if (!$this->handler instanceof HandlerInterface) { - if (!is_callable($this->handler)) { - throw new \RuntimeException("The given handler (".json_encode($this->handler).") is not a callable nor a Monolog\Handler\HandlerInterface object"); - } $this->handler = call_user_func($this->handler, $record, $this); if (!$this->handler instanceof HandlerInterface) { throw new \RuntimeException("The factory callable should return a HandlerInterface"); diff --git a/vendor/monolog/monolog/src/Monolog/Handler/HandlerInterface.php b/vendor/monolog/monolog/src/Monolog/Handler/HandlerInterface.php index accff037c1..d920c4ba04 100644 --- a/vendor/monolog/monolog/src/Monolog/Handler/HandlerInterface.php +++ b/vendor/monolog/monolog/src/Monolog/Handler/HandlerInterface.php @@ -29,7 +29,7 @@ interface HandlerInterface * is no guarantee that handle() will not be called, and isHandling() might not be called * for a given record. * - * @param array $record + * @param array $record Partial log record containing only a level key * * @return Boolean */ diff --git a/vendor/monolog/monolog/src/Monolog/Handler/HipChatHandler.php b/vendor/monolog/monolog/src/Monolog/Handler/HipChatHandler.php index 1fd3603569..29614d3163 100644 --- a/vendor/monolog/monolog/src/Monolog/Handler/HipChatHandler.php +++ b/vendor/monolog/monolog/src/Monolog/Handler/HipChatHandler.php @@ -71,14 +71,15 @@ class HipChatHandler extends SocketHandler * @param Boolean $bubble Whether the messages that are handled can bubble up the stack or not * @param Boolean $useSSL Whether to connect via SSL. * @param string $format The format of the messages (default to text, can be set to html if you have html in the messages) + * @param string $host The HipChat server hostname. */ - public function __construct($token, $room, $name = 'Monolog', $notify = false, $level = Logger::CRITICAL, $bubble = true, $useSSL = true, $format = 'text') + public function __construct($token, $room, $name = 'Monolog', $notify = false, $level = Logger::CRITICAL, $bubble = true, $useSSL = true, $format = 'text', $host = 'api.hipchat.com') { if (!$this->validateStringLength($name, static::MAXIMUM_NAME_LENGTH)) { throw new \InvalidArgumentException('The supplied name is too long. HipChat\'s v1 API supports names up to 15 UTF-8 characters.'); } - $connectionString = $useSSL ? 'ssl://api.hipchat.com:443' : 'api.hipchat.com:80'; + $connectionString = $useSSL ? 'ssl://'.$host.':443' : $host.':80'; parent::__construct($connectionString, $level, $bubble); $this->token = $token; diff --git a/vendor/monolog/monolog/src/Monolog/Handler/LogEntriesHandler.php b/vendor/monolog/monolog/src/Monolog/Handler/LogEntriesHandler.php index 18b3fa4f68..8bf388b39c 100644 --- a/vendor/monolog/monolog/src/Monolog/Handler/LogEntriesHandler.php +++ b/vendor/monolog/monolog/src/Monolog/Handler/LogEntriesHandler.php @@ -18,7 +18,6 @@ use Monolog\Logger; */ class LogEntriesHandler extends SocketHandler { - /** * @var string */ @@ -53,5 +52,4 @@ class LogEntriesHandler extends SocketHandler { return $this->logToken . ' ' . $record['formatted']; } - } diff --git a/vendor/monolog/monolog/src/Monolog/Handler/MandrillHandler.php b/vendor/monolog/monolog/src/Monolog/Handler/MandrillHandler.php index 6525a01d6d..60a2901ee3 100644 --- a/vendor/monolog/monolog/src/Monolog/Handler/MandrillHandler.php +++ b/vendor/monolog/monolog/src/Monolog/Handler/MandrillHandler.php @@ -56,6 +56,7 @@ class MandrillHandler extends MailHandler curl_setopt($ch, CURLOPT_URL, 'https://mandrillapp.com/api/1.0/messages/send-raw.json'); curl_setopt($ch, CURLOPT_POST, 1); + curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query(array( 'key' => $this->apiKey, 'raw_message' => (string) $message, diff --git a/vendor/monolog/monolog/src/Monolog/Handler/MissingExtensionException.php b/vendor/monolog/monolog/src/Monolog/Handler/MissingExtensionException.php index 0cb21cd227..4724a7e2d0 100644 --- a/vendor/monolog/monolog/src/Monolog/Handler/MissingExtensionException.php +++ b/vendor/monolog/monolog/src/Monolog/Handler/MissingExtensionException.php @@ -18,5 +18,4 @@ namespace Monolog\Handler; */ class MissingExtensionException extends \Exception { - } diff --git a/vendor/monolog/monolog/src/Monolog/Handler/NativeMailerHandler.php b/vendor/monolog/monolog/src/Monolog/Handler/NativeMailerHandler.php index 7605a14c60..0fe6b6420f 100644 --- a/vendor/monolog/monolog/src/Monolog/Handler/NativeMailerHandler.php +++ b/vendor/monolog/monolog/src/Monolog/Handler/NativeMailerHandler.php @@ -129,6 +129,10 @@ class NativeMailerHandler extends MailHandler */ public function setContentType($contentType) { + if (strpos($contentType, "\n") !== false || strpos($contentType, "\r") !== false) { + throw new \InvalidArgumentException('The content type can not contain newline characters to prevent email header injection'); + } + $this->contentType = $contentType; return $this; @@ -140,6 +144,10 @@ class NativeMailerHandler extends MailHandler */ public function setEncoding($encoding) { + if (strpos($encoding, "\n") !== false || strpos($encoding, "\r") !== false) { + throw new \InvalidArgumentException('The content type can not contain newline characters to prevent email header injection'); + } + $this->encoding = $encoding; return $this; diff --git a/vendor/monolog/monolog/src/Monolog/Handler/NewRelicHandler.php b/vendor/monolog/monolog/src/Monolog/Handler/NewRelicHandler.php index 052c407a3c..9807410df4 100644 --- a/vendor/monolog/monolog/src/Monolog/Handler/NewRelicHandler.php +++ b/vendor/monolog/monolog/src/Monolog/Handler/NewRelicHandler.php @@ -16,7 +16,7 @@ use Monolog\Logger; /** * Class to record a log on a NewRelic application * - * @see https://newrelic.com/docs/php/new-relic-for-php + * @see https://docs.newrelic.com/docs/agents/php-agent */ class NewRelicHandler extends AbstractProcessingHandler { @@ -27,16 +27,40 @@ class NewRelicHandler extends AbstractProcessingHandler */ protected $appName; + /** + * Name of the current transaction + * + * @var string + */ + protected $transactionName; + + /** + * Some context and extra data is passed into the handler as arrays of values. Do we send them as is + * (useful if we are using the API), or explode them for display on the NewRelic RPM website? + * + * @var boolean + */ + protected $explodeArrays; + /** * {@inheritDoc} * - * @param string $appName + * @param string $appName + * @param boolean $explodeArrays + * @param string $transactionName */ - public function __construct($level = Logger::ERROR, $bubble = true, $appName = null) - { + public function __construct( + $level = Logger::ERROR, + $bubble = true, + $appName = null, + $explodeArrays = false, + $transactionName = null + ) { parent::__construct($level, $bubble); - $this->appName = $appName; + $this->appName = $appName; + $this->explodeArrays = $explodeArrays; + $this->transactionName = $transactionName; } /** @@ -52,6 +76,11 @@ class NewRelicHandler extends AbstractProcessingHandler $this->setNewRelicAppName($appName); } + if ($transactionName = $this->getTransactionName($record['context'])) { + $this->setNewRelicTransactionName($transactionName); + unset($record['context']['transaction_name']); + } + if (isset($record['context']['exception']) && $record['context']['exception'] instanceof \Exception) { newrelic_notice_error($record['message'], $record['context']['exception']); unset($record['context']['exception']); @@ -60,11 +89,23 @@ class NewRelicHandler extends AbstractProcessingHandler } foreach ($record['context'] as $key => $parameter) { - newrelic_add_custom_parameter('context_' . $key, $parameter); + if (is_array($parameter) && $this->explodeArrays) { + foreach ($parameter as $paramKey => $paramValue) { + newrelic_add_custom_parameter('context_' . $key . '_' . $paramKey, $paramValue); + } + } else { + newrelic_add_custom_parameter('context_' . $key, $parameter); + } } foreach ($record['extra'] as $key => $parameter) { - newrelic_add_custom_parameter('extra_' . $key, $parameter); + if (is_array($parameter) && $this->explodeArrays) { + foreach ($parameter as $paramKey => $paramValue) { + newrelic_add_custom_parameter('extra_' . $key . '_' . $paramKey, $paramValue); + } + } else { + newrelic_add_custom_parameter('extra_' . $key, $parameter); + } } } @@ -80,7 +121,7 @@ class NewRelicHandler extends AbstractProcessingHandler /** * Returns the appname where this log should be sent. Each log can override the default appname, set in this - * handler's constructor, by providing the appname in its context. + * handler's constructor, by providing the appname in it's context. * * @param array $context * @return null|string @@ -94,6 +135,23 @@ class NewRelicHandler extends AbstractProcessingHandler return $this->appName; } + /** + * Returns the name of the current transaction. Each log can override the default transaction name, set in this + * handler's constructor, by providing the transaction_name in it's context + * + * @param array $context + * + * @return null|string + */ + protected function getTransactionName(array $context) + { + if (isset($context['transaction_name'])) { + return $context['transaction_name']; + } + + return $this->transactionName; + } + /** * Sets the NewRelic application that should receive this log. * @@ -103,4 +161,14 @@ class NewRelicHandler extends AbstractProcessingHandler { newrelic_set_appname($appName); } + + /** + * Overwrites the name of the current transaction + * + * @param $transactionName + */ + protected function setNewRelicTransactionName($transactionName) + { + newrelic_name_transaction($transactionName); + } } diff --git a/vendor/monolog/monolog/src/Monolog/Handler/PushoverHandler.php b/vendor/monolog/monolog/src/Monolog/Handler/PushoverHandler.php index 0dc2e27e44..cd2fcfa3d1 100644 --- a/vendor/monolog/monolog/src/Monolog/Handler/PushoverHandler.php +++ b/vendor/monolog/monolog/src/Monolog/Handler/PushoverHandler.php @@ -31,6 +31,27 @@ class PushoverHandler extends SocketHandler private $highPriorityLevel; private $emergencyLevel; + /** + * All parameters that can be sent to Pushover + * @see https://pushover.net/api + * @var array + */ + private $parameterNames = array( + 'token' => true, + 'user' => true, + 'message' => true, + 'device' => true, + 'title' => true, + 'url' => true, + 'url_title' => true, + 'priority' => true, + 'timestamp' => true, + 'sound' => true, + 'retry' => true, + 'expire' => true, + 'callback' => true, + ); + /** * Sounds the api supports by default * @see https://pushover.net/api#sounds @@ -101,10 +122,16 @@ class PushoverHandler extends SocketHandler $dataArray['priority'] = 1; } - if (isset($record['context']['sound']) && in_array($record['context']['sound'], $this->sounds)) { - $dataArray['sound'] = $record['context']['sound']; - } elseif (isset($record['extra']['sound']) && in_array($record['extra']['sound'], $this->sounds)) { - $dataArray['sound'] = $record['extra']['sound']; + // First determine the available parameters + $context = array_intersect_key($record['context'], $this->parameterNames); + $extra = array_intersect_key($record['extra'], $this->parameterNames); + + // Least important info should be merged with subsequent info + $dataArray = array_merge($extra, $context, $dataArray); + + // Only pass sounds that are supported by the API + if (isset($dataArray['sound']) && !in_array($dataArray['sound'], $this->sounds)) { + unset($dataArray['sound']); } return http_build_query($dataArray); diff --git a/vendor/monolog/monolog/src/Monolog/Handler/RavenHandler.php b/vendor/monolog/monolog/src/Monolog/Handler/RavenHandler.php index 2b32c321e0..f5743cd676 100644 --- a/vendor/monolog/monolog/src/Monolog/Handler/RavenHandler.php +++ b/vendor/monolog/monolog/src/Monolog/Handler/RavenHandler.php @@ -138,6 +138,12 @@ class RavenHandler extends AbstractProcessingHandler $options['tags'] = array_merge($options['tags'], $record['context']['tags']); unset($record['context']['tags']); } + if (!empty($record['context']['logger'])) { + $options['logger'] = $record['context']['logger']; + unset($record['context']['logger']); + } else { + $options['logger'] = $record['channel']; + } if (!empty($record['context'])) { $options['extra']['context'] = $record['context']; } diff --git a/vendor/monolog/monolog/src/Monolog/Handler/SlackHandler.php b/vendor/monolog/monolog/src/Monolog/Handler/SlackHandler.php index 2f2b6bd727..e3c8e11bf0 100644 --- a/vendor/monolog/monolog/src/Monolog/Handler/SlackHandler.php +++ b/vendor/monolog/monolog/src/Monolog/Handler/SlackHandler.php @@ -12,6 +12,7 @@ namespace Monolog\Handler; use Monolog\Logger; +use Monolog\Formatter\LineFormatter; /** * Sends notifications through Slack API @@ -51,6 +52,23 @@ class SlackHandler extends SocketHandler */ private $useAttachment; + /** + * Whether the the message that is added to Slack as attachment is in a short style (or not) + * @var bool + */ + private $useShortAttachment; + + /** + * Whether the attachment should include extra data (or not) + * @var bool + */ + private $includeExtra; + + /** + * @var LineFormatter + */ + private $lineFormatter; + /** * @param string $token Slack API token * @param string $channel Slack channel (encoded ID or name) @@ -60,7 +78,7 @@ class SlackHandler extends SocketHandler * @param int $level The minimum logging level at which this handler will be triggered * @param bool $bubble Whether the messages that are handled can bubble up the stack or not */ - public function __construct($token, $channel, $username = 'Monolog', $useAttachment = true, $iconEmoji = null, $level = Logger::CRITICAL, $bubble = true) + public function __construct($token, $channel, $username = 'Monolog', $useAttachment = true, $iconEmoji = null, $level = Logger::CRITICAL, $bubble = true, $useShortAttachment = false, $includeExtra = false) { if (!extension_loaded('openssl')) { throw new MissingExtensionException('The OpenSSL PHP extension is required to use the SlackHandler'); @@ -73,6 +91,11 @@ class SlackHandler extends SocketHandler $this->username = $username; $this->iconEmoji = trim($iconEmoji, ':'); $this->useAttachment = $useAttachment; + $this->useShortAttachment = $useShortAttachment; + $this->includeExtra = $includeExtra; + if ($this->includeExtra) { + $this->lineFormatter = new LineFormatter; + } } /** @@ -105,26 +128,50 @@ class SlackHandler extends SocketHandler ); if ($this->useAttachment) { - $dataArray['attachments'] = json_encode( - array( + $attachment = array( + 'fallback' => $record['message'], + 'color' => $this->getAttachmentColor($record['level']) + ); + + if ($this->useShortAttachment) { + $attachment['fields'] = array( array( - 'fallback' => $record['message'], - 'color' => $this->getAttachmentColor($record['level']), - 'fields' => array( - array( - 'title' => 'Message', - 'value' => $record['message'], - 'short' => false - ), - array( - 'title' => 'Level', - 'value' => $record['level_name'], - 'short' => true - ) - ) + 'title' => $record['level_name'], + 'value' => $record['message'], + 'short' => false ) - ) - ); + ); + } else { + $attachment['fields'] = array( + array( + 'title' => 'Message', + 'value' => $record['message'], + 'short' => false + ), + array( + 'title' => 'Level', + 'value' => $record['level_name'], + 'short' => true + ) + ); + } + + if ($this->includeExtra) { + $extra = ''; + foreach ($record['extra'] as $var => $val) { + $extra .= $var.': '.$this->lineFormatter->stringify($val)." | "; + } + + $extra = rtrim($extra, " |"); + + $attachment['fields'][] = array( + 'title' => "Extra", + 'value' => $extra, + 'short' => false + ); + } + + $dataArray['attachments'] = json_encode(array($attachment)); } else { $dataArray['text'] = $record['message']; } diff --git a/vendor/monolog/monolog/src/Monolog/Handler/SocketHandler.php b/vendor/monolog/monolog/src/Monolog/Handler/SocketHandler.php index 2b4d6d62e7..ee486f6923 100644 --- a/vendor/monolog/monolog/src/Monolog/Handler/SocketHandler.php +++ b/vendor/monolog/monolog/src/Monolog/Handler/SocketHandler.php @@ -281,5 +281,4 @@ class SocketHandler extends AbstractProcessingHandler throw new \RuntimeException("End-of-file reached, probably we got disconnected (sent $sent of $length)"); } } - } diff --git a/vendor/monolog/monolog/src/Monolog/Handler/StreamHandler.php b/vendor/monolog/monolog/src/Monolog/Handler/StreamHandler.php index 604774b440..7965db7480 100644 --- a/vendor/monolog/monolog/src/Monolog/Handler/StreamHandler.php +++ b/vendor/monolog/monolog/src/Monolog/Handler/StreamHandler.php @@ -35,7 +35,7 @@ class StreamHandler extends AbstractProcessingHandler * @param int|null $filePermission Optional file permissions (default (0644) are only for owner read/write) * @param Boolean $useLocking Try to lock log file before doing any writes * - * @throws InvalidArgumentException If stream is not a resource or string + * @throws \InvalidArgumentException If stream is not a resource or string */ public function __construct($stream, $level = Logger::DEBUG, $bubble = true, $filePermission = null, $useLocking = false) { diff --git a/vendor/monolog/monolog/src/Monolog/Handler/SyslogUdp/UdpSocket.php b/vendor/monolog/monolog/src/Monolog/Handler/SyslogUdp/UdpSocket.php index d87ab9d348..dcf3f1f92a 100644 --- a/vendor/monolog/monolog/src/Monolog/Handler/SyslogUdp/UdpSocket.php +++ b/vendor/monolog/monolog/src/Monolog/Handler/SyslogUdp/UdpSocket.php @@ -13,7 +13,7 @@ namespace Monolog\Handler\SyslogUdp; class UdpSocket { - const DATAGRAM_MAX_LENGTH = 2048; + const DATAGRAM_MAX_LENGTH = 65023; public function __construct($ip, $port = 514) { @@ -24,11 +24,7 @@ class UdpSocket public function write($line, $header = "") { - $remaining = $line; - while (!is_null($remaining)) { - list($chunk, $remaining) = $this->splitLineIfNessesary($remaining, $header); - $this->send($chunk); - } + $this->send($this->assembleMessage($line, $header)); } public function close() @@ -41,22 +37,10 @@ class UdpSocket socket_sendto($this->socket, $chunk, strlen($chunk), $flags = 0, $this->ip, $this->port); } - protected function splitLineIfNessesary($line, $header) + protected function assembleMessage($line, $header) { - if ($this->shouldSplitLine($line, $header)) { - $chunkSize = self::DATAGRAM_MAX_LENGTH - strlen($header); - $chunk = $header . substr($line, 0, $chunkSize); - $remaining = substr($line, $chunkSize); - } else { - $chunk = $header . $line; - $remaining = null; - } - - return array($chunk, $remaining); - } + $chunkSize = self::DATAGRAM_MAX_LENGTH - strlen($header); - protected function shouldSplitLine($remaining, $header) - { - return strlen($header.$remaining) > self::DATAGRAM_MAX_LENGTH; + return $header . substr($line, 0, $chunkSize); } } diff --git a/vendor/monolog/monolog/src/Monolog/Handler/SyslogUdpHandler.php b/vendor/monolog/monolog/src/Monolog/Handler/SyslogUdpHandler.php index 4aadffc548..aa047c07d1 100644 --- a/vendor/monolog/monolog/src/Monolog/Handler/SyslogUdpHandler.php +++ b/vendor/monolog/monolog/src/Monolog/Handler/SyslogUdpHandler.php @@ -63,11 +63,11 @@ class SyslogUdpHandler extends AbstractSyslogHandler /** * Make common syslog header (see rfc5424) */ - private function makeCommonSyslogHeader($severity) + protected function makeCommonSyslogHeader($severity) { $priority = $severity + $this->facility; - return "<$priority>: "; + return "<$priority>1 "; } /** diff --git a/vendor/monolog/monolog/src/Monolog/Handler/WhatFailureGroupHandler.php b/vendor/monolog/monolog/src/Monolog/Handler/WhatFailureGroupHandler.php index 187b34410b..05a8817316 100644 --- a/vendor/monolog/monolog/src/Monolog/Handler/WhatFailureGroupHandler.php +++ b/vendor/monolog/monolog/src/Monolog/Handler/WhatFailureGroupHandler.php @@ -12,7 +12,7 @@ namespace Monolog\Handler; /** - * Forwards records to multiple handlers suppressing failures of each handler + * Forwards records to multiple handlers suppressing failures of each handler * and continuing through to give every handler a chance to succeed. * * @author Craig D'Amelio diff --git a/vendor/monolog/monolog/src/Monolog/Logger.php b/vendor/monolog/monolog/src/Monolog/Logger.php index 2ece2894d9..4a38de7f2f 100644 --- a/vendor/monolog/monolog/src/Monolog/Logger.php +++ b/vendor/monolog/monolog/src/Monolog/Logger.php @@ -229,6 +229,21 @@ class Logger implements LoggerInterface $this->pushHandler(new StreamHandler('php://stderr', static::DEBUG)); } + $levelName = static::getLevelName($level); + + // check if any handler will handle this message so we can return early and save cycles + $handlerKey = null; + foreach ($this->handlers as $key => $handler) { + if ($handler->isHandling(array('level' => $level))) { + $handlerKey = $key; + break; + } + } + + if (null === $handlerKey) { + return false; + } + if (!static::$timezone) { static::$timezone = new \DateTimeZone(date_default_timezone_get() ?: 'UTC'); } @@ -237,25 +252,12 @@ class Logger implements LoggerInterface 'message' => (string) $message, 'context' => $context, 'level' => $level, - 'level_name' => static::getLevelName($level), + 'level_name' => $levelName, 'channel' => $this->name, 'datetime' => \DateTime::createFromFormat('U.u', sprintf('%.6F', microtime(true)), static::$timezone)->setTimezone(static::$timezone), 'extra' => array(), ); - // check if any handler will handle this message - $handlerKey = null; - foreach ($this->handlers as $key => $handler) { - if ($handler->isHandling($record)) { - $handlerKey = $key; - break; - } - } - // none found - if (null === $handlerKey) { - return false; - } - // found at least one, process message and dispatch it foreach ($this->processors as $processor) { $record = call_user_func($processor, $record); } @@ -472,7 +474,7 @@ class Logger implements LoggerInterface } /** - * Adds a log record at the INFO level. + * Adds a log record at the NOTICE level. * * This method allows for compatibility with common interfaces. * diff --git a/vendor/monolog/monolog/src/Monolog/Processor/MemoryProcessor.php b/vendor/monolog/monolog/src/Monolog/Processor/MemoryProcessor.php index 7e53f47018..0820def461 100644 --- a/vendor/monolog/monolog/src/Monolog/Processor/MemoryProcessor.php +++ b/vendor/monolog/monolog/src/Monolog/Processor/MemoryProcessor.php @@ -60,5 +60,4 @@ abstract class MemoryProcessor return $bytes . ' B'; } - } diff --git a/vendor/monolog/monolog/src/Monolog/Processor/WebProcessor.php b/vendor/monolog/monolog/src/Monolog/Processor/WebProcessor.php index 522c892a86..21f22a6e20 100644 --- a/vendor/monolog/monolog/src/Monolog/Processor/WebProcessor.php +++ b/vendor/monolog/monolog/src/Monolog/Processor/WebProcessor.php @@ -41,7 +41,7 @@ class WebProcessor public function __construct($serverData = null, array $extraFields = null) { if (null === $serverData) { - $this->serverData =& $_SERVER; + $this->serverData = &$_SERVER; } elseif (is_array($serverData) || $serverData instanceof \ArrayAccess) { $this->serverData = $serverData; } else { diff --git a/vendor/monolog/monolog/tests/Monolog/Formatter/GelfMessageFormatterTest.php b/vendor/monolog/monolog/tests/Monolog/Formatter/GelfMessageFormatterTest.php index d47ba91ccd..3f47a09afa 100644 --- a/vendor/monolog/monolog/tests/Monolog/Formatter/GelfMessageFormatterTest.php +++ b/vendor/monolog/monolog/tests/Monolog/Formatter/GelfMessageFormatterTest.php @@ -115,7 +115,6 @@ class GelfMessageFormatterTest extends \PHPUnit_Framework_TestCase $this->assertArrayHasKey('_CTXfrom', $message_array); $this->assertEquals('logger', $message_array['_CTXfrom']); - } /** @@ -144,7 +143,6 @@ class GelfMessageFormatterTest extends \PHPUnit_Framework_TestCase $this->assertEquals("/some/file/in/dir.php", $message->getFile()); $this->assertEquals("56", $message->getLine()); - } /** diff --git a/vendor/monolog/monolog/tests/Monolog/Formatter/JsonFormatterTest.php b/vendor/monolog/monolog/tests/Monolog/Formatter/JsonFormatterTest.php index d18c4763d5..69e2007747 100644 --- a/vendor/monolog/monolog/tests/Monolog/Formatter/JsonFormatterTest.php +++ b/vendor/monolog/monolog/tests/Monolog/Formatter/JsonFormatterTest.php @@ -65,7 +65,6 @@ class JsonFormatterTest extends TestCase */ public function testFormatBatchNewlines() { - $formatter = new JsonFormatter(JsonFormatter::BATCH_MODE_NEWLINES); $records = $expected = array( $this->getRecord(Logger::WARNING), diff --git a/vendor/monolog/monolog/tests/Monolog/Formatter/LineFormatterTest.php b/vendor/monolog/monolog/tests/Monolog/Formatter/LineFormatterTest.php index 45636c2bf8..89e1ca2e5f 100644 --- a/vendor/monolog/monolog/tests/Monolog/Formatter/LineFormatterTest.php +++ b/vendor/monolog/monolog/tests/Monolog/Formatter/LineFormatterTest.php @@ -120,7 +120,7 @@ class LineFormatterTest extends \PHPUnit_Framework_TestCase $path = str_replace('\\/', '/', json_encode(__FILE__)); - $this->assertEquals('['.date('Y-m-d').'] core.CRITICAL: foobar {"exception":"[object] (RuntimeException: Foo at '.substr($path, 1, -1).':'.(__LINE__-8).')"} []'."\n", $message); + $this->assertEquals('['.date('Y-m-d').'] core.CRITICAL: foobar {"exception":"[object] (RuntimeException(code: 0): Foo at '.substr($path, 1, -1).':'.(__LINE__-8).')"} []'."\n", $message); } public function testDefFormatWithPreviousException() @@ -138,7 +138,7 @@ class LineFormatterTest extends \PHPUnit_Framework_TestCase $path = str_replace('\\/', '/', json_encode(__FILE__)); - $this->assertEquals('['.date('Y-m-d').'] core.CRITICAL: foobar {"exception":"[object] (RuntimeException: Foo at '.substr($path, 1, -1).':'.(__LINE__-8).', LogicException: Wut? at '.substr($path, 1, -1).':'.(__LINE__-12).')"} []'."\n", $message); + $this->assertEquals('['.date('Y-m-d').'] core.CRITICAL: foobar {"exception":"[object] (RuntimeException(code: 0): Foo at '.substr($path, 1, -1).':'.(__LINE__-8).', LogicException(code: 0): Wut? at '.substr($path, 1, -1).':'.(__LINE__-12).')"} []'."\n", $message); } public function testBatchFormat() diff --git a/vendor/monolog/monolog/tests/Monolog/Formatter/LogstashFormatterTest.php b/vendor/monolog/monolog/tests/Monolog/Formatter/LogstashFormatterTest.php index 5776ab7215..de4a3c2c7c 100644 --- a/vendor/monolog/monolog/tests/Monolog/Formatter/LogstashFormatterTest.php +++ b/vendor/monolog/monolog/tests/Monolog/Formatter/LogstashFormatterTest.php @@ -15,7 +15,6 @@ use Monolog\Logger; class LogstashFormatterTest extends \PHPUnit_Framework_TestCase { - /** * @covers Monolog\Formatter\LogstashFormatter::format */ @@ -102,7 +101,6 @@ class LogstashFormatterTest extends \PHPUnit_Framework_TestCase $this->assertArrayHasKey('CTXfrom', $message_array); $this->assertEquals('logger', $message_array['CTXfrom']); - } /** @@ -239,7 +237,6 @@ class LogstashFormatterTest extends \PHPUnit_Framework_TestCase $this->assertArrayHasKey('CTXfrom', $message); $this->assertEquals('logger', $message['CTXfrom']); - } /** diff --git a/vendor/monolog/monolog/tests/Monolog/Formatter/NormalizerFormatterTest.php b/vendor/monolog/monolog/tests/Monolog/Formatter/NormalizerFormatterTest.php index 7477871284..00bbb2491e 100644 --- a/vendor/monolog/monolog/tests/Monolog/Formatter/NormalizerFormatterTest.php +++ b/vendor/monolog/monolog/tests/Monolog/Formatter/NormalizerFormatterTest.php @@ -66,7 +66,8 @@ class NormalizerFormatterTest extends \PHPUnit_Framework_TestCase 'exception' => array( 'class' => get_class($e2), 'message' => $e2->getMessage(), - 'file' => $e2->getFile().':'.$e2->getLine(), + 'code' => $e2->getCode(), + 'file' => $e2->getFile().':'.$e2->getLine(), ) ), $formatted); } @@ -166,6 +167,51 @@ class NormalizerFormatterTest extends \PHPUnit_Framework_TestCase $this->assertEquals(@json_encode(array($resource)), $res); } + + public function testExceptionTraceWithArgs() + { + if (defined('HHVM_VERSION')) { + $this->markTestSkipped('Not supported in HHVM since it detects errors differently'); + } + + // This happens i.e. in React promises or Guzzle streams where stream wrappers are registered + // and no file or line are included in the trace because it's treated as internal function + set_error_handler(function ($errno, $errstr, $errfile, $errline) { + throw new \ErrorException($errstr, 0, $errno, $errfile, $errline); + }); + + try { + // This will contain $resource and $wrappedResource as arguments in the trace item + $resource = fopen('php://memory', 'rw+'); + fwrite($resource, 'test_resource'); + $wrappedResource = new TestStreamFoo($resource); + // Just do something stupid with a resource/wrapped resource as argument + array_keys($wrappedResource); + } catch (\Exception $e) { + restore_error_handler(); + } + + $formatter = new NormalizerFormatter(); + $record = array('context' => array('exception' => $e)); + $result = $formatter->format($record); + + $this->assertRegExp( + '%"resource":"\[resource\]"%', + $result['context']['exception']['trace'][0] + ); + + if (version_compare(PHP_VERSION, '5.5.0', '>=')) { + $pattern = '%"wrappedResource":"\[object\] \(Monolog\\\\\\\\Formatter\\\\\\\\TestStreamFoo: \)"%'; + } else { + $pattern = '%\\\\"resource\\\\":null%'; + } + + // Tests that the wrapped resource is ignored while encoding, only works for PHP <= 5.4 + $this->assertRegExp( + $pattern, + $result['context']['exception']['trace'][0] + ); + } } class TestFooNorm @@ -180,3 +226,22 @@ class TestBarNorm return 'bar'; } } + +class TestStreamFoo +{ + public $foo; + public $resource; + + public function __construct($resource) + { + $this->resource = $resource; + $this->foo = 'BAR'; + } + + public function __toString() + { + fseek($this->resource, 0); + + return $this->foo . ' - ' . (string) stream_get_contents($this->resource); + } +} diff --git a/vendor/monolog/monolog/tests/Monolog/Formatter/ScalarFormatterTest.php b/vendor/monolog/monolog/tests/Monolog/Formatter/ScalarFormatterTest.php index b8cbb132b4..c5a4ebb5be 100644 --- a/vendor/monolog/monolog/tests/Monolog/Formatter/ScalarFormatterTest.php +++ b/vendor/monolog/monolog/tests/Monolog/Formatter/ScalarFormatterTest.php @@ -39,7 +39,7 @@ class ScalarFormatterTest extends \PHPUnit_Framework_TestCase 'foo' => 'string', 'bar' => 1, 'baz' => false, - 'bam' => array(1,2,3), + 'bam' => array(1, 2, 3), 'bat' => array('foo' => 'bar'), 'bap' => \DateTime::createFromFormat(\DateTime::ISO8601, '1970-01-01T00:00:00+0000'), 'ban' => $exception @@ -49,12 +49,13 @@ class ScalarFormatterTest extends \PHPUnit_Framework_TestCase 'foo' => 'string', 'bar' => 1, 'baz' => false, - 'bam' => $this->encodeJson(array(1,2,3)), + 'bam' => $this->encodeJson(array(1, 2, 3)), 'bat' => $this->encodeJson(array('foo' => 'bar')), 'bap' => '1970-01-01 00:00:00', 'ban' => $this->encodeJson(array( 'class' => get_class($exception), 'message' => $exception->getMessage(), + 'code' => $exception->getCode(), 'file' => $exception->getFile() . ':' . $exception->getLine(), 'trace' => $this->buildTrace($exception) )) @@ -87,6 +88,7 @@ class ScalarFormatterTest extends \PHPUnit_Framework_TestCase 'exception' => array( 'class' => get_class($exception), 'message' => $exception->getMessage(), + 'code' => $exception->getCode(), 'file' => $exception->getFile() . ':' . $exception->getLine(), 'trace' => $this->buildTrace($exception) ) diff --git a/vendor/monolog/monolog/tests/Monolog/Handler/BrowserConsoleHandlerTest.php b/vendor/monolog/monolog/tests/Monolog/Handler/BrowserConsoleHandlerTest.php index f3d8038c7f..ffb1d746af 100644 --- a/vendor/monolog/monolog/tests/Monolog/Handler/BrowserConsoleHandlerTest.php +++ b/vendor/monolog/monolog/tests/Monolog/Handler/BrowserConsoleHandlerTest.php @@ -64,7 +64,6 @@ EOF; $this->assertEquals($expected, $this->generateScript()); } - public function testAutolabel() { $handler = new BrowserConsoleHandler(); diff --git a/vendor/monolog/monolog/tests/Monolog/Handler/ErrorLogHandlerTest.php b/vendor/monolog/monolog/tests/Monolog/Handler/ErrorLogHandlerTest.php index 951dec9dcf..99785cbbb2 100644 --- a/vendor/monolog/monolog/tests/Monolog/Handler/ErrorLogHandlerTest.php +++ b/vendor/monolog/monolog/tests/Monolog/Handler/ErrorLogHandlerTest.php @@ -22,7 +22,6 @@ function error_log() class ErrorLogHandlerTest extends TestCase { - protected function setUp() { $GLOBALS['error_log'] = array(); diff --git a/vendor/monolog/monolog/tests/Monolog/Handler/FleepHookHandlerTest.php b/vendor/monolog/monolog/tests/Monolog/Handler/FleepHookHandlerTest.php index 14a4f0d472..91cdd31283 100644 --- a/vendor/monolog/monolog/tests/Monolog/Handler/FleepHookHandlerTest.php +++ b/vendor/monolog/monolog/tests/Monolog/Handler/FleepHookHandlerTest.php @@ -73,7 +73,6 @@ class FleepHookHandlerTest extends TestCase $actual = $handlerFormatter->format($record); $this->assertEquals($expected, $actual, 'Empty context and extra arrays should not be rendered'); - } /** @@ -83,5 +82,4 @@ class FleepHookHandlerTest extends TestCase { $this->assertEquals('ssl://' . FleepHookHandler::FLEEP_HOST . ':443', $this->handler->getConnectionString()); } - } diff --git a/vendor/monolog/monolog/tests/Monolog/Handler/GelfHandlerTest.php b/vendor/monolog/monolog/tests/Monolog/Handler/GelfHandlerTest.php index 83136875ce..8cdd64f441 100644 --- a/vendor/monolog/monolog/tests/Monolog/Handler/GelfHandlerTest.php +++ b/vendor/monolog/monolog/tests/Monolog/Handler/GelfHandlerTest.php @@ -65,7 +65,6 @@ class GelfHandlerTest extends TestCase $handler = $this->getHandler($messagePublisher); $handler->handle($record); - } public function testWarning() @@ -114,6 +113,5 @@ class GelfHandlerTest extends TestCase $handler = $this->getHandler($messagePublisher); $handler->setFormatter(new GelfMessageFormatter('mysystem', 'EXT', 'CTX')); $handler->handle($record); - } } diff --git a/vendor/monolog/monolog/tests/Monolog/Handler/HipChatHandlerTest.php b/vendor/monolog/monolog/tests/Monolog/Handler/HipChatHandlerTest.php index 8b9e4d4440..d58386a1b8 100644 --- a/vendor/monolog/monolog/tests/Monolog/Handler/HipChatHandlerTest.php +++ b/vendor/monolog/monolog/tests/Monolog/Handler/HipChatHandlerTest.php @@ -20,7 +20,6 @@ use Monolog\Logger; */ class HipChatHandlerTest extends TestCase { - private $res; private $handler; diff --git a/vendor/monolog/monolog/tests/Monolog/Handler/MongoDBHandlerTest.php b/vendor/monolog/monolog/tests/Monolog/Handler/MongoDBHandlerTest.php index 7f06d666ce..0fdef63aaf 100644 --- a/vendor/monolog/monolog/tests/Monolog/Handler/MongoDBHandlerTest.php +++ b/vendor/monolog/monolog/tests/Monolog/Handler/MongoDBHandlerTest.php @@ -58,6 +58,8 @@ class MongoDBHandlerTest extends TestCase if (!class_exists('Mongo')) { class Mongo { - public function selectCollection() {} + public function selectCollection() + { + } } } diff --git a/vendor/monolog/monolog/tests/Monolog/Handler/NativeMailerHandlerTest.php b/vendor/monolog/monolog/tests/Monolog/Handler/NativeMailerHandlerTest.php index 50ceace0f0..c2553ee45a 100644 --- a/vendor/monolog/monolog/tests/Monolog/Handler/NativeMailerHandlerTest.php +++ b/vendor/monolog/monolog/tests/Monolog/Handler/NativeMailerHandlerTest.php @@ -40,4 +40,22 @@ class NativeMailerHandlerTest extends TestCase $mailer = new NativeMailerHandler('spammer@example.org', 'dear victim', 'receiver@example.org'); $mailer->addHeader(array("Content-Type: text/html\r\nFrom: faked@attacker.org")); } + + /** + * @expectedException InvalidArgumentException + */ + public function testSetterContentTypeInjection() + { + $mailer = new NativeMailerHandler('spammer@example.org', 'dear victim', 'receiver@example.org'); + $mailer->setContentType("text/html\r\nFrom: faked@attacker.org"); + } + + /** + * @expectedException InvalidArgumentException + */ + public function testSetterEncodingInjection() + { + $mailer = new NativeMailerHandler('spammer@example.org', 'dear victim', 'receiver@example.org'); + $mailer->setEncoding("utf-8\r\nFrom: faked@attacker.org"); + } } diff --git a/vendor/monolog/monolog/tests/Monolog/Handler/NewRelicHandlerTest.php b/vendor/monolog/monolog/tests/Monolog/Handler/NewRelicHandlerTest.php index 73c2a53eb2..2201490857 100644 --- a/vendor/monolog/monolog/tests/Monolog/Handler/NewRelicHandlerTest.php +++ b/vendor/monolog/monolog/tests/Monolog/Handler/NewRelicHandlerTest.php @@ -18,11 +18,13 @@ class NewRelicHandlerTest extends TestCase { public static $appname; public static $customParameters; + public static $transactionName; public function setUp() { self::$appname = null; self::$customParameters = array(); + self::$transactionName = null; } /** @@ -47,6 +49,20 @@ class NewRelicHandlerTest extends TestCase $this->assertEquals(array('context_a' => 'b'), self::$customParameters); } + public function testThehandlerCanAddExplodedContextParamsToTheNewRelicTrace() + { + $handler = new StubNewRelicHandler(Logger::ERROR, true, self::$appname, true); + $handler->handle($this->getRecord( + Logger::ERROR, + 'log message', + array('a' => array('key1' => 'value1', 'key2' => 'value2')) + )); + $this->assertEquals( + array('context_a_key1' => 'value1', 'context_a_key2' => 'value2'), + self::$customParameters + ); + } + public function testThehandlerCanAddExtraParamsToTheNewRelicTrace() { $record = $this->getRecord(Logger::ERROR, 'log message'); @@ -58,6 +74,20 @@ class NewRelicHandlerTest extends TestCase $this->assertEquals(array('extra_c' => 'd'), self::$customParameters); } + public function testThehandlerCanAddExplodedExtraParamsToTheNewRelicTrace() + { + $record = $this->getRecord(Logger::ERROR, 'log message'); + $record['extra'] = array('c' => array('key1' => 'value1', 'key2' => 'value2')); + + $handler = new StubNewRelicHandler(Logger::ERROR, true, self::$appname, true); + $handler->handle($record); + + $this->assertEquals( + array('extra_c_key1' => 'value1', 'extra_c_key2' => 'value2'), + self::$customParameters + ); + } + public function testThehandlerCanAddExtraContextAndParamsToTheNewRelicTrace() { $record = $this->getRecord(Logger::ERROR, 'log message', array('a' => 'b')); @@ -97,6 +127,30 @@ class NewRelicHandlerTest extends TestCase $this->assertEquals('logAppName', self::$appname); } + + public function testTheTransactionNameIsNullByDefault() + { + $handler = new StubNewRelicHandler(); + $handler->handle($this->getRecord(Logger::ERROR, 'log message')); + + $this->assertEquals(null, self::$transactionName); + } + + public function testTheTransactionNameCanBeInjectedFromtheConstructor() + { + $handler = new StubNewRelicHandler(Logger::DEBUG, false, null, false, 'myTransaction'); + $handler->handle($this->getRecord(Logger::ERROR, 'log message')); + + $this->assertEquals('myTransaction', self::$transactionName); + } + + public function testTheTransactionNameCanBeOverriddenFromEachLog() + { + $handler = new StubNewRelicHandler(Logger::DEBUG, false, null, false, 'myTransaction'); + $handler->handle($this->getRecord(Logger::ERROR, 'log message', array('transaction_name' => 'logTransactName'))); + + $this->assertEquals('logTransactName', self::$transactionName); + } } class StubNewRelicHandlerWithoutExtension extends NewRelicHandler @@ -125,6 +179,11 @@ function newrelic_set_appname($appname) return NewRelicHandlerTest::$appname = $appname; } +function newrelic_name_transaction($transactionName) +{ + return NewRelicHandlerTest::$transactionName = $transactionName; +} + function newrelic_add_custom_parameter($key, $value) { NewRelicHandlerTest::$customParameters[$key] = $value; diff --git a/vendor/monolog/monolog/tests/Monolog/Handler/PushoverHandlerTest.php b/vendor/monolog/monolog/tests/Monolog/Handler/PushoverHandlerTest.php index e048a02a63..8940823680 100644 --- a/vendor/monolog/monolog/tests/Monolog/Handler/PushoverHandlerTest.php +++ b/vendor/monolog/monolog/tests/Monolog/Handler/PushoverHandlerTest.php @@ -22,7 +22,6 @@ use Monolog\Logger; */ class PushoverHandlerTest extends TestCase { - private $res; private $handler; diff --git a/vendor/monolog/monolog/tests/Monolog/Handler/SlackHandlerTest.php b/vendor/monolog/monolog/tests/Monolog/Handler/SlackHandlerTest.php index de1cfbcda6..d657fae319 100644 --- a/vendor/monolog/monolog/tests/Monolog/Handler/SlackHandlerTest.php +++ b/vendor/monolog/monolog/tests/Monolog/Handler/SlackHandlerTest.php @@ -56,7 +56,7 @@ class SlackHandlerTest extends TestCase $this->assertRegexp('/token=myToken&channel=channel1&username=Monolog&text=&attachments=.*$/', $content); } - + public function testWriteContentWithEmoji() { $this->createHandler('myToken', 'channel1', 'Monolog', true, 'alien'); @@ -104,9 +104,9 @@ class SlackHandlerTest extends TestCase ); } - private function createHandler($token = 'myToken', $channel = 'channel1', $username = 'Monolog', $useAttachment = true, $iconEmoji = null) + private function createHandler($token = 'myToken', $channel = 'channel1', $username = 'Monolog', $useAttachment = true, $iconEmoji = null, $useShortAttachment = false, $includeExtra = false) { - $constructorArgs = array($token, $channel, $username, $useAttachment, $iconEmoji, Logger::DEBUG, true); + $constructorArgs = array($token, $channel, $username, $useAttachment, $iconEmoji, Logger::DEBUG, true, $useShortAttachment, $includeExtra); $this->res = fopen('php://memory', 'a'); $this->handler = $this->getMock( '\Monolog\Handler\SlackHandler', diff --git a/vendor/monolog/monolog/tests/Monolog/Handler/SocketHandlerTest.php b/vendor/monolog/monolog/tests/Monolog/Handler/SocketHandlerTest.php index 3a925eb59d..2e3d504a2e 100644 --- a/vendor/monolog/monolog/tests/Monolog/Handler/SocketHandlerTest.php +++ b/vendor/monolog/monolog/tests/Monolog/Handler/SocketHandlerTest.php @@ -279,5 +279,4 @@ class SocketHandlerTest extends TestCase $this->handler->setFormatter($this->getIdentityFormatter()); } - } diff --git a/vendor/monolog/monolog/tests/Monolog/Handler/StreamHandlerTest.php b/vendor/monolog/monolog/tests/Monolog/Handler/StreamHandlerTest.php index cd26cb1ed5..44d3d9f12a 100644 --- a/vendor/monolog/monolog/tests/Monolog/Handler/StreamHandlerTest.php +++ b/vendor/monolog/monolog/tests/Monolog/Handler/StreamHandlerTest.php @@ -83,7 +83,7 @@ class StreamHandlerTest extends TestCase array(array('bogus://url')), ); } - + /** * @dataProvider invalidArgumentProvider * @expectedException InvalidArgumentException @@ -93,7 +93,7 @@ class StreamHandlerTest extends TestCase { $handler = new StreamHandler($invalidArgument); } - + /** * @expectedException UnexpectedValueException * @covers Monolog\Handler\StreamHandler::__construct diff --git a/vendor/monolog/monolog/tests/Monolog/Handler/SyslogHandlerTest.php b/vendor/monolog/monolog/tests/Monolog/Handler/SyslogHandlerTest.php index 98219ac12d..8f9e46bf10 100644 --- a/vendor/monolog/monolog/tests/Monolog/Handler/SyslogHandlerTest.php +++ b/vendor/monolog/monolog/tests/Monolog/Handler/SyslogHandlerTest.php @@ -10,6 +10,7 @@ */ namespace Monolog\Handler; + use Monolog\Logger; class SyslogHandlerTest extends \PHPUnit_Framework_TestCase diff --git a/vendor/monolog/monolog/tests/Monolog/Handler/SyslogUdpHandlerTest.php b/vendor/monolog/monolog/tests/Monolog/Handler/SyslogUdpHandlerTest.php index 8bd46b3a7c..497812b327 100644 --- a/vendor/monolog/monolog/tests/Monolog/Handler/SyslogUdpHandlerTest.php +++ b/vendor/monolog/monolog/tests/Monolog/Handler/SyslogUdpHandlerTest.php @@ -32,10 +32,10 @@ class SyslogUdpHandlerTest extends \PHPUnit_Framework_TestCase $socket = $this->getMock('\Monolog\Handler\SyslogUdp\UdpSocket', array('write'), array('lol', 'lol')); $socket->expects($this->at(0)) ->method('write') - ->with("lol", "<".(LOG_AUTHPRIV + LOG_WARNING).">: "); + ->with("lol", "<".(LOG_AUTHPRIV + LOG_WARNING).">1 "); $socket->expects($this->at(1)) ->method('write') - ->with("hej", "<".(LOG_AUTHPRIV + LOG_WARNING).">: "); + ->with("hej", "<".(LOG_AUTHPRIV + LOG_WARNING).">1 "); $handler->setSocket($socket); diff --git a/vendor/monolog/monolog/tests/Monolog/Handler/UdpSocketTest.php b/vendor/monolog/monolog/tests/Monolog/Handler/UdpSocketTest.php index b251974e5f..bcaf52b3ad 100644 --- a/vendor/monolog/monolog/tests/Monolog/Handler/UdpSocketTest.php +++ b/vendor/monolog/monolog/tests/Monolog/Handler/UdpSocketTest.php @@ -18,7 +18,7 @@ use Monolog\TestCase; */ class UdpSocketTest extends TestCase { - public function testWeDoNotSplitShortMessages() + public function testWeDoNotTruncateShortMessages() { $socket = $this->getMock('\Monolog\Handler\SyslogUdp\UdpSocket', array('send'), array('lol', 'lol')); @@ -29,29 +29,18 @@ class UdpSocketTest extends TestCase $socket->write("The quick brown fox jumps over the lazy dog", "HEADER: "); } - public function testWeSplitLongMessages() + public function testLongMessagesAreTruncated() { $socket = $this->getMock('\Monolog\Handler\SyslogUdp\UdpSocket', array('send'), array('lol', 'lol')); - $socket->expects($this->at(1)) - ->method('send') - ->with("The quick brown fox jumps over the lazy dog"); - - $aStringOfLength2048 = str_repeat("derp", 2048/4); - - $socket->write($aStringOfLength2048."The quick brown fox jumps over the lazy dog"); - } - - public function testAllSplitMessagesHasAHeader() - { - $socket = $this->getMock('\Monolog\Handler\SyslogUdp\UdpSocket', array('send'), array('lol', 'lol')); + $truncatedString = str_repeat("derp", 16254).'d'; - $socket->expects($this->exactly(5)) + $socket->expects($this->exactly(1)) ->method('send') - ->with($this->stringStartsWith("HEADER")); + ->with("HEADER" . $truncatedString); - $aStringOfLength8192 = str_repeat("derp", 2048); + $longString = str_repeat("derp", 20000); - $socket->write($aStringOfLength8192, "HEADER"); + $socket->write($longString, "HEADER"); } } diff --git a/vendor/monolog/monolog/tests/Monolog/Handler/WhatFailureGroupHandlerTest.php b/vendor/monolog/monolog/tests/Monolog/Handler/WhatFailureGroupHandlerTest.php index 29508afa2b..8d37a1fcc1 100644 --- a/vendor/monolog/monolog/tests/Monolog/Handler/WhatFailureGroupHandlerTest.php +++ b/vendor/monolog/monolog/tests/Monolog/Handler/WhatFailureGroupHandlerTest.php @@ -90,7 +90,8 @@ class WhatFailureGroupHandlerTest extends TestCase /** * @covers Monolog\Handler\WhatFailureGroupHandler::handle */ - public function testHandleException() { + public function testHandleException() + { $test = new TestHandler(); $exception = new ExceptionTestHandler(); $handler = new WhatFailureGroupHandler(array($exception, $test, $exception)); @@ -105,3 +106,16 @@ class WhatFailureGroupHandlerTest extends TestCase $this->assertTrue($records[0]['extra']['foo']); } } + +class ExceptionTestHandler extends TestHandler +{ + /** + * {@inheritdoc} + */ + public function handle(array $record) + { + parent::handle($record); + + throw new \Exception("ExceptionTestHandler::handle"); + } +} diff --git a/vendor/monolog/monolog/tests/Monolog/Processor/PsrLogMessageProcessorTest.php b/vendor/monolog/monolog/tests/Monolog/Processor/PsrLogMessageProcessorTest.php index 595e43826c..81bfbdc387 100644 --- a/vendor/monolog/monolog/tests/Monolog/Processor/PsrLogMessageProcessorTest.php +++ b/vendor/monolog/monolog/tests/Monolog/Processor/PsrLogMessageProcessorTest.php @@ -11,8 +11,6 @@ namespace Monolog\Processor; -use Monolog\Processor\PsrLogMessageProcessor; - class PsrLogMessageProcessorTest extends \PHPUnit_Framework_TestCase { /** diff --git a/vendor/sabre/vobject/ChangeLog.md b/vendor/sabre/vobject/ChangeLog.md index 6dcc337df3..ffaac27d17 100644 --- a/vendor/sabre/vobject/ChangeLog.md +++ b/vendor/sabre/vobject/ChangeLog.md @@ -1,6 +1,20 @@ ChangeLog ========= +3.3.5 (2015-01-09) +------------------ + +* #168: Expanding calendars now removes objects with recurrence rules that + don't have a valid recurrence instance. +* #177: SCHEDULE-STATUS should not contain a reason phrase, only a status + code. +* #175: Parser can now read and skip the UTF-8 BOM. +* #179: Added `isFloating` to `DATE-TIME` properties. +* #179: Fixed jCal serialization of floating `DATE-TIME` properties. +* #173: vCard converter failed for `X-ABDATE` properties that had no + `X-ABLABEL`. + + 3.3.4 (2014-11-19) ------------------ @@ -33,6 +47,7 @@ ChangeLog * Support for "Line Islands Standard Time" windows timezone. * #154: Correctly work around vCard parameters that have a value but no name. + 3.3.2 (2014-09-19) ------------------ @@ -54,6 +69,7 @@ ChangeLog declined earlier will no longer generate another reply. * #125: Send CANCEL messages when ORGANIZER property gets deleted. + 3.3.1 (2014-08-18) ------------------ @@ -119,6 +135,7 @@ ChangeLog 3.2.1 (2014-05-03) ------------------ + * Minor tweak to make the unittests run with the latest hhvm on travis. * Updated timezone definitions. * Updated copyright links to point to http://sabre.io/ @@ -152,14 +169,9 @@ ChangeLog disabled and an invalid file is read. -3.1.5 (2014-??-??) ------------------- -* Updated: Some docblocks and other documentation. Made the unittests succeed - on recent php versions. - - 3.1.4 (2014-03-30) ------------------ + * Fixed: Issue #87: Several compatibility fixes related to timezone handling changes in PHP 5.5.10. @@ -342,6 +354,12 @@ ChangeLog add() method. +2.1.6 (2014-12-10) +------------------ + +* Fixed: Minor change to make sure that unittests succeed on every PHP version. + + 2.1.5 (2014-06-03) ------------------ diff --git a/vendor/sabre/vobject/LICENSE b/vendor/sabre/vobject/LICENSE index 6e1e302e5c..29a5c788fa 100644 --- a/vendor/sabre/vobject/LICENSE +++ b/vendor/sabre/vobject/LICENSE @@ -1,4 +1,4 @@ -Copyright (C) 2007-2014 fruux GmbH (https://fruux.com/) +Copyright (C) 2011-2015 fruux GmbH (https://fruux.com/) All rights reserved. diff --git a/vendor/sabre/vobject/README.md b/vendor/sabre/vobject/README.md index f7497a40f8..b51c767655 100644 --- a/vendor/sabre/vobject/README.md +++ b/vendor/sabre/vobject/README.md @@ -12,6 +12,7 @@ Build status | branch | status | | ------ | ------ | | master | [![Build Status](https://travis-ci.org/fruux/sabre-vobject.png?branch=master)](https://travis-ci.org/fruux/sabre-vobject) | +| 3.3 | [![Build Status](https://travis-ci.org/fruux/sabre-vobject.png?branch=3.3)](https://travis-ci.org/fruux/sabre-vobject) | | 3.1 | [![Build Status](https://travis-ci.org/fruux/sabre-vobject.png?branch=3.1)](https://travis-ci.org/fruux/sabre-vobject) | | 2.1 | [![Build Status](https://travis-ci.org/fruux/sabre-vobject.png?branch=2.1)](https://travis-ci.org/fruux/sabre-vobject) | | 2.0 | [![Build Status](https://travis-ci.org/fruux/sabre-vobject.png?branch=2.0)](https://travis-ci.org/fruux/sabre-vobject) | diff --git a/vendor/sabre/vobject/lib/Cli.php b/vendor/sabre/vobject/lib/Cli.php index cac0763264..69cab8861c 100644 --- a/vendor/sabre/vobject/lib/Cli.php +++ b/vendor/sabre/vobject/lib/Cli.php @@ -8,7 +8,7 @@ use /** * This is the CLI interface for sabre-vobject. * - * @copyright Copyright (C) 2007-2014 fruux GmbH. All rights reserved. + * @copyright Copyright (C) 2011-2015 fruux GmbH (https://fruux.com/). * @author Evert Pot (http://evertpot.com/) * @license http://sabre.io/license/ Modified BSD License */ @@ -303,7 +303,7 @@ class Cli { $this->log($this->colorize('green', ' convert') . ' source_file [output_file] Converts a file.'); $this->log($this->colorize('green', ' color') . ' source_file Colorize a file, useful for debbugging.'); $this->log( -<<name = strtoupper($name); $this->root = $root; @@ -104,7 +104,7 @@ class Component extends Node { * * @return Node */ - public function add($a1, $a2 = null, $a3 = null) { + function add($a1, $a2 = null, $a3 = null) { if ($a1 instanceof Node) { if (!is_null($a2)) { @@ -145,7 +145,7 @@ class Component extends Node { * @param mixed $item * @return void */ - public function remove($item) { + function remove($item) { if (is_string($item)) { $children = $this->select($item); @@ -172,7 +172,7 @@ class Component extends Node { * * @return array */ - public function children() { + function children() { return $this->children; @@ -184,7 +184,7 @@ class Component extends Node { * * @return array */ - public function getComponents() { + function getComponents() { $result = array(); foreach($this->children as $child) { @@ -213,7 +213,7 @@ class Component extends Node { * @param string $name * @return array */ - public function select($name) { + function select($name) { $group = null; $name = strtoupper($name); @@ -250,7 +250,7 @@ class Component extends Node { * * @return string */ - public function serialize() { + function serialize() { $str = "BEGIN:" . $this->name . "\r\n"; @@ -324,7 +324,7 @@ class Component extends Node { * * @return array */ - public function jsonSerialize() { + function jsonSerialize() { $components = array(); $properties = array(); @@ -371,7 +371,7 @@ class Component extends Node { * @param string $name * @return Property */ - public function __get($name) { + function __get($name) { $matches = $this->select($name); if (count($matches)===0) { @@ -391,7 +391,7 @@ class Component extends Node { * @param string $name * @return bool */ - public function __isset($name) { + function __isset($name) { $matches = $this->select($name); return count($matches)>0; @@ -411,7 +411,7 @@ class Component extends Node { * @param mixed $value * @return void */ - public function __set($name, $value) { + function __set($name, $value) { $matches = $this->select($name); $overWrite = count($matches)?key($matches):null; @@ -441,7 +441,7 @@ class Component extends Node { * @param string $name * @return void */ - public function __unset($name) { + function __unset($name) { $matches = $this->select($name); foreach($matches as $k=>$child) { @@ -461,7 +461,7 @@ class Component extends Node { * * @return void */ - public function __clone() { + function __clone() { foreach($this->children as $key=>$child) { $this->children[$key] = clone $child; @@ -491,7 +491,7 @@ class Component extends Node { * * @var array */ - public function getValidationRules() { + function getValidationRules() { return array(); @@ -502,6 +502,8 @@ class Component extends Node { * * The following options are supported: * Node::REPAIR - May attempt to automatically repair the problem. + * Node::PROFILE_CARDDAV - Validate the vCard for CardDAV purposes. + * Node::PROFILE_CALDAV - Validate the iCalendar for CalDAV purposes. * * This method returns an array with detected problems. * Every element has the following properties: @@ -511,14 +513,14 @@ class Component extends Node { * * node - A reference to the problematic node. * * The level means: - * 1 - The issue was repaired (only happens if REPAIR was turned on) - * 2 - An inconsequential issue - * 3 - A severe issue. + * 1 - The issue was repaired (only happens if REPAIR was turned on). + * 2 - A warning. + * 3 - An error. * * @param int $options * @return array */ - public function validate($options = 0) { + function validate($options = 0) { $rules = $this->getValidationRules(); $defaults = $this->getDefaults(); diff --git a/vendor/sabre/vobject/lib/Component/VAlarm.php b/vendor/sabre/vobject/lib/Component/VAlarm.php index b9aaae100a..d626b5a7e5 100644 --- a/vendor/sabre/vobject/lib/Component/VAlarm.php +++ b/vendor/sabre/vobject/lib/Component/VAlarm.php @@ -8,7 +8,7 @@ use Sabre\VObject; * * This component contains some additional functionality specific for VALARMs. * - * @copyright Copyright (C) 2007-2014 fruux GmbH (https://fruux.com/). + * @copyright Copyright (C) 2011-2015 fruux GmbH (https://fruux.com/). * @author Evert Pot (http://evertpot.com/) * @license http://sabre.io/license/ Modified BSD License */ diff --git a/vendor/sabre/vobject/lib/Component/VCalendar.php b/vendor/sabre/vobject/lib/Component/VCalendar.php index 8704d332b4..9d17e20881 100644 --- a/vendor/sabre/vobject/lib/Component/VCalendar.php +++ b/vendor/sabre/vobject/lib/Component/VCalendar.php @@ -7,13 +7,14 @@ use DateTimeZone; use Sabre\VObject; use Sabre\VObject\Component; use Sabre\VObject\Recur\EventIterator; +use Sabre\VObject\Recur\NoInstancesException; /** * The VCalendar component * * This component adds functionality to a component, specific for a VCALENDAR. * - * @copyright Copyright (C) 2007-2014 fruux GmbH (https://fruux.com/). + * @copyright Copyright (C) 2011-2015 fruux GmbH (https://fruux.com/). * @author Evert Pot (http://evertpot.com/) * @license http://sabre.io/license/ Modified BSD License */ @@ -26,14 +27,14 @@ class VCalendar extends VObject\Document { * * @var string */ - static public $defaultName = 'VCALENDAR'; + static $defaultName = 'VCALENDAR'; /** * This is a list of components, and which classes they should map to. * * @var array */ - static public $componentMap = array( + static $componentMap = array( 'VALARM' => 'Sabre\\VObject\\Component\\VAlarm', 'VEVENT' => 'Sabre\\VObject\\Component\\VEvent', 'VFREEBUSY' => 'Sabre\\VObject\\Component\\VFreeBusy', @@ -47,7 +48,7 @@ class VCalendar extends VObject\Document { * * @var array */ - static public $valueMap = array( + static $valueMap = array( 'BINARY' => 'Sabre\\VObject\\Property\\Binary', 'BOOLEAN' => 'Sabre\\VObject\\Property\\Boolean', 'CAL-ADDRESS' => 'Sabre\\VObject\\Property\\ICalendar\\CalAddress', @@ -70,7 +71,7 @@ class VCalendar extends VObject\Document { * * @var array */ - static public $propertyMap = array( + static $propertyMap = array( // Calendar properties 'CALSCALE' => 'Sabre\\VObject\\Property\\FlatText', 'METHOD' => 'Sabre\\VObject\\Property\\FlatText', @@ -149,7 +150,7 @@ class VCalendar extends VObject\Document { * * @return void */ - public function getDocumentType() { + function getDocumentType() { return self::ICALENDAR20; @@ -165,7 +166,7 @@ class VCalendar extends VObject\Document { * @param string $componentName filter by component name * @return VObject\Component[] */ - public function getBaseComponents($componentName = null) { + function getBaseComponents($componentName = null) { $components = array(); foreach($this->children as $component) { @@ -199,7 +200,7 @@ class VCalendar extends VObject\Document { * @param string $componentName filter by component name * @return VObject\Component|null */ - public function getBaseComponent($componentName = null) { + function getBaseComponent($componentName = null) { foreach($this->children as $component) { @@ -244,7 +245,7 @@ class VCalendar extends VObject\Document { * times. * @return void */ - public function expand(DateTime $start, DateTime $end, DateTimeZone $timeZone = null) { + function expand(DateTime $start, DateTime $end, DateTimeZone $timeZone = null) { $newEvents = array(); @@ -268,12 +269,22 @@ class VCalendar extends VObject\Document { continue; } + + $uid = (string)$vevent->uid; if (!$uid) { throw new \LogicException('Event did not have a UID!'); } - $it = new EventIterator($this, $vevent->uid, $timeZone); + try { + $it = new EventIterator($this, $vevent->uid, $timeZone); + } catch (NoInstancesException $e) { + // This event is recurring, but it doesn't have a single + // instance. We are skipping this event from the output + // entirely. + unset($this->children[$key]); + continue; + } $it->fastForward($start); while($it->valid() && $it->getDTStart() < $end) { @@ -286,6 +297,7 @@ class VCalendar extends VObject\Document { $it->next(); } + unset($this->children[$key]); } @@ -343,7 +355,7 @@ class VCalendar extends VObject\Document { * * @var array */ - public function getValidationRules() { + function getValidationRules() { return array( 'PRODID' => 1, @@ -357,16 +369,28 @@ class VCalendar extends VObject\Document { /** * Validates the node for correctness. - * An array is returned with warnings. * - * Every item in the array has the following properties: - * * level - (number between 1 and 3 with severity information) - * * message - (human readable message) - * * node - (reference to the offending node) + * The following options are supported: + * Node::REPAIR - May attempt to automatically repair the problem. + * Node::PROFILE_CARDDAV - Validate the vCard for CardDAV purposes. + * Node::PROFILE_CALDAV - Validate the iCalendar for CalDAV purposes. + * + * This method returns an array with detected problems. + * Every element has the following properties: + * + * * level - problem level. + * * message - A human-readable string describing the issue. + * * node - A reference to the problematic node. + * + * The level means: + * 1 - The issue was repaired (only happens if REPAIR was turned on). + * 2 - A warning. + * 3 - An error. * + * @param int $options * @return array */ - public function validate($options = 0) { + function validate($options = 0) { $warnings = parent::validate($options); @@ -384,6 +408,9 @@ class VCalendar extends VObject\Document { $uidList = array(); $componentsFound = 0; + + $componentTypes = array(); + foreach($this->children as $child) { if($child instanceof Component) { $componentsFound++; @@ -391,6 +418,7 @@ class VCalendar extends VObject\Document { if (!in_array($child->name, array('VEVENT', 'VTODO', 'VJOURNAL'))) { continue; } + $componentTypes[] = $child->name; $uid = (string)$child->UID; $isMaster = isset($child->{'RECURRENCE-ID'})?0:1; @@ -422,6 +450,38 @@ class VCalendar extends VObject\Document { ); } + if ($options & self::PROFILE_CALDAV) { + if (count($uidList)>1) { + $warnings[] = array( + 'level' => 3, + 'message' => 'A calendar object on a CalDAV server may only have components with the same UID.', + 'node' => $this, + ); + } + if (count(array_unique($componentTypes))===0) { + $warnings[] = array( + 'level' => 3, + 'message' => 'A calendar object on a CalDAV server must have at least 1 component (VTODO, VEVENT, VJOURNAL).', + 'node' => $this, + ); + } + if (count(array_unique($componentTypes))>1) { + $warnings[] = array( + 'level' => 3, + 'message' => 'A calendar object on a CalDAV server may only have 1 type of component (VEVENT, VTODO or VJOURNAL).', + 'node' => $this, + ); + } + + if (isset($this->METHOD)) { + $warnings[] = array( + 'level' => 3, + 'message' => 'A calendar object on a CalDAV server MUST NOT have a METHOD property.', + 'node' => $this, + ); + } + } + return $warnings; } diff --git a/vendor/sabre/vobject/lib/Component/VCard.php b/vendor/sabre/vobject/lib/Component/VCard.php index 632ddc3d0b..e46880139e 100644 --- a/vendor/sabre/vobject/lib/Component/VCard.php +++ b/vendor/sabre/vobject/lib/Component/VCard.php @@ -11,7 +11,7 @@ use * This component represents the BEGIN:VCARD and END:VCARD found in every * vcard. * - * @copyright Copyright (C) 2007-2014 fruux GmbH (https://fruux.com/). + * @copyright Copyright (C) 2011-2015 fruux GmbH (https://fruux.com/). * @author Evert Pot (http://evertpot.com/) * @license http://sabre.io/license/ Modified BSD License */ @@ -24,7 +24,7 @@ class VCard extends VObject\Document { * * @var string */ - static public $defaultName = 'VCARD'; + static $defaultName = 'VCARD'; /** * Caching the version number @@ -38,7 +38,7 @@ class VCard extends VObject\Document { * * @var array */ - static public $valueMap = array( + static $valueMap = array( 'BINARY' => 'Sabre\\VObject\\Property\\Binary', 'BOOLEAN' => 'Sabre\\VObject\\Property\\Boolean', 'CONTENT-ID' => 'Sabre\\VObject\\Property\\FlatText', // vCard 2.1 only @@ -62,7 +62,7 @@ class VCard extends VObject\Document { * * @var array */ - static public $propertyMap = array( + static $propertyMap = array( // vCard 2.1 properties and up 'N' => 'Sabre\\VObject\\Property\\Text', @@ -131,7 +131,7 @@ class VCard extends VObject\Document { * * @return void */ - public function getDocumentType() { + function getDocumentType() { if (!$this->version) { $version = (string)$this->VERSION; @@ -169,7 +169,7 @@ class VCard extends VObject\Document { * @param int $target * @return VCard */ - public function convert($target) { + function convert($target) { $converter = new VObject\VCardConverter(); return $converter->convert($this, $target); @@ -204,7 +204,7 @@ class VCard extends VObject\Document { * @param int $options * @return array */ - public function validate($options = 0) { + function validate($options = 0) { $warnings = array(); @@ -227,8 +227,37 @@ class VCard extends VObject\Document { $this->VERSION = $versionMap[self::DEFAULT_VERSION]; } } + if ($version === '2.1' && ($options & self::PROFILE_CARDDAV)) { + $warnings[] = array( + 'level' => 3, + 'message' => 'CardDAV servers are not allowed to accept vCard 2.1.', + 'node' => $this, + ); + } } + $uid = $this->select('UID'); + if (count($uid) === 0) { + if ($options & self::PROFILE_CARDDAV) { + // Required for CardDAV + $warningLevel = 3; + $message = 'vCards on CardDAV servers MUST have a UID property.'; + } else { + // Not required for regular vcards + $warningLevel = 2; + $message = 'Adding a UID to a vCard property is recommended.'; + } + if ($options & self::REPAIR) { + $this->UID = VObject\UUIDUtil::getUUID(); + $warningLevel = 1; + } + $warnings[] = array( + 'level' => $warningLevel, + 'message' => $message, + 'node' => $this, + ); + } + $fn = $this->select('FN'); if (count($fn)!==1) { @@ -280,7 +309,7 @@ class VCard extends VObject\Document { * * @var array */ - public function getValidationRules() { + function getValidationRules() { return array( 'ADR' => '*', @@ -322,16 +351,7 @@ class VCard extends VObject\Document { // validate function, which may also try to repair it. // 'FN' => '+', - // vcard actually specifies this as '?', but in most cases not - // having a UID is highly undesirable. So here we're going against - // the spec and make it required. - // - // I would be interested to hear if this is problematic for - // anyone, or at least a usecase where this is undesirable. - // - // If so, I may have to add a facility that allows us to check - // specifically for validity in the context of 'DAV'. - 'UID' => '1', + 'UID' => '?', ); } @@ -349,7 +369,7 @@ class VCard extends VObject\Document { * @param string $fieldName * @return VObject\Property|null */ - public function preferred($propertyName) { + function preferred($propertyName) { $preferred = null; $lastPref = 101; @@ -392,7 +412,7 @@ class VCard extends VObject\Document { * * @return array */ - public function jsonSerialize() { + function jsonSerialize() { // A vcard does not have sub-components, so we're overriding this // method to remove that array element. @@ -415,7 +435,7 @@ class VCard extends VObject\Document { * @param string $propertyName * @return string */ - public function getClassNameForPropertyName($propertyName) { + function getClassNameForPropertyName($propertyName) { $className = parent::getClassNameForPropertyName($propertyName); // In vCard 4, BINARY no longer exists, and we need URI instead. diff --git a/vendor/sabre/vobject/lib/Component/VEvent.php b/vendor/sabre/vobject/lib/Component/VEvent.php index 6ab6ee8290..c3f1dda8dd 100644 --- a/vendor/sabre/vobject/lib/Component/VEvent.php +++ b/vendor/sabre/vobject/lib/Component/VEvent.php @@ -10,7 +10,7 @@ use Sabre\VObject\Recur\EventIterator; * * This component contains some additional functionality specific for VEVENT's. * - * @copyright Copyright (C) 2007-2014 fruux GmbH (https://fruux.com/). + * @copyright Copyright (C) 2011-2015 fruux GmbH (https://fruux.com/). * @author Evert Pot (http://evertpot.com/) * @license http://sabre.io/license/ Modified BSD License */ diff --git a/vendor/sabre/vobject/lib/Component/VFreeBusy.php b/vendor/sabre/vobject/lib/Component/VFreeBusy.php index 358b8fac50..5f7c0e4c1a 100644 --- a/vendor/sabre/vobject/lib/Component/VFreeBusy.php +++ b/vendor/sabre/vobject/lib/Component/VFreeBusy.php @@ -10,7 +10,7 @@ use Sabre\VObject; * This component adds functionality to a component, specific for VFREEBUSY * components. * - * @copyright Copyright (C) 2007-2014 fruux GmbH (https://fruux.com/). + * @copyright Copyright (C) 2011-2015 fruux GmbH (https://fruux.com/). * @author Evert Pot (http://evertpot.com/) * @license http://sabre.io/license/ Modified BSD License */ diff --git a/vendor/sabre/vobject/lib/Component/VJournal.php b/vendor/sabre/vobject/lib/Component/VJournal.php index f8dd89f536..957ec71501 100644 --- a/vendor/sabre/vobject/lib/Component/VJournal.php +++ b/vendor/sabre/vobject/lib/Component/VJournal.php @@ -9,7 +9,7 @@ use Sabre\VObject; * * This component contains some additional functionality specific for VJOURNALs. * - * @copyright Copyright (C) 2007-2014 fruux GmbH (https://fruux.com/). + * @copyright Copyright (C) 2011-2015 fruux GmbH (https://fruux.com/). * @author Evert Pot (http://evertpot.com/) * @license http://sabre.io/license/ Modified BSD License */ diff --git a/vendor/sabre/vobject/lib/Component/VTimeZone.php b/vendor/sabre/vobject/lib/Component/VTimeZone.php index 6c3be7bbec..dc0d9c6a8b 100644 --- a/vendor/sabre/vobject/lib/Component/VTimeZone.php +++ b/vendor/sabre/vobject/lib/Component/VTimeZone.php @@ -10,7 +10,7 @@ use Sabre\VObject; * This component adds functionality to a component, specific for VTIMEZONE * components. * - * @copyright Copyright (C) 2007-2014 fruux GmbH (https://fruux.com/). + * @copyright Copyright (C) 2011-2015 fruux GmbH (https://fruux.com/). * @author Evert Pot (http://evertpot.com/) * @license http://sabre.io/license/ Modified BSD License */ diff --git a/vendor/sabre/vobject/lib/Component/VTodo.php b/vendor/sabre/vobject/lib/Component/VTodo.php index 654cd68c82..11e05dd879 100644 --- a/vendor/sabre/vobject/lib/Component/VTodo.php +++ b/vendor/sabre/vobject/lib/Component/VTodo.php @@ -9,7 +9,7 @@ use Sabre\VObject; * * This component contains some additional functionality specific for VTODOs. * - * @copyright Copyright (C) 2007-2014 fruux GmbH (https://fruux.com/). + * @copyright Copyright (C) 2011-2015 fruux GmbH (https://fruux.com/). * @author Evert Pot (http://evertpot.com/) * @license http://sabre.io/license/ Modified BSD License */ diff --git a/vendor/sabre/vobject/lib/DateTimeParser.php b/vendor/sabre/vobject/lib/DateTimeParser.php index 88a7982949..c67857563d 100644 --- a/vendor/sabre/vobject/lib/DateTimeParser.php +++ b/vendor/sabre/vobject/lib/DateTimeParser.php @@ -14,7 +14,7 @@ use LogicException; * This class is responsible for parsing the several different date and time * formats iCalendar and vCards have. * - * @copyright Copyright (C) 2007-2014 fruux GmbH (https://fruux.com/). + * @copyright Copyright (C) 2011-2015 fruux GmbH (https://fruux.com/). * @author Evert Pot (http://evertpot.com/) * @license http://sabre.io/license/ Modified BSD License */ diff --git a/vendor/sabre/vobject/lib/Document.php b/vendor/sabre/vobject/lib/Document.php index 78d209d03b..393612342c 100644 --- a/vendor/sabre/vobject/lib/Document.php +++ b/vendor/sabre/vobject/lib/Document.php @@ -12,7 +12,7 @@ namespace Sabre\VObject; * * This class also provides a registry for document types. * - * @copyright Copyright (C) 2007-2014 fruux GmbH. All rights reserved. + * @copyright Copyright (C) 2011-2015 fruux GmbH (https://fruux.com/). * @author Evert Pot (http://evertpot.com/) * @license http://sabre.io/license/ Modified BSD License */ diff --git a/vendor/sabre/vobject/lib/ElementList.php b/vendor/sabre/vobject/lib/ElementList.php index d0c4ed8f52..cfe8fc8716 100644 --- a/vendor/sabre/vobject/lib/ElementList.php +++ b/vendor/sabre/vobject/lib/ElementList.php @@ -8,7 +8,7 @@ namespace Sabre\VObject; * This class represents a list of elements. Lists are the result of queries, * such as doing $vcalendar->vevent where there's multiple VEVENT objects. * - * @copyright Copyright (C) 2007-2014 fruux GmbH (https://fruux.com/). + * @copyright Copyright (C) 2011-2015 fruux GmbH (https://fruux.com/). * @author Evert Pot (http://evertpot.com/) * @license http://sabre.io/license/ Modified BSD License */ diff --git a/vendor/sabre/vobject/lib/EofException.php b/vendor/sabre/vobject/lib/EofException.php index bc784b3146..4e24b35ce0 100644 --- a/vendor/sabre/vobject/lib/EofException.php +++ b/vendor/sabre/vobject/lib/EofException.php @@ -6,7 +6,7 @@ namespace Sabre\VObject; * Exception thrown by parser when the end of the stream has been reached, * before this was expected. * - * @copyright Copyright (C) 2007-2014 fruux GmbH (https://fruux.com/). + * @copyright Copyright (C) 2011-2015 fruux GmbH (https://fruux.com/). * @author Evert Pot (http://evertpot.com/) * @license http://sabre.io/license/ Modified BSD License */ diff --git a/vendor/sabre/vobject/lib/FreeBusyGenerator.php b/vendor/sabre/vobject/lib/FreeBusyGenerator.php index ef6e72a511..406e62a583 100644 --- a/vendor/sabre/vobject/lib/FreeBusyGenerator.php +++ b/vendor/sabre/vobject/lib/FreeBusyGenerator.php @@ -16,7 +16,7 @@ use Sabre\VObject\Recur\EventIterator; * VFREEBUSY components are described in RFC5545, The rules for what should * go in a single freebusy report is taken from RFC4791, section 7.10. * - * @copyright Copyright (C) 2007-2014 fruux GmbH (https://fruux.com/). + * @copyright Copyright (C) 2011-2015 fruux GmbH (https://fruux.com/). * @author Evert Pot (http://evertpot.com/) * @license http://sabre.io/license/ Modified BSD License */ diff --git a/vendor/sabre/vobject/lib/ITip/Broker.php b/vendor/sabre/vobject/lib/ITip/Broker.php index a256756d60..aefe9fb79e 100644 --- a/vendor/sabre/vobject/lib/ITip/Broker.php +++ b/vendor/sabre/vobject/lib/ITip/Broker.php @@ -31,7 +31,7 @@ use Sabre\VObject\Recur\EventIterator; * 6. It can process a reply from an invite and update an events attendee * status based on a reply. * - * @copyright Copyright (C) 2007-2014 fruux GmbH. All rights reserved. + * @copyright Copyright (C) 2011-2015 fruux GmbH (https://fruux.com/). * @author Evert Pot (http://evertpot.com/) * @license http://sabre.io/license/ Modified BSD License */ @@ -341,7 +341,7 @@ class Broker { return null; } $instances = array(); - $requestStatus = '2.0;Success'; + $requestStatus = '2.0'; // Finding all the instances the attendee replied to. foreach($itipMessage->message->VEVENT as $vevent) { @@ -350,6 +350,7 @@ class Broker { $instances[$recurId] = $attendee['PARTSTAT']->getValue(); if (isset($vevent->{'REQUEST-STATUS'})) { $requestStatus = $vevent->{'REQUEST-STATUS'}->getValue(); + list($requestStatus) = explode(';', $requestStatus); } } diff --git a/vendor/sabre/vobject/lib/ITip/ITipException.php b/vendor/sabre/vobject/lib/ITip/ITipException.php index 2efe563814..2596fe0ee5 100644 --- a/vendor/sabre/vobject/lib/ITip/ITipException.php +++ b/vendor/sabre/vobject/lib/ITip/ITipException.php @@ -7,7 +7,7 @@ use Exception; /** * This message is emitted in case of serious problems with iTip messages. * - * @copyright Copyright (C) 2007-2014 fruux GmbH. All rights reserved. + * @copyright Copyright (C) 2011-2015 fruux GmbH (https://fruux.com/). * @author Evert Pot (http://evertpot.com/) * @license http://sabre.io/license/ Modified BSD License */ diff --git a/vendor/sabre/vobject/lib/ITip/Message.php b/vendor/sabre/vobject/lib/ITip/Message.php index 9c55b2529a..0b18af6a09 100644 --- a/vendor/sabre/vobject/lib/ITip/Message.php +++ b/vendor/sabre/vobject/lib/ITip/Message.php @@ -10,7 +10,7 @@ namespace Sabre\VObject\ITip; * * It should for the most part be treated as immutable. * - * @copyright Copyright (C) 2007-2014 fruux GmbH. All rights reserved. + * @copyright Copyright (C) 2011-2015 fruux GmbH (https://fruux.com/). * @author Evert Pot (http://evertpot.com/) * @license http://sabre.io/license/ Modified BSD License */ diff --git a/vendor/sabre/vobject/lib/ITip/SameOrganizerForAllComponentsException.php b/vendor/sabre/vobject/lib/ITip/SameOrganizerForAllComponentsException.php index 1b201886c3..759d1ca8c8 100644 --- a/vendor/sabre/vobject/lib/ITip/SameOrganizerForAllComponentsException.php +++ b/vendor/sabre/vobject/lib/ITip/SameOrganizerForAllComponentsException.php @@ -9,7 +9,7 @@ namespace Sabre\VObject\ITip; * component (e.g.: exceptions), but the organizer is not identical in every * component. * - * @copyright Copyright (C) 2007-2014 fruux GmbH. All rights reserved. + * @copyright Copyright (C) 2011-2015 fruux GmbH (https://fruux.com/). * @author Evert Pot (http://evertpot.com/) * @license http://sabre.io/license/ Modified BSD License */ diff --git a/vendor/sabre/vobject/lib/Node.php b/vendor/sabre/vobject/lib/Node.php index 29bae61786..77d3dc69d7 100644 --- a/vendor/sabre/vobject/lib/Node.php +++ b/vendor/sabre/vobject/lib/Node.php @@ -5,7 +5,7 @@ namespace Sabre\VObject; /** * A node is the root class for every element in an iCalendar of vCard object. * - * @copyright Copyright (C) 2007-2014 fruux GmbH. All rights reserved. + * @copyright Copyright (C) 2011-2015 fruux GmbH (https://fruux.com/). * @author Evert Pot (http://evertpot.com/) * @license http://sabre.io/license/ Modified BSD License */ @@ -13,9 +13,30 @@ abstract class Node implements \IteratorAggregate, \ArrayAccess, \Countable { /** * The following constants are used by the validate() method. + * + * If REPAIR is set, the validator will attempt to repair any broken data + * (if possible). */ const REPAIR = 1; + /** + * If this option is set, the validator will operate on the vcards on the + * assumption that the vcards need to be valid for CardDAV. + * + * This means for example that the UID is required, whereas it is not for + * regular vcards. + */ + const PROFILE_CARDDAV = 2; + + /** + * If this option is set, the validator will operate on iCalendar objects + * on the assumption that the vcards need to be valid for CalDAV. + * + * This means for example that calendars can only contain objects with + * identical component types and UIDs. + */ + const PROFILE_CALDAV = 4; + /** * Reference to the parent object, if this is not the top object. * diff --git a/vendor/sabre/vobject/lib/Parameter.php b/vendor/sabre/vobject/lib/Parameter.php index f13bcd06ae..ab4261afb0 100644 --- a/vendor/sabre/vobject/lib/Parameter.php +++ b/vendor/sabre/vobject/lib/Parameter.php @@ -13,7 +13,7 @@ use * DTSTART;VALUE=DATE:20101108 * VALUE=DATE would be the parameter name and value. * - * @copyright Copyright (C) 2007-2014 fruux GmbH (https://fruux.com/). + * @copyright Copyright (C) 2011-2015 fruux GmbH (https://fruux.com/). * @author Evert Pot (http://evertpot.com/) * @license http://sabre.io/license/ Modified BSD License */ diff --git a/vendor/sabre/vobject/lib/ParseException.php b/vendor/sabre/vobject/lib/ParseException.php index f6d03cf39c..0327d108c6 100644 --- a/vendor/sabre/vobject/lib/ParseException.php +++ b/vendor/sabre/vobject/lib/ParseException.php @@ -5,7 +5,7 @@ namespace Sabre\VObject; /** * Exception thrown by Reader if an invalid object was attempted to be parsed. * - * @copyright Copyright (C) 2007-2014 fruux GmbH (https://fruux.com/). + * @copyright Copyright (C) 2011-2015 fruux GmbH (https://fruux.com/). * @author Evert Pot (http://evertpot.com/) * @license http://sabre.io/license/ Modified BSD License */ diff --git a/vendor/sabre/vobject/lib/Parser/Json.php b/vendor/sabre/vobject/lib/Parser/Json.php index 646d60177b..742cda054b 100644 --- a/vendor/sabre/vobject/lib/Parser/Json.php +++ b/vendor/sabre/vobject/lib/Parser/Json.php @@ -13,7 +13,7 @@ use * * This parser parses both the jCal and jCard formats. * - * @copyright Copyright (C) 2007-2014 fruux GmbH. All rights reserved. + * @copyright Copyright (C) 2011-2015 fruux GmbH (https://fruux.com/). * @author Evert Pot (http://evertpot.com/) * @license http://sabre.io/license/ Modified BSD License */ diff --git a/vendor/sabre/vobject/lib/Parser/MimeDir.php b/vendor/sabre/vobject/lib/Parser/MimeDir.php index 8dd2e63511..1b87374390 100644 --- a/vendor/sabre/vobject/lib/Parser/MimeDir.php +++ b/vendor/sabre/vobject/lib/Parser/MimeDir.php @@ -13,11 +13,13 @@ use /** * MimeDir parser. * - * This class parses iCalendar/vCard files and returns an array. + * This class parses iCalendar 2.0 and vCard 2.1, 3.0 and 4.0 files. This + * parser will return one of the following two objects from the parse method: * - * The array is identical to the format jCard/jCal use. + * Sabre\VObject\Component\VCalendar + * Sabre\VObject\Component\VCard * - * @copyright Copyright (C) 2007-2014 fruux GmbH. All rights reserved. + * @copyright Copyright (C) 2011-2015 fruux GmbH (https://fruux.com/). * @author Evert Pot (http://evertpot.com/) * @license http://sabre.io/license/ Modified BSD License */ @@ -98,6 +100,16 @@ class MimeDir extends Parser { protected function parseDocument() { $line = $this->readLine(); + + // BOM is ZERO WIDTH NO-BREAK SPACE (U+FEFF). + // It's 0xEF 0xBB 0xBF in UTF-8 hex. + if ( 3 <= strlen($line) + && ord($line[0]) === 0xef + && ord($line[1]) === 0xbb + && ord($line[2]) === 0xbf) { + $line = substr($line, 3); + } + switch(strtoupper($line)) { case 'BEGIN:VCALENDAR' : $class = isset(VCalendar::$componentMap['VCALENDAR']) diff --git a/vendor/sabre/vobject/lib/Parser/Parser.php b/vendor/sabre/vobject/lib/Parser/Parser.php index cbe0e4b32a..7624094d70 100644 --- a/vendor/sabre/vobject/lib/Parser/Parser.php +++ b/vendor/sabre/vobject/lib/Parser/Parser.php @@ -7,7 +7,7 @@ namespace Sabre\VObject\Parser; * * This class serves as a base-class for the different parsers. * - * @copyright Copyright (C) 2007-2014 fruux GmbH. All rights reserved. + * @copyright Copyright (C) 2011-2015 fruux GmbH (https://fruux.com/). * @author Evert Pot (http://evertpot.com/) * @license http://sabre.io/license/ Modified BSD License */ diff --git a/vendor/sabre/vobject/lib/Property.php b/vendor/sabre/vobject/lib/Property.php index 079837fb83..3e6704c4aa 100644 --- a/vendor/sabre/vobject/lib/Property.php +++ b/vendor/sabre/vobject/lib/Property.php @@ -8,7 +8,7 @@ namespace Sabre\VObject; * A property is always in a KEY:VALUE structure, and may optionally contain * parameters. * - * @copyright Copyright (C) 2007-2014 fruux GmbH. All rights reserved. + * @copyright Copyright (C) 2011-2015 fruux GmbH (https://fruux.com/). * @author Evert Pot (http://evertpot.com/) * @license http://sabre.io/license/ Modified BSD License */ diff --git a/vendor/sabre/vobject/lib/Property/Binary.php b/vendor/sabre/vobject/lib/Property/Binary.php index 7fdd99056f..41bfaf8191 100644 --- a/vendor/sabre/vobject/lib/Property/Binary.php +++ b/vendor/sabre/vobject/lib/Property/Binary.php @@ -16,7 +16,7 @@ use * * This property will transparently encode and decode to base64. * - * @copyright Copyright (C) 2007-2014 fruux GmbH. All rights reserved. + * @copyright Copyright (C) 2011-2015 fruux GmbH (https://fruux.com/). * @author Evert Pot (http://evertpot.com/) * @license http://sabre.io/license/ Modified BSD License */ diff --git a/vendor/sabre/vobject/lib/Property/Boolean.php b/vendor/sabre/vobject/lib/Property/Boolean.php index 7ef2aa1f53..262468c10c 100644 --- a/vendor/sabre/vobject/lib/Property/Boolean.php +++ b/vendor/sabre/vobject/lib/Property/Boolean.php @@ -13,7 +13,7 @@ use * * Automatic conversion to PHP's true and false are done. * - * @copyright Copyright (C) 2007-2014 fruux GmbH. All rights reserved. + * @copyright Copyright (C) 2011-2015 fruux GmbH (https://fruux.com/). * @author Evert Pot (http://evertpot.com/) * @license http://sabre.io/license/ Modified BSD License */ diff --git a/vendor/sabre/vobject/lib/Property/FlatText.php b/vendor/sabre/vobject/lib/Property/FlatText.php index 00044fad3e..146969c767 100644 --- a/vendor/sabre/vobject/lib/Property/FlatText.php +++ b/vendor/sabre/vobject/lib/Property/FlatText.php @@ -18,7 +18,7 @@ namespace Sabre\VObject\Property; * vCard 4.0 states something similar. An unescaped semi-colon _may_ be a * delimiter, depending on the property. * - * @copyright Copyright (C) 2007-2014 fruux GmbH. All rights reserved. + * @copyright Copyright (C) 2011-2015 fruux GmbH (https://fruux.com/). * @author Evert Pot (http://evertpot.com/) * @license http://sabre.io/license/ Modified BSD License */ diff --git a/vendor/sabre/vobject/lib/Property/Float.php b/vendor/sabre/vobject/lib/Property/Float.php index 5b1f17e9aa..25bcd3db25 100644 --- a/vendor/sabre/vobject/lib/Property/Float.php +++ b/vendor/sabre/vobject/lib/Property/Float.php @@ -11,7 +11,7 @@ use * This object represents FLOAT values. These can be 1 or more floating-point * numbers. * - * @copyright Copyright (C) 2007-2014 fruux GmbH. All rights reserved. + * @copyright Copyright (C) 2011-2015 fruux GmbH (https://fruux.com/). * @author Evert Pot (http://evertpot.com/) * @license http://sabre.io/license/ Modified BSD License */ diff --git a/vendor/sabre/vobject/lib/Property/ICalendar/CalAddress.php b/vendor/sabre/vobject/lib/Property/ICalendar/CalAddress.php index f0eb639f3a..b7c47ce819 100644 --- a/vendor/sabre/vobject/lib/Property/ICalendar/CalAddress.php +++ b/vendor/sabre/vobject/lib/Property/ICalendar/CalAddress.php @@ -10,7 +10,7 @@ use * * This object encodes CAL-ADDRESS values, as defined in rfc5545 * - * @copyright Copyright (C) 2007-2014 fruux GmbH. All rights reserved. + * @copyright Copyright (C) 2011-2015 fruux GmbH (https://fruux.com/). * @author Evert Pot (http://evertpot.com/) * @license http://sabre.io/license/ Modified BSD License */ diff --git a/vendor/sabre/vobject/lib/Property/ICalendar/Date.php b/vendor/sabre/vobject/lib/Property/ICalendar/Date.php index 85c6676b62..1a238e94bc 100644 --- a/vendor/sabre/vobject/lib/Property/ICalendar/Date.php +++ b/vendor/sabre/vobject/lib/Property/ICalendar/Date.php @@ -9,7 +9,7 @@ namespace Sabre\VObject\Property\ICalendar; * * http://tools.ietf.org/html/rfc5545#section-3.3.5 * - * @copyright Copyright (C) 2007-2014 fruux GmbH. All rights reserved. + * @copyright Copyright (C) 2011-2015 fruux GmbH (https://fruux.com/). * @author Evert Pot (http://evertpot.com/) * @license http://sabre.io/license/ Modified BSD License */ diff --git a/vendor/sabre/vobject/lib/Property/ICalendar/DateTime.php b/vendor/sabre/vobject/lib/Property/ICalendar/DateTime.php index 5e7eb59aa3..47dc34b73f 100644 --- a/vendor/sabre/vobject/lib/Property/ICalendar/DateTime.php +++ b/vendor/sabre/vobject/lib/Property/ICalendar/DateTime.php @@ -4,7 +4,6 @@ namespace Sabre\VObject\Property\ICalendar; use DateTimeZone; use Sabre\VObject\Property; -use Sabre\VObject\Parser\MimeDir; use Sabre\VObject\DateTimeParser; use Sabre\VObject\TimeZoneUtil; @@ -19,7 +18,7 @@ use Sabre\VObject\TimeZoneUtil; * cases represent a DATE value. This is because it's a common usecase to be * able to change a DATE-TIME into a DATE. * - * @copyright Copyright (C) 2007-2014 fruux GmbH. All rights reserved. + * @copyright Copyright (C) 2011-2015 fruux GmbH (https://fruux.com/). * @author Evert Pot (http://evertpot.com/) * @license http://sabre.io/license/ Modified BSD License */ @@ -110,6 +109,22 @@ class DateTime extends Property { } + /** + * Returns true if this is a floating DATE or DATE-TIME. + * + * Note that DATE is always floating. + */ + public function isFloating() { + + return + !$this->hasTime() || + ( + !isset($this['TZID']) && + strpos($this->getValue(),'Z')===false + ); + + } + /** * Returns a date-time value. * @@ -259,9 +274,10 @@ class DateTime extends Property { $dts = $this->getDateTimes(); $hasTime = $this->hasTime(); + $isFloating = $this->isFloating(); $tz = $dts[0]->getTimeZone(); - $isUtc = in_array($tz->getName() , array('UTC', 'GMT', 'Z')); + $isUtc = $isFloating ? false : in_array($tz->getName() , array('UTC', 'GMT', 'Z')); return array_map( function($dt) use ($hasTime, $isUtc) { diff --git a/vendor/sabre/vobject/lib/Property/ICalendar/Duration.php b/vendor/sabre/vobject/lib/Property/ICalendar/Duration.php index 05f14208ad..c2988f14c7 100644 --- a/vendor/sabre/vobject/lib/Property/ICalendar/Duration.php +++ b/vendor/sabre/vobject/lib/Property/ICalendar/Duration.php @@ -14,7 +14,7 @@ use * * http://tools.ietf.org/html/rfc5545#section-3.3.6 * - * @copyright Copyright (C) 2007-2014 fruux GmbH. All rights reserved. + * @copyright Copyright (C) 2011-2015 fruux GmbH (https://fruux.com/). * @author Evert Pot (http://evertpot.com/) * @license http://sabre.io/license/ Modified BSD License */ diff --git a/vendor/sabre/vobject/lib/Property/ICalendar/Period.php b/vendor/sabre/vobject/lib/Property/ICalendar/Period.php index 1acd6d63ce..fb9bf07f7f 100644 --- a/vendor/sabre/vobject/lib/Property/ICalendar/Period.php +++ b/vendor/sabre/vobject/lib/Property/ICalendar/Period.php @@ -14,7 +14,7 @@ use * * http://tools.ietf.org/html/rfc5545#section-3.8.2.6 * - * @copyright Copyright (C) 2007-2014 fruux GmbH. All rights reserved. + * @copyright Copyright (C) 2011-2015 fruux GmbH (https://fruux.com/). * @author Evert Pot (http://evertpot.com/) * @license http://sabre.io/license/ Modified BSD License */ diff --git a/vendor/sabre/vobject/lib/Property/ICalendar/Recur.php b/vendor/sabre/vobject/lib/Property/ICalendar/Recur.php index 2df095f5fc..1cce5023d2 100644 --- a/vendor/sabre/vobject/lib/Property/ICalendar/Recur.php +++ b/vendor/sabre/vobject/lib/Property/ICalendar/Recur.php @@ -19,7 +19,7 @@ use * This property exposes this as a key=>value array that is accessible using * getParts, and may be set using setParts. * - * @copyright Copyright (C) 2007-2014 fruux GmbH. All rights reserved. + * @copyright Copyright (C) 2011-2015 fruux GmbH (https://fruux.com/). * @author Evert Pot (http://evertpot.com/) * @license http://sabre.io/license/ Modified BSD License */ diff --git a/vendor/sabre/vobject/lib/Property/Integer.php b/vendor/sabre/vobject/lib/Property/Integer.php index fbcee709bd..db000156f3 100644 --- a/vendor/sabre/vobject/lib/Property/Integer.php +++ b/vendor/sabre/vobject/lib/Property/Integer.php @@ -11,7 +11,7 @@ use * This object represents INTEGER values. These are always a single integer. * They may be preceeded by either + or -. * - * @copyright Copyright (C) 2007-2014 fruux GmbH. All rights reserved. + * @copyright Copyright (C) 2011-2015 fruux GmbH (https://fruux.com/). * @author Evert Pot (http://evertpot.com/) * @license http://sabre.io/license/ Modified BSD License */ diff --git a/vendor/sabre/vobject/lib/Property/Text.php b/vendor/sabre/vobject/lib/Property/Text.php index 3cfa84f217..f23dc860f3 100644 --- a/vendor/sabre/vobject/lib/Property/Text.php +++ b/vendor/sabre/vobject/lib/Property/Text.php @@ -13,7 +13,7 @@ use * * This object represents TEXT values. * - * @copyright Copyright (C) 2007-2014 fruux GmbH. All rights reserved. + * @copyright Copyright (C) 2011-2015 fruux GmbH (https://fruux.com/). * @author Evert Pot (http://evertpot.com/) * @license http://sabre.io/license/ Modified BSD License */ diff --git a/vendor/sabre/vobject/lib/Property/Time.php b/vendor/sabre/vobject/lib/Property/Time.php index a271dcee10..fa19f973f2 100644 --- a/vendor/sabre/vobject/lib/Property/Time.php +++ b/vendor/sabre/vobject/lib/Property/Time.php @@ -9,7 +9,7 @@ use Sabre\VObject\DateTimeParser; * * This object encodes TIME values. * - * @copyright Copyright (C) 2007-2014 fruux GmbH. All rights reserved. + * @copyright Copyright (C) 2011-2015 fruux GmbH (https://fruux.com/). * @author Evert Pot (http://evertpot.com/) * @license http://sabre.io/license/ Modified BSD License */ diff --git a/vendor/sabre/vobject/lib/Property/Unknown.php b/vendor/sabre/vobject/lib/Property/Unknown.php index baf72852ad..8227983906 100644 --- a/vendor/sabre/vobject/lib/Property/Unknown.php +++ b/vendor/sabre/vobject/lib/Property/Unknown.php @@ -14,7 +14,7 @@ use * This object represents any properties not recognized by the parser. * This type of value has been introduced by the jCal, jCard specs. * - * @copyright Copyright (C) 2007-2014 fruux GmbH. All rights reserved. + * @copyright Copyright (C) 2011-2015 fruux GmbH (https://fruux.com/). * @author Evert Pot (http://evertpot.com/) * @license http://sabre.io/license/ Modified BSD License */ diff --git a/vendor/sabre/vobject/lib/Property/Uri.php b/vendor/sabre/vobject/lib/Property/Uri.php index ee3e8694ab..e1a5833883 100644 --- a/vendor/sabre/vobject/lib/Property/Uri.php +++ b/vendor/sabre/vobject/lib/Property/Uri.php @@ -9,7 +9,7 @@ use Sabre\VObject\Property; * * This object encodes URI values. vCard 2.1 calls these URL. * - * @copyright Copyright (C) 2007-2014 fruux GmbH. All rights reserved. + * @copyright Copyright (C) 2011-2015 fruux GmbH (https://fruux.com/). * @author Evert Pot (http://evertpot.com/) * @license http://sabre.io/license/ Modified BSD License */ diff --git a/vendor/sabre/vobject/lib/Property/UtcOffset.php b/vendor/sabre/vobject/lib/Property/UtcOffset.php index a7060eea25..c49510be9f 100644 --- a/vendor/sabre/vobject/lib/Property/UtcOffset.php +++ b/vendor/sabre/vobject/lib/Property/UtcOffset.php @@ -7,7 +7,7 @@ namespace Sabre\VObject\Property; * * This object encodes UTC-OFFSET values. * - * @copyright Copyright (C) 2007-2014 fruux GmbH. All rights reserved. + * @copyright Copyright (C) 2011-2015 fruux GmbH (https://fruux.com/). * @author Evert Pot (http://evertpot.com/) * @license http://sabre.io/license/ Modified BSD License */ diff --git a/vendor/sabre/vobject/lib/Property/VCard/Date.php b/vendor/sabre/vobject/lib/Property/VCard/Date.php index cc640e6829..7b44d05c81 100644 --- a/vendor/sabre/vobject/lib/Property/VCard/Date.php +++ b/vendor/sabre/vobject/lib/Property/VCard/Date.php @@ -10,7 +10,7 @@ use * * This object encodes vCard DATE values. * - * @copyright Copyright (C) 2007-2014 fruux GmbH. All rights reserved. + * @copyright Copyright (C) 2011-2015 fruux GmbH (https://fruux.com/). * @author Evert Pot (http://evertpot.com/) * @license http://sabre.io/license/ Modified BSD License */ diff --git a/vendor/sabre/vobject/lib/Property/VCard/DateAndOrTime.php b/vendor/sabre/vobject/lib/Property/VCard/DateAndOrTime.php index 352e80c566..8f62bb084d 100644 --- a/vendor/sabre/vobject/lib/Property/VCard/DateAndOrTime.php +++ b/vendor/sabre/vobject/lib/Property/VCard/DateAndOrTime.php @@ -13,7 +13,7 @@ use * * This object encodes DATE-AND-OR-TIME values. * - * @copyright Copyright (C) 2007-2014 fruux GmbH. All rights reserved. + * @copyright Copyright (C) 2011-2015 fruux GmbH (https://fruux.com/). * @author Evert Pot (http://evertpot.com/) * @license http://sabre.io/license/ Modified BSD License */ diff --git a/vendor/sabre/vobject/lib/Property/VCard/DateTime.php b/vendor/sabre/vobject/lib/Property/VCard/DateTime.php index 7ce0c91057..97c19c9a51 100644 --- a/vendor/sabre/vobject/lib/Property/VCard/DateTime.php +++ b/vendor/sabre/vobject/lib/Property/VCard/DateTime.php @@ -10,7 +10,7 @@ use * * This object encodes DATE-TIME values for vCards. * - * @copyright Copyright (C) 2007-2014 fruux GmbH. All rights reserved. + * @copyright Copyright (C) 2011-2015 fruux GmbH (https://fruux.com/). * @author Evert Pot (http://evertpot.com/) * @license http://sabre.io/license/ Modified BSD License */ diff --git a/vendor/sabre/vobject/lib/Property/VCard/LanguageTag.php b/vendor/sabre/vobject/lib/Property/VCard/LanguageTag.php index 7ccf8269da..fc6b4a53e5 100644 --- a/vendor/sabre/vobject/lib/Property/VCard/LanguageTag.php +++ b/vendor/sabre/vobject/lib/Property/VCard/LanguageTag.php @@ -10,7 +10,7 @@ use * * This object represents LANGUAGE-TAG values as used in vCards. * - * @copyright Copyright (C) 2007-2014 fruux GmbH. All rights reserved. + * @copyright Copyright (C) 2011-2015 fruux GmbH (https://fruux.com/). * @author Evert Pot (http://evertpot.com/) * @license http://sabre.io/license/ Modified BSD License */ diff --git a/vendor/sabre/vobject/lib/Property/VCard/TimeStamp.php b/vendor/sabre/vobject/lib/Property/VCard/TimeStamp.php index a05a0366be..70265ceb80 100644 --- a/vendor/sabre/vobject/lib/Property/VCard/TimeStamp.php +++ b/vendor/sabre/vobject/lib/Property/VCard/TimeStamp.php @@ -11,7 +11,7 @@ use * * This object encodes TIMESTAMP values. * - * @copyright Copyright (C) 2007-2014 fruux GmbH. All rights reserved. + * @copyright Copyright (C) 2011-2015 fruux GmbH (https://fruux.com/). * @author Evert Pot (http://evertpot.com/) * @license http://sabre.io/license/ Modified BSD License */ diff --git a/vendor/sabre/vobject/lib/Reader.php b/vendor/sabre/vobject/lib/Reader.php index 65a2543c49..4bd329be18 100644 --- a/vendor/sabre/vobject/lib/Reader.php +++ b/vendor/sabre/vobject/lib/Reader.php @@ -8,7 +8,7 @@ namespace Sabre\VObject; * This object provides a few (static) convenience methods to quickly access * the parsers. * - * @copyright Copyright (C) 2007-2014 fruux GmbH (https://fruux.com/). + * @copyright Copyright (C) 2011-2015 fruux GmbH (https://fruux.com/). * @author Evert Pot (http://evertpot.com/) * @license http://sabre.io/license/ Modified BSD License */ diff --git a/vendor/sabre/vobject/lib/Recur/EventIterator.php b/vendor/sabre/vobject/lib/Recur/EventIterator.php index 8743f5ae1b..2430545a4a 100644 --- a/vendor/sabre/vobject/lib/Recur/EventIterator.php +++ b/vendor/sabre/vobject/lib/Recur/EventIterator.php @@ -50,7 +50,7 @@ use Sabre\VObject\Component\VEvent; * * The recurrence iterator also does not yet support THISANDFUTURE. * - * @copyright Copyright (C) 2007-2014 fruux GmbH (https://fruux.com/). + * @copyright Copyright (C) 2011-2015 fruux GmbH (https://fruux.com/). * @author Evert Pot (http://evertpot.com/) * @license http://sabre.io/license/ Modified BSD License */ @@ -88,7 +88,6 @@ class EventIterator implements \Iterator { } $this->timeZone = $timeZone; - $rrule = null; if ($vcal instanceof VEvent) { // Single instance mode. $events = array($vcal); @@ -139,17 +138,6 @@ class EventIterator implements \Iterator { $this->masterEvent = array_shift($this->overriddenEvents); } - // master event. - if (isset($this->masterEvent->RRULE)) { - $rrule = $this->masterEvent->RRULE->getParts(); - } else { - // master event has no rrule. We default to something that - // iterates once. - $rrule = array( - 'FREQ' => 'DAILY', - 'COUNT' => 1, - ); - } $this->startDate = $this->masterEvent->DTSTART->getDateTime($this->timeZone); $this->allDay = !$this->masterEvent->DTSTART->hasTime(); diff --git a/vendor/sabre/vobject/lib/Recur/NoInstancesException.php b/vendor/sabre/vobject/lib/Recur/NoInstancesException.php index 084bdc1f87..6cf892b583 100644 --- a/vendor/sabre/vobject/lib/Recur/NoInstancesException.php +++ b/vendor/sabre/vobject/lib/Recur/NoInstancesException.php @@ -9,7 +9,7 @@ use Exception; * * This may happen when every occurence in a rrule is also in EXDATE. * - * @copyright Copyright (C) 2009-2014 fruux GmbH. All rights reserved. + * @copyright Copyright (C) 2011-2015 fruux GmbH (https://fruux.com/). * @author Evert Pot (http://evertpot.com/) * @license http://code.google.com/p/sabredav/wiki/License Modified BSD License */ diff --git a/vendor/sabre/vobject/lib/Recur/RDateIterator.php b/vendor/sabre/vobject/lib/Recur/RDateIterator.php index 3a3fd2a081..f37966888d 100644 --- a/vendor/sabre/vobject/lib/Recur/RDateIterator.php +++ b/vendor/sabre/vobject/lib/Recur/RDateIterator.php @@ -17,7 +17,7 @@ use Sabre\VObject\DateTimeParser; * For instance, passing: FREQ=DAILY;LIMIT=5 will cause the iterator to contain * 5 items, one for each day. * - * @copyright Copyright (C) 2007-2014 fruux GmbH. All rights reserved. + * @copyright Copyright (C) 2011-2015 fruux GmbH (https://fruux.com/). * @author Evert Pot (http://evertpot.com/) * @license http://sabre.io/license/ Modified BSD License */ diff --git a/vendor/sabre/vobject/lib/Recur/RRuleIterator.php b/vendor/sabre/vobject/lib/Recur/RRuleIterator.php index 08f20101ed..0a8f9bcdc1 100644 --- a/vendor/sabre/vobject/lib/Recur/RRuleIterator.php +++ b/vendor/sabre/vobject/lib/Recur/RRuleIterator.php @@ -18,7 +18,7 @@ use Sabre\VObject\Property; * For instance, passing: FREQ=DAILY;LIMIT=5 will cause the iterator to contain * 5 items, one for each day. * - * @copyright Copyright (C) 2007-2014 fruux GmbH. All rights reserved. + * @copyright Copyright (C) 2011-2015 fruux GmbH (https://fruux.com/). * @author Evert Pot (http://evertpot.com/) * @license http://sabre.io/license/ Modified BSD License */ diff --git a/vendor/sabre/vobject/lib/RecurrenceIterator.php b/vendor/sabre/vobject/lib/RecurrenceIterator.php index 39caddfe09..92ea03ffe0 100644 --- a/vendor/sabre/vobject/lib/RecurrenceIterator.php +++ b/vendor/sabre/vobject/lib/RecurrenceIterator.php @@ -10,7 +10,7 @@ use Sabre\VObject\Recur\EventIterator; * This class is deprecated. Use Sabre\VObject\Recur\EventIterator instead. * This class will be removed from a future version. * - * @copyright Copyright (C) 2007-2014 fruux GmbH. All rights reserved. + * @copyright Copyright (C) 2011-2015 fruux GmbH (https://fruux.com/). * @author Evert Pot (http://evertpot.com/) * @deprecated * @license http://sabre.io/license Modified BSD License diff --git a/vendor/sabre/vobject/lib/Splitter/ICalendar.php b/vendor/sabre/vobject/lib/Splitter/ICalendar.php index 9a70832ffb..833df6d423 100644 --- a/vendor/sabre/vobject/lib/Splitter/ICalendar.php +++ b/vendor/sabre/vobject/lib/Splitter/ICalendar.php @@ -15,7 +15,7 @@ use * calendar-objects inside. Objects with identical UID's will be combined into * a single object. * - * @copyright Copyright (C) 2007-2014 fruux GmbH (https://fruux.com/). + * @copyright Copyright (C) 2011-2015 fruux GmbH (https://fruux.com/). * @author Dominik Tobschall * @author Armin Hackmann * @license http://sabre.io/license/ Modified BSD License diff --git a/vendor/sabre/vobject/lib/Splitter/SplitterInterface.php b/vendor/sabre/vobject/lib/Splitter/SplitterInterface.php index e5282ab1a7..c41b412b1a 100644 --- a/vendor/sabre/vobject/lib/Splitter/SplitterInterface.php +++ b/vendor/sabre/vobject/lib/Splitter/SplitterInterface.php @@ -11,7 +11,7 @@ namespace Sabre\VObject\Splitter; * This is for example for Card and CalDAV, which require every event and vcard * to exist in their own objects, instead of one large one. * - * @copyright Copyright (C) 2007-2014 fruux GmbH (https://fruux.com/). + * @copyright Copyright (C) 2011-2015 fruux GmbH (https://fruux.com/). * @author Dominik Tobschall * @license http://sabre.io/license/ Modified BSD License */ diff --git a/vendor/sabre/vobject/lib/Splitter/VCard.php b/vendor/sabre/vobject/lib/Splitter/VCard.php index 7e3687a12f..f474174ad0 100644 --- a/vendor/sabre/vobject/lib/Splitter/VCard.php +++ b/vendor/sabre/vobject/lib/Splitter/VCard.php @@ -15,7 +15,7 @@ use * class checks for BEGIN:VCARD and END:VCARD and parses each encountered * component individually. * - * @copyright Copyright (C) 2007-2014 fruux GmbH (https://fruux.com/). + * @copyright Copyright (C) 2011-2015 fruux GmbH (https://fruux.com/). * @author Dominik Tobschall * @author Armin Hackmann * @license http://sabre.io/license/ Modified BSD License diff --git a/vendor/sabre/vobject/lib/StringUtil.php b/vendor/sabre/vobject/lib/StringUtil.php index bca717afbc..3354abea3d 100644 --- a/vendor/sabre/vobject/lib/StringUtil.php +++ b/vendor/sabre/vobject/lib/StringUtil.php @@ -5,7 +5,7 @@ namespace Sabre\VObject; /** * Useful utilities for working with various strings. * - * @copyright Copyright (C) 2007-2014 fruux GmbH (https://fruux.com/). + * @copyright Copyright (C) 2011-2015 fruux GmbH (https://fruux.com/). * @author Evert Pot (http://evertpot.com/) * @license http://sabre.io/license/ Modified BSD License */ diff --git a/vendor/sabre/vobject/lib/TimeZoneUtil.php b/vendor/sabre/vobject/lib/TimeZoneUtil.php index cb2d3a03be..db3e25fd32 100644 --- a/vendor/sabre/vobject/lib/TimeZoneUtil.php +++ b/vendor/sabre/vobject/lib/TimeZoneUtil.php @@ -7,7 +7,7 @@ namespace Sabre\VObject; * * This file translates well-known time zone names into "Olson database" time zone names. * - * @copyright Copyright (C) 2007-2014 fruux GmbH (https://fruux.com/). + * @copyright Copyright (C) 2011-2015 fruux GmbH (https://fruux.com/). * @author Frank Edelhaeuser (fedel@users.sourceforge.net) * @author Evert Pot (http://evertpot.com/) * @license http://sabre.io/license/ Modified BSD License diff --git a/vendor/sabre/vobject/lib/UUIDUtil.php b/vendor/sabre/vobject/lib/UUIDUtil.php index 81cdc7dd39..992da0defa 100644 --- a/vendor/sabre/vobject/lib/UUIDUtil.php +++ b/vendor/sabre/vobject/lib/UUIDUtil.php @@ -9,7 +9,7 @@ namespace Sabre\VObject; * UUIDs are used a decent amount within various *DAV standards, so it made * sense to include it. * - * @copyright Copyright (C) 2007-2014 fruux GmbH (https://fruux.com/). + * @copyright Copyright (C) 2011-2015 fruux GmbH (https://fruux.com/). * @author Evert Pot (http://evertpot.com/) * @license http://sabre.io/license/ Modified BSD License */ diff --git a/vendor/sabre/vobject/lib/VCardConverter.php b/vendor/sabre/vobject/lib/VCardConverter.php index 87d6c142a3..1bf3c5b484 100644 --- a/vendor/sabre/vobject/lib/VCardConverter.php +++ b/vendor/sabre/vobject/lib/VCardConverter.php @@ -5,7 +5,7 @@ namespace Sabre\VObject; /** * This utility converts vcards from one version to another. * - * @copyright Copyright (C) 2007-2014 fruux GmbH. All rights reserved. + * @copyright Copyright (C) 2011-2015 fruux GmbH (https://fruux.com/). * @author Evert Pot (http://evertpot.com/) * @license http://sabre.io/license/ Modified BSD License */ @@ -96,7 +96,7 @@ class VCardConverter { if ($property instanceof Property\Uri && in_array($property->name, array('PHOTO','LOGO','SOUND'))) { - $newProperty = $this->convertUriToBinary($output, $newProperty, $parameters); + $newProperty = $this->convertUriToBinary($output, $newProperty); } elseif ($property instanceof Property\VCard\DateAndOrTime) { @@ -208,7 +208,7 @@ class VCardConverter { $label = $input->{$property->group . '.X-ABLABEL'}; // We only support converting anniversaries. - if ($label->getValue()!=='_$!!$_') { + if (!$label || $label->getValue()!=='_$!!$_') { break; } @@ -319,11 +319,9 @@ class VCardConverter { * * @param Component\VCard $output * @param Property\Uri $property The input property. - * @param $parameters List of parameters that will eventually be added to - * the new property. * @return Property\Binary|null */ - protected function convertUriToBinary(Component\VCard $output, Property\Uri $newProperty, array &$parameters) { + protected function convertUriToBinary(Component\VCard $output, Property\Uri $newProperty) { $value = $newProperty->getValue(); diff --git a/vendor/sabre/vobject/lib/Version.php b/vendor/sabre/vobject/lib/Version.php index 1a5ecbb140..abc654147e 100644 --- a/vendor/sabre/vobject/lib/Version.php +++ b/vendor/sabre/vobject/lib/Version.php @@ -5,7 +5,7 @@ namespace Sabre\VObject; /** * This class contains the version number for the VObject package * - * @copyright Copyright (C) 2007-2014 fruux GmbH (https://fruux.com/). + * @copyright Copyright (C) 2011-2015 fruux GmbH (https://fruux.com/). * @author Evert Pot (http://evertpot.com/) * @license http://sabre.io/license/ Modified BSD License */ @@ -14,6 +14,6 @@ class Version { /** * Full version number */ - const VERSION = '3.3.4'; + const VERSION = '3.3.5'; } diff --git a/vendor/sabre/vobject/lib/timezonedata/exchangezones.php b/vendor/sabre/vobject/lib/timezonedata/exchangezones.php index a56c574ea4..5dadb18095 100644 --- a/vendor/sabre/vobject/lib/timezonedata/exchangezones.php +++ b/vendor/sabre/vobject/lib/timezonedata/exchangezones.php @@ -8,7 +8,7 @@ * Correct timezones deduced with help from: * http://en.wikipedia.org/wiki/List_of_tz_database_time_zones * - * @copyright Copyright (C) 2007-2014 fruux GmbH (https://fruux.com/). + * @copyright Copyright (C) 2011-2015 fruux GmbH (https://fruux.com/). * @license http://sabre.io/license/ Modified BSD License */ return array( diff --git a/vendor/sabre/vobject/lib/timezonedata/lotuszones.php b/vendor/sabre/vobject/lib/timezonedata/lotuszones.php index 15147f5412..4de690959a 100644 --- a/vendor/sabre/vobject/lib/timezonedata/lotuszones.php +++ b/vendor/sabre/vobject/lib/timezonedata/lotuszones.php @@ -4,7 +4,7 @@ * The following list are timezone names that could be generated by * Lotus / Domino * - * @copyright Copyright (C) 2007-2014 fruux GmbH (https://fruux.com/). + * @copyright Copyright (C) 2011-2015 fruux GmbH (https://fruux.com/). * @license http://sabre.io/license/ Modified BSD License */ return array( diff --git a/vendor/sabre/vobject/lib/timezonedata/php-bc.php b/vendor/sabre/vobject/lib/timezonedata/php-bc.php index 0eb4725693..7ef44ffce0 100644 --- a/vendor/sabre/vobject/lib/timezonedata/php-bc.php +++ b/vendor/sabre/vobject/lib/timezonedata/php-bc.php @@ -11,10 +11,10 @@ * directly, we use this file because DateTimeZone::ALL_WITH_BC is not properly * supported by all PHP version and HHVM. * - * @copyright Copyright (C) 2007-2014 fruux GmbH (https://fruux.com/). + * @copyright Copyright (C) 2011-2015 fruux GmbH (https://fruux.com/). * @license http://sabre.io/license/ Modified BSD License */ - return array( +return array( 'Africa/Asmera', 'Africa/Timbuktu', 'America/Argentina/ComodRivadavia', diff --git a/vendor/sabre/vobject/lib/timezonedata/php-workaround.php b/vendor/sabre/vobject/lib/timezonedata/php-workaround.php index d86a98ef31..08e2144965 100644 --- a/vendor/sabre/vobject/lib/timezonedata/php-workaround.php +++ b/vendor/sabre/vobject/lib/timezonedata/php-workaround.php @@ -10,7 +10,7 @@ * Some more info here: * http://evertpot.com/php-5-5-10-timezone-changes/ * - * @copyright Copyright (C) 2007-2014 fruux GmbH (https://fruux.com/). + * @copyright Copyright (C) 2011-2015 fruux GmbH (https://fruux.com/). * @license http://sabre.io/license/ Modified BSD License */ return array( diff --git a/vendor/sabre/vobject/lib/timezonedata/windowszones.php b/vendor/sabre/vobject/lib/timezonedata/windowszones.php index 9d723e3df2..e45adcc6f0 100644 --- a/vendor/sabre/vobject/lib/timezonedata/windowszones.php +++ b/vendor/sabre/vobject/lib/timezonedata/windowszones.php @@ -6,7 +6,7 @@ * Last update: 2014-10-03T07:58:31-04:00 * Source: http://unicode.org/repos/cldr/trunk/common/supplemental/windowsZones.xml * - * @copyright Copyright (C) 2007-2014 fruux GmbH (https://fruux.com/). + * @copyright Copyright (C) 2011-2015 fruux GmbH (https://fruux.com/). * @license http://sabre.io/license/ Modified BSD License */ @@ -111,4 +111,4 @@ return array ( 'West Asia Standard Time' => 'Asia/Tashkent', 'West Pacific Standard Time' => 'Pacific/Port_Moresby', 'Yakutsk Standard Time' => 'Asia/Yakutsk', -); \ No newline at end of file +); diff --git a/vendor/sabre/vobject/tests/VObject/CliTest.php b/vendor/sabre/vobject/tests/VObject/CliTest.php index 9d4b19cbdb..9049c00b0c 100644 --- a/vendor/sabre/vobject/tests/VObject/CliTest.php +++ b/vendor/sabre/vobject/tests/VObject/CliTest.php @@ -498,8 +498,7 @@ VCARD ); rewind($this->cli->stdout); - $this->assertEquals("BEGIN:VCARD\r\nVERSION:2.1\r\nEND:VCARD\r\n", stream_get_contents($this->cli->stdout)); - + $this->assertRegExp("/^BEGIN:VCARD\r\nVERSION:2.1\r\nUID:[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}\r\nEND:VCARD\r\n$/", stream_get_contents($this->cli->stdout)); } function testRepairNothing() { diff --git a/vendor/sabre/vobject/tests/VObject/Component/VCalendarTest.php b/vendor/sabre/vobject/tests/VObject/Component/VCalendarTest.php index 2f4d21cdff..9c9db42eb0 100644 --- a/vendor/sabre/vobject/tests/VObject/Component/VCalendarTest.php +++ b/vendor/sabre/vobject/tests/VObject/Component/VCalendarTest.php @@ -268,6 +268,28 @@ ICS; $tests[] = array($input, $output, 'America/Argentina/Buenos_Aires', '2014-01-01', '2015-01-01'); + // Recurrence rule with no valid instances + $input = 'BEGIN:VCALENDAR +CALSCALE:GREGORIAN +VERSION:2.0 +BEGIN:VEVENT +UID:bla6 +SUMMARY:Testing RRule3 +DTSTART:20111125T120000Z +DTEND:20111125T130000Z +RRULE:FREQ=WEEKLY;COUNT=1 +EXDATE:20111125T120000Z +END:VEVENT +END:VCALENDAR +'; + + $output = 'BEGIN:VCALENDAR +CALSCALE:GREGORIAN +VERSION:2.0 +END:VCALENDAR +'; + + $tests[] = array($input, $output); return $tests; } @@ -521,4 +543,154 @@ END:VCALENDAR $this->assertNull($result); } + + function testNoComponents() { + + $input = <<assertValidate( + $input, + 0, + 3, + "An iCalendar object must have at least 1 component." + ); + + } + + function testCalDAVNoComponents() { + + $input = <<assertValidate( + $input, + VCalendar::PROFILE_CALDAV, + 3, + "A calendar object on a CalDAV server must have at least 1 component (VTODO, VEVENT, VJOURNAL)." + ); + + } + + function testCalDAVMultiUID() { + + $input = <<assertValidate( + $input, + VCalendar::PROFILE_CALDAV, + 3, + "A calendar object on a CalDAV server may only have components with the same UID." + ); + + } + + function testCalDAVMultiComponent() { + + $input = <<assertValidate( + $input, + VCalendar::PROFILE_CALDAV, + 3, + "A calendar object on a CalDAV server may only have 1 type of component (VEVENT, VTODO or VJOURNAL)." + ); + + } + + function testCalDAVMETHOD() { + + $input = <<assertValidate( + $input, + VCalendar::PROFILE_CALDAV, + 3, + "A calendar object on a CalDAV server MUST NOT have a METHOD property." + ); + + } + + function assertValidate($ics, $options, $expectedLevel, $expectedMessage = null) { + + $vcal = VObject\Reader::read($ics); + $result = $vcal->validate($options); + + $this->assertValidateResult($result, $expectedLevel, $expectedMessage); + + } + + function assertValidateResult($input, $expectedLevel, $expectedMessage = null) { + + $messages = array(); + foreach($input as $warning) { + $messages[] = $warning['message']; + } + + if ($expectedLevel === 0) { + $this->assertEquals(0, count($input), 'No validation messages were expected. We got: ' . implode(', ', $messages)); + } else { + $this->assertEquals(1, count($input), 'We expected exactly 1 validation message, We got: ' . implode(', ', $messages)); + + $this->assertEquals($expectedMessage, $input[0]['message']); + $this->assertEquals($expectedLevel, $input[0]['level']); + } + + } + + } diff --git a/vendor/sabre/vobject/tests/VObject/Component/VCardTest.php b/vendor/sabre/vobject/tests/VObject/Component/VCardTest.php index 032f275989..d460ddc3a6 100644 --- a/vendor/sabre/vobject/tests/VObject/Component/VCardTest.php +++ b/vendor/sabre/vobject/tests/VObject/Component/VCardTest.php @@ -173,4 +173,116 @@ VCF; $this->assertNull($vcard->preferred('EMAIL')); } + + function testNoUIDCardDAV() { + + $vcard = <<assertValidate( + $vcard, + VCARD::PROFILE_CARDDAV, + 3, + 'vCards on CardDAV servers MUST have a UID property.' + ); + + } + + function testNoUIDNoCardDAV() { + + $vcard = <<assertValidate( + $vcard, + 0, + 2, + 'Adding a UID to a vCard property is recommended.' + ); + + } + function testNoUIDNoCardDAVRepair() { + + $vcard = <<assertValidate( + $vcard, + VCARD::REPAIR, + 1, + 'Adding a UID to a vCard property is recommended.' + ); + + } + + function testVCard21CardDAV() { + + $vcard = <<assertValidate( + $vcard, + VCARD::PROFILE_CARDDAV, + 3, + 'CardDAV servers are not allowed to accept vCard 2.1.' + ); + + } + + function testVCard21NoCardDAV() { + + $vcard = <<assertValidate( + $vcard, + 0, + 0 + ); + + } + + function assertValidate($vcf, $options, $expectedLevel, $expectedMessage = null) { + + $vcal = VObject\Reader::read($vcf); + $result = $vcal->validate($options); + + $this->assertValidateResult($result, $expectedLevel, $expectedMessage); + + } + + function assertValidateResult($input, $expectedLevel, $expectedMessage = null) { + + $messages = array(); + foreach($input as $warning) { + $messages[] = $warning['message']; + } + + if ($expectedLevel === 0) { + $this->assertEquals(0, count($input), 'No validation messages were expected. We got: ' . implode(', ', $messages)); + } else { + $this->assertEquals(1, count($input), 'We expected exactly 1 validation message, We got: ' . implode(', ', $messages)); + + $this->assertEquals($expectedMessage, $input[0]['message']); + $this->assertEquals($expectedLevel, $input[0]['level']); + } + + } } diff --git a/vendor/sabre/vobject/tests/VObject/ITip/BrokerProcessReplyTest.php b/vendor/sabre/vobject/tests/VObject/ITip/BrokerProcessReplyTest.php index 4812be9ac0..0e7e47e761 100644 --- a/vendor/sabre/vobject/tests/VObject/ITip/BrokerProcessReplyTest.php +++ b/vendor/sabre/vobject/tests/VObject/ITip/BrokerProcessReplyTest.php @@ -59,8 +59,7 @@ VERSION:2.0 BEGIN:VEVENT SEQUENCE:2 UID:foobar -ATTENDEE;PARTSTAT=ACCEPTED;SCHEDULE-STATUS="2.0;Success":mailto:foo@example - .org +ATTENDEE;PARTSTAT=ACCEPTED;SCHEDULE-STATUS=2.0:mailto:foo@example.org ORGANIZER:mailto:bar@example.org END:VEVENT END:VCALENDAR @@ -105,8 +104,7 @@ VERSION:2.0 BEGIN:VEVENT UID:foobar SEQUENCE:2 -ATTENDEE;PARTSTAT=ACCEPTED;SCHEDULE-STATUS="2.3;foo-bar!":mailto:foo@exampl - e.org +ATTENDEE;PARTSTAT=ACCEPTED;SCHEDULE-STATUS=2.3:mailto:foo@example.org ORGANIZER:mailto:bar@example.org END:VEVENT END:VCALENDAR @@ -414,8 +412,7 @@ VERSION:2.0 BEGIN:VEVENT SEQUENCE:2 UID:foobar -ATTENDEE;PARTSTAT=ACCEPTED;SCHEDULE-STATUS="2.0;Success":mailto:foo@example - .org +ATTENDEE;PARTSTAT=ACCEPTED;SCHEDULE-STATUS=2.0:mailto:foo@example.org ORGANIZER:mailto:bar@example.org END:VEVENT END:VCALENDAR diff --git a/vendor/sabre/vobject/tests/VObject/ITip/BrokerTester.php b/vendor/sabre/vobject/tests/VObject/ITip/BrokerTester.php index a86da0362b..5049ad04c0 100644 --- a/vendor/sabre/vobject/tests/VObject/ITip/BrokerTester.php +++ b/vendor/sabre/vobject/tests/VObject/ITip/BrokerTester.php @@ -7,7 +7,7 @@ use Sabre\VObject\Reader; /** * Utilities for testing the broker * - * @copyright Copyright (C) 2007-2014 fruux GmbH. All rights reserved. + * @copyright Copyright (C) 2011-2015 fruux GmbH (https://fruux.com/). * @author Evert Pot (http://evertpot.com/) * @license http://sabre.io/license/ Modified BSD License */ diff --git a/vendor/sabre/vobject/tests/VObject/JCalTest.php b/vendor/sabre/vobject/tests/VObject/JCalTest.php index 8c4461846e..f23165bcf3 100644 --- a/vendor/sabre/vobject/tests/VObject/JCalTest.php +++ b/vendor/sabre/vobject/tests/VObject/JCalTest.php @@ -34,6 +34,8 @@ class JCalTest extends \PHPUnit_Framework_TestCase { $event->add('REQUEST-STATUS', array("2.0", "Success")); $event->add('REQUEST-STATUS', array("3.7", "Invalid Calendar User", "ATTENDEE:mailto:jsmith@example.org")); + $event->add('DTEND', '20150108T133000'); + $expected = array( "vcalendar", array( @@ -129,6 +131,12 @@ class JCalTest extends \PHPUnit_Framework_TestCase { "text", array("3.7", "Invalid Calendar User", "ATTENDEE:mailto:jsmith@example.org"), ), + array( + 'dtend', + new \StdClass(), + "date-time", + "2015-01-08T13:30:00", + ), ), array(), ) diff --git a/vendor/sabre/vobject/tests/VObject/ReaderTest.php b/vendor/sabre/vobject/tests/VObject/ReaderTest.php index 735b9127f8..f530d8120d 100644 --- a/vendor/sabre/vobject/tests/VObject/ReaderTest.php +++ b/vendor/sabre/vobject/tests/VObject/ReaderTest.php @@ -125,7 +125,6 @@ class ReaderTest extends \PHPUnit_Framework_TestCase { } - /** * @expectedException Sabre\VObject\ParseException */ @@ -154,6 +153,7 @@ class ReaderTest extends \PHPUnit_Framework_TestCase { $this->assertEquals('propValue', $result->children[0]->getValue()); } + function testReadNestedComponent() { $data = array( @@ -294,6 +294,7 @@ class ReaderTest extends \PHPUnit_Framework_TestCase { $this->assertEquals('paramvalue', $result->parameters['PARAMNAME']->getValue()); } + function testReadPropertyParameterNewLines() { $data = "BEGIN:VCALENDAR\r\nPROPNAME;PARAMNAME=paramvalue1^nvalue2^^nvalue3:propValue\r\nEND:VCALENDAR"; @@ -354,7 +355,6 @@ class ReaderTest extends \PHPUnit_Framework_TestCase { $this->assertEquals($expected, $result->serialize()); - } function testReadWithInvalidLine() { @@ -386,7 +386,6 @@ class ReaderTest extends \PHPUnit_Framework_TestCase { $this->assertEquals($expected, $result->serialize()); - } /** @@ -436,4 +435,15 @@ ICS; } + public function testReadBOM() { + + $data = chr(0xef) . chr(0xbb) . chr(0xbf) . "BEGIN:VCALENDAR\r\nEND:VCALENDAR"; + $result = Reader::read($data); + + $this->assertInstanceOf('Sabre\\VObject\\Component', $result); + $this->assertEquals('VCALENDAR', $result->name); + $this->assertEquals(0, count($result->children)); + + } + } diff --git a/vendor/sabre/vobject/tests/VObject/VCardConverterTest.php b/vendor/sabre/vobject/tests/VObject/VCardConverterTest.php index c4e40ee9c2..9e7b2df3c5 100644 --- a/vendor/sabre/vobject/tests/VObject/VCardConverterTest.php +++ b/vendor/sabre/vobject/tests/VObject/VCardConverterTest.php @@ -37,8 +37,8 @@ KIND:ORG END:VCARD OUT; - $vcard = \Sabre\VObject\Reader::read($input); - $vcard = $vcard->convert(\Sabre\VObject\Document::VCARD40); + $vcard = Reader::read($input); + $vcard = $vcard->convert(Document::VCARD40); $this->assertVObjEquals( $output, @@ -75,8 +75,8 @@ END:VCARD OUT; - $vcard = \Sabre\VObject\Reader::read($input); - $vcard = $vcard->convert(\Sabre\VObject\Document::VCARD40); + $vcard = Reader::read($input); + $vcard = $vcard->convert(Document::VCARD40); $this->assertVObjEquals( $output, @@ -114,8 +114,8 @@ END:VCARD OUT; - $vcard = \Sabre\VObject\Reader::read($input); - $vcard = $vcard->convert(\Sabre\VObject\Document::VCARD40); + $vcard = Reader::read($input); + $vcard = $vcard->convert(Document::VCARD40); $this->assertVObjEquals( $output, @@ -154,8 +154,8 @@ END:VCARD OUT; - $vcard = \Sabre\VObject\Reader::read($input); - $vcard = $vcard->convert(\Sabre\VObject\Document::VCARD30); + $vcard = Reader::read($input); + $vcard = $vcard->convert(Document::VCARD30); $this->assertVObjEquals( $output, @@ -195,8 +195,8 @@ END:VCARD OUT; - $vcard = \Sabre\VObject\Reader::read($input); - $vcard = $vcard->convert(\Sabre\VObject\Document::VCARD30); + $vcard = Reader::read($input); + $vcard = $vcard->convert(Document::VCARD30); $this->assertVObjEquals( $output, @@ -224,8 +224,8 @@ END:VCARD OUT; - $vcard = \Sabre\VObject\Reader::read($input); - $vcard = $vcard->convert(\Sabre\VObject\Document::VCARD40); + $vcard = Reader::read($input); + $vcard = $vcard->convert(Document::VCARD40); $this->assertVObjEquals( $output, @@ -241,8 +241,8 @@ END:VCARD OUT; - $vcard = \Sabre\VObject\Reader::read($input); - $vcard = $vcard->convert(\Sabre\VObject\Document::VCARD30); + $vcard = Reader::read($input); + $vcard = $vcard->convert(Document::VCARD30); $this->assertVObjEquals( $output, @@ -270,8 +270,8 @@ END:VCARD OUT; - $vcard = \Sabre\VObject\Reader::read($input); - $vcard = $vcard->convert(\Sabre\VObject\Document::VCARD40); + $vcard = Reader::read($input); + $vcard = $vcard->convert(Document::VCARD40); $this->assertVObjEquals( $output, @@ -287,8 +287,8 @@ END:VCARD OUT; - $vcard = \Sabre\VObject\Reader::read($input); - $vcard = $vcard->convert(\Sabre\VObject\Document::VCARD30); + $vcard = Reader::read($input); + $vcard = $vcard->convert(Document::VCARD30); $this->assertVObjEquals( $output, @@ -487,4 +487,45 @@ OUT; ); } + + function testNoLabel() { + + $input = <<assertInstanceOf('Sabre\\VObject\\Component\\VCard', $vcard); + $vcard = $vcard->convert(Document::VCARD40); + $vcard = $vcard->serialize(); + + $converted = Reader::read($vcard); + $converted->validate(); + + $version = Version::VERSION; + + $expected = <<assertEquals($expected, str_replace("\r","", $vcard)); + + } + } diff --git a/vendor/symfony/console/Symfony/Component/Console/Application.php b/vendor/symfony/console/Symfony/Component/Console/Application.php index 3ba8766a7c..5f4244b74b 100644 --- a/vendor/symfony/console/Symfony/Component/Console/Application.php +++ b/vendor/symfony/console/Symfony/Component/Console/Application.php @@ -223,7 +223,7 @@ class Application } /** - * Set an input definition set to be used with this application + * Set an input definition set to be used with this application. * * @param InputDefinition $definition The input definition * @@ -736,7 +736,7 @@ class Application } /** - * Tries to figure out the terminal width in which this application runs + * Tries to figure out the terminal width in which this application runs. * * @return int|null */ @@ -748,7 +748,7 @@ class Application } /** - * Tries to figure out the terminal height in which this application runs + * Tries to figure out the terminal height in which this application runs. * * @return int|null */ @@ -760,7 +760,7 @@ class Application } /** - * Tries to figure out the terminal dimensions based on the current environment + * Tries to figure out the terminal dimensions based on the current environment. * * @return array Array containing width and height */ @@ -770,7 +770,7 @@ class Application return $this->terminalDimensions; } - if (defined('PHP_WINDOWS_VERSION_BUILD')) { + if ('\\' === DIRECTORY_SEPARATOR) { // extract [w, H] from "wxh (WxH)" if (preg_match('/^(\d+)x\d+ \(\d+x(\d+)\)$/', trim(getenv('ANSICON')), $matches)) { return array((int) $matches[1], (int) $matches[2]); @@ -800,8 +800,8 @@ class Application * * Can be useful to force terminal dimensions for functional tests. * - * @param int $width The width - * @param int $height The height + * @param int $width The width + * @param int $height The height * * @return Application The current application */ @@ -921,13 +921,13 @@ class Application return new InputDefinition(array( new InputArgument('command', InputArgument::REQUIRED, 'The command to execute'), - new InputOption('--help', '-h', InputOption::VALUE_NONE, 'Display this help message.'), - new InputOption('--quiet', '-q', InputOption::VALUE_NONE, 'Do not output any message.'), - new InputOption('--verbose', '-v|vv|vvv', InputOption::VALUE_NONE, 'Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug.'), - new InputOption('--version', '-V', InputOption::VALUE_NONE, 'Display this application version.'), - new InputOption('--ansi', '', InputOption::VALUE_NONE, 'Force ANSI output.'), - new InputOption('--no-ansi', '', InputOption::VALUE_NONE, 'Disable ANSI output.'), - new InputOption('--no-interaction', '-n', InputOption::VALUE_NONE, 'Do not ask any interactive question.'), + new InputOption('--help', '-h', InputOption::VALUE_NONE, 'Display this help message'), + new InputOption('--quiet', '-q', InputOption::VALUE_NONE, 'Do not output any message'), + new InputOption('--verbose', '-v|vv|vvv', InputOption::VALUE_NONE, 'Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug'), + new InputOption('--version', '-V', InputOption::VALUE_NONE, 'Display this application version'), + new InputOption('--ansi', '', InputOption::VALUE_NONE, 'Force ANSI output'), + new InputOption('--no-ansi', '', InputOption::VALUE_NONE, 'Disable ANSI output'), + new InputOption('--no-interaction', '-n', InputOption::VALUE_NONE, 'Do not ask any interactive question'), )); } @@ -960,7 +960,7 @@ class Application } /** - * Runs and parses stty -a if it's available, suppressing any error output + * Runs and parses stty -a if it's available, suppressing any error output. * * @return string */ @@ -983,7 +983,7 @@ class Application } /** - * Runs and parses mode CON if it's available, suppressing any error output + * Runs and parses mode CON if it's available, suppressing any error output. * * @return string x or null if it could not be parsed */ @@ -1039,10 +1039,10 @@ class Application /** * Finds alternative of $name among $collection, - * if nothing is found in $collection, try in $abbrevs + * if nothing is found in $collection, try in $abbrevs. * - * @param string $name The string - * @param array|\Traversable $collection The collection + * @param string $name The string + * @param array|\Traversable $collection The collection * * @return array A sorted array of similar string */ diff --git a/vendor/symfony/console/Symfony/Component/Console/Command/Command.php b/vendor/symfony/console/Symfony/Component/Console/Command/Command.php index 83ff791234..0302cb1753 100644 --- a/vendor/symfony/console/Symfony/Component/Console/Command/Command.php +++ b/vendor/symfony/console/Symfony/Component/Console/Command/Command.php @@ -129,7 +129,7 @@ class Command } /** - * Checks whether the command is enabled or not in the current environment + * Checks whether the command is enabled or not in the current environment. * * Override this to check for x or y and return false if the command can not * run properly under the current conditions. @@ -162,7 +162,8 @@ class Command * @return null|int null or 0 if everything went fine, or an error code * * @throws \LogicException When this abstract method is not implemented - * @see setCode() + * + * @see setCode() */ protected function execute(InputInterface $input, OutputInterface $output) { diff --git a/vendor/symfony/console/Symfony/Component/Console/Command/HelpCommand.php b/vendor/symfony/console/Symfony/Component/Console/Command/HelpCommand.php index 9d361a6436..d370da2709 100644 --- a/vendor/symfony/console/Symfony/Component/Console/Command/HelpCommand.php +++ b/vendor/symfony/console/Symfony/Component/Console/Command/HelpCommand.php @@ -58,7 +58,7 @@ EOF } /** - * Sets the command + * Sets the command. * * @param Command $command The command to set */ diff --git a/vendor/symfony/console/Symfony/Component/Console/Descriptor/ApplicationDescription.php b/vendor/symfony/console/Symfony/Component/Console/Descriptor/ApplicationDescription.php index cdf1493c40..a0a5df295f 100644 --- a/vendor/symfony/console/Symfony/Component/Console/Descriptor/ApplicationDescription.php +++ b/vendor/symfony/console/Symfony/Component/Console/Descriptor/ApplicationDescription.php @@ -16,6 +16,8 @@ use Symfony\Component\Console\Command\Command; /** * @author Jean-François Simon + * + * @internal */ class ApplicationDescription { diff --git a/vendor/symfony/console/Symfony/Component/Console/Descriptor/Descriptor.php b/vendor/symfony/console/Symfony/Component/Console/Descriptor/Descriptor.php index ab7acc63d7..49e21939f9 100644 --- a/vendor/symfony/console/Symfony/Component/Console/Descriptor/Descriptor.php +++ b/vendor/symfony/console/Symfony/Component/Console/Descriptor/Descriptor.php @@ -20,6 +20,8 @@ use Symfony\Component\Console\Output\OutputInterface; /** * @author Jean-François Simon + * + * @internal */ abstract class Descriptor implements DescriptorInterface { @@ -59,8 +61,8 @@ abstract class Descriptor implements DescriptorInterface /** * Writes content to output. * - * @param string $content - * @param bool $decorated + * @param string $content + * @param bool $decorated */ protected function write($content, $decorated = false) { diff --git a/vendor/symfony/console/Symfony/Component/Console/Descriptor/JsonDescriptor.php b/vendor/symfony/console/Symfony/Component/Console/Descriptor/JsonDescriptor.php index 186da508d5..13785a40fe 100644 --- a/vendor/symfony/console/Symfony/Component/Console/Descriptor/JsonDescriptor.php +++ b/vendor/symfony/console/Symfony/Component/Console/Descriptor/JsonDescriptor.php @@ -21,6 +21,8 @@ use Symfony\Component\Console\Input\InputOption; * JSON descriptor. * * @author Jean-François Simon + * + * @internal */ class JsonDescriptor extends Descriptor { diff --git a/vendor/symfony/console/Symfony/Component/Console/Descriptor/MarkdownDescriptor.php b/vendor/symfony/console/Symfony/Component/Console/Descriptor/MarkdownDescriptor.php index 3699f08753..db8f7df00a 100644 --- a/vendor/symfony/console/Symfony/Component/Console/Descriptor/MarkdownDescriptor.php +++ b/vendor/symfony/console/Symfony/Component/Console/Descriptor/MarkdownDescriptor.php @@ -21,6 +21,8 @@ use Symfony\Component\Console\Input\InputOption; * Markdown descriptor. * * @author Jean-François Simon + * + * @internal */ class MarkdownDescriptor extends Descriptor { diff --git a/vendor/symfony/console/Symfony/Component/Console/Descriptor/TextDescriptor.php b/vendor/symfony/console/Symfony/Component/Console/Descriptor/TextDescriptor.php index fcefcd83f6..04e7264d89 100644 --- a/vendor/symfony/console/Symfony/Component/Console/Descriptor/TextDescriptor.php +++ b/vendor/symfony/console/Symfony/Component/Console/Descriptor/TextDescriptor.php @@ -21,6 +21,8 @@ use Symfony\Component\Console\Input\InputOption; * Text descriptor. * * @author Jean-François Simon + * + * @internal */ class TextDescriptor extends Descriptor { diff --git a/vendor/symfony/console/Symfony/Component/Console/Descriptor/XmlDescriptor.php b/vendor/symfony/console/Symfony/Component/Console/Descriptor/XmlDescriptor.php index ac1e25e3af..5054686697 100644 --- a/vendor/symfony/console/Symfony/Component/Console/Descriptor/XmlDescriptor.php +++ b/vendor/symfony/console/Symfony/Component/Console/Descriptor/XmlDescriptor.php @@ -21,6 +21,8 @@ use Symfony\Component\Console\Input\InputOption; * XML descriptor. * * @author Jean-François Simon + * + * @internal */ class XmlDescriptor extends Descriptor { diff --git a/vendor/symfony/console/Symfony/Component/Console/Formatter/OutputFormatterStyle.php b/vendor/symfony/console/Symfony/Component/Console/Formatter/OutputFormatterStyle.php index b346ec9b61..38be37a850 100644 --- a/vendor/symfony/console/Symfony/Component/Console/Formatter/OutputFormatterStyle.php +++ b/vendor/symfony/console/Symfony/Component/Console/Formatter/OutputFormatterStyle.php @@ -160,7 +160,6 @@ class OutputFormatterStyle implements OutputFormatterStyleInterface * @param string $option The option name * * @throws \InvalidArgumentException When the option name isn't defined - * */ public function unsetOption($option) { diff --git a/vendor/symfony/console/Symfony/Component/Console/Helper/DescriptorHelper.php b/vendor/symfony/console/Symfony/Component/Console/Helper/DescriptorHelper.php index ff2573d9aa..c324c99454 100644 --- a/vendor/symfony/console/Symfony/Component/Console/Helper/DescriptorHelper.php +++ b/vendor/symfony/console/Symfony/Component/Console/Helper/DescriptorHelper.php @@ -36,10 +36,10 @@ class DescriptorHelper extends Helper public function __construct() { $this - ->register('txt', new TextDescriptor()) - ->register('xml', new XmlDescriptor()) + ->register('txt', new TextDescriptor()) + ->register('xml', new XmlDescriptor()) ->register('json', new JsonDescriptor()) - ->register('md', new MarkdownDescriptor()) + ->register('md', new MarkdownDescriptor()) ; } diff --git a/vendor/symfony/console/Symfony/Component/Console/Helper/DialogHelper.php b/vendor/symfony/console/Symfony/Component/Console/Helper/DialogHelper.php index eae28e03a6..5885180d06 100644 --- a/vendor/symfony/console/Symfony/Component/Console/Helper/DialogHelper.php +++ b/vendor/symfony/console/Symfony/Component/Console/Helper/DialogHelper.php @@ -250,7 +250,7 @@ class DialogHelper extends InputAwareHelper } /** - * Asks a question to the user, the response is hidden + * Asks a question to the user, the response is hidden. * * @param OutputInterface $output An Output instance * @param string|array $question The question @@ -262,7 +262,7 @@ class DialogHelper extends InputAwareHelper */ public function askHiddenResponse(OutputInterface $output, $question, $fallback = true) { - if (defined('PHP_WINDOWS_VERSION_BUILD')) { + if ('\\' === DIRECTORY_SEPARATOR) { $exe = __DIR__.'/../Resources/bin/hiddeninput.exe'; // handle code running from a phar @@ -365,7 +365,6 @@ class DialogHelper extends InputAwareHelper * * @throws \Exception When any of the validators return an error * @throws \RuntimeException In case the fallback is deactivated and the response can not be hidden - * */ public function askHiddenResponseAndValidate(OutputInterface $output, $question, $validator, $attempts = false, $fallback = true) { @@ -391,7 +390,7 @@ class DialogHelper extends InputAwareHelper } /** - * Returns the helper's input stream + * Returns the helper's input stream. * * @return string */ @@ -409,7 +408,7 @@ class DialogHelper extends InputAwareHelper } /** - * Return a valid Unix shell + * Return a valid Unix shell. * * @return string|bool The valid shell name, false in case no valid shell is found */ @@ -447,7 +446,7 @@ class DialogHelper extends InputAwareHelper } /** - * Validate an attempt + * Validate an attempt. * * @param callable $interviewer A callable that will ask for a question and return the result * @param OutputInterface $output An Output instance diff --git a/vendor/symfony/console/Symfony/Component/Console/Helper/ProgressBar.php b/vendor/symfony/console/Symfony/Component/Console/Helper/ProgressBar.php index bc3471b297..893664e412 100644 --- a/vendor/symfony/console/Symfony/Component/Console/Helper/ProgressBar.php +++ b/vendor/symfony/console/Symfony/Component/Console/Helper/ProgressBar.php @@ -151,7 +151,7 @@ class ProgressBar /** * Gets the progress bar start time. * - * @return int The progress bar start time + * @return int The progress bar start time */ public function getStartTime() { @@ -161,7 +161,7 @@ class ProgressBar /** * Gets the progress bar maximal steps. * - * @return int The progress bar max steps + * @return int The progress bar max steps */ public function getMaxSteps() { @@ -173,7 +173,7 @@ class ProgressBar * * @deprecated since 2.6, to be removed in 3.0. Use {@link getProgress()} instead. * - * @return int The progress bar step + * @return int The progress bar step */ public function getStep() { @@ -195,7 +195,7 @@ class ProgressBar * * @internal This method is public for PHP 5.3 compatibility, it should not be used. * - * @return int The progress bar step width + * @return int The progress bar step width */ public function getStepWidth() { @@ -215,7 +215,7 @@ class ProgressBar /** * Sets the progress bar width. * - * @param int $size The progress bar size + * @param int $size The progress bar size */ public function setBarWidth($size) { @@ -225,7 +225,7 @@ class ProgressBar /** * Gets the progress bar width. * - * @return int The progress bar size + * @return int The progress bar size */ public function getBarWidth() { @@ -318,7 +318,7 @@ class ProgressBar /** * Sets the redraw frequency. * - * @param int $freq The frequency in steps + * @param int $freq The frequency in steps */ public function setRedrawFrequency($freq) { @@ -346,7 +346,7 @@ class ProgressBar /** * Advances the progress output X steps. * - * @param int $step Number of steps to advance + * @param int $step Number of steps to advance * * @throws \LogicException */ @@ -360,7 +360,7 @@ class ProgressBar * * @deprecated since 2.6, to be removed in 3.0. Use {@link setProgress()} instead. * - * @param int $step The current progress + * @param int $step The current progress * * @throws \LogicException */ @@ -382,7 +382,7 @@ class ProgressBar /** * Sets the current progress. * - * @param int $step The current progress + * @param int $step The current progress * * @throws \LogicException */ diff --git a/vendor/symfony/console/Symfony/Component/Console/Helper/ProgressHelper.php b/vendor/symfony/console/Symfony/Component/Console/Helper/ProgressHelper.php index f413f5d519..abd1c2bd25 100644 --- a/vendor/symfony/console/Symfony/Component/Console/Helper/ProgressHelper.php +++ b/vendor/symfony/console/Symfony/Component/Console/Helper/ProgressHelper.php @@ -48,28 +48,28 @@ class ProgressHelper extends Helper private $output; /** - * Current step + * Current step. * * @var int */ private $current; /** - * Maximum number of steps + * Maximum number of steps. * * @var int */ private $max; /** - * Start time of the progress bar + * Start time of the progress bar. * * @var int */ private $startTime; /** - * List of formatting variables + * List of formatting variables. * * @var array */ @@ -82,14 +82,14 @@ class ProgressHelper extends Helper ); /** - * Available formatting variables + * Available formatting variables. * * @var array */ private $formatVars; /** - * Stored format part widths (used for padding) + * Stored format part widths (used for padding). * * @var array */ @@ -101,7 +101,7 @@ class ProgressHelper extends Helper ); /** - * Various time formats + * Various time formats. * * @var array */ diff --git a/vendor/symfony/console/Symfony/Component/Console/Helper/QuestionHelper.php b/vendor/symfony/console/Symfony/Component/Console/Helper/QuestionHelper.php index c5e7aad444..caa091492c 100644 --- a/vendor/symfony/console/Symfony/Component/Console/Helper/QuestionHelper.php +++ b/vendor/symfony/console/Symfony/Component/Console/Helper/QuestionHelper.php @@ -164,7 +164,7 @@ class QuestionHelper extends Helper * Autocompletes a question. * * @param OutputInterface $output - * @param Question $question + * @param Question $question * * @return string */ @@ -281,15 +281,15 @@ class QuestionHelper extends Helper /** * Gets a hidden response from user. * - * @param OutputInterface $output An Output instance + * @param OutputInterface $output An Output instance * - * @return string The answer + * @return string The answer * * @throws \RuntimeException In case the fallback is deactivated and the response cannot be hidden */ private function getHiddenResponse(OutputInterface $output, $inputStream) { - if (defined('PHP_WINDOWS_VERSION_BUILD')) { + if ('\\' === DIRECTORY_SEPARATOR) { $exe = __DIR__.'/../Resources/bin/hiddeninput.exe'; // handle code running from a phar @@ -341,11 +341,11 @@ class QuestionHelper extends Helper /** * Validates an attempt. * - * @param callable $interviewer A callable that will ask for a question and return the result - * @param OutputInterface $output An Output instance - * @param Question $question A Question instance + * @param callable $interviewer A callable that will ask for a question and return the result + * @param OutputInterface $output An Output instance + * @param Question $question A Question instance * - * @return string The validated response + * @return string The validated response * * @throws \Exception In case the max number of attempts has been reached and no valid response has been given */ @@ -355,7 +355,13 @@ class QuestionHelper extends Helper $attempts = $question->getMaxAttempts(); while (null === $attempts || $attempts--) { if (null !== $error) { - $output->writeln($this->getHelperSet()->get('formatter')->formatBlock($error->getMessage(), 'error')); + if (null !== $this->getHelperSet() && $this->getHelperSet()->has('formatter')) { + $message = $this->getHelperSet()->get('formatter')->formatBlock($error->getMessage(), 'error'); + } else { + $message = ''.$error->getMessage().''; + } + + $output->writeln($message); } try { @@ -370,7 +376,7 @@ class QuestionHelper extends Helper /** * Returns a valid unix shell. * - * @return string|bool The valid shell name, false in case no valid shell is found + * @return string|bool The valid shell name, false in case no valid shell is found */ private function getShell() { diff --git a/vendor/symfony/console/Symfony/Component/Console/Helper/Table.php b/vendor/symfony/console/Symfony/Component/Console/Helper/Table.php index 5a3dbc168c..3f20b37162 100644 --- a/vendor/symfony/console/Symfony/Component/Console/Helper/Table.php +++ b/vendor/symfony/console/Symfony/Component/Console/Helper/Table.php @@ -296,9 +296,9 @@ class Table /** * Renders table cell with padding. * - * @param array $row - * @param int $column - * @param string $cellFormat + * @param array $row + * @param int $column + * @param string $cellFormat */ private function renderCell(array $row, $column, $cellFormat) { @@ -339,7 +339,7 @@ class Table /** * Gets column width. * - * @param int $column + * @param int $column * * @return int */ @@ -364,8 +364,8 @@ class Table /** * Gets cell width. * - * @param array $row - * @param int $column + * @param array $row + * @param int $column * * @return int */ diff --git a/vendor/symfony/console/Symfony/Component/Console/Helper/TableHelper.php b/vendor/symfony/console/Symfony/Component/Console/Helper/TableHelper.php index bbb92e9bf0..fc6861cf35 100644 --- a/vendor/symfony/console/Symfony/Component/Console/Helper/TableHelper.php +++ b/vendor/symfony/console/Symfony/Component/Console/Helper/TableHelper.php @@ -45,7 +45,7 @@ class TableHelper extends Helper * * @return TableHelper * - * @throws InvalidArgumentException when the table layout is not known + * @throws \InvalidArgumentException when the table layout is not known */ public function setLayout($layout) { @@ -64,7 +64,6 @@ class TableHelper extends Helper default: throw new \InvalidArgumentException(sprintf('Invalid table layout "%s".', $layout)); - break; }; return $this; diff --git a/vendor/symfony/console/Symfony/Component/Console/Helper/TableStyle.php b/vendor/symfony/console/Symfony/Component/Console/Helper/TableStyle.php index 338f1a060a..580f9abc81 100644 --- a/vendor/symfony/console/Symfony/Component/Console/Helper/TableStyle.php +++ b/vendor/symfony/console/Symfony/Component/Console/Helper/TableStyle.php @@ -228,7 +228,7 @@ class TableStyle /** * Sets cell padding type. * - * @param int $padType STR_PAD_* + * @param int $padType STR_PAD_* * * @return TableStyle */ diff --git a/vendor/symfony/console/Symfony/Component/Console/Input/ArgvInput.php b/vendor/symfony/console/Symfony/Component/Console/Input/ArgvInput.php index 68aef1ef6c..7234f75608 100644 --- a/vendor/symfony/console/Symfony/Component/Console/Input/ArgvInput.php +++ b/vendor/symfony/console/Symfony/Component/Console/Input/ArgvInput.php @@ -33,8 +33,8 @@ namespace Symfony\Component\Console\Input; * * @author Fabien Potencier * - * @see http://www.gnu.org/software/libc/manual/html_node/Argument-Syntax.html - * @see http://www.opengroup.org/onlinepubs/009695399/basedefs/xbd_chap12.html#tag_12_02 + * @see http://www.gnu.org/software/libc/manual/html_node/Argument-Syntax.html + * @see http://www.opengroup.org/onlinepubs/009695399/basedefs/xbd_chap12.html#tag_12_02 * * @api */ @@ -327,7 +327,7 @@ class ArgvInput extends Input } /** - * Returns a stringified representation of the args passed to the command + * Returns a stringified representation of the args passed to the command. * * @return string */ diff --git a/vendor/symfony/console/Symfony/Component/Console/Input/ArrayInput.php b/vendor/symfony/console/Symfony/Component/Console/Input/ArrayInput.php index ae935f5302..f3222bb555 100644 --- a/vendor/symfony/console/Symfony/Component/Console/Input/ArrayInput.php +++ b/vendor/symfony/console/Symfony/Component/Console/Input/ArrayInput.php @@ -111,7 +111,7 @@ class ArrayInput extends Input } /** - * Returns a stringified representation of the args passed to the command + * Returns a stringified representation of the args passed to the command. * * @return string */ diff --git a/vendor/symfony/console/Symfony/Component/Console/Input/Input.php b/vendor/symfony/console/Symfony/Component/Console/Input/Input.php index 491f0ec92a..5e7c140875 100644 --- a/vendor/symfony/console/Symfony/Component/Console/Input/Input.php +++ b/vendor/symfony/console/Symfony/Component/Console/Input/Input.php @@ -213,7 +213,7 @@ abstract class Input implements InputInterface } /** - * Escapes a token through escapeshellarg if it contains unsafe chars + * Escapes a token through escapeshellarg if it contains unsafe chars. * * @param string $token * diff --git a/vendor/symfony/console/Symfony/Component/Console/LICENSE b/vendor/symfony/console/Symfony/Component/Console/LICENSE index 0b3292cf90..43028bc600 100644 --- a/vendor/symfony/console/Symfony/Component/Console/LICENSE +++ b/vendor/symfony/console/Symfony/Component/Console/LICENSE @@ -1,4 +1,4 @@ -Copyright (c) 2004-2014 Fabien Potencier +Copyright (c) 2004-2015 Fabien Potencier Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/vendor/symfony/console/Symfony/Component/Console/Logger/ConsoleLogger.php b/vendor/symfony/console/Symfony/Component/Console/Logger/ConsoleLogger.php index 1f2dc2c53c..cf5d49c4c6 100644 --- a/vendor/symfony/console/Symfony/Component/Console/Logger/ConsoleLogger.php +++ b/vendor/symfony/console/Symfony/Component/Console/Logger/ConsoleLogger.php @@ -96,8 +96,10 @@ class ConsoleLogger extends AbstractLogger * Interpolates context values into the message placeholders * * @author PHP Framework Interoperability Group - * @param string $message - * @param array $context + * + * @param string $message + * @param array $context + * * @return string */ private function interpolate($message, array $context) diff --git a/vendor/symfony/console/Symfony/Component/Console/Question/ChoiceQuestion.php b/vendor/symfony/console/Symfony/Component/Console/Question/ChoiceQuestion.php index 59808e1256..e1da7a8c5e 100644 --- a/vendor/symfony/console/Symfony/Component/Console/Question/ChoiceQuestion.php +++ b/vendor/symfony/console/Symfony/Component/Console/Question/ChoiceQuestion.php @@ -23,6 +23,13 @@ class ChoiceQuestion extends Question private $prompt = ' > '; private $errorMessage = 'Value "%s" is invalid'; + /** + * Constructor. + * + * @param string $question The question to ask to the user + * @param array $choices The list of available choices + * @param mixed $default The default answer to return + */ public function __construct($question, array $choices, $default = null) { parent::__construct($question, $default); @@ -47,7 +54,7 @@ class ChoiceQuestion extends Question * * When multiselect is set to true, multiple choices can be answered. * - * @param bool $multiselect + * @param bool $multiselect * * @return ChoiceQuestion The current instance */ @@ -100,6 +107,11 @@ class ChoiceQuestion extends Question return $this; } + /** + * Returns the default answer validator. + * + * @return callable + */ private function getDefaultValidator() { $choices = $this->choices; diff --git a/vendor/symfony/console/Symfony/Component/Console/Question/ConfirmationQuestion.php b/vendor/symfony/console/Symfony/Component/Console/Question/ConfirmationQuestion.php index 0438640fa4..09ac74ff65 100644 --- a/vendor/symfony/console/Symfony/Component/Console/Question/ConfirmationQuestion.php +++ b/vendor/symfony/console/Symfony/Component/Console/Question/ConfirmationQuestion.php @@ -18,6 +18,12 @@ namespace Symfony\Component\Console\Question; */ class ConfirmationQuestion extends Question { + /** + * Constructor. + * + * @param string $question The question to ask to the user + * @param bool $default The default answer to return, true or false + */ public function __construct($question, $default = true) { parent::__construct($question, (bool) $default); @@ -25,6 +31,11 @@ class ConfirmationQuestion extends Question $this->setNormalizer($this->getDefaultNormalizer()); } + /** + * Returns the default answer normalizer. + * + * @return callable + */ private function getDefaultNormalizer() { $default = $this->getDefault(); diff --git a/vendor/symfony/console/Symfony/Component/Console/Question/Question.php b/vendor/symfony/console/Symfony/Component/Console/Question/Question.php index 3003f19c55..9f776d5790 100644 --- a/vendor/symfony/console/Symfony/Component/Console/Question/Question.php +++ b/vendor/symfony/console/Symfony/Component/Console/Question/Question.php @@ -72,7 +72,7 @@ class Question /** * Sets whether the user response must be hidden or not. * - * @param bool $hidden + * @param bool $hidden * * @return Question The current instance * @@ -102,7 +102,7 @@ class Question /** * Sets whether to fallback on non-hidden question if the response can not be hidden. * - * @param bool $fallback + * @param bool $fallback * * @return Question The current instance */ @@ -116,7 +116,7 @@ class Question /** * Gets values for the autocompleter. * - * @return null|array|Traversable + * @return null|array|\Traversable */ public function getAutocompleterValues() { @@ -126,7 +126,7 @@ class Question /** * Sets values for the autocompleter. * - * @param null|array|Traversable $values + * @param null|array|\Traversable $values * * @return Question The current instance * @@ -165,7 +165,7 @@ class Question } /** - * Gets the validator for the question + * Gets the validator for the question. * * @return null|callable */ @@ -179,7 +179,7 @@ class Question * * Null means an unlimited number of attempts. * - * @param null|int $attempts + * @param null|int $attempts * * @return Question The current instance * @@ -211,9 +211,9 @@ class Question /** * Sets a normalizer for the response. * - * The normalizer can ba a callable (a string), a closure or a class implementing __invoke. + * The normalizer can be a callable (a string), a closure or a class implementing __invoke. * - * @param string|Closure $normalizer + * @param string|\Closure $normalizer * * @return Question The current instance */ @@ -229,7 +229,7 @@ class Question * * The normalizer can ba a callable (a string), a closure or a class implementing __invoke. * - * @return string|Closure + * @return string|\Closure */ public function getNormalizer() { diff --git a/vendor/symfony/console/Symfony/Component/Console/Tester/ApplicationTester.php b/vendor/symfony/console/Symfony/Component/Console/Tester/ApplicationTester.php index b8f9faa98d..da8a19ce50 100644 --- a/vendor/symfony/console/Symfony/Component/Console/Tester/ApplicationTester.php +++ b/vendor/symfony/console/Symfony/Component/Console/Tester/ApplicationTester.php @@ -119,7 +119,7 @@ class ApplicationTester /** * Gets the status code returned by the last execution of the application. * - * @return int The status code + * @return int The status code */ public function getStatusCode() { diff --git a/vendor/symfony/console/Symfony/Component/Console/Tester/CommandTester.php b/vendor/symfony/console/Symfony/Component/Console/Tester/CommandTester.php index 7ebc8631ef..f6079c63b5 100644 --- a/vendor/symfony/console/Symfony/Component/Console/Tester/CommandTester.php +++ b/vendor/symfony/console/Symfony/Component/Console/Tester/CommandTester.php @@ -123,7 +123,7 @@ class CommandTester /** * Gets the status code returned by the last execution of the application. * - * @return int The status code + * @return int The status code */ public function getStatusCode() { diff --git a/vendor/symfony/console/Symfony/Component/Console/Tests/ApplicationTest.php b/vendor/symfony/console/Symfony/Component/Console/Tests/ApplicationTest.php index 49d94e2b28..cfcd9363ce 100644 --- a/vendor/symfony/console/Symfony/Component/Console/Tests/ApplicationTest.php +++ b/vendor/symfony/console/Symfony/Component/Console/Tests/ApplicationTest.php @@ -480,8 +480,10 @@ class ApplicationTest extends \PHPUnit_Framework_TestCase } } - public function testAsText() + public function testLegacyAsText() { + $this->iniSet('error_reporting', -1 & ~E_USER_DEPRECATED); + $application = new Application(); $application->add(new \FooCommand()); $this->ensureStaticCommandHelp($application); @@ -489,8 +491,10 @@ class ApplicationTest extends \PHPUnit_Framework_TestCase $this->assertStringEqualsFile(self::$fixturesPath.'/application_astext2.txt', $this->normalizeLineBreaks($application->asText('foo')), '->asText() returns a text representation of the application'); } - public function testAsXml() + public function testLegacyAsXml() { + $this->iniSet('error_reporting', -1 & ~E_USER_DEPRECATED); + $application = new Application(); $application->add(new \FooCommand()); $this->ensureStaticCommandHelp($application); @@ -994,7 +998,6 @@ class ApplicationTest extends \PHPUnit_Framework_TestCase $tester = new ApplicationTester($application); $tester->run(array('command' => 'help')); - $this->assertTrue($tester->getInput()->isInteractive()); $this->assertFalse($tester->getInput()->hasParameterOption(array('--no-interaction', '-n'))); $inputStream = $application->getHelperSet()->get('question')->getInputStream(); diff --git a/vendor/symfony/console/Symfony/Component/Console/Tests/Command/CommandTest.php b/vendor/symfony/console/Symfony/Component/Console/Tests/Command/CommandTest.php index 43693ebbf1..36c14ddec5 100644 --- a/vendor/symfony/console/Symfony/Component/Console/Tests/Command/CommandTest.php +++ b/vendor/symfony/console/Symfony/Component/Console/Tests/Command/CommandTest.php @@ -318,8 +318,10 @@ class CommandTest extends \PHPUnit_Framework_TestCase $output->writeln('from the code...'); } - public function testAsText() + public function testLegacyAsText() { + $this->iniSet('error_reporting', -1 & ~E_USER_DEPRECATED); + $command = new \TestCommand(); $command->setApplication(new Application()); $tester = new CommandTester($command); @@ -327,8 +329,10 @@ class CommandTest extends \PHPUnit_Framework_TestCase $this->assertStringEqualsFile(self::$fixturesPath.'/command_astext.txt', $command->asText(), '->asText() returns a text representation of the command'); } - public function testAsXml() + public function testLegacyAsXml() { + $this->iniSet('error_reporting', -1 & ~E_USER_DEPRECATED); + $command = new \TestCommand(); $command->setApplication(new Application()); $tester = new CommandTester($command); diff --git a/vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/application_1.json b/vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/application_1.json index b8b3c1f09e..7f8d92eefc 100644 --- a/vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/application_1.json +++ b/vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/application_1.json @@ -1 +1 @@ -{"commands":[{"name":"help","usage":"help [--xml] [--format=\"...\"] [--raw] [command_name]","description":"Displays help for a command","help":"The help<\/info> command displays help for a given command:\n\n php app\/console help list<\/info>\n\nYou can also output the help in other formats by using the --format<\/comment> option:\n\n php app\/console help --format=xml list<\/info>\n\nTo display the list of available commands, please use the list<\/info> command.","aliases":[],"definition":{"arguments":{"command_name":{"name":"command_name","is_required":false,"is_array":false,"description":"The command name","default":"help"}},"options":{"xml":{"name":"--xml","shortcut":"","accept_value":false,"is_value_required":false,"is_multiple":false,"description":"To output help as XML","default":false},"format":{"name":"--format","shortcut":"","accept_value":true,"is_value_required":true,"is_multiple":false,"description":"To output help in other formats","default":"txt"},"raw":{"name":"--raw","shortcut":"","accept_value":false,"is_value_required":false,"is_multiple":false,"description":"To output raw command help","default":false},"help":{"name":"--help","shortcut":"-h","accept_value":false,"is_value_required":false,"is_multiple":false,"description":"Display this help message.","default":false},"quiet":{"name":"--quiet","shortcut":"-q","accept_value":false,"is_value_required":false,"is_multiple":false,"description":"Do not output any message.","default":false},"verbose":{"name":"--verbose","shortcut":"-v|-vv|-vvv","accept_value":false,"is_value_required":false,"is_multiple":false,"description":"Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug.","default":false},"version":{"name":"--version","shortcut":"-V","accept_value":false,"is_value_required":false,"is_multiple":false,"description":"Display this application version.","default":false},"ansi":{"name":"--ansi","shortcut":"","accept_value":false,"is_value_required":false,"is_multiple":false,"description":"Force ANSI output.","default":false},"no-ansi":{"name":"--no-ansi","shortcut":"","accept_value":false,"is_value_required":false,"is_multiple":false,"description":"Disable ANSI output.","default":false},"no-interaction":{"name":"--no-interaction","shortcut":"-n","accept_value":false,"is_value_required":false,"is_multiple":false,"description":"Do not ask any interactive question.","default":false}}}},{"name":"list","usage":"list [--xml] [--raw] [--format=\"...\"] [namespace]","description":"Lists commands","help":"The list<\/info> command lists all commands:\n\n php app\/console list<\/info>\n\nYou can also display the commands for a specific namespace:\n\n php app\/console list test<\/info>\n\nYou can also output the information in other formats by using the --format<\/comment> option:\n\n php app\/console list --format=xml<\/info>\n\nIt's also possible to get raw list of commands (useful for embedding command runner):\n\n php app\/console list --raw<\/info>","aliases":[],"definition":{"arguments":{"namespace":{"name":"namespace","is_required":false,"is_array":false,"description":"The namespace name","default":null}},"options":{"xml":{"name":"--xml","shortcut":"","accept_value":false,"is_value_required":false,"is_multiple":false,"description":"To output list as XML","default":false},"raw":{"name":"--raw","shortcut":"","accept_value":false,"is_value_required":false,"is_multiple":false,"description":"To output raw command list","default":false},"format":{"name":"--format","shortcut":"","accept_value":true,"is_value_required":true,"is_multiple":false,"description":"To output list in other formats","default":"txt"}}}}],"namespaces":[{"id":"_global","commands":["help","list"]}]} +{"commands":[{"name":"help","usage":"help [--xml] [--format=\"...\"] [--raw] [command_name]","description":"Displays help for a command","help":"The help<\/info> command displays help for a given command:\n\n php app\/console help list<\/info>\n\nYou can also output the help in other formats by using the --format<\/comment> option:\n\n php app\/console help --format=xml list<\/info>\n\nTo display the list of available commands, please use the list<\/info> command.","aliases":[],"definition":{"arguments":{"command_name":{"name":"command_name","is_required":false,"is_array":false,"description":"The command name","default":"help"}},"options":{"xml":{"name":"--xml","shortcut":"","accept_value":false,"is_value_required":false,"is_multiple":false,"description":"To output help as XML","default":false},"format":{"name":"--format","shortcut":"","accept_value":true,"is_value_required":true,"is_multiple":false,"description":"To output help in other formats","default":"txt"},"raw":{"name":"--raw","shortcut":"","accept_value":false,"is_value_required":false,"is_multiple":false,"description":"To output raw command help","default":false},"help":{"name":"--help","shortcut":"-h","accept_value":false,"is_value_required":false,"is_multiple":false,"description":"Display this help message","default":false},"quiet":{"name":"--quiet","shortcut":"-q","accept_value":false,"is_value_required":false,"is_multiple":false,"description":"Do not output any message","default":false},"verbose":{"name":"--verbose","shortcut":"-v|-vv|-vvv","accept_value":false,"is_value_required":false,"is_multiple":false,"description":"Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug","default":false},"version":{"name":"--version","shortcut":"-V","accept_value":false,"is_value_required":false,"is_multiple":false,"description":"Display this application version","default":false},"ansi":{"name":"--ansi","shortcut":"","accept_value":false,"is_value_required":false,"is_multiple":false,"description":"Force ANSI output","default":false},"no-ansi":{"name":"--no-ansi","shortcut":"","accept_value":false,"is_value_required":false,"is_multiple":false,"description":"Disable ANSI output","default":false},"no-interaction":{"name":"--no-interaction","shortcut":"-n","accept_value":false,"is_value_required":false,"is_multiple":false,"description":"Do not ask any interactive question","default":false}}}},{"name":"list","usage":"list [--xml] [--raw] [--format=\"...\"] [namespace]","description":"Lists commands","help":"The list<\/info> command lists all commands:\n\n php app\/console list<\/info>\n\nYou can also display the commands for a specific namespace:\n\n php app\/console list test<\/info>\n\nYou can also output the information in other formats by using the --format<\/comment> option:\n\n php app\/console list --format=xml<\/info>\n\nIt's also possible to get raw list of commands (useful for embedding command runner):\n\n php app\/console list --raw<\/info>","aliases":[],"definition":{"arguments":{"namespace":{"name":"namespace","is_required":false,"is_array":false,"description":"The namespace name","default":null}},"options":{"xml":{"name":"--xml","shortcut":"","accept_value":false,"is_value_required":false,"is_multiple":false,"description":"To output list as XML","default":false},"raw":{"name":"--raw","shortcut":"","accept_value":false,"is_value_required":false,"is_multiple":false,"description":"To output raw command list","default":false},"format":{"name":"--format","shortcut":"","accept_value":true,"is_value_required":true,"is_multiple":false,"description":"To output list in other formats","default":"txt"}}}}],"namespaces":[{"id":"_global","commands":["help","list"]}]} diff --git a/vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/application_1.md b/vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/application_1.md index 5779a7095a..e3804162df 100644 --- a/vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/application_1.md +++ b/vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/application_1.md @@ -70,7 +70,7 @@ To display the list of available commands, please use the list comm * Accept value: no * Is value required: no * Is multiple: no -* Description: Display this help message. +* Description: Display this help message * Default: `false` **quiet:** @@ -80,7 +80,7 @@ To display the list of available commands, please use the list comm * Accept value: no * Is value required: no * Is multiple: no -* Description: Do not output any message. +* Description: Do not output any message * Default: `false` **verbose:** @@ -90,7 +90,7 @@ To display the list of available commands, please use the list comm * Accept value: no * Is value required: no * Is multiple: no -* Description: Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug. +* Description: Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug * Default: `false` **version:** @@ -100,7 +100,7 @@ To display the list of available commands, please use the list comm * Accept value: no * Is value required: no * Is multiple: no -* Description: Display this application version. +* Description: Display this application version * Default: `false` **ansi:** @@ -110,7 +110,7 @@ To display the list of available commands, please use the list comm * Accept value: no * Is value required: no * Is multiple: no -* Description: Force ANSI output. +* Description: Force ANSI output * Default: `false` **no-ansi:** @@ -120,7 +120,7 @@ To display the list of available commands, please use the list comm * Accept value: no * Is value required: no * Is multiple: no -* Description: Disable ANSI output. +* Description: Disable ANSI output * Default: `false` **no-interaction:** @@ -130,7 +130,7 @@ To display the list of available commands, please use the list comm * Accept value: no * Is value required: no * Is multiple: no -* Description: Do not ask any interactive question. +* Description: Do not ask any interactive question * Default: `false` list diff --git a/vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/application_1.txt b/vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/application_1.txt index 47b8f05f5f..dff9875f63 100644 --- a/vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/application_1.txt +++ b/vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/application_1.txt @@ -4,13 +4,13 @@ [options] command [arguments] Options: - --help (-h) Display this help message. - --quiet (-q) Do not output any message. - --verbose (-v|vv|vvv) Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug. - --version (-V) Display this application version. - --ansi Force ANSI output. - --no-ansi Disable ANSI output. - --no-interaction (-n) Do not ask any interactive question. + --help (-h) Display this help message + --quiet (-q) Do not output any message + --verbose (-v|vv|vvv) Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug + --version (-V) Display this application version + --ansi Force ANSI output + --no-ansi Disable ANSI output + --no-interaction (-n) Do not ask any interactive question Available commands: help Displays help for a command diff --git a/vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/application_1.xml b/vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/application_1.xml index dbd6b6e84b..176310886f 100644 --- a/vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/application_1.xml +++ b/vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/application_1.xml @@ -36,25 +36,25 @@ To output raw command help diff --git a/vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/application_2.json b/vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/application_2.json index 3231ddd532..1655d47e62 100644 --- a/vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/application_2.json +++ b/vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/application_2.json @@ -1 +1 @@ -{"commands":[{"name":"help","usage":"help [--xml] [--format=\"...\"] [--raw] [command_name]","description":"Displays help for a command","help":"The help<\/info> command displays help for a given command:\n\n php app\/console help list<\/info>\n\nYou can also output the help in other formats by using the --format<\/comment> option:\n\n php app\/console help --format=xml list<\/info>\n\nTo display the list of available commands, please use the list<\/info> command.","aliases":[],"definition":{"arguments":{"command_name":{"name":"command_name","is_required":false,"is_array":false,"description":"The command name","default":"help"}},"options":{"xml":{"name":"--xml","shortcut":"","accept_value":false,"is_value_required":false,"is_multiple":false,"description":"To output help as XML","default":false},"format":{"name":"--format","shortcut":"","accept_value":true,"is_value_required":true,"is_multiple":false,"description":"To output help in other formats","default":"txt"},"raw":{"name":"--raw","shortcut":"","accept_value":false,"is_value_required":false,"is_multiple":false,"description":"To output raw command help","default":false},"help":{"name":"--help","shortcut":"-h","accept_value":false,"is_value_required":false,"is_multiple":false,"description":"Display this help message.","default":false},"quiet":{"name":"--quiet","shortcut":"-q","accept_value":false,"is_value_required":false,"is_multiple":false,"description":"Do not output any message.","default":false},"verbose":{"name":"--verbose","shortcut":"-v|-vv|-vvv","accept_value":false,"is_value_required":false,"is_multiple":false,"description":"Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug.","default":false},"version":{"name":"--version","shortcut":"-V","accept_value":false,"is_value_required":false,"is_multiple":false,"description":"Display this application version.","default":false},"ansi":{"name":"--ansi","shortcut":"","accept_value":false,"is_value_required":false,"is_multiple":false,"description":"Force ANSI output.","default":false},"no-ansi":{"name":"--no-ansi","shortcut":"","accept_value":false,"is_value_required":false,"is_multiple":false,"description":"Disable ANSI output.","default":false},"no-interaction":{"name":"--no-interaction","shortcut":"-n","accept_value":false,"is_value_required":false,"is_multiple":false,"description":"Do not ask any interactive question.","default":false}}}},{"name":"list","usage":"list [--xml] [--raw] [--format=\"...\"] [namespace]","description":"Lists commands","help":"The list<\/info> command lists all commands:\n\n php app\/console list<\/info>\n\nYou can also display the commands for a specific namespace:\n\n php app\/console list test<\/info>\n\nYou can also output the information in other formats by using the --format<\/comment> option:\n\n php app\/console list --format=xml<\/info>\n\nIt's also possible to get raw list of commands (useful for embedding command runner):\n\n php app\/console list --raw<\/info>","aliases":[],"definition":{"arguments":{"namespace":{"name":"namespace","is_required":false,"is_array":false,"description":"The namespace name","default":null}},"options":{"xml":{"name":"--xml","shortcut":"","accept_value":false,"is_value_required":false,"is_multiple":false,"description":"To output list as XML","default":false},"raw":{"name":"--raw","shortcut":"","accept_value":false,"is_value_required":false,"is_multiple":false,"description":"To output raw command list","default":false},"format":{"name":"--format","shortcut":"","accept_value":true,"is_value_required":true,"is_multiple":false,"description":"To output list in other formats","default":"txt"}}}},{"name":"descriptor:command1","usage":"descriptor:command1","description":"command 1 description","help":"command 1 help","aliases":["alias1","alias2"],"definition":{"arguments":[],"options":{"help":{"name":"--help","shortcut":"-h","accept_value":false,"is_value_required":false,"is_multiple":false,"description":"Display this help message.","default":false},"quiet":{"name":"--quiet","shortcut":"-q","accept_value":false,"is_value_required":false,"is_multiple":false,"description":"Do not output any message.","default":false},"verbose":{"name":"--verbose","shortcut":"-v|-vv|-vvv","accept_value":false,"is_value_required":false,"is_multiple":false,"description":"Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug.","default":false},"version":{"name":"--version","shortcut":"-V","accept_value":false,"is_value_required":false,"is_multiple":false,"description":"Display this application version.","default":false},"ansi":{"name":"--ansi","shortcut":"","accept_value":false,"is_value_required":false,"is_multiple":false,"description":"Force ANSI output.","default":false},"no-ansi":{"name":"--no-ansi","shortcut":"","accept_value":false,"is_value_required":false,"is_multiple":false,"description":"Disable ANSI output.","default":false},"no-interaction":{"name":"--no-interaction","shortcut":"-n","accept_value":false,"is_value_required":false,"is_multiple":false,"description":"Do not ask any interactive question.","default":false}}}},{"name":"descriptor:command2","usage":"descriptor:command2 [-o|--option_name] argument_name","description":"command 2 description","help":"command 2 help","aliases":[],"definition":{"arguments":{"argument_name":{"name":"argument_name","is_required":true,"is_array":false,"description":"","default":null}},"options":{"option_name":{"name":"--option_name","shortcut":"-o","accept_value":false,"is_value_required":false,"is_multiple":false,"description":"","default":false},"help":{"name":"--help","shortcut":"-h","accept_value":false,"is_value_required":false,"is_multiple":false,"description":"Display this help message.","default":false},"quiet":{"name":"--quiet","shortcut":"-q","accept_value":false,"is_value_required":false,"is_multiple":false,"description":"Do not output any message.","default":false},"verbose":{"name":"--verbose","shortcut":"-v|-vv|-vvv","accept_value":false,"is_value_required":false,"is_multiple":false,"description":"Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug.","default":false},"version":{"name":"--version","shortcut":"-V","accept_value":false,"is_value_required":false,"is_multiple":false,"description":"Display this application version.","default":false},"ansi":{"name":"--ansi","shortcut":"","accept_value":false,"is_value_required":false,"is_multiple":false,"description":"Force ANSI output.","default":false},"no-ansi":{"name":"--no-ansi","shortcut":"","accept_value":false,"is_value_required":false,"is_multiple":false,"description":"Disable ANSI output.","default":false},"no-interaction":{"name":"--no-interaction","shortcut":"-n","accept_value":false,"is_value_required":false,"is_multiple":false,"description":"Do not ask any interactive question.","default":false}}}}],"namespaces":[{"id":"_global","commands":["alias1","alias2","help","list"]},{"id":"descriptor","commands":["descriptor:command1","descriptor:command2"]}]} +{"commands":[{"name":"help","usage":"help [--xml] [--format=\"...\"] [--raw] [command_name]","description":"Displays help for a command","help":"The help<\/info> command displays help for a given command:\n\n php app\/console help list<\/info>\n\nYou can also output the help in other formats by using the --format<\/comment> option:\n\n php app\/console help --format=xml list<\/info>\n\nTo display the list of available commands, please use the list<\/info> command.","aliases":[],"definition":{"arguments":{"command_name":{"name":"command_name","is_required":false,"is_array":false,"description":"The command name","default":"help"}},"options":{"xml":{"name":"--xml","shortcut":"","accept_value":false,"is_value_required":false,"is_multiple":false,"description":"To output help as XML","default":false},"format":{"name":"--format","shortcut":"","accept_value":true,"is_value_required":true,"is_multiple":false,"description":"To output help in other formats","default":"txt"},"raw":{"name":"--raw","shortcut":"","accept_value":false,"is_value_required":false,"is_multiple":false,"description":"To output raw command help","default":false},"help":{"name":"--help","shortcut":"-h","accept_value":false,"is_value_required":false,"is_multiple":false,"description":"Display this help message","default":false},"quiet":{"name":"--quiet","shortcut":"-q","accept_value":false,"is_value_required":false,"is_multiple":false,"description":"Do not output any message","default":false},"verbose":{"name":"--verbose","shortcut":"-v|-vv|-vvv","accept_value":false,"is_value_required":false,"is_multiple":false,"description":"Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug","default":false},"version":{"name":"--version","shortcut":"-V","accept_value":false,"is_value_required":false,"is_multiple":false,"description":"Display this application version","default":false},"ansi":{"name":"--ansi","shortcut":"","accept_value":false,"is_value_required":false,"is_multiple":false,"description":"Force ANSI output","default":false},"no-ansi":{"name":"--no-ansi","shortcut":"","accept_value":false,"is_value_required":false,"is_multiple":false,"description":"Disable ANSI output","default":false},"no-interaction":{"name":"--no-interaction","shortcut":"-n","accept_value":false,"is_value_required":false,"is_multiple":false,"description":"Do not ask any interactive question","default":false}}}},{"name":"list","usage":"list [--xml] [--raw] [--format=\"...\"] [namespace]","description":"Lists commands","help":"The list<\/info> command lists all commands:\n\n php app\/console list<\/info>\n\nYou can also display the commands for a specific namespace:\n\n php app\/console list test<\/info>\n\nYou can also output the information in other formats by using the --format<\/comment> option:\n\n php app\/console list --format=xml<\/info>\n\nIt's also possible to get raw list of commands (useful for embedding command runner):\n\n php app\/console list --raw<\/info>","aliases":[],"definition":{"arguments":{"namespace":{"name":"namespace","is_required":false,"is_array":false,"description":"The namespace name","default":null}},"options":{"xml":{"name":"--xml","shortcut":"","accept_value":false,"is_value_required":false,"is_multiple":false,"description":"To output list as XML","default":false},"raw":{"name":"--raw","shortcut":"","accept_value":false,"is_value_required":false,"is_multiple":false,"description":"To output raw command list","default":false},"format":{"name":"--format","shortcut":"","accept_value":true,"is_value_required":true,"is_multiple":false,"description":"To output list in other formats","default":"txt"}}}},{"name":"descriptor:command1","usage":"descriptor:command1","description":"command 1 description","help":"command 1 help","aliases":["alias1","alias2"],"definition":{"arguments":[],"options":{"help":{"name":"--help","shortcut":"-h","accept_value":false,"is_value_required":false,"is_multiple":false,"description":"Display this help message","default":false},"quiet":{"name":"--quiet","shortcut":"-q","accept_value":false,"is_value_required":false,"is_multiple":false,"description":"Do not output any message","default":false},"verbose":{"name":"--verbose","shortcut":"-v|-vv|-vvv","accept_value":false,"is_value_required":false,"is_multiple":false,"description":"Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug","default":false},"version":{"name":"--version","shortcut":"-V","accept_value":false,"is_value_required":false,"is_multiple":false,"description":"Display this application version","default":false},"ansi":{"name":"--ansi","shortcut":"","accept_value":false,"is_value_required":false,"is_multiple":false,"description":"Force ANSI output","default":false},"no-ansi":{"name":"--no-ansi","shortcut":"","accept_value":false,"is_value_required":false,"is_multiple":false,"description":"Disable ANSI output","default":false},"no-interaction":{"name":"--no-interaction","shortcut":"-n","accept_value":false,"is_value_required":false,"is_multiple":false,"description":"Do not ask any interactive question","default":false}}}},{"name":"descriptor:command2","usage":"descriptor:command2 [-o|--option_name] argument_name","description":"command 2 description","help":"command 2 help","aliases":[],"definition":{"arguments":{"argument_name":{"name":"argument_name","is_required":true,"is_array":false,"description":"","default":null}},"options":{"option_name":{"name":"--option_name","shortcut":"-o","accept_value":false,"is_value_required":false,"is_multiple":false,"description":"","default":false},"help":{"name":"--help","shortcut":"-h","accept_value":false,"is_value_required":false,"is_multiple":false,"description":"Display this help message","default":false},"quiet":{"name":"--quiet","shortcut":"-q","accept_value":false,"is_value_required":false,"is_multiple":false,"description":"Do not output any message","default":false},"verbose":{"name":"--verbose","shortcut":"-v|-vv|-vvv","accept_value":false,"is_value_required":false,"is_multiple":false,"description":"Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug","default":false},"version":{"name":"--version","shortcut":"-V","accept_value":false,"is_value_required":false,"is_multiple":false,"description":"Display this application version","default":false},"ansi":{"name":"--ansi","shortcut":"","accept_value":false,"is_value_required":false,"is_multiple":false,"description":"Force ANSI output","default":false},"no-ansi":{"name":"--no-ansi","shortcut":"","accept_value":false,"is_value_required":false,"is_multiple":false,"description":"Disable ANSI output","default":false},"no-interaction":{"name":"--no-interaction","shortcut":"-n","accept_value":false,"is_value_required":false,"is_multiple":false,"description":"Do not ask any interactive question","default":false}}}}],"namespaces":[{"id":"_global","commands":["alias1","alias2","help","list"]},{"id":"descriptor","commands":["descriptor:command1","descriptor:command2"]}]} diff --git a/vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/application_2.md b/vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/application_2.md index 3d76373cff..7492886ea3 100644 --- a/vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/application_2.md +++ b/vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/application_2.md @@ -77,7 +77,7 @@ To display the list of available commands, please use the list comm * Accept value: no * Is value required: no * Is multiple: no -* Description: Display this help message. +* Description: Display this help message * Default: `false` **quiet:** @@ -87,7 +87,7 @@ To display the list of available commands, please use the list comm * Accept value: no * Is value required: no * Is multiple: no -* Description: Do not output any message. +* Description: Do not output any message * Default: `false` **verbose:** @@ -97,7 +97,7 @@ To display the list of available commands, please use the list comm * Accept value: no * Is value required: no * Is multiple: no -* Description: Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug. +* Description: Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug * Default: `false` **version:** @@ -107,7 +107,7 @@ To display the list of available commands, please use the list comm * Accept value: no * Is value required: no * Is multiple: no -* Description: Display this application version. +* Description: Display this application version * Default: `false` **ansi:** @@ -117,7 +117,7 @@ To display the list of available commands, please use the list comm * Accept value: no * Is value required: no * Is multiple: no -* Description: Force ANSI output. +* Description: Force ANSI output * Default: `false` **no-ansi:** @@ -127,7 +127,7 @@ To display the list of available commands, please use the list comm * Accept value: no * Is value required: no * Is multiple: no -* Description: Disable ANSI output. +* Description: Disable ANSI output * Default: `false` **no-interaction:** @@ -137,7 +137,7 @@ To display the list of available commands, please use the list comm * Accept value: no * Is value required: no * Is multiple: no -* Description: Do not ask any interactive question. +* Description: Do not ask any interactive question * Default: `false` list @@ -223,7 +223,7 @@ command 1 help * Accept value: no * Is value required: no * Is multiple: no -* Description: Display this help message. +* Description: Display this help message * Default: `false` **quiet:** @@ -233,7 +233,7 @@ command 1 help * Accept value: no * Is value required: no * Is multiple: no -* Description: Do not output any message. +* Description: Do not output any message * Default: `false` **verbose:** @@ -243,7 +243,7 @@ command 1 help * Accept value: no * Is value required: no * Is multiple: no -* Description: Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug. +* Description: Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug * Default: `false` **version:** @@ -253,7 +253,7 @@ command 1 help * Accept value: no * Is value required: no * Is multiple: no -* Description: Display this application version. +* Description: Display this application version * Default: `false` **ansi:** @@ -263,7 +263,7 @@ command 1 help * Accept value: no * Is value required: no * Is multiple: no -* Description: Force ANSI output. +* Description: Force ANSI output * Default: `false` **no-ansi:** @@ -273,7 +273,7 @@ command 1 help * Accept value: no * Is value required: no * Is multiple: no -* Description: Disable ANSI output. +* Description: Disable ANSI output * Default: `false` **no-interaction:** @@ -283,7 +283,7 @@ command 1 help * Accept value: no * Is value required: no * Is multiple: no -* Description: Do not ask any interactive question. +* Description: Do not ask any interactive question * Default: `false` descriptor:command2 @@ -324,7 +324,7 @@ command 2 help * Accept value: no * Is value required: no * Is multiple: no -* Description: Display this help message. +* Description: Display this help message * Default: `false` **quiet:** @@ -334,7 +334,7 @@ command 2 help * Accept value: no * Is value required: no * Is multiple: no -* Description: Do not output any message. +* Description: Do not output any message * Default: `false` **verbose:** @@ -344,7 +344,7 @@ command 2 help * Accept value: no * Is value required: no * Is multiple: no -* Description: Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug. +* Description: Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug * Default: `false` **version:** @@ -354,7 +354,7 @@ command 2 help * Accept value: no * Is value required: no * Is multiple: no -* Description: Display this application version. +* Description: Display this application version * Default: `false` **ansi:** @@ -364,7 +364,7 @@ command 2 help * Accept value: no * Is value required: no * Is multiple: no -* Description: Force ANSI output. +* Description: Force ANSI output * Default: `false` **no-ansi:** @@ -374,7 +374,7 @@ command 2 help * Accept value: no * Is value required: no * Is multiple: no -* Description: Disable ANSI output. +* Description: Disable ANSI output * Default: `false` **no-interaction:** @@ -384,5 +384,5 @@ command 2 help * Accept value: no * Is value required: no * Is multiple: no -* Description: Do not ask any interactive question. +* Description: Do not ask any interactive question * Default: `false` diff --git a/vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/application_2.txt b/vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/application_2.txt index 4dbe271902..80619a71aa 100644 --- a/vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/application_2.txt +++ b/vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/application_2.txt @@ -4,13 +4,13 @@ [options] command [arguments] Options: - --help (-h) Display this help message. - --quiet (-q) Do not output any message. - --verbose (-v|vv|vvv) Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug. - --version (-V) Display this application version. - --ansi Force ANSI output. - --no-ansi Disable ANSI output. - --no-interaction (-n) Do not ask any interactive question. + --help (-h) Display this help message + --quiet (-q) Do not output any message + --verbose (-v|vv|vvv) Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug + --version (-V) Display this application version + --ansi Force ANSI output + --no-ansi Disable ANSI output + --no-interaction (-n) Do not ask any interactive question Available commands: alias1 command 1 description diff --git a/vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/application_2.xml b/vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/application_2.xml index daab7a99ca..a7d65b4f86 100644 --- a/vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/application_2.xml +++ b/vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/application_2.xml @@ -36,25 +36,25 @@ To output raw command help @@ -109,25 +109,25 @@ @@ -147,25 +147,25 @@ diff --git a/vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/application_astext1.txt b/vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/application_astext1.txt index 248537df03..c87fde4c92 100644 --- a/vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/application_astext1.txt +++ b/vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/application_astext1.txt @@ -4,13 +4,13 @@ [options] command [arguments] Options: - --help (-h) Display this help message. - --quiet (-q) Do not output any message. - --verbose (-v|vv|vvv) Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug. - --version (-V) Display this application version. - --ansi Force ANSI output. - --no-ansi Disable ANSI output. - --no-interaction (-n) Do not ask any interactive question. + --help (-h) Display this help message + --quiet (-q) Do not output any message + --verbose (-v|vv|vvv) Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug + --version (-V) Display this application version + --ansi Force ANSI output + --no-ansi Disable ANSI output + --no-interaction (-n) Do not ask any interactive question Available commands: afoobar The foo:bar command diff --git a/vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/application_astext2.txt b/vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/application_astext2.txt index 16310aa79f..130ac5252b 100644 --- a/vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/application_astext2.txt +++ b/vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/application_astext2.txt @@ -4,13 +4,13 @@ [options] command [arguments] Options: - --help (-h) Display this help message. - --quiet (-q) Do not output any message. - --verbose (-v|vv|vvv) Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug. - --version (-V) Display this application version. - --ansi Force ANSI output. - --no-ansi Disable ANSI output. - --no-interaction (-n) Do not ask any interactive question. + --help (-h) Display this help message + --quiet (-q) Do not output any message + --verbose (-v|vv|vvv) Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug + --version (-V) Display this application version + --ansi Force ANSI output + --no-ansi Disable ANSI output + --no-interaction (-n) Do not ask any interactive question Available commands for the "foo" namespace: foo:bar The foo:bar command diff --git a/vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/application_asxml1.txt b/vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/application_asxml1.txt index ffff85970b..d9567819a1 100644 --- a/vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/application_asxml1.txt +++ b/vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/application_asxml1.txt @@ -36,25 +36,25 @@ To output raw command help @@ -108,25 +108,25 @@ diff --git a/vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/application_asxml2.txt b/vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/application_asxml2.txt index 0d0ab95e98..0b30b201f2 100644 --- a/vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/application_asxml2.txt +++ b/vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/application_asxml2.txt @@ -11,25 +11,25 @@ diff --git a/vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/application_run1.txt b/vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/application_run1.txt index e4be367c85..0df294ad26 100644 --- a/vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/application_run1.txt +++ b/vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/application_run1.txt @@ -4,13 +4,13 @@ Usage: [options] command [arguments] Options: - --help (-h) Display this help message. - --quiet (-q) Do not output any message. - --verbose (-v|vv|vvv) Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug. - --version (-V) Display this application version. - --ansi Force ANSI output. - --no-ansi Disable ANSI output. - --no-interaction (-n) Do not ask any interactive question. + --help (-h) Display this help message + --quiet (-q) Do not output any message + --verbose (-v|vv|vvv) Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug + --version (-V) Display this application version + --ansi Force ANSI output + --no-ansi Disable ANSI output + --no-interaction (-n) Do not ask any interactive question Available commands: help Displays help for a command diff --git a/vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/application_run2.txt b/vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/application_run2.txt index e456a48466..6963c0f164 100644 --- a/vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/application_run2.txt +++ b/vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/application_run2.txt @@ -9,13 +9,13 @@ Options: --xml To output help as XML --format To output help in other formats (default: "txt") --raw To output raw command help - --help (-h) Display this help message. - --quiet (-q) Do not output any message. - --verbose (-v|vv|vvv) Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug. - --version (-V) Display this application version. - --ansi Force ANSI output. - --no-ansi Disable ANSI output. - --no-interaction (-n) Do not ask any interactive question. + --help (-h) Display this help message + --quiet (-q) Do not output any message + --verbose (-v|vv|vvv) Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug + --version (-V) Display this application version + --ansi Force ANSI output + --no-ansi Disable ANSI output + --no-interaction (-n) Do not ask any interactive question Help: The help command displays help for a given command: diff --git a/vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/command_astext.txt b/vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/command_astext.txt index 12fc4b6fb1..5d703512f7 100644 --- a/vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/command_astext.txt +++ b/vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/command_astext.txt @@ -6,13 +6,13 @@ command The command to execute Options: - --help (-h) Display this help message. - --quiet (-q) Do not output any message. - --verbose (-v|vv|vvv) Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug. - --version (-V) Display this application version. - --ansi Force ANSI output. - --no-ansi Disable ANSI output. - --no-interaction (-n) Do not ask any interactive question. + --help (-h) Display this help message + --quiet (-q) Do not output any message + --verbose (-v|vv|vvv) Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug + --version (-V) Display this application version + --ansi Force ANSI output + --no-ansi Disable ANSI output + --no-interaction (-n) Do not ask any interactive question Help: help diff --git a/vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/command_asxml.txt b/vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/command_asxml.txt index 04291a48be..57542faad5 100644 --- a/vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/command_asxml.txt +++ b/vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/command_asxml.txt @@ -14,25 +14,25 @@ diff --git a/vendor/symfony/console/Symfony/Component/Console/Tests/Helper/DialogHelperTest.php b/vendor/symfony/console/Symfony/Component/Console/Tests/Helper/DialogHelperTest.php deleted file mode 100644 index e8404a4a68..0000000000 --- a/vendor/symfony/console/Symfony/Component/Console/Tests/Helper/DialogHelperTest.php +++ /dev/null @@ -1,192 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Tests\Helper; - -use Symfony\Component\Console\Input\ArrayInput; -use Symfony\Component\Console\Helper\DialogHelper; -use Symfony\Component\Console\Helper\HelperSet; -use Symfony\Component\Console\Helper\FormatterHelper; -use Symfony\Component\Console\Output\StreamOutput; - -class DialogHelperTest extends \PHPUnit_Framework_TestCase -{ - public function testSelect() - { - $dialog = new DialogHelper(); - - $helperSet = new HelperSet(array(new FormatterHelper())); - $dialog->setHelperSet($helperSet); - - $heroes = array('Superman', 'Batman', 'Spiderman'); - - $dialog->setInputStream($this->getInputStream("\n1\n 1 \nFabien\n1\nFabien\n1\n0,2\n 0 , 2 \n\n\n")); - $this->assertEquals('2', $dialog->select($this->getOutputStream(), 'What is your favorite superhero?', $heroes, '2')); - $this->assertEquals('1', $dialog->select($this->getOutputStream(), 'What is your favorite superhero?', $heroes)); - $this->assertEquals('1', $dialog->select($this->getOutputStream(), 'What is your favorite superhero?', $heroes)); - $this->assertEquals('1', $dialog->select($output = $this->getOutputStream(), 'What is your favorite superhero?', $heroes, null, false, 'Input "%s" is not a superhero!', false)); - - rewind($output->getStream()); - $this->assertContains('Input "Fabien" is not a superhero!', stream_get_contents($output->getStream())); - - try { - $this->assertEquals('1', $dialog->select($output = $this->getOutputStream(), 'What is your favorite superhero?', $heroes, null, 1)); - $this->fail(); - } catch (\InvalidArgumentException $e) { - $this->assertEquals('Value "Fabien" is invalid', $e->getMessage()); - } - - $this->assertEquals(array('1'), $dialog->select($this->getOutputStream(), 'What is your favorite superhero?', $heroes, null, false, 'Input "%s" is not a superhero!', true)); - $this->assertEquals(array('0', '2'), $dialog->select($this->getOutputStream(), 'What is your favorite superhero?', $heroes, null, false, 'Input "%s" is not a superhero!', true)); - $this->assertEquals(array('0', '2'), $dialog->select($this->getOutputStream(), 'What is your favorite superhero?', $heroes, null, false, 'Input "%s" is not a superhero!', true)); - $this->assertEquals(array('0', '1'), $dialog->select($this->getOutputStream(), 'What is your favorite superhero?', $heroes, '0,1', false, 'Input "%s" is not a superhero!', true)); - $this->assertEquals(array('0', '1'), $dialog->select($this->getOutputStream(), 'What is your favorite superhero?', $heroes, ' 0 , 1 ', false, 'Input "%s" is not a superhero!', true)); - } - - public function testAsk() - { - $dialog = new DialogHelper(); - - $dialog->setInputStream($this->getInputStream("\n8AM\n")); - - $this->assertEquals('2PM', $dialog->ask($this->getOutputStream(), 'What time is it?', '2PM')); - $this->assertEquals('8AM', $dialog->ask($output = $this->getOutputStream(), 'What time is it?', '2PM')); - - rewind($output->getStream()); - $this->assertEquals('What time is it?', stream_get_contents($output->getStream())); - } - - public function testAskWithAutocomplete() - { - if (!$this->hasSttyAvailable()) { - $this->markTestSkipped('`stty` is required to test autocomplete functionality'); - } - - // Acm - // AcsTest - // - // - // Test - // - // S - // F00oo - $inputStream = $this->getInputStream("Acm\nAc\177\177s\tTest\n\n\033[A\033[A\n\033[A\033[A\033[A\033[A\033[A\tTest\n\033[B\nS\177\177\033[B\033[B\nF00\177\177oo\t\n"); - - $dialog = new DialogHelper(); - $dialog->setInputStream($inputStream); - - $bundles = array('AcmeDemoBundle', 'AsseticBundle', 'SecurityBundle', 'FooBundle'); - - $this->assertEquals('AcmeDemoBundle', $dialog->ask($this->getOutputStream(), 'Please select a bundle', 'FrameworkBundle', $bundles)); - $this->assertEquals('AsseticBundleTest', $dialog->ask($this->getOutputStream(), 'Please select a bundle', 'FrameworkBundle', $bundles)); - $this->assertEquals('FrameworkBundle', $dialog->ask($this->getOutputStream(), 'Please select a bundle', 'FrameworkBundle', $bundles)); - $this->assertEquals('SecurityBundle', $dialog->ask($this->getOutputStream(), 'Please select a bundle', 'FrameworkBundle', $bundles)); - $this->assertEquals('FooBundleTest', $dialog->ask($this->getOutputStream(), 'Please select a bundle', 'FrameworkBundle', $bundles)); - $this->assertEquals('AcmeDemoBundle', $dialog->ask($this->getOutputStream(), 'Please select a bundle', 'FrameworkBundle', $bundles)); - $this->assertEquals('AsseticBundle', $dialog->ask($this->getOutputStream(), 'Please select a bundle', 'FrameworkBundle', $bundles)); - $this->assertEquals('FooBundle', $dialog->ask($this->getOutputStream(), 'Please select a bundle', 'FrameworkBundle', $bundles)); - } - - /** - * @group tty - */ - public function testAskHiddenResponse() - { - if (defined('PHP_WINDOWS_VERSION_BUILD')) { - $this->markTestSkipped('This test is not supported on Windows'); - } - - $dialog = new DialogHelper(); - - $dialog->setInputStream($this->getInputStream("8AM\n")); - - $this->assertEquals('8AM', $dialog->askHiddenResponse($this->getOutputStream(), 'What time is it?')); - } - - public function testAskConfirmation() - { - $dialog = new DialogHelper(); - - $dialog->setInputStream($this->getInputStream("\n\n")); - $this->assertTrue($dialog->askConfirmation($this->getOutputStream(), 'Do you like French fries?')); - $this->assertFalse($dialog->askConfirmation($this->getOutputStream(), 'Do you like French fries?', false)); - - $dialog->setInputStream($this->getInputStream("y\nyes\n")); - $this->assertTrue($dialog->askConfirmation($this->getOutputStream(), 'Do you like French fries?', false)); - $this->assertTrue($dialog->askConfirmation($this->getOutputStream(), 'Do you like French fries?', false)); - - $dialog->setInputStream($this->getInputStream("n\nno\n")); - $this->assertFalse($dialog->askConfirmation($this->getOutputStream(), 'Do you like French fries?', true)); - $this->assertFalse($dialog->askConfirmation($this->getOutputStream(), 'Do you like French fries?', true)); - } - - public function testAskAndValidate() - { - $dialog = new DialogHelper(); - $helperSet = new HelperSet(array(new FormatterHelper())); - $dialog->setHelperSet($helperSet); - - $question = 'What color was the white horse of Henry IV?'; - $error = 'This is not a color!'; - $validator = function ($color) use ($error) { - if (!in_array($color, array('white', 'black'))) { - throw new \InvalidArgumentException($error); - } - - return $color; - }; - - $dialog->setInputStream($this->getInputStream("\nblack\n")); - $this->assertEquals('white', $dialog->askAndValidate($this->getOutputStream(), $question, $validator, 2, 'white')); - $this->assertEquals('black', $dialog->askAndValidate($this->getOutputStream(), $question, $validator, 2, 'white')); - - $dialog->setInputStream($this->getInputStream("green\nyellow\norange\n")); - try { - $this->assertEquals('white', $dialog->askAndValidate($this->getOutputStream(), $question, $validator, 2, 'white')); - $this->fail(); - } catch (\InvalidArgumentException $e) { - $this->assertEquals($error, $e->getMessage()); - } - } - - public function testNoInteraction() - { - $dialog = new DialogHelper(); - - $input = new ArrayInput(array()); - $input->setInteractive(false); - - $dialog->setInput($input); - - $this->assertEquals('not yet', $dialog->ask($this->getOutputStream(), 'Do you have a job?', 'not yet')); - } - - protected function getInputStream($input) - { - $stream = fopen('php://memory', 'r+', false); - fputs($stream, $input); - rewind($stream); - - return $stream; - } - - protected function getOutputStream() - { - return new StreamOutput(fopen('php://memory', 'r+', false)); - } - - private function hasSttyAvailable() - { - exec('stty 2>&1', $output, $exitcode); - - return $exitcode === 0; - } -} diff --git a/vendor/symfony/console/Symfony/Component/Console/Tests/Helper/ProcessHelperTest.php b/vendor/symfony/console/Symfony/Component/Console/Tests/Helper/ProcessHelperTest.php index 327247c3d8..2e333dc05e 100644 --- a/vendor/symfony/console/Symfony/Component/Console/Tests/Helper/ProcessHelperTest.php +++ b/vendor/symfony/console/Symfony/Component/Console/Tests/Helper/ProcessHelperTest.php @@ -84,7 +84,7 @@ EOT; EOT; $errorMessage = 'An error occurred'; - if (defined('PHP_WINDOWS_VERSION_BUILD')) { + if ('\\' === DIRECTORY_SEPARATOR) { $successOutputProcessDebug = str_replace("'", '"', $successOutputProcessDebug); } diff --git a/vendor/symfony/console/Symfony/Component/Console/Tests/Helper/ProgressHelperTest.php b/vendor/symfony/console/Symfony/Component/Console/Tests/Helper/ProgressHelperTest.php deleted file mode 100644 index 7bc475fce0..0000000000 --- a/vendor/symfony/console/Symfony/Component/Console/Tests/Helper/ProgressHelperTest.php +++ /dev/null @@ -1,224 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Tests\Helper; - -use Symfony\Component\Console\Helper\ProgressHelper; -use Symfony\Component\Console\Output\StreamOutput; - -class ProgressHelperTest extends \PHPUnit_Framework_TestCase -{ - public function testAdvance() - { - $progress = new ProgressHelper(); - $progress->start($output = $this->getOutputStream()); - $progress->advance(); - - rewind($output->getStream()); - $this->assertEquals($this->generateOutput(' 1 [->--------------------------]'), stream_get_contents($output->getStream())); - } - - public function testAdvanceWithStep() - { - $progress = new ProgressHelper(); - $progress->start($output = $this->getOutputStream()); - $progress->advance(5); - - rewind($output->getStream()); - $this->assertEquals($this->generateOutput(' 5 [----->----------------------]'), stream_get_contents($output->getStream())); - } - - public function testAdvanceMultipleTimes() - { - $progress = new ProgressHelper(); - $progress->start($output = $this->getOutputStream()); - $progress->advance(3); - $progress->advance(2); - - rewind($output->getStream()); - $this->assertEquals($this->generateOutput(' 3 [--->------------------------]').$this->generateOutput(' 5 [----->----------------------]'), stream_get_contents($output->getStream())); - } - - public function testCustomizations() - { - $progress = new ProgressHelper(); - $progress->setBarWidth(10); - $progress->setBarCharacter('_'); - $progress->setEmptyBarCharacter(' '); - $progress->setProgressCharacter('/'); - $progress->setFormat(' %current%/%max% [%bar%] %percent%%'); - $progress->start($output = $this->getOutputStream(), 10); - $progress->advance(); - - rewind($output->getStream()); - $this->assertEquals($this->generateOutput(' 1/10 [_/ ] 10%'), stream_get_contents($output->getStream())); - } - - public function testPercent() - { - $progress = new ProgressHelper(); - $progress->start($output = $this->getOutputStream(), 50); - $progress->display(); - $progress->advance(); - $progress->advance(); - - rewind($output->getStream()); - $this->assertEquals($this->generateOutput(' 0/50 [>---------------------------] 0%').$this->generateOutput(' 1/50 [>---------------------------] 2%').$this->generateOutput(' 2/50 [=>--------------------------] 4%'), stream_get_contents($output->getStream())); - } - - public function testOverwriteWithShorterLine() - { - $progress = new ProgressHelper(); - $progress->setFormat(' %current%/%max% [%bar%] %percent%%'); - $progress->start($output = $this->getOutputStream(), 50); - $progress->display(); - $progress->advance(); - - // set shorter format - $progress->setFormat(' %current%/%max% [%bar%]'); - $progress->advance(); - - rewind($output->getStream()); - $this->assertEquals( - $this->generateOutput(' 0/50 [>---------------------------] 0%'). - $this->generateOutput(' 1/50 [>---------------------------] 2%'). - $this->generateOutput(' 2/50 [=>--------------------------] '), - stream_get_contents($output->getStream()) - ); - } - - public function testSetCurrentProgress() - { - $progress = new ProgressHelper(); - $progress->start($output = $this->getOutputStream(), 50); - $progress->display(); - $progress->advance(); - $progress->setCurrent(15); - $progress->setCurrent(25); - - rewind($output->getStream()); - $this->assertEquals( - $this->generateOutput(' 0/50 [>---------------------------] 0%'). - $this->generateOutput(' 1/50 [>---------------------------] 2%'). - $this->generateOutput(' 15/50 [========>-------------------] 30%'). - $this->generateOutput(' 25/50 [==============>-------------] 50%'), - stream_get_contents($output->getStream()) - ); - } - - /** - * @expectedException \LogicException - * @expectedExceptionMessage You must start the progress bar - */ - public function testSetCurrentBeforeStarting() - { - $progress = new ProgressHelper(); - $progress->setCurrent(15); - } - - /** - * @expectedException \LogicException - * @expectedExceptionMessage You can't regress the progress bar - */ - public function testRegressProgress() - { - $progress = new ProgressHelper(); - $progress->start($output = $this->getOutputStream(), 50); - $progress->setCurrent(15); - $progress->setCurrent(10); - } - - public function testRedrawFrequency() - { - $progress = $this->getMock('Symfony\Component\Console\Helper\ProgressHelper', array('display')); - $progress->expects($this->exactly(4)) - ->method('display'); - - $progress->setRedrawFrequency(2); - - $progress->start($output = $this->getOutputStream(), 6); - $progress->setCurrent(1); - $progress->advance(2); - $progress->advance(2); - $progress->advance(1); - } - - public function testMultiByteSupport() - { - if (!function_exists('mb_strlen') || (false === $encoding = mb_detect_encoding('■'))) { - $this->markTestSkipped('The mbstring extension is needed for multi-byte support'); - } - - $progress = new ProgressHelper(); - $progress->start($output = $this->getOutputStream()); - $progress->setBarCharacter('■'); - $progress->advance(3); - - rewind($output->getStream()); - $this->assertEquals($this->generateOutput(' 3 [■■■>------------------------]'), stream_get_contents($output->getStream())); - } - - public function testClear() - { - $progress = new ProgressHelper(); - $progress->start($output = $this->getOutputStream(), 50); - $progress->setCurrent(25); - $progress->clear(); - - rewind($output->getStream()); - $this->assertEquals( - $this->generateOutput(' 25/50 [==============>-------------] 50%').$this->generateOutput(''), - stream_get_contents($output->getStream()) - ); - } - - public function testPercentNotHundredBeforeComplete() - { - $progress = new ProgressHelper(); - $progress->start($output = $this->getOutputStream(), 200); - $progress->display(); - $progress->advance(199); - $progress->advance(); - - rewind($output->getStream()); - $this->assertEquals($this->generateOutput(' 0/200 [>---------------------------] 0%').$this->generateOutput(' 199/200 [===========================>] 99%').$this->generateOutput(' 200/200 [============================] 100%'), stream_get_contents($output->getStream())); - } - - public function testNonDecoratedOutput() - { - $progress = new ProgressHelper(); - $progress->start($output = $this->getOutputStream(false)); - $progress->advance(); - - rewind($output->getStream()); - $this->assertEquals('', stream_get_contents($output->getStream())); - } - - protected function getOutputStream($decorated = true) - { - return new StreamOutput(fopen('php://memory', 'r+', false), StreamOutput::VERBOSITY_NORMAL, $decorated); - } - - protected $lastMessagesLength; - - protected function generateOutput($expected) - { - $expectedout = $expected; - - if ($this->lastMessagesLength !== null) { - $expectedout = str_pad($expected, $this->lastMessagesLength, "\x20", STR_PAD_RIGHT); - } - - $this->lastMessagesLength = strlen($expectedout); - - return "\x0D".$expectedout; - } -} diff --git a/vendor/symfony/console/Symfony/Component/Console/Tests/Helper/QuestionHelperTest.php b/vendor/symfony/console/Symfony/Component/Console/Tests/Helper/QuestionHelperTest.php index bba25375dc..e5499fc086 100644 --- a/vendor/symfony/console/Symfony/Component/Console/Tests/Helper/QuestionHelperTest.php +++ b/vendor/symfony/console/Symfony/Component/Console/Tests/Helper/QuestionHelperTest.php @@ -19,6 +19,9 @@ use Symfony\Component\Console\Question\ChoiceQuestion; use Symfony\Component\Console\Question\ConfirmationQuestion; use Symfony\Component\Console\Question\Question; +/** + * @group tty + */ class QuestionHelperTest extends \PHPUnit_Framework_TestCase { public function testAskChoice() @@ -125,12 +128,9 @@ class QuestionHelperTest extends \PHPUnit_Framework_TestCase $this->assertEquals('FooBundle', $dialog->ask($this->createInputInterfaceMock(), $this->createOutputInterface(), $question)); } - /** - * @group tty - */ public function testAskHiddenResponse() { - if (defined('PHP_WINDOWS_VERSION_BUILD')) { + if ('\\' === DIRECTORY_SEPARATOR) { $this->markTestSkipped('This test is not supported on Windows'); } diff --git a/vendor/symfony/console/Symfony/Component/Console/Tests/Helper/TableHelperTest.php b/vendor/symfony/console/Symfony/Component/Console/Tests/Helper/TableHelperTest.php deleted file mode 100644 index f3cda0dabf..0000000000 --- a/vendor/symfony/console/Symfony/Component/Console/Tests/Helper/TableHelperTest.php +++ /dev/null @@ -1,294 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Tests\Helper; - -use Symfony\Component\Console\Helper\TableHelper; -use Symfony\Component\Console\Output\StreamOutput; - -class TableHelperTest extends \PHPUnit_Framework_TestCase -{ - protected $stream; - - protected function setUp() - { - $this->stream = fopen('php://memory', 'r+'); - } - - protected function tearDown() - { - fclose($this->stream); - $this->stream = null; - } - - /** - * @dataProvider testRenderProvider - */ - public function testRender($headers, $rows, $layout, $expected) - { - $table = new TableHelper(); - $table - ->setHeaders($headers) - ->setRows($rows) - ->setLayout($layout) - ; - $table->render($output = $this->getOutputStream()); - - $this->assertEquals($expected, $this->getOutputContent($output)); - } - - /** - * @dataProvider testRenderProvider - */ - public function testRenderAddRows($headers, $rows, $layout, $expected) - { - $table = new TableHelper(); - $table - ->setHeaders($headers) - ->addRows($rows) - ->setLayout($layout) - ; - $table->render($output = $this->getOutputStream()); - - $this->assertEquals($expected, $this->getOutputContent($output)); - } - - /** - * @dataProvider testRenderProvider - */ - public function testRenderAddRowsOneByOne($headers, $rows, $layout, $expected) - { - $table = new TableHelper(); - $table - ->setHeaders($headers) - ->setLayout($layout) - ; - foreach ($rows as $row) { - $table->addRow($row); - } - $table->render($output = $this->getOutputStream()); - - $this->assertEquals($expected, $this->getOutputContent($output)); - } - - public function testRenderProvider() - { - $books = array( - array('99921-58-10-7', 'Divine Comedy', 'Dante Alighieri'), - array('9971-5-0210-0', 'A Tale of Two Cities', 'Charles Dickens'), - array('960-425-059-0', 'The Lord of the Rings', 'J. R. R. Tolkien'), - array('80-902734-1-6', 'And Then There Were None', 'Agatha Christie'), - ); - - return array( - array( - array('ISBN', 'Title', 'Author'), - $books, - TableHelper::LAYOUT_DEFAULT, -<<
      array( - array('ISBN', 'Title', 'Author'), - array( - array('99921-58-10-7', 'Divine Comedy', 'Dante Alighieri'), - array('9971-5-0210-0', 'A Tale of Two Cities', 'Charles Dickens'), - ), - TableHelper::LAYOUT_DEFAULT, -<<
      array( - array('ISBN', 'Title', 'Author'), - array( - array('99921-58-10-700', 'Divine Com', 'Dante Alighieri'), - array('9971-5-0210-0', 'A Tale of Two Cities', 'Charles Dickens'), - ), - TableHelper::LAYOUT_DEFAULT, -<<
      99921-58-10-700 | Divine Com | Dante Alighieri | -| 9971-5-0210-0 | A Tale of Two Cities | Charles Dickens | -+----------------------------------+----------------------+-----------------+ - -TABLE - ), - ); - } - - public function testRenderMultiByte() - { - if (!function_exists('mb_strlen')) { - $this->markTestSkipped('The "mbstring" extension is not available'); - } - - $table = new TableHelper(); - $table - ->setHeaders(array('■■')) - ->setRows(array(array(1234))) - ->setLayout(TableHelper::LAYOUT_DEFAULT) - ; - $table->render($output = $this->getOutputStream()); - - $expected = -<<
      assertEquals($expected, $this->getOutputContent($output)); - } - - protected function getOutputStream() - { - return new StreamOutput($this->stream, StreamOutput::VERBOSITY_NORMAL, false); - } - - protected function getOutputContent(StreamOutput $output) - { - rewind($output->getStream()); - - return str_replace(PHP_EOL, "\n", stream_get_contents($output->getStream())); - } -} diff --git a/vendor/symfony/console/Symfony/Component/Console/Tests/Input/InputDefinitionTest.php b/vendor/symfony/console/Symfony/Component/Console/Tests/Input/InputDefinitionTest.php index 5cf5011774..9e3e982d7d 100644 --- a/vendor/symfony/console/Symfony/Component/Console/Tests/Input/InputDefinitionTest.php +++ b/vendor/symfony/console/Symfony/Component/Console/Tests/Input/InputDefinitionTest.php @@ -373,8 +373,10 @@ class InputDefinitionTest extends \PHPUnit_Framework_TestCase $this->assertEquals('foo1 ... [fooN]', $definition->getSynopsis(), '->getSynopsis() returns a synopsis of arguments and options'); } - public function testAsText() + public function testLegacyAsText() { + $this->iniSet('error_reporting', -1 & ~E_USER_DEPRECATED); + $definition = new InputDefinition(array( new InputArgument('foo', InputArgument::OPTIONAL, 'The foo argument'), new InputArgument('baz', InputArgument::OPTIONAL, 'The baz argument', true), @@ -388,8 +390,10 @@ class InputDefinitionTest extends \PHPUnit_Framework_TestCase $this->assertStringEqualsFile(self::$fixtures.'/definition_astext.txt', $definition->asText(), '->asText() returns a textual representation of the InputDefinition'); } - public function testAsXml() + public function testLegacyAsXml() { + $this->iniSet('error_reporting', -1 & ~E_USER_DEPRECATED); + $definition = new InputDefinition(array( new InputArgument('foo', InputArgument::OPTIONAL, 'The foo argument'), new InputArgument('baz', InputArgument::OPTIONAL, 'The baz argument', true), @@ -398,7 +402,7 @@ class InputDefinitionTest extends \PHPUnit_Framework_TestCase new InputOption('baz', null, InputOption::VALUE_OPTIONAL, 'The baz option', false), new InputOption('bar', 'b', InputOption::VALUE_OPTIONAL, 'The bar option', 'bar'), )); - $this->assertXmlStringEqualsXmlFile(self::$fixtures.'/definition_asxml.txt', $definition->asXml(), '->asText() returns a textual representation of the InputDefinition'); + $this->assertXmlStringEqualsXmlFile(self::$fixtures.'/definition_asxml.txt', $definition->asXml(), '->asXml() returns an XML representation of the InputDefinition'); } protected function initializeArguments() diff --git a/vendor/symfony/console/Symfony/Component/Console/Tests/Input/StringInputTest.php b/vendor/symfony/console/Symfony/Component/Console/Tests/Input/StringInputTest.php index b284320afc..a79a7181dd 100644 --- a/vendor/symfony/console/Symfony/Component/Console/Tests/Input/StringInputTest.php +++ b/vendor/symfony/console/Symfony/Component/Console/Tests/Input/StringInputTest.php @@ -39,8 +39,16 @@ class StringInputTest extends \PHPUnit_Framework_TestCase $input = new StringInput('--foo=bar'); $input->bind($definition); $this->assertEquals('bar', $input->getOption('foo')); + } + + public function testLegacyInputOptionDefinitionInConstructor() + { + $this->iniSet('error_reporting', -1 & ~E_USER_DEPRECATED); + + $definition = new InputDefinition( + array(new InputOption('foo', null, InputOption::VALUE_REQUIRED)) + ); - // definition in constructor $input = new StringInput('--foo=bar', $definition); $this->assertEquals('bar', $input->getOption('foo')); } diff --git a/vendor/symfony/console/Symfony/Component/Console/phpunit.xml.dist b/vendor/symfony/console/Symfony/Component/Console/phpunit.xml.dist index 13e0f33748..f4831ecb85 100644 --- a/vendor/symfony/console/Symfony/Component/Console/phpunit.xml.dist +++ b/vendor/symfony/console/Symfony/Component/Console/phpunit.xml.dist @@ -6,6 +6,10 @@ colors="true" bootstrap="vendor/autoload.php" > + + + + ./Tests/ diff --git a/vendor/symfony/filesystem/Symfony/Component/Filesystem/Exception/IOException.php b/vendor/symfony/filesystem/Symfony/Component/Filesystem/Exception/IOException.php index 4b551af71b..f68a8202c8 100644 --- a/vendor/symfony/filesystem/Symfony/Component/Filesystem/Exception/IOException.php +++ b/vendor/symfony/filesystem/Symfony/Component/Filesystem/Exception/IOException.php @@ -12,7 +12,7 @@ namespace Symfony\Component\Filesystem\Exception; /** - * Exception class thrown when a filesystem operation failure happens + * Exception class thrown when a filesystem operation failure happens. * * @author Romain Neutron * @author Christian Gärtner diff --git a/vendor/symfony/filesystem/Symfony/Component/Filesystem/Filesystem.php b/vendor/symfony/filesystem/Symfony/Component/Filesystem/Filesystem.php index 1812f42e29..ca2778cf56 100644 --- a/vendor/symfony/filesystem/Symfony/Component/Filesystem/Filesystem.php +++ b/vendor/symfony/filesystem/Symfony/Component/Filesystem/Filesystem.php @@ -32,8 +32,8 @@ class Filesystem * @param string $targetFile The target filename * @param bool $override Whether to override an existing file or not * - * @throws FileNotFoundException When originFile doesn't exist - * @throws IOException When copy fails + * @throws FileNotFoundException When originFile doesn't exist + * @throws IOException When copy fails */ public function copy($originFile, $targetFile, $override = false) { @@ -164,7 +164,7 @@ class Filesystem } } else { // https://bugs.php.net/bug.php?id=52176 - if (defined('PHP_WINDOWS_VERSION_MAJOR') && is_dir($file)) { + if ('\\' === DIRECTORY_SEPARATOR && is_dir($file)) { if (true !== @rmdir($file)) { throw new IOException(sprintf('Failed to remove file "%s".', $file), 0, null, $file); } @@ -200,7 +200,7 @@ class Filesystem } /** - * Change the owner of an array of files or directories + * Change the owner of an array of files or directories. * * @param string|array|\Traversable $files A filename, an array of files, or a \Traversable instance to change owner * @param string $user The new owner user name @@ -227,7 +227,7 @@ class Filesystem } /** - * Change the group of an array of files or directories + * Change the group of an array of files or directories. * * @param string|array|\Traversable $files A filename, an array of files, or a \Traversable instance to change group * @param string $group The group name @@ -286,10 +286,9 @@ class Filesystem */ public function symlink($originDir, $targetDir, $copyOnWindows = false) { - $onWindows = strtoupper(substr(php_uname('s'), 0, 3)) === 'WIN'; - - if ($onWindows && $copyOnWindows) { + if ('\\' === DIRECTORY_SEPARATOR && $copyOnWindows) { $this->mirror($originDir, $targetDir); + return; } @@ -308,21 +307,17 @@ class Filesystem if (true !== @symlink($originDir, $targetDir)) { $report = error_get_last(); if (is_array($report)) { - if (defined('PHP_WINDOWS_VERSION_MAJOR') && false !== strpos($report['message'], 'error code(1314)')) { + if ('\\' === DIRECTORY_SEPARATOR && false !== strpos($report['message'], 'error code(1314)')) { throw new IOException('Unable to create symlink due to error code 1314: \'A required privilege is not held by the client\'. Do you have the required Administrator-rights?'); } } throw new IOException(sprintf('Failed to create symbolic link from "%s" to "%s".', $originDir, $targetDir), 0, null, $targetDir); } - - if (!file_exists($targetDir)) { - throw new IOException(sprintf('Symbolic link "%s" is created but appears to be broken.', $targetDir), 0, null, $targetDir); - } } } /** - * Given an existing path, convert it to a path relative to a given starting path + * Given an existing path, convert it to a path relative to a given starting path. * * @param string $endPath Absolute path of target * @param string $startPath Absolute path where traversal begins @@ -332,7 +327,7 @@ class Filesystem public function makePathRelative($endPath, $startPath) { // Normalize separators on Windows - if (defined('PHP_WINDOWS_VERSION_MAJOR')) { + if ('\\' === DIRECTORY_SEPARATOR) { $endPath = strtr($endPath, '\\', '/'); $startPath = strtr($startPath, '\\', '/'); } @@ -422,7 +417,7 @@ class Filesystem } } else { if (is_link($file)) { - $this->symlink($file->getLinkTarget(), $target); + $this->symlink($file->getRealPath(), $target); } elseif (is_dir($file)) { $this->mkdir($target); } elseif (is_file($file)) { diff --git a/vendor/symfony/filesystem/Symfony/Component/Filesystem/LICENSE b/vendor/symfony/filesystem/Symfony/Component/Filesystem/LICENSE index 0b3292cf90..43028bc600 100644 --- a/vendor/symfony/filesystem/Symfony/Component/Filesystem/LICENSE +++ b/vendor/symfony/filesystem/Symfony/Component/Filesystem/LICENSE @@ -1,4 +1,4 @@ -Copyright (c) 2004-2014 Fabien Potencier +Copyright (c) 2004-2015 Fabien Potencier Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/vendor/symfony/filesystem/Symfony/Component/Filesystem/Tests/FilesystemTest.php b/vendor/symfony/filesystem/Symfony/Component/Filesystem/Tests/FilesystemTest.php index 2790e5e4e3..6d284c0c0a 100644 --- a/vendor/symfony/filesystem/Symfony/Component/Filesystem/Tests/FilesystemTest.php +++ b/vendor/symfony/filesystem/Symfony/Component/Filesystem/Tests/FilesystemTest.php @@ -59,7 +59,7 @@ class FilesystemTest extends FilesystemTestCase public function testCopyUnreadableFileFails() { // skip test on Windows; PHP can't easily set file as unreadable on Windows - if (defined('PHP_WINDOWS_VERSION_MAJOR')) { + if ('\\' === DIRECTORY_SEPARATOR) { $this->markTestSkipped('This test cannot run on Windows.'); } @@ -133,7 +133,7 @@ class FilesystemTest extends FilesystemTestCase public function testCopyWithOverrideWithReadOnlyTargetFails() { // skip test on Windows; PHP can't easily set file as unwritable on Windows - if (defined('PHP_WINDOWS_VERSION_MAJOR')) { + if ('\\' === DIRECTORY_SEPARATOR) { $this->markTestSkipped('This test cannot run on Windows.'); } @@ -686,11 +686,14 @@ class FilesystemTest extends FilesystemTestCase $file = $this->workspace.DIRECTORY_SEPARATOR.'file'; $link = $this->workspace.DIRECTORY_SEPARATOR.'link'; - touch($file); - + // $file does not exists right now: creating "broken" links is a wanted feature $this->filesystem->symlink($file, $link); $this->assertTrue(is_link($link)); + + // Create the linked file AFTER creating the link + touch($file); + $this->assertEquals($file, readlink($link)); } @@ -800,7 +803,7 @@ class FilesystemTest extends FilesystemTestCase array('/a/aab/bb/', '/a/aa/', '../aab/bb/'), ); - if (defined('PHP_WINDOWS_VERSION_MAJOR')) { + if ('\\' === DIRECTORY_SEPARATOR) { $paths[] = array('c:\var\lib/symfony/src/Symfony/', 'c:/var/lib/symfony/', 'src/Symfony/'); } @@ -901,6 +904,31 @@ class FilesystemTest extends FilesystemTestCase $this->assertTrue(is_link($targetPath.DIRECTORY_SEPARATOR.'link1')); } + public function testMirrorCopiesRelativeLinkedContents() + { + $this->markAsSkippedIfSymlinkIsMissing(); + + $sourcePath = $this->workspace.DIRECTORY_SEPARATOR.'source'.DIRECTORY_SEPARATOR; + $oldPath = getcwd(); + + mkdir($sourcePath.'nested/', 0777, true); + file_put_contents($sourcePath.'/nested/file1.txt', 'FILE1'); + // Note: Create relative symlink + chdir($sourcePath); + symlink('nested', 'link1'); + + chdir($oldPath); + + $targetPath = $this->workspace.DIRECTORY_SEPARATOR.'target'.DIRECTORY_SEPARATOR; + + $this->filesystem->mirror($sourcePath, $targetPath); + + $this->assertTrue(is_dir($targetPath)); + $this->assertFileEquals($sourcePath.'/nested/file1.txt', $targetPath.DIRECTORY_SEPARATOR.'link1/file1.txt'); + $this->assertTrue(is_link($targetPath.DIRECTORY_SEPARATOR.'link1')); + $this->assertEquals($sourcePath.'nested', readlink($targetPath.DIRECTORY_SEPARATOR.'link1')); + } + /** * @dataProvider providePathsForIsAbsolutePath */ @@ -937,7 +965,7 @@ class FilesystemTest extends FilesystemTestCase $this->assertSame('bar', file_get_contents($filename)); // skip mode check on Windows - if (!defined('PHP_WINDOWS_VERSION_MAJOR')) { + if ('\\' !== DIRECTORY_SEPARATOR) { $this->assertFilePermissions(753, $filename); } } @@ -952,7 +980,7 @@ class FilesystemTest extends FilesystemTestCase $this->assertSame('bar', file_get_contents($filename)); // skip mode check on Windows - if (!defined('PHP_WINDOWS_VERSION_MAJOR')) { + if ('\\' !== DIRECTORY_SEPARATOR) { $this->assertFilePermissions(600, $filename); } } diff --git a/vendor/symfony/filesystem/Symfony/Component/Filesystem/Tests/FilesystemTestCase.php b/vendor/symfony/filesystem/Symfony/Component/Filesystem/Tests/FilesystemTestCase.php index 106c13fb50..eb4f5c3d6a 100644 --- a/vendor/symfony/filesystem/Symfony/Component/Filesystem/Tests/FilesystemTestCase.php +++ b/vendor/symfony/filesystem/Symfony/Component/Filesystem/Tests/FilesystemTestCase.php @@ -13,6 +13,8 @@ namespace Symfony\Component\Filesystem\Tests; class FilesystemTestCase extends \PHPUnit_Framework_TestCase { + private $umask; + /** * @var string $workspace */ @@ -22,7 +24,7 @@ class FilesystemTestCase extends \PHPUnit_Framework_TestCase public static function setUpBeforeClass() { - if (defined('PHP_WINDOWS_VERSION_MAJOR')) { + if ('\\' === DIRECTORY_SEPARATOR) { static::$symlinkOnWindows = true; $originDir = tempnam(sys_get_temp_dir(), 'sl'); $targetDir = tempnam(sys_get_temp_dir(), 'sl'); @@ -37,6 +39,7 @@ class FilesystemTestCase extends \PHPUnit_Framework_TestCase public function setUp() { + $this->umask = umask(0); $this->workspace = rtrim(sys_get_temp_dir(), DIRECTORY_SEPARATOR).DIRECTORY_SEPARATOR.time().rand(0, 1000); mkdir($this->workspace, 0777, true); $this->workspace = realpath($this->workspace); @@ -45,6 +48,7 @@ class FilesystemTestCase extends \PHPUnit_Framework_TestCase public function tearDown() { $this->clean($this->workspace); + umask($this->umask); } /** @@ -65,7 +69,7 @@ class FilesystemTestCase extends \PHPUnit_Framework_TestCase } /** - * @param int $expectedFilePerms expected file permissions as three digits (i.e. 755) + * @param int $expectedFilePerms expected file permissions as three digits (i.e. 755) * @param string $filePath */ protected function assertFilePermissions($expectedFilePerms, $filePath) @@ -106,21 +110,21 @@ class FilesystemTestCase extends \PHPUnit_Framework_TestCase $this->markTestSkipped('symlink is not supported'); } - if (defined('PHP_WINDOWS_VERSION_MAJOR') && false === static::$symlinkOnWindows) { + if ('\\' === DIRECTORY_SEPARATOR && false === static::$symlinkOnWindows) { $this->markTestSkipped('symlink requires "Create symbolic links" privilege on windows'); } } protected function markAsSkippedIfChmodIsMissing() { - if (defined('PHP_WINDOWS_VERSION_MAJOR')) { + if ('\\' === DIRECTORY_SEPARATOR) { $this->markTestSkipped('chmod is not supported on windows'); } } protected function markAsSkippedIfPosixIsMissing() { - if (defined('PHP_WINDOWS_VERSION_MAJOR') || !function_exists('posix_isatty')) { + if ('\\' === DIRECTORY_SEPARATOR || !function_exists('posix_isatty')) { $this->markTestSkipped('Posix is not supported'); } } diff --git a/vendor/symfony/filesystem/Symfony/Component/Filesystem/phpunit.xml.dist b/vendor/symfony/filesystem/Symfony/Component/Filesystem/phpunit.xml.dist index 790283551c..c5b7cb5ee2 100644 --- a/vendor/symfony/filesystem/Symfony/Component/Filesystem/phpunit.xml.dist +++ b/vendor/symfony/filesystem/Symfony/Component/Filesystem/phpunit.xml.dist @@ -6,6 +6,10 @@ colors="true" bootstrap="vendor/autoload.php" > + + + + ./Tests/ diff --git a/vendor/symfony/process/Symfony/Component/Process/ExecutableFinder.php b/vendor/symfony/process/Symfony/Component/Process/ExecutableFinder.php index 6ae74dca17..a9c0a5c879 100644 --- a/vendor/symfony/process/Symfony/Component/Process/ExecutableFinder.php +++ b/vendor/symfony/process/Symfony/Component/Process/ExecutableFinder.php @@ -72,13 +72,13 @@ class ExecutableFinder } $suffixes = array(''); - if (defined('PHP_WINDOWS_VERSION_BUILD')) { + if ('\\' === DIRECTORY_SEPARATOR) { $pathExt = getenv('PATHEXT'); $suffixes = $pathExt ? explode(PATH_SEPARATOR, $pathExt) : $this->suffixes; } foreach ($suffixes as $suffix) { foreach ($dirs as $dir) { - if (is_file($file = $dir.DIRECTORY_SEPARATOR.$name.$suffix) && (defined('PHP_WINDOWS_VERSION_BUILD') || is_executable($file))) { + if (is_file($file = $dir.DIRECTORY_SEPARATOR.$name.$suffix) && ('\\' === DIRECTORY_SEPARATOR || is_executable($file))) { return $file; } } diff --git a/vendor/symfony/process/Symfony/Component/Process/LICENSE b/vendor/symfony/process/Symfony/Component/Process/LICENSE index 0b3292cf90..43028bc600 100644 --- a/vendor/symfony/process/Symfony/Component/Process/LICENSE +++ b/vendor/symfony/process/Symfony/Component/Process/LICENSE @@ -1,4 +1,4 @@ -Copyright (c) 2004-2014 Fabien Potencier +Copyright (c) 2004-2015 Fabien Potencier Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/vendor/symfony/process/Symfony/Component/Process/PhpExecutableFinder.php b/vendor/symfony/process/Symfony/Component/Process/PhpExecutableFinder.php index 7854487a26..91d6d78a67 100644 --- a/vendor/symfony/process/Symfony/Component/Process/PhpExecutableFinder.php +++ b/vendor/symfony/process/Symfony/Component/Process/PhpExecutableFinder.php @@ -60,7 +60,7 @@ class PhpExecutableFinder } $dirs = array(PHP_BINDIR); - if (defined('PHP_WINDOWS_VERSION_BUILD')) { + if ('\\' === DIRECTORY_SEPARATOR) { $dirs[] = 'C:\xampp\php\\'; } diff --git a/vendor/symfony/process/Symfony/Component/Process/Pipes/UnixPipes.php b/vendor/symfony/process/Symfony/Component/Process/Pipes/UnixPipes.php index 69f31467a0..6150d4a709 100644 --- a/vendor/symfony/process/Symfony/Component/Process/Pipes/UnixPipes.php +++ b/vendor/symfony/process/Symfony/Component/Process/Pipes/UnixPipes.php @@ -121,7 +121,7 @@ class UnixPipes extends AbstractPipes $r = $this->pipes; } // discard read on stdin - unset ($r[0]); + unset($r[0]); $w = isset($this->pipes[0]) ? array($this->pipes[0]) : null; $e = null; diff --git a/vendor/symfony/process/Symfony/Component/Process/Pipes/WindowsPipes.php b/vendor/symfony/process/Symfony/Component/Process/Pipes/WindowsPipes.php index ecdf50eee2..86cde67d02 100644 --- a/vendor/symfony/process/Symfony/Component/Process/Pipes/WindowsPipes.php +++ b/vendor/symfony/process/Symfony/Component/Process/Pipes/WindowsPipes.php @@ -230,7 +230,7 @@ class WindowsPipes extends AbstractPipes if (false === $data || (true === $close && feof($r['input']) && '' === $data)) { // no more data to read on input resource // use an empty buffer in the next reads - unset($this->input); + $this->input = null; } } diff --git a/vendor/symfony/process/Symfony/Component/Process/Process.php b/vendor/symfony/process/Symfony/Component/Process/Process.php index b91bc5dea7..bbbc9a018f 100644 --- a/vendor/symfony/process/Symfony/Component/Process/Process.php +++ b/vendor/symfony/process/Symfony/Component/Process/Process.php @@ -155,7 +155,7 @@ class Process // on Gnu/Linux, PHP builds with --enable-maintainer-zts are also affected // @see : https://bugs.php.net/bug.php?id=51800 // @see : https://bugs.php.net/bug.php?id=50524 - if (null === $this->cwd && (defined('ZEND_THREAD_SAFE') || defined('PHP_WINDOWS_VERSION_BUILD'))) { + if (null === $this->cwd && (defined('ZEND_THREAD_SAFE') || '\\' === DIRECTORY_SEPARATOR)) { $this->cwd = getcwd(); } if (null !== $env) { @@ -164,10 +164,10 @@ class Process $this->input = $input; $this->setTimeout($timeout); - $this->useFileHandles = defined('PHP_WINDOWS_VERSION_BUILD'); + $this->useFileHandles = '\\' === DIRECTORY_SEPARATOR; $this->pty = false; $this->enhanceWindowsCompatibility = true; - $this->enhanceSigchildCompatibility = !defined('PHP_WINDOWS_VERSION_BUILD') && $this->isSigchildEnabled(); + $this->enhanceSigchildCompatibility = '\\' !== DIRECTORY_SEPARATOR && $this->isSigchildEnabled(); $this->options = array_replace(array('suppress_errors' => true, 'binary_pipes' => true), $options); } @@ -276,7 +276,7 @@ class Process $commandline = $this->commandline; - if (defined('PHP_WINDOWS_VERSION_BUILD') && $this->enhanceWindowsCompatibility) { + if ('\\' === DIRECTORY_SEPARATOR && $this->enhanceWindowsCompatibility) { $commandline = 'cmd /V:ON /E:ON /C "('.$commandline.')'; foreach ($this->processPipes->getFiles() as $offset => $filename) { $commandline .= ' '.$offset.'>'.ProcessUtils::escapeArgument($filename); @@ -356,8 +356,8 @@ class Process do { $this->checkTimeout(); - $running = defined('PHP_WINDOWS_VERSION_BUILD') ? $this->isRunning() : $this->processPipes->areOpen(); - $close = !defined('PHP_WINDOWS_VERSION_BUILD') || !$running; + $running = '\\' === DIRECTORY_SEPARATOR ? $this->isRunning() : $this->processPipes->areOpen(); + $close = '\\' !== DIRECTORY_SEPARATOR || !$running; $this->readPipes(true, $close); } while ($running); @@ -476,7 +476,7 @@ class Process $this->requireProcessIsStarted(__FUNCTION__); - $this->readPipes(false, defined('PHP_WINDOWS_VERSION_BUILD') ? !$this->processInformation['running'] : true); + $this->readPipes(false, '\\' === DIRECTORY_SEPARATOR ? !$this->processInformation['running'] : true); return $this->stdout; } @@ -499,6 +499,11 @@ class Process $data = $this->getOutput(); $latest = substr($data, $this->incrementalOutputOffset); + + if (false === $latest) { + return ''; + } + $this->incrementalOutputOffset = strlen($data); return $latest; @@ -535,7 +540,7 @@ class Process $this->requireProcessIsStarted(__FUNCTION__); - $this->readPipes(false, defined('PHP_WINDOWS_VERSION_BUILD') ? !$this->processInformation['running'] : true); + $this->readPipes(false, '\\' === DIRECTORY_SEPARATOR ? !$this->processInformation['running'] : true); return $this->stderr; } @@ -559,6 +564,11 @@ class Process $data = $this->getErrorOutput(); $latest = substr($data, $this->incrementalErrorOutputOffset); + + if (false === $latest) { + return ''; + } + $this->incrementalErrorOutputOffset = strlen($data); return $latest; @@ -787,7 +797,7 @@ class Process { $timeoutMicro = microtime(true) + $timeout; if ($this->isRunning()) { - if (defined('PHP_WINDOWS_VERSION_BUILD') && !$this->isSigchildEnabled()) { + if ('\\' === DIRECTORY_SEPARATOR && !$this->isSigchildEnabled()) { exec(sprintf("taskkill /F /T /PID %d 2>&1", $this->getPid()), $output, $exitCode); if ($exitCode > 0) { throw new RuntimeException('Unable to kill the process'); @@ -907,7 +917,7 @@ class Process * * To disable the timeout, set this value to null. * - * @param int|float|null $timeout The timeout in seconds + * @param int|float|null $timeout The timeout in seconds * * @return self The current Process instance. * @@ -936,7 +946,7 @@ class Process */ public function setTty($tty) { - if (defined('PHP_WINDOWS_VERSION_BUILD') && $tty) { + if ('\\' === DIRECTORY_SEPARATOR && $tty) { throw new RuntimeException('TTY mode is not supported on Windows platform.'); } @@ -958,7 +968,7 @@ class Process /** * Sets PTY mode. * - * @param bool $bool + * @param bool $bool * * @return self */ @@ -1228,7 +1238,7 @@ class Process return $result; } - if (defined('PHP_WINDOWS_VERSION_BUILD')) { + if ('\\' === DIRECTORY_SEPARATOR) { return $result = false; } @@ -1249,7 +1259,7 @@ class Process */ private function getDescriptors() { - if (defined('PHP_WINDOWS_VERSION_BUILD')) { + if ('\\' === DIRECTORY_SEPARATOR) { $this->processPipes = WindowsPipes::create($this, $this->input); } else { $this->processPipes = UnixPipes::create($this, $this->input); @@ -1310,7 +1320,7 @@ class Process $this->processInformation = proc_get_status($this->process); $this->captureExitCode(); - $this->readPipes($blocking, defined('PHP_WINDOWS_VERSION_BUILD') ? !$this->processInformation['running'] : true); + $this->readPipes($blocking, '\\' === DIRECTORY_SEPARATOR ? !$this->processInformation['running'] : true); if (!$this->processInformation['running']) { $this->close(); @@ -1341,7 +1351,7 @@ class Process /** * Validates and returns the filtered timeout. * - * @param int|float|null $timeout + * @param int|float|null $timeout * * @return float|null * @@ -1370,11 +1380,12 @@ class Process { $result = $this->processPipes->readAndWrite($blocking, $close); + $callback = $this->callback; foreach ($result as $type => $data) { if (3 == $type) { $this->fallbackExitcode = (int) $data; } else { - call_user_func($this->callback, $type === self::STDOUT ? self::OUT : self::ERR, $data); + $callback($type === self::STDOUT ? self::OUT : self::ERR, $data); } } } diff --git a/vendor/symfony/process/Symfony/Component/Process/ProcessBuilder.php b/vendor/symfony/process/Symfony/Component/Process/ProcessBuilder.php index 71633cd7fa..189ab8a3d1 100644 --- a/vendor/symfony/process/Symfony/Component/Process/ProcessBuilder.php +++ b/vendor/symfony/process/Symfony/Component/Process/ProcessBuilder.php @@ -32,7 +32,7 @@ class ProcessBuilder private $outputDisabled = false; /** - * Constructor + * Constructor. * * @param string[] $arguments An array of arguments */ @@ -129,7 +129,7 @@ class ProcessBuilder } /** - * Sets an environment variable + * Sets an environment variable. * * Setting a variable overrides its previous value. Use `null` to unset a * defined environment variable. @@ -187,7 +187,7 @@ class ProcessBuilder * * To disable the timeout, set this value to null. * - * @param float|null + * @param float|null $timeout * * @return ProcessBuilder * diff --git a/vendor/symfony/process/Symfony/Component/Process/ProcessUtils.php b/vendor/symfony/process/Symfony/Component/Process/ProcessUtils.php index 2ec321cc12..0f4cb89e6b 100644 --- a/vendor/symfony/process/Symfony/Component/Process/ProcessUtils.php +++ b/vendor/symfony/process/Symfony/Component/Process/ProcessUtils.php @@ -23,7 +23,7 @@ use Symfony\Component\Process\Exception\InvalidArgumentException; class ProcessUtils { /** - * This class should not be instantiated + * This class should not be instantiated. */ private function __construct() { @@ -42,7 +42,7 @@ class ProcessUtils //Fix for PHP bug #49446 escapeshellarg doesn't work on Windows //@see https://bugs.php.net/bug.php?id=43784 //@see https://bugs.php.net/bug.php?id=49446 - if (defined('PHP_WINDOWS_VERSION_BUILD')) { + if ('\\' === DIRECTORY_SEPARATOR) { if ('' === $argument) { return escapeshellarg($argument); } @@ -75,7 +75,7 @@ class ProcessUtils } /** - * Validates and normalizes a Process input + * Validates and normalizes a Process input. * * @param string $caller The name of method call that validates the input * @param mixed $input The input to validate diff --git a/vendor/symfony/process/Symfony/Component/Process/Tests/AbstractProcessTest.php b/vendor/symfony/process/Symfony/Component/Process/Tests/AbstractProcessTest.php index d48698a7cf..5bfd1a8692 100644 --- a/vendor/symfony/process/Symfony/Component/Process/Tests/AbstractProcessTest.php +++ b/vendor/symfony/process/Symfony/Component/Process/Tests/AbstractProcessTest.php @@ -128,7 +128,7 @@ abstract class AbstractProcessTest extends \PHPUnit_Framework_TestCase } /** - * tests results from sub processes + * tests results from sub processes. * * @dataProvider responsesCodeProvider */ @@ -141,7 +141,7 @@ abstract class AbstractProcessTest extends \PHPUnit_Framework_TestCase } /** - * tests results from sub processes + * tests results from sub processes. * * @dataProvider pipesCodeProvider */ @@ -236,7 +236,7 @@ abstract class AbstractProcessTest extends \PHPUnit_Framework_TestCase public function chainedCommandsOutputProvider() { - if (defined('PHP_WINDOWS_VERSION_BUILD')) { + if ('\\' === DIRECTORY_SEPARATOR) { return array( array("2 \r\n2\r\n", '&&', '2'), ); @@ -249,7 +249,6 @@ abstract class AbstractProcessTest extends \PHPUnit_Framework_TestCase } /** - * * @dataProvider chainedCommandsOutputProvider */ public function testChainedCommandsOutput($expected, $operator, $input) @@ -309,6 +308,37 @@ abstract class AbstractProcessTest extends \PHPUnit_Framework_TestCase $this->assertEmpty($p->getErrorOutput()); } + public function testGetEmptyIncrementalErrorOutput() + { + // use a lock file to toggle between writing ("W") and reading ("R") the + // output stream + $lock = tempnam(sys_get_temp_dir(), get_class($this).'Lock'); + file_put_contents($lock, 'W'); + + $p = $this->getProcess(sprintf('php -r %s', escapeshellarg('$n = 0; while ($n < 3) { if (\'W\' === file_get_contents('.var_export($lock, true).')) { file_put_contents(\'php://stderr\', \'ERROR\'); $n++; file_put_contents('.var_export($lock, true).', \'R\'); } usleep(100); }'))); + + $p->start(); + + $shouldWrite = false; + + while ($p->isRunning()) { + if ('R' === file_get_contents($lock)) { + if (!$shouldWrite) { + $this->assertLessThanOrEqual(1, preg_match_all('/ERROR/', $p->getIncrementalOutput(), $matches)); + $shouldWrite = true; + } else { + $this->assertSame('', $p->getIncrementalOutput()); + + file_put_contents($lock, 'W'); + $shouldWrite = false; + } + } + usleep(100); + } + + unlink($lock); + } + public function testGetOutput() { $p = $this->getProcess(sprintf('php -r %s', escapeshellarg('$n = 0; while ($n < 3) { echo \' foo \'; $n++; }'))); @@ -347,9 +377,40 @@ abstract class AbstractProcessTest extends \PHPUnit_Framework_TestCase $this->assertEmpty($p->getOutput()); } + public function testGetEmptyIncrementalOutput() + { + // use a lock file to toggle between writing ("W") and reading ("R") the + // output stream + $lock = tempnam(sys_get_temp_dir(), get_class($this).'Lock'); + file_put_contents($lock, 'W'); + + $p = $this->getProcess(sprintf('php -r %s', escapeshellarg('$n = 0; while ($n < 3) { if (\'W\' === file_get_contents('.var_export($lock, true).')) { echo \' foo \'; $n++; file_put_contents('.var_export($lock, true).', \'R\'); } usleep(100); }'))); + + $p->start(); + + $shouldWrite = false; + + while ($p->isRunning()) { + if ('R' === file_get_contents($lock)) { + if (!$shouldWrite) { + $this->assertLessThanOrEqual(1, preg_match_all('/foo/', $p->getIncrementalOutput(), $matches)); + $shouldWrite = true; + } else { + $this->assertSame('', $p->getIncrementalOutput()); + + file_put_contents($lock, 'W'); + $shouldWrite = false; + } + } + usleep(100); + } + + unlink($lock); + } + public function testZeroAsOutput() { - if (defined('PHP_WINDOWS_VERSION_BUILD')) { + if ('\\' === DIRECTORY_SEPARATOR) { // see http://stackoverflow.com/questions/7105433/windows-batch-echo-without-new-line $p = $this->getProcess('echo | set /p dummyName=0'); } else { @@ -362,7 +423,7 @@ abstract class AbstractProcessTest extends \PHPUnit_Framework_TestCase public function testExitCodeCommandFailed() { - if (defined('PHP_WINDOWS_VERSION_BUILD')) { + if ('\\' === DIRECTORY_SEPARATOR) { $this->markTestSkipped('Windows does not support POSIX exit code'); } @@ -375,7 +436,7 @@ abstract class AbstractProcessTest extends \PHPUnit_Framework_TestCase public function testTTYCommand() { - if (defined('PHP_WINDOWS_VERSION_BUILD')) { + if ('\\' === DIRECTORY_SEPARATOR) { $this->markTestSkipped('Windows does have /dev/tty support'); } @@ -390,7 +451,7 @@ abstract class AbstractProcessTest extends \PHPUnit_Framework_TestCase public function testTTYCommandExitCode() { - if (defined('PHP_WINDOWS_VERSION_BUILD')) { + if ('\\' === DIRECTORY_SEPARATOR) { $this->markTestSkipped('Windows does have /dev/tty support'); } @@ -403,7 +464,7 @@ abstract class AbstractProcessTest extends \PHPUnit_Framework_TestCase public function testTTYInWindowsEnvironment() { - if (!defined('PHP_WINDOWS_VERSION_BUILD')) { + if ('\\' !== DIRECTORY_SEPARATOR) { $this->markTestSkipped('This test is for Windows platform only'); } @@ -570,7 +631,7 @@ abstract class AbstractProcessTest extends \PHPUnit_Framework_TestCase public function testProcessIsNotSignaled() { - if (defined('PHP_WINDOWS_VERSION_BUILD')) { + if ('\\' === DIRECTORY_SEPARATOR) { $this->markTestSkipped('Windows does not support POSIX signals'); } @@ -581,7 +642,7 @@ abstract class AbstractProcessTest extends \PHPUnit_Framework_TestCase public function testProcessWithoutTermSignalIsNotSignaled() { - if (defined('PHP_WINDOWS_VERSION_BUILD')) { + if ('\\' === DIRECTORY_SEPARATOR) { $this->markTestSkipped('Windows does not support POSIX signals'); } @@ -592,7 +653,7 @@ abstract class AbstractProcessTest extends \PHPUnit_Framework_TestCase public function testProcessWithoutTermSignal() { - if (defined('PHP_WINDOWS_VERSION_BUILD')) { + if ('\\' === DIRECTORY_SEPARATOR) { $this->markTestSkipped('Windows does not support POSIX signals'); } @@ -603,7 +664,7 @@ abstract class AbstractProcessTest extends \PHPUnit_Framework_TestCase public function testProcessIsSignaledIfStopped() { - if (defined('PHP_WINDOWS_VERSION_BUILD')) { + if ('\\' === DIRECTORY_SEPARATOR) { $this->markTestSkipped('Windows does not support POSIX signals'); } @@ -615,7 +676,7 @@ abstract class AbstractProcessTest extends \PHPUnit_Framework_TestCase public function testProcessWithTermSignal() { - if (defined('PHP_WINDOWS_VERSION_BUILD')) { + if ('\\' === DIRECTORY_SEPARATOR) { $this->markTestSkipped('Windows does not support POSIX signals'); } @@ -631,7 +692,7 @@ abstract class AbstractProcessTest extends \PHPUnit_Framework_TestCase public function testProcessThrowsExceptionWhenExternallySignaled() { - if (defined('PHP_WINDOWS_VERSION_BUILD')) { + if ('\\' === DIRECTORY_SEPARATOR) { $this->markTestSkipped('Windows does not support POSIX signals'); } @@ -692,7 +753,7 @@ abstract class AbstractProcessTest extends \PHPUnit_Framework_TestCase } $duration = microtime(true) - $start; - if (defined('PHP_WINDOWS_VERSION_BUILD')) { + if ('\\' === DIRECTORY_SEPARATOR) { // Windows is a bit slower as it read file handles, then allow twice the precision $maxDuration = $timeout + 2 * Process::TIMEOUT_PRECISION; } else { @@ -865,7 +926,7 @@ abstract class AbstractProcessTest extends \PHPUnit_Framework_TestCase { $process = $this->getProcess('php -m'); $this->setExpectedException('Symfony\Component\Process\Exception\LogicException', sprintf('Process must be started before calling %s.', $method)); - call_user_func(array($process, $method)); + $process->{$method}(); } public function provideMethodsThatNeedARunningProcess() @@ -887,7 +948,7 @@ abstract class AbstractProcessTest extends \PHPUnit_Framework_TestCase $process = $this->getProcess('php -r "sleep(1);"'); $process->start(); try { - call_user_func(array($process, $method)); + $process->{$method}(); $process->stop(0); $this->fail('A LogicException must have been thrown'); } catch (\Exception $e) { @@ -909,7 +970,7 @@ abstract class AbstractProcessTest extends \PHPUnit_Framework_TestCase private function verifyPosixIsEnabled() { - if (defined('PHP_WINDOWS_VERSION_BUILD')) { + if ('\\' === DIRECTORY_SEPARATOR) { $this->markTestSkipped('POSIX signals do not work on Windows'); } if (!defined('SIGUSR1')) { @@ -922,7 +983,7 @@ abstract class AbstractProcessTest extends \PHPUnit_Framework_TestCase */ public function testSignalWithWrongIntSignal() { - if (defined('PHP_WINDOWS_VERSION_BUILD')) { + if ('\\' === DIRECTORY_SEPARATOR) { $this->markTestSkipped('POSIX signals do not work on Windows'); } @@ -936,7 +997,7 @@ abstract class AbstractProcessTest extends \PHPUnit_Framework_TestCase */ public function testSignalWithWrongNonIntSignal() { - if (defined('PHP_WINDOWS_VERSION_BUILD')) { + if ('\\' === DIRECTORY_SEPARATOR) { $this->markTestSkipped('POSIX signals do not work on Windows'); } @@ -1013,7 +1074,7 @@ abstract class AbstractProcessTest extends \PHPUnit_Framework_TestCase $p = $this->getProcess('php -r "usleep(500000);"'); $p->disableOutput(); $this->setExpectedException($exception, $exceptionMessage); - call_user_func(array($p, $startMethod), function () {}); + $p->{$startMethod}(function () {}); } public function provideStartMethods() @@ -1034,7 +1095,7 @@ abstract class AbstractProcessTest extends \PHPUnit_Framework_TestCase $p->disableOutput(); $p->start(); $this->setExpectedException('Symfony\Component\Process\Exception\LogicException', 'Output has been disabled.'); - call_user_func(array($p, $fetchMethod)); + $p->{$fetchMethod}(); } public function provideOutputFetchingMethods() @@ -1064,7 +1125,7 @@ abstract class AbstractProcessTest extends \PHPUnit_Framework_TestCase 'include \''.__DIR__.'/PipeStdinInStdoutStdErrStreamSelect.php\';', ); - if (defined('PHP_WINDOWS_VERSION_BUILD')) { + if ('\\' === DIRECTORY_SEPARATOR) { // Avoid XL buffers on Windows because of https://bugs.php.net/bug.php?id=65650 $sizes = array(1, 2, 4, 8); } else { @@ -1082,7 +1143,7 @@ abstract class AbstractProcessTest extends \PHPUnit_Framework_TestCase } /** - * provides default method names for simple getter/setter + * provides default method names for simple getter/setter. */ public function methodProvider() { diff --git a/vendor/symfony/process/Symfony/Component/Process/Tests/ExecutableFinderTest.php b/vendor/symfony/process/Symfony/Component/Process/Tests/ExecutableFinderTest.php index 5fbe1e0aa7..5033cdab02 100644 --- a/vendor/symfony/process/Symfony/Component/Process/Tests/ExecutableFinderTest.php +++ b/vendor/symfony/process/Symfony/Component/Process/Tests/ExecutableFinderTest.php @@ -94,7 +94,7 @@ class ExecutableFinderTest extends \PHPUnit_Framework_TestCase $this->markTestSkipped('Requires the PHP_BINARY constant'); } - if (defined('PHP_WINDOWS_VERSION_BUILD')) { + if ('\\' === DIRECTORY_SEPARATOR) { $this->markTestSkipped('Cannot run test on windows'); } @@ -102,7 +102,7 @@ class ExecutableFinderTest extends \PHPUnit_Framework_TestCase $this->markTestSkipped('Cannot test when open_basedir is set'); } - ini_set('open_basedir', dirname(PHP_BINARY).PATH_SEPARATOR.'/'); + $this->iniSet('open_basedir', dirname(PHP_BINARY).PATH_SEPARATOR.'/'); $finder = new ExecutableFinder(); $result = $finder->find($this->getPhpBinaryName()); @@ -120,10 +120,12 @@ class ExecutableFinderTest extends \PHPUnit_Framework_TestCase $this->markTestSkipped('Requires the PHP_BINARY constant'); } - $execPath = __DIR__.'/SignalListener.php'; + if ('\\' === DIRECTORY_SEPARATOR) { + $this->markTestSkipped('Cannot run test on windows'); + } $this->setPath(''); - ini_set('open_basedir', PHP_BINARY.PATH_SEPARATOR.'/'); + $this->iniSet('open_basedir', PHP_BINARY.PATH_SEPARATOR.'/'); $finder = new ExecutableFinder(); $result = $finder->find($this->getPhpBinaryName(), false); @@ -133,7 +135,7 @@ class ExecutableFinderTest extends \PHPUnit_Framework_TestCase private function assertSamePath($expected, $tested) { - if (defined('PHP_WINDOWS_VERSION_BUILD')) { + if ('\\' === DIRECTORY_SEPARATOR) { $this->assertEquals(strtolower($expected), strtolower($tested)); } else { $this->assertEquals($expected, $tested); @@ -142,6 +144,6 @@ class ExecutableFinderTest extends \PHPUnit_Framework_TestCase private function getPhpBinaryName() { - return basename(PHP_BINARY, defined('PHP_WINDOWS_VERSION_BUILD') ? '.exe' : ''); + return basename(PHP_BINARY, '\\' === DIRECTORY_SEPARATOR ? '.exe' : ''); } } diff --git a/vendor/symfony/process/Symfony/Component/Process/Tests/NonStopableProcess.php b/vendor/symfony/process/Symfony/Component/Process/Tests/NonStopableProcess.php index 2183e48c64..692feebba2 100644 --- a/vendor/symfony/process/Symfony/Component/Process/Tests/NonStopableProcess.php +++ b/vendor/symfony/process/Symfony/Component/Process/Tests/NonStopableProcess.php @@ -1,13 +1,12 @@ find(); //TODO maybe php executable is custom or even Windows - if (defined('PHP_WINDOWS_VERSION_BUILD')) { + if ('\\' === DIRECTORY_SEPARATOR) { $this->assertTrue(is_executable($current)); $this->assertTrue((bool) preg_match('/'.addSlashes(DIRECTORY_SEPARATOR).'php\.(exe|bat|cmd|com)$/i', $current), '::find() returns the executable PHP with suffixes'); } diff --git a/vendor/symfony/process/Symfony/Component/Process/Tests/ProcessBuilderTest.php b/vendor/symfony/process/Symfony/Component/Process/Tests/ProcessBuilderTest.php index e864f66234..02a960d4e5 100644 --- a/vendor/symfony/process/Symfony/Component/Process/Tests/ProcessBuilderTest.php +++ b/vendor/symfony/process/Symfony/Component/Process/Tests/ProcessBuilderTest.php @@ -102,14 +102,14 @@ class ProcessBuilderTest extends \PHPUnit_Framework_TestCase $pb->setPrefix('/usr/bin/php'); $proc = $pb->setArguments(array('-v'))->getProcess(); - if (defined('PHP_WINDOWS_VERSION_BUILD')) { + if ('\\' === DIRECTORY_SEPARATOR) { $this->assertEquals('"/usr/bin/php" "-v"', $proc->getCommandLine()); } else { $this->assertEquals("'/usr/bin/php' '-v'", $proc->getCommandLine()); } $proc = $pb->setArguments(array('-i'))->getProcess(); - if (defined('PHP_WINDOWS_VERSION_BUILD')) { + if ('\\' === DIRECTORY_SEPARATOR) { $this->assertEquals('"/usr/bin/php" "-i"', $proc->getCommandLine()); } else { $this->assertEquals("'/usr/bin/php' '-i'", $proc->getCommandLine()); @@ -122,14 +122,14 @@ class ProcessBuilderTest extends \PHPUnit_Framework_TestCase $pb->setPrefix(array('/usr/bin/php', 'composer.phar')); $proc = $pb->setArguments(array('-v'))->getProcess(); - if (defined('PHP_WINDOWS_VERSION_BUILD')) { + if ('\\' === DIRECTORY_SEPARATOR) { $this->assertEquals('"/usr/bin/php" "composer.phar" "-v"', $proc->getCommandLine()); } else { $this->assertEquals("'/usr/bin/php' 'composer.phar' '-v'", $proc->getCommandLine()); } $proc = $pb->setArguments(array('-i'))->getProcess(); - if (defined('PHP_WINDOWS_VERSION_BUILD')) { + if ('\\' === DIRECTORY_SEPARATOR) { $this->assertEquals('"/usr/bin/php" "composer.phar" "-i"', $proc->getCommandLine()); } else { $this->assertEquals("'/usr/bin/php' 'composer.phar' '-i'", $proc->getCommandLine()); @@ -141,7 +141,7 @@ class ProcessBuilderTest extends \PHPUnit_Framework_TestCase $pb = new ProcessBuilder(array('%path%', 'foo " bar', '%baz%baz')); $proc = $pb->getProcess(); - if (defined('PHP_WINDOWS_VERSION_BUILD')) { + if ('\\' === DIRECTORY_SEPARATOR) { $this->assertSame('^%"path"^% "foo \\" bar" "%baz%baz"', $proc->getCommandLine()); } else { $this->assertSame("'%path%' 'foo \" bar' '%baz%baz'", $proc->getCommandLine()); @@ -154,7 +154,7 @@ class ProcessBuilderTest extends \PHPUnit_Framework_TestCase $pb->setPrefix('%prefix%'); $proc = $pb->getProcess(); - if (defined('PHP_WINDOWS_VERSION_BUILD')) { + if ('\\' === DIRECTORY_SEPARATOR) { $this->assertSame('^%"prefix"^% "arg"', $proc->getCommandLine()); } else { $this->assertSame("'%prefix%' 'arg'", $proc->getCommandLine()); @@ -175,7 +175,7 @@ class ProcessBuilderTest extends \PHPUnit_Framework_TestCase ->setPrefix('/usr/bin/php') ->getProcess(); - if (defined('PHP_WINDOWS_VERSION_BUILD')) { + if ('\\' === DIRECTORY_SEPARATOR) { $this->assertEquals('"/usr/bin/php"', $process->getCommandLine()); } else { $this->assertEquals("'/usr/bin/php'", $process->getCommandLine()); @@ -187,7 +187,7 @@ class ProcessBuilderTest extends \PHPUnit_Framework_TestCase $process = ProcessBuilder::create(array('/usr/bin/php')) ->getProcess(); - if (defined('PHP_WINDOWS_VERSION_BUILD')) { + if ('\\' === DIRECTORY_SEPARATOR) { $this->assertEquals('"/usr/bin/php"', $process->getCommandLine()); } else { $this->assertEquals("'/usr/bin/php'", $process->getCommandLine()); diff --git a/vendor/symfony/process/Symfony/Component/Process/Tests/ProcessFailedExceptionTest.php b/vendor/symfony/process/Symfony/Component/Process/Tests/ProcessFailedExceptionTest.php index c48648f517..20753df4a6 100644 --- a/vendor/symfony/process/Symfony/Component/Process/Tests/ProcessFailedExceptionTest.php +++ b/vendor/symfony/process/Symfony/Component/Process/Tests/ProcessFailedExceptionTest.php @@ -19,7 +19,7 @@ use Symfony\Component\Process\Exception\ProcessFailedException; class ProcessFailedExceptionTest extends \PHPUnit_Framework_TestCase { /** - * tests ProcessFailedException throws exception if the process was successful + * tests ProcessFailedException throws exception if the process was successful. */ public function testProcessFailedExceptionThrowsException() { @@ -42,7 +42,7 @@ class ProcessFailedExceptionTest extends \PHPUnit_Framework_TestCase /** * tests ProcessFailedException uses information from process output - * to generate exception message + * to generate exception message. */ public function testProcessFailedExceptionPopulatesInformationFromProcessOutput() { diff --git a/vendor/symfony/process/Symfony/Component/Process/Tests/ProcessUtilsTest.php b/vendor/symfony/process/Symfony/Component/Process/Tests/ProcessUtilsTest.php index 8ba94c114d..e6564cde5b 100644 --- a/vendor/symfony/process/Symfony/Component/Process/Tests/ProcessUtilsTest.php +++ b/vendor/symfony/process/Symfony/Component/Process/Tests/ProcessUtilsTest.php @@ -25,7 +25,7 @@ class ProcessUtilsTest extends \PHPUnit_Framework_TestCase public function dataArguments() { - if (defined('PHP_WINDOWS_VERSION_BUILD')) { + if ('\\' === DIRECTORY_SEPARATOR) { return array( array('"\"php\" \"-v\""', '"php" "-v"'), array('"foo bar"', 'foo bar'), diff --git a/vendor/symfony/process/Symfony/Component/Process/Tests/SigchildEnabledProcessTest.php b/vendor/symfony/process/Symfony/Component/Process/Tests/SigchildEnabledProcessTest.php index 3fea3ba1cd..2668a9b4bf 100644 --- a/vendor/symfony/process/Symfony/Component/Process/Tests/SigchildEnabledProcessTest.php +++ b/vendor/symfony/process/Symfony/Component/Process/Tests/SigchildEnabledProcessTest.php @@ -114,7 +114,7 @@ class SigchildEnabledProcessTest extends AbstractProcessTest public function testStartAfterATimeout() { - if (defined('PHP_WINDOWS_VERSION_BUILD')) { + if ('\\' === DIRECTORY_SEPARATOR) { $this->markTestSkipped('Restarting a timed-out process on Windows is not supported in sigchild environment'); } parent::testStartAfterATimeout(); diff --git a/vendor/symfony/process/Symfony/Component/Process/Tests/SimpleProcessTest.php b/vendor/symfony/process/Symfony/Component/Process/Tests/SimpleProcessTest.php index cd206ea4c3..0a8b126205 100644 --- a/vendor/symfony/process/Symfony/Component/Process/Tests/SimpleProcessTest.php +++ b/vendor/symfony/process/Symfony/Component/Process/Tests/SimpleProcessTest.php @@ -154,7 +154,7 @@ class SimpleProcessTest extends AbstractProcessTest $process->run(function () use ($process) { $process->stop(); }); - } catch (RuntimeException $e) { + } catch (\RuntimeException $e) { $this->fail('A call to stop() is not expected to cause wait() to throw a RuntimeException'); } } @@ -170,7 +170,7 @@ class SimpleProcessTest extends AbstractProcessTest $process->signal(defined('SIGKILL') ? SIGKILL : 9); } }); - } catch (RuntimeException $e) { + } catch (\RuntimeException $e) { $this->fail('A call to signal() is not expected to cause wait() to throw a RuntimeException'); } } @@ -186,7 +186,7 @@ class SimpleProcessTest extends AbstractProcessTest $process->signal(defined('SIGTERM') ? SIGTERM : 15); } }); - } catch (RuntimeException $e) { + } catch (\RuntimeException $e) { $this->fail('A call to signal() is not expected to cause wait() to throw a RuntimeException'); } } diff --git a/vendor/symfony/process/Symfony/Component/Process/phpunit.xml.dist b/vendor/symfony/process/Symfony/Component/Process/phpunit.xml.dist index fcb230a062..8f147bca73 100644 --- a/vendor/symfony/process/Symfony/Component/Process/phpunit.xml.dist +++ b/vendor/symfony/process/Symfony/Component/Process/phpunit.xml.dist @@ -6,6 +6,10 @@ colors="true" bootstrap="vendor/autoload.php" > + + + + ./Tests/ diff --git a/vendor/symfony/yaml/Symfony/Component/Yaml/Inline.php b/vendor/symfony/yaml/Symfony/Component/Yaml/Inline.php index e3fafe12bc..aec52e6295 100644 --- a/vendor/symfony/yaml/Symfony/Component/Yaml/Inline.php +++ b/vendor/symfony/yaml/Symfony/Component/Yaml/Inline.php @@ -194,7 +194,7 @@ class Inline /** * Parses a scalar to a YAML string. * - * @param scalar $scalar + * @param string $scalar * @param string $delimiters * @param array $stringDelimiters * @param int &$i diff --git a/vendor/symfony/yaml/Symfony/Component/Yaml/LICENSE b/vendor/symfony/yaml/Symfony/Component/Yaml/LICENSE index 0b3292cf90..43028bc600 100644 --- a/vendor/symfony/yaml/Symfony/Component/Yaml/LICENSE +++ b/vendor/symfony/yaml/Symfony/Component/Yaml/LICENSE @@ -1,4 +1,4 @@ -Copyright (c) 2004-2014 Fabien Potencier +Copyright (c) 2004-2015 Fabien Potencier Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/vendor/symfony/yaml/Symfony/Component/Yaml/Parser.php b/vendor/symfony/yaml/Symfony/Component/Yaml/Parser.php index 00c613dfdc..23afb17e88 100644 --- a/vendor/symfony/yaml/Symfony/Component/Yaml/Parser.php +++ b/vendor/symfony/yaml/Symfony/Component/Yaml/Parser.php @@ -29,7 +29,7 @@ class Parser private $refs = array(); /** - * Constructor + * Constructor. * * @param int $offset The offset of YAML document (used for line numbers in error messages) */ @@ -41,10 +41,10 @@ class Parser /** * Parses a YAML string to a PHP value. * - * @param string $value A YAML string - * @param bool $exceptionOnInvalidType true if an exception must be thrown on invalid types (a PHP resource or object), false otherwise - * @param bool $objectSupport true if object support is enabled, false otherwise - * @param bool $objectForMap true if maps should return a stdClass instead of array() + * @param string $value A YAML string + * @param bool $exceptionOnInvalidType true if an exception must be thrown on invalid types (a PHP resource or object), false otherwise + * @param bool $objectSupport true if object support is enabled, false otherwise + * @param bool $objectForMap true if maps should return a stdClass instead of array() * * @return mixed A PHP value * @@ -649,7 +649,7 @@ class Parser } /** - * Returns true if the next line starts unindented collection + * Returns true if the next line starts unindented collection. * * @return bool Returns true if the next line starts unindented collection, false otherwise */ @@ -681,7 +681,7 @@ class Parser } /** - * Returns true if the string is un-indented collection item + * Returns true if the string is un-indented collection item. * * @return bool Returns true if the string is un-indented collection item, false otherwise */ diff --git a/vendor/symfony/yaml/Symfony/Component/Yaml/README.md b/vendor/symfony/yaml/Symfony/Component/Yaml/README.md index 50f9e09488..96abbbfd16 100644 --- a/vendor/symfony/yaml/Symfony/Component/Yaml/README.md +++ b/vendor/symfony/yaml/Symfony/Component/Yaml/README.md @@ -6,7 +6,7 @@ YAML implements most of the YAML 1.2 specification. ```php use Symfony\Component\Yaml\Yaml; -$array = Yaml::parse($file); +$array = Yaml::parse(file_get_contents(filename)); print Yaml::dump($array); ``` diff --git a/vendor/symfony/yaml/Symfony/Component/Yaml/Tests/DumperTest.php b/vendor/symfony/yaml/Symfony/Component/Yaml/Tests/DumperTest.php index aa27c4abeb..b103b9a184 100644 --- a/vendor/symfony/yaml/Symfony/Component/Yaml/Tests/DumperTest.php +++ b/vendor/symfony/yaml/Symfony/Component/Yaml/Tests/DumperTest.php @@ -11,7 +11,6 @@ namespace Symfony\Component\Yaml\Tests; -use Symfony\Component\Yaml\Yaml; use Symfony\Component\Yaml\Parser; use Symfony\Component\Yaml\Dumper; diff --git a/vendor/symfony/yaml/Symfony/Component/Yaml/Tests/ParseExceptionTest.php b/vendor/symfony/yaml/Symfony/Component/Yaml/Tests/ParseExceptionTest.php index 8c2b1a49a9..e4eb9c98a1 100644 --- a/vendor/symfony/yaml/Symfony/Component/Yaml/Tests/ParseExceptionTest.php +++ b/vendor/symfony/yaml/Symfony/Component/Yaml/Tests/ParseExceptionTest.php @@ -12,7 +12,6 @@ namespace Symfony\Component\Yaml\Tests; use Symfony\Component\Yaml\Exception\ParseException; -use Symfony\Component\Yaml\Yaml; class ParseExceptionTest extends \PHPUnit_Framework_TestCase { diff --git a/vendor/symfony/yaml/Symfony/Component/Yaml/Tests/ParserTest.php b/vendor/symfony/yaml/Symfony/Component/Yaml/Tests/ParserTest.php index 7f16d925e4..d735ec6fde 100644 --- a/vendor/symfony/yaml/Symfony/Component/Yaml/Tests/ParserTest.php +++ b/vendor/symfony/yaml/Symfony/Component/Yaml/Tests/ParserTest.php @@ -464,9 +464,7 @@ EOF; } /** - * * @expectedException \Symfony\Component\Yaml\Exception\ParseException - * */ public function testUnindentedCollectionException() { diff --git a/vendor/symfony/yaml/Symfony/Component/Yaml/Unescaper.php b/vendor/symfony/yaml/Symfony/Component/Yaml/Unescaper.php index 50b1018c40..ffddd95c7b 100644 --- a/vendor/symfony/yaml/Symfony/Component/Yaml/Unescaper.php +++ b/vendor/symfony/yaml/Symfony/Component/Yaml/Unescaper.php @@ -59,7 +59,7 @@ class Unescaper } /** - * Unescapes a character that was found in a double-quoted string + * Unescapes a character that was found in a double-quoted string. * * @param string $value An escaped character * diff --git a/vendor/symfony/yaml/Symfony/Component/Yaml/phpunit.xml.dist b/vendor/symfony/yaml/Symfony/Component/Yaml/phpunit.xml.dist index 90e0bcc27e..39c04ce3a6 100644 --- a/vendor/symfony/yaml/Symfony/Component/Yaml/phpunit.xml.dist +++ b/vendor/symfony/yaml/Symfony/Component/Yaml/phpunit.xml.dist @@ -6,6 +6,10 @@ colors="true" bootstrap="vendor/autoload.php" > + + + + ./Tests/ diff --git a/vendor/twig/twig/.gitignore b/vendor/twig/twig/.gitignore index 840b78e7e4..31103621c6 100644 --- a/vendor/twig/twig/.gitignore +++ b/vendor/twig/twig/.gitignore @@ -1,2 +1,5 @@ +/build +/composer.lock /ext/twig/autom4te.cache/ - +/phpunit.xml +/vendor diff --git a/vendor/twig/twig/CHANGELOG b/vendor/twig/twig/CHANGELOG index 33b32f8381..fdc9e2c62b 100644 --- a/vendor/twig/twig/CHANGELOG +++ b/vendor/twig/twig/CHANGELOG @@ -1,3 +1,22 @@ +* 1.18.0 (2015-XX-XX) + + * fixed some error messages where the line was wrong (unknown variables or argument names) + * added a new way to customize the main Module node (via empty nodes) + * added Twig_Environment::createTemplate() to create a template from a string + * added a profiler + * fixed filesystem loader cache when different file paths are used for the same template + +* 1.17.0 (2015-01-14) + + * added a 'filename' autoescaping strategy, which dynamically chooses the + autoescaping strategy for a template based on template file extension. + +* 1.16.3 (2014-12-25) + + * fixed regression for dynamic parent templates + * fixed cache management with statcache + * fixed a regression in the slice filter + * 1.16.2 (2014-10-17) * fixed timezone on dates as strings diff --git a/vendor/twig/twig/composer.json b/vendor/twig/twig/composer.json index 98b8df0f73..6f7e50ce12 100644 --- a/vendor/twig/twig/composer.json +++ b/vendor/twig/twig/composer.json @@ -14,7 +14,7 @@ }, { "name": "Twig Team", - "homepage": "https://github.com/fabpot/Twig/graphs/contributors", + "homepage": "http://twig.sensiolabs.org/contributors", "role": "Contributors" }, { @@ -36,7 +36,7 @@ }, "extra": { "branch-alias": { - "dev-master": "1.16-dev" + "dev-master": "1.18-dev" } } } diff --git a/vendor/twig/twig/doc/advanced.rst b/vendor/twig/twig/doc/advanced.rst index ea82ce066e..0e3be9092b 100644 --- a/vendor/twig/twig/doc/advanced.rst +++ b/vendor/twig/twig/doc/advanced.rst @@ -281,7 +281,7 @@ Tests allow you to create custom application specific logic for evaluating boolean conditions. As a simple example, let's create a Twig test that checks if objects are 'red':: - $twig = new Twig_Environment($loader) + $twig = new Twig_Environment($loader); $test = new Twig_SimpleTest('red', function ($value) { if (isset($value->color) && $value->color == 'red') { return true; @@ -299,7 +299,7 @@ When creating tests you can use the ``node_class`` option to provide custom test compilation. This is useful if your test can be compiled into PHP primitives. This is used by many of the tests built into Twig:: - $twig = new Twig_Environment($loader) + $twig = new Twig_Environment($loader); $test = new Twig_SimpleTest( 'odd', null, @@ -503,7 +503,7 @@ to host all the specific tags and filters you want to add to Twig. .. note:: Before writing your own extensions, have a look at the Twig official - extension repository: http://github.com/fabpot/Twig-extensions. + extension repository: http://github.com/twigphp/Twig-extensions. An extension is a class that implements the following interface:: @@ -830,5 +830,5 @@ Testing the node visitors can be complex, so extend your test cases from .. _`spl_autoload_register()`: http://www.php.net/spl_autoload_register .. _`rot13`: http://www.php.net/manual/en/function.str-rot13.php -.. _`tests/Twig/Fixtures`: https://github.com/fabpot/Twig/tree/master/test/Twig/Tests/Fixtures -.. _`tests/Twig/Node`: https://github.com/fabpot/Twig/tree/master/test/Twig/Tests/Node +.. _`tests/Twig/Fixtures`: https://github.com/twigphp/Twig/tree/master/test/Twig/Tests/Fixtures +.. _`tests/Twig/Node`: https://github.com/twigphp/Twig/tree/master/test/Twig/Tests/Node diff --git a/vendor/twig/twig/doc/advanced_legacy.rst b/vendor/twig/twig/doc/advanced_legacy.rst index 2b3318020a..2ef6bfde86 100644 --- a/vendor/twig/twig/doc/advanced_legacy.rst +++ b/vendor/twig/twig/doc/advanced_legacy.rst @@ -529,7 +529,7 @@ to host all the specific tags and filters you want to add to Twig. .. note:: Before writing your own extensions, have a look at the Twig official - extension repository: http://github.com/fabpot/Twig-extensions. + extension repository: http://github.com/twigphp/Twig-extensions. An extension is a class that implements the following interface:: @@ -883,5 +883,5 @@ Testing the node visitors can be complex, so extend your test cases from .. _`spl_autoload_register()`: http://www.php.net/spl_autoload_register .. _`rot13`: http://www.php.net/manual/en/function.str-rot13.php -.. _`tests/Twig/Fixtures`: https://github.com/fabpot/Twig/tree/master/test/Twig/Tests/Fixtures -.. _`tests/Twig/Node`: https://github.com/fabpot/Twig/tree/master/test/Twig/Tests/Node +.. _`tests/Twig/Fixtures`: https://github.com/twigphp/Twig/tree/master/test/Twig/Tests/Fixtures +.. _`tests/Twig/Node`: https://github.com/twigphp/Twig/tree/master/test/Twig/Tests/Node diff --git a/vendor/twig/twig/doc/api.rst b/vendor/twig/twig/doc/api.rst index 775612714b..3ff5d1a2ac 100644 --- a/vendor/twig/twig/doc/api.rst +++ b/vendor/twig/twig/doc/api.rst @@ -94,14 +94,20 @@ The following options are available: replace them with a ``null`` value. When set to ``true``, Twig throws an exception instead (default to ``false``). -* ``autoescape``: If set to ``true``, auto-escaping will be enabled by default - for all templates (default to ``true``). As of Twig 1.8, you can set the - escaping strategy to use (``html``, ``js``, ``false`` to disable). - As of Twig 1.9, you can set the escaping strategy to use (``css``, ``url``, - ``html_attr``, or a PHP callback that takes the template "filename" and must +* ``autoescape``: If set to ``true``, HTML auto-escaping will be enabled by + default for all templates (default to ``true``). + + As of Twig 1.8, you can set the escaping strategy to use (``html``, ``js``, + ``false`` to disable). + + As of Twig 1.9, you can set the escaping strategy to use (``css``, ``url``, + ``html_attr``, or a PHP callback that takes the template "filename" and must return the escaping strategy to use -- the callback cannot be a function name to avoid collision with built-in escaping strategies). + As of Twig 1.17, the ``filename`` escaping strategy determines the escaping + strategy to use for a template based on the template filename extension. + * ``optimizations``: A flag that indicates which optimizations to apply (default to ``-1`` -- all optimizations are enabled; set it to ``0`` to disable). @@ -279,6 +285,9 @@ Twig comes bundled with the following extensions: * *Twig_Extension_Sandbox*: Adds a sandbox mode to the default Twig environment, making it safe to evaluate untrusted code. +* *Twig_Extension_Profiler*: Enabled the built-in Twig profiler (as of Twig + 1.18). + * *Twig_Extension_Optimizer*: Optimizes the node tree before compilation. The core, escaper, and optimizer extensions do not need to be added to the @@ -447,6 +456,37 @@ the extension constructor:: $sandbox = new Twig_Extension_Sandbox($policy, true); +Profiler Extension +~~~~~~~~~~~~~~~~~~ + +.. versionadded:: 1.18 + The Profile extension was added in Twig 1.18. + +The ``profiler`` extension enables a profiler for Twig templates; it should +only be used on your development machines as it adds some overhead:: + + $profile = new Twig_Profiler_Profile(); + $twig->addExtension(new Twig_Extension_Profiler($profile)); + + $dumper = new Twig_Profiler_Dumper_Text(); + echo $dumper->dump($profile); + +A profile contains information about time and memory consumption for template, +block, and macro executions. + +You can also dump the data in a `Blackfire.io `_ +compatible format:: + + $dumper = new Twig_Profiler_Dumper_Blackfire(); + file_put_contents('/path/to/profile.prof', $dumper->dump($profile)); + +Upload the profile to visualize it (create a `free account +`_ first): + +.. code-block:: sh + + blackfire --slot=7 upload /path/to/profile.prof + Optimizer Extension ~~~~~~~~~~~~~~~~~~~ diff --git a/vendor/twig/twig/doc/filters/batch.rst b/vendor/twig/twig/doc/filters/batch.rst index 30dd782354..da47eb6e66 100644 --- a/vendor/twig/twig/doc/filters/batch.rst +++ b/vendor/twig/twig/doc/filters/batch.rst @@ -5,7 +5,7 @@ The ``batch`` filter was added in Twig 1.12.3. The ``batch`` filter "batches" items by returning a list of lists with the -given number of items. If you provide a second parameter, it is used to fill +given number of items. A second parameter can be provided and used to fill in missing items: .. code-block:: jinja diff --git a/vendor/twig/twig/doc/filters/index.rst b/vendor/twig/twig/doc/filters/index.rst index 3ed0952345..8daa961183 100644 --- a/vendor/twig/twig/doc/filters/index.rst +++ b/vendor/twig/twig/doc/filters/index.rst @@ -20,10 +20,9 @@ Filters last length lower + merge nl2br number_format - merge - upper raw replace reverse @@ -34,4 +33,5 @@ Filters striptags title trim + upper url_encode diff --git a/vendor/twig/twig/doc/filters/slice.rst b/vendor/twig/twig/doc/filters/slice.rst index a856664123..70bf139e63 100644 --- a/vendor/twig/twig/doc/filters/slice.rst +++ b/vendor/twig/twig/doc/filters/slice.rst @@ -32,7 +32,7 @@ As syntactic sugar, you can also use the ``[]`` notation: {# ... #} {% endfor %} - {{ '12345'[1:2] }} + {{ '12345'[1:2] }} {# will display "23" #} {# you can omit the first argument -- which is the same as 0 #} {{ '12345'[:2] }} {# will display "12" #} diff --git a/vendor/twig/twig/doc/installation.rst b/vendor/twig/twig/doc/installation.rst index 2d19f755e8..eeaef9a725 100644 --- a/vendor/twig/twig/doc/installation.rst +++ b/vendor/twig/twig/doc/installation.rst @@ -28,7 +28,7 @@ Installing the development version .. code-block:: bash - git clone git://github.com/fabpot/Twig.git + git clone git://github.com/twigphp/Twig.git Installing the PEAR package ~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -107,7 +107,7 @@ advantage of the C extension. Note that this extension does not replace the PHP code but only provides an optimized version of the ``Twig_Template::getAttribute()`` method. -.. _`download page`: https://github.com/fabpot/Twig/tags -.. _`Composer`: https://getcomposer.org/download/ +.. _`download page`: https://github.com/twigphp/Twig/tags +.. _`Composer`: https://getcomposer.org/download/ .. _`PHP documentation`: https://wiki.php.net/internals/windows/stepbystepbuild -.. _`Zend Server FAQ`: http://www.zend.com/en/products/server/faq#faqD6 +.. _`Zend Server FAQ`: http://www.zend.com/en/products/server/faq#faqD6 diff --git a/vendor/twig/twig/doc/intro.rst b/vendor/twig/twig/doc/intro.rst index 3a7c1d4e59..773c476ec0 100644 --- a/vendor/twig/twig/doc/intro.rst +++ b/vendor/twig/twig/doc/intro.rst @@ -50,9 +50,9 @@ This section gives you a brief introduction to the PHP API for Twig. require_once '/path/to/vendor/autoload.php'; - $loader = new Twig_Loader_Array( + $loader = new Twig_Loader_Array(array( 'index' => 'Hello {{ name }}!', - ); + )); $twig = new Twig_Environment($loader); echo $twig->render('index', array('name' => 'Fabien')); diff --git a/vendor/twig/twig/doc/tags/if.rst b/vendor/twig/twig/doc/tags/if.rst index 273207d0b9..b10dcb4b3a 100644 --- a/vendor/twig/twig/doc/tags/if.rst +++ b/vendor/twig/twig/doc/tags/if.rst @@ -29,6 +29,14 @@ You can also test if an array is not empty: If you want to test if the variable is defined, use ``if users is defined`` instead. +You can also use ``not`` to check for values that evaluate to ``false``: + +.. code-block:: jinja + + {% if not user.subscribed %} +

      You are not subscribed to our mailing list.

      + {% endif %} + For multiple branches ``elseif`` and ``else`` can be used like in PHP. You can use more complex ``expressions`` there too: diff --git a/vendor/twig/twig/doc/tags/index.rst b/vendor/twig/twig/doc/tags/index.rst index 64e8864485..e6a632b7df 100644 --- a/vendor/twig/twig/doc/tags/index.rst +++ b/vendor/twig/twig/doc/tags/index.rst @@ -6,10 +6,10 @@ Tags autoescape block - filter do embed extends + filter flush for from diff --git a/vendor/twig/twig/doc/templates.rst b/vendor/twig/twig/doc/templates.rst index 82b6f0c742..7ff7862835 100644 --- a/vendor/twig/twig/doc/templates.rst +++ b/vendor/twig/twig/doc/templates.rst @@ -866,7 +866,7 @@ Extension` chapter. .. _`Twig syntax plugin`: http://plugins.netbeans.org/plugin/37069/php-twig .. _`Twig plugin`: https://github.com/pulse00/Twig-Eclipse-Plugin .. _`Twig language definition`: https://github.com/gabrielcorpse/gedit-twig-template-language -.. _`extension repository`: http://github.com/fabpot/Twig-extensions +.. _`extension repository`: http://github.com/twigphp/Twig-extensions .. _`Twig syntax mode`: https://github.com/bobthecow/Twig-HTML.mode .. _`other Twig syntax mode`: https://github.com/muxx/Twig-HTML.mode .. _`Notepad++ Twig Highlighter`: https://github.com/Banane9/notepadplusplus-twig diff --git a/vendor/twig/twig/ext/twig/php_twig.h b/vendor/twig/twig/ext/twig/php_twig.h index e116b4c2d3..13bb8cd307 100644 --- a/vendor/twig/twig/ext/twig/php_twig.h +++ b/vendor/twig/twig/ext/twig/php_twig.h @@ -15,7 +15,7 @@ #ifndef PHP_TWIG_H #define PHP_TWIG_H -#define PHP_TWIG_VERSION "1.16.2" +#define PHP_TWIG_VERSION "1.18.0" #include "php.h" diff --git a/vendor/twig/twig/lib/Twig/Autoloader.php b/vendor/twig/twig/lib/Twig/Autoloader.php index 42f16f094a..36b10951c0 100644 --- a/vendor/twig/twig/lib/Twig/Autoloader.php +++ b/vendor/twig/twig/lib/Twig/Autoloader.php @@ -19,7 +19,7 @@ class Twig_Autoloader /** * Registers Twig_Autoloader as an SPL autoloader. * - * @param bool $prepend Whether to prepend the autoloader or not. + * @param bool $prepend Whether to prepend the autoloader or not. */ public static function register($prepend = false) { diff --git a/vendor/twig/twig/lib/Twig/Compiler.php b/vendor/twig/twig/lib/Twig/Compiler.php index 93dc87660d..2514c31e8a 100644 --- a/vendor/twig/twig/lib/Twig/Compiler.php +++ b/vendor/twig/twig/lib/Twig/Compiler.php @@ -231,13 +231,15 @@ class Twig_Compiler implements Twig_CompilerInterface public function getDebugInfo() { + ksort($this->debugInfo); + return $this->debugInfo; } /** * Indents the generated code. * - * @param int $step The number of indentation to add + * @param int $step The number of indentation to add * * @return Twig_Compiler The current compiler instance */ @@ -251,7 +253,7 @@ class Twig_Compiler implements Twig_CompilerInterface /** * Outdents the generated code. * - * @param int $step The number of indentation to remove + * @param int $step The number of indentation to remove * * @return Twig_Compiler The current compiler instance * diff --git a/vendor/twig/twig/lib/Twig/Environment.php b/vendor/twig/twig/lib/Twig/Environment.php index 17e88ab2a5..0cb9bb7cea 100644 --- a/vendor/twig/twig/lib/Twig/Environment.php +++ b/vendor/twig/twig/lib/Twig/Environment.php @@ -16,7 +16,7 @@ */ class Twig_Environment { - const VERSION = '1.16.2'; + const VERSION = '1.18.0'; protected $charset; protected $loader; @@ -72,6 +72,7 @@ class Twig_Environment * * false: disable auto-escaping * * true: equivalent to html * * html, js: set the autoescaping to one of the supported strategies + * * filename: set the autoescaping strategy based on the template filename extension * * PHP callback: a PHP callback that returns an escaping strategy based on the template "filename" * * * optimizations: A flag that indicates which optimizations to apply @@ -154,7 +155,7 @@ class Twig_Environment /** * Checks if debug mode is enabled. * - * @return bool true if debug mode is enabled, false otherwise + * @return bool true if debug mode is enabled, false otherwise */ public function isDebug() { @@ -180,7 +181,7 @@ class Twig_Environment /** * Checks if the auto_reload option is enabled. * - * @return bool true if auto_reload is enabled, false otherwise + * @return bool true if auto_reload is enabled, false otherwise */ public function isAutoReload() { @@ -206,7 +207,7 @@ class Twig_Environment /** * Checks if the strict_variables option is enabled. * - * @return bool true if strict_variables is enabled, false otherwise + * @return bool true if strict_variables is enabled, false otherwise */ public function isStrictVariables() { @@ -223,12 +224,12 @@ class Twig_Environment return $this->cache; } - /** - * Sets the cache directory or false if cache is disabled. - * - * @param string|false $cache The absolute path to the compiled templates, - * or false to disable cache - */ + /** + * Sets the cache directory or false if cache is disabled. + * + * @param string|false $cache The absolute path to the compiled templates, + * or false to disable cache + */ public function setCache($cache) { $this->cache = $cache ? $cache : false; @@ -255,8 +256,8 @@ class Twig_Environment /** * Gets the template class associated with the given string. * - * @param string $name The name for which to calculate the template class name - * @param int $index The index if it is an embedded template + * @param string $name The name for which to calculate the template class name + * @param int $index The index if it is an embedded template * * @return string The template class name */ @@ -310,8 +311,8 @@ class Twig_Environment /** * Loads a template by name. * - * @param string $name The template name - * @param int $index The index if it is an embedded template + * @param string $name The template name + * @param int $index The index if it is an embedded template * * @return Twig_TemplateInterface A template instance representing the given template name * @@ -345,6 +346,41 @@ class Twig_Environment return $this->loadedTemplates[$cls] = new $cls($this); } + /** + * Creates a template from source. + * + * This method should not be used as a generic way to load templates. + * + * @param string $name The template name + * @param int $index The index if it is an embedded template + * + * @return Twig_Template A template instance representing the given template name + * + * @throws Twig_Error_Loader When the template cannot be found + * @throws Twig_Error_Syntax When an error occurred during compilation + */ + public function createTemplate($template) + { + $name = sprintf('__string_template__%s', hash('sha256', uniqid(mt_rand(), true), false)); + + $loader = new Twig_Loader_Chain(array( + new Twig_Loader_Array(array($name => $template)), + $current = $this->getLoader(), + )); + + $this->setLoader($loader); + try { + $template = $this->loadTemplate($name); + } catch (Exception $e) { + $this->setLoader($current); + + throw $e; + } + $this->setLoader($current); + + return $template; + } + /** * Returns true if the template is still fresh. * @@ -352,10 +388,10 @@ class Twig_Environment * this method also checks if the enabled extensions have * not changed. * - * @param string $name The template name - * @param timestamp $time The last modification time of the cached template + * @param string $name The template name + * @param int $time The last modification time of the cached template * - * @return bool true if the template is fresh, false otherwise + * @return bool true if the template is fresh, false otherwise */ public function isTemplateFresh($name, $time) { @@ -626,7 +662,7 @@ class Twig_Environment * * @param string $name The extension name * - * @return bool Whether the extension is registered or not + * @return bool Whether the extension is registered or not */ public function hasExtension($name) { @@ -1232,8 +1268,11 @@ class Twig_Environment { $dir = dirname($file); if (!is_dir($dir)) { - if (false === @mkdir($dir, 0777, true) && !is_dir($dir)) { - throw new RuntimeException(sprintf("Unable to create the cache directory (%s).", $dir)); + if (false === @mkdir($dir, 0777, true)) { + clearstatcache(false, $dir); + if (!is_dir($dir)) { + throw new RuntimeException(sprintf("Unable to create the cache directory (%s).", $dir)); + } } } elseif (!is_writable($dir)) { throw new RuntimeException(sprintf("Unable to write in the cache directory (%s).", $dir)); diff --git a/vendor/twig/twig/lib/Twig/Error.php b/vendor/twig/twig/lib/Twig/Error.php index 5b253dd752..afb8ddde08 100644 --- a/vendor/twig/twig/lib/Twig/Error.php +++ b/vendor/twig/twig/lib/Twig/Error.php @@ -111,7 +111,7 @@ class Twig_Error extends Exception /** * Gets the template line where the error occurred. * - * @return int The template line + * @return int The template line */ public function getTemplateLine() { @@ -121,7 +121,7 @@ class Twig_Error extends Exception /** * Sets the template line where the error occurred. * - * @param int $lineno The template line + * @param int $lineno The template line */ public function setTemplateLine($lineno) { diff --git a/vendor/twig/twig/lib/Twig/ExistsLoaderInterface.php b/vendor/twig/twig/lib/Twig/ExistsLoaderInterface.php index 48df9e1a3b..b168c3c354 100644 --- a/vendor/twig/twig/lib/Twig/ExistsLoaderInterface.php +++ b/vendor/twig/twig/lib/Twig/ExistsLoaderInterface.php @@ -23,7 +23,7 @@ interface Twig_ExistsLoaderInterface * * @param string $name The name of the template to check if we can load * - * @return bool If the template source code is handled by this loader or not + * @return bool If the template source code is handled by this loader or not */ public function exists($name); } diff --git a/vendor/twig/twig/lib/Twig/ExpressionParser.php b/vendor/twig/twig/lib/Twig/ExpressionParser.php index f685bad8ec..fa9fa35e8e 100644 --- a/vendor/twig/twig/lib/Twig/ExpressionParser.php +++ b/vendor/twig/twig/lib/Twig/ExpressionParser.php @@ -164,6 +164,21 @@ class Twig_ExpressionParser $this->parser->getStream()->next(); $node = new Twig_Node_Expression_Name($token->getValue(), $token->getLine()); break; + } elseif (isset($this->unaryOperators[$token->getValue()])) { + $class = $this->unaryOperators[$token->getValue()]['class']; + + $ref = new ReflectionClass($class); + $negClass = 'Twig_Node_Expression_Unary_Neg'; + $posClass = 'Twig_Node_Expression_Unary_Pos'; + if (!(in_array($ref->getName(), array($negClass, $posClass)) || $ref->isSubclassOf($negClass) || $ref->isSubclassOf($posClass))) { + throw new Twig_Error_Syntax(sprintf('Unexpected unary operator "%s"', $token->getValue()), $token->getLine(), $this->parser->getFilename()); + } + + $this->parser->getStream()->next(); + $expr = $this->parsePrimaryExpression(); + + $node = new $class($expr, $token->getLine()); + break; } default: @@ -451,8 +466,8 @@ class Twig_ExpressionParser /** * Parses arguments. * - * @param bool $namedArguments Whether to allow named arguments or not - * @param bool $definition Whether we are parsing arguments for a function definition + * @param bool $namedArguments Whether to allow named arguments or not + * @param bool $definition Whether we are parsing arguments for a function definition */ public function parseArguments($namedArguments = false, $definition = false) { @@ -583,7 +598,9 @@ class Twig_ExpressionParser // checks that the node only contains "constant" elements protected function checkConstantExpression(Twig_NodeInterface $node) { - if (!($node instanceof Twig_Node_Expression_Constant || $node instanceof Twig_Node_Expression_Array)) { + if (!($node instanceof Twig_Node_Expression_Constant || $node instanceof Twig_Node_Expression_Array + || $node instanceof Twig_Node_Expression_Unary_Neg || $node instanceof Twig_Node_Expression_Unary_Pos + )) { return false; } diff --git a/vendor/twig/twig/lib/Twig/Extension/Core.php b/vendor/twig/twig/lib/Twig/Extension/Core.php index e71d741d25..4dbee873cf 100644 --- a/vendor/twig/twig/lib/Twig/Extension/Core.php +++ b/vendor/twig/twig/lib/Twig/Extension/Core.php @@ -95,9 +95,9 @@ class Twig_Extension_Core extends Twig_Extension /** * Sets the default format to be used by the number_format filter. * - * @param int $decimal The number of decimal places to use. - * @param string $decimalPoint The character(s) to use for the decimal point. - * @param string $thousandSep The character(s) to use for the thousands separator. + * @param int $decimal The number of decimal places to use. + * @param string $decimalPoint The character(s) to use for the decimal point. + * @param string $thousandSep The character(s) to use for the thousands separator. */ public function setNumberFormat($decimal, $decimalPoint, $thousandSep) { @@ -621,8 +621,8 @@ if (version_compare(PHP_VERSION, '5.3.0', '<')) { /** * JSON encodes a variable. * - * @param mixed $value The value to encode. - * @param int $options Not used on PHP 5.2.x + * @param mixed $value The value to encode. + * @param int $options Not used on PHP 5.2.x * * @return mixed The JSON encoded value */ @@ -640,8 +640,8 @@ if (version_compare(PHP_VERSION, '5.3.0', '<')) { /** * JSON encodes a variable. * - * @param mixed $value The value to encode. - * @param int $options Bitmask consisting of JSON_HEX_QUOT, JSON_HEX_TAG, JSON_HEX_AMP, JSON_HEX_APOS, JSON_NUMERIC_CHECK, JSON_PRETTY_PRINT, JSON_UNESCAPED_SLASHES, JSON_FORCE_OBJECT + * @param mixed $value The value to encode. + * @param int $options Bitmask consisting of JSON_HEX_QUOT, JSON_HEX_TAG, JSON_HEX_AMP, JSON_HEX_APOS, JSON_NUMERIC_CHECK, JSON_PRETTY_PRINT, JSON_UNESCAPED_SLASHES, JSON_FORCE_OBJECT * * @return mixed The JSON encoded value */ @@ -708,7 +708,11 @@ function twig_slice(Twig_Environment $env, $item, $start, $length = null, $prese } if ($start >= 0 && $length >= 0) { - return iterator_to_array(new LimitIterator($item, $start, $length === null ? -1 : $length), $preserveKeys); + try { + return iterator_to_array(new LimitIterator($item, $start, $length === null ? -1 : $length), $preserveKeys); + } catch (OutOfBoundsException $exception) { + return array(); + } } $item = iterator_to_array($item, $preserveKeys); @@ -930,15 +934,11 @@ function twig_sort_filter($array) function twig_in_filter($value, $compare) { if (is_array($compare)) { - return in_array($value, $compare, is_object($value)); - } elseif (is_string($compare)) { - if (!strlen($value)) { - return empty($compare); - } - - return false !== strpos($compare, (string) $value); + return in_array($value, $compare, is_object($value) || is_resource($value)); + } elseif (is_string($compare) && (is_string($value) || is_int($value) || is_float($value))) { + return '' === $value || false !== strpos($compare, (string) $value); } elseif ($compare instanceof Traversable) { - return in_array($value, iterator_to_array($compare, false), is_object($value)); + return in_array($value, iterator_to_array($compare, false), is_object($value) || is_resource($value)); } return false; @@ -1216,7 +1216,6 @@ function _twig_escape_html_attr_callback($matches) * Per OWASP recommendations, we'll use hex entities for any other * characters where a named entity does not exist. */ - return sprintf('&#x%s;', $hex); } @@ -1228,7 +1227,7 @@ if (function_exists('mb_get_info')) { * @param Twig_Environment $env A Twig_Environment instance * @param mixed $thing A variable * - * @return int The length of the value + * @return int The length of the value */ function twig_length_filter(Twig_Environment $env, $thing) { @@ -1312,7 +1311,7 @@ else { * @param Twig_Environment $env A Twig_Environment instance * @param mixed $thing A variable * - * @return int The length of the value + * @return int The length of the value */ function twig_length_filter(Twig_Environment $env, $thing) { diff --git a/vendor/twig/twig/lib/Twig/Extension/Escaper.php b/vendor/twig/twig/lib/Twig/Extension/Escaper.php index d3e5ad0ec5..0edf563ab6 100644 --- a/vendor/twig/twig/lib/Twig/Extension/Escaper.php +++ b/vendor/twig/twig/lib/Twig/Extension/Escaper.php @@ -64,6 +64,10 @@ class Twig_Extension_Escaper extends Twig_Extension $defaultStrategy = 'html'; } + if ('filename' === $defaultStrategy) { + $defaultStrategy = array('Twig_FileExtensionEscapingStrategy', 'guess'); + } + $this->defaultStrategy = $defaultStrategy; } diff --git a/vendor/twig/twig/lib/Twig/Extension/StringLoader.php b/vendor/twig/twig/lib/Twig/Extension/StringLoader.php index 5e1a60d0a3..4e1a546c2b 100644 --- a/vendor/twig/twig/lib/Twig/Extension/StringLoader.php +++ b/vendor/twig/twig/lib/Twig/Extension/StringLoader.php @@ -43,22 +43,5 @@ class Twig_Extension_StringLoader extends Twig_Extension */ function twig_template_from_string(Twig_Environment $env, $template) { - $name = sprintf('__string_template__%s', hash('sha256', uniqid(mt_rand(), true), false)); - - $loader = new Twig_Loader_Chain(array( - new Twig_Loader_Array(array($name => $template)), - $current = $env->getLoader(), - )); - - $env->setLoader($loader); - try { - $template = $env->loadTemplate($name); - } catch (Exception $e) { - $env->setLoader($current); - - throw $e; - } - $env->setLoader($current); - - return $template; + return $env->createTemplate($template); } diff --git a/vendor/twig/twig/lib/Twig/Lexer.php b/vendor/twig/twig/lib/Twig/Lexer.php index ad3ec7d483..19380b5830 100644 --- a/vendor/twig/twig/lib/Twig/Lexer.php +++ b/vendor/twig/twig/lib/Twig/Lexer.php @@ -317,11 +317,9 @@ class Twig_Lexer implements Twig_LexerInterface $this->pushToken(Twig_Token::INTERPOLATION_START_TYPE); $this->moveCursor($match[0]); $this->pushState(self::STATE_INTERPOLATION); - } elseif (preg_match(self::REGEX_DQ_STRING_PART, $this->code, $match, null, $this->cursor) && strlen($match[0]) > 0) { $this->pushToken(Twig_Token::STRING_TYPE, stripcslashes($match[0])); $this->moveCursor($match[0]); - } elseif (preg_match(self::REGEX_DQ_STRING_DELIM, $this->code, $match, null, $this->cursor)) { list($expect, $lineno) = array_pop($this->brackets); if ($this->code[$this->cursor] != '"') { diff --git a/vendor/twig/twig/lib/Twig/Loader/Filesystem.php b/vendor/twig/twig/lib/Twig/Loader/Filesystem.php index d0ae1cc1d7..329a23ff1a 100644 --- a/vendor/twig/twig/lib/Twig/Loader/Filesystem.php +++ b/vendor/twig/twig/lib/Twig/Loader/Filesystem.php @@ -183,6 +183,9 @@ class Twig_Loader_Filesystem implements Twig_LoaderInterface, Twig_ExistsLoaderI } foreach ($this->paths[$namespace] as $path) { + if (false !== $realpath = realpath($path.'/'.$shortname)) { + return $this->cache[$name] = $realpath; + } if (is_file($path.'/'.$shortname)) { return $this->cache[$name] = $path.'/'.$shortname; } diff --git a/vendor/twig/twig/lib/Twig/LoaderInterface.php b/vendor/twig/twig/lib/Twig/LoaderInterface.php index 4405291fff..b87058e67c 100644 --- a/vendor/twig/twig/lib/Twig/LoaderInterface.php +++ b/vendor/twig/twig/lib/Twig/LoaderInterface.php @@ -44,7 +44,7 @@ interface Twig_LoaderInterface * @param string $name The template name * @param timestamp $time The last modification time of the cached template * - * @return bool true if the template is fresh, false otherwise + * @return bool true if the template is fresh, false otherwise * * @throws Twig_Error_Loader When $name is not found */ diff --git a/vendor/twig/twig/lib/Twig/Node.php b/vendor/twig/twig/lib/Twig/Node.php index 20af544981..515d81bb58 100644 --- a/vendor/twig/twig/lib/Twig/Node.php +++ b/vendor/twig/twig/lib/Twig/Node.php @@ -28,10 +28,10 @@ class Twig_Node implements Twig_NodeInterface * The nodes are automatically made available as properties ($this->node). * The attributes are automatically made available as array items ($this['name']). * - * @param array $nodes An array of named nodes - * @param array $attributes An array of attributes (should not be nodes) - * @param int $lineno The line number - * @param string $tag The tag name associated with the Node + * @param array $nodes An array of named nodes + * @param array $attributes An array of attributes (should not be nodes) + * @param int $lineno The line number + * @param string $tag The tag name associated with the Node */ public function __construct(array $nodes = array(), array $attributes = array(), $lineno = 0, $tag = null) { @@ -124,7 +124,7 @@ class Twig_Node implements Twig_NodeInterface * * @param string The attribute name * - * @return bool true if the attribute is defined, false otherwise + * @return bool true if the attribute is defined, false otherwise */ public function hasAttribute($name) { @@ -173,7 +173,7 @@ class Twig_Node implements Twig_NodeInterface * * @param string The node name * - * @return bool true if the node with the given name exists, false otherwise + * @return bool true if the node with the given name exists, false otherwise */ public function hasNode($name) { diff --git a/vendor/twig/twig/lib/Twig/Node/Expression/Call.php b/vendor/twig/twig/lib/Twig/Node/Expression/Call.php index 912b837a9f..d09e06f8f9 100644 --- a/vendor/twig/twig/lib/Twig/Node/Expression/Call.php +++ b/vendor/twig/twig/lib/Twig/Node/Expression/Call.php @@ -90,6 +90,9 @@ abstract class Twig_Node_Expression_Call extends Twig_Node_Expression protected function getArguments($callable, $arguments) { + $callType = $this->getAttribute('type'); + $callName = $this->getAttribute('name'); + $parameters = array(); $named = false; foreach ($arguments as $name => $node) { @@ -97,7 +100,7 @@ abstract class Twig_Node_Expression_Call extends Twig_Node_Expression $named = true; $name = $this->normalizeName($name); } elseif ($named) { - throw new Twig_Error_Syntax(sprintf('Positional arguments cannot be used after named arguments for %s "%s".', $this->getAttribute('type'), $this->getAttribute('name'))); + throw new Twig_Error_Syntax(sprintf('Positional arguments cannot be used after named arguments for %s "%s".', $callType, $callName)); } $parameters[$name] = $node; @@ -108,7 +111,7 @@ abstract class Twig_Node_Expression_Call extends Twig_Node_Expression } if (!$callable) { - throw new LogicException(sprintf('Named arguments are not supported for %s "%s".', $this->getAttribute('type'), $this->getAttribute('name'))); + throw new LogicException(sprintf('Named arguments are not supported for %s "%s".', $callType, $callName)); } // manage named arguments @@ -138,32 +141,61 @@ abstract class Twig_Node_Expression_Call extends Twig_Node_Expression } $arguments = array(); + $names = array(); + $missingArguments = array(); + $optionalArguments = array(); $pos = 0; foreach ($definition as $param) { - $name = $this->normalizeName($param->name); + $names[] = $name = $this->normalizeName($param->name); if (array_key_exists($name, $parameters)) { if (array_key_exists($pos, $parameters)) { - throw new Twig_Error_Syntax(sprintf('Argument "%s" is defined twice for %s "%s".', $name, $this->getAttribute('type'), $this->getAttribute('name'))); + throw new Twig_Error_Syntax(sprintf('Argument "%s" is defined twice for %s "%s".', $name, $callType, $callName)); + } + + if (!empty($missingArguments)) { + throw new Twig_Error_Syntax(sprintf( + 'Argument "%s" could not be assigned for %s "%s(%s)" because it is mapped to an internal PHP function which cannot determine default value for optional argument%s "%s".', + $name, $callType, $callName, implode(', ', $names), count($missingArguments) > 1 ? 's' : '', implode('", "', $missingArguments)) + ); } + $arguments = array_merge($arguments, $optionalArguments); $arguments[] = $parameters[$name]; unset($parameters[$name]); + $optionalArguments = array(); } elseif (array_key_exists($pos, $parameters)) { + $arguments = array_merge($arguments, $optionalArguments); $arguments[] = $parameters[$pos]; unset($parameters[$pos]); + $optionalArguments = array(); ++$pos; } elseif ($param->isDefaultValueAvailable()) { - $arguments[] = new Twig_Node_Expression_Constant($param->getDefaultValue(), -1); + $optionalArguments[] = new Twig_Node_Expression_Constant($param->getDefaultValue(), -1); } elseif ($param->isOptional()) { - break; + if (empty($parameters)) { + break; + } else { + $missingArguments[] = $name; + } } else { - throw new Twig_Error_Syntax(sprintf('Value for argument "%s" is required for %s "%s".', $name, $this->getAttribute('type'), $this->getAttribute('name'))); + throw new Twig_Error_Syntax(sprintf('Value for argument "%s" is required for %s "%s".', $name, $callType, $callName)); } } if (!empty($parameters)) { - throw new Twig_Error_Syntax(sprintf('Unknown argument%s "%s" for %s "%s".', count($parameters) > 1 ? 's' : '', implode('", "', array_keys($parameters)), $this->getAttribute('type'), $this->getAttribute('name'))); + $unknownParameter = null; + foreach ($parameters as $parameter) { + if ($parameter instanceof Twig_Node) { + $unknownParameter = $parameter; + break; + } + } + + throw new Twig_Error_Syntax(sprintf( + 'Unknown argument%s "%s" for %s "%s(%s)".', + count($parameters) > 1 ? 's' : '', implode('", "', array_keys($parameters)), $callType, $callName, implode(', ', $names) + ), $unknownParameter ? $unknownParameter->getLine() : -1); } return $arguments; diff --git a/vendor/twig/twig/lib/Twig/Node/Expression/Name.php b/vendor/twig/twig/lib/Twig/Node/Expression/Name.php index 3b8fae01dc..4cbdea9753 100644 --- a/vendor/twig/twig/lib/Twig/Node/Expression/Name.php +++ b/vendor/twig/twig/lib/Twig/Node/Expression/Name.php @@ -26,6 +26,8 @@ class Twig_Node_Expression_Name extends Twig_Node_Expression { $name = $this->getAttribute('name'); + $compiler->addDebugInfo($this); + if ($this->getAttribute('is_defined_test')) { if ($this->isSpecial()) { $compiler->repr(true); diff --git a/vendor/twig/twig/lib/Twig/Node/Expression/Unary.php b/vendor/twig/twig/lib/Twig/Node/Expression/Unary.php index c514388eb6..1cf54c3264 100644 --- a/vendor/twig/twig/lib/Twig/Node/Expression/Unary.php +++ b/vendor/twig/twig/lib/Twig/Node/Expression/Unary.php @@ -18,12 +18,9 @@ abstract class Twig_Node_Expression_Unary extends Twig_Node_Expression public function compile(Twig_Compiler $compiler) { - $compiler->raw('('); + $compiler->raw(' '); $this->operator($compiler); - $compiler - ->subcompile($this->getNode('node')) - ->raw(')') - ; + $compiler->subcompile($this->getNode('node')); } abstract public function operator(Twig_Compiler $compiler); diff --git a/vendor/twig/twig/lib/Twig/Node/Module.php b/vendor/twig/twig/lib/Twig/Node/Module.php index 9f66b28d50..c156e29597 100644 --- a/vendor/twig/twig/lib/Twig/Node/Module.php +++ b/vendor/twig/twig/lib/Twig/Node/Module.php @@ -13,6 +13,10 @@ /** * Represents a module node. * + * Consider this class as being final. If you need to customize the behavior of + * the generated class, consider adding nodes to the following nodes: display_start, + * display_end, constructor_start, constructor_end, and class_end. + * * @author Fabien Potencier */ class Twig_Node_Module extends Twig_Node @@ -20,7 +24,22 @@ class Twig_Node_Module extends Twig_Node public function __construct(Twig_NodeInterface $body, Twig_Node_Expression $parent = null, Twig_NodeInterface $blocks, Twig_NodeInterface $macros, Twig_NodeInterface $traits, $embeddedTemplates, $filename) { // embedded templates are set as attributes so that they are only visited once by the visitors - parent::__construct(array('parent' => $parent, 'body' => $body, 'blocks' => $blocks, 'macros' => $macros, 'traits' => $traits), array('filename' => $filename, 'index' => null, 'embedded_templates' => $embeddedTemplates), 1); + parent::__construct(array( + 'parent' => $parent, + 'body' => $body, + 'blocks' => $blocks, + 'macros' => $macros, + 'traits' => $traits, + 'display_start' => new Twig_Node(), + 'display_end' => new Twig_Node(), + 'constructor_start' => new Twig_Node(), + 'constructor_end' => new Twig_Node(), + 'class_end' => new Twig_Node(), + ), array( + 'filename' => $filename, + 'index' => null, + 'embedded_templates' => $embeddedTemplates, + ), 1); } public function setIndex($index) @@ -50,17 +69,20 @@ class Twig_Node_Module extends Twig_Node $this->compileClassHeader($compiler); - if (count($this->getNode('blocks')) || count($this->getNode('traits')) || null === $this->getNode('parent') || $this->getNode('parent') instanceof Twig_Node_Expression_Constant) { + if ( + count($this->getNode('blocks')) + || count($this->getNode('traits')) + || null === $this->getNode('parent') + || $this->getNode('parent') instanceof Twig_Node_Expression_Constant + || count($this->getNode('constructor_start')) + || count($this->getNode('constructor_end')) + ) { $this->compileConstructor($compiler); } $this->compileGetParent($compiler); - $this->compileDisplayHeader($compiler); - - $this->compileDisplayBody($compiler); - - $this->compileDisplayFooter($compiler); + $this->compileDisplay($compiler); $compiler->subcompile($this->getNode('blocks')); @@ -77,22 +99,23 @@ class Twig_Node_Module extends Twig_Node protected function compileGetParent(Twig_Compiler $compiler) { - if (null === $this->getNode('parent')) { + if (null === $parent = $this->getNode('parent')) { return; } $compiler ->write("protected function doGetParent(array \$context)\n", "{\n") ->indent() + ->addDebugInfo($parent) ->write("return ") ; - if ($this->getNode('parent') instanceof Twig_Node_Expression_Constant) { - $compiler->subcompile($this->getNode('parent')); + if ($parent instanceof Twig_Node_Expression_Constant) { + $compiler->subcompile($parent); } else { $compiler ->raw("\$this->env->resolveTemplate(") - ->subcompile($this->getNode('parent')) + ->subcompile($parent) ->raw(")") ; } @@ -104,20 +127,6 @@ class Twig_Node_Module extends Twig_Node ; } - protected function compileDisplayBody(Twig_Compiler $compiler) - { - $compiler->subcompile($this->getNode('body')); - - if (null !== $this->getNode('parent')) { - if ($this->getNode('parent') instanceof Twig_Node_Expression_Constant) { - $compiler->write("\$this->parent"); - } else { - $compiler->write("\$this->getParent(\$context)"); - } - $compiler->raw("->display(\$context, array_merge(\$this->blocks, \$blocks));\n"); - } - } - protected function compileClassHeader(Twig_Compiler $compiler) { $compiler @@ -136,17 +145,29 @@ class Twig_Node_Module extends Twig_Node $compiler ->write("public function __construct(Twig_Environment \$env)\n", "{\n") ->indent() + ->subcompile($this->getNode('constructor_start')) ->write("parent::__construct(\$env);\n\n") ; // parent - if (null === $this->getNode('parent')) { + if (null === $parent = $this->getNode('parent')) { $compiler->write("\$this->parent = false;\n\n"); - } elseif ($this->getNode('parent') instanceof Twig_Node_Expression_Constant) { + } elseif ($parent instanceof Twig_Node_Expression_Constant) { $compiler + ->addDebugInfo($parent) + ->write("try {\n") + ->indent() ->write("\$this->parent = \$this->env->loadTemplate(") - ->subcompile($this->getNode('parent')) - ->raw(");\n\n") + ->subcompile($parent) + ->raw(");\n") + ->outdent() + ->write("} catch (Twig_Error_Loader \$e) {\n") + ->indent() + ->write("\$e->setTemplateFile(\$this->getTemplateName());\n") + ->write(sprintf("\$e->setTemplateLine(%d);\n\n", $parent->getLine())) + ->write("throw \$e;\n") + ->outdent() + ->write("}\n\n") ; } @@ -249,21 +270,32 @@ class Twig_Node_Module extends Twig_Node ->outdent() ->write(");\n") ->outdent() - ->write("}\n\n"); + ->subcompile($this->getNode('constructor_end')) + ->write("}\n\n") ; } - protected function compileDisplayHeader(Twig_Compiler $compiler) + protected function compileDisplay(Twig_Compiler $compiler) { $compiler ->write("protected function doDisplay(array \$context, array \$blocks = array())\n", "{\n") ->indent() + ->subcompile($this->getNode('display_start')) + ->subcompile($this->getNode('body')) ; - } - protected function compileDisplayFooter(Twig_Compiler $compiler) - { + if (null !== $parent = $this->getNode('parent')) { + $compiler->addDebugInfo($parent); + if ($parent instanceof Twig_Node_Expression_Constant) { + $compiler->write("\$this->parent"); + } else { + $compiler->write("\$this->getParent(\$context)"); + } + $compiler->raw("->display(\$context, array_merge(\$this->blocks, \$blocks));\n"); + } + $compiler + ->subcompile($this->getNode('display_end')) ->outdent() ->write("}\n\n") ; @@ -272,6 +304,7 @@ class Twig_Node_Module extends Twig_Node protected function compileClassFooter(Twig_Compiler $compiler) { $compiler + ->subcompile($this->getNode('class_end')) ->outdent() ->write("}\n") ; diff --git a/vendor/twig/twig/lib/Twig/Node/SandboxedModule.php b/vendor/twig/twig/lib/Twig/Node/SandboxedModule.php deleted file mode 100644 index 410332cc36..0000000000 --- a/vendor/twig/twig/lib/Twig/Node/SandboxedModule.php +++ /dev/null @@ -1,96 +0,0 @@ - - */ -class Twig_Node_SandboxedModule extends Twig_Node_Module -{ - protected $usedFilters; - protected $usedTags; - protected $usedFunctions; - - public function __construct(Twig_Node_Module $node, array $usedFilters, array $usedTags, array $usedFunctions) - { - parent::__construct($node->getNode('body'), $node->getNode('parent'), $node->getNode('blocks'), $node->getNode('macros'), $node->getNode('traits'), $node->getAttribute('embedded_templates'), $node->getAttribute('filename')); - - $this->setAttribute('index', $node->getAttribute('index')); - - $this->usedFilters = $usedFilters; - $this->usedTags = $usedTags; - $this->usedFunctions = $usedFunctions; - } - - protected function compileDisplayBody(Twig_Compiler $compiler) - { - $compiler->write("\$this->checkSecurity();\n"); - - parent::compileDisplayBody($compiler); - } - - protected function compileDisplayFooter(Twig_Compiler $compiler) - { - parent::compileDisplayFooter($compiler); - - $tags = $filters = $functions = array(); - foreach (array('tags', 'filters', 'functions') as $type) { - foreach ($this->{'used'.ucfirst($type)} as $name => $node) { - if ($node instanceof Twig_Node) { - ${$type}[$name] = $node->getLine(); - } else { - ${$type}[$node] = null; - } - } - } - - $compiler - ->write("protected function checkSecurity()\n", "{\n") - ->indent() - ->write("\$tags = ")->repr(array_filter($tags))->raw(";\n") - ->write("\$filters = ")->repr(array_filter($filters))->raw(";\n") - ->write("\$functions = ")->repr(array_filter($functions))->raw(";\n\n") - ->write("try {\n") - ->indent() - ->write("\$this->env->getExtension('sandbox')->checkSecurity(\n") - ->indent() - ->write(!$tags ? "array(),\n" : "array('".implode("', '", array_keys($tags))."'),\n") - ->write(!$filters ? "array(),\n" : "array('".implode("', '", array_keys($filters))."'),\n") - ->write(!$functions ? "array()\n" : "array('".implode("', '", array_keys($functions))."')\n") - ->outdent() - ->write(");\n") - ->outdent() - ->write("} catch (Twig_Sandbox_SecurityError \$e) {\n") - ->indent() - ->write("\$e->setTemplateFile(\$this->getTemplateName());\n\n") - ->write("if (\$e instanceof Twig_Sandbox_SecurityNotAllowedTagError && isset(\$tags[\$e->getTagName()])) {\n") - ->indent() - ->write("\$e->setTemplateLine(\$tags[\$e->getTagName()]);\n") - ->outdent() - ->write("} elseif (\$e instanceof Twig_Sandbox_SecurityNotAllowedFilterError && isset(\$filters[\$e->getFilterName()])) {\n") - ->indent() - ->write("\$e->setTemplateLine(\$filters[\$e->getFilterName()]);\n") - ->outdent() - ->write("} elseif (\$e instanceof Twig_Sandbox_SecurityNotAllowedFunctionError && isset(\$functions[\$e->getFunctionName()])) {\n") - ->indent() - ->write("\$e->setTemplateLine(\$functions[\$e->getFunctionName()]);\n") - ->outdent() - ->write("}\n\n") - ->write("throw \$e;\n") - ->outdent() - ->write("}\n") - ->outdent() - ->write("}\n\n") - ; - } -} diff --git a/vendor/twig/twig/lib/Twig/NodeVisitor/Optimizer.php b/vendor/twig/twig/lib/Twig/NodeVisitor/Optimizer.php index 3cc3312b5a..6b4233b53a 100644 --- a/vendor/twig/twig/lib/Twig/NodeVisitor/Optimizer.php +++ b/vendor/twig/twig/lib/Twig/NodeVisitor/Optimizer.php @@ -36,7 +36,7 @@ class Twig_NodeVisitor_Optimizer implements Twig_NodeVisitorInterface /** * Constructor. * - * @param int $optimizers The optimizer mode + * @param int $optimizers The optimizer mode */ public function __construct($optimizers = -1) { @@ -205,6 +205,16 @@ class Twig_NodeVisitor_Optimizer implements Twig_NodeVisitorInterface $this->addLoopToAll(); } + // include function without the with_context=false parameter + elseif ($node instanceof Twig_Node_Expression_Function + && 'include' === $node->getAttribute('name') + && (!$node->getNode('arguments')->hasNode('with_context') + || false !== $node->getNode('arguments')->getNode('with_context')->getAttribute('value') + ) + ) { + $this->addLoopToAll(); + } + // the loop variable is referenced via an attribute elseif ($node instanceof Twig_Node_Expression_GetAttr && (!$node->getNode('attribute') instanceof Twig_Node_Expression_Constant diff --git a/vendor/twig/twig/lib/Twig/NodeVisitor/Sandbox.php b/vendor/twig/twig/lib/Twig/NodeVisitor/Sandbox.php index e5e3ff631d..5467f81347 100644 --- a/vendor/twig/twig/lib/Twig/NodeVisitor/Sandbox.php +++ b/vendor/twig/twig/lib/Twig/NodeVisitor/Sandbox.php @@ -76,7 +76,7 @@ class Twig_NodeVisitor_Sandbox implements Twig_NodeVisitorInterface if ($node instanceof Twig_Node_Module) { $this->inAModule = false; - return new Twig_Node_SandboxedModule($node, $this->filters, $this->tags, $this->functions); + $node->setNode('display_start', new Twig_Node(array(new Twig_Node_CheckSecurity($this->filters, $this->tags, $this->functions), $node->getNode('display_start')))); } return $node; diff --git a/vendor/twig/twig/lib/Twig/NodeVisitorInterface.php b/vendor/twig/twig/lib/Twig/NodeVisitorInterface.php index 608adedb02..f276163029 100644 --- a/vendor/twig/twig/lib/Twig/NodeVisitorInterface.php +++ b/vendor/twig/twig/lib/Twig/NodeVisitorInterface.php @@ -41,7 +41,7 @@ interface Twig_NodeVisitorInterface * * Priority should be between -10 and 10 (0 is the default). * - * @return int The priority level + * @return int The priority level */ public function getPriority(); } diff --git a/vendor/twig/twig/lib/Twig/Template.php b/vendor/twig/twig/lib/Twig/Template.php index 63910dacc0..70d19e740b 100644 --- a/vendor/twig/twig/lib/Twig/Template.php +++ b/vendor/twig/twig/lib/Twig/Template.php @@ -20,7 +20,7 @@ abstract class Twig_Template implements Twig_TemplateInterface protected static $cache = array(); protected $parent; - protected $parents; + protected $parents = array(); protected $env; protected $blocks; protected $traits; @@ -66,15 +66,25 @@ abstract class Twig_Template implements Twig_TemplateInterface return $this->parent; } - $parent = $this->doGetParent($context); - if (false === $parent) { - return false; - } elseif ($parent instanceof Twig_Template) { - $name = $parent->getTemplateName(); - $this->parents[$name] = $parent; - $parent = $name; - } elseif (!isset($this->parents[$parent])) { - $this->parents[$parent] = $this->env->loadTemplate($parent); + try { + $parent = $this->doGetParent($context); + + if (false === $parent) { + return false; + } + + if ($parent instanceof Twig_Template) { + return $this->parents[$parent->getTemplateName()] = $parent; + } + + if (!isset($this->parents[$parent])) { + $this->parents[$parent] = $this->env->loadTemplate($parent); + } + } catch (Twig_Error_Loader $e) { + $e->setTemplateFile(null); + $e->guess(); + + throw $e; } return $this->parents[$parent]; @@ -119,10 +129,10 @@ abstract class Twig_Template implements Twig_TemplateInterface * This method is for internal use only and should never be called * directly. * - * @param string $name The block name to display - * @param array $context The context - * @param array $blocks The current set of blocks - * @param bool $useBlocks Whether to use the current set of blocks + * @param string $name The block name to display + * @param array $context The context + * @param array $blocks The current set of blocks + * @param bool $useBlocks Whether to use the current set of blocks */ public function displayBlock($name, array $context, array $blocks = array(), $useBlocks = true) { @@ -178,10 +188,10 @@ abstract class Twig_Template implements Twig_TemplateInterface * This method is for internal use only and should never be called * directly. * - * @param string $name The block name to render - * @param array $context The context - * @param array $blocks The current set of blocks - * @param bool $useBlocks Whether to use the current set of blocks + * @param string $name The block name to render + * @param array $context The context + * @param array $blocks The current set of blocks + * @param bool $useBlocks Whether to use the current set of blocks * * @return string The rendered block */ @@ -208,7 +218,7 @@ abstract class Twig_Template implements Twig_TemplateInterface * * @param string $name The block name * - * @return bool true if the block exists, false otherwise + * @return bool true if the block exists, false otherwise */ public function hasBlock($name) { @@ -314,9 +324,9 @@ abstract class Twig_Template implements Twig_TemplateInterface * access for versions of PHP before 5.4. This is not a way to override * the way to get a variable value. * - * @param array $context The context - * @param string $item The variable to return from the context - * @param bool $ignoreStrictCheck Whether to ignore the strict variable check or not + * @param array $context The context + * @param string $item The variable to return from the context + * @param bool $ignoreStrictCheck Whether to ignore the strict variable check or not * * @return The content of the context variable * @@ -338,12 +348,12 @@ abstract class Twig_Template implements Twig_TemplateInterface /** * Returns the attribute value for a given array/object. * - * @param mixed $object The object or array from where to get the item - * @param mixed $item The item to get from the array or object - * @param array $arguments An array of arguments to pass if the item is an object method - * @param string $type The type of attribute (@see Twig_Template constants) - * @param bool $isDefinedTest Whether this is only a defined check - * @param bool $ignoreStrictCheck Whether to ignore the strict attribute check or not + * @param mixed $object The object or array from where to get the item + * @param mixed $item The item to get from the array or object + * @param array $arguments An array of arguments to pass if the item is an object method + * @param string $type The type of attribute (@see Twig_Template constants) + * @param bool $isDefinedTest Whether this is only a defined check + * @param bool $ignoreStrictCheck Whether to ignore the strict attribute check or not * * @return mixed The attribute value, or a Boolean when $isDefinedTest is true, or null when the attribute is not set and $ignoreStrictCheck is true * @@ -478,12 +488,4 @@ abstract class Twig_Template implements Twig_TemplateInterface return $ret; } - - /** - * This method is only useful when testing Twig. Do not use it. - */ - public static function clearCache() - { - self::$cache = array(); - } } diff --git a/vendor/twig/twig/lib/Twig/Test/IntegrationTestCase.php b/vendor/twig/twig/lib/Twig/Test/IntegrationTestCase.php index 724f094178..b8bceb8179 100644 --- a/vendor/twig/twig/lib/Twig/Test/IntegrationTestCase.php +++ b/vendor/twig/twig/lib/Twig/Test/IntegrationTestCase.php @@ -123,7 +123,7 @@ abstract class Twig_Test_IntegrationTestCase extends PHPUnit_Framework_TestCase if (false !== $exception) { list($class, ) = explode(':', $exception); - $this->assertThat(NULL, new PHPUnit_Framework_Constraint_Exception($class)); + $this->assertThat(null, new PHPUnit_Framework_Constraint_Exception($class)); } $expected = trim($match[3], "\n "); diff --git a/vendor/twig/twig/lib/Twig/Test/NodeTestCase.php b/vendor/twig/twig/lib/Twig/Test/NodeTestCase.php index b15c85ffd7..9eb44614f5 100644 --- a/vendor/twig/twig/lib/Twig/Test/NodeTestCase.php +++ b/vendor/twig/twig/lib/Twig/Test/NodeTestCase.php @@ -38,13 +38,15 @@ abstract class Twig_Test_NodeTestCase extends PHPUnit_Framework_TestCase return new Twig_Environment(); } - protected function getVariableGetter($name) + protected function getVariableGetter($name, $line = false) { + $line = $line > 0 ? "// line {$line}\n" : ''; + if (version_compare(phpversion(), '5.4.0RC1', '>=')) { - return sprintf('(isset($context["%s"]) ? $context["%s"] : null)', $name, $name); + return sprintf('%s(isset($context["%s"]) ? $context["%s"] : null)', $line, $name, $name); } - return sprintf('$this->getContext($context, "%s")', $name); + return sprintf('%s$this->getContext($context, "%s")', $line, $name); } protected function getAttributeGetter() diff --git a/vendor/twig/twig/lib/Twig/Token.php b/vendor/twig/twig/lib/Twig/Token.php index 599f9f565d..15dd4eb67d 100644 --- a/vendor/twig/twig/lib/Twig/Token.php +++ b/vendor/twig/twig/lib/Twig/Token.php @@ -38,9 +38,9 @@ class Twig_Token /** * Constructor. * - * @param int $type The type of the token - * @param string $value The token value - * @param int $lineno The line position in the source + * @param int $type The type of the token + * @param string $value The token value + * @param int $lineno The line position in the source */ public function __construct($type, $value, $lineno) { @@ -89,7 +89,7 @@ class Twig_Token /** * Gets the line. * - * @return int The source line + * @return int The source line */ public function getLine() { @@ -99,7 +99,7 @@ class Twig_Token /** * Gets the token type. * - * @return int The token type + * @return int The token type */ public function getType() { @@ -119,8 +119,8 @@ class Twig_Token /** * Returns the constant representation (internal) of a given type. * - * @param int $type The type as an integer - * @param bool $short Whether to return a short representation or not + * @param int $type The type as an integer + * @param bool $short Whether to return a short representation or not * * @return string The string representation */ @@ -176,7 +176,7 @@ class Twig_Token /** * Returns the english representation of a given type. * - * @param int $type The type as an integer + * @param int $type The type as an integer * * @return string The string representation */ diff --git a/vendor/twig/twig/lib/Twig/TokenStream.php b/vendor/twig/twig/lib/Twig/TokenStream.php index 44440daedd..7e95a4f08c 100644 --- a/vendor/twig/twig/lib/Twig/TokenStream.php +++ b/vendor/twig/twig/lib/Twig/TokenStream.php @@ -101,7 +101,7 @@ class Twig_TokenStream /** * Looks at the next token. * - * @param int $number + * @param int $number * * @return Twig_Token */ diff --git a/vendor/twig/twig/test/Twig/Tests/ErrorTest.php b/vendor/twig/twig/test/Twig/Tests/ErrorTest.php index 719a6a78fa..6a78d2bca2 100644 --- a/vendor/twig/twig/test/Twig/Tests/ErrorTest.php +++ b/vendor/twig/twig/test/Twig/Tests/ErrorTest.php @@ -112,7 +112,7 @@ class Twig_Tests_ErrorTest extends PHPUnit_Framework_TestCase {% block content %} {{ parent() }} {% endblock %}", - 'base' => '{% block content %}{{ foo.bar }}{% endblock %}' + 'base' => '{% block content %}{{ foo.bar }}{% endblock %}', ), 'base', 1, ), @@ -127,7 +127,7 @@ class Twig_Tests_ErrorTest extends PHPUnit_Framework_TestCase {% block foo %} {{ foo.bar }} {% endblock %}", - 'base' => '{% block content %}{% endblock %}' + 'base' => '{% block content %}{% endblock %}', ), 'index', 3, ), diff --git a/vendor/twig/twig/test/Twig/Tests/ExpressionParserTest.php b/vendor/twig/twig/test/Twig/Tests/ExpressionParserTest.php index 8ec6537a9c..983849ea12 100644 --- a/vendor/twig/twig/test/Twig/Tests/ExpressionParserTest.php +++ b/vendor/twig/twig/test/Twig/Tests/ExpressionParserTest.php @@ -32,7 +32,7 @@ class Twig_Tests_ExpressionParserTest extends PHPUnit_Framework_TestCase array('{% set 3 = "foo" %}'), array('{% set 1 + 2 = "foo" %}'), array('{% set "bar" = "foo" %}'), - array('{% set %}{% endset %}') + array('{% set %}{% endset %}'), ); } @@ -190,7 +190,7 @@ class Twig_Tests_ExpressionParserTest extends PHPUnit_Framework_TestCase ), new Twig_Node_Expression_Constant(' baz', 1), 1 - ) + ), ), array( diff --git a/vendor/twig/twig/test/Twig/Tests/FileCachingTest.php b/vendor/twig/twig/test/Twig/Tests/FileCachingTest.php index 36cdd337ae..3eaee593b0 100644 --- a/vendor/twig/twig/test/Twig/Tests/FileCachingTest.php +++ b/vendor/twig/twig/test/Twig/Tests/FileCachingTest.php @@ -1,5 +1,14 @@ 'bar', 'foo' => array('bar' => 'bar')) +return array('bar' => 'bar', 'foo' => array('bar' => 'bar'), 'dir_object' => new SplFileInfo(dirname(__FILE__)), 'object' => new stdClass(), 'resource' => fopen(dirname(__FILE__), 'r')) --EXPECT-- TRUE TRUE @@ -46,3 +85,42 @@ TRUE TRUE TRUE TRUE + +TRUE +TRUE +TRUE +TRUE +TRUE + +TRUE +FALSE +FALSE +FALSE +FALSE + +TRUE +FALSE +TRUE + +FALSE +FALSE +FALSE +FALSE + +FALSE +FALSE +FALSE +FALSE + +FALSE +FALSE +FALSE + +FALSE +TRUE +FALSE +TRUE + +FALSE +TRUE +FALSE diff --git a/vendor/twig/twig/test/Twig/Tests/Loader/FilesystemTest.php b/vendor/twig/twig/test/Twig/Tests/Loader/FilesystemTest.php index 13849b342e..a9d611956d 100644 --- a/vendor/twig/twig/test/Twig/Tests/Loader/FilesystemTest.php +++ b/vendor/twig/twig/test/Twig/Tests/Loader/FilesystemTest.php @@ -60,6 +60,7 @@ class Twig_Tests_Loader_FilesystemTest extends PHPUnit_Framework_TestCase $loader->addPath($basePath.'/named_ter', 'named'); $loader->addPath($basePath.'/normal_ter'); $loader->prependPath($basePath.'/normal_final'); + $loader->prependPath($basePath.'/named/../named_quater', 'named'); $loader->prependPath($basePath.'/named_final', 'named'); $this->assertEquals(array( @@ -70,11 +71,16 @@ class Twig_Tests_Loader_FilesystemTest extends PHPUnit_Framework_TestCase ), $loader->getPaths()); $this->assertEquals(array( $basePath.'/named_final', + $basePath.'/named/../named_quater', $basePath.'/named', $basePath.'/named_bis', $basePath.'/named_ter', ), $loader->getPaths('named')); + $this->assertEquals( + $basePath.'/named_quater/named_absolute.html', + $loader->getCacheKey('@named/named_absolute.html') + ); $this->assertEquals("path (final)\n", $loader->getSource('index.html')); $this->assertEquals("path (final)\n", $loader->getSource('@__main__/index.html')); $this->assertEquals("named path (final)\n", $loader->getSource('@named/index.html')); diff --git a/vendor/twig/twig/test/Twig/Tests/NativeExtensionTest.php b/vendor/twig/twig/test/Twig/Tests/NativeExtensionTest.php index 7de268c652..9bc6079ffd 100644 --- a/vendor/twig/twig/test/Twig/Tests/NativeExtensionTest.php +++ b/vendor/twig/twig/test/Twig/Tests/NativeExtensionTest.php @@ -13,20 +13,20 @@ class Twig_Tests_NativeExtensionTest extends PHPUnit_Framework_TestCase { public function testGetProperties() { + if (defined('HHVM_VERSION')) { + $this->markTestSkipped('Skip under HHVM as the behavior is not the same as plain PHP (which is an edge case anyway)'); + } + $twig = new Twig_Environment(new Twig_Loader_String(), array( 'debug' => true, 'cache' => false, - 'autoescape' => false + 'autoescape' => false, )); $d1 = new DateTime(); $d2 = new DateTime(); $output = $twig->render('{{ d1.date }}{{ d2.date }}', compact('d1', 'd2')); - if (defined('HHVM_VERSION')) { - $this->markTestSkipped('Skip under HHVM as the behavior is not the same as plain PHP (which is an edge case anyway)'); - } - // If it fails, PHP will crash. $this->assertEquals($output, $d1->date.$d2->date); } diff --git a/vendor/twig/twig/test/Twig/Tests/Node/AutoEscapeTest.php b/vendor/twig/twig/test/Twig/Tests/Node/AutoEscapeTest.php index dc7ddc561d..25d16023f2 100644 --- a/vendor/twig/twig/test/Twig/Tests/Node/AutoEscapeTest.php +++ b/vendor/twig/twig/test/Twig/Tests/Node/AutoEscapeTest.php @@ -11,9 +11,6 @@ class Twig_Tests_Node_AutoEscapeTest extends Twig_Test_NodeTestCase { - /** - * @covers Twig_Node_AutoEscape::__construct - */ public function testConstructor() { $body = new Twig_Node(array(new Twig_Node_Text('foo', 1))); @@ -23,15 +20,6 @@ class Twig_Tests_Node_AutoEscapeTest extends Twig_Test_NodeTestCase $this->assertTrue($node->getAttribute('value')); } - /** - * @covers Twig_Node_AutoEscape::compile - * @dataProvider getTests - */ - public function testCompile($node, $source, $environment = null) - { - parent::testCompile($node, $source, $environment); - } - public function getTests() { $body = new Twig_Node(array(new Twig_Node_Text('foo', 1))); diff --git a/vendor/twig/twig/test/Twig/Tests/Node/BlockReferenceTest.php b/vendor/twig/twig/test/Twig/Tests/Node/BlockReferenceTest.php index 96d0e101c6..84dac9bfa8 100644 --- a/vendor/twig/twig/test/Twig/Tests/Node/BlockReferenceTest.php +++ b/vendor/twig/twig/test/Twig/Tests/Node/BlockReferenceTest.php @@ -11,9 +11,6 @@ class Twig_Tests_Node_BlockReferenceTest extends Twig_Test_NodeTestCase { - /** - * @covers Twig_Node_BlockReference::__construct - */ public function testConstructor() { $node = new Twig_Node_BlockReference('foo', 1); @@ -21,15 +18,6 @@ class Twig_Tests_Node_BlockReferenceTest extends Twig_Test_NodeTestCase $this->assertEquals('foo', $node->getAttribute('name')); } - /** - * @covers Twig_Node_BlockReference::compile - * @dataProvider getTests - */ - public function testCompile($node, $source, $environment = null) - { - parent::testCompile($node, $source, $environment); - } - public function getTests() { return array( diff --git a/vendor/twig/twig/test/Twig/Tests/Node/BlockTest.php b/vendor/twig/twig/test/Twig/Tests/Node/BlockTest.php index 024049de08..e7246dcc36 100644 --- a/vendor/twig/twig/test/Twig/Tests/Node/BlockTest.php +++ b/vendor/twig/twig/test/Twig/Tests/Node/BlockTest.php @@ -11,9 +11,6 @@ class Twig_Tests_Node_BlockTest extends Twig_Test_NodeTestCase { - /** - * @covers Twig_Node_Block::__construct - */ public function testConstructor() { $body = new Twig_Node_Text('foo', 1); @@ -23,15 +20,6 @@ class Twig_Tests_Node_BlockTest extends Twig_Test_NodeTestCase $this->assertEquals('foo', $node->getAttribute('name')); } - /** - * @covers Twig_Node_Block::compile - * @dataProvider getTests - */ - public function testCompile($node, $source, $environment = null) - { - parent::testCompile($node, $source, $environment); - } - public function getTests() { $body = new Twig_Node_Text('foo', 1); diff --git a/vendor/twig/twig/test/Twig/Tests/Node/DoTest.php b/vendor/twig/twig/test/Twig/Tests/Node/DoTest.php index a406e22d72..aa33d1a2dc 100644 --- a/vendor/twig/twig/test/Twig/Tests/Node/DoTest.php +++ b/vendor/twig/twig/test/Twig/Tests/Node/DoTest.php @@ -11,9 +11,6 @@ class Twig_Tests_Node_DoTest extends Twig_Test_NodeTestCase { - /** - * @covers Twig_Node_Do::__construct - */ public function testConstructor() { $expr = new Twig_Node_Expression_Constant('foo', 1); @@ -22,15 +19,6 @@ class Twig_Tests_Node_DoTest extends Twig_Test_NodeTestCase $this->assertEquals($expr, $node->getNode('expr')); } - /** - * @covers Twig_Node_Do::compile - * @dataProvider getTests - */ - public function testCompile($node, $source, $environment = null) - { - parent::testCompile($node, $source, $environment); - } - public function getTests() { $tests = array(); diff --git a/vendor/twig/twig/test/Twig/Tests/Node/Expression/ArrayTest.php b/vendor/twig/twig/test/Twig/Tests/Node/Expression/ArrayTest.php index c6a9044b34..4f83ab176f 100644 --- a/vendor/twig/twig/test/Twig/Tests/Node/Expression/ArrayTest.php +++ b/vendor/twig/twig/test/Twig/Tests/Node/Expression/ArrayTest.php @@ -11,9 +11,6 @@ class Twig_Tests_Node_Expression_ArrayTest extends Twig_Test_NodeTestCase { - /** - * @covers Twig_Node_Expression_Array::__construct - */ public function testConstructor() { $elements = array(new Twig_Node_Expression_Constant('foo', 1), $foo = new Twig_Node_Expression_Constant('bar', 1)); @@ -22,15 +19,6 @@ class Twig_Tests_Node_Expression_ArrayTest extends Twig_Test_NodeTestCase $this->assertEquals($foo, $node->getNode(1)); } - /** - * @covers Twig_Node_Expression_Array::compile - * @dataProvider getTests - */ - public function testCompile($node, $source, $environment = null) - { - parent::testCompile($node, $source, $environment); - } - public function getTests() { $elements = array( diff --git a/vendor/twig/twig/test/Twig/Tests/Node/Expression/AssignNameTest.php b/vendor/twig/twig/test/Twig/Tests/Node/Expression/AssignNameTest.php index b156dcc042..bf365de497 100644 --- a/vendor/twig/twig/test/Twig/Tests/Node/Expression/AssignNameTest.php +++ b/vendor/twig/twig/test/Twig/Tests/Node/Expression/AssignNameTest.php @@ -11,9 +11,6 @@ class Twig_Tests_Node_Expression_AssignNameTest extends Twig_Test_NodeTestCase { - /** - * @covers Twig_Node_Expression_AssignName::__construct - */ public function testConstructor() { $node = new Twig_Node_Expression_AssignName('foo', 1); @@ -21,15 +18,6 @@ class Twig_Tests_Node_Expression_AssignNameTest extends Twig_Test_NodeTestCase $this->assertEquals('foo', $node->getAttribute('name')); } - /** - * @covers Twig_Node_Expression_AssignName::compile - * @dataProvider getTests - */ - public function testCompile($node, $source, $environment = null) - { - parent::testCompile($node, $source, $environment); - } - public function getTests() { $node = new Twig_Node_Expression_AssignName('foo', 1); diff --git a/vendor/twig/twig/test/Twig/Tests/Node/Expression/Binary/AddTest.php b/vendor/twig/twig/test/Twig/Tests/Node/Expression/Binary/AddTest.php index a0f49cb3d2..02310a1b03 100644 --- a/vendor/twig/twig/test/Twig/Tests/Node/Expression/Binary/AddTest.php +++ b/vendor/twig/twig/test/Twig/Tests/Node/Expression/Binary/AddTest.php @@ -11,9 +11,6 @@ class Twig_Tests_Node_Expression_Binary_AddTest extends Twig_Test_NodeTestCase { - /** - * @covers Twig_Node_Expression_Binary_Add::__construct - */ public function testConstructor() { $left = new Twig_Node_Expression_Constant(1, 1); @@ -24,16 +21,6 @@ class Twig_Tests_Node_Expression_Binary_AddTest extends Twig_Test_NodeTestCase $this->assertEquals($right, $node->getNode('right')); } - /** - * @covers Twig_Node_Expression_Binary_Add::compile - * @covers Twig_Node_Expression_Binary_Add::operator - * @dataProvider getTests - */ - public function testCompile($node, $source, $environment = null) - { - parent::testCompile($node, $source, $environment); - } - public function getTests() { $left = new Twig_Node_Expression_Constant(1, 1); diff --git a/vendor/twig/twig/test/Twig/Tests/Node/Expression/Binary/AndTest.php b/vendor/twig/twig/test/Twig/Tests/Node/Expression/Binary/AndTest.php index 50e551a775..2df3c8e459 100644 --- a/vendor/twig/twig/test/Twig/Tests/Node/Expression/Binary/AndTest.php +++ b/vendor/twig/twig/test/Twig/Tests/Node/Expression/Binary/AndTest.php @@ -11,9 +11,6 @@ class Twig_Tests_Node_Expression_Binary_AndTest extends Twig_Test_NodeTestCase { - /** - * @covers Twig_Node_Expression_Binary_And::__construct - */ public function testConstructor() { $left = new Twig_Node_Expression_Constant(1, 1); @@ -24,16 +21,6 @@ class Twig_Tests_Node_Expression_Binary_AndTest extends Twig_Test_NodeTestCase $this->assertEquals($right, $node->getNode('right')); } - /** - * @covers Twig_Node_Expression_Binary_And::compile - * @covers Twig_Node_Expression_Binary_And::operator - * @dataProvider getTests - */ - public function testCompile($node, $source, $environment = null) - { - parent::testCompile($node, $source, $environment); - } - public function getTests() { $left = new Twig_Node_Expression_Constant(1, 1); diff --git a/vendor/twig/twig/test/Twig/Tests/Node/Expression/Binary/ConcatTest.php b/vendor/twig/twig/test/Twig/Tests/Node/Expression/Binary/ConcatTest.php index 140329fa9e..759e482898 100644 --- a/vendor/twig/twig/test/Twig/Tests/Node/Expression/Binary/ConcatTest.php +++ b/vendor/twig/twig/test/Twig/Tests/Node/Expression/Binary/ConcatTest.php @@ -11,9 +11,6 @@ class Twig_Tests_Node_Expression_Binary_ConcatTest extends Twig_Test_NodeTestCase { - /** - * @covers Twig_Node_Expression_Binary_Concat::__construct - */ public function testConstructor() { $left = new Twig_Node_Expression_Constant(1, 1); @@ -24,16 +21,6 @@ class Twig_Tests_Node_Expression_Binary_ConcatTest extends Twig_Test_NodeTestCas $this->assertEquals($right, $node->getNode('right')); } - /** - * @covers Twig_Node_Expression_Binary_Concat::compile - * @covers Twig_Node_Expression_Binary_Concat::operator - * @dataProvider getTests - */ - public function testCompile($node, $source, $environment = null) - { - parent::testCompile($node, $source, $environment); - } - public function getTests() { $left = new Twig_Node_Expression_Constant(1, 1); diff --git a/vendor/twig/twig/test/Twig/Tests/Node/Expression/Binary/DivTest.php b/vendor/twig/twig/test/Twig/Tests/Node/Expression/Binary/DivTest.php index 0c1a3c7f79..0e54b10a39 100644 --- a/vendor/twig/twig/test/Twig/Tests/Node/Expression/Binary/DivTest.php +++ b/vendor/twig/twig/test/Twig/Tests/Node/Expression/Binary/DivTest.php @@ -11,9 +11,6 @@ class Twig_Tests_Node_Expression_Binary_DivTest extends Twig_Test_NodeTestCase { - /** - * @covers Twig_Node_Expression_Binary_Div::__construct - */ public function testConstructor() { $left = new Twig_Node_Expression_Constant(1, 1); @@ -24,16 +21,6 @@ class Twig_Tests_Node_Expression_Binary_DivTest extends Twig_Test_NodeTestCase $this->assertEquals($right, $node->getNode('right')); } - /** - * @covers Twig_Node_Expression_Binary_Div::compile - * @covers Twig_Node_Expression_Binary_Div::operator - * @dataProvider getTests - */ - public function testCompile($node, $source, $environment = null) - { - parent::testCompile($node, $source, $environment); - } - public function getTests() { $left = new Twig_Node_Expression_Constant(1, 1); diff --git a/vendor/twig/twig/test/Twig/Tests/Node/Expression/Binary/FloorDivTest.php b/vendor/twig/twig/test/Twig/Tests/Node/Expression/Binary/FloorDivTest.php index ead1fde84e..602888fd5d 100644 --- a/vendor/twig/twig/test/Twig/Tests/Node/Expression/Binary/FloorDivTest.php +++ b/vendor/twig/twig/test/Twig/Tests/Node/Expression/Binary/FloorDivTest.php @@ -11,9 +11,6 @@ class Twig_Tests_Node_Expression_Binary_FloorDivTest extends Twig_Test_NodeTestCase { - /** - * @covers Twig_Node_Expression_Binary_FloorDiv::__construct - */ public function testConstructor() { $left = new Twig_Node_Expression_Constant(1, 1); @@ -24,16 +21,6 @@ class Twig_Tests_Node_Expression_Binary_FloorDivTest extends Twig_Test_NodeTestC $this->assertEquals($right, $node->getNode('right')); } - /** - * @covers Twig_Node_Expression_Binary_FloorDiv::compile - * @covers Twig_Node_Expression_Binary_FloorDiv::operator - * @dataProvider getTests - */ - public function testCompile($node, $source, $environment = null) - { - parent::testCompile($node, $source, $environment); - } - public function getTests() { $left = new Twig_Node_Expression_Constant(1, 1); diff --git a/vendor/twig/twig/test/Twig/Tests/Node/Expression/Binary/ModTest.php b/vendor/twig/twig/test/Twig/Tests/Node/Expression/Binary/ModTest.php index 4fe1a1fc02..4c663c7877 100644 --- a/vendor/twig/twig/test/Twig/Tests/Node/Expression/Binary/ModTest.php +++ b/vendor/twig/twig/test/Twig/Tests/Node/Expression/Binary/ModTest.php @@ -11,9 +11,6 @@ class Twig_Tests_Node_Expression_Binary_ModTest extends Twig_Test_NodeTestCase { - /** - * @covers Twig_Node_Expression_Binary_Mod::__construct - */ public function testConstructor() { $left = new Twig_Node_Expression_Constant(1, 1); @@ -24,16 +21,6 @@ class Twig_Tests_Node_Expression_Binary_ModTest extends Twig_Test_NodeTestCase $this->assertEquals($right, $node->getNode('right')); } - /** - * @covers Twig_Node_Expression_Binary_Mod::compile - * @covers Twig_Node_Expression_Binary_Mod::operator - * @dataProvider getTests - */ - public function testCompile($node, $source, $environment = null) - { - parent::testCompile($node, $source, $environment); - } - public function getTests() { $left = new Twig_Node_Expression_Constant(1, 1); diff --git a/vendor/twig/twig/test/Twig/Tests/Node/Expression/Binary/MulTest.php b/vendor/twig/twig/test/Twig/Tests/Node/Expression/Binary/MulTest.php index 12bb35c961..e92c95e640 100644 --- a/vendor/twig/twig/test/Twig/Tests/Node/Expression/Binary/MulTest.php +++ b/vendor/twig/twig/test/Twig/Tests/Node/Expression/Binary/MulTest.php @@ -11,9 +11,6 @@ class Twig_Tests_Node_Expression_Binary_MulTest extends Twig_Test_NodeTestCase { - /** - * @covers Twig_Node_Expression_Binary_Mul::__construct - */ public function testConstructor() { $left = new Twig_Node_Expression_Constant(1, 1); @@ -24,16 +21,6 @@ class Twig_Tests_Node_Expression_Binary_MulTest extends Twig_Test_NodeTestCase $this->assertEquals($right, $node->getNode('right')); } - /** - * @covers Twig_Node_Expression_Binary_Mul::compile - * @covers Twig_Node_Expression_Binary_Mul::operator - * @dataProvider getTests - */ - public function testCompile($node, $source, $environment = null) - { - parent::testCompile($node, $source, $environment); - } - public function getTests() { $left = new Twig_Node_Expression_Constant(1, 1); diff --git a/vendor/twig/twig/test/Twig/Tests/Node/Expression/Binary/OrTest.php b/vendor/twig/twig/test/Twig/Tests/Node/Expression/Binary/OrTest.php index 9534c41c95..ec37c83ebb 100644 --- a/vendor/twig/twig/test/Twig/Tests/Node/Expression/Binary/OrTest.php +++ b/vendor/twig/twig/test/Twig/Tests/Node/Expression/Binary/OrTest.php @@ -11,9 +11,6 @@ class Twig_Tests_Node_Expression_Binary_OrTest extends Twig_Test_NodeTestCase { - /** - * @covers Twig_Node_Expression_Binary_Or::__construct - */ public function testConstructor() { $left = new Twig_Node_Expression_Constant(1, 1); @@ -24,16 +21,6 @@ class Twig_Tests_Node_Expression_Binary_OrTest extends Twig_Test_NodeTestCase $this->assertEquals($right, $node->getNode('right')); } - /** - * @covers Twig_Node_Expression_Binary_Or::compile - * @covers Twig_Node_Expression_Binary_Or::operator - * @dataProvider getTests - */ - public function testCompile($node, $source, $environment = null) - { - parent::testCompile($node, $source, $environment); - } - public function getTests() { $left = new Twig_Node_Expression_Constant(1, 1); diff --git a/vendor/twig/twig/test/Twig/Tests/Node/Expression/Binary/SubTest.php b/vendor/twig/twig/test/Twig/Tests/Node/Expression/Binary/SubTest.php index 9074893b1d..061cb270f4 100644 --- a/vendor/twig/twig/test/Twig/Tests/Node/Expression/Binary/SubTest.php +++ b/vendor/twig/twig/test/Twig/Tests/Node/Expression/Binary/SubTest.php @@ -11,9 +11,6 @@ class Twig_Tests_Node_Expression_Binary_SubTest extends Twig_Test_NodeTestCase { - /** - * @covers Twig_Node_Expression_Binary_Sub::__construct - */ public function testConstructor() { $left = new Twig_Node_Expression_Constant(1, 1); @@ -24,16 +21,6 @@ class Twig_Tests_Node_Expression_Binary_SubTest extends Twig_Test_NodeTestCase $this->assertEquals($right, $node->getNode('right')); } - /** - * @covers Twig_Node_Expression_Binary_Sub::compile - * @covers Twig_Node_Expression_Binary_Sub::operator - * @dataProvider getTests - */ - public function testCompile($node, $source, $environment = null) - { - parent::testCompile($node, $source, $environment); - } - public function getTests() { $left = new Twig_Node_Expression_Constant(1, 1); diff --git a/vendor/twig/twig/test/Twig/Tests/Node/Expression/CallTest.php b/vendor/twig/twig/test/Twig/Tests/Node/Expression/CallTest.php index c54ea1e02e..9cd9715648 100644 --- a/vendor/twig/twig/test/Twig/Tests/Node/Expression/CallTest.php +++ b/vendor/twig/twig/test/Twig/Tests/Node/Expression/CallTest.php @@ -39,7 +39,7 @@ class Twig_Tests_Node_Expression_CallTest extends PHPUnit_Framework_TestCase /** * @expectedException Twig_Error_Syntax - * @expectedExceptionMessage Unknown argument "unknown" for function "date". + * @expectedExceptionMessage Unknown argument "unknown" for function "date(format, timestamp)". */ public function testGetArgumentsWithWrongNamedArgumentName() { @@ -49,13 +49,38 @@ class Twig_Tests_Node_Expression_CallTest extends PHPUnit_Framework_TestCase /** * @expectedException Twig_Error_Syntax - * @expectedExceptionMessage Unknown arguments "unknown1", "unknown2" for function "date". + * @expectedExceptionMessage Unknown arguments "unknown1", "unknown2" for function "date(format, timestamp)". */ public function testGetArgumentsWithWrongNamedArgumentNames() { $node = new Twig_Tests_Node_Expression_Call(array(), array('type' => 'function', 'name' => 'date')); $node->getArguments('date', array('Y-m-d', 'timestamp' => null, 'unknown1' => '', 'unknown2' => '')); } + + /** + * @expectedException Twig_Error_Syntax + * @expectedExceptionMessage Argument "case_sensitivity" could not be assigned for function "substr_compare(main_str, str, offset, length, case_sensitivity)" because it is mapped to an internal PHP function which cannot determine default value for optional argument "length". + */ + public function testResolveArgumentsWithMissingValueForOptionalArgument() + { + if (defined('HHVM_VERSION')) { + $this->markTestSkipped('Skip under HHVM as the behavior is not the same as plain PHP (which is an edge case anyway)'); + } + + $node = new Twig_Tests_Node_Expression_Call(array(), array('type' => 'function', 'name' => 'substr_compare')); + $node->getArguments('substr_compare', array('abcd', 'bc', 'offset' => 1, 'case_sensitivity' => true)); + } + + public function testResolveArgumentsOnlyNecessaryArgumentsForCustomFunction() + { + $node = new Twig_Tests_Node_Expression_Call(array(), array('type' => 'function', 'name' => 'custom_function')); + + $this->assertEquals(array('arg1'), $node->getArguments(array($this, 'customFunction'), array('arg1' => 'arg1'))); + } + + public function customFunction($arg1, $arg2 = 'default', $arg3 = array()) + { + } } class Twig_Tests_Node_Expression_Call extends Twig_Node_Expression_Call diff --git a/vendor/twig/twig/test/Twig/Tests/Node/Expression/ConditionalTest.php b/vendor/twig/twig/test/Twig/Tests/Node/Expression/ConditionalTest.php index 9906d51272..a3e8badffa 100644 --- a/vendor/twig/twig/test/Twig/Tests/Node/Expression/ConditionalTest.php +++ b/vendor/twig/twig/test/Twig/Tests/Node/Expression/ConditionalTest.php @@ -11,9 +11,6 @@ class Twig_Tests_Node_Expression_ConditionalTest extends Twig_Test_NodeTestCase { - /** - * @covers Twig_Node_Expression_Conditional::__construct - */ public function testConstructor() { $expr1 = new Twig_Node_Expression_Constant(1, 1); @@ -26,15 +23,6 @@ class Twig_Tests_Node_Expression_ConditionalTest extends Twig_Test_NodeTestCase $this->assertEquals($expr3, $node->getNode('expr3')); } - /** - * @covers Twig_Node_Expression_Conditional::compile - * @dataProvider getTests - */ - public function testCompile($node, $source, $environment = null) - { - parent::testCompile($node, $source, $environment); - } - public function getTests() { $tests = array(); diff --git a/vendor/twig/twig/test/Twig/Tests/Node/Expression/ConstantTest.php b/vendor/twig/twig/test/Twig/Tests/Node/Expression/ConstantTest.php index d0dec53130..2ff9318229 100644 --- a/vendor/twig/twig/test/Twig/Tests/Node/Expression/ConstantTest.php +++ b/vendor/twig/twig/test/Twig/Tests/Node/Expression/ConstantTest.php @@ -11,9 +11,6 @@ class Twig_Tests_Node_Expression_ConstantTest extends Twig_Test_NodeTestCase { - /** - * @covers Twig_Node_Expression_Constant::__construct - */ public function testConstructor() { $node = new Twig_Node_Expression_Constant('foo', 1); @@ -21,15 +18,6 @@ class Twig_Tests_Node_Expression_ConstantTest extends Twig_Test_NodeTestCase $this->assertEquals('foo', $node->getAttribute('value')); } - /** - * @covers Twig_Node_Expression_Constant::compile - * @dataProvider getTests - */ - public function testCompile($node, $source, $environment = null) - { - parent::testCompile($node, $source, $environment); - } - public function getTests() { $tests = array(); diff --git a/vendor/twig/twig/test/Twig/Tests/Node/Expression/FilterTest.php b/vendor/twig/twig/test/Twig/Tests/Node/Expression/FilterTest.php index 8089b9cb1c..2b85141cd6 100644 --- a/vendor/twig/twig/test/Twig/Tests/Node/Expression/FilterTest.php +++ b/vendor/twig/twig/test/Twig/Tests/Node/Expression/FilterTest.php @@ -11,9 +11,6 @@ class Twig_Tests_Node_Expression_FilterTest extends Twig_Test_NodeTestCase { - /** - * @covers Twig_Node_Expression_Filter::__construct - */ public function testConstructor() { $expr = new Twig_Node_Expression_Constant('foo', 1); @@ -26,15 +23,6 @@ class Twig_Tests_Node_Expression_FilterTest extends Twig_Test_NodeTestCase $this->assertEquals($args, $node->getNode('arguments')); } - /** - * @covers Twig_Node_Expression_Filter::compile - * @dataProvider getTests - */ - public function testCompile($node, $source, $environment = null) - { - parent::testCompile($node, $source, $environment); - } - public function getTests() { $tests = array(); @@ -86,7 +74,7 @@ class Twig_Tests_Node_Expression_FilterTest extends Twig_Test_NodeTestCase /** * @expectedException Twig_Error_Syntax - * @expectedExceptionMessage Unknown argument "foobar" for filter "date". + * @expectedExceptionMessage Unknown argument "foobar" for filter "date(format, timezone)" at line 1. */ public function testCompileWithWrongNamedArgumentName() { diff --git a/vendor/twig/twig/test/Twig/Tests/Node/Expression/FunctionTest.php b/vendor/twig/twig/test/Twig/Tests/Node/Expression/FunctionTest.php index 2693b2ef19..4d4a72192d 100644 --- a/vendor/twig/twig/test/Twig/Tests/Node/Expression/FunctionTest.php +++ b/vendor/twig/twig/test/Twig/Tests/Node/Expression/FunctionTest.php @@ -11,9 +11,6 @@ class Twig_Tests_Node_Expression_FunctionTest extends Twig_Test_NodeTestCase { - /** - * @covers Twig_Node_Expression_Function::__construct - */ public function testConstructor() { $name = 'function'; @@ -24,15 +21,6 @@ class Twig_Tests_Node_Expression_FunctionTest extends Twig_Test_NodeTestCase $this->assertEquals($args, $node->getNode('arguments')); } - /** - * @covers Twig_Node_Expression_Function::compile - * @dataProvider getTests - */ - public function testCompile($node, $source, $environment = null) - { - parent::testCompile($node, $source, $environment); - } - public function getTests() { $environment = new Twig_Environment(); diff --git a/vendor/twig/twig/test/Twig/Tests/Node/Expression/GetAttrTest.php b/vendor/twig/twig/test/Twig/Tests/Node/Expression/GetAttrTest.php index 76cf5c6316..2764478c41 100644 --- a/vendor/twig/twig/test/Twig/Tests/Node/Expression/GetAttrTest.php +++ b/vendor/twig/twig/test/Twig/Tests/Node/Expression/GetAttrTest.php @@ -11,9 +11,6 @@ class Twig_Tests_Node_Expression_GetAttrTest extends Twig_Test_NodeTestCase { - /** - * @covers Twig_Node_Expression_GetAttr::__construct - */ public function testConstructor() { $expr = new Twig_Node_Expression_Name('foo', 1); @@ -29,15 +26,6 @@ class Twig_Tests_Node_Expression_GetAttrTest extends Twig_Test_NodeTestCase $this->assertEquals(Twig_Template::ARRAY_CALL, $node->getAttribute('type')); } - /** - * @covers Twig_Node_Expression_GetAttr::compile - * @dataProvider getTests - */ - public function testCompile($node, $source, $environment = null) - { - parent::testCompile($node, $source, $environment); - } - public function getTests() { $tests = array(); @@ -46,16 +34,16 @@ class Twig_Tests_Node_Expression_GetAttrTest extends Twig_Test_NodeTestCase $attr = new Twig_Node_Expression_Constant('bar', 1); $args = new Twig_Node_Expression_Array(array(), 1); $node = new Twig_Node_Expression_GetAttr($expr, $attr, $args, Twig_Template::ANY_CALL, 1); - $tests[] = array($node, sprintf('%s%s, "bar", array())', $this->getAttributeGetter(), $this->getVariableGetter('foo'))); + $tests[] = array($node, sprintf('%s%s, "bar", array())', $this->getAttributeGetter(), $this->getVariableGetter('foo', 1))); $node = new Twig_Node_Expression_GetAttr($expr, $attr, $args, Twig_Template::ARRAY_CALL, 1); - $tests[] = array($node, sprintf('%s%s, "bar", array(), "array")', $this->getAttributeGetter(), $this->getVariableGetter('foo'))); + $tests[] = array($node, sprintf('%s%s, "bar", array(), "array")', $this->getAttributeGetter(), $this->getVariableGetter('foo', 1))); $args = new Twig_Node_Expression_Array(array(), 1); $args->addElement(new Twig_Node_Expression_Name('foo', 1)); $args->addElement(new Twig_Node_Expression_Constant('bar', 1)); $node = new Twig_Node_Expression_GetAttr($expr, $attr, $args, Twig_Template::METHOD_CALL, 1); - $tests[] = array($node, sprintf('%s%s, "bar", array(0 => %s, 1 => "bar"), "method")', $this->getAttributeGetter(), $this->getVariableGetter('foo'), $this->getVariableGetter('foo'))); + $tests[] = array($node, sprintf('%s%s, "bar", array(0 => %s, 1 => "bar"), "method")', $this->getAttributeGetter(), $this->getVariableGetter('foo', 1), $this->getVariableGetter('foo'))); return $tests; } diff --git a/vendor/twig/twig/test/Twig/Tests/Node/Expression/NameTest.php b/vendor/twig/twig/test/Twig/Tests/Node/Expression/NameTest.php index 76d109b624..d013affad0 100644 --- a/vendor/twig/twig/test/Twig/Tests/Node/Expression/NameTest.php +++ b/vendor/twig/twig/test/Twig/Tests/Node/Expression/NameTest.php @@ -11,9 +11,6 @@ class Twig_Tests_Node_Expression_NameTest extends Twig_Test_NodeTestCase { - /** - * @covers Twig_Node_Expression_Name::__construct - */ public function testConstructor() { $node = new Twig_Node_Expression_Name('foo', 1); @@ -21,15 +18,6 @@ class Twig_Tests_Node_Expression_NameTest extends Twig_Test_NodeTestCase $this->assertEquals('foo', $node->getAttribute('name')); } - /** - * @covers Twig_Node_Expression_Name::compile - * @dataProvider getTests - */ - public function testCompile($node, $source, $environment = null) - { - parent::testCompile($node, $source, $environment); - } - public function getTests() { $node = new Twig_Node_Expression_Name('foo', 1); @@ -40,10 +28,10 @@ class Twig_Tests_Node_Expression_NameTest extends Twig_Test_NodeTestCase $env1 = new Twig_Environment(null, array('strict_variables' => false)); return array( - version_compare(PHP_VERSION, '5.4.0') >= 0 ? array($node, '(isset($context["foo"]) ? $context["foo"] : $this->getContext($context, "foo"))', $env) : array($node, '$this->getContext($context, "foo")', $env), - array($node, $this->getVariableGetter('foo'), $env1), - array($self, '$this'), - array($context, '$context'), + array($node, "// line 1\n".(version_compare(PHP_VERSION, '5.4.0') >= 0 ? '(isset($context["foo"]) ? $context["foo"] : $this->getContext($context, "foo"))' : '$this->getContext($context, "foo")'), $env), + array($node, $this->getVariableGetter('foo', 1), $env1), + array($self, "// line 1\n\$this"), + array($context, "// line 1\n\$context"), ); } } diff --git a/vendor/twig/twig/test/Twig/Tests/Node/Expression/ParentTest.php b/vendor/twig/twig/test/Twig/Tests/Node/Expression/ParentTest.php index 4d40419b15..ab2bbe0748 100644 --- a/vendor/twig/twig/test/Twig/Tests/Node/Expression/ParentTest.php +++ b/vendor/twig/twig/test/Twig/Tests/Node/Expression/ParentTest.php @@ -11,9 +11,6 @@ class Twig_Tests_Node_Expression_ParentTest extends Twig_Test_NodeTestCase { - /** - * @covers Twig_Node_Expression_Parent::__construct - */ public function testConstructor() { $node = new Twig_Node_Expression_Parent('foo', 1); @@ -21,15 +18,6 @@ class Twig_Tests_Node_Expression_ParentTest extends Twig_Test_NodeTestCase $this->assertEquals('foo', $node->getAttribute('name')); } - /** - * @covers Twig_Node_Expression_Parent::compile - * @dataProvider getTests - */ - public function testCompile($node, $source, $environment = null) - { - parent::testCompile($node, $source, $environment); - } - public function getTests() { $tests = array(); diff --git a/vendor/twig/twig/test/Twig/Tests/Node/Expression/TestTest.php b/vendor/twig/twig/test/Twig/Tests/Node/Expression/TestTest.php index 0664150a5d..2f54a5a2ef 100644 --- a/vendor/twig/twig/test/Twig/Tests/Node/Expression/TestTest.php +++ b/vendor/twig/twig/test/Twig/Tests/Node/Expression/TestTest.php @@ -11,9 +11,6 @@ class Twig_Tests_Node_Expression_TestTest extends Twig_Test_NodeTestCase { - /** - * @covers Twig_Node_Expression_Test::__construct - */ public function testConstructor() { $expr = new Twig_Node_Expression_Constant('foo', 1); @@ -26,15 +23,6 @@ class Twig_Tests_Node_Expression_TestTest extends Twig_Test_NodeTestCase $this->assertEquals($name, $node->getAttribute('name')); } - /** - * @covers Twig_Node_Expression_Test::compile - * @dataProvider getTests - */ - public function testCompile($node, $source, $environment = null) - { - parent::testCompile($node, $source, $environment); - } - public function getTests() { $tests = array(); diff --git a/vendor/twig/twig/test/Twig/Tests/Node/Expression/Unary/NegTest.php b/vendor/twig/twig/test/Twig/Tests/Node/Expression/Unary/NegTest.php index d55ab3335c..b63337117d 100644 --- a/vendor/twig/twig/test/Twig/Tests/Node/Expression/Unary/NegTest.php +++ b/vendor/twig/twig/test/Twig/Tests/Node/Expression/Unary/NegTest.php @@ -11,9 +11,6 @@ class Twig_Tests_Node_Expression_Unary_NegTest extends Twig_Test_NodeTestCase { - /** - * @covers Twig_Node_Expression_Unary_Neg::__construct - */ public function testConstructor() { $expr = new Twig_Node_Expression_Constant(1, 1); @@ -22,23 +19,14 @@ class Twig_Tests_Node_Expression_Unary_NegTest extends Twig_Test_NodeTestCase $this->assertEquals($expr, $node->getNode('node')); } - /** - * @covers Twig_Node_Expression_Unary_Neg::compile - * @covers Twig_Node_Expression_Unary_Neg::operator - * @dataProvider getTests - */ - public function testCompile($node, $source, $environment = null) - { - parent::testCompile($node, $source, $environment); - } - public function getTests() { $node = new Twig_Node_Expression_Constant(1, 1); $node = new Twig_Node_Expression_Unary_Neg($node, 1); return array( - array($node, '(-1)'), + array($node, '-1'), + array(new Twig_Node_Expression_Unary_Neg($node, 1), '- -1'), ); } } diff --git a/vendor/twig/twig/test/Twig/Tests/Node/Expression/Unary/NotTest.php b/vendor/twig/twig/test/Twig/Tests/Node/Expression/Unary/NotTest.php index 625c25273f..d7c6f85e78 100644 --- a/vendor/twig/twig/test/Twig/Tests/Node/Expression/Unary/NotTest.php +++ b/vendor/twig/twig/test/Twig/Tests/Node/Expression/Unary/NotTest.php @@ -11,9 +11,6 @@ class Twig_Tests_Node_Expression_Unary_NotTest extends Twig_Test_NodeTestCase { - /** - * @covers Twig_Node_Expression_Unary_Not::__construct - */ public function testConstructor() { $expr = new Twig_Node_Expression_Constant(1, 1); @@ -22,23 +19,13 @@ class Twig_Tests_Node_Expression_Unary_NotTest extends Twig_Test_NodeTestCase $this->assertEquals($expr, $node->getNode('node')); } - /** - * @covers Twig_Node_Expression_Unary_Not::compile - * @covers Twig_Node_Expression_Unary_Not::operator - * @dataProvider getTests - */ - public function testCompile($node, $source, $environment = null) - { - parent::testCompile($node, $source, $environment); - } - public function getTests() { $node = new Twig_Node_Expression_Constant(1, 1); $node = new Twig_Node_Expression_Unary_Not($node, 1); return array( - array($node, '(!1)'), + array($node, '!1'), ); } } diff --git a/vendor/twig/twig/test/Twig/Tests/Node/Expression/Unary/PosTest.php b/vendor/twig/twig/test/Twig/Tests/Node/Expression/Unary/PosTest.php index 047a097711..057250f376 100644 --- a/vendor/twig/twig/test/Twig/Tests/Node/Expression/Unary/PosTest.php +++ b/vendor/twig/twig/test/Twig/Tests/Node/Expression/Unary/PosTest.php @@ -11,9 +11,6 @@ class Twig_Tests_Node_Expression_Unary_PosTest extends Twig_Test_NodeTestCase { - /** - * @covers Twig_Node_Expression_Unary_Pos::__construct - */ public function testConstructor() { $expr = new Twig_Node_Expression_Constant(1, 1); @@ -22,23 +19,13 @@ class Twig_Tests_Node_Expression_Unary_PosTest extends Twig_Test_NodeTestCase $this->assertEquals($expr, $node->getNode('node')); } - /** - * @covers Twig_Node_Expression_Unary_Pos::compile - * @covers Twig_Node_Expression_Unary_Pos::operator - * @dataProvider getTests - */ - public function testCompile($node, $source, $environment = null) - { - parent::testCompile($node, $source, $environment); - } - public function getTests() { $node = new Twig_Node_Expression_Constant(1, 1); $node = new Twig_Node_Expression_Unary_Pos($node, 1); return array( - array($node, '(+1)'), + array($node, '+1'), ); } } diff --git a/vendor/twig/twig/test/Twig/Tests/Node/ForTest.php b/vendor/twig/twig/test/Twig/Tests/Node/ForTest.php index 09862a7a37..b289592fb0 100644 --- a/vendor/twig/twig/test/Twig/Tests/Node/ForTest.php +++ b/vendor/twig/twig/test/Twig/Tests/Node/ForTest.php @@ -11,9 +11,6 @@ class Twig_Tests_Node_ForTest extends Twig_Test_NodeTestCase { - /** - * @covers Twig_Node_For::__construct - */ public function testConstructor() { $keyTarget = new Twig_Node_Expression_AssignName('key', 1); @@ -39,15 +36,6 @@ class Twig_Tests_Node_ForTest extends Twig_Test_NodeTestCase $this->assertEquals($else, $node->getNode('else')); } - /** - * @covers Twig_Node_For::compile - * @dataProvider getTests - */ - public function testCompile($node, $source, $environment = null) - { - parent::testCompile($node, $source, $environment); - } - public function getTests() { $tests = array(); diff --git a/vendor/twig/twig/test/Twig/Tests/Node/IfTest.php b/vendor/twig/twig/test/Twig/Tests/Node/IfTest.php index 2d96f6f186..e47dd6540e 100644 --- a/vendor/twig/twig/test/Twig/Tests/Node/IfTest.php +++ b/vendor/twig/twig/test/Twig/Tests/Node/IfTest.php @@ -11,9 +11,6 @@ class Twig_Tests_Node_IfTest extends Twig_Test_NodeTestCase { - /** - * @covers Twig_Node_If::__construct - */ public function testConstructor() { $t = new Twig_Node(array( @@ -31,15 +28,6 @@ class Twig_Tests_Node_IfTest extends Twig_Test_NodeTestCase $this->assertEquals($else, $node->getNode('else')); } - /** - * @covers Twig_Node_If::compile - * @dataProvider getTests - */ - public function testCompile($node, $source, $environment = null) - { - parent::testCompile($node, $source, $environment); - } - public function getTests() { $tests = array(); diff --git a/vendor/twig/twig/test/Twig/Tests/Node/ImportTest.php b/vendor/twig/twig/test/Twig/Tests/Node/ImportTest.php index db36581aaa..0c340a9395 100644 --- a/vendor/twig/twig/test/Twig/Tests/Node/ImportTest.php +++ b/vendor/twig/twig/test/Twig/Tests/Node/ImportTest.php @@ -11,9 +11,6 @@ class Twig_Tests_Node_ImportTest extends Twig_Test_NodeTestCase { - /** - * @covers Twig_Node_Import::__construct - */ public function testConstructor() { $macro = new Twig_Node_Expression_Constant('foo.twig', 1); @@ -24,15 +21,6 @@ class Twig_Tests_Node_ImportTest extends Twig_Test_NodeTestCase $this->assertEquals($var, $node->getNode('var')); } - /** - * @covers Twig_Node_Import::compile - * @dataProvider getTests - */ - public function testCompile($node, $source, $environment = null) - { - parent::testCompile($node, $source, $environment); - } - public function getTests() { $tests = array(); diff --git a/vendor/twig/twig/test/Twig/Tests/Node/IncludeTest.php b/vendor/twig/twig/test/Twig/Tests/Node/IncludeTest.php index 9afecef85b..03f10d400d 100644 --- a/vendor/twig/twig/test/Twig/Tests/Node/IncludeTest.php +++ b/vendor/twig/twig/test/Twig/Tests/Node/IncludeTest.php @@ -11,9 +11,6 @@ class Twig_Tests_Node_IncludeTest extends Twig_Test_NodeTestCase { - /** - * @covers Twig_Node_Include::__construct - */ public function testConstructor() { $expr = new Twig_Node_Expression_Constant('foo.twig', 1); @@ -29,15 +26,6 @@ class Twig_Tests_Node_IncludeTest extends Twig_Test_NodeTestCase $this->assertTrue($node->getAttribute('only')); } - /** - * @covers Twig_Node_Include::compile - * @dataProvider getTests - */ - public function testCompile($node, $source, $environment = null) - { - parent::testCompile($node, $source, $environment); - } - public function getTests() { $tests = array(); diff --git a/vendor/twig/twig/test/Twig/Tests/Node/MacroTest.php b/vendor/twig/twig/test/Twig/Tests/Node/MacroTest.php index 2a77ac7a65..52ee8b7c40 100644 --- a/vendor/twig/twig/test/Twig/Tests/Node/MacroTest.php +++ b/vendor/twig/twig/test/Twig/Tests/Node/MacroTest.php @@ -11,9 +11,6 @@ class Twig_Tests_Node_MacroTest extends Twig_Test_NodeTestCase { - /** - * @covers Twig_Node_Macro::__construct - */ public function testConstructor() { $body = new Twig_Node_Text('foo', 1); @@ -25,15 +22,6 @@ class Twig_Tests_Node_MacroTest extends Twig_Test_NodeTestCase $this->assertEquals('foo', $node->getAttribute('name')); } - /** - * @covers Twig_Node_Macro::compile - * @dataProvider getTests - */ - public function testCompile($node, $source, $environment = null) - { - parent::testCompile($node, $source, $environment); - } - public function getTests() { $body = new Twig_Node_Text('foo', 1); diff --git a/vendor/twig/twig/test/Twig/Tests/Node/ModuleTest.php b/vendor/twig/twig/test/Twig/Tests/Node/ModuleTest.php index b8996edf42..b15a475511 100644 --- a/vendor/twig/twig/test/Twig/Tests/Node/ModuleTest.php +++ b/vendor/twig/twig/test/Twig/Tests/Node/ModuleTest.php @@ -11,9 +11,6 @@ class Twig_Tests_Node_ModuleTest extends Twig_Test_NodeTestCase { - /** - * @covers Twig_Node_Module::__construct - */ public function testConstructor() { $body = new Twig_Node_Text('foo', 1); @@ -31,22 +28,6 @@ class Twig_Tests_Node_ModuleTest extends Twig_Test_NodeTestCase $this->assertEquals($filename, $node->getAttribute('filename')); } - /** - * @covers Twig_Node_Module::compile - * @covers Twig_Node_Module::compileTemplate - * @covers Twig_Node_Module::compileMacros - * @covers Twig_Node_Module::compileClassHeader - * @covers Twig_Node_Module::compileDisplayHeader - * @covers Twig_Node_Module::compileDisplayBody - * @covers Twig_Node_Module::compileDisplayFooter - * @covers Twig_Node_Module::compileClassFooter - * @dataProvider getTests - */ - public function testCompile($node, $source, $environment = null) - { - parent::testCompile($node, $source, $environment); - } - public function getTests() { $twig = new Twig_Environment(new Twig_Loader_String()); @@ -96,7 +77,7 @@ class __TwigTemplate_a2bfbf7dd6ab85666684fe9297f69363a3fc2046d90f22a317d380c1863 EOF , $twig); - $import = new Twig_Node_Import(new Twig_Node_Expression_Constant('foo.twig', 1), new Twig_Node_Expression_AssignName('macro', 1), 1); + $import = new Twig_Node_Import(new Twig_Node_Expression_Constant('foo.twig', 1), new Twig_Node_Expression_AssignName('macro', 1), 2); $body = new Twig_Node(array($import)); $extends = new Twig_Node_Expression_Constant('layout.twig', 1); @@ -112,7 +93,15 @@ class __TwigTemplate_a2bfbf7dd6ab85666684fe9297f69363a3fc2046d90f22a317d380c1863 { parent::__construct(\$env); - \$this->parent = \$this->env->loadTemplate("layout.twig"); + // line 1 + try { + \$this->parent = \$this->env->loadTemplate("layout.twig"); + } catch (Twig_Error_Loader \$e) { + \$e->setTemplateFile(\$this->getTemplateName()); + \$e->setTemplateLine(1); + + throw \$e; + } \$this->blocks = array( ); @@ -125,8 +114,9 @@ class __TwigTemplate_a2bfbf7dd6ab85666684fe9297f69363a3fc2046d90f22a317d380c1863 protected function doDisplay(array \$context, array \$blocks = array()) { - // line 1 + // line 2 \$context["macro"] = \$this->env->loadTemplate("foo.twig"); + // line 1 \$this->parent->display(\$context, array_merge(\$this->blocks, \$blocks)); } @@ -142,18 +132,19 @@ class __TwigTemplate_a2bfbf7dd6ab85666684fe9297f69363a3fc2046d90f22a317d380c1863 public function getDebugInfo() { - return array ( 24 => 1,); + return array ( 34 => 1, 32 => 2, 11 => 1,); } } EOF , $twig); - $body = new Twig_Node(); + $set = new Twig_Node_Set(false, new Twig_Node(array(new Twig_Node_Expression_AssignName('foo', 4))), new Twig_Node(array(new Twig_Node_Expression_Constant("foo", 4))), 4); + $body = new Twig_Node(array($set)); $extends = new Twig_Node_Expression_Conditional( - new Twig_Node_Expression_Constant(true, 1), - new Twig_Node_Expression_Constant('foo', 1), - new Twig_Node_Expression_Constant('foo', 1), - 0 + new Twig_Node_Expression_Constant(true, 2), + new Twig_Node_Expression_Constant('foo', 2), + new Twig_Node_Expression_Constant('foo', 2), + 2 ); $node = new Twig_Node_Module($body, $extends, $blocks, $macros, $traits, new Twig_Node(array()), $filename); @@ -165,11 +156,15 @@ class __TwigTemplate_a2bfbf7dd6ab85666684fe9297f69363a3fc2046d90f22a317d380c1863 { protected function doGetParent(array \$context) { + // line 2 return \$this->env->resolveTemplate(((true) ? ("foo") : ("foo"))); } protected function doDisplay(array \$context, array \$blocks = array()) { + // line 4 + \$context["foo"] = "foo"; + // line 2 \$this->getParent(\$context)->display(\$context, array_merge(\$this->blocks, \$blocks)); } @@ -185,7 +180,7 @@ class __TwigTemplate_a2bfbf7dd6ab85666684fe9297f69363a3fc2046d90f22a317d380c1863 public function getDebugInfo() { - return array (); + return array ( 17 => 2, 15 => 4, 9 => 2,); } } EOF diff --git a/vendor/twig/twig/test/Twig/Tests/Node/PrintTest.php b/vendor/twig/twig/test/Twig/Tests/Node/PrintTest.php index 6fe43a417e..4e0990facc 100644 --- a/vendor/twig/twig/test/Twig/Tests/Node/PrintTest.php +++ b/vendor/twig/twig/test/Twig/Tests/Node/PrintTest.php @@ -11,9 +11,6 @@ class Twig_Tests_Node_PrintTest extends Twig_Test_NodeTestCase { - /** - * @covers Twig_Node_Print::__construct - */ public function testConstructor() { $expr = new Twig_Node_Expression_Constant('foo', 1); @@ -22,15 +19,6 @@ class Twig_Tests_Node_PrintTest extends Twig_Test_NodeTestCase $this->assertEquals($expr, $node->getNode('expr')); } - /** - * @covers Twig_Node_Print::compile - * @dataProvider getTests - */ - public function testCompile($node, $source, $environment = null) - { - parent::testCompile($node, $source, $environment); - } - public function getTests() { $tests = array(); diff --git a/vendor/twig/twig/test/Twig/Tests/Node/SandboxTest.php b/vendor/twig/twig/test/Twig/Tests/Node/SandboxTest.php index db9dbf95d2..46ecf97319 100644 --- a/vendor/twig/twig/test/Twig/Tests/Node/SandboxTest.php +++ b/vendor/twig/twig/test/Twig/Tests/Node/SandboxTest.php @@ -11,9 +11,6 @@ class Twig_Tests_Node_SandboxTest extends Twig_Test_NodeTestCase { - /** - * @covers Twig_Node_Sandbox::__construct - */ public function testConstructor() { $body = new Twig_Node_Text('foo', 1); @@ -22,15 +19,6 @@ class Twig_Tests_Node_SandboxTest extends Twig_Test_NodeTestCase $this->assertEquals($body, $node->getNode('body')); } - /** - * @covers Twig_Node_Sandbox::compile - * @dataProvider getTests - */ - public function testCompile($node, $source, $environment = null) - { - parent::testCompile($node, $source, $environment); - } - public function getTests() { $tests = array(); diff --git a/vendor/twig/twig/test/Twig/Tests/Node/SandboxedModuleTest.php b/vendor/twig/twig/test/Twig/Tests/Node/SandboxedModuleTest.php deleted file mode 100644 index bb9ffb7824..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Node/SandboxedModuleTest.php +++ /dev/null @@ -1,209 +0,0 @@ -assertEquals($body, $node->getNode('body')); - $this->assertEquals($blocks, $node->getNode('blocks')); - $this->assertEquals($macros, $node->getNode('macros')); - $this->assertEquals($parent, $node->getNode('parent')); - $this->assertEquals($filename, $node->getAttribute('filename')); - } - - /** - * @covers Twig_Node_SandboxedModule::compile - * @covers Twig_Node_SandboxedModule::compileDisplayBody - * @covers Twig_Node_SandboxedModule::compileDisplayFooter - * @dataProvider getTests - */ - public function testCompile($node, $source, $environment = null) - { - parent::testCompile($node, $source, $environment); - } - - public function getTests() - { - $twig = new Twig_Environment(new Twig_Loader_String()); - - $tests = array(); - - $body = new Twig_Node_Text('foo', 1); - $extends = null; - $blocks = new Twig_Node(); - $macros = new Twig_Node(); - $traits = new Twig_Node(); - $filename = 'foo.twig'; - - $node = new Twig_Node_Module($body, $extends, $blocks, $macros, $traits, new Twig_Node(array()), $filename); - $node = new Twig_Node_SandboxedModule($node, array('for'), array('upper'), array('cycle')); - - $tests[] = array($node, <<parent = false; - - \$this->blocks = array( - ); - } - - protected function doDisplay(array \$context, array \$blocks = array()) - { - \$this->checkSecurity(); - // line 1 - echo "foo"; - } - - protected function checkSecurity() - { - \$tags = array(); - \$filters = array(); - \$functions = array(); - - try { - \$this->env->getExtension('sandbox')->checkSecurity( - array('upper'), - array('for'), - array('cycle') - ); - } catch (Twig_Sandbox_SecurityError \$e) { - \$e->setTemplateFile(\$this->getTemplateName()); - - if (\$e instanceof Twig_Sandbox_SecurityNotAllowedTagError && isset(\$tags[\$e->getTagName()])) { - \$e->setTemplateLine(\$tags[\$e->getTagName()]); - } elseif (\$e instanceof Twig_Sandbox_SecurityNotAllowedFilterError && isset(\$filters[\$e->getFilterName()])) { - \$e->setTemplateLine(\$filters[\$e->getFilterName()]); - } elseif (\$e instanceof Twig_Sandbox_SecurityNotAllowedFunctionError && isset(\$functions[\$e->getFunctionName()])) { - \$e->setTemplateLine(\$functions[\$e->getFunctionName()]); - } - - throw \$e; - } - } - - public function getTemplateName() - { - return "foo.twig"; - } - - public function getDebugInfo() - { - return array ( 20 => 1,); - } -} -EOF - , $twig); - - $body = new Twig_Node(); - $extends = new Twig_Node_Expression_Constant('layout.twig', 1); - $blocks = new Twig_Node(); - $macros = new Twig_Node(); - $traits = new Twig_Node(); - $filename = 'foo.twig'; - - $node = new Twig_Node_Module($body, $extends, $blocks, $macros, $traits, new Twig_Node(array()), $filename); - $node = new Twig_Node_SandboxedModule($node, array('for'), array('upper'), array('cycle')); - - $tests[] = array($node, <<parent = \$this->env->loadTemplate("layout.twig"); - - \$this->blocks = array( - ); - } - - protected function doGetParent(array \$context) - { - return "layout.twig"; - } - - protected function doDisplay(array \$context, array \$blocks = array()) - { - \$this->checkSecurity(); - \$this->parent->display(\$context, array_merge(\$this->blocks, \$blocks)); - } - - protected function checkSecurity() - { - \$tags = array(); - \$filters = array(); - \$functions = array(); - - try { - \$this->env->getExtension('sandbox')->checkSecurity( - array('upper'), - array('for'), - array('cycle') - ); - } catch (Twig_Sandbox_SecurityError \$e) { - \$e->setTemplateFile(\$this->getTemplateName()); - - if (\$e instanceof Twig_Sandbox_SecurityNotAllowedTagError && isset(\$tags[\$e->getTagName()])) { - \$e->setTemplateLine(\$tags[\$e->getTagName()]); - } elseif (\$e instanceof Twig_Sandbox_SecurityNotAllowedFilterError && isset(\$filters[\$e->getFilterName()])) { - \$e->setTemplateLine(\$filters[\$e->getFilterName()]); - } elseif (\$e instanceof Twig_Sandbox_SecurityNotAllowedFunctionError && isset(\$functions[\$e->getFunctionName()])) { - \$e->setTemplateLine(\$functions[\$e->getFunctionName()]); - } - - throw \$e; - } - } - - public function getTemplateName() - { - return "foo.twig"; - } - - public function isTraitable() - { - return false; - } - - public function getDebugInfo() - { - return array (); - } -} -EOF - , $twig); - - return $tests; - } -} diff --git a/vendor/twig/twig/test/Twig/Tests/Node/SandboxedPrintTest.php b/vendor/twig/twig/test/Twig/Tests/Node/SandboxedPrintTest.php index 058e02bc22..05e1854cb1 100644 --- a/vendor/twig/twig/test/Twig/Tests/Node/SandboxedPrintTest.php +++ b/vendor/twig/twig/test/Twig/Tests/Node/SandboxedPrintTest.php @@ -11,9 +11,6 @@ class Twig_Tests_Node_SandboxedPrintTest extends Twig_Test_NodeTestCase { - /** - * @covers Twig_Node_SandboxedPrint::__construct - */ public function testConstructor() { $node = new Twig_Node_SandboxedPrint($expr = new Twig_Node_Expression_Constant('foo', 1), 1); @@ -21,15 +18,6 @@ class Twig_Tests_Node_SandboxedPrintTest extends Twig_Test_NodeTestCase $this->assertEquals($expr, $node->getNode('expr')); } - /** - * @covers Twig_Node_SandboxedPrint::compile - * @dataProvider getTests - */ - public function testCompile($node, $source, $environment = null) - { - parent::testCompile($node, $source, $environment); - } - public function getTests() { $tests = array(); diff --git a/vendor/twig/twig/test/Twig/Tests/Node/SetTest.php b/vendor/twig/twig/test/Twig/Tests/Node/SetTest.php index 893cd4d7d1..62ad2803ea 100644 --- a/vendor/twig/twig/test/Twig/Tests/Node/SetTest.php +++ b/vendor/twig/twig/test/Twig/Tests/Node/SetTest.php @@ -11,9 +11,6 @@ class Twig_Tests_Node_SetTest extends Twig_Test_NodeTestCase { - /** - * @covers Twig_Node_Set::__construct - */ public function testConstructor() { $names = new Twig_Node(array(new Twig_Node_Expression_AssignName('foo', 1)), array(), 1); @@ -25,15 +22,6 @@ class Twig_Tests_Node_SetTest extends Twig_Test_NodeTestCase $this->assertFalse($node->getAttribute('capture')); } - /** - * @covers Twig_Node_Set::compile - * @dataProvider getTests - */ - public function testCompile($node, $source, $environment = null) - { - parent::testCompile($node, $source, $environment); - } - public function getTests() { $tests = array(); diff --git a/vendor/twig/twig/test/Twig/Tests/Node/SpacelessTest.php b/vendor/twig/twig/test/Twig/Tests/Node/SpacelessTest.php index 6735dc316d..222ca09207 100644 --- a/vendor/twig/twig/test/Twig/Tests/Node/SpacelessTest.php +++ b/vendor/twig/twig/test/Twig/Tests/Node/SpacelessTest.php @@ -11,9 +11,6 @@ class Twig_Tests_Node_SpacelessTest extends Twig_Test_NodeTestCase { - /** - * @covers Twig_Node_Spaceless::__construct - */ public function testConstructor() { $body = new Twig_Node(array(new Twig_Node_Text('
      foo
      ', 1))); @@ -22,15 +19,6 @@ class Twig_Tests_Node_SpacelessTest extends Twig_Test_NodeTestCase $this->assertEquals($body, $node->getNode('body')); } - /** - * @covers Twig_Node_Spaceless::compile - * @dataProvider getTests - */ - public function testCompile($node, $source, $environment = null) - { - parent::testCompile($node, $source, $environment); - } - public function getTests() { $body = new Twig_Node(array(new Twig_Node_Text('
      foo
      ', 1))); diff --git a/vendor/twig/twig/test/Twig/Tests/Node/TextTest.php b/vendor/twig/twig/test/Twig/Tests/Node/TextTest.php index 6f85576e0f..ceaf67f4c5 100644 --- a/vendor/twig/twig/test/Twig/Tests/Node/TextTest.php +++ b/vendor/twig/twig/test/Twig/Tests/Node/TextTest.php @@ -11,9 +11,6 @@ class Twig_Tests_Node_TextTest extends Twig_Test_NodeTestCase { - /** - * @covers Twig_Node_Text::__construct - */ public function testConstructor() { $node = new Twig_Node_Text('foo', 1); @@ -21,15 +18,6 @@ class Twig_Tests_Node_TextTest extends Twig_Test_NodeTestCase $this->assertEquals('foo', $node->getAttribute('data')); } - /** - * @covers Twig_Node_Text::compile - * @dataProvider getTests - */ - public function testCompile($node, $source, $environment = null) - { - parent::testCompile($node, $source, $environment); - } - public function getTests() { $tests = array(); diff --git a/vendor/twig/twig/test/Twig/Tests/NodeVisitor/OptimizerTest.php b/vendor/twig/twig/test/Twig/Tests/NodeVisitor/OptimizerTest.php index d35740d5c5..72c777c1ef 100644 --- a/vendor/twig/twig/test/Twig/Tests/NodeVisitor/OptimizerTest.php +++ b/vendor/twig/twig/test/Twig/Tests/NodeVisitor/OptimizerTest.php @@ -89,6 +89,16 @@ class Twig_Tests_NodeVisitor_OptimizerTest extends PHPUnit_Framework_TestCase array('{% for i in foo %}{% for j in foo %}{{ foo.parent.loop.index }}{% endfor %}{% endfor %}', array('i' => false, 'j' => false)), array('{% for i in foo %}{% for j in foo %}{{ loop["parent"].loop.index }}{% endfor %}{% endfor %}', array('i' => true, 'j' => true)), + + array('{% for i in foo %}{{ include("foo") }}{% endfor %}', array('i' => true)), + + array('{% for i in foo %}{{ include("foo", with_context = false) }}{% endfor %}', array('i' => false)), + + array('{% for i in foo %}{{ include("foo", with_context = true) }}{% endfor %}', array('i' => true)), + + array('{% for i in foo %}{{ include("foo", { "foo": "bar" }, with_context = false) }}{% endfor %}', array('i' => false)), + + array('{% for i in foo %}{{ include("foo", { "foo": loop.index }, with_context = false) }}{% endfor %}', array('i' => true)), ); } diff --git a/vendor/twig/twig/test/Twig/Tests/TemplateTest.php b/vendor/twig/twig/test/Twig/Tests/TemplateTest.php index e2f84eeed7..9010f28e10 100644 --- a/vendor/twig/twig/test/Twig/Tests/TemplateTest.php +++ b/vendor/twig/twig/test/Twig/Tests/TemplateTest.php @@ -310,7 +310,7 @@ class Twig_Tests_TemplateTest extends PHPUnit_Framework_TestCase foreach ($basicTests as $test) { // properties cannot be numbers if (($testObject[0] instanceof stdClass || $testObject[0] instanceof Twig_TemplatePropertyObject) && is_numeric($test[2])) { - continue; + continue; } if ('+4' === $test[2] && $methodObject === $testObject[0]) { @@ -347,7 +347,7 @@ class Twig_Tests_TemplateTest extends PHPUnit_Framework_TestCase } } - $methodAndPropObject = new Twig_TemplateMethodAndPropObject; + $methodAndPropObject = new Twig_TemplateMethodAndPropObject(); // additional method tests $tests = array_merge($tests, array( @@ -396,7 +396,7 @@ class Twig_TemplateTest extends Twig_Template { parent::__construct($env); $this->useExtGetAttribute = $useExtGetAttribute; - Twig_Template::clearCache(); + self::$cache = array(); } public function getZero() diff --git a/vendor/twig/twig/test/Twig/Tests/escapingTest.php b/vendor/twig/twig/test/Twig/Tests/escapingTest.php index d581315a00..b28d3cda0a 100644 --- a/vendor/twig/twig/test/Twig/Tests/escapingTest.php +++ b/vendor/twig/twig/test/Twig/Tests/escapingTest.php @@ -6,7 +6,6 @@ * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ - class Twig_Test_EscapingTest extends PHPUnit_Framework_TestCase { /** @@ -17,7 +16,7 @@ class Twig_Test_EscapingTest extends PHPUnit_Framework_TestCase '"' => '"', '<' => '<', '>' => '>', - '&' => '&' + '&' => '&', ); protected $htmlAttrSpecialChars = array( @@ -227,7 +226,7 @@ class Twig_Test_EscapingTest extends PHPUnit_Framework_TestCase /** * Convert a Unicode Codepoint to a literal UTF-8 character. * - * @param int $codepoint Unicode codepoint in hex notation + * @param int $codepoint Unicode codepoint in hex notation * @return string UTF-8 literal string */ protected function codepointToUtf8($codepoint) @@ -256,7 +255,7 @@ class Twig_Test_EscapingTest extends PHPUnit_Framework_TestCase public function testJavascriptEscapingEscapesOwaspRecommendedRanges() { $immune = array(',', '.', '_'); // Exceptions to escaping ranges - for ($chr=0; $chr < 0xFF; $chr++) { + for ($chr = 0; $chr < 0xFF; $chr++) { if ($chr >= 0x30 && $chr <= 0x39 || $chr >= 0x41 && $chr <= 0x5A || $chr >= 0x61 && $chr <= 0x7A) { @@ -279,7 +278,7 @@ class Twig_Test_EscapingTest extends PHPUnit_Framework_TestCase public function testHtmlAttributeEscapingEscapesOwaspRecommendedRanges() { $immune = array(',', '.', '-', '_'); // Exceptions to escaping ranges - for ($chr=0; $chr < 0xFF; $chr++) { + for ($chr = 0; $chr < 0xFF; $chr++) { if ($chr >= 0x30 && $chr <= 0x39 || $chr >= 0x41 && $chr <= 0x5A || $chr >= 0x61 && $chr <= 0x7A) { @@ -302,7 +301,7 @@ class Twig_Test_EscapingTest extends PHPUnit_Framework_TestCase public function testCssEscapingEscapesOwaspRecommendedRanges() { // CSS has no exceptions to escaping ranges - for ($chr=0; $chr < 0xFF; $chr++) { + for ($chr = 0; $chr < 0xFF; $chr++) { if ($chr >= 0x30 && $chr <= 0x39 || $chr >= 0x41 && $chr <= 0x5A || $chr >= 0x61 && $chr <= 0x7A) {