updated to 0.3.3. also, removed all instances of '=&'; replaced with '='

This commit is contained in:
real_nowhereman 2011-08-25 19:33:18 +00:00
parent 5fac9b6a39
commit e5f7052516
7 changed files with 386 additions and 777 deletions

View File

@ -1,192 +0,0 @@
The Artistic License
Version 2.0beta4, October 2000
Copyright (C) 2000, Larry Wall.
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
This copyright license states the terms under which a given free software Package may be copied, modified and/or redistributed, while the Originator(s) maintain some artistic control over the future development of that Package (at least as much artistic control as can be given under copyright law while still making the Package open source and free software).
This license is bound by copyright law, and thus it legally applies only to works which the copyright holder has permitted copying, distribution or modification under the terms of the Artistic License, Version 2.0.
You are reminded that You are always permitted to make arrangements wholly outside of a given copyright license directly with the copyright holder(s) of a given Package. If the terms of this license impede your ability to make full use of the Package, You are encouraged to contact the copyright holder(s) and seek a different licensing arrangement.
Definitions
"Package" refers to the collection of files distributed by the Originator(s), and derivatives of that collection of files created through textual modification.
"Standard Version" refers to the Package if it has not been modified, or has been modified only in ways suggested by the Originator(s).
"Modified Version" refers to the Package, if it has been changed by You via textual modification of the source code, and such changes were not suggested by the Originator(s).
"Originator" refers to the author(s) and/or copyright holder(s) of the Standard Version of the Package.
"You" and "Your" refers to any person who would like to copy, distribute, or modify the Package.
"Distribution Fee" is any fee that You charge for providing a copy of this Package to another party. It does not refer to licensing fees.
"Freely Available" means that:
(a) no fee is charged for the right to use the item (though a
Distribution Fee may be charged).
(b) recipients of the item may redistribute it under the same
conditions they received it.
(c) If the item is a binary, object code, bytecode, the complete
corresponding machine-readable source code is included with the
item.
Permission for Use and Modification Without Redistribution
(1) You are permitted to use the Standard Version and create and use
Modified Versions for any purpose without restriction, provided that
you do not redistribute the Modified Version to others outside of your
company or organization.
Permissions for Redistribution of the Standard Version
(2) You may make available verbatim copies of the source code of the
Standard Version of this Package in any medium without restriction,
either gratis or for a Distribution Fee, provided that you duplicate
all of the original copyright notices and associated disclaimers. At
Your discretion, such verbatim copies may or may not include compiled
bytecode, object code or binary versions of the corresponding source
code in the same medium.
(3) You may apply any bug fixes, portability changes, and other
modifications made available from any of the Originator(s). The
resulting modified Package will still be considered the Standard
Version, and may be copied, modified and redistributed under the terms
of the original license of the Standard Version as if it were the
Standard Version.
Permissions for Redistribution of Modified Versions of the Package as Source
(4) You may modify your copy of the source code of this Package in any way
and distribute that Modified Version (either gratis or for a
Distribution Fee, and with or without a corresponding binary, bytecode
or object code version of the Modified Version) provided that You
clearly indicate what changes You made to the Package, and provided
that You do at least ONE of the following:
(a) make the Modified Version available to the Originator(s) of the
Standard Version, under the exact license of the Standard
Version, so that the Originator(s) may include your modifications
into the Standard Version (at their discretion).
(b) modify any installation scripts and procedures so that
installation of the Modified Version will never conflict with an
installation of the Standard Version, include for each program
installed by the Modified Version clear documentation describing
how it differs from the Standard Version, and rename your
Modified Version so that the name is substantially different from
the Standard Version.
(c) permit and encourage anyone who receives a copy of the Modified
Version permission to make your modifications Freely Available in
some specific way.
If Your Modified Version is in turn derived from a Modified Version
made by a third party, then You are still required to ensure that Your
Modified Version complies with the requirements of this license.
Permissions for Redistribution of Non-Source Versions of Package
(5) You may distribute binary, object code, bytecode or other non-source
versions of the Standard Version of the Package, provided that you
include complete instructions on where to get the source code of the
Standard Version. Such instructions must be valid at the time of Your
distribution. If these instructions, at any time while You are
carrying our such distribution, become invalid, you must provide new
instructions on demand or cease further distribution. If You cease
distribution within thirty days after You become aware that the
instructions are invalid, then You do not forfeit any of Your rights
under this license.
(6) You may distribute binary, object code, bytecode or other non-source
versions of a Modified Version provided that You do at least ONE of
the following:
(a) include a copy of the corresponding source code for the Modified
Version under the terms indicated in (4).
(b) ensure that the installation of Your non-source Modified Version
does not conflict in any way with an installation of the Standard
Version, include for each program installed by the Modified
Version clear documentation describing how it differs from the
Standard Version, and rename your Modified Version so that the
name is substantially different from the Standard Version.
(c) ensure that the Modified Version includes notification of the
changes made from the Standard Version, and offer to provide
machine-readable source code (under a license that permits making
that source code Freely Available) of the Modified Version via
mail order.
Permissions for Inclusion of the Package in Aggregate Works
(7) You may aggregate this Package (either the Standard Version or
Modified Version) with other packages and distribute the resulting
aggregation provided that You do not charge a licensing fee for the
Package. Distribution Fees are permitted, and licensing fees for
other packages in the aggregation are permitted. Your permission to
distribute Standard or Modified Versions of the Package is still
subject to the other terms set forth in other sections of this
license.
(8) In addition to the permissions given elsewhere by this license, You
are also permitted to link Modified and Standard Versions of this
Package with other works and distribute the result without
restriction, provided You have produced binary program(s) that do not
overtly expose the interfaces of the Package. This includes
permission to embed the Package in a larger work of your own without
exposing a direct interface to the Package. This also includes
permission to build stand-alone binary or bytecode versions of your
scripts that require the Package, but do not otherwise give the casual
user direct access to the Package itself.
Items That are Never Considered Part of a Modified Version Package
(9) Works (including, but not limited to, subroutines and scripts) that
you have linked or aggregated with the Package that merely extend or
make use of the Package, but are not intended to cause the Package to
operate differently from the Standard Version, do not, by themselves,
cause the Package to be a Modified Version. In addition, such works
are not considered parts of the Package itself, and are not bound by
the terms of the Package's license.
Acceptance of License and Disclaimer of Warranty
(10) You are not required to accept this License, since you have not signed
it. However, nothing else grants you permission to copy, modify or
distribute the Standard or Modified Versions of the Package. These
actions are prohibited by copyright law if you do not accept this
License. Therefore, by copying, modifying or distributing Standard
and Modified Versions of the Package, you indicate your acceptance of
the license of the Package.
(11) Disclaimer of Warranty:
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT UNLESS REQUIRED BY
LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER OR CONTRIBUTOR
BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, PROFITS; OR
BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

View File

@ -1,3 +1,45 @@
-- Changes until version 0.3.3
2008-03-27 Christian Seiler <webmaster@christian-seiler.de>
* stringparser_bbcode.class.php:
fixed regression in handling of case insensitive codes
-- Changes until version 0.3.2b
2007-12-27 Christian Seiler <webmaster@christian-seiler.de>
* stringparser_bbcode.class.php:
removed forgotten debug output
-- Changes until version 0.3.2
2007-12-10 Christian Seiler <webmaster@christian-seiler.de>
* stringparser_bbcode.class.php:
fixed bug in handling of case insensitive codes,
fixed nasty bug that made [list][*][*][/list] misbehave
* Documentation: Changed example to prevent XSS attacks.
* Changed license to MIT license
-- Changes until version 0.3.1
2006-04-23 Christian Seiler <webmaster@christian-seiler.de>
* stringparser_bbcode.class.php:
fixed nasty bug in _findNamedNode(),
fixed really nasty bug that newly occured in 0.3.0
(usecontent? and callback_replace? were swapped)
-- Changes until version 0.3.0
2006-04-23 Christian Seiler <webmaster@christian-seiler.de>
* stringparser.class.php:
corrected several phpdoc comments, made removeChild method
public, fixed nasty bug in removeChild, fixed notice that
occurs in new PHP versions
* stringparser_bbcode.class.php:
corrected several phpdoc comments, added support for mixed
attribute types ([code=foo attr=bar]), added support for
code revalidation on close tag occurrence, added support
for usecontent? the other way round (callback_replace?)
-- Changes until version 0.2.5
2005-08-14 Christian Seiler <webmaster@christian-seiler.de>

View File

@ -1,340 +0,0 @@
GNU GENERAL PUBLIC LICENSE
Version 2, June 1991
Copyright (C) 1989, 1991 Free Software Foundation, Inc.
59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
License is intended to guarantee your freedom to share and change free
software--to make sure the software is free for all its users. This
General Public License applies to most of the Free Software
Foundation's software and to any other program whose authors commit to
using it. (Some other Free Software Foundation software is covered by
the GNU Library General Public License instead.) You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
this service if you wish), that you receive source code or can get it
if you want it, that you can change the software or use pieces of it
in new free programs; and that you know you can do these things.
To protect your rights, we need to make restrictions that forbid
anyone to deny you these rights or to ask you to surrender the rights.
These restrictions translate to certain responsibilities for you if you
distribute copies of the software, or if you modify it.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must give the recipients all the rights that
you have. You must make sure that they, too, receive or can get the
source code. And you must show them these terms so they know their
rights.
We protect your rights with two steps: (1) copyright the software, and
(2) offer you this license which gives you legal permission to copy,
distribute and/or modify the software.
Also, for each author's protection and ours, we want to make certain
that everyone understands that there is no warranty for this free
software. If the software is modified by someone else and passed on, we
want its recipients to know that what they have is not the original, so
that any problems introduced by others will not reflect on the original
authors' reputations.
Finally, any free program is threatened constantly by software
patents. We wish to avoid the danger that redistributors of a free
program will individually obtain patent licenses, in effect making the
program proprietary. To prevent this, we have made it clear that any
patent must be licensed for everyone's free use or not licensed at all.
The precise terms and conditions for copying, distribution and
modification follow.
GNU GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License applies to any program or other work which contains
a notice placed by the copyright holder saying it may be distributed
under the terms of this General Public License. The "Program", below,
refers to any such program or work, and a "work based on the Program"
means either the Program or any derivative work under copyright law:
that is to say, a work containing the Program or a portion of it,
either verbatim or with modifications and/or translated into another
language. (Hereinafter, translation is included without limitation in
the term "modification".) Each licensee is addressed as "you".
Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope. The act of
running the Program is not restricted, and the output from the Program
is covered only if its contents constitute a work based on the
Program (independent of having been made by running the Program).
Whether that is true depends on what the Program does.
1. You may copy and distribute verbatim copies of the Program's
source code as you receive it, in any medium, provided that you
conspicuously and appropriately publish on each copy an appropriate
copyright notice and disclaimer of warranty; keep intact all the
notices that refer to this License and to the absence of any warranty;
and give any other recipients of the Program a copy of this License
along with the Program.
You may charge a fee for the physical act of transferring a copy, and
you may at your option offer warranty protection in exchange for a fee.
2. You may modify your copy or copies of the Program or any portion
of it, thus forming a work based on the Program, and copy and
distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions:
a) You must cause the modified files to carry prominent notices
stating that you changed the files and the date of any change.
b) You must cause any work that you distribute or publish, that in
whole or in part contains or is derived from the Program or any
part thereof, to be licensed as a whole at no charge to all third
parties under the terms of this License.
c) If the modified program normally reads commands interactively
when run, you must cause it, when started running for such
interactive use in the most ordinary way, to print or display an
announcement including an appropriate copyright notice and a
notice that there is no warranty (or else, saying that you provide
a warranty) and that users may redistribute the program under
these conditions, and telling the user how to view a copy of this
License. (Exception: if the Program itself is interactive but
does not normally print such an announcement, your work based on
the Program is not required to print an announcement.)
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Program,
and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works. But when you
distribute the same sections as part of a whole which is a work based
on the Program, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote it.
Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or
collective works based on the Program.
In addition, mere aggregation of another work not based on the Program
with the Program (or with a work based on the Program) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.
3. You may copy and distribute the Program (or a work based on it,
under Section 2) in object code or executable form under the terms of
Sections 1 and 2 above provided that you also do one of the following:
a) Accompany it with the complete corresponding machine-readable
source code, which must be distributed under the terms of Sections
1 and 2 above on a medium customarily used for software interchange; or,
b) Accompany it with a written offer, valid for at least three
years, to give any third party, for a charge no more than your
cost of physically performing source distribution, a complete
machine-readable copy of the corresponding source code, to be
distributed under the terms of Sections 1 and 2 above on a medium
customarily used for software interchange; or,
c) Accompany it with the information you received as to the offer
to distribute corresponding source code. (This alternative is
allowed only for noncommercial distribution and only if you
received the program in object code or executable form with such
an offer, in accord with Subsection b above.)
The source code for a work means the preferred form of the work for
making modifications to it. For an executable work, complete source
code means all the source code for all modules it contains, plus any
associated interface definition files, plus the scripts used to
control compilation and installation of the executable. However, as a
special exception, the source code distributed need not include
anything that is normally distributed (in either source or binary
form) with the major components (compiler, kernel, and so on) of the
operating system on which the executable runs, unless that component
itself accompanies the executable.
If distribution of executable or object code is made by offering
access to copy from a designated place, then offering equivalent
access to copy the source code from the same place counts as
distribution of the source code, even though third parties are not
compelled to copy the source along with the object code.
4. You may not copy, modify, sublicense, or distribute the Program
except as expressly provided under this License. Any attempt
otherwise to copy, modify, sublicense or distribute the Program is
void, and will automatically terminate your rights under this License.
However, parties who have received copies, or rights, from you under
this License will not have their licenses terminated so long as such
parties remain in full compliance.
5. You are not required to accept this License, since you have not
signed it. However, nothing else grants you permission to modify or
distribute the Program or its derivative works. These actions are
prohibited by law if you do not accept this License. Therefore, by
modifying or distributing the Program (or any work based on the
Program), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Program or works based on it.
6. Each time you redistribute the Program (or any work based on the
Program), the recipient automatically receives a license from the
original licensor to copy, distribute or modify the Program subject to
these terms and conditions. You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties to
this License.
7. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot
distribute so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you
may not distribute the Program at all. For example, if a patent
license would not permit royalty-free redistribution of the Program by
all those who receive copies directly or indirectly through you, then
the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Program.
If any portion of this section is held invalid or unenforceable under
any particular circumstance, the balance of the section is intended to
apply and the section as a whole is intended to apply in other
circumstances.
It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system, which is
implemented by public license practices. Many people have made
generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing
to distribute software through any other system and a licensee cannot
impose that choice.
This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.
8. If the distribution and/or use of the Program is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Program under this License
may add an explicit geographical distribution limitation excluding
those countries, so that distribution is permitted only in or among
countries not thus excluded. In such case, this License incorporates
the limitation as if written in the body of this License.
9. The Free Software Foundation may publish revised and/or new versions
of the General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the Program
specifies a version number of this License which applies to it and "any
later version", you have the option of following the terms and conditions
either of that version or of any later version published by the Free
Software Foundation. If the Program does not specify a version number of
this License, you may choose any version ever published by the Free Software
Foundation.
10. If you wish to incorporate parts of the Program into other free
programs whose distribution conditions are different, write to the author
to ask for permission. For software which is copyrighted by the Free
Software Foundation, write to the Free Software Foundation; we sometimes
make exceptions for this. Our decision will be guided by the two goals
of preserving the free status of all derivatives of our free software and
of promoting the sharing and reuse of software generally.
NO WARRANTY
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
REPAIR OR CORRECTION.
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGES.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
convey the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program 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 General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Also add information on how to contact you by electronic and paper mail.
If the program is interactive, make it output a short notice like this
when it starts in an interactive mode:
Gnomovision version 69, Copyright (C) year name of author
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, the commands you use may
be called something other than `show w' and `show c'; they could even be
mouse-clicks or menu items--whatever suits your program.
You should also get your employer (if you work as a programmer) or your
school, if any, to sign a "copyright disclaimer" for the program, if
necessary. Here is a sample; alter the names:
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
`Gnomovision' (which makes passes at compilers) written by James Hacker.
<signature of Ty Coon>, 1 April 1989
Ty Coon, President of Vice
This General Public License does not permit incorporating your program into
proprietary programs. If your program is a subroutine library, you may
consider it more useful to permit linking proprietary applications with the
library. If this is what you want to do, use the GNU Library General
Public License instead of this License.

View File

@ -6,35 +6,33 @@
* memory structure. It would e.g. be possible to create an HTML parser based
* upon this class.
*
* Preview Version (20060220)
* Version: 0.3.3
*
* @author Christian Seiler <spam@christian-seiler.de>
* @copyright Christian Seiler 2005
* @copyright Christian Seiler 2004-2008
* @package stringparser
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of either:
* The MIT License
*
* a) the GNU General Public License as published by the Free
* Software Foundation; either version 1, or (at your option) any
* later version, or
* Copyright (c) 2004-2009 Christian Seiler
*
* b) the Artistic License as published by Larry Wall, either version 2.0,
* or (at your option) any later version.
* 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:
*
* This program 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 either
* the GNU General Public License or the Artistic License for more details.
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* You should have received a copy of the Artistic License with this Kit,
* in the file named "Artistic.clarified". If not, I'll be glad to provide
* one.
*
* You should also have received a copy of the GNU General Public License
* along with this program in the file named "COPYING"; if not, write to
* the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston,
* MA 02111-1307, USA.
* 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.
*/
/**
@ -81,7 +79,7 @@ class StringParser {
* The subclass that does the string parsing itself will define which
* mode it will implement.
*
* @access private
* @access protected
* @var int
* @see STRINGPARSER_MODE_SEARCH, STRINGPARSER_MODE_LOOP
*/
@ -89,35 +87,35 @@ class StringParser {
/**
* Raw text
* @access private
* @access protected
* @var string
*/
var $_text = '';
/**
* Parse stack
* @access private
* @access protected
* @var array
*/
var $_stack = array ();
/**
* Current position in raw text
* @access private
* @access protected
* @var integer
*/
var $_cpos = -1;
/**
* Root node
* @access private
* @access protected
* @var mixed
*/
var $_root = null;
/**
* Length of the text
* @access private
* @access protected
* @var integer
*/
var $_length = -1;
@ -128,7 +126,7 @@ class StringParser {
* This flag is to prevent recursive calls to the parse() function that
* would cause very nasty things.
*
* @access private
* @access protected
* @var boolean
*/
var $_parsing = false;
@ -145,7 +143,7 @@ class StringParser {
/**
* Characters or strings to look for
* @access private
* @access protected
* @var array
*/
var $_charactersSearch = array ();
@ -163,35 +161,35 @@ class StringParser {
* allowed is encountered. If not in strict mode, the character is
* simply ignored.
*
* @access private
* @access protected
* @var array
*/
var $_charactersAllowed = array ();
/**
* Current parser status
* @access private
* @access protected
* @var int
*/
var $_status = 0;
/**
* Prefilters
* @access private
* @access protected
* @var array
*/
var $_prefilters = array ();
/**
* Postfilters
* @access private
* @access protected
* @var array
*/
var $_postfilters = array ();
/**
* Recently reparsed?
* @access private
* @access protected
* @var bool
*/
var $_recentlyReparsed = false;
@ -284,8 +282,8 @@ class StringParser {
StringParser_Node::destroyNode ($this->_root);
}
unset ($this->_root);
$this->_root =& new StringParser_Node_Root ();
$this->_stack[0] =& $this->_root;
$this->_root = new StringParser_Node_Root ();
$this->_stack[0] = $this->_root;
$this->_parserInit ();
@ -344,7 +342,7 @@ class StringParser {
}
if (is_null ($this->_output)) {
$root =& $this->_root;
$root = $this->_root;
unset ($this->_root);
$this->_root = null;
while (count ($this->_stack)) {
@ -409,7 +407,7 @@ class StringParser {
/**
* Abstract method: Manipulate the tree
* @access private
* @access protected
* @return bool
*/
function _modifyTree () {
@ -418,7 +416,7 @@ class StringParser {
/**
* Abstract method: Output tree
* @access private
* @access protected
* @return bool
*/
function _outputTree () {
@ -440,9 +438,9 @@ class StringParser {
if (($stack_count = count ($this->_stack)) < 2) {
return false;
}
$topelem =& $this->_stack[$stack_count-1];
$topelem = $this->_stack[$stack_count-1];
$node_parent =& $topelem->_parent;
$node_parent = $topelem->_parent;
// remove the child from the tree
$res = $node_parent->removeChild ($topelem, false);
if (!$res) {
@ -474,7 +472,7 @@ class StringParser {
/**
* Abstract method: Close remaining blocks
* @access private
* @access protected
*/
function _closeRemainingBlocks () {
// everything closed
@ -496,7 +494,7 @@ class StringParser {
/**
* Abstract method: Initialize the parser
* @access private
* @access protected
*/
function _parserInit () {
$this->_setStatus (0);
@ -504,7 +502,7 @@ class StringParser {
/**
* Abstract method: Set a specific status
* @access private
* @access protected
*/
function _setStatus ($status) {
if ($status != 0) {
@ -518,7 +516,7 @@ class StringParser {
/**
* Abstract method: Handle status
* @access private
* @access protected
* @param int $status The current status
* @param string $needle The needle that was found
* @return bool
@ -531,7 +529,7 @@ class StringParser {
/**
* Search mode loop
* @access private
* @access protected
* @return bool
*/
function _searchLoop () {
@ -566,7 +564,7 @@ class StringParser {
}
$this->_cpos = $offset;
$res = $this->_handleStatus ($this->_status, $needle);
if (!$res && $strict) {
if (!$res && $this->strict) {
return false;
}
if (!$res) {
@ -599,7 +597,7 @@ class StringParser {
/**
* Loop mode loop
*
* @access private
* @access protected
* @return bool
*/
function _loop () {
@ -660,7 +658,7 @@ class StringParser {
/**
* Abstract method Append text depending on current status
* @access private
* @access protected
* @param string $text The text to append
* @return bool On success, the function returns true, else false
*/
@ -674,7 +672,7 @@ class StringParser {
/**
* Append text to last text child of current top parser stack node
* @access private
* @access protected
* @param string $text The text to append
* @return bool On success, the function returns true, else false
*/
@ -696,7 +694,7 @@ class StringParser {
* element is <code>false</code> and the <code>'offset'</code> element
* is <code>-1</code>.
*
* @access private
* @access protected
* @param array $needles
* @param int $offset
* @return array
@ -722,7 +720,7 @@ class StringParser {
/**
* Detects a string at the current position
*
* @access private
* @access protected
* @param array $needles The strings that are to be detected
* @param int $offset The current offset
* @return mixed The string that was detected or the needle
@ -741,25 +739,25 @@ class StringParser {
/**
* Adds a node to the current parse stack
*
* @access private
* @access protected
* @param object $node The node that is to be added
* @return bool True on success, else false.
* @see StringParser_Node, StringParser::_stack
*/
function _pushNode (&$node) {
$stack_count = count ($this->_stack);
$max_node =& $this->_stack[$stack_count-1];
$max_node = $this->_stack[$stack_count-1];
if (!$max_node->appendChild ($node)) {
return false;
}
$this->_stack[$stack_count] =& $node;
$this->_stack[$stack_count] = $node;
return true;
}
/**
* Removes a node from the current parse stack
*
* @access private
* @access protected
* @return bool True on success, else false.
* @see StringParser_Node, StringParser::_stack
*/
@ -772,7 +770,7 @@ class StringParser {
/**
* Execute a method on the top element
*
* @access private
* @access protected
* @return mixed
*/
function _topNode () {
@ -792,7 +790,7 @@ class StringParser {
/**
* Get a variable of the top element
*
* @access private
* @access protected
* @return mixed
*/
function _topNodeVar ($var) {
@ -845,7 +843,7 @@ class StringParser_Node {
* node. All node types are integer constants. Any node type of a
* subclass must be at least 32 to allow future developements.
*
* @access private
* @access protected
* @var int
* @see STRINGPARSER_NODE_ROOT, STRINGPARSER_NODE_TEXT
* @see STRINGPARSER_NODE_UNKNOWN
@ -861,7 +859,7 @@ class StringParser_Node {
* subclasses and especially not in external data structures. This ID
* has nothing to do with any type of ID in HTML oder XML.
*
* @access private
* @access protected
* @var int
* @see StringParser_Node::_children
*/
@ -872,7 +870,7 @@ class StringParser_Node {
*
* It is either null (root node) or a reference to the parent object.
*
* @access private
* @access protected
* @var mixed
* @see StringParser_Node::_children
*/
@ -884,7 +882,7 @@ class StringParser_Node {
* It contains an array of references to all the children nodes of this
* node.
*
* @access private
* @access protected
* @var array
* @see StringParser_Node::_parent
*/
@ -949,8 +947,8 @@ class StringParser_Node {
// if node already has a parent
if ($node->_parent !== false) {
// remove node from there
$parent =& $node->_parent;
if (!$parent->_removeChild ($node, false)) {
$parent = $node->_parent;
if (!$parent->removeChild ($node, false)) {
return false;
}
unset ($parent);
@ -960,15 +958,15 @@ class StringParser_Node {
// move all nodes to a new index
while ($index >= 0) {
// save object
$object =& $this->_children[$index];
$object = $this->_children[$index];
// we have to unset it because else it will be
// overridden in in the loop
unset ($this->_children[$index]);
// put object to new position
$this->_children[$index+1] =& $object;
$this->_children[$index+1] = $object;
$index--;
}
$this->_children[0] =& $node;
$this->_children[0] = $node;
return true;
}
@ -981,7 +979,7 @@ class StringParser_Node {
function appendToLastTextChild ($text) {
$ccount = count ($this->_children);
if ($ccount == 0 || $this->_children[$ccount-1]->_type != STRINGPARSER_NODE_TEXT) {
$ntextnode =& new StringParser_Node_Text ($text);
$ntextnode = new StringParser_Node_Text ($text);
return $this->appendChild ($ntextnode);
} else {
$this->_children[$ccount-1]->appendText ($text);
@ -1013,7 +1011,7 @@ class StringParser_Node {
// if node already has a parent
if ($node->_parent !== null) {
// remove node from there
$parent =& $node->_parent;
$parent = $node->_parent;
if (!$parent->removeChild ($node, false)) {
return false;
}
@ -1022,8 +1020,8 @@ class StringParser_Node {
// append it to current node
$new_index = count ($this->_children);
$this->_children[$new_index] =& $node;
$node->_parent =& $this;
$this->_children[$new_index] = $node;
$node->_parent = $this;
return true;
}
@ -1056,8 +1054,8 @@ class StringParser_Node {
// if node already has a parent
if ($node->_parent !== null) {
// remove node from there
$parent =& $node->_parent;
if (!$parent->_removeChild ($node, false)) {
$parent = $node->_parent;
if (!$parent->removeChild ($node, false)) {
return false;
}
unset ($parent);
@ -1067,15 +1065,15 @@ class StringParser_Node {
// move all nodes to a new index
while ($index >= $child) {
// save object
$object =& $this->_children[$index];
$object = $this->_children[$index];
// we have to unset it because else it will be
// overridden in in the loop
unset ($this->_children[$index]);
// put object to new position
$this->_children[$index+1] =& $object;
$this->_children[$index+1] = $object;
$index--;
}
$this->_children[$child] =& $node;
$this->_children[$child] = $node;
return true;
}
@ -1108,8 +1106,8 @@ class StringParser_Node {
// if node already has a parent
if ($node->_parent !== false) {
// remove node from there
$parent =& $node->_parent;
if (!$parent->_removeChild ($node, false)) {
$parent = $node->_parent;
if (!$parent->removeChild ($node, false)) {
return false;
}
unset ($parent);
@ -1119,15 +1117,15 @@ class StringParser_Node {
// move all nodes to a new index
while ($index >= $child + 1) {
// save object
$object =& $this->_children[$index];
$object = $this->_children[$index];
// we have to unset it because else it will be
// overridden in in the loop
unset ($this->_children[$index]);
// put object to new position
$this->_children[$index+1] =& $object;
$this->_children[$index+1] = $object;
$index--;
}
$this->_children[$child + 1] =& $node;
$this->_children[$child + 1] = $node;
return true;
}
@ -1149,15 +1147,23 @@ class StringParser_Node {
function removeChild (&$child, $destroy = false) {
if (is_object ($child)) {
// if object: get index
$object =& $child;
$object = $child;
unset ($child);
$child = $this->_findChild ($object);
if ($child === false) {
return false;
}
} else {
// remove reference on $child
$save = $child;
unset($child);
$child = $save;
// else: get object
$object =& $this->_children[$child];
if (!isset($this->_children[$child])) {
return false;
}
$object = $this->_children[$child];
}
// store count for later use
@ -1183,17 +1189,16 @@ class StringParser_Node {
// we have to unset it because else it will be overridden in
// in the loop
unset ($this->_children[$child]);
unset ($obj);
// move all remaining objects one index higher
while ($child < $ccount - 1) {
// save object
$obj =& $this->_children[$child+1];
$obj = $this->_children[$child+1];
// we have to unset it because else it will be
// overridden in in the loop
unset ($this->_children[$child+1]);
// put object to new position
$this->_children[$child] =& $obj;
$this->_children[$child] = $obj;
// UNSET THE OBJECT!
unset ($obj);
$child++;
@ -1201,6 +1206,7 @@ class StringParser_Node {
if ($destroy) {
return StringParser_Node::destroyNode ($object);
unset ($object);
}
return true;
}
@ -1243,9 +1249,12 @@ class StringParser_Node {
* @return bool True on success, else false.
*/
function destroyNode (&$node) {
if ($node === null) {
return false;
}
// if parent exists: remove node from tree!
if ($node->_parent !== null) {
$parent =& $node->_parent;
$parent = $node->_parent;
// directly return that result because the removeChild
// method will call destroyNode again
return $parent->removeChild ($node, true);
@ -1258,6 +1267,7 @@ class StringParser_Node {
if (!$node->removeChild ($child, true)) {
return false;
}
unset($child);
}
// now call the nodes destructor
@ -1276,7 +1286,7 @@ class StringParser_Node {
* Destroy this node
*
*
* @access private
* @access protected
* @return bool True on success, else false.
*/
function _destroy () {
@ -1290,7 +1300,7 @@ class StringParser_Node {
* the index of the node or false if the node is not a child of this
* node.
*
* @access private
* @access protected
* @param mixed $child The node to look for.
* @return mixed The index of the child node on success, else false.
*/
@ -1347,13 +1357,13 @@ class StringParser_Node {
$node_ctr = 0;
for ($i = 0; $i < count ($this->_children); $i++) {
if ($this->_children[$i]->matchesCriterium ($criterium, $value)) {
$nodes[$node_ctr++] =& $this->_children[$i];
$nodes[$node_ctr++] = $this->_children[$i];
}
$subnodes = $this->_children[$i]->getNodesByCriterium ($criterium, $value);
if (count ($subnodes)) {
$subnodes_count = count ($subnodes);
for ($j = 0; $j < $subnodes_count; $j++) {
$nodes[$node_ctr++] =& $subnodes[$j];
$nodes[$node_ctr++] = $subnodes[$j];
unset ($subnodes[$j]);
}
}
@ -1428,7 +1438,7 @@ class StringParser_Node_Root extends StringParser_Node {
*
* This node is a root node.
*
* @access private
* @access protected
* @var int
* @see STRINGPARSER_NODE_ROOT
*/
@ -1446,7 +1456,7 @@ class StringParser_Node_Text extends StringParser_Node {
*
* This node is a text node.
*
* @access private
* @access protected
* @var int
* @see STRINGPARSER_NODE_TEXT
*/
@ -1455,7 +1465,7 @@ class StringParser_Node_Text extends StringParser_Node {
/**
* Node flags
*
* @access private
* @access protected
* @var array
*/
var $_flags = array ();
@ -1531,4 +1541,4 @@ class StringParser_Node_Text extends StringParser_Node {
}
}
?>
?>

View File

@ -2,35 +2,33 @@
/**
* BB code string parsing class
*
* Preview Version (20060220)
* Version: 0.3.3
*
* @author Christian Seiler <spam@christian-seiler.de>
* @copyright Christian Seiler 2005
* @copyright Christian Seiler 2004-2008
* @package stringparser
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of either:
* The MIT License
*
* a) the GNU General Public License as published by the Free
* Software Foundation; either version 1, or (at your option) any
* later version, or
* Copyright (c) 2004-2008 Christian Seiler
*
* b) the Artistic License as published by Larry Wall, either version 2.0,
* or (at your option) any later version.
* 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:
*
* This program 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 either
* the GNU General Public License or the Artistic License for more details.
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* You should have received a copy of the Artistic License with this Kit,
* in the file named "Artistic.clarified". If not, I'll be glad to provide
* one.
*
* You should also have received a copy of the GNU General Public License
* along with this program in the file named "COPYING"; if not, write to
* the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston,
* MA 02111-1307, USA.
* 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.
*/
require_once dirname(__FILE__).'/stringparser.class.php';
@ -60,7 +58,7 @@ class StringParser_BBCode extends StringParser {
*
* The BBCode string parser works in search mode
*
* @access private
* @access protected
* @var int
* @see STRINGPARSER_MODE_SEARCH, STRINGPARSER_MODE_LOOP
*/
@ -71,7 +69,7 @@ class StringParser_BBCode extends StringParser {
*
* The registered BB codes
*
* @access private
* @access protected
* @var array
*/
var $_codes = array ();
@ -79,7 +77,7 @@ class StringParser_BBCode extends StringParser {
/**
* Registered parsers
*
* @access private
* @access protected
* @var array
*/
var $_parsers = array ();
@ -119,14 +117,14 @@ class StringParser_BBCode extends StringParser {
/**
* Root paragraph handling enabled
*
* @access private
* @access protected
* @var bool
*/
var $_rootParagraphHandling = false;
/**
* Paragraph handling parameters
* @access private
* @access protected
* @var array
*/
var $_paragraphHandling = array (
@ -142,6 +140,13 @@ class StringParser_BBCode extends StringParser {
*/
var $_mixedAttributeTypes = false;
/**
* Whether to call validation function again (with $action == 'validate_auto') when closetag comes
* @access protected
* @var bool
*/
var $_validateAgain = false;
/**
* Add a code
*
@ -159,7 +164,7 @@ class StringParser_BBCode extends StringParser {
if (isset ($this->_codes[$name])) {
return false; // already exists
}
if (!preg_match ('/^[a-zA-Z0-9*_!+-]+$/', $name, $code)) {
if (!preg_match ('/^[a-zA-Z0-9*_!+-]+$/', $name)) {
return false; // invalid
}
$this->_codes[$name] = array (
@ -359,6 +364,29 @@ class StringParser_BBCode extends StringParser {
return $this->_mixedAttributeTypes;
}
/**
* Set validate again flag
*
* If this is set to true, the class calls the validation function
* again with $action == 'validate_again' when closetag comes.
*
* @access public
* @param bool $validateAgain
*/
function setValidateAgain ($validateAgain) {
$this->_validateAgain = (bool)$validateAgain;
}
/**
* Get validate again flag
*
* @access public
* @return bool
*/
function validateAgain () {
return $this->_validateAgain;
}
/**
* Get a code flag
*
@ -385,7 +413,7 @@ class StringParser_BBCode extends StringParser {
/**
* Set a specific status
* @access private
* @access protected
*/
function _setStatus ($status) {
switch ($status) {
@ -449,7 +477,7 @@ class StringParser_BBCode extends StringParser {
/**
* Abstract method Append text depending on current status
* @access private
* @access protected
* @param string $text The text to append
* @return bool On success, the function returns true, else false
*/
@ -523,7 +551,7 @@ class StringParser_BBCode extends StringParser {
/**
* Handle status
* @access private
* @access protected
* @param int $status The current status
* @param string $needle The needle that was found
* @return bool
@ -536,7 +564,7 @@ class StringParser_BBCode extends StringParser {
return true;
}
if ($needle == '[') {
$node =& new StringParser_BBCode_Node_Element ($this->_cpos);
$node = new StringParser_BBCode_Node_Element ($this->_cpos);
$res = $this->_pushNode ($node);
if (!$res) {
return false;
@ -568,7 +596,7 @@ class StringParser_BBCode extends StringParser {
$this->_appendText ($needle);
return true;
}
break;
// break not necessary because every if clause contains return
case 2: // CLOSE TAG
if ($needle != ']') {
$this->_appendText ($needle);
@ -580,6 +608,14 @@ class StringParser_BBCode extends StringParser {
$this->_appendText ('[/'.$this->_savedName.$needle);
return true;
}
// this validates the code(s) to be closed after the content tree of
// that code(s) are built - if the second validation fails, we will have
// to reparse. note that as _reparseAfterCurrentBlock will not work correctly
// if we're in $status == 2, we will have to set our status to 0 manually
if (!$this->_validateCloseTags ($closecount)) {
$this->_setStatus (0);
return $this->_reparseAfterCurrentBlock ();
}
$this->_setStatus (0);
for ($i = 0; $i < $closecount; $i++) {
if ($i == $closecount - 1) {
@ -621,7 +657,7 @@ class StringParser_BBCode extends StringParser {
return true;
}
}
break;
// break not needed because every if clause contains return!
case 4: // ATTRIBUTE NAME
if ($needle == ' ') {
if (strlen ($this->_savedName)) {
@ -651,7 +687,7 @@ class StringParser_BBCode extends StringParser {
$this->_appendText ($needle);
return true;
}
break;
// break not needed because every if clause contains return!
case 5: // ATTRIBUTE VALUE
if ($this->_quoting !== null) {
if ($needle == '\\\\') {
@ -687,7 +723,7 @@ class StringParser_BBCode extends StringParser {
return true;
}
}
break;
// break not needed because every if clause contains return!
case 7:
if ($needle == '[/') {
// this was case insensitive match
@ -707,7 +743,7 @@ class StringParser_BBCode extends StringParser {
// do we have to close subnodes?
if ($closecount) {
// get top node
$mynode =& $this->_stack[count ($this->_stack)-1];
$mynode = $this->_stack[count ($this->_stack)-1];
// close necessary nodes
for ($i = 0; $i <= $closecount; $i++) {
if (!$this->_popNode ()) {
@ -730,17 +766,13 @@ class StringParser_BBCode extends StringParser {
/**
* Open the next element
*
* @access private
* @access protected
* @return bool
*/
function _openElement ($type = 0) {
$name = $this->_topNode ('name');
if (!isset ($this->_codes[$name])) {
if (isset ($this->_codes[strtolower ($name)]) && (!$this->getCodeFlag (strtolower ($name), 'case_sensitive', 'boolean', true) || !$this->_caseSensitive)) {
$name = strtolower ($name);
} else {
return $this->_reparseAfterCurrentBlock ();
}
$name = $this->_getCanonicalName ($this->_topNode ('name'));
if ($name === false) {
return $this->_reparseAfterCurrentBlock ();
}
$occ_type = $this->getCodeFlag ($name, 'occurrence_type', 'string');
if ($occ_type !== null && isset ($this->_maxOccurrences[$occ_type])) {
@ -781,7 +813,7 @@ class StringParser_BBCode extends StringParser {
// do we have to close subnodes?
if ($closecount) {
// get top node
$mynode =& $this->_stack[count ($this->_stack)-1];
$mynode = $this->_stack[count ($this->_stack)-1];
// close necessary nodes
for ($i = 0; $i <= $closecount; $i++) {
if (!$this->_popNode ()) {
@ -805,11 +837,11 @@ class StringParser_BBCode extends StringParser {
/**
* Is a node closeable?
*
* @access private
* @access protected
* @return bool
*/
function _isCloseable ($name, &$closecount) {
$node =& $this->_findNamedNode ($name, false);
$node = $this->_findNamedNode ($name, false);
if ($node === false) {
return false;
}
@ -826,10 +858,28 @@ class StringParser_BBCode extends StringParser {
return false;
}
/**
* Revalidate codes when close tags appear
*
* @access protected
* @return bool
*/
function _validateCloseTags ($closecount) {
$scount = count ($this->_stack);
for ($i = $scount - 1; $i >= $scount - $closecount; $i--) {
if ($this->_validateAgain) {
if (!$this->_stack[$i]->validate ('validate_again')) {
return false;
}
}
}
return true;
}
/**
* Is a node openable?
*
* @access private
* @access protected
* @return bool
*/
function _isOpenable ($name, &$closecount) {
@ -865,18 +915,15 @@ class StringParser_BBCode extends StringParser {
/**
* Is a node openable by closing other nodes?
*
* @access private
* @access protected
* @return bool
*/
function _isOpenableWithClose ($name, &$closecount) {
$tnname = $this->_topNode ('name');
if (isset ($this->_codes[strtolower($tnname)]) && (!$this->getCodeFlag (strtolower($tnname), 'case_sensitive', 'boolean', true) || !$this->_caseSensitive)) {
$tnname = strtolower($tnname);
}
$tnname = $this->_getCanonicalName ($this->_topNode ('name'));
if (!in_array ($this->getCodeFlag ($tnname, 'closetag', 'integer', BBCODE_CLOSETAG_IMPLICIT), array (BBCODE_CLOSETAG_FORBIDDEN, BBCODE_CLOSETAG_OPTIONAL))) {
return false;
}
$node =& $this->_findNamedNode ($name, true);
$node = $this->_findNamedNode ($name, true);
if ($node === false) {
return false;
}
@ -892,6 +939,11 @@ class StringParser_BBCode extends StringParser {
if (in_array ($this->_stack[$i]->getFlag ('closetag', 'integer', BBCODE_CLOSETAG_IMPLICIT), array (BBCODE_CLOSETAG_IMPLICIT_ON_CLOSE_ONLY, BBCODE_CLOSETAG_MUSTEXIST))) {
return false;
}
if ($this->_validateAgain) {
if (!$this->_stack[$i]->validate ('validate_again')) {
return false;
}
}
}
return false;
@ -899,7 +951,7 @@ class StringParser_BBCode extends StringParser {
/**
* Abstract method: Close remaining blocks
* @access private
* @access protected
*/
function _closeRemainingBlocks () {
// everything closed
@ -925,16 +977,14 @@ class StringParser_BBCode extends StringParser {
/**
* Find a node with a specific name in stack
*
* @access private
* @access protected
* @return mixed
*/
function &_findNamedNode ($name, $searchdeeper = false) {
$lname = strtolower ($name);
if (isset ($this->_codes[$lname]) && (!$this->getCodeFlag ($lname, 'case_sensitive', 'boolean', true) || !$this->_caseSensitive)) {
$name = $lname;
$case_sensitive = false;
} else {
$case_sensitive = true;
$lname = $this->_getCanonicalName ($name);
$case_sensitive = $this->_caseSensitive && $this->getCodeFlag ($lname, 'case_sensitive', 'boolean', true);
if ($case_sensitive) {
$name = strtolower ($name);
}
$scount = count ($this->_stack);
if ($searchdeeper) {
@ -946,17 +996,17 @@ class StringParser_BBCode extends StringParser {
} else {
$cmp_name = $this->_stack[$i]->name ();
}
if ($cmp_name == $name) {
if ($cmp_name == $lname) {
return $this->_stack[$i];
}
}
$false = false; // workaround for notice
return $false;
$result = false;
return $result;
}
/**
* Abstract method: Output tree
* @access private
* @access protected
* @return bool
*/
function _outputTree () {
@ -975,7 +1025,7 @@ class StringParser_BBCode extends StringParser {
/**
* Output a node
* @access private
* @access protected
* @return bool
*/
function _outputNode (&$node) {
@ -1032,9 +1082,9 @@ class StringParser_BBCode extends StringParser {
return $before.$output.$after;
}
if ($node->_parent->_type == STRINGPARSER_BBCODE_NODE_PARAGRAPH) {
$parent =& $node->_parent;
$parent = $node->_parent;
unset ($node);
$node =& $parent;
$node = $parent;
unset ($parent);
// if no parent for this paragraph
if ($node->_parent === null) {
@ -1053,17 +1103,17 @@ class StringParser_BBCode extends StringParser {
/**
* Abstract method: Manipulate the tree
* @access private
* @access protected
* @return bool
*/
function _modifyTree () {
// first pass: try to do newline handling
$nodes =& $this->_root->getNodesByCriterium ('needsTextNodeModification', true);
$nodes = $this->_root->getNodesByCriterium ('needsTextNodeModification', true);
$nodes_count = count ($nodes);
for ($i = 0; $i < $nodes_count; $i++) {
$v = $nodes[$i]->getFlag ('opentag.before.newline', 'integer', BBCODE_NEWLINE_PARSE);
if ($v != BBCODE_NEWLINE_PARSE) {
$n =& $nodes[$i]->findPrevAdjentTextNode ();
$n = $nodes[$i]->findPrevAdjentTextNode ();
if (!is_null ($n)) {
$n->setFlag ('newlinemode.end', $v);
}
@ -1071,7 +1121,7 @@ class StringParser_BBCode extends StringParser {
}
$v = $nodes[$i]->getFlag ('opentag.after.newline', 'integer', BBCODE_NEWLINE_PARSE);
if ($v != BBCODE_NEWLINE_PARSE) {
$n =& $nodes[$i]->firstChildIfText ();
$n = $nodes[$i]->firstChildIfText ();
if (!is_null ($n)) {
$n->setFlag ('newlinemode.begin', $v);
}
@ -1079,7 +1129,7 @@ class StringParser_BBCode extends StringParser {
}
$v = $nodes[$i]->getFlag ('closetag.before.newline', 'integer', BBCODE_NEWLINE_PARSE);
if ($v != BBCODE_NEWLINE_PARSE) {
$n =& $nodes[$i]->lastChildIfText ();
$n = $nodes[$i]->lastChildIfText ();
if (!is_null ($n)) {
$n->setFlag ('newlinemode.end', $v);
}
@ -1087,7 +1137,7 @@ class StringParser_BBCode extends StringParser {
}
$v = $nodes[$i]->getFlag ('closetag.after.newline', 'integer', BBCODE_NEWLINE_PARSE);
if ($v != BBCODE_NEWLINE_PARSE) {
$n =& $nodes[$i]->findNextAdjentTextNode ();
$n = $nodes[$i]->findNextAdjentTextNode ();
if (!is_null ($n)) {
$n->setFlag ('newlinemode.begin', $v);
}
@ -1105,7 +1155,7 @@ class StringParser_BBCode extends StringParser {
// second pass b: do paragraph handling on other elements
unset ($nodes);
$nodes =& $this->_root->getNodesByCriterium ('flag:paragraphs', true);
$nodes = $this->_root->getNodesByCriterium ('flag:paragraphs', true);
$nodes_count = count ($nodes);
for ($i = 0; $i < $nodes_count; $i++) {
$res = $this->_handleParagraphs ($nodes[$i]);
@ -1116,7 +1166,7 @@ class StringParser_BBCode extends StringParser {
// second pass c: search for empty paragraph nodes and remove them
unset ($nodes);
$nodes =& $this->_root->getNodesByCriterium ('empty', true);
$nodes = $this->_root->getNodesByCriterium ('empty', true);
$nodes_count = count ($nodes);
if (isset ($parent)) {
unset ($parent); $parent = null;
@ -1126,7 +1176,7 @@ class StringParser_BBCode extends StringParser {
continue;
}
unset ($parent);
$parent =& $nodes[$i]->_parent;
$parent = $nodes[$i]->_parent;
$parent->removeChild ($nodes[$i], true);
}
@ -1135,7 +1185,7 @@ class StringParser_BBCode extends StringParser {
/**
* Handle paragraphs
* @access private
* @access protected
* @param object $node The node to handle
* @return bool
*/
@ -1150,25 +1200,25 @@ class StringParser_BBCode extends StringParser {
$prevtype = STRINGPARSER_NODE_TEXT;
$paragraph = null;
while (count ($node->_children)) {
$mynode =& $node->_children[0];
$mynode = $node->_children[0];
$node->removeChild ($mynode);
$subprevtype = $prevtype;
$sub_nodes =& $this->_breakupNodeByParagraphs ($mynode);
$sub_nodes = $this->_breakupNodeByParagraphs ($mynode);
for ($i = 0; $i < count ($sub_nodes); $i++) {
if (!$last_node_was_paragraph || ($prevtype == $sub_nodes[$i]->_type && ($i != 0 || $prevtype != STRINGPARSER_BBCODE_NODE_ELEMENT))) {
unset ($paragraph);
$paragraph =& new StringParser_BBCode_Node_Paragraph ();
$paragraph = new StringParser_BBCode_Node_Paragraph ();
}
$prevtype = $sub_nodes[$i]->_type;
if ($sub_nodes[$i]->_type != STRINGPARSER_BBCODE_NODE_ELEMENT || $sub_nodes[$i]->getFlag ('paragraph_type', 'integer', BBCODE_PARAGRAPH_ALLOW_BREAKUP) != BBCODE_PARAGRAPH_BLOCK_ELEMENT) {
$paragraph->appendChild ($sub_nodes[$i]);
$dest_nodes[] =& $paragraph;
$dest_nodes[] = $paragraph;
$last_node_was_paragraph = true;
} else {
$dest_nodes[] =& $sub_nodes[$i];
$dest_nodes[] = $sub_nodes[$i];
$last_onde_was_paragraph = false;
unset ($paragraph);
$paragraph =& new StringParser_BBCode_Node_Paragraph ();
$paragraph = new StringParser_BBCode_Node_Paragraph ();
}
}
}
@ -1183,7 +1233,7 @@ class StringParser_BBCode extends StringParser {
/**
* Search for a paragraph node in tree in upward direction
* @access private
* @access protected
* @param object $node The node to analyze
* @return bool
*/
@ -1191,7 +1241,7 @@ class StringParser_BBCode extends StringParser {
if ($node->_parent === null) {
return false;
}
$parent =& $node->_parent;
$parent = $node->_parent;
if ($parent->_type == STRINGPARSER_BBCODE_NODE_PARAGRAPH) {
return true;
}
@ -1200,7 +1250,7 @@ class StringParser_BBCode extends StringParser {
/**
* Break up nodes
* @access private
* @access protected
* @param object $node The node to break up
* @return array
*/
@ -1211,7 +1261,7 @@ class StringParser_BBCode extends StringParser {
if ($node->_type == STRINGPARSER_NODE_TEXT) {
$cpos = 0;
while (($npos = strpos ($node->content, $detect_string, $cpos)) !== false) {
$subnode =& new StringParser_Node_Text (substr ($node->content, $cpos, $npos - $cpos), $node->occurredAt + $cpos);
$subnode = new StringParser_Node_Text (substr ($node->content, $cpos, $npos - $cpos), $node->occurredAt + $cpos);
// copy flags
foreach ($node->_flags as $flag => $value) {
if ($flag == 'newlinemode.begin') {
@ -1224,11 +1274,11 @@ class StringParser_BBCode extends StringParser {
$subnode->setFlag ($flag, $value);
}
}
$dest_nodes[] =& $subnode;
$dest_nodes[] = $subnode;
unset ($subnode);
$cpos = $npos + strlen ($detect_string);
}
$subnode =& new StringParser_Node_Text (substr ($node->content, $cpos), $node->occurredAt + $cpos);
$subnode = new StringParser_Node_Text (substr ($node->content, $cpos), $node->occurredAt + $cpos);
if ($cpos == 0) {
$value = $node->getFlag ('newlinemode.begin', 'integer', null);
if ($value !== null) {
@ -1239,72 +1289,105 @@ class StringParser_BBCode extends StringParser {
if ($value !== null) {
$subnode->setFlag ('newlinemode.end', $value);
}
$dest_nodes[] =& $subnode;
$dest_nodes[] = $subnode;
unset ($subnode);
return $dest_nodes;
}
// not a text node or an element node => no way
if ($node->_type != STRINGPARSER_BBCODE_NODE_ELEMENT) {
$dest_nodes[] =& $node;
$dest_nodes[] = $node;
return $dest_nodes;
}
if ($node->getFlag ('paragraph_type', 'integer', BBCODE_PARAGRAPH_ALLOW_BREAKUP) != BBCODE_PARAGRAPH_ALLOW_BREAKUP || !count ($node->_children)) {
$dest_nodes[] =& $node;
$dest_nodes[] = $node;
return $dest_nodes;
}
$dest_node =& $node->duplicate ();
$dest_node = $node->duplicate ();
$nodecount = count ($node->_children);
// now this node allows breakup - do it
for ($i = 0; $i < $nodecount; $i++) {
$firstnode =& $node->_children[0];
$firstnode = $node->_children[0];
$node->removeChild ($firstnode);
$sub_nodes =& $this->_breakupNodeByParagraphs ($firstnode);
$sub_nodes = $this->_breakupNodeByParagraphs ($firstnode);
for ($j = 0; $j < count ($sub_nodes); $j++) {
if ($j != 0) {
$dest_nodes[] =& $dest_node;
$dest_nodes[] = $dest_node;
unset ($dest_node);
$dest_node =& $node->duplicate ();
$dest_node = $node->duplicate ();
}
$dest_node->appendChild ($sub_nodes[$j]);
}
unset ($sub_nodes);
}
$dest_nodes[] =& $dest_node;
$dest_nodes[] = $dest_node;
return $dest_nodes;
}
/**
* Is this node a usecontent node
* @access private
* @access protected
* @param object $node The node to check
* @param bool $check_attrs Also check whether 'usecontent?'-attributes exist
* @return bool
*/
function _isUseContent (&$node, $check_attrs = false) {
$name = strtolower($node->name ());
$name = $this->_getCanonicalName ($node->name ());
// this should NOT happen
if ($name === false) {
return false;
}
if ($this->_codes[$name]['callback_type'] == 'usecontent') {
return true;
}
if ($this->_codes[$name]['callback_type'] != 'usecontent?') {
$result = false;
if ($this->_codes[$name]['callback_type'] == 'callback_replace?') {
$result = true;
} else if ($this->_codes[$name]['callback_type'] != 'usecontent?') {
return false;
}
if ($check_attrs === false) {
return true;
return !$result;
}
$attributes = array_keys ($this->_topNodeVar ('_attributes'));
$p = @$this->_codes[$name]['callback_params']['usecontent_param'];
if (is_array ($p)) {
foreach ($p as $param) {
if (in_array ($param, $attributes)) {
return false;
return $result;
}
}
} else {
if (in_array ($p, $attributes)) {
return false;
return $result;
}
}
return true;
return !$result;
}
/**
* Get canonical name of a code
*
* @access protected
* @param string $name
* @return string
*/
function _getCanonicalName ($name) {
if (isset ($this->_codes[$name])) {
return $name;
}
$found = false;
// try to find the code in the code list
foreach (array_keys ($this->_codes) as $rname) {
// match
if (strtolower ($rname) == strtolower ($name)) {
$found = $rname;
break;
}
}
if ($found === false || ($this->_caseSensitive && $this->getCodeFlag ($found, 'case_sensitive', 'boolean', true))) {
return false;
}
return $rname;
}
}
@ -1332,7 +1415,7 @@ class StringParser_BBCode_Node_Paragraph extends StringParser_Node {
*
* This node is a bbcode paragraph node.
*
* @access private
* @access protected
* @var int
* @see STRINGPARSER_BBCODE_NODE_PARAGRAPH
*/
@ -1391,7 +1474,7 @@ class StringParser_BBCode_Node_Element extends StringParser_Node {
*
* This node is a bbcode element node.
*
* @access private
* @access protected
* @var int
* @see STRINGPARSER_BBCODE_NODE_ELEMENT
*/
@ -1400,7 +1483,7 @@ class StringParser_BBCode_Node_Element extends StringParser_Node {
/**
* Element name
*
* @access private
* @access protected
* @var string
* @see StringParser_BBCode_Node_Element::name
* @see StringParser_BBCode_Node_Element::setName
@ -1411,7 +1494,7 @@ class StringParser_BBCode_Node_Element extends StringParser_Node {
/**
* Element flags
*
* @access private
* @access protected
* @var array
*/
var $_flags = array ();
@ -1419,7 +1502,7 @@ class StringParser_BBCode_Node_Element extends StringParser_Node {
/**
* Element attributes
*
* @access private
* @access protected
* @var array
*/
var $_attributes = array ();
@ -1427,7 +1510,7 @@ class StringParser_BBCode_Node_Element extends StringParser_Node {
/**
* Had a close tag
*
* @access private
* @access protected
* @var bool
*/
var $_hadCloseTag = false;
@ -1435,7 +1518,7 @@ class StringParser_BBCode_Node_Element extends StringParser_Node {
/**
* Was processed by paragraph handling
*
* @access private
* @access protected
* @var bool
*/
var $_paragraphHandled = false;
@ -1449,7 +1532,7 @@ class StringParser_BBCode_Node_Element extends StringParser_Node {
* @return object
*/
function &duplicate () {
$newnode =& new StringParser_BBCode_Node_Element ($this->occurredAt);
$newnode = new StringParser_BBCode_Node_Element ($this->occurredAt);
$newnode->_name = $this->_name;
$newnode->_flags = $this->_flags;
$newnode->_attributes = $this->_attributes;
@ -1623,7 +1706,7 @@ class StringParser_BBCode_Node_Element extends StringParser_Node {
* @return mixed
*/
function &firstChildIfText () {
$ret =& $this->firstChild ();
$ret = $this->firstChild ();
if (is_null ($ret)) {
return $ret;
}
@ -1643,7 +1726,7 @@ class StringParser_BBCode_Node_Element extends StringParser_Node {
* @return mixed
*/
function &lastChildIfText () {
$ret =& $this->lastChild ();
$ret = $this->lastChild ();
if (is_null ($ret)) {
return $ret;
}
@ -1651,9 +1734,9 @@ class StringParser_BBCode_Node_Element extends StringParser_Node {
// DON'T DO $ret = null WITHOUT unset BEFORE!
// ELSE WE WILL ERASE THE NODE ITSELF! EVIL!
if ($ret->_type != STRINGPARSER_NODE_TEXT && !$ret->hadCloseTag ()) {
$ret2 =& $ret->_findPrevAdjentTextNodeHelper ();
$ret2 = $ret->_findPrevAdjentTextNodeHelper ();
unset ($ret);
$ret =& $ret2;
$ret = $ret2;
unset ($ret2);
} else {
unset ($ret);
@ -1697,7 +1780,7 @@ class StringParser_BBCode_Node_Element extends StringParser_Node {
return $ret;
}
if ($this->_parent->_type == STRINGPARSER_BBCODE_NODE_ELEMENT && !$this->_parent->hadCloseTag ()) {
$ret =& $this->_parent->findNextAdjentTextNode ();
$ret = $this->_parent->findNextAdjentTextNode ();
return $ret;
}
return $ret;
@ -1732,7 +1815,7 @@ class StringParser_BBCode_Node_Element extends StringParser_Node {
return $this->_parent->_children[$found-1];
}
if (!$this->_parent->_children[$found-1]->hadCloseTag ()) {
$ret =& $this->_parent->_children[$found-1]->_findPrevAdjentTextNodeHelper ();
$ret = $this->_parent->_children[$found-1]->_findPrevAdjentTextNodeHelper ();
}
return $ret;
}
@ -1747,12 +1830,12 @@ class StringParser_BBCode_Node_Element extends StringParser_Node {
* recursively.
*/
function &_findPrevAdjentTextNodeHelper () {
$lastnode =& $this->lastChild ();
if ($lastnode->_type == STRINGPARSER_NODE_TEXT) {
$lastnode = $this->lastChild ();
if ($lastnode === null || $lastnode->_type == STRINGPARSER_NODE_TEXT) {
return $lastnode;
}
if (!$lastnode->hadCloseTag ()) {
$ret =& $lastnode->_findPrevAdjentTextNodeHelper ();
$ret = $lastnode->_findPrevAdjentTextNodeHelper ();
} else {
$ret = null;
}
@ -1795,19 +1878,25 @@ class StringParser_BBCode_Node_Element extends StringParser_Node {
* Validate code
*
* @access public
* @param string $action The action which is to be called ('validate'
* for first validation, 'validate_again' for
* second validation (optional))
* @return bool
*/
function validate () {
function validate ($action = 'validate') {
if ($action != 'validate' && $action != 'validate_again') {
return false;
}
if ($this->_codeInfo['callback_type'] != 'simple_replace' && $this->_codeInfo['callback_type'] != 'simple_replace_single') {
if (!is_callable ($this->_codeInfo['callback_func'])) {
return false;
}
if (($this->_codeInfo['callback_type'] == 'usecontent' || $this->_codeInfo['callback_type'] == 'usecontent?') && count ($this->_children) == 1 && $this->_children[0]->_type == STRINGPARSER_NODE_TEXT) {
if (($this->_codeInfo['callback_type'] == 'usecontent' || $this->_codeInfo['callback_type'] == 'usecontent?' || $this->_codeInfo['callback_type'] == 'callback_replace?') && count ($this->_children) == 1 && $this->_children[0]->_type == STRINGPARSER_NODE_TEXT) {
// we have to make sure the object gets passed on as a reference
// if we do call_user_func(..., &$this) this will clash with PHP5
$callArray = array ('validate', $this->_attributes, $this->_children[0]->content, $this->_codeInfo['callback_params']);
$callArray[] =& $this;
$callArray = array ($action, $this->_attributes, $this->_children[0]->content, $this->_codeInfo['callback_params']);
$callArray[] = $this;
$res = call_user_func_array ($this->_codeInfo['callback_func'], $callArray);
if ($res) {
// ok, now, if we've got a usecontent type, set a flag that
@ -1825,8 +1914,8 @@ class StringParser_BBCode_Node_Element extends StringParser_Node {
// we have to make sure the object gets passed on as a reference
// if we do call_user_func(..., &$this) this will clash with PHP5
$callArray = array ('validate', $this->_attributes, null, $this->_codeInfo['callback_params']);
$callArray[] =& $this;
$callArray = array ($action, $this->_attributes, null, $this->_codeInfo['callback_params']);
$callArray[] = $this;
return call_user_func_array ($this->_codeInfo['callback_func'], $callArray);
}
return (bool)(!count ($this->_attributes));
@ -1855,7 +1944,7 @@ class StringParser_BBCode_Node_Element extends StringParser_Node {
// we have to make sure the object gets passed on as a reference
// if we do call_user_func(..., &$this) this will clash with PHP5
$callArray = array ('output', $this->_attributes, $subcontent, $this->_codeInfo['callback_params']);
$callArray[] =& $this;
$callArray[] = $this;
return call_user_func_array ($this->_codeInfo['callback_func'], $callArray);
}

View File

@ -1,23 +1,21 @@
This program is free software; you can redistribute it and/or modify
it under the terms of either:
The MIT License
a) the GNU General Public License as published by the Free
Software Foundation; either version 1, or (at your option) any
later version, or
Copyright (c) 2004-2008 Christian Seiler <webmaster@christian-seiler.de>
b) the Artistic License as published by Larry Wall, either version 2.0,
or (at your option) any later version.
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:
This program 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 either
the GNU General Public License or the Artistic License for more details.
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
You should have received a copy of the Artistic License with this Kit,
in the file named "Artistic.clarified". If not, I'll be glad to provide
one.
You should also have received a copy of the GNU General Public License
along with this program in the file named "COPYING"; if not, write to
the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston,
MA 02111-1307, USA.
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.

View File

@ -4,3 +4,5 @@ Special thanks go to:
project website.
* Götz Bürkle (goetz@buerkle.org) for doing an awful lot of beta testing
and designing the favicon.
* Many people supplying me with lots of ideas of how I could improve the
classes