Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Fix typos #381

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion INSTALL
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ Autoload compatibility

HTML Purifier attempts to be as smart as possible when registering an
autoloader, but there are some cases where you will need to change
your own code to accomodate HTML Purifier. These are those cases:
your own code to accommodate HTML Purifier. These are those cases:

AN __autoload FUNCTION IS DECLARED AFTER OUR AUTOLOADER IS REGISTERED
spl_autoload_register() has the curious behavior of disabling
Expand Down
16 changes: 8 additions & 8 deletions NEWS
Original file line number Diff line number Diff line change
Expand Up @@ -439,7 +439,7 @@ real release we decided to skip this version number.

3.3.0, released 2009-02-16
! Implement CSS property 'overflow' when %CSS.AllowTricky is true.
! Implement generic property list classess
! Implement generic property list classes
- Fix bug with testEncodingSupportsASCII() algorithm when iconv() implementation
does not do the "right thing" with characters not supported in the output
set.
Expand Down Expand Up @@ -479,7 +479,7 @@ real release we decided to skip this version number.
! %Core.AggressivelyFixLt is on by default. This causes more sensible
processing of left angled brackets in smileys and other whatnot.
! Test scripts now have a 'type' parameter, which lets you say 'htmlpurifier',
'phpt', 'vtest', etc. in order to only execute those tests. This supercedes
'phpt', 'vtest', etc. in order to only execute those tests. This supersedes
the --only-phpt parameter, although for backwards-compatibility the flag
will still work.
! AutoParagraph auto-formatter will now preserve double-newlines upon output.
Expand Down Expand Up @@ -530,7 +530,7 @@ real release we decided to skip this version number.
. Added --quick option to multitest.php, which tests only the most recent
release for each series.
. Added --distro option to multitest.php, which accepts either 'normal' or
'standalone'. This supercedes --exclude-normal and --exclude-standalone
'standalone'. This supersedes --exclude-normal and --exclude-standalone

3.1.1, released 2008-06-19
# %URI.Munge now, by default, does not munge resources (for example, <img src="">)
Expand Down Expand Up @@ -680,7 +680,7 @@ real release we decided to skip this version number.
# HTMLPurifier->addFilter is deprecated; built-in filters can now be
enabled using %Filter.$filter_name or by setting your own filters using
%Filter.Custom
# Directive-level safety properties superceded in favor of module-level
# Directive-level safety properties superseded in favor of module-level
safety. Internal method HTMLModule->addElement() has changed, although
the externally visible HTMLDefinition->addElement has *not* changed.
! Extra utility classes for testing and non-library operations can
Expand Down Expand Up @@ -726,7 +726,7 @@ real release we decided to skip this version number.
. A couple of new historical maintenance scripts were added.
. HTMLPurifier/HTMLModule/Tidy/XHTMLAndHTML4.php split into two files
. tests/index.php can now be run from any directory.
. HTMLPurifier_Token subclasses split into seperate files
. HTMLPurifier_Token subclasses split into separate files
. HTMLPURIFIER_PREFIX now is defined in Bootstrap.php, NOT HTMLPurifier.php
. HTMLPURIFIER_PREFIX can now be defined outside of HTML Purifier
. New --php=php flag added, allows PHP executable to be specified (command
Expand Down Expand Up @@ -792,7 +792,7 @@ real release we decided to skip this version number.
- Fix warning emitted when a non-supported URI scheme is passed to the
MakeAbsolute URIFilter, thanks NykO18 (again)
- Further refine AutoParagraph injector. Behavior inside of elements
allowing paragraph tags clarified: only inline content delimeted by
allowing paragraph tags clarified: only inline content delimited by
double newlines (not block elements) are paragraphed.
- Buggy treatment of end tags of elements that have required attributes
fixed (does not manifest on default tag-set)
Expand Down Expand Up @@ -838,7 +838,7 @@ real release we decided to skip this version number.
! CSS property border-spacing implemented
- Fix non-visible parsing error in DirectLex with empty tags that have
slashes inside attribute values.
- Fix typo in CSS definition: border-collapse:seperate; was incorrectly
- Fix typo in CSS definition: border-collapse:separate; was incorrectly
accepted as valid CSS. Usually non-visible, because this styling is the
default for tables in most browsers. Thanks Brett Zamir for pointing
this out.
Expand Down Expand Up @@ -889,7 +889,7 @@ real release we decided to skip this version number.
. HTMLPurifier_Config->getSerial() implemented, this is extremely useful
for output cache invalidation
. ConfigForm printer now can retrieve CSS and JS files as strings, in
case HTML Purifier's directory is not publically accessible
case HTML Purifier's directory is not publicly accessible
. Introduce new text/itext configuration directive values: these represent
longer strings that would be more appropriately edited with a textarea
. Allow newlines to act as separators for lists, hashes, lookups and
Expand Down
4 changes: 2 additions & 2 deletions TODO
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ FUTURE VERSIONS
- Config: Add examples to everything (make built-in which also automatically
gives output)
- Add "register" field to config schemas to eliminate dependence on
naming conventions (try to remember why we ultimately decided on tihs)
naming conventions (try to remember why we ultimately decided on this)

5.0 release [HTML 5]
# Swap out code to use html5lib tokenizer and tree-builder
Expand Down Expand Up @@ -112,7 +112,7 @@ Neat feature related
Also, enable disabling of directionality
? Externalize inline CSS to promote clean HTML, proposed by Sander Tekelenburg
? Remove redundant tags, ex. <u><u>Underlined</u></u>. Implementation notes:
1. Analyzing which tags to remove duplicants
1. Analyzing which tags to remove duplicates
2. Ensure attributes are merged into the parent tag
3. Extend the tag exclusion system to specify whether or not the
contents should be dropped or not (currently, there's code that could do
Expand Down
2 changes: 1 addition & 1 deletion benchmarks/samples/Lexer/4.html
Original file line number Diff line number Diff line change
Expand Up @@ -392,7 +392,7 @@ <h2>External links</h2>
<li><a href="http://www.scheele.org/lee/tcclinks.html" class="external text" title="http://www.scheele.org/lee/tcclinks.html">Lee Scheele's Links to T'ai Chi Ch'uan Web Sites</a></li>
<li><a href="http://news.bbc.co.uk/1/hi/health/3543907.stm" class="external text" title="http://news.bbc.co.uk/1/hi/health/3543907.stm">BBC article</a></li>
<li><a href="http://www.acupuncturetoday.com/archives2004/jul/07taichi.html" class="external text" title="http://www.acupuncturetoday.com/archives2004/jul/07taichi.html">Tai Chi: Good for the Mind, Good for the Body</a></li>
<li><a href="http://www.taichiunion.com/" class="external text" title="http://www.taichiunion.com/">Tai Chi Chuan Union for Great Britian: The largest collective of independent Tai Chi Chuan Instructors in the British Isles</a></li>
<li><a href="http://www.taichiunion.com/" class="external text" title="http://www.taichiunion.com/">Tai Chi Chuan Union for Great Britain: The largest collective of independent Tai Chi Chuan Instructors in the British Isles</a></li>
</ul>


Expand Down
2 changes: 1 addition & 1 deletion docs/dev-config-naming.txt
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ the properties:
AllowedFrameTargets -> heavily <a> specific, but also used by <area>
and <form>. Transitional DTD %FrameTarget, not present in strict,
HTML5 calls them "browsing contexts"
Default*Image* -> as a default parameter, is almost entirely exlcusive
Default*Image* -> as a default parameter, is almost entirely exclusive
to <img>
EnableID -> global attribute
Name.UseCDATA -> heavily <a> specific, but has heavy other usage by
Expand Down
2 changes: 1 addition & 1 deletion docs/dev-progress.html
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ <h2>CSS</h2>

<tbody>
<tr><th colspan="2">Table</th></tr>
<tr class="impl-yes"><td>border-collapse</td><td>ENUM(collapse, seperate)</td></tr>
<tr class="impl-yes"><td>border-collapse</td><td>ENUM(collapse, separate)</td></tr>
<tr class="impl-yes"><td>border-space</td><td>MULTIPLE</td></tr>
<tr class="impl-yes"><td>caption-side</td><td>ENUM(top, bottom)</td></tr>
<tr class="feature"><td>empty-cells</td><td>ENUM(show, hide), No IE support makes this useless,
Expand Down
2 changes: 1 addition & 1 deletion docs/enduser-tidy.html
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ <h2>I like the general idea, but the specifics bug me!</h2>

<p>So you want HTML Purifier to clean up your HTML, but you're not
so happy about the br@clear implementation. That's perfectly fine!
HTML Purifier will make accomodations:</p>
HTML Purifier will make accommodations:</p>

<pre>$config-&gt;set('HTML.Doctype', 'XHTML 1.0 Transitional');
$config-&gt;set('HTML.TidyLevel', 'heavy'); // all changes, minus...
Expand Down
4 changes: 2 additions & 2 deletions docs/proposal-filter-levels.txt
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ These are special use tags, they should be enabled on a blanket basis.
Lists - dd, dl, dt, li, ol, ul ~ menu, dir
Tables - caption, table, td, th, tr / col, colgroup, tbody, tfoot, thead

Forms - fieldset, form, input, lable, legend, optgroup, option, select, textarea
Forms - fieldset, form, input, label, legend, optgroup, option, select, textarea
XSS - noscript, object, script ~ applet
Meta - base, basefont, body, head, html, link, meta, style, title
Frames - frame, frameset, iframe
Expand Down Expand Up @@ -91,7 +91,7 @@ attribute and put URI filtering higher up on the priority list.

== Attribute Risk Analysis ==

We actually have a suprisingly small assortment of allowed attributes (the
We actually have a surprisingly small assortment of allowed attributes (the
rest are deprecated in strict, and thus we opted not to allow them, even
though our output is XHTML Transitional by default.)

Expand Down
2 changes: 1 addition & 1 deletion docs/proposal-plists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ Backfills/Data integrity:
Type systems:
- Flags: ReadOnly, Permanent, DontEnum
- Typed properties isn't that useful [It's also Not-PHP]
- Seperate meta-list of directive properties IS useful
- Separate meta-list of directive properties IS useful
- Duck typing is useful for systems designed fully around properties pattern

Trade-off:
Expand Down
2 changes: 1 addition & 1 deletion library/HTMLPurifier/AttrDef/CSS/FontFamily.php
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ public function validate($string, $config, $context)
// transforms don't pose a security risk (as \\ and \"
// might--these escapes are not supported by most browsers).
// We could try to be clever and use single-quote wrapping
// when there is a double quote present, but I have choosen
// when there is a double quote present, but I have chosen
// not to implement that. (NOTE: you can reduce the amount
// of escapes by one depending on what quoting style you use)
// $font = str_replace('\\', '\\5C ', $font);
Expand Down
2 changes: 1 addition & 1 deletion library/HTMLPurifier/AttrDef/URI/IPv6.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public function validate($aIP, $config, $context)
}
}

// IPv4-compatiblity check
// IPv4-compatibility check
if (preg_match('#(?<=:' . ')' . $this->ip4 . '$#s', $aIP, $find)) {
$aIP = substr($aIP, 0, 0 - strlen($find[0]));
$ip = explode('.', $find[0]);
Expand Down
2 changes: 1 addition & 1 deletion library/HTMLPurifier/AttrTransform/BdoDir.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
// this MUST be placed in post, as it assumes that any value in dir is valid

/**
* Post-trasnform that ensures that bdo tags have the dir attribute set.
* Post-transform that ensures that bdo tags have the dir attribute set.
*/
class HTMLPurifier_AttrTransform_BdoDir extends HTMLPurifier_AttrTransform
{
Expand Down
2 changes: 1 addition & 1 deletion library/HTMLPurifier/AttrValidator.php
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ public function validateToken($token, $config, $context)
// 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,
// resolve (certain ones would be completely overridden,
// others would prepend themselves).
}

Expand Down
2 changes: 1 addition & 1 deletion library/HTMLPurifier/Bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
define('HTMLPURIFIER_PREFIX', realpath(dirname(__FILE__) . '/..'));
}

// accomodations for versions earlier than 5.0.2
// accommodations for versions earlier than 5.0.2
// borrowed from PHP_Compat, LGPL licensed, by Aidan Lister <[email protected]>
if (!defined('PHP_EOL')) {
switch (strtoupper(substr(PHP_OS, 0, 3))) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ class HTMLPurifier_ConfigSchema_Interchange_Directive
public $version;

/**
* ID of directive that supercedes this old directive.
* ID of directive that supersedes this old directive.
* Null if not deprecated.
* @type HTMLPurifier_ConfigSchema_Interchange_Id
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ 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
have a separate prefix that changes with each iteration. This way,
separately 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
separator (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
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ 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.
repertoire is available, although this is the case for almost all encodings.
Anyway, use UTF-8!
--# vim: et sw=4 sts=4
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ DEFAULT: NULL
</dd>
<dt><em>string</em> lexer identifier</dt>
<dd>
This is a slim way of manually overridding the implementation.
This is a slim way of manually overriding the implementation.
Currently recognized values are: DOMLex (the default PHP5
implementation)
and DirectLex (the default PHP4 implementation). Only use this if
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ EXTERNAL: CSSTidy
<div>
<?php echo $html; ?>
</div>
</b]]><![CDATA[ody>
</b]]><![CDATA[body>
</html>
]]></pre>
<p>
Expand Down
2 changes: 1 addition & 1 deletion library/HTMLPurifier/EntityParser.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
// $config or $context to the callback functions.

/**
* Handles referencing and derefencing character entities
* Handles referencing and dereferencing character entities
*/
class HTMLPurifier_EntityParser
{
Expand Down
2 changes: 1 addition & 1 deletion library/HTMLPurifier/Filter.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* Represents a pre or post processing filter on HTML Purifier's output
*
* Sometimes, a little ad-hoc fixing of HTML has to be done before
* it gets sent through HTML Purifier: you can use filters to acheive
* it gets sent through HTML Purifier: you can use filters to achieve
* this effect. For instance, YouTube videos can be preserved using
* this manner. You could have used a decorator for this task, but
* PHP's support for them is not terribly robust, so we're going
Expand Down
2 changes: 1 addition & 1 deletion library/HTMLPurifier/Generator.php
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ public function generateAttributes($assoc_array_of_attributes, $element = '')
// whitespace (in fact, most don't, at least for attributes
// like alt, but an extra space at the end is barely
// noticeable). Still, we have a configuration knob for
// this, since this transformation is not necesary if you
// this, since this transformation is not necessary if you
// don't process user input with innerHTML or you don't plan
// on supporting Internet Explorer.
if ($this->_innerHTMLFix) {
Expand Down
2 changes: 1 addition & 1 deletion library/HTMLPurifier/HTMLModule/Edit.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public function setup($config)

// 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
// a complicated workaround to achieve this effect

// Inline context ! Block context (exclamation mark is
// separator, see getChildDef for parsing)
Expand Down
2 changes: 1 addition & 1 deletion library/HTMLPurifier/HTMLModule/Ruby.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

/**
* XHTML 1.1 Ruby Annotation Module, defines elements that indicate
* short runs of text alongside base text for annotation or pronounciation.
* short runs of text alongside base text for annotation or pronunciation.
*/
class HTMLPurifier_HTMLModule_Ruby extends HTMLPurifier_HTMLModule
{
Expand Down
2 changes: 1 addition & 1 deletion library/HTMLPurifier/HTMLModule/Tidy/Name.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php

/**
* Name is deprecated, but allowed in strict doctypes, so onl
* Name is deprecated, but allowed in strict doctypes, so only
*/
class HTMLPurifier_HTMLModule_Tidy_Name extends HTMLPurifier_HTMLModule_Tidy
{
Expand Down
20 changes: 15 additions & 5 deletions library/HTMLPurifier/Lexer/PH5P.php
Original file line number Diff line number Diff line change
Expand Up @@ -463,7 +463,7 @@ public function __construct($data)
$this->data = $data;
$this->char = -1;
$this->EOF = strlen($data);
$this->tree = new HTML5TreeConstructer;
$this->tree = new HTML5TreeConstructor;
$this->content_model = self::PCDATA;

$this->state = 'data';
Expand Down Expand Up @@ -1223,7 +1223,7 @@ private function markupDeclarationOpenState()
'type' => self::COMMENT
);

/* Otherwise if the next seven chacacters are a case-insensitive match
/* Otherwise if the next seven characters 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') {
Expand Down Expand Up @@ -1574,6 +1574,14 @@ private function EOF()
}
}

class HTML5TreeConstructor extends HTML5TreeConstructer
{}

/**
* @deprecated Use HTML5TreeConstructor instead
*
* @todo Remove with version 5
*/
class HTML5TreeConstructer
szepeviktor marked this conversation as resolved.
Show resolved Hide resolved
{
public $stack = array();
Expand Down Expand Up @@ -1674,6 +1682,8 @@ class HTML5TreeConstructer
const END_PHASE = 3;

// The different insertion modes for the main phase.
const BEFORE_HEAD = 0;
// For backward compatibility.
const BEFOR_HEAD = 0;
const IN_HEAD = 1;
const AFTER_HEAD = 2;
Expand All @@ -1700,7 +1710,7 @@ class HTML5TreeConstructer
public function __construct()
{
$this->phase = self::INIT_PHASE;
$this->mode = self::BEFOR_HEAD;
$this->mode = self::BEFORE_HEAD;
$this->dom = new DOMDocument;

$this->dom->encoding = 'UTF-8';
Expand Down Expand Up @@ -1865,7 +1875,7 @@ private function mainPhase($token)
} else {
/* Depends on the insertion mode: */
switch ($this->mode) {
case self::BEFOR_HEAD:
case self::BEFORE_HEAD:
return $this->beforeHead($token);
break;
case self::IN_HEAD:
Expand Down Expand Up @@ -4749,7 +4759,7 @@ private function resetInsertionMode()
case, abort these steps. (innerHTML case) */
} elseif ($node->nodeName === 'html') {
$this->mode = ($this->head_pointer === null)
? self::BEFOR_HEAD
? self::BEFORE_HEAD
: self::AFTER_HEAD;

break;
Expand Down
2 changes: 1 addition & 1 deletion library/HTMLPurifier/Strategy/FixNesting.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
* The second objective is to ensure that explicitly excluded elements of
* an element do not appear in its children. Code that accomplishes this
* task is pervasive through the strategy, though the two are distinct tasks
* and could, theoretically, be seperated (although it's not recommended).
* and could, theoretically, be separated (although it's not recommended).
*
* @note Whether or not unrecognized children are silently dropped or
* translated into text depends on the child definitions.
Expand Down
2 changes: 1 addition & 1 deletion library/HTMLPurifier/Strategy/MakeWellFormed.php
Original file line number Diff line number Diff line change
Expand Up @@ -641,7 +641,7 @@ private function remove()
// Needless to say, we need to UN-skip the token so it gets
// reprocessed.
//
// - Suppose that you successfuly process a token, replace it with
// - Suppose that you successfully process a token, replace it with
// one with your skip mark, but now another injector wants to
// process the skipped token with another token. Should you continue
// to skip that new token, or reprocess it? If you reprocess,
Expand Down
Loading