Make WordPress Core

Ticket #39714: phpmailer2.diff

File phpmailer2.diff, 525.3 KB (added by JeffMatson, 9 years ago)

Diff including new files.

  • new file wp-includes/PHPMailer/LICENSE

    diff --git wp-includes/PHPMailer/LICENSE wp-includes/PHPMailer/LICENSE
    new file mode 100644
    index 0000000..8e0763d
    - +  
     1                  GNU LESSER GENERAL PUBLIC LICENSE
     2                       Version 2.1, February 1999
     3
     4 Copyright (C) 1991, 1999 Free Software Foundation, Inc.
     5     59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
     6 Everyone is permitted to copy and distribute verbatim copies
     7 of this license document, but changing it is not allowed.
     8
     9[This is the first released version of the Lesser GPL.  It also counts
     10 as the successor of the GNU Library Public License, version 2, hence
     11 the version number 2.1.]
     12
     13                            Preamble
     14
     15  The licenses for most software are designed to take away your
     16freedom to share and change it.  By contrast, the GNU General Public
     17Licenses are intended to guarantee your freedom to share and change
     18free software--to make sure the software is free for all its users.
     19
     20  This license, the Lesser General Public License, applies to some
     21specially designated software packages--typically libraries--of the
     22Free Software Foundation and other authors who decide to use it.  You
     23can use it too, but we suggest you first think carefully about whether
     24this license or the ordinary General Public License is the better
     25strategy to use in any particular case, based on the explanations below.
     26
     27  When we speak of free software, we are referring to freedom of use,
     28not price.  Our General Public Licenses are designed to make sure that
     29you have the freedom to distribute copies of free software (and charge
     30for this service if you wish); that you receive source code or can get
     31it if you want it; that you can change the software and use pieces of
     32it in new free programs; and that you are informed that you can do
     33these things.
     34
     35  To protect your rights, we need to make restrictions that forbid
     36distributors to deny you these rights or to ask you to surrender these
     37rights.  These restrictions translate to certain responsibilities for
     38you if you distribute copies of the library or if you modify it.
     39
     40  For example, if you distribute copies of the library, whether gratis
     41or for a fee, you must give the recipients all the rights that we gave
     42you.  You must make sure that they, too, receive or can get the source
     43code.  If you link other code with the library, you must provide
     44complete object files to the recipients, so that they can relink them
     45with the library after making changes to the library and recompiling
     46it.  And you must show them these terms so they know their rights.
     47
     48  We protect your rights with a two-step method: (1) we copyright the
     49library, and (2) we offer you this license, which gives you legal
     50permission to copy, distribute and/or modify the library.
     51
     52  To protect each distributor, we want to make it very clear that
     53there is no warranty for the free library.  Also, if the library is
     54modified by someone else and passed on, the recipients should know
     55that what they have is not the original version, so that the original
     56author's reputation will not be affected by problems that might be
     57introduced by others.
     58
     59  Finally, software patents pose a constant threat to the existence of
     60any free program.  We wish to make sure that a company cannot
     61effectively restrict the users of a free program by obtaining a
     62restrictive license from a patent holder.  Therefore, we insist that
     63any patent license obtained for a version of the library must be
     64consistent with the full freedom of use specified in this license.
     65
     66  Most GNU software, including some libraries, is covered by the
     67ordinary GNU General Public License.  This license, the GNU Lesser
     68General Public License, applies to certain designated libraries, and
     69is quite different from the ordinary General Public License.  We use
     70this license for certain libraries in order to permit linking those
     71libraries into non-free programs.
     72
     73  When a program is linked with a library, whether statically or using
     74a shared library, the combination of the two is legally speaking a
     75combined work, a derivative of the original library.  The ordinary
     76General Public License therefore permits such linking only if the
     77entire combination fits its criteria of freedom.  The Lesser General
     78Public License permits more lax criteria for linking other code with
     79the library.
     80
     81  We call this license the "Lesser" General Public License because it
     82does Less to protect the user's freedom than the ordinary General
     83Public License.  It also provides other free software developers Less
     84of an advantage over competing non-free programs.  These disadvantages
     85are the reason we use the ordinary General Public License for many
     86libraries.  However, the Lesser license provides advantages in certain
     87special circumstances.
     88
     89  For example, on rare occasions, there may be a special need to
     90encourage the widest possible use of a certain library, so that it becomes
     91a de-facto standard.  To achieve this, non-free programs must be
     92allowed to use the library.  A more frequent case is that a free
     93library does the same job as widely used non-free libraries.  In this
     94case, there is little to gain by limiting the free library to free
     95software only, so we use the Lesser General Public License.
     96
     97  In other cases, permission to use a particular library in non-free
     98programs enables a greater number of people to use a large body of
     99free software.  For example, permission to use the GNU C Library in
     100non-free programs enables many more people to use the whole GNU
     101operating system, as well as its variant, the GNU/Linux operating
     102system.
     103
     104  Although the Lesser General Public License is Less protective of the
     105users' freedom, it does ensure that the user of a program that is
     106linked with the Library has the freedom and the wherewithal to run
     107that program using a modified version of the Library.
     108
     109  The precise terms and conditions for copying, distribution and
     110modification follow.  Pay close attention to the difference between a
     111"work based on the library" and a "work that uses the library".  The
     112former contains code derived from the library, whereas the latter must
     113be combined with the library in order to run.
     114
     115                  GNU LESSER GENERAL PUBLIC LICENSE
     116   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
     117
     118  0. This License Agreement applies to any software library or other
     119program which contains a notice placed by the copyright holder or
     120other authorized party saying it may be distributed under the terms of
     121this Lesser General Public License (also called "this License").
     122Each licensee is addressed as "you".
     123
     124  A "library" means a collection of software functions and/or data
     125prepared so as to be conveniently linked with application programs
     126(which use some of those functions and data) to form executables.
     127
     128  The "Library", below, refers to any such software library or work
     129which has been distributed under these terms.  A "work based on the
     130Library" means either the Library or any derivative work under
     131copyright law: that is to say, a work containing the Library or a
     132portion of it, either verbatim or with modifications and/or translated
     133straightforwardly into another language.  (Hereinafter, translation is
     134included without limitation in the term "modification".)
     135
     136  "Source code" for a work means the preferred form of the work for
     137making modifications to it.  For a library, complete source code means
     138all the source code for all modules it contains, plus any associated
     139interface definition files, plus the scripts used to control compilation
     140and installation of the library.
     141
     142  Activities other than copying, distribution and modification are not
     143covered by this License; they are outside its scope.  The act of
     144running a program using the Library is not restricted, and output from
     145such a program is covered only if its contents constitute a work based
     146on the Library (independent of the use of the Library in a tool for
     147writing it).  Whether that is true depends on what the Library does
     148and what the program that uses the Library does.
     149 
     150  1. You may copy and distribute verbatim copies of the Library's
     151complete source code as you receive it, in any medium, provided that
     152you conspicuously and appropriately publish on each copy an
     153appropriate copyright notice and disclaimer of warranty; keep intact
     154all the notices that refer to this License and to the absence of any
     155warranty; and distribute a copy of this License along with the
     156Library.
     157
     158  You may charge a fee for the physical act of transferring a copy,
     159and you may at your option offer warranty protection in exchange for a
     160fee.
     161
     162  2. You may modify your copy or copies of the Library or any portion
     163of it, thus forming a work based on the Library, and copy and
     164distribute such modifications or work under the terms of Section 1
     165above, provided that you also meet all of these conditions:
     166
     167    a) The modified work must itself be a software library.
     168
     169    b) You must cause the files modified to carry prominent notices
     170    stating that you changed the files and the date of any change.
     171
     172    c) You must cause the whole of the work to be licensed at no
     173    charge to all third parties under the terms of this License.
     174
     175    d) If a facility in the modified Library refers to a function or a
     176    table of data to be supplied by an application program that uses
     177    the facility, other than as an argument passed when the facility
     178    is invoked, then you must make a good faith effort to ensure that,
     179    in the event an application does not supply such function or
     180    table, the facility still operates, and performs whatever part of
     181    its purpose remains meaningful.
     182
     183    (For example, a function in a library to compute square roots has
     184    a purpose that is entirely well-defined independent of the
     185    application.  Therefore, Subsection 2d requires that any
     186    application-supplied function or table used by this function must
     187    be optional: if the application does not supply it, the square
     188    root function must still compute square roots.)
     189
     190These requirements apply to the modified work as a whole.  If
     191identifiable sections of that work are not derived from the Library,
     192and can be reasonably considered independent and separate works in
     193themselves, then this License, and its terms, do not apply to those
     194sections when you distribute them as separate works.  But when you
     195distribute the same sections as part of a whole which is a work based
     196on the Library, the distribution of the whole must be on the terms of
     197this License, whose permissions for other licensees extend to the
     198entire whole, and thus to each and every part regardless of who wrote
     199it.
     200
     201Thus, it is not the intent of this section to claim rights or contest
     202your rights to work written entirely by you; rather, the intent is to
     203exercise the right to control the distribution of derivative or
     204collective works based on the Library.
     205
     206In addition, mere aggregation of another work not based on the Library
     207with the Library (or with a work based on the Library) on a volume of
     208a storage or distribution medium does not bring the other work under
     209the scope of this License.
     210
     211  3. You may opt to apply the terms of the ordinary GNU General Public
     212License instead of this License to a given copy of the Library.  To do
     213this, you must alter all the notices that refer to this License, so
     214that they refer to the ordinary GNU General Public License, version 2,
     215instead of to this License.  (If a newer version than version 2 of the
     216ordinary GNU General Public License has appeared, then you can specify
     217that version instead if you wish.)  Do not make any other change in
     218these notices.
     219
     220  Once this change is made in a given copy, it is irreversible for
     221that copy, so the ordinary GNU General Public License applies to all
     222subsequent copies and derivative works made from that copy.
     223
     224  This option is useful when you wish to copy part of the code of
     225the Library into a program that is not a library.
     226
     227  4. You may copy and distribute the Library (or a portion or
     228derivative of it, under Section 2) in object code or executable form
     229under the terms of Sections 1 and 2 above provided that you accompany
     230it with the complete corresponding machine-readable source code, which
     231must be distributed under the terms of Sections 1 and 2 above on a
     232medium customarily used for software interchange.
     233
     234  If distribution of object code is made by offering access to copy
     235from a designated place, then offering equivalent access to copy the
     236source code from the same place satisfies the requirement to
     237distribute the source code, even though third parties are not
     238compelled to copy the source along with the object code.
     239
     240  5. A program that contains no derivative of any portion of the
     241Library, but is designed to work with the Library by being compiled or
     242linked with it, is called a "work that uses the Library".  Such a
     243work, in isolation, is not a derivative work of the Library, and
     244therefore falls outside the scope of this License.
     245
     246  However, linking a "work that uses the Library" with the Library
     247creates an executable that is a derivative of the Library (because it
     248contains portions of the Library), rather than a "work that uses the
     249library".  The executable is therefore covered by this License.
     250Section 6 states terms for distribution of such executables.
     251
     252  When a "work that uses the Library" uses material from a header file
     253that is part of the Library, the object code for the work may be a
     254derivative work of the Library even though the source code is not.
     255Whether this is true is especially significant if the work can be
     256linked without the Library, or if the work is itself a library.  The
     257threshold for this to be true is not precisely defined by law.
     258
     259  If such an object file uses only numerical parameters, data
     260structure layouts and accessors, and small macros and small inline
     261functions (ten lines or less in length), then the use of the object
     262file is unrestricted, regardless of whether it is legally a derivative
     263work.  (Executables containing this object code plus portions of the
     264Library will still fall under Section 6.)
     265
     266  Otherwise, if the work is a derivative of the Library, you may
     267distribute the object code for the work under the terms of Section 6.
     268Any executables containing that work also fall under Section 6,
     269whether or not they are linked directly with the Library itself.
     270
     271  6. As an exception to the Sections above, you may also combine or
     272link a "work that uses the Library" with the Library to produce a
     273work containing portions of the Library, and distribute that work
     274under terms of your choice, provided that the terms permit
     275modification of the work for the customer's own use and reverse
     276engineering for debugging such modifications.
     277
     278  You must give prominent notice with each copy of the work that the
     279Library is used in it and that the Library and its use are covered by
     280this License.  You must supply a copy of this License.  If the work
     281during execution displays copyright notices, you must include the
     282copyright notice for the Library among them, as well as a reference
     283directing the user to the copy of this License.  Also, you must do one
     284of these things:
     285
     286    a) Accompany the work with the complete corresponding
     287    machine-readable source code for the Library including whatever
     288    changes were used in the work (which must be distributed under
     289    Sections 1 and 2 above); and, if the work is an executable linked
     290    with the Library, with the complete machine-readable "work that
     291    uses the Library", as object code and/or source code, so that the
     292    user can modify the Library and then relink to produce a modified
     293    executable containing the modified Library.  (It is understood
     294    that the user who changes the contents of definitions files in the
     295    Library will not necessarily be able to recompile the application
     296    to use the modified definitions.)
     297
     298    b) Use a suitable shared library mechanism for linking with the
     299    Library.  A suitable mechanism is one that (1) uses at run time a
     300    copy of the library already present on the user's computer system,
     301    rather than copying library functions into the executable, and (2)
     302    will operate properly with a modified version of the library, if
     303    the user installs one, as long as the modified version is
     304    interface-compatible with the version that the work was made with.
     305
     306    c) Accompany the work with a written offer, valid for at
     307    least three years, to give the same user the materials
     308    specified in Subsection 6a, above, for a charge no more
     309    than the cost of performing this distribution.
     310
     311    d) If distribution of the work is made by offering access to copy
     312    from a designated place, offer equivalent access to copy the above
     313    specified materials from the same place.
     314
     315    e) verify that the user has already received a copy of these
     316    materials or that you have already sent this user a copy.
     317
     318  For an executable, the required form of the "work that uses the
     319Library" must include any data and utility programs needed for
     320reproducing the executable from it.  However, as a special exception,
     321the materials to be distributed need not include anything that is
     322normally distributed (in either source or binary form) with the major
     323components (compiler, kernel, and so on) of the operating system on
     324which the executable runs, unless that component itself accompanies
     325the executable.
     326
     327  It may happen that this requirement contradicts the license
     328restrictions of other proprietary libraries that do not normally
     329accompany the operating system.  Such a contradiction means you cannot
     330use both them and the Library together in an executable that you
     331distribute.
     332
     333  7. You may place library facilities that are a work based on the
     334Library side-by-side in a single library together with other library
     335facilities not covered by this License, and distribute such a combined
     336library, provided that the separate distribution of the work based on
     337the Library and of the other library facilities is otherwise
     338permitted, and provided that you do these two things:
     339
     340    a) Accompany the combined library with a copy of the same work
     341    based on the Library, uncombined with any other library
     342    facilities.  This must be distributed under the terms of the
     343    Sections above.
     344
     345    b) Give prominent notice with the combined library of the fact
     346    that part of it is a work based on the Library, and explaining
     347    where to find the accompanying uncombined form of the same work.
     348
     349  8. You may not copy, modify, sublicense, link with, or distribute
     350the Library except as expressly provided under this License.  Any
     351attempt otherwise to copy, modify, sublicense, link with, or
     352distribute the Library is void, and will automatically terminate your
     353rights under this License.  However, parties who have received copies,
     354or rights, from you under this License will not have their licenses
     355terminated so long as such parties remain in full compliance.
     356
     357  9. You are not required to accept this License, since you have not
     358signed it.  However, nothing else grants you permission to modify or
     359distribute the Library or its derivative works.  These actions are
     360prohibited by law if you do not accept this License.  Therefore, by
     361modifying or distributing the Library (or any work based on the
     362Library), you indicate your acceptance of this License to do so, and
     363all its terms and conditions for copying, distributing or modifying
     364the Library or works based on it.
     365
     366  10. Each time you redistribute the Library (or any work based on the
     367Library), the recipient automatically receives a license from the
     368original licensor to copy, distribute, link with or modify the Library
     369subject to these terms and conditions.  You may not impose any further
     370restrictions on the recipients' exercise of the rights granted herein.
     371You are not responsible for enforcing compliance by third parties with
     372this License.
     373
     374  11. If, as a consequence of a court judgment or allegation of patent
     375infringement or for any other reason (not limited to patent issues),
     376conditions are imposed on you (whether by court order, agreement or
     377otherwise) that contradict the conditions of this License, they do not
     378excuse you from the conditions of this License.  If you cannot
     379distribute so as to satisfy simultaneously your obligations under this
     380License and any other pertinent obligations, then as a consequence you
     381may not distribute the Library at all.  For example, if a patent
     382license would not permit royalty-free redistribution of the Library by
     383all those who receive copies directly or indirectly through you, then
     384the only way you could satisfy both it and this License would be to
     385refrain entirely from distribution of the Library.
     386
     387If any portion of this section is held invalid or unenforceable under any
     388particular circumstance, the balance of the section is intended to apply,
     389and the section as a whole is intended to apply in other circumstances.
     390
     391It is not the purpose of this section to induce you to infringe any
     392patents or other property right claims or to contest validity of any
     393such claims; this section has the sole purpose of protecting the
     394integrity of the free software distribution system which is
     395implemented by public license practices.  Many people have made
     396generous contributions to the wide range of software distributed
     397through that system in reliance on consistent application of that
     398system; it is up to the author/donor to decide if he or she is willing
     399to distribute software through any other system and a licensee cannot
     400impose that choice.
     401
     402This section is intended to make thoroughly clear what is believed to
     403be a consequence of the rest of this License.
     404
     405  12. If the distribution and/or use of the Library is restricted in
     406certain countries either by patents or by copyrighted interfaces, the
     407original copyright holder who places the Library under this License may add
     408an explicit geographical distribution limitation excluding those countries,
     409so that distribution is permitted only in or among countries not thus
     410excluded.  In such case, this License incorporates the limitation as if
     411written in the body of this License.
     412
     413  13. The Free Software Foundation may publish revised and/or new
     414versions of the Lesser General Public License from time to time.
     415Such new versions will be similar in spirit to the present version,
     416but may differ in detail to address new problems or concerns.
     417
     418Each version is given a distinguishing version number.  If the Library
     419specifies a version number of this License which applies to it and
     420"any later version", you have the option of following the terms and
     421conditions either of that version or of any later version published by
     422the Free Software Foundation.  If the Library does not specify a
     423license version number, you may choose any version ever published by
     424the Free Software Foundation.
     425
     426  14. If you wish to incorporate parts of the Library into other free
     427programs whose distribution conditions are incompatible with these,
     428write to the author to ask for permission.  For software which is
     429copyrighted by the Free Software Foundation, write to the Free
     430Software Foundation; we sometimes make exceptions for this.  Our
     431decision will be guided by the two goals of preserving the free status
     432of all derivatives of our free software and of promoting the sharing
     433and reuse of software generally.
     434
     435                            NO WARRANTY
     436
     437  15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
     438WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
     439EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
     440OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
     441KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
     442IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
     443PURPOSE.  THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
     444LIBRARY IS WITH YOU.  SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
     445THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
     446
     447  16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
     448WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
     449AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
     450FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
     451CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
     452LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
     453RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
     454FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
     455SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
     456DAMAGES.
     457
     458                     END OF TERMS AND CONDITIONS
     459
     460           How to Apply These Terms to Your New Libraries
     461
     462  If you develop a new library, and you want it to be of the greatest
     463possible use to the public, we recommend making it free software that
     464everyone can redistribute and change.  You can do so by permitting
     465redistribution under these terms (or, alternatively, under the terms of the
     466ordinary General Public License).
     467
     468  To apply these terms, attach the following notices to the library.  It is
     469safest to attach them to the start of each source file to most effectively
     470convey the exclusion of warranty; and each file should have at least the
     471"copyright" line and a pointer to where the full notice is found.
     472
     473    <one line to give the library's name and a brief idea of what it does.>
     474    Copyright (C) <year>  <name of author>
     475
     476    This library is free software; you can redistribute it and/or
     477    modify it under the terms of the GNU Lesser General Public
     478    License as published by the Free Software Foundation; either
     479    version 2.1 of the License, or (at your option) any later version.
     480
     481    This library is distributed in the hope that it will be useful,
     482    but WITHOUT ANY WARRANTY; without even the implied warranty of
     483    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
     484    Lesser General Public License for more details.
     485
     486    You should have received a copy of the GNU Lesser General Public
     487    License along with this library; if not, write to the Free Software
     488    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
     489
     490Also add information on how to contact you by electronic and paper mail.
     491
     492You should also get your employer (if you work as a programmer) or your
     493school, if any, to sign a "copyright disclaimer" for the library, if
     494necessary.  Here is a sample; alter the names:
     495
     496  Yoyodyne, Inc., hereby disclaims all copyright interest in the
     497  library `Frob' (a library for tweaking knobs) written by James Random Hacker.
     498
     499  <signature of Ty Coon>, 1 April 1990
     500  Ty Coon, President of Vice
     501
     502That's all there is to it!
     503
     504
  • new file wp-includes/PHPMailer/PHPMailerAutoload.php

    diff --git wp-includes/PHPMailer/PHPMailerAutoload.php wp-includes/PHPMailer/PHPMailerAutoload.php
    new file mode 100644
    index 0000000..eaa2e30
    - +  
     1<?php
     2/**
     3 * PHPMailer SPL autoloader.
     4 * PHP Version 5
     5 * @package PHPMailer
     6 * @link https://github.com/PHPMailer/PHPMailer/ The PHPMailer GitHub project
     7 * @author Marcus Bointon (Synchro/coolbru) <phpmailer@synchromedia.co.uk>
     8 * @author Jim Jagielski (jimjag) <jimjag@gmail.com>
     9 * @author Andy Prevost (codeworxtech) <codeworxtech@users.sourceforge.net>
     10 * @author Brent R. Matzelle (original founder)
     11 * @copyright 2012 - 2014 Marcus Bointon
     12 * @copyright 2010 - 2012 Jim Jagielski
     13 * @copyright 2004 - 2009 Andy Prevost
     14 * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License
     15 * @note This program is distributed in the hope that it will be useful - WITHOUT
     16 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
     17 * FITNESS FOR A PARTICULAR PURPOSE.
     18 */
     19
     20/**
     21 * PHPMailer SPL autoloader.
     22 * @param string $classname The name of the class to load
     23 */
     24function PHPMailerAutoload($classname)
     25{
     26    //Can't use __DIR__ as it's only in PHP 5.3+
     27    $filename = dirname(__FILE__).DIRECTORY_SEPARATOR.'class.'.strtolower($classname).'.php';
     28    if (is_readable($filename)) {
     29        require $filename;
     30    }
     31}
     32
     33if (version_compare(PHP_VERSION, '5.1.2', '>=')) {
     34    //SPL autoloading was introduced in PHP 5.1.2
     35    if (version_compare(PHP_VERSION, '5.3.0', '>=')) {
     36        spl_autoload_register('PHPMailerAutoload', true, true);
     37    } else {
     38        spl_autoload_register('PHPMailerAutoload');
     39    }
     40} else {
     41    /**
     42     * Fall back to traditional autoload for old PHP versions
     43     * @param string $classname The name of the class to load
     44     */
     45    function __autoload($classname)
     46    {
     47        PHPMailerAutoload($classname);
     48    }
     49}
  • new file wp-includes/PHPMailer/class.phpmailer.php

    diff --git wp-includes/PHPMailer/class.phpmailer.php wp-includes/PHPMailer/class.phpmailer.php
    new file mode 100644
    index 0000000..477ee82
    - +  
     1<?php
     2/**
     3 * PHPMailer - PHP email creation and transport class.
     4 * PHP Version 5
     5 * @package PHPMailer
     6 * @link https://github.com/PHPMailer/PHPMailer/ The PHPMailer GitHub project
     7 * @author Marcus Bointon (Synchro/coolbru) <phpmailer@synchromedia.co.uk>
     8 * @author Jim Jagielski (jimjag) <jimjag@gmail.com>
     9 * @author Andy Prevost (codeworxtech) <codeworxtech@users.sourceforge.net>
     10 * @author Brent R. Matzelle (original founder)
     11 * @copyright 2012 - 2014 Marcus Bointon
     12 * @copyright 2010 - 2012 Jim Jagielski
     13 * @copyright 2004 - 2009 Andy Prevost
     14 * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License
     15 * @note This program is distributed in the hope that it will be useful - WITHOUT
     16 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
     17 * FITNESS FOR A PARTICULAR PURPOSE.
     18 */
     19
     20/**
     21 * PHPMailer - PHP email creation and transport class.
     22 * @package PHPMailer
     23 * @author Marcus Bointon (Synchro/coolbru) <phpmailer@synchromedia.co.uk>
     24 * @author Jim Jagielski (jimjag) <jimjag@gmail.com>
     25 * @author Andy Prevost (codeworxtech) <codeworxtech@users.sourceforge.net>
     26 * @author Brent R. Matzelle (original founder)
     27 */
     28class PHPMailer
     29{
     30    /**
     31     * The PHPMailer Version number.
     32     * @var string
     33     */
     34    public $Version = '5.2.22';
     35
     36    /**
     37     * Email priority.
     38     * Options: null (default), 1 = High, 3 = Normal, 5 = low.
     39     * When null, the header is not set at all.
     40     * @var integer
     41     */
     42    public $Priority = null;
     43
     44    /**
     45     * The character set of the message.
     46     * @var string
     47     */
     48    public $CharSet = 'iso-8859-1';
     49
     50    /**
     51     * The MIME Content-type of the message.
     52     * @var string
     53     */
     54    public $ContentType = 'text/plain';
     55
     56    /**
     57     * The message encoding.
     58     * Options: "8bit", "7bit", "binary", "base64", and "quoted-printable".
     59     * @var string
     60     */
     61    public $Encoding = '8bit';
     62
     63    /**
     64     * Holds the most recent mailer error message.
     65     * @var string
     66     */
     67    public $ErrorInfo = '';
     68
     69    /**
     70     * The From email address for the message.
     71     * @var string
     72     */
     73    public $From = 'root@localhost';
     74
     75    /**
     76     * The From name of the message.
     77     * @var string
     78     */
     79    public $FromName = 'Root User';
     80
     81    /**
     82     * The Sender email (Return-Path) of the message.
     83     * If not empty, will be sent via -f to sendmail or as 'MAIL FROM' in smtp mode.
     84     * @var string
     85     */
     86    public $Sender = '';
     87
     88    /**
     89     * The Return-Path of the message.
     90     * If empty, it will be set to either From or Sender.
     91     * @var string
     92     * @deprecated Email senders should never set a return-path header;
     93     * it's the receiver's job (RFC5321 section 4.4), so this no longer does anything.
     94     * @link https://tools.ietf.org/html/rfc5321#section-4.4 RFC5321 reference
     95     */
     96    public $ReturnPath = '';
     97
     98    /**
     99     * The Subject of the message.
     100     * @var string
     101     */
     102    public $Subject = '';
     103
     104    /**
     105     * An HTML or plain text message body.
     106     * If HTML then call isHTML(true).
     107     * @var string
     108     */
     109    public $Body = '';
     110
     111    /**
     112     * The plain-text message body.
     113     * This body can be read by mail clients that do not have HTML email
     114     * capability such as mutt & Eudora.
     115     * Clients that can read HTML will view the normal Body.
     116     * @var string
     117     */
     118    public $AltBody = '';
     119
     120    /**
     121     * An iCal message part body.
     122     * Only supported in simple alt or alt_inline message types
     123     * To generate iCal events, use the bundled extras/EasyPeasyICS.php class or iCalcreator
     124     * @link http://sprain.ch/blog/downloads/php-class-easypeasyics-create-ical-files-with-php/
     125     * @link http://kigkonsult.se/iCalcreator/
     126     * @var string
     127     */
     128    public $Ical = '';
     129
     130    /**
     131     * The complete compiled MIME message body.
     132     * @access protected
     133     * @var string
     134     */
     135    protected $MIMEBody = '';
     136
     137    /**
     138     * The complete compiled MIME message headers.
     139     * @var string
     140     * @access protected
     141     */
     142    protected $MIMEHeader = '';
     143
     144    /**
     145     * Extra headers that createHeader() doesn't fold in.
     146     * @var string
     147     * @access protected
     148     */
     149    protected $mailHeader = '';
     150
     151    /**
     152     * Word-wrap the message body to this number of chars.
     153     * Set to 0 to not wrap. A useful value here is 78, for RFC2822 section 2.1.1 compliance.
     154     * @var integer
     155     */
     156    public $WordWrap = 0;
     157
     158    /**
     159     * Which method to use to send mail.
     160     * Options: "mail", "sendmail", or "smtp".
     161     * @var string
     162     */
     163    public $Mailer = 'mail';
     164
     165    /**
     166     * The path to the sendmail program.
     167     * @var string
     168     */
     169    public $Sendmail = '/usr/sbin/sendmail';
     170
     171    /**
     172     * Whether mail() uses a fully sendmail-compatible MTA.
     173     * One which supports sendmail's "-oi -f" options.
     174     * @var boolean
     175     */
     176    public $UseSendmailOptions = true;
     177
     178    /**
     179     * Path to PHPMailer plugins.
     180     * Useful if the SMTP class is not in the PHP include path.
     181     * @var string
     182     * @deprecated Should not be needed now there is an autoloader.
     183     */
     184    public $PluginDir = '';
     185
     186    /**
     187     * The email address that a reading confirmation should be sent to, also known as read receipt.
     188     * @var string
     189     */
     190    public $ConfirmReadingTo = '';
     191
     192    /**
     193     * The hostname to use in the Message-ID header and as default HELO string.
     194     * If empty, PHPMailer attempts to find one with, in order,
     195     * $_SERVER['SERVER_NAME'], gethostname(), php_uname('n'), or the value
     196     * 'localhost.localdomain'.
     197     * @var string
     198     */
     199    public $Hostname = '';
     200
     201    /**
     202     * An ID to be used in the Message-ID header.
     203     * If empty, a unique id will be generated.
     204     * You can set your own, but it must be in the format "<id@domain>",
     205     * as defined in RFC5322 section 3.6.4 or it will be ignored.
     206     * @see https://tools.ietf.org/html/rfc5322#section-3.6.4
     207     * @var string
     208     */
     209    public $MessageID = '';
     210
     211    /**
     212     * The message Date to be used in the Date header.
     213     * If empty, the current date will be added.
     214     * @var string
     215     */
     216    public $MessageDate = '';
     217
     218    /**
     219     * SMTP hosts.
     220     * Either a single hostname or multiple semicolon-delimited hostnames.
     221     * You can also specify a different port
     222     * for each host by using this format: [hostname:port]
     223     * (e.g. "smtp1.example.com:25;smtp2.example.com").
     224     * You can also specify encryption type, for example:
     225     * (e.g. "tls://smtp1.example.com:587;ssl://smtp2.example.com:465").
     226     * Hosts will be tried in order.
     227     * @var string
     228     */
     229    public $Host = 'localhost';
     230
     231    /**
     232     * The default SMTP server port.
     233     * @var integer
     234     * @TODO Why is this needed when the SMTP class takes care of it?
     235     */
     236    public $Port = 25;
     237
     238    /**
     239     * The SMTP HELO of the message.
     240     * Default is $Hostname. If $Hostname is empty, PHPMailer attempts to find
     241     * one with the same method described above for $Hostname.
     242     * @var string
     243     * @see PHPMailer::$Hostname
     244     */
     245    public $Helo = '';
     246
     247    /**
     248     * What kind of encryption to use on the SMTP connection.
     249     * Options: '', 'ssl' or 'tls'
     250     * @var string
     251     */
     252    public $SMTPSecure = '';
     253
     254    /**
     255     * Whether to enable TLS encryption automatically if a server supports it,
     256     * even if `SMTPSecure` is not set to 'tls'.
     257     * Be aware that in PHP >= 5.6 this requires that the server's certificates are valid.
     258     * @var boolean
     259     */
     260    public $SMTPAutoTLS = true;
     261
     262    /**
     263     * Whether to use SMTP authentication.
     264     * Uses the Username and Password properties.
     265     * @var boolean
     266     * @see PHPMailer::$Username
     267     * @see PHPMailer::$Password
     268     */
     269    public $SMTPAuth = false;
     270
     271    /**
     272     * Options array passed to stream_context_create when connecting via SMTP.
     273     * @var array
     274     */
     275    public $SMTPOptions = array();
     276
     277    /**
     278     * SMTP username.
     279     * @var string
     280     */
     281    public $Username = '';
     282
     283    /**
     284     * SMTP password.
     285     * @var string
     286     */
     287    public $Password = '';
     288
     289    /**
     290     * SMTP auth type.
     291     * Options are CRAM-MD5, LOGIN, PLAIN, NTLM, XOAUTH2, attempted in that order if not specified
     292     * @var string
     293     */
     294    public $AuthType = '';
     295
     296    /**
     297     * SMTP realm.
     298     * Used for NTLM auth
     299     * @var string
     300     */
     301    public $Realm = '';
     302
     303    /**
     304     * SMTP workstation.
     305     * Used for NTLM auth
     306     * @var string
     307     */
     308    public $Workstation = '';
     309
     310    /**
     311     * The SMTP server timeout in seconds.
     312     * Default of 5 minutes (300sec) is from RFC2821 section 4.5.3.2
     313     * @var integer
     314     */
     315    public $Timeout = 300;
     316
     317    /**
     318     * SMTP class debug output mode.
     319     * Debug output level.
     320     * Options:
     321     * * `0` No output
     322     * * `1` Commands
     323     * * `2` Data and commands
     324     * * `3` As 2 plus connection status
     325     * * `4` Low-level data output
     326     * @var integer
     327     * @see SMTP::$do_debug
     328     */
     329    public $SMTPDebug = 0;
     330
     331    /**
     332     * How to handle debug output.
     333     * Options:
     334     * * `echo` Output plain-text as-is, appropriate for CLI
     335     * * `html` Output escaped, line breaks converted to `<br>`, appropriate for browser output
     336     * * `error_log` Output to error log as configured in php.ini
     337     *
     338     * Alternatively, you can provide a callable expecting two params: a message string and the debug level:
     339     * <code>
     340     * $mail->Debugoutput = function($str, $level) {echo "debug level $level; message: $str";};
     341     * </code>
     342     * @var string|callable
     343     * @see SMTP::$Debugoutput
     344     */
     345    public $Debugoutput = 'echo';
     346
     347    /**
     348     * Whether to keep SMTP connection open after each message.
     349     * If this is set to true then to close the connection
     350     * requires an explicit call to smtpClose().
     351     * @var boolean
     352     */
     353    public $SMTPKeepAlive = false;
     354
     355    /**
     356     * Whether to split multiple to addresses into multiple messages
     357     * or send them all in one message.
     358     * Only supported in `mail` and `sendmail` transports, not in SMTP.
     359     * @var boolean
     360     */
     361    public $SingleTo = false;
     362
     363    /**
     364     * Storage for addresses when SingleTo is enabled.
     365     * @var array
     366     * @TODO This should really not be public
     367     */
     368    public $SingleToArray = array();
     369
     370    /**
     371     * Whether to generate VERP addresses on send.
     372     * Only applicable when sending via SMTP.
     373     * @link https://en.wikipedia.org/wiki/Variable_envelope_return_path
     374     * @link http://www.postfix.org/VERP_README.html Postfix VERP info
     375     * @var boolean
     376     */
     377    public $do_verp = false;
     378
     379    /**
     380     * Whether to allow sending messages with an empty body.
     381     * @var boolean
     382     */
     383    public $AllowEmpty = false;
     384
     385    /**
     386     * The default line ending.
     387     * @note The default remains "\n". We force CRLF where we know
     388     *        it must be used via self::CRLF.
     389     * @var string
     390     */
     391    public $LE = "\n";
     392
     393    /**
     394     * DKIM selector.
     395     * @var string
     396     */
     397    public $DKIM_selector = '';
     398
     399    /**
     400     * DKIM Identity.
     401     * Usually the email address used as the source of the email.
     402     * @var string
     403     */
     404    public $DKIM_identity = '';
     405
     406    /**
     407     * DKIM passphrase.
     408     * Used if your key is encrypted.
     409     * @var string
     410     */
     411    public $DKIM_passphrase = '';
     412
     413    /**
     414     * DKIM signing domain name.
     415     * @example 'example.com'
     416     * @var string
     417     */
     418    public $DKIM_domain = '';
     419
     420    /**
     421     * DKIM private key file path.
     422     * @var string
     423     */
     424    public $DKIM_private = '';
     425
     426    /**
     427     * DKIM private key string.
     428     * If set, takes precedence over `$DKIM_private`.
     429     * @var string
     430     */
     431    public $DKIM_private_string = '';
     432
     433    /**
     434     * Callback Action function name.
     435     *
     436     * The function that handles the result of the send email action.
     437     * It is called out by send() for each email sent.
     438     *
     439     * Value can be any php callable: http://www.php.net/is_callable
     440     *
     441     * Parameters:
     442     *   boolean $result        result of the send action
     443     *   string  $to            email address of the recipient
     444     *   string  $cc            cc email addresses
     445     *   string  $bcc           bcc email addresses
     446     *   string  $subject       the subject
     447     *   string  $body          the email body
     448     *   string  $from          email address of sender
     449     * @var string
     450     */
     451    public $action_function = '';
     452
     453    /**
     454     * What to put in the X-Mailer header.
     455     * Options: An empty string for PHPMailer default, whitespace for none, or a string to use
     456     * @var string
     457     */
     458    public $XMailer = '';
     459
     460    /**
     461     * Which validator to use by default when validating email addresses.
     462     * May be a callable to inject your own validator, but there are several built-in validators.
     463     * @see PHPMailer::validateAddress()
     464     * @var string|callable
     465     * @static
     466     */
     467    public static $validator = 'auto';
     468
     469    /**
     470     * An instance of the SMTP sender class.
     471     * @var SMTP
     472     * @access protected
     473     */
     474    protected $smtp = null;
     475
     476    /**
     477     * The array of 'to' names and addresses.
     478     * @var array
     479     * @access protected
     480     */
     481    protected $to = array();
     482
     483    /**
     484     * The array of 'cc' names and addresses.
     485     * @var array
     486     * @access protected
     487     */
     488    protected $cc = array();
     489
     490    /**
     491     * The array of 'bcc' names and addresses.
     492     * @var array
     493     * @access protected
     494     */
     495    protected $bcc = array();
     496
     497    /**
     498     * The array of reply-to names and addresses.
     499     * @var array
     500     * @access protected
     501     */
     502    protected $ReplyTo = array();
     503
     504    /**
     505     * An array of all kinds of addresses.
     506     * Includes all of $to, $cc, $bcc
     507     * @var array
     508     * @access protected
     509     * @see PHPMailer::$to @see PHPMailer::$cc @see PHPMailer::$bcc
     510     */
     511    protected $all_recipients = array();
     512
     513    /**
     514     * An array of names and addresses queued for validation.
     515     * In send(), valid and non duplicate entries are moved to $all_recipients
     516     * and one of $to, $cc, or $bcc.
     517     * This array is used only for addresses with IDN.
     518     * @var array
     519     * @access protected
     520     * @see PHPMailer::$to @see PHPMailer::$cc @see PHPMailer::$bcc
     521     * @see PHPMailer::$all_recipients
     522     */
     523    protected $RecipientsQueue = array();
     524
     525    /**
     526     * An array of reply-to names and addresses queued for validation.
     527     * In send(), valid and non duplicate entries are moved to $ReplyTo.
     528     * This array is used only for addresses with IDN.
     529     * @var array
     530     * @access protected
     531     * @see PHPMailer::$ReplyTo
     532     */
     533    protected $ReplyToQueue = array();
     534
     535    /**
     536     * The array of attachments.
     537     * @var array
     538     * @access protected
     539     */
     540    protected $attachment = array();
     541
     542    /**
     543     * The array of custom headers.
     544     * @var array
     545     * @access protected
     546     */
     547    protected $CustomHeader = array();
     548
     549    /**
     550     * The most recent Message-ID (including angular brackets).
     551     * @var string
     552     * @access protected
     553     */
     554    protected $lastMessageID = '';
     555
     556    /**
     557     * The message's MIME type.
     558     * @var string
     559     * @access protected
     560     */
     561    protected $message_type = '';
     562
     563    /**
     564     * The array of MIME boundary strings.
     565     * @var array
     566     * @access protected
     567     */
     568    protected $boundary = array();
     569
     570    /**
     571     * The array of available languages.
     572     * @var array
     573     * @access protected
     574     */
     575    protected $language = array();
     576
     577    /**
     578     * The number of errors encountered.
     579     * @var integer
     580     * @access protected
     581     */
     582    protected $error_count = 0;
     583
     584    /**
     585     * The S/MIME certificate file path.
     586     * @var string
     587     * @access protected
     588     */
     589    protected $sign_cert_file = '';
     590
     591    /**
     592     * The S/MIME key file path.
     593     * @var string
     594     * @access protected
     595     */
     596    protected $sign_key_file = '';
     597
     598    /**
     599     * The optional S/MIME extra certificates ("CA Chain") file path.
     600     * @var string
     601     * @access protected
     602     */
     603    protected $sign_extracerts_file = '';
     604
     605    /**
     606     * The S/MIME password for the key.
     607     * Used only if the key is encrypted.
     608     * @var string
     609     * @access protected
     610     */
     611    protected $sign_key_pass = '';
     612
     613    /**
     614     * Whether to throw exceptions for errors.
     615     * @var boolean
     616     * @access protected
     617     */
     618    protected $exceptions = false;
     619
     620    /**
     621     * Unique ID used for message ID and boundaries.
     622     * @var string
     623     * @access protected
     624     */
     625    protected $uniqueid = '';
     626
     627    /**
     628     * Error severity: message only, continue processing.
     629     */
     630    const STOP_MESSAGE = 0;
     631
     632    /**
     633     * Error severity: message, likely ok to continue processing.
     634     */
     635    const STOP_CONTINUE = 1;
     636
     637    /**
     638     * Error severity: message, plus full stop, critical error reached.
     639     */
     640    const STOP_CRITICAL = 2;
     641
     642    /**
     643     * SMTP RFC standard line ending.
     644     */
     645    const CRLF = "\r\n";
     646
     647    /**
     648     * The maximum line length allowed by RFC 2822 section 2.1.1
     649     * @var integer
     650     */
     651    const MAX_LINE_LENGTH = 998;
     652
     653    /**
     654     * Constructor.
     655     * @param boolean $exceptions Should we throw external exceptions?
     656     */
     657    public function __construct($exceptions = null)
     658    {
     659        if ($exceptions !== null) {
     660            $this->exceptions = (boolean)$exceptions;
     661        }
     662    }
     663
     664    /**
     665     * Destructor.
     666     */
     667    public function __destruct()
     668    {
     669        //Close any open SMTP connection nicely
     670        $this->smtpClose();
     671    }
     672
     673    /**
     674     * Call mail() in a safe_mode-aware fashion.
     675     * Also, unless sendmail_path points to sendmail (or something that
     676     * claims to be sendmail), don't pass params (not a perfect fix,
     677     * but it will do)
     678     * @param string $to To
     679     * @param string $subject Subject
     680     * @param string $body Message Body
     681     * @param string $header Additional Header(s)
     682     * @param string $params Params
     683     * @access private
     684     * @return boolean
     685     */
     686    private function mailPassthru($to, $subject, $body, $header, $params)
     687    {
     688        //Check overloading of mail function to avoid double-encoding
     689        if (ini_get('mbstring.func_overload') & 1) {
     690            $subject = $this->secureHeader($subject);
     691        } else {
     692            $subject = $this->encodeHeader($this->secureHeader($subject));
     693        }
     694
     695        //Can't use additional_parameters in safe_mode, calling mail() with null params breaks
     696        //@link http://php.net/manual/en/function.mail.php
     697        if (ini_get('safe_mode') or !$this->UseSendmailOptions or is_null($params)) {
     698            $result = @mail($to, $subject, $body, $header);
     699        } else {
     700            $result = @mail($to, $subject, $body, $header, $params);
     701        }
     702        return $result;
     703    }
     704    /**
     705     * Output debugging info via user-defined method.
     706     * Only generates output if SMTP debug output is enabled (@see SMTP::$do_debug).
     707     * @see PHPMailer::$Debugoutput
     708     * @see PHPMailer::$SMTPDebug
     709     * @param string $str
     710     */
     711    protected function edebug($str)
     712    {
     713        if ($this->SMTPDebug <= 0) {
     714            return;
     715        }
     716        //Avoid clash with built-in function names
     717        if (!in_array($this->Debugoutput, array('error_log', 'html', 'echo')) and is_callable($this->Debugoutput)) {
     718            call_user_func($this->Debugoutput, $str, $this->SMTPDebug);
     719            return;
     720        }
     721        switch ($this->Debugoutput) {
     722            case 'error_log':
     723                //Don't output, just log
     724                error_log($str);
     725                break;
     726            case 'html':
     727                //Cleans up output a bit for a better looking, HTML-safe output
     728                echo htmlentities(
     729                    preg_replace('/[\r\n]+/', '', $str),
     730                    ENT_QUOTES,
     731                    'UTF-8'
     732                )
     733                . "<br>\n";
     734                break;
     735            case 'echo':
     736            default:
     737                //Normalize line breaks
     738                $str = preg_replace('/\r\n?/ms', "\n", $str);
     739                echo gmdate('Y-m-d H:i:s') . "\t" . str_replace(
     740                    "\n",
     741                    "\n                   \t                  ",
     742                    trim($str)
     743                ) . "\n";
     744        }
     745    }
     746
     747    /**
     748     * Sets message type to HTML or plain.
     749     * @param boolean $isHtml True for HTML mode.
     750     * @return void
     751     */
     752    public function isHTML($isHtml = true)
     753    {
     754        if ($isHtml) {
     755            $this->ContentType = 'text/html';
     756        } else {
     757            $this->ContentType = 'text/plain';
     758        }
     759    }
     760
     761    /**
     762     * Send messages using SMTP.
     763     * @return void
     764     */
     765    public function isSMTP()
     766    {
     767        $this->Mailer = 'smtp';
     768    }
     769
     770    /**
     771     * Send messages using PHP's mail() function.
     772     * @return void
     773     */
     774    public function isMail()
     775    {
     776        $this->Mailer = 'mail';
     777    }
     778
     779    /**
     780     * Send messages using $Sendmail.
     781     * @return void
     782     */
     783    public function isSendmail()
     784    {
     785        $ini_sendmail_path = ini_get('sendmail_path');
     786
     787        if (!stristr($ini_sendmail_path, 'sendmail')) {
     788            $this->Sendmail = '/usr/sbin/sendmail';
     789        } else {
     790            $this->Sendmail = $ini_sendmail_path;
     791        }
     792        $this->Mailer = 'sendmail';
     793    }
     794
     795    /**
     796     * Send messages using qmail.
     797     * @return void
     798     */
     799    public function isQmail()
     800    {
     801        $ini_sendmail_path = ini_get('sendmail_path');
     802
     803        if (!stristr($ini_sendmail_path, 'qmail')) {
     804            $this->Sendmail = '/var/qmail/bin/qmail-inject';
     805        } else {
     806            $this->Sendmail = $ini_sendmail_path;
     807        }
     808        $this->Mailer = 'qmail';
     809    }
     810
     811    /**
     812     * Add a "To" address.
     813     * @param string $address The email address to send to
     814     * @param string $name
     815     * @return boolean true on success, false if address already used or invalid in some way
     816     */
     817    public function addAddress($address, $name = '')
     818    {
     819        return $this->addOrEnqueueAnAddress('to', $address, $name);
     820    }
     821
     822    /**
     823     * Add a "CC" address.
     824     * @note: This function works with the SMTP mailer on win32, not with the "mail" mailer.
     825     * @param string $address The email address to send to
     826     * @param string $name
     827     * @return boolean true on success, false if address already used or invalid in some way
     828     */
     829    public function addCC($address, $name = '')
     830    {
     831        return $this->addOrEnqueueAnAddress('cc', $address, $name);
     832    }
     833
     834    /**
     835     * Add a "BCC" address.
     836     * @note: This function works with the SMTP mailer on win32, not with the "mail" mailer.
     837     * @param string $address The email address to send to
     838     * @param string $name
     839     * @return boolean true on success, false if address already used or invalid in some way
     840     */
     841    public function addBCC($address, $name = '')
     842    {
     843        return $this->addOrEnqueueAnAddress('bcc', $address, $name);
     844    }
     845
     846    /**
     847     * Add a "Reply-To" address.
     848     * @param string $address The email address to reply to
     849     * @param string $name
     850     * @return boolean true on success, false if address already used or invalid in some way
     851     */
     852    public function addReplyTo($address, $name = '')
     853    {
     854        return $this->addOrEnqueueAnAddress('Reply-To', $address, $name);
     855    }
     856
     857    /**
     858     * Add an address to one of the recipient arrays or to the ReplyTo array. Because PHPMailer
     859     * can't validate addresses with an IDN without knowing the PHPMailer::$CharSet (that can still
     860     * be modified after calling this function), addition of such addresses is delayed until send().
     861     * Addresses that have been added already return false, but do not throw exceptions.
     862     * @param string $kind One of 'to', 'cc', 'bcc', or 'ReplyTo'
     863     * @param string $address The email address to send, resp. to reply to
     864     * @param string $name
     865     * @throws phpmailerException
     866     * @return boolean true on success, false if address already used or invalid in some way
     867     * @access protected
     868     */
     869    protected function addOrEnqueueAnAddress($kind, $address, $name)
     870    {
     871        $address = trim($address);
     872        $name = trim(preg_replace('/[\r\n]+/', '', $name)); //Strip breaks and trim
     873        if (($pos = strrpos($address, '@')) === false) {
     874            // At-sign is misssing.
     875            $error_message = $this->lang('invalid_address') . " (addAnAddress $kind): $address";
     876            $this->setError($error_message);
     877            $this->edebug($error_message);
     878            if ($this->exceptions) {
     879                throw new phpmailerException($error_message);
     880            }
     881            return false;
     882        }
     883        $params = array($kind, $address, $name);
     884        // Enqueue addresses with IDN until we know the PHPMailer::$CharSet.
     885        if ($this->has8bitChars(substr($address, ++$pos)) and $this->idnSupported()) {
     886            if ($kind != 'Reply-To') {
     887                if (!array_key_exists($address, $this->RecipientsQueue)) {
     888                    $this->RecipientsQueue[$address] = $params;
     889                    return true;
     890                }
     891            } else {
     892                if (!array_key_exists($address, $this->ReplyToQueue)) {
     893                    $this->ReplyToQueue[$address] = $params;
     894                    return true;
     895                }
     896            }
     897            return false;
     898        }
     899        // Immediately add standard addresses without IDN.
     900        return call_user_func_array(array($this, 'addAnAddress'), $params);
     901    }
     902
     903    /**
     904     * Add an address to one of the recipient arrays or to the ReplyTo array.
     905     * Addresses that have been added already return false, but do not throw exceptions.
     906     * @param string $kind One of 'to', 'cc', 'bcc', or 'ReplyTo'
     907     * @param string $address The email address to send, resp. to reply to
     908     * @param string $name
     909     * @throws phpmailerException
     910     * @return boolean true on success, false if address already used or invalid in some way
     911     * @access protected
     912     */
     913    protected function addAnAddress($kind, $address, $name = '')
     914    {
     915        if (!in_array($kind, array('to', 'cc', 'bcc', 'Reply-To'))) {
     916            $error_message = $this->lang('Invalid recipient kind: ') . $kind;
     917            $this->setError($error_message);
     918            $this->edebug($error_message);
     919            if ($this->exceptions) {
     920                throw new phpmailerException($error_message);
     921            }
     922            return false;
     923        }
     924        if (!$this->validateAddress($address)) {
     925            $error_message = $this->lang('invalid_address') . " (addAnAddress $kind): $address";
     926            $this->setError($error_message);
     927            $this->edebug($error_message);
     928            if ($this->exceptions) {
     929                throw new phpmailerException($error_message);
     930            }
     931            return false;
     932        }
     933        if ($kind != 'Reply-To') {
     934            if (!array_key_exists(strtolower($address), $this->all_recipients)) {
     935                array_push($this->$kind, array($address, $name));
     936                $this->all_recipients[strtolower($address)] = true;
     937                return true;
     938            }
     939        } else {
     940            if (!array_key_exists(strtolower($address), $this->ReplyTo)) {
     941                $this->ReplyTo[strtolower($address)] = array($address, $name);
     942                return true;
     943            }
     944        }
     945        return false;
     946    }
     947
     948    /**
     949     * Parse and validate a string containing one or more RFC822-style comma-separated email addresses
     950     * of the form "display name <address>" into an array of name/address pairs.
     951     * Uses the imap_rfc822_parse_adrlist function if the IMAP extension is available.
     952     * Note that quotes in the name part are removed.
     953     * @param string $addrstr The address list string
     954     * @param bool $useimap Whether to use the IMAP extension to parse the list
     955     * @return array
     956     * @link http://www.andrew.cmu.edu/user/agreen1/testing/mrbs/web/Mail/RFC822.php A more careful implementation
     957     */
     958    public function parseAddresses($addrstr, $useimap = true)
     959    {
     960        $addresses = array();
     961        if ($useimap and function_exists('imap_rfc822_parse_adrlist')) {
     962            //Use this built-in parser if it's available
     963            $list = imap_rfc822_parse_adrlist($addrstr, '');
     964            foreach ($list as $address) {
     965                if ($address->host != '.SYNTAX-ERROR.') {
     966                    if ($this->validateAddress($address->mailbox . '@' . $address->host)) {
     967                        $addresses[] = array(
     968                            'name' => (property_exists($address, 'personal') ? $address->personal : ''),
     969                            'address' => $address->mailbox . '@' . $address->host
     970                        );
     971                    }
     972                }
     973            }
     974        } else {
     975            //Use this simpler parser
     976            $list = explode(',', $addrstr);
     977            foreach ($list as $address) {
     978                $address = trim($address);
     979                //Is there a separate name part?
     980                if (strpos($address, '<') === false) {
     981                    //No separate name, just use the whole thing
     982                    if ($this->validateAddress($address)) {
     983                        $addresses[] = array(
     984                            'name' => '',
     985                            'address' => $address
     986                        );
     987                    }
     988                } else {
     989                    list($name, $email) = explode('<', $address);
     990                    $email = trim(str_replace('>', '', $email));
     991                    if ($this->validateAddress($email)) {
     992                        $addresses[] = array(
     993                            'name' => trim(str_replace(array('"', "'"), '', $name)),
     994                            'address' => $email
     995                        );
     996                    }
     997                }
     998            }
     999        }
     1000        return $addresses;
     1001    }
     1002
     1003    /**
     1004     * Set the From and FromName properties.
     1005     * @param string $address
     1006     * @param string $name
     1007     * @param boolean $auto Whether to also set the Sender address, defaults to true
     1008     * @throws phpmailerException
     1009     * @return boolean
     1010     */
     1011    public function setFrom($address, $name = '', $auto = true)
     1012    {
     1013        $address = trim($address);
     1014        $name = trim(preg_replace('/[\r\n]+/', '', $name)); //Strip breaks and trim
     1015        // Don't validate now addresses with IDN. Will be done in send().
     1016        if (($pos = strrpos($address, '@')) === false or
     1017            (!$this->has8bitChars(substr($address, ++$pos)) or !$this->idnSupported()) and
     1018            !$this->validateAddress($address)) {
     1019            $error_message = $this->lang('invalid_address') . " (setFrom) $address";
     1020            $this->setError($error_message);
     1021            $this->edebug($error_message);
     1022            if ($this->exceptions) {
     1023                throw new phpmailerException($error_message);
     1024            }
     1025            return false;
     1026        }
     1027        $this->From = $address;
     1028        $this->FromName = $name;
     1029        if ($auto) {
     1030            if (empty($this->Sender)) {
     1031                $this->Sender = $address;
     1032            }
     1033        }
     1034        return true;
     1035    }
     1036
     1037    /**
     1038     * Return the Message-ID header of the last email.
     1039     * Technically this is the value from the last time the headers were created,
     1040     * but it's also the message ID of the last sent message except in
     1041     * pathological cases.
     1042     * @return string
     1043     */
     1044    public function getLastMessageID()
     1045    {
     1046        return $this->lastMessageID;
     1047    }
     1048
     1049    /**
     1050     * Check that a string looks like an email address.
     1051     * @param string $address The email address to check
     1052     * @param string|callable $patternselect A selector for the validation pattern to use :
     1053     * * `auto` Pick best pattern automatically;
     1054     * * `pcre8` Use the squiloople.com pattern, requires PCRE > 8.0, PHP >= 5.3.2, 5.2.14;
     1055     * * `pcre` Use old PCRE implementation;
     1056     * * `php` Use PHP built-in FILTER_VALIDATE_EMAIL;
     1057     * * `html5` Use the pattern given by the HTML5 spec for 'email' type form input elements.
     1058     * * `noregex` Don't use a regex: super fast, really dumb.
     1059     * Alternatively you may pass in a callable to inject your own validator, for example:
     1060     * PHPMailer::validateAddress('user@example.com', function($address) {
     1061     *     return (strpos($address, '@') !== false);
     1062     * });
     1063     * You can also set the PHPMailer::$validator static to a callable, allowing built-in methods to use your validator.
     1064     * @return boolean
     1065     * @static
     1066     * @access public
     1067     */
     1068    public static function validateAddress($address, $patternselect = null)
     1069    {
     1070        if (is_null($patternselect)) {
     1071            $patternselect = self::$validator;
     1072        }
     1073        if (is_callable($patternselect)) {
     1074            return call_user_func($patternselect, $address);
     1075        }
     1076        //Reject line breaks in addresses; it's valid RFC5322, but not RFC5321
     1077        if (strpos($address, "\n") !== false or strpos($address, "\r") !== false) {
     1078            return false;
     1079        }
     1080        if (!$patternselect or $patternselect == 'auto') {
     1081            //Check this constant first so it works when extension_loaded() is disabled by safe mode
     1082            //Constant was added in PHP 5.2.4
     1083            if (defined('PCRE_VERSION')) {
     1084                //This pattern can get stuck in a recursive loop in PCRE <= 8.0.2
     1085                if (version_compare(PCRE_VERSION, '8.0.3') >= 0) {
     1086                    $patternselect = 'pcre8';
     1087                } else {
     1088                    $patternselect = 'pcre';
     1089                }
     1090            } elseif (function_exists('extension_loaded') and extension_loaded('pcre')) {
     1091                //Fall back to older PCRE
     1092                $patternselect = 'pcre';
     1093            } else {
     1094                //Filter_var appeared in PHP 5.2.0 and does not require the PCRE extension
     1095                if (version_compare(PHP_VERSION, '5.2.0') >= 0) {
     1096                    $patternselect = 'php';
     1097                } else {
     1098                    $patternselect = 'noregex';
     1099                }
     1100            }
     1101        }
     1102        switch ($patternselect) {
     1103            case 'pcre8':
     1104                /**
     1105                 * Uses the same RFC5322 regex on which FILTER_VALIDATE_EMAIL is based, but allows dotless domains.
     1106                 * @link http://squiloople.com/2009/12/20/email-address-validation/
     1107                 * @copyright 2009-2010 Michael Rushton
     1108                 * Feel free to use and redistribute this code. But please keep this copyright notice.
     1109                 */
     1110                return (boolean)preg_match(
     1111                    '/^(?!(?>(?1)"?(?>\\\[ -~]|[^"])"?(?1)){255,})(?!(?>(?1)"?(?>\\\[ -~]|[^"])"?(?1)){65,}@)' .
     1112                    '((?>(?>(?>((?>(?>(?>\x0D\x0A)?[\t ])+|(?>[\t ]*\x0D\x0A)?[\t ]+)?)(\((?>(?2)' .
     1113                    '(?>[\x01-\x08\x0B\x0C\x0E-\'*-\[\]-\x7F]|\\\[\x00-\x7F]|(?3)))*(?2)\)))+(?2))|(?2))?)' .
     1114                    '([!#-\'*+\/-9=?^-~-]+|"(?>(?2)(?>[\x01-\x08\x0B\x0C\x0E-!#-\[\]-\x7F]|\\\[\x00-\x7F]))*' .
     1115                    '(?2)")(?>(?1)\.(?1)(?4))*(?1)@(?!(?1)[a-z0-9-]{64,})(?1)(?>([a-z0-9](?>[a-z0-9-]*[a-z0-9])?)' .
     1116                    '(?>(?1)\.(?!(?1)[a-z0-9-]{64,})(?1)(?5)){0,126}|\[(?:(?>IPv6:(?>([a-f0-9]{1,4})(?>:(?6)){7}' .
     1117                    '|(?!(?:.*[a-f0-9][:\]]){8,})((?6)(?>:(?6)){0,6})?::(?7)?))|(?>(?>IPv6:(?>(?6)(?>:(?6)){5}:' .
     1118                    '|(?!(?:.*[a-f0-9]:){6,})(?8)?::(?>((?6)(?>:(?6)){0,4}):)?))?(25[0-5]|2[0-4][0-9]|1[0-9]{2}' .
     1119                    '|[1-9]?[0-9])(?>\.(?9)){3}))\])(?1)$/isD',
     1120                    $address
     1121                );
     1122            case 'pcre':
     1123                //An older regex that doesn't need a recent PCRE
     1124                return (boolean)preg_match(
     1125                    '/^(?!(?>"?(?>\\\[ -~]|[^"])"?){255,})(?!(?>"?(?>\\\[ -~]|[^"])"?){65,}@)(?>' .
     1126                    '[!#-\'*+\/-9=?^-~-]+|"(?>(?>[\x01-\x08\x0B\x0C\x0E-!#-\[\]-\x7F]|\\\[\x00-\xFF]))*")' .
     1127                    '(?>\.(?>[!#-\'*+\/-9=?^-~-]+|"(?>(?>[\x01-\x08\x0B\x0C\x0E-!#-\[\]-\x7F]|\\\[\x00-\xFF]))*"))*' .
     1128                    '@(?>(?![a-z0-9-]{64,})(?>[a-z0-9](?>[a-z0-9-]*[a-z0-9])?)(?>\.(?![a-z0-9-]{64,})' .
     1129                    '(?>[a-z0-9](?>[a-z0-9-]*[a-z0-9])?)){0,126}|\[(?:(?>IPv6:(?>(?>[a-f0-9]{1,4})(?>:' .
     1130                    '[a-f0-9]{1,4}){7}|(?!(?:.*[a-f0-9][:\]]){8,})(?>[a-f0-9]{1,4}(?>:[a-f0-9]{1,4}){0,6})?' .
     1131                    '::(?>[a-f0-9]{1,4}(?>:[a-f0-9]{1,4}){0,6})?))|(?>(?>IPv6:(?>[a-f0-9]{1,4}(?>:' .
     1132                    '[a-f0-9]{1,4}){5}:|(?!(?:.*[a-f0-9]:){6,})(?>[a-f0-9]{1,4}(?>:[a-f0-9]{1,4}){0,4})?' .
     1133                    '::(?>(?:[a-f0-9]{1,4}(?>:[a-f0-9]{1,4}){0,4}):)?))?(?>25[0-5]|2[0-4][0-9]|1[0-9]{2}' .
     1134                    '|[1-9]?[0-9])(?>\.(?>25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9])){3}))\])$/isD',
     1135                    $address
     1136                );
     1137            case 'html5':
     1138                /**
     1139                 * This is the pattern used in the HTML5 spec for validation of 'email' type form input elements.
     1140                 * @link http://www.whatwg.org/specs/web-apps/current-work/#e-mail-state-(type=email)
     1141                 */
     1142                return (boolean)preg_match(
     1143                    '/^[a-zA-Z0-9.!#$%&\'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}' .
     1144                    '[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/sD',
     1145                    $address
     1146                );
     1147            case 'noregex':
     1148                //No PCRE! Do something _very_ approximate!
     1149                //Check the address is 3 chars or longer and contains an @ that's not the first or last char
     1150                return (strlen($address) >= 3
     1151                    and strpos($address, '@') >= 1
     1152                    and strpos($address, '@') != strlen($address) - 1);
     1153            case 'php':
     1154            default:
     1155                return (boolean)filter_var($address, FILTER_VALIDATE_EMAIL);
     1156        }
     1157    }
     1158
     1159    /**
     1160     * Tells whether IDNs (Internationalized Domain Names) are supported or not. This requires the
     1161     * "intl" and "mbstring" PHP extensions.
     1162     * @return bool "true" if required functions for IDN support are present
     1163     */
     1164    public function idnSupported()
     1165    {
     1166        // @TODO: Write our own "idn_to_ascii" function for PHP <= 5.2.
     1167        return function_exists('idn_to_ascii') and function_exists('mb_convert_encoding');
     1168    }
     1169
     1170    /**
     1171     * Converts IDN in given email address to its ASCII form, also known as punycode, if possible.
     1172     * Important: Address must be passed in same encoding as currently set in PHPMailer::$CharSet.
     1173     * This function silently returns unmodified address if:
     1174     * - No conversion is necessary (i.e. domain name is not an IDN, or is already in ASCII form)
     1175     * - Conversion to punycode is impossible (e.g. required PHP functions are not available)
     1176     *   or fails for any reason (e.g. domain has characters not allowed in an IDN)
     1177     * @see PHPMailer::$CharSet
     1178     * @param string $address The email address to convert
     1179     * @return string The encoded address in ASCII form
     1180     */
     1181    public function punyencodeAddress($address)
     1182    {
     1183        // Verify we have required functions, CharSet, and at-sign.
     1184        if ($this->idnSupported() and
     1185            !empty($this->CharSet) and
     1186            ($pos = strrpos($address, '@')) !== false) {
     1187            $domain = substr($address, ++$pos);
     1188            // Verify CharSet string is a valid one, and domain properly encoded in this CharSet.
     1189            if ($this->has8bitChars($domain) and @mb_check_encoding($domain, $this->CharSet)) {
     1190                $domain = mb_convert_encoding($domain, 'UTF-8', $this->CharSet);
     1191                if (($punycode = defined('INTL_IDNA_VARIANT_UTS46') ?
     1192                    idn_to_ascii($domain, 0, INTL_IDNA_VARIANT_UTS46) :
     1193                    idn_to_ascii($domain)) !== false) {
     1194                    return substr($address, 0, $pos) . $punycode;
     1195                }
     1196            }
     1197        }
     1198        return $address;
     1199    }
     1200
     1201    /**
     1202     * Create a message and send it.
     1203     * Uses the sending method specified by $Mailer.
     1204     * @throws phpmailerException
     1205     * @return boolean false on error - See the ErrorInfo property for details of the error.
     1206     */
     1207    public function send()
     1208    {
     1209        try {
     1210            if (!$this->preSend()) {
     1211                return false;
     1212            }
     1213            return $this->postSend();
     1214        } catch (phpmailerException $exc) {
     1215            $this->mailHeader = '';
     1216            $this->setError($exc->getMessage());
     1217            if ($this->exceptions) {
     1218                throw $exc;
     1219            }
     1220            return false;
     1221        }
     1222    }
     1223
     1224    /**
     1225     * Prepare a message for sending.
     1226     * @throws phpmailerException
     1227     * @return boolean
     1228     */
     1229    public function preSend()
     1230    {
     1231        try {
     1232            $this->error_count = 0; // Reset errors
     1233            $this->mailHeader = '';
     1234
     1235            // Dequeue recipient and Reply-To addresses with IDN
     1236            foreach (array_merge($this->RecipientsQueue, $this->ReplyToQueue) as $params) {
     1237                $params[1] = $this->punyencodeAddress($params[1]);
     1238                call_user_func_array(array($this, 'addAnAddress'), $params);
     1239            }
     1240            if ((count($this->to) + count($this->cc) + count($this->bcc)) < 1) {
     1241                throw new phpmailerException($this->lang('provide_address'), self::STOP_CRITICAL);
     1242            }
     1243
     1244            // Validate From, Sender, and ConfirmReadingTo addresses
     1245            foreach (array('From', 'Sender', 'ConfirmReadingTo') as $address_kind) {
     1246                $this->$address_kind = trim($this->$address_kind);
     1247                if (empty($this->$address_kind)) {
     1248                    continue;
     1249                }
     1250                $this->$address_kind = $this->punyencodeAddress($this->$address_kind);
     1251                if (!$this->validateAddress($this->$address_kind)) {
     1252                    $error_message = $this->lang('invalid_address') . ' (punyEncode) ' . $this->$address_kind;
     1253                    $this->setError($error_message);
     1254                    $this->edebug($error_message);
     1255                    if ($this->exceptions) {
     1256                        throw new phpmailerException($error_message);
     1257                    }
     1258                    return false;
     1259                }
     1260            }
     1261
     1262            // Set whether the message is multipart/alternative
     1263            if ($this->alternativeExists()) {
     1264                $this->ContentType = 'multipart/alternative';
     1265            }
     1266
     1267            $this->setMessageType();
     1268            // Refuse to send an empty message unless we are specifically allowing it
     1269            if (!$this->AllowEmpty and empty($this->Body)) {
     1270                throw new phpmailerException($this->lang('empty_message'), self::STOP_CRITICAL);
     1271            }
     1272
     1273            // Create body before headers in case body makes changes to headers (e.g. altering transfer encoding)
     1274            $this->MIMEHeader = '';
     1275            $this->MIMEBody = $this->createBody();
     1276            // createBody may have added some headers, so retain them
     1277            $tempheaders = $this->MIMEHeader;
     1278            $this->MIMEHeader = $this->createHeader();
     1279            $this->MIMEHeader .= $tempheaders;
     1280
     1281            // To capture the complete message when using mail(), create
     1282            // an extra header list which createHeader() doesn't fold in
     1283            if ($this->Mailer == 'mail') {
     1284                if (count($this->to) > 0) {
     1285                    $this->mailHeader .= $this->addrAppend('To', $this->to);
     1286                } else {
     1287                    $this->mailHeader .= $this->headerLine('To', 'undisclosed-recipients:;');
     1288                }
     1289                $this->mailHeader .= $this->headerLine(
     1290                    'Subject',
     1291                    $this->encodeHeader($this->secureHeader(trim($this->Subject)))
     1292                );
     1293            }
     1294
     1295            // Sign with DKIM if enabled
     1296            if (!empty($this->DKIM_domain)
     1297                && !empty($this->DKIM_selector)
     1298                && (!empty($this->DKIM_private_string)
     1299                   || (!empty($this->DKIM_private) && file_exists($this->DKIM_private))
     1300                )
     1301            ) {
     1302                $header_dkim = $this->DKIM_Add(
     1303                    $this->MIMEHeader . $this->mailHeader,
     1304                    $this->encodeHeader($this->secureHeader($this->Subject)),
     1305                    $this->MIMEBody
     1306                );
     1307                $this->MIMEHeader = rtrim($this->MIMEHeader, "\r\n ") . self::CRLF .
     1308                    str_replace("\r\n", "\n", $header_dkim) . self::CRLF;
     1309            }
     1310            return true;
     1311        } catch (phpmailerException $exc) {
     1312            $this->setError($exc->getMessage());
     1313            if ($this->exceptions) {
     1314                throw $exc;
     1315            }
     1316            return false;
     1317        }
     1318    }
     1319
     1320    /**
     1321     * Actually send a message.
     1322     * Send the email via the selected mechanism
     1323     * @throws phpmailerException
     1324     * @return boolean
     1325     */
     1326    public function postSend()
     1327    {
     1328        try {
     1329            // Choose the mailer and send through it
     1330            switch ($this->Mailer) {
     1331                case 'sendmail':
     1332                case 'qmail':
     1333                    return $this->sendmailSend($this->MIMEHeader, $this->MIMEBody);
     1334                case 'smtp':
     1335                    return $this->smtpSend($this->MIMEHeader, $this->MIMEBody);
     1336                case 'mail':
     1337                    return $this->mailSend($this->MIMEHeader, $this->MIMEBody);
     1338                default:
     1339                    $sendMethod = $this->Mailer.'Send';
     1340                    if (method_exists($this, $sendMethod)) {
     1341                        return $this->$sendMethod($this->MIMEHeader, $this->MIMEBody);
     1342                    }
     1343
     1344                    return $this->mailSend($this->MIMEHeader, $this->MIMEBody);
     1345            }
     1346        } catch (phpmailerException $exc) {
     1347            $this->setError($exc->getMessage());
     1348            $this->edebug($exc->getMessage());
     1349            if ($this->exceptions) {
     1350                throw $exc;
     1351            }
     1352        }
     1353        return false;
     1354    }
     1355
     1356    /**
     1357     * Send mail using the $Sendmail program.
     1358     * @param string $header The message headers
     1359     * @param string $body The message body
     1360     * @see PHPMailer::$Sendmail
     1361     * @throws phpmailerException
     1362     * @access protected
     1363     * @return boolean
     1364     */
     1365    protected function sendmailSend($header, $body)
     1366    {
     1367        // CVE-2016-10033, CVE-2016-10045: Don't pass -f if characters will be escaped.
     1368        if (!empty($this->Sender) and self::isShellSafe($this->Sender)) {
     1369            if ($this->Mailer == 'qmail') {
     1370                $sendmailFmt = '%s -f%s';
     1371            } else {
     1372                $sendmailFmt = '%s -oi -f%s -t';
     1373            }
     1374        } else {
     1375            if ($this->Mailer == 'qmail') {
     1376                $sendmailFmt = '%s';
     1377            } else {
     1378                $sendmailFmt = '%s -oi -t';
     1379            }
     1380        }
     1381
     1382        // TODO: If possible, this should be changed to escapeshellarg.  Needs thorough testing.
     1383        $sendmail = sprintf($sendmailFmt, escapeshellcmd($this->Sendmail), $this->Sender);
     1384
     1385        if ($this->SingleTo) {
     1386            foreach ($this->SingleToArray as $toAddr) {
     1387                if (!@$mail = popen($sendmail, 'w')) {
     1388                    throw new phpmailerException($this->lang('execute') . $this->Sendmail, self::STOP_CRITICAL);
     1389                }
     1390                fputs($mail, 'To: ' . $toAddr . "\n");
     1391                fputs($mail, $header);
     1392                fputs($mail, $body);
     1393                $result = pclose($mail);
     1394                $this->doCallback(
     1395                    ($result == 0),
     1396                    array($toAddr),
     1397                    $this->cc,
     1398                    $this->bcc,
     1399                    $this->Subject,
     1400                    $body,
     1401                    $this->From
     1402                );
     1403                if ($result != 0) {
     1404                    throw new phpmailerException($this->lang('execute') . $this->Sendmail, self::STOP_CRITICAL);
     1405                }
     1406            }
     1407        } else {
     1408            if (!@$mail = popen($sendmail, 'w')) {
     1409                throw new phpmailerException($this->lang('execute') . $this->Sendmail, self::STOP_CRITICAL);
     1410            }
     1411            fputs($mail, $header);
     1412            fputs($mail, $body);
     1413            $result = pclose($mail);
     1414            $this->doCallback(
     1415                ($result == 0),
     1416                $this->to,
     1417                $this->cc,
     1418                $this->bcc,
     1419                $this->Subject,
     1420                $body,
     1421                $this->From
     1422            );
     1423            if ($result != 0) {
     1424                throw new phpmailerException($this->lang('execute') . $this->Sendmail, self::STOP_CRITICAL);
     1425            }
     1426        }
     1427        return true;
     1428    }
     1429
     1430    /**
     1431     * Fix CVE-2016-10033 and CVE-2016-10045 by disallowing potentially unsafe shell characters.
     1432     *
     1433     * Note that escapeshellarg and escapeshellcmd are inadequate for our purposes, especially on Windows.
     1434     * @param string $string The string to be validated
     1435     * @see https://github.com/PHPMailer/PHPMailer/issues/924 CVE-2016-10045 bug report
     1436     * @access protected
     1437     * @return boolean
     1438     */
     1439    protected static function isShellSafe($string)
     1440    {
     1441        // Future-proof
     1442        if (escapeshellcmd($string) !== $string
     1443            or !in_array(escapeshellarg($string), array("'$string'", "\"$string\""))
     1444        ) {
     1445            return false;
     1446        }
     1447
     1448        $length = strlen($string);
     1449
     1450        for ($i = 0; $i < $length; $i++) {
     1451            $c = $string[$i];
     1452
     1453            // All other characters have a special meaning in at least one common shell, including = and +.
     1454            // Full stop (.) has a special meaning in cmd.exe, but its impact should be negligible here.
     1455            // Note that this does permit non-Latin alphanumeric characters based on the current locale.
     1456            if (!ctype_alnum($c) && strpos('@_-.', $c) === false) {
     1457                return false;
     1458            }
     1459        }
     1460
     1461        return true;
     1462    }
     1463
     1464    /**
     1465     * Send mail using the PHP mail() function.
     1466     * @param string $header The message headers
     1467     * @param string $body The message body
     1468     * @link http://www.php.net/manual/en/book.mail.php
     1469     * @throws phpmailerException
     1470     * @access protected
     1471     * @return boolean
     1472     */
     1473    protected function mailSend($header, $body)
     1474    {
     1475        $toArr = array();
     1476        foreach ($this->to as $toaddr) {
     1477            $toArr[] = $this->addrFormat($toaddr);
     1478        }
     1479        $to = implode(', ', $toArr);
     1480
     1481        $params = null;
     1482        //This sets the SMTP envelope sender which gets turned into a return-path header by the receiver
     1483        if (!empty($this->Sender) and $this->validateAddress($this->Sender)) {
     1484            // CVE-2016-10033, CVE-2016-10045: Don't pass -f if characters will be escaped.
     1485            if (self::isShellSafe($this->Sender)) {
     1486                $params = sprintf('-f%s', $this->Sender);
     1487            }
     1488        }
     1489        if (!empty($this->Sender) and !ini_get('safe_mode') and $this->validateAddress($this->Sender)) {
     1490            $old_from = ini_get('sendmail_from');
     1491            ini_set('sendmail_from', $this->Sender);
     1492        }
     1493        $result = false;
     1494        if ($this->SingleTo and count($toArr) > 1) {
     1495            foreach ($toArr as $toAddr) {
     1496                $result = $this->mailPassthru($toAddr, $this->Subject, $body, $header, $params);
     1497                $this->doCallback($result, array($toAddr), $this->cc, $this->bcc, $this->Subject, $body, $this->From);
     1498            }
     1499        } else {
     1500            $result = $this->mailPassthru($to, $this->Subject, $body, $header, $params);
     1501            $this->doCallback($result, $this->to, $this->cc, $this->bcc, $this->Subject, $body, $this->From);
     1502        }
     1503        if (isset($old_from)) {
     1504            ini_set('sendmail_from', $old_from);
     1505        }
     1506        if (!$result) {
     1507            throw new phpmailerException($this->lang('instantiate'), self::STOP_CRITICAL);
     1508        }
     1509        return true;
     1510    }
     1511
     1512    /**
     1513     * Get an instance to use for SMTP operations.
     1514     * Override this function to load your own SMTP implementation
     1515     * @return SMTP
     1516     */
     1517    public function getSMTPInstance()
     1518    {
     1519        if (!is_object($this->smtp)) {
     1520            $this->smtp = new SMTP;
     1521        }
     1522        return $this->smtp;
     1523    }
     1524
     1525    /**
     1526     * Send mail via SMTP.
     1527     * Returns false if there is a bad MAIL FROM, RCPT, or DATA input.
     1528     * Uses the PHPMailerSMTP class by default.
     1529     * @see PHPMailer::getSMTPInstance() to use a different class.
     1530     * @param string $header The message headers
     1531     * @param string $body The message body
     1532     * @throws phpmailerException
     1533     * @uses SMTP
     1534     * @access protected
     1535     * @return boolean
     1536     */
     1537    protected function smtpSend($header, $body)
     1538    {
     1539        $bad_rcpt = array();
     1540        if (!$this->smtpConnect($this->SMTPOptions)) {
     1541            throw new phpmailerException($this->lang('smtp_connect_failed'), self::STOP_CRITICAL);
     1542        }
     1543        if (!empty($this->Sender) and $this->validateAddress($this->Sender)) {
     1544            $smtp_from = $this->Sender;
     1545        } else {
     1546            $smtp_from = $this->From;
     1547        }
     1548        if (!$this->smtp->mail($smtp_from)) {
     1549            $this->setError($this->lang('from_failed') . $smtp_from . ' : ' . implode(',', $this->smtp->getError()));
     1550            throw new phpmailerException($this->ErrorInfo, self::STOP_CRITICAL);
     1551        }
     1552
     1553        // Attempt to send to all recipients
     1554        foreach (array($this->to, $this->cc, $this->bcc) as $togroup) {
     1555            foreach ($togroup as $to) {
     1556                if (!$this->smtp->recipient($to[0])) {
     1557                    $error = $this->smtp->getError();
     1558                    $bad_rcpt[] = array('to' => $to[0], 'error' => $error['detail']);
     1559                    $isSent = false;
     1560                } else {
     1561                    $isSent = true;
     1562                }
     1563                $this->doCallback($isSent, array($to[0]), array(), array(), $this->Subject, $body, $this->From);
     1564            }
     1565        }
     1566
     1567        // Only send the DATA command if we have viable recipients
     1568        if ((count($this->all_recipients) > count($bad_rcpt)) and !$this->smtp->data($header . $body)) {
     1569            throw new phpmailerException($this->lang('data_not_accepted'), self::STOP_CRITICAL);
     1570        }
     1571        if ($this->SMTPKeepAlive) {
     1572            $this->smtp->reset();
     1573        } else {
     1574            $this->smtp->quit();
     1575            $this->smtp->close();
     1576        }
     1577        //Create error message for any bad addresses
     1578        if (count($bad_rcpt) > 0) {
     1579            $errstr = '';
     1580            foreach ($bad_rcpt as $bad) {
     1581                $errstr .= $bad['to'] . ': ' . $bad['error'];
     1582            }
     1583            throw new phpmailerException(
     1584                $this->lang('recipients_failed') . $errstr,
     1585                self::STOP_CONTINUE
     1586            );
     1587        }
     1588        return true;
     1589    }
     1590
     1591    /**
     1592     * Initiate a connection to an SMTP server.
     1593     * Returns false if the operation failed.
     1594     * @param array $options An array of options compatible with stream_context_create()
     1595     * @uses SMTP
     1596     * @access public
     1597     * @throws phpmailerException
     1598     * @return boolean
     1599     */
     1600    public function smtpConnect($options = null)
     1601    {
     1602        if (is_null($this->smtp)) {
     1603            $this->smtp = $this->getSMTPInstance();
     1604        }
     1605
     1606        //If no options are provided, use whatever is set in the instance
     1607        if (is_null($options)) {
     1608            $options = $this->SMTPOptions;
     1609        }
     1610
     1611        // Already connected?
     1612        if ($this->smtp->connected()) {
     1613            return true;
     1614        }
     1615
     1616        $this->smtp->setTimeout($this->Timeout);
     1617        $this->smtp->setDebugLevel($this->SMTPDebug);
     1618        $this->smtp->setDebugOutput($this->Debugoutput);
     1619        $this->smtp->setVerp($this->do_verp);
     1620        $hosts = explode(';', $this->Host);
     1621        $lastexception = null;
     1622
     1623        foreach ($hosts as $hostentry) {
     1624            $hostinfo = array();
     1625            if (!preg_match('/^((ssl|tls):\/\/)*([a-zA-Z0-9\.-]*):?([0-9]*)$/', trim($hostentry), $hostinfo)) {
     1626                // Not a valid host entry
     1627                continue;
     1628            }
     1629            // $hostinfo[2]: optional ssl or tls prefix
     1630            // $hostinfo[3]: the hostname
     1631            // $hostinfo[4]: optional port number
     1632            // The host string prefix can temporarily override the current setting for SMTPSecure
     1633            // If it's not specified, the default value is used
     1634            $prefix = '';
     1635            $secure = $this->SMTPSecure;
     1636            $tls = ($this->SMTPSecure == 'tls');
     1637            if ('ssl' == $hostinfo[2] or ('' == $hostinfo[2] and 'ssl' == $this->SMTPSecure)) {
     1638                $prefix = 'ssl://';
     1639                $tls = false; // Can't have SSL and TLS at the same time
     1640                $secure = 'ssl';
     1641            } elseif ($hostinfo[2] == 'tls') {
     1642                $tls = true;
     1643                // tls doesn't use a prefix
     1644                $secure = 'tls';
     1645            }
     1646            //Do we need the OpenSSL extension?
     1647            $sslext = defined('OPENSSL_ALGO_SHA1');
     1648            if ('tls' === $secure or 'ssl' === $secure) {
     1649                //Check for an OpenSSL constant rather than using extension_loaded, which is sometimes disabled
     1650                if (!$sslext) {
     1651                    throw new phpmailerException($this->lang('extension_missing').'openssl', self::STOP_CRITICAL);
     1652                }
     1653            }
     1654            $host = $hostinfo[3];
     1655            $port = $this->Port;
     1656            $tport = (integer)$hostinfo[4];
     1657            if ($tport > 0 and $tport < 65536) {
     1658                $port = $tport;
     1659            }
     1660            if ($this->smtp->connect($prefix . $host, $port, $this->Timeout, $options)) {
     1661                try {
     1662                    if ($this->Helo) {
     1663                        $hello = $this->Helo;
     1664                    } else {
     1665                        $hello = $this->serverHostname();
     1666                    }
     1667                    $this->smtp->hello($hello);
     1668                    //Automatically enable TLS encryption if:
     1669                    // * it's not disabled
     1670                    // * we have openssl extension
     1671                    // * we are not already using SSL
     1672                    // * the server offers STARTTLS
     1673                    if ($this->SMTPAutoTLS and $sslext and $secure != 'ssl' and $this->smtp->getServerExt('STARTTLS')) {
     1674                        $tls = true;
     1675                    }
     1676                    if ($tls) {
     1677                        if (!$this->smtp->startTLS()) {
     1678                            throw new phpmailerException($this->lang('connect_host'));
     1679                        }
     1680                        // We must resend EHLO after TLS negotiation
     1681                        $this->smtp->hello($hello);
     1682                    }
     1683                    if ($this->SMTPAuth) {
     1684                        if (!$this->smtp->authenticate(
     1685                            $this->Username,
     1686                            $this->Password,
     1687                            $this->AuthType,
     1688                            $this->Realm,
     1689                            $this->Workstation
     1690                        )
     1691                        ) {
     1692                            throw new phpmailerException($this->lang('authenticate'));
     1693                        }
     1694                    }
     1695                    return true;
     1696                } catch (phpmailerException $exc) {
     1697                    $lastexception = $exc;
     1698                    $this->edebug($exc->getMessage());
     1699                    // We must have connected, but then failed TLS or Auth, so close connection nicely
     1700                    $this->smtp->quit();
     1701                }
     1702            }
     1703        }
     1704        // If we get here, all connection attempts have failed, so close connection hard
     1705        $this->smtp->close();
     1706        // As we've caught all exceptions, just report whatever the last one was
     1707        if ($this->exceptions and !is_null($lastexception)) {
     1708            throw $lastexception;
     1709        }
     1710        return false;
     1711    }
     1712
     1713    /**
     1714     * Close the active SMTP session if one exists.
     1715     * @return void
     1716     */
     1717    public function smtpClose()
     1718    {
     1719        if (is_a($this->smtp, 'SMTP')) {
     1720            if ($this->smtp->connected()) {
     1721                $this->smtp->quit();
     1722                $this->smtp->close();
     1723            }
     1724        }
     1725    }
     1726
     1727    /**
     1728     * Set the language for error messages.
     1729     * Returns false if it cannot load the language file.
     1730     * The default language is English.
     1731     * @param string $langcode ISO 639-1 2-character language code (e.g. French is "fr")
     1732     * @param string $lang_path Path to the language file directory, with trailing separator (slash)
     1733     * @return boolean
     1734     * @access public
     1735     */
     1736    public function setLanguage($langcode = 'en', $lang_path = '')
     1737    {
     1738        // Backwards compatibility for renamed language codes
     1739        $renamed_langcodes = array(
     1740            'br' => 'pt_br',
     1741            'cz' => 'cs',
     1742            'dk' => 'da',
     1743            'no' => 'nb',
     1744            'se' => 'sv',
     1745        );
     1746
     1747        if (isset($renamed_langcodes[$langcode])) {
     1748            $langcode = $renamed_langcodes[$langcode];
     1749        }
     1750
     1751        // Define full set of translatable strings in English
     1752        $PHPMAILER_LANG = array(
     1753            'authenticate' => 'SMTP Error: Could not authenticate.',
     1754            'connect_host' => 'SMTP Error: Could not connect to SMTP host.',
     1755            'data_not_accepted' => 'SMTP Error: data not accepted.',
     1756            'empty_message' => 'Message body empty',
     1757            'encoding' => 'Unknown encoding: ',
     1758            'execute' => 'Could not execute: ',
     1759            'file_access' => 'Could not access file: ',
     1760            'file_open' => 'File Error: Could not open file: ',
     1761            'from_failed' => 'The following From address failed: ',
     1762            'instantiate' => 'Could not instantiate mail function.',
     1763            'invalid_address' => 'Invalid address: ',
     1764            'mailer_not_supported' => ' mailer is not supported.',
     1765            'provide_address' => 'You must provide at least one recipient email address.',
     1766            'recipients_failed' => 'SMTP Error: The following recipients failed: ',
     1767            'signing' => 'Signing Error: ',
     1768            'smtp_connect_failed' => 'SMTP connect() failed.',
     1769            'smtp_error' => 'SMTP server error: ',
     1770            'variable_set' => 'Cannot set or reset variable: ',
     1771            'extension_missing' => 'Extension missing: '
     1772        );
     1773        if (empty($lang_path)) {
     1774            // Calculate an absolute path so it can work if CWD is not here
     1775            $lang_path = dirname(__FILE__). DIRECTORY_SEPARATOR . 'language'. DIRECTORY_SEPARATOR;
     1776        }
     1777        //Validate $langcode
     1778        if (!preg_match('/^[a-z]{2}(?:_[a-zA-Z]{2})?$/', $langcode)) {
     1779            $langcode = 'en';
     1780        }
     1781        $foundlang = true;
     1782        $lang_file = $lang_path . 'phpmailer.lang-' . $langcode . '.php';
     1783        // There is no English translation file
     1784        if ($langcode != 'en') {
     1785            // Make sure language file path is readable
     1786            if (!is_readable($lang_file)) {
     1787                $foundlang = false;
     1788            } else {
     1789                // Overwrite language-specific strings.
     1790                // This way we'll never have missing translation keys.
     1791                $foundlang = include $lang_file;
     1792            }
     1793        }
     1794        $this->language = $PHPMAILER_LANG;
     1795        return (boolean)$foundlang; // Returns false if language not found
     1796    }
     1797
     1798    /**
     1799     * Get the array of strings for the current language.
     1800     * @return array
     1801     */
     1802    public function getTranslations()
     1803    {
     1804        return $this->language;
     1805    }
     1806
     1807    /**
     1808     * Create recipient headers.
     1809     * @access public
     1810     * @param string $type
     1811     * @param array $addr An array of recipient,
     1812     * where each recipient is a 2-element indexed array with element 0 containing an address
     1813     * and element 1 containing a name, like:
     1814     * array(array('joe@example.com', 'Joe User'), array('zoe@example.com', 'Zoe User'))
     1815     * @return string
     1816     */
     1817    public function addrAppend($type, $addr)
     1818    {
     1819        $addresses = array();
     1820        foreach ($addr as $address) {
     1821            $addresses[] = $this->addrFormat($address);
     1822        }
     1823        return $type . ': ' . implode(', ', $addresses) . $this->LE;
     1824    }
     1825
     1826    /**
     1827     * Format an address for use in a message header.
     1828     * @access public
     1829     * @param array $addr A 2-element indexed array, element 0 containing an address, element 1 containing a name
     1830     *      like array('joe@example.com', 'Joe User')
     1831     * @return string
     1832     */
     1833    public function addrFormat($addr)
     1834    {
     1835        if (empty($addr[1])) { // No name provided
     1836            return $this->secureHeader($addr[0]);
     1837        } else {
     1838            return $this->encodeHeader($this->secureHeader($addr[1]), 'phrase') . ' <' . $this->secureHeader(
     1839                $addr[0]
     1840            ) . '>';
     1841        }
     1842    }
     1843
     1844    /**
     1845     * Word-wrap message.
     1846     * For use with mailers that do not automatically perform wrapping
     1847     * and for quoted-printable encoded messages.
     1848     * Original written by philippe.
     1849     * @param string $message The message to wrap
     1850     * @param integer $length The line length to wrap to
     1851     * @param boolean $qp_mode Whether to run in Quoted-Printable mode
     1852     * @access public
     1853     * @return string
     1854     */
     1855    public function wrapText($message, $length, $qp_mode = false)
     1856    {
     1857        if ($qp_mode) {
     1858            $soft_break = sprintf(' =%s', $this->LE);
     1859        } else {
     1860            $soft_break = $this->LE;
     1861        }
     1862        // If utf-8 encoding is used, we will need to make sure we don't
     1863        // split multibyte characters when we wrap
     1864        $is_utf8 = (strtolower($this->CharSet) == 'utf-8');
     1865        $lelen = strlen($this->LE);
     1866        $crlflen = strlen(self::CRLF);
     1867
     1868        $message = $this->fixEOL($message);
     1869        //Remove a trailing line break
     1870        if (substr($message, -$lelen) == $this->LE) {
     1871            $message = substr($message, 0, -$lelen);
     1872        }
     1873
     1874        //Split message into lines
     1875        $lines = explode($this->LE, $message);
     1876        //Message will be rebuilt in here
     1877        $message = '';
     1878        foreach ($lines as $line) {
     1879            $words = explode(' ', $line);
     1880            $buf = '';
     1881            $firstword = true;
     1882            foreach ($words as $word) {
     1883                if ($qp_mode and (strlen($word) > $length)) {
     1884                    $space_left = $length - strlen($buf) - $crlflen;
     1885                    if (!$firstword) {
     1886                        if ($space_left > 20) {
     1887                            $len = $space_left;
     1888                            if ($is_utf8) {
     1889                                $len = $this->utf8CharBoundary($word, $len);
     1890                            } elseif (substr($word, $len - 1, 1) == '=') {
     1891                                $len--;
     1892                            } elseif (substr($word, $len - 2, 1) == '=') {
     1893                                $len -= 2;
     1894                            }
     1895                            $part = substr($word, 0, $len);
     1896                            $word = substr($word, $len);
     1897                            $buf .= ' ' . $part;
     1898                            $message .= $buf . sprintf('=%s', self::CRLF);
     1899                        } else {
     1900                            $message .= $buf . $soft_break;
     1901                        }
     1902                        $buf = '';
     1903                    }
     1904                    while (strlen($word) > 0) {
     1905                        if ($length <= 0) {
     1906                            break;
     1907                        }
     1908                        $len = $length;
     1909                        if ($is_utf8) {
     1910                            $len = $this->utf8CharBoundary($word, $len);
     1911                        } elseif (substr($word, $len - 1, 1) == '=') {
     1912                            $len--;
     1913                        } elseif (substr($word, $len - 2, 1) == '=') {
     1914                            $len -= 2;
     1915                        }
     1916                        $part = substr($word, 0, $len);
     1917                        $word = substr($word, $len);
     1918
     1919                        if (strlen($word) > 0) {
     1920                            $message .= $part . sprintf('=%s', self::CRLF);
     1921                        } else {
     1922                            $buf = $part;
     1923                        }
     1924                    }
     1925                } else {
     1926                    $buf_o = $buf;
     1927                    if (!$firstword) {
     1928                        $buf .= ' ';
     1929                    }
     1930                    $buf .= $word;
     1931
     1932                    if (strlen($buf) > $length and $buf_o != '') {
     1933                        $message .= $buf_o . $soft_break;
     1934                        $buf = $word;
     1935                    }
     1936                }
     1937                $firstword = false;
     1938            }
     1939            $message .= $buf . self::CRLF;
     1940        }
     1941
     1942        return $message;
     1943    }
     1944
     1945    /**
     1946     * Find the last character boundary prior to $maxLength in a utf-8
     1947     * quoted-printable encoded string.
     1948     * Original written by Colin Brown.
     1949     * @access public
     1950     * @param string $encodedText utf-8 QP text
     1951     * @param integer $maxLength Find the last character boundary prior to this length
     1952     * @return integer
     1953     */
     1954    public function utf8CharBoundary($encodedText, $maxLength)
     1955    {
     1956        $foundSplitPos = false;
     1957        $lookBack = 3;
     1958        while (!$foundSplitPos) {
     1959            $lastChunk = substr($encodedText, $maxLength - $lookBack, $lookBack);
     1960            $encodedCharPos = strpos($lastChunk, '=');
     1961            if (false !== $encodedCharPos) {
     1962                // Found start of encoded character byte within $lookBack block.
     1963                // Check the encoded byte value (the 2 chars after the '=')
     1964                $hex = substr($encodedText, $maxLength - $lookBack + $encodedCharPos + 1, 2);
     1965                $dec = hexdec($hex);
     1966                if ($dec < 128) {
     1967                    // Single byte character.
     1968                    // If the encoded char was found at pos 0, it will fit
     1969                    // otherwise reduce maxLength to start of the encoded char
     1970                    if ($encodedCharPos > 0) {
     1971                        $maxLength = $maxLength - ($lookBack - $encodedCharPos);
     1972                    }
     1973                    $foundSplitPos = true;
     1974                } elseif ($dec >= 192) {
     1975                    // First byte of a multi byte character
     1976                    // Reduce maxLength to split at start of character
     1977                    $maxLength = $maxLength - ($lookBack - $encodedCharPos);
     1978                    $foundSplitPos = true;
     1979                } elseif ($dec < 192) {
     1980                    // Middle byte of a multi byte character, look further back
     1981                    $lookBack += 3;
     1982                }
     1983            } else {
     1984                // No encoded character found
     1985                $foundSplitPos = true;
     1986            }
     1987        }
     1988        return $maxLength;
     1989    }
     1990
     1991    /**
     1992     * Apply word wrapping to the message body.
     1993     * Wraps the message body to the number of chars set in the WordWrap property.
     1994     * You should only do this to plain-text bodies as wrapping HTML tags may break them.
     1995     * This is called automatically by createBody(), so you don't need to call it yourself.
     1996     * @access public
     1997     * @return void
     1998     */
     1999    public function setWordWrap()
     2000    {
     2001        if ($this->WordWrap < 1) {
     2002            return;
     2003        }
     2004
     2005        switch ($this->message_type) {
     2006            case 'alt':
     2007            case 'alt_inline':
     2008            case 'alt_attach':
     2009            case 'alt_inline_attach':
     2010                $this->AltBody = $this->wrapText($this->AltBody, $this->WordWrap);
     2011                break;
     2012            default:
     2013                $this->Body = $this->wrapText($this->Body, $this->WordWrap);
     2014                break;
     2015        }
     2016    }
     2017
     2018    /**
     2019     * Assemble message headers.
     2020     * @access public
     2021     * @return string The assembled headers
     2022     */
     2023    public function createHeader()
     2024    {
     2025        $result = '';
     2026
     2027        if ($this->MessageDate == '') {
     2028            $this->MessageDate = self::rfcDate();
     2029        }
     2030        $result .= $this->headerLine('Date', $this->MessageDate);
     2031
     2032        // To be created automatically by mail()
     2033        if ($this->SingleTo) {
     2034            if ($this->Mailer != 'mail') {
     2035                foreach ($this->to as $toaddr) {
     2036                    $this->SingleToArray[] = $this->addrFormat($toaddr);
     2037                }
     2038            }
     2039        } else {
     2040            if (count($this->to) > 0) {
     2041                if ($this->Mailer != 'mail') {
     2042                    $result .= $this->addrAppend('To', $this->to);
     2043                }
     2044            } elseif (count($this->cc) == 0) {
     2045                $result .= $this->headerLine('To', 'undisclosed-recipients:;');
     2046            }
     2047        }
     2048
     2049        $result .= $this->addrAppend('From', array(array(trim($this->From), $this->FromName)));
     2050
     2051        // sendmail and mail() extract Cc from the header before sending
     2052        if (count($this->cc) > 0) {
     2053            $result .= $this->addrAppend('Cc', $this->cc);
     2054        }
     2055
     2056        // sendmail and mail() extract Bcc from the header before sending
     2057        if ((
     2058                $this->Mailer == 'sendmail' or $this->Mailer == 'qmail' or $this->Mailer == 'mail'
     2059            )
     2060            and count($this->bcc) > 0
     2061        ) {
     2062            $result .= $this->addrAppend('Bcc', $this->bcc);
     2063        }
     2064
     2065        if (count($this->ReplyTo) > 0) {
     2066            $result .= $this->addrAppend('Reply-To', $this->ReplyTo);
     2067        }
     2068
     2069        // mail() sets the subject itself
     2070        if ($this->Mailer != 'mail') {
     2071            $result .= $this->headerLine('Subject', $this->encodeHeader($this->secureHeader($this->Subject)));
     2072        }
     2073
     2074        // Only allow a custom message ID if it conforms to RFC 5322 section 3.6.4
     2075        // https://tools.ietf.org/html/rfc5322#section-3.6.4
     2076        if ('' != $this->MessageID and preg_match('/^<.*@.*>$/', $this->MessageID)) {
     2077            $this->lastMessageID = $this->MessageID;
     2078        } else {
     2079            $this->lastMessageID = sprintf('<%s@%s>', $this->uniqueid, $this->serverHostname());
     2080        }
     2081        $result .= $this->headerLine('Message-ID', $this->lastMessageID);
     2082        if (!is_null($this->Priority)) {
     2083            $result .= $this->headerLine('X-Priority', $this->Priority);
     2084        }
     2085        if ($this->XMailer == '') {
     2086            $result .= $this->headerLine(
     2087                'X-Mailer',
     2088                'PHPMailer ' . $this->Version . ' (https://github.com/PHPMailer/PHPMailer)'
     2089            );
     2090        } else {
     2091            $myXmailer = trim($this->XMailer);
     2092            if ($myXmailer) {
     2093                $result .= $this->headerLine('X-Mailer', $myXmailer);
     2094            }
     2095        }
     2096
     2097        if ($this->ConfirmReadingTo != '') {
     2098            $result .= $this->headerLine('Disposition-Notification-To', '<' . $this->ConfirmReadingTo . '>');
     2099        }
     2100
     2101        // Add custom headers
     2102        foreach ($this->CustomHeader as $header) {
     2103            $result .= $this->headerLine(
     2104                trim($header[0]),
     2105                $this->encodeHeader(trim($header[1]))
     2106            );
     2107        }
     2108        if (!$this->sign_key_file) {
     2109            $result .= $this->headerLine('MIME-Version', '1.0');
     2110            $result .= $this->getMailMIME();
     2111        }
     2112
     2113        return $result;
     2114    }
     2115
     2116    /**
     2117     * Get the message MIME type headers.
     2118     * @access public
     2119     * @return string
     2120     */
     2121    public function getMailMIME()
     2122    {
     2123        $result = '';
     2124        $ismultipart = true;
     2125        switch ($this->message_type) {
     2126            case 'inline':
     2127                $result .= $this->headerLine('Content-Type', 'multipart/related;');
     2128                $result .= $this->textLine("\tboundary=\"" . $this->boundary[1] . '"');
     2129                break;
     2130            case 'attach':
     2131            case 'inline_attach':
     2132            case 'alt_attach':
     2133            case 'alt_inline_attach':
     2134                $result .= $this->headerLine('Content-Type', 'multipart/mixed;');
     2135                $result .= $this->textLine("\tboundary=\"" . $this->boundary[1] . '"');
     2136                break;
     2137            case 'alt':
     2138            case 'alt_inline':
     2139                $result .= $this->headerLine('Content-Type', 'multipart/alternative;');
     2140                $result .= $this->textLine("\tboundary=\"" . $this->boundary[1] . '"');
     2141                break;
     2142            default:
     2143                // Catches case 'plain': and case '':
     2144                $result .= $this->textLine('Content-Type: ' . $this->ContentType . '; charset=' . $this->CharSet);
     2145                $ismultipart = false;
     2146                break;
     2147        }
     2148        // RFC1341 part 5 says 7bit is assumed if not specified
     2149        if ($this->Encoding != '7bit') {
     2150            // RFC 2045 section 6.4 says multipart MIME parts may only use 7bit, 8bit or binary CTE
     2151            if ($ismultipart) {
     2152                if ($this->Encoding == '8bit') {
     2153                    $result .= $this->headerLine('Content-Transfer-Encoding', '8bit');
     2154                }
     2155                // The only remaining alternatives are quoted-printable and base64, which are both 7bit compatible
     2156            } else {
     2157                $result .= $this->headerLine('Content-Transfer-Encoding', $this->Encoding);
     2158            }
     2159        }
     2160
     2161        if ($this->Mailer != 'mail') {
     2162            $result .= $this->LE;
     2163        }
     2164
     2165        return $result;
     2166    }
     2167
     2168    /**
     2169     * Returns the whole MIME message.
     2170     * Includes complete headers and body.
     2171     * Only valid post preSend().
     2172     * @see PHPMailer::preSend()
     2173     * @access public
     2174     * @return string
     2175     */
     2176    public function getSentMIMEMessage()
     2177    {
     2178        return rtrim($this->MIMEHeader . $this->mailHeader, "\n\r") . self::CRLF . self::CRLF . $this->MIMEBody;
     2179    }
     2180
     2181    /**
     2182     * Create unique ID
     2183     * @return string
     2184     */
     2185    protected function generateId() {
     2186        return md5(uniqid(time()));
     2187    }
     2188
     2189    /**
     2190     * Assemble the message body.
     2191     * Returns an empty string on failure.
     2192     * @access public
     2193     * @throws phpmailerException
     2194     * @return string The assembled message body
     2195     */
     2196    public function createBody()
     2197    {
     2198        $body = '';
     2199        //Create unique IDs and preset boundaries
     2200        $this->uniqueid = $this->generateId();
     2201        $this->boundary[1] = 'b1_' . $this->uniqueid;
     2202        $this->boundary[2] = 'b2_' . $this->uniqueid;
     2203        $this->boundary[3] = 'b3_' . $this->uniqueid;
     2204
     2205        if ($this->sign_key_file) {
     2206            $body .= $this->getMailMIME() . $this->LE;
     2207        }
     2208
     2209        $this->setWordWrap();
     2210
     2211        $bodyEncoding = $this->Encoding;
     2212        $bodyCharSet = $this->CharSet;
     2213        //Can we do a 7-bit downgrade?
     2214        if ($bodyEncoding == '8bit' and !$this->has8bitChars($this->Body)) {
     2215            $bodyEncoding = '7bit';
     2216            //All ISO 8859, Windows codepage and UTF-8 charsets are ascii compatible up to 7-bit
     2217            $bodyCharSet = 'us-ascii';
     2218        }
     2219        //If lines are too long, and we're not already using an encoding that will shorten them,
     2220        //change to quoted-printable transfer encoding for the body part only
     2221        if ('base64' != $this->Encoding and self::hasLineLongerThanMax($this->Body)) {
     2222            $bodyEncoding = 'quoted-printable';
     2223        }
     2224
     2225        $altBodyEncoding = $this->Encoding;
     2226        $altBodyCharSet = $this->CharSet;
     2227        //Can we do a 7-bit downgrade?
     2228        if ($altBodyEncoding == '8bit' and !$this->has8bitChars($this->AltBody)) {
     2229            $altBodyEncoding = '7bit';
     2230            //All ISO 8859, Windows codepage and UTF-8 charsets are ascii compatible up to 7-bit
     2231            $altBodyCharSet = 'us-ascii';
     2232        }
     2233        //If lines are too long, and we're not already using an encoding that will shorten them,
     2234        //change to quoted-printable transfer encoding for the alt body part only
     2235        if ('base64' != $altBodyEncoding and self::hasLineLongerThanMax($this->AltBody)) {
     2236            $altBodyEncoding = 'quoted-printable';
     2237        }
     2238        //Use this as a preamble in all multipart message types
     2239        $mimepre = "This is a multi-part message in MIME format." . $this->LE . $this->LE;
     2240        switch ($this->message_type) {
     2241            case 'inline':
     2242                $body .= $mimepre;
     2243                $body .= $this->getBoundary($this->boundary[1], $bodyCharSet, '', $bodyEncoding);
     2244                $body .= $this->encodeString($this->Body, $bodyEncoding);
     2245                $body .= $this->LE . $this->LE;
     2246                $body .= $this->attachAll('inline', $this->boundary[1]);
     2247                break;
     2248            case 'attach':
     2249                $body .= $mimepre;
     2250                $body .= $this->getBoundary($this->boundary[1], $bodyCharSet, '', $bodyEncoding);
     2251                $body .= $this->encodeString($this->Body, $bodyEncoding);
     2252                $body .= $this->LE . $this->LE;
     2253                $body .= $this->attachAll('attachment', $this->boundary[1]);
     2254                break;
     2255            case 'inline_attach':
     2256                $body .= $mimepre;
     2257                $body .= $this->textLine('--' . $this->boundary[1]);
     2258                $body .= $this->headerLine('Content-Type', 'multipart/related;');
     2259                $body .= $this->textLine("\tboundary=\"" . $this->boundary[2] . '"');
     2260                $body .= $this->LE;
     2261                $body .= $this->getBoundary($this->boundary[2], $bodyCharSet, '', $bodyEncoding);
     2262                $body .= $this->encodeString($this->Body, $bodyEncoding);
     2263                $body .= $this->LE . $this->LE;
     2264                $body .= $this->attachAll('inline', $this->boundary[2]);
     2265                $body .= $this->LE;
     2266                $body .= $this->attachAll('attachment', $this->boundary[1]);
     2267                break;
     2268            case 'alt':
     2269                $body .= $mimepre;
     2270                $body .= $this->getBoundary($this->boundary[1], $altBodyCharSet, 'text/plain', $altBodyEncoding);
     2271                $body .= $this->encodeString($this->AltBody, $altBodyEncoding);
     2272                $body .= $this->LE . $this->LE;
     2273                $body .= $this->getBoundary($this->boundary[1], $bodyCharSet, 'text/html', $bodyEncoding);
     2274                $body .= $this->encodeString($this->Body, $bodyEncoding);
     2275                $body .= $this->LE . $this->LE;
     2276                if (!empty($this->Ical)) {
     2277                    $body .= $this->getBoundary($this->boundary[1], '', 'text/calendar; method=REQUEST', '');
     2278                    $body .= $this->encodeString($this->Ical, $this->Encoding);
     2279                    $body .= $this->LE . $this->LE;
     2280                }
     2281                $body .= $this->endBoundary($this->boundary[1]);
     2282                break;
     2283            case 'alt_inline':
     2284                $body .= $mimepre;
     2285                $body .= $this->getBoundary($this->boundary[1], $altBodyCharSet, 'text/plain', $altBodyEncoding);
     2286                $body .= $this->encodeString($this->AltBody, $altBodyEncoding);
     2287                $body .= $this->LE . $this->LE;
     2288                $body .= $this->textLine('--' . $this->boundary[1]);
     2289                $body .= $this->headerLine('Content-Type', 'multipart/related;');
     2290                $body .= $this->textLine("\tboundary=\"" . $this->boundary[2] . '"');
     2291                $body .= $this->LE;
     2292                $body .= $this->getBoundary($this->boundary[2], $bodyCharSet, 'text/html', $bodyEncoding);
     2293                $body .= $this->encodeString($this->Body, $bodyEncoding);
     2294                $body .= $this->LE . $this->LE;
     2295                $body .= $this->attachAll('inline', $this->boundary[2]);
     2296                $body .= $this->LE;
     2297                $body .= $this->endBoundary($this->boundary[1]);
     2298                break;
     2299            case 'alt_attach':
     2300                $body .= $mimepre;
     2301                $body .= $this->textLine('--' . $this->boundary[1]);
     2302                $body .= $this->headerLine('Content-Type', 'multipart/alternative;');
     2303                $body .= $this->textLine("\tboundary=\"" . $this->boundary[2] . '"');
     2304                $body .= $this->LE;
     2305                $body .= $this->getBoundary($this->boundary[2], $altBodyCharSet, 'text/plain', $altBodyEncoding);
     2306                $body .= $this->encodeString($this->AltBody, $altBodyEncoding);
     2307                $body .= $this->LE . $this->LE;
     2308                $body .= $this->getBoundary($this->boundary[2], $bodyCharSet, 'text/html', $bodyEncoding);
     2309                $body .= $this->encodeString($this->Body, $bodyEncoding);
     2310                $body .= $this->LE . $this->LE;
     2311                $body .= $this->endBoundary($this->boundary[2]);
     2312                $body .= $this->LE;
     2313                $body .= $this->attachAll('attachment', $this->boundary[1]);
     2314                break;
     2315            case 'alt_inline_attach':
     2316                $body .= $mimepre;
     2317                $body .= $this->textLine('--' . $this->boundary[1]);
     2318                $body .= $this->headerLine('Content-Type', 'multipart/alternative;');
     2319                $body .= $this->textLine("\tboundary=\"" . $this->boundary[2] . '"');
     2320                $body .= $this->LE;
     2321                $body .= $this->getBoundary($this->boundary[2], $altBodyCharSet, 'text/plain', $altBodyEncoding);
     2322                $body .= $this->encodeString($this->AltBody, $altBodyEncoding);
     2323                $body .= $this->LE . $this->LE;
     2324                $body .= $this->textLine('--' . $this->boundary[2]);
     2325                $body .= $this->headerLine('Content-Type', 'multipart/related;');
     2326                $body .= $this->textLine("\tboundary=\"" . $this->boundary[3] . '"');
     2327                $body .= $this->LE;
     2328                $body .= $this->getBoundary($this->boundary[3], $bodyCharSet, 'text/html', $bodyEncoding);
     2329                $body .= $this->encodeString($this->Body, $bodyEncoding);
     2330                $body .= $this->LE . $this->LE;
     2331                $body .= $this->attachAll('inline', $this->boundary[3]);
     2332                $body .= $this->LE;
     2333                $body .= $this->endBoundary($this->boundary[2]);
     2334                $body .= $this->LE;
     2335                $body .= $this->attachAll('attachment', $this->boundary[1]);
     2336                break;
     2337            default:
     2338                // Catch case 'plain' and case '', applies to simple `text/plain` and `text/html` body content types
     2339                //Reset the `Encoding` property in case we changed it for line length reasons
     2340                $this->Encoding = $bodyEncoding;
     2341                $body .= $this->encodeString($this->Body, $this->Encoding);
     2342                break;
     2343        }
     2344
     2345        if ($this->isError()) {
     2346            $body = '';
     2347        } elseif ($this->sign_key_file) {
     2348            try {
     2349                if (!defined('PKCS7_TEXT')) {
     2350                    throw new phpmailerException($this->lang('extension_missing') . 'openssl');
     2351                }
     2352                // @TODO would be nice to use php://temp streams here, but need to wrap for PHP < 5.1
     2353                $file = tempnam(sys_get_temp_dir(), 'mail');
     2354                if (false === file_put_contents($file, $body)) {
     2355                    throw new phpmailerException($this->lang('signing') . ' Could not write temp file');
     2356                }
     2357                $signed = tempnam(sys_get_temp_dir(), 'signed');
     2358                //Workaround for PHP bug https://bugs.php.net/bug.php?id=69197
     2359                if (empty($this->sign_extracerts_file)) {
     2360                    $sign = @openssl_pkcs7_sign(
     2361                        $file,
     2362                        $signed,
     2363                        'file://' . realpath($this->sign_cert_file),
     2364                        array('file://' . realpath($this->sign_key_file), $this->sign_key_pass),
     2365                        null
     2366                    );
     2367                } else {
     2368                    $sign = @openssl_pkcs7_sign(
     2369                        $file,
     2370                        $signed,
     2371                        'file://' . realpath($this->sign_cert_file),
     2372                        array('file://' . realpath($this->sign_key_file), $this->sign_key_pass),
     2373                        null,
     2374                        PKCS7_DETACHED,
     2375                        $this->sign_extracerts_file
     2376                    );
     2377                }
     2378                if ($sign) {
     2379                    @unlink($file);
     2380                    $body = file_get_contents($signed);
     2381                    @unlink($signed);
     2382                    //The message returned by openssl contains both headers and body, so need to split them up
     2383                    $parts = explode("\n\n", $body, 2);
     2384                    $this->MIMEHeader .= $parts[0] . $this->LE . $this->LE;
     2385                    $body = $parts[1];
     2386                } else {
     2387                    @unlink($file);
     2388                    @unlink($signed);
     2389                    throw new phpmailerException($this->lang('signing') . openssl_error_string());
     2390                }
     2391            } catch (phpmailerException $exc) {
     2392                $body = '';
     2393                if ($this->exceptions) {
     2394                    throw $exc;
     2395                }
     2396            }
     2397        }
     2398        return $body;
     2399    }
     2400
     2401    /**
     2402     * Return the start of a message boundary.
     2403     * @access protected
     2404     * @param string $boundary
     2405     * @param string $charSet
     2406     * @param string $contentType
     2407     * @param string $encoding
     2408     * @return string
     2409     */
     2410    protected function getBoundary($boundary, $charSet, $contentType, $encoding)
     2411    {
     2412        $result = '';
     2413        if ($charSet == '') {
     2414            $charSet = $this->CharSet;
     2415        }
     2416        if ($contentType == '') {
     2417            $contentType = $this->ContentType;
     2418        }
     2419        if ($encoding == '') {
     2420            $encoding = $this->Encoding;
     2421        }
     2422        $result .= $this->textLine('--' . $boundary);
     2423        $result .= sprintf('Content-Type: %s; charset=%s', $contentType, $charSet);
     2424        $result .= $this->LE;
     2425        // RFC1341 part 5 says 7bit is assumed if not specified
     2426        if ($encoding != '7bit') {
     2427            $result .= $this->headerLine('Content-Transfer-Encoding', $encoding);
     2428        }
     2429        $result .= $this->LE;
     2430
     2431        return $result;
     2432    }
     2433
     2434    /**
     2435     * Return the end of a message boundary.
     2436     * @access protected
     2437     * @param string $boundary
     2438     * @return string
     2439     */
     2440    protected function endBoundary($boundary)
     2441    {
     2442        return $this->LE . '--' . $boundary . '--' . $this->LE;
     2443    }
     2444
     2445    /**
     2446     * Set the message type.
     2447     * PHPMailer only supports some preset message types, not arbitrary MIME structures.
     2448     * @access protected
     2449     * @return void
     2450     */
     2451    protected function setMessageType()
     2452    {
     2453        $type = array();
     2454        if ($this->alternativeExists()) {
     2455            $type[] = 'alt';
     2456        }
     2457        if ($this->inlineImageExists()) {
     2458            $type[] = 'inline';
     2459        }
     2460        if ($this->attachmentExists()) {
     2461            $type[] = 'attach';
     2462        }
     2463        $this->message_type = implode('_', $type);
     2464        if ($this->message_type == '') {
     2465            //The 'plain' message_type refers to the message having a single body element, not that it is plain-text
     2466            $this->message_type = 'plain';
     2467        }
     2468    }
     2469
     2470    /**
     2471     * Format a header line.
     2472     * @access public
     2473     * @param string $name
     2474     * @param string $value
     2475     * @return string
     2476     */
     2477    public function headerLine($name, $value)
     2478    {
     2479        return $name . ': ' . $value . $this->LE;
     2480    }
     2481
     2482    /**
     2483     * Return a formatted mail line.
     2484     * @access public
     2485     * @param string $value
     2486     * @return string
     2487     */
     2488    public function textLine($value)
     2489    {
     2490        return $value . $this->LE;
     2491    }
     2492
     2493    /**
     2494     * Add an attachment from a path on the filesystem.
     2495     * Never use a user-supplied path to a file!
     2496     * Returns false if the file could not be found or read.
     2497     * @param string $path Path to the attachment.
     2498     * @param string $name Overrides the attachment name.
     2499     * @param string $encoding File encoding (see $Encoding).
     2500     * @param string $type File extension (MIME) type.
     2501     * @param string $disposition Disposition to use
     2502     * @throws phpmailerException
     2503     * @return boolean
     2504     */
     2505    public function addAttachment($path, $name = '', $encoding = 'base64', $type = '', $disposition = 'attachment')
     2506    {
     2507        try {
     2508            if (!@is_file($path)) {
     2509                throw new phpmailerException($this->lang('file_access') . $path, self::STOP_CONTINUE);
     2510            }
     2511
     2512            // If a MIME type is not specified, try to work it out from the file name
     2513            if ($type == '') {
     2514                $type = self::filenameToType($path);
     2515            }
     2516
     2517            $filename = basename($path);
     2518            if ($name == '') {
     2519                $name = $filename;
     2520            }
     2521
     2522            $this->attachment[] = array(
     2523                0 => $path,
     2524                1 => $filename,
     2525                2 => $name,
     2526                3 => $encoding,
     2527                4 => $type,
     2528                5 => false, // isStringAttachment
     2529                6 => $disposition,
     2530                7 => 0
     2531            );
     2532
     2533        } catch (phpmailerException $exc) {
     2534            $this->setError($exc->getMessage());
     2535            $this->edebug($exc->getMessage());
     2536            if ($this->exceptions) {
     2537                throw $exc;
     2538            }
     2539            return false;
     2540        }
     2541        return true;
     2542    }
     2543
     2544    /**
     2545     * Return the array of attachments.
     2546     * @return array
     2547     */
     2548    public function getAttachments()
     2549    {
     2550        return $this->attachment;
     2551    }
     2552
     2553    /**
     2554     * Attach all file, string, and binary attachments to the message.
     2555     * Returns an empty string on failure.
     2556     * @access protected
     2557     * @param string $disposition_type
     2558     * @param string $boundary
     2559     * @return string
     2560     */
     2561    protected function attachAll($disposition_type, $boundary)
     2562    {
     2563        // Return text of body
     2564        $mime = array();
     2565        $cidUniq = array();
     2566        $incl = array();
     2567
     2568        // Add all attachments
     2569        foreach ($this->attachment as $attachment) {
     2570            // Check if it is a valid disposition_filter
     2571            if ($attachment[6] == $disposition_type) {
     2572                // Check for string attachment
     2573                $string = '';
     2574                $path = '';
     2575                $bString = $attachment[5];
     2576                if ($bString) {
     2577                    $string = $attachment[0];
     2578                } else {
     2579                    $path = $attachment[0];
     2580                }
     2581
     2582                $inclhash = md5(serialize($attachment));
     2583                if (in_array($inclhash, $incl)) {
     2584                    continue;
     2585                }
     2586                $incl[] = $inclhash;
     2587                $name = $attachment[2];
     2588                $encoding = $attachment[3];
     2589                $type = $attachment[4];
     2590                $disposition = $attachment[6];
     2591                $cid = $attachment[7];
     2592                if ($disposition == 'inline' && array_key_exists($cid, $cidUniq)) {
     2593                    continue;
     2594                }
     2595                $cidUniq[$cid] = true;
     2596
     2597                $mime[] = sprintf('--%s%s', $boundary, $this->LE);
     2598                //Only include a filename property if we have one
     2599                if (!empty($name)) {
     2600                    $mime[] = sprintf(
     2601                        'Content-Type: %s; name="%s"%s',
     2602                        $type,
     2603                        $this->encodeHeader($this->secureHeader($name)),
     2604                        $this->LE
     2605                    );
     2606                } else {
     2607                    $mime[] = sprintf(
     2608                        'Content-Type: %s%s',
     2609                        $type,
     2610                        $this->LE
     2611                    );
     2612                }
     2613                // RFC1341 part 5 says 7bit is assumed if not specified
     2614                if ($encoding != '7bit') {
     2615                    $mime[] = sprintf('Content-Transfer-Encoding: %s%s', $encoding, $this->LE);
     2616                }
     2617
     2618                if ($disposition == 'inline') {
     2619                    $mime[] = sprintf('Content-ID: <%s>%s', $cid, $this->LE);
     2620                }
     2621
     2622                // If a filename contains any of these chars, it should be quoted,
     2623                // but not otherwise: RFC2183 & RFC2045 5.1
     2624                // Fixes a warning in IETF's msglint MIME checker
     2625                // Allow for bypassing the Content-Disposition header totally
     2626                if (!(empty($disposition))) {
     2627                    $encoded_name = $this->encodeHeader($this->secureHeader($name));
     2628                    if (preg_match('/[ \(\)<>@,;:\\"\/\[\]\?=]/', $encoded_name)) {
     2629                        $mime[] = sprintf(
     2630                            'Content-Disposition: %s; filename="%s"%s',
     2631                            $disposition,
     2632                            $encoded_name,
     2633                            $this->LE . $this->LE
     2634                        );
     2635                    } else {
     2636                        if (!empty($encoded_name)) {
     2637                            $mime[] = sprintf(
     2638                                'Content-Disposition: %s; filename=%s%s',
     2639                                $disposition,
     2640                                $encoded_name,
     2641                                $this->LE . $this->LE
     2642                            );
     2643                        } else {
     2644                            $mime[] = sprintf(
     2645                                'Content-Disposition: %s%s',
     2646                                $disposition,
     2647                                $this->LE . $this->LE
     2648                            );
     2649                        }
     2650                    }
     2651                } else {
     2652                    $mime[] = $this->LE;
     2653                }
     2654
     2655                // Encode as string attachment
     2656                if ($bString) {
     2657                    $mime[] = $this->encodeString($string, $encoding);
     2658                    if ($this->isError()) {
     2659                        return '';
     2660                    }
     2661                    $mime[] = $this->LE . $this->LE;
     2662                } else {
     2663                    $mime[] = $this->encodeFile($path, $encoding);
     2664                    if ($this->isError()) {
     2665                        return '';
     2666                    }
     2667                    $mime[] = $this->LE . $this->LE;
     2668                }
     2669            }
     2670        }
     2671
     2672        $mime[] = sprintf('--%s--%s', $boundary, $this->LE);
     2673
     2674        return implode('', $mime);
     2675    }
     2676
     2677    /**
     2678     * Encode a file attachment in requested format.
     2679     * Returns an empty string on failure.
     2680     * @param string $path The full path to the file
     2681     * @param string $encoding The encoding to use; one of 'base64', '7bit', '8bit', 'binary', 'quoted-printable'
     2682     * @throws phpmailerException
     2683     * @access protected
     2684     * @return string
     2685     */
     2686    protected function encodeFile($path, $encoding = 'base64')
     2687    {
     2688        try {
     2689            if (!is_readable($path)) {
     2690                throw new phpmailerException($this->lang('file_open') . $path, self::STOP_CONTINUE);
     2691            }
     2692            $magic_quotes = get_magic_quotes_runtime();
     2693            if ($magic_quotes) {
     2694                if (version_compare(PHP_VERSION, '5.3.0', '<')) {
     2695                    set_magic_quotes_runtime(false);
     2696                } else {
     2697                    //Doesn't exist in PHP 5.4, but we don't need to check because
     2698                    //get_magic_quotes_runtime always returns false in 5.4+
     2699                    //so it will never get here
     2700                    ini_set('magic_quotes_runtime', false);
     2701                }
     2702            }
     2703            $file_buffer = file_get_contents($path);
     2704            $file_buffer = $this->encodeString($file_buffer, $encoding);
     2705            if ($magic_quotes) {
     2706                if (version_compare(PHP_VERSION, '5.3.0', '<')) {
     2707                    set_magic_quotes_runtime($magic_quotes);
     2708                } else {
     2709                    ini_set('magic_quotes_runtime', $magic_quotes);
     2710                }
     2711            }
     2712            return $file_buffer;
     2713        } catch (Exception $exc) {
     2714            $this->setError($exc->getMessage());
     2715            return '';
     2716        }
     2717    }
     2718
     2719    /**
     2720     * Encode a string in requested format.
     2721     * Returns an empty string on failure.
     2722     * @param string $str The text to encode
     2723     * @param string $encoding The encoding to use; one of 'base64', '7bit', '8bit', 'binary', 'quoted-printable'
     2724     * @access public
     2725     * @return string
     2726     */
     2727    public function encodeString($str, $encoding = 'base64')
     2728    {
     2729        $encoded = '';
     2730        switch (strtolower($encoding)) {
     2731            case 'base64':
     2732                $encoded = chunk_split(base64_encode($str), 76, $this->LE);
     2733                break;
     2734            case '7bit':
     2735            case '8bit':
     2736                $encoded = $this->fixEOL($str);
     2737                // Make sure it ends with a line break
     2738                if (substr($encoded, -(strlen($this->LE))) != $this->LE) {
     2739                    $encoded .= $this->LE;
     2740                }
     2741                break;
     2742            case 'binary':
     2743                $encoded = $str;
     2744                break;
     2745            case 'quoted-printable':
     2746                $encoded = $this->encodeQP($str);
     2747                break;
     2748            default:
     2749                $this->setError($this->lang('encoding') . $encoding);
     2750                break;
     2751        }
     2752        return $encoded;
     2753    }
     2754
     2755    /**
     2756     * Encode a header string optimally.
     2757     * Picks shortest of Q, B, quoted-printable or none.
     2758     * @access public
     2759     * @param string $str
     2760     * @param string $position
     2761     * @return string
     2762     */
     2763    public function encodeHeader($str, $position = 'text')
     2764    {
     2765        $matchcount = 0;
     2766        switch (strtolower($position)) {
     2767            case 'phrase':
     2768                if (!preg_match('/[\200-\377]/', $str)) {
     2769                    // Can't use addslashes as we don't know the value of magic_quotes_sybase
     2770                    $encoded = addcslashes($str, "\0..\37\177\\\"");
     2771                    if (($str == $encoded) && !preg_match('/[^A-Za-z0-9!#$%&\'*+\/=?^_`{|}~ -]/', $str)) {
     2772                        return ($encoded);
     2773                    } else {
     2774                        return ("\"$encoded\"");
     2775                    }
     2776                }
     2777                $matchcount = preg_match_all('/[^\040\041\043-\133\135-\176]/', $str, $matches);
     2778                break;
     2779            /** @noinspection PhpMissingBreakStatementInspection */
     2780            case 'comment':
     2781                $matchcount = preg_match_all('/[()"]/', $str, $matches);
     2782                // Intentional fall-through
     2783            case 'text':
     2784            default:
     2785                $matchcount += preg_match_all('/[\000-\010\013\014\016-\037\177-\377]/', $str, $matches);
     2786                break;
     2787        }
     2788
     2789        //There are no chars that need encoding
     2790        if ($matchcount == 0) {
     2791            return ($str);
     2792        }
     2793
     2794        $maxlen = 75 - 7 - strlen($this->CharSet);
     2795        // Try to select the encoding which should produce the shortest output
     2796        if ($matchcount > strlen($str) / 3) {
     2797            // More than a third of the content will need encoding, so B encoding will be most efficient
     2798            $encoding = 'B';
     2799            if (function_exists('mb_strlen') && $this->hasMultiBytes($str)) {
     2800                // Use a custom function which correctly encodes and wraps long
     2801                // multibyte strings without breaking lines within a character
     2802                $encoded = $this->base64EncodeWrapMB($str, "\n");
     2803            } else {
     2804                $encoded = base64_encode($str);
     2805                $maxlen -= $maxlen % 4;
     2806                $encoded = trim(chunk_split($encoded, $maxlen, "\n"));
     2807            }
     2808        } else {
     2809            $encoding = 'Q';
     2810            $encoded = $this->encodeQ($str, $position);
     2811            $encoded = $this->wrapText($encoded, $maxlen, true);
     2812            $encoded = str_replace('=' . self::CRLF, "\n", trim($encoded));
     2813        }
     2814
     2815        $encoded = preg_replace('/^(.*)$/m', ' =?' . $this->CharSet . "?$encoding?\\1?=", $encoded);
     2816        $encoded = trim(str_replace("\n", $this->LE, $encoded));
     2817
     2818        return $encoded;
     2819    }
     2820
     2821    /**
     2822     * Check if a string contains multi-byte characters.
     2823     * @access public
     2824     * @param string $str multi-byte text to wrap encode
     2825     * @return boolean
     2826     */
     2827    public function hasMultiBytes($str)
     2828    {
     2829        if (function_exists('mb_strlen')) {
     2830            return (strlen($str) > mb_strlen($str, $this->CharSet));
     2831        } else { // Assume no multibytes (we can't handle without mbstring functions anyway)
     2832            return false;
     2833        }
     2834    }
     2835
     2836    /**
     2837     * Does a string contain any 8-bit chars (in any charset)?
     2838     * @param string $text
     2839     * @return boolean
     2840     */
     2841    public function has8bitChars($text)
     2842    {
     2843        return (boolean)preg_match('/[\x80-\xFF]/', $text);
     2844    }
     2845
     2846    /**
     2847     * Encode and wrap long multibyte strings for mail headers
     2848     * without breaking lines within a character.
     2849     * Adapted from a function by paravoid
     2850     * @link http://www.php.net/manual/en/function.mb-encode-mimeheader.php#60283
     2851     * @access public
     2852     * @param string $str multi-byte text to wrap encode
     2853     * @param string $linebreak string to use as linefeed/end-of-line
     2854     * @return string
     2855     */
     2856    public function base64EncodeWrapMB($str, $linebreak = null)
     2857    {
     2858        $start = '=?' . $this->CharSet . '?B?';
     2859        $end = '?=';
     2860        $encoded = '';
     2861        if ($linebreak === null) {
     2862            $linebreak = $this->LE;
     2863        }
     2864
     2865        $mb_length = mb_strlen($str, $this->CharSet);
     2866        // Each line must have length <= 75, including $start and $end
     2867        $length = 75 - strlen($start) - strlen($end);
     2868        // Average multi-byte ratio
     2869        $ratio = $mb_length / strlen($str);
     2870        // Base64 has a 4:3 ratio
     2871        $avgLength = floor($length * $ratio * .75);
     2872
     2873        for ($i = 0; $i < $mb_length; $i += $offset) {
     2874            $lookBack = 0;
     2875            do {
     2876                $offset = $avgLength - $lookBack;
     2877                $chunk = mb_substr($str, $i, $offset, $this->CharSet);
     2878                $chunk = base64_encode($chunk);
     2879                $lookBack++;
     2880            } while (strlen($chunk) > $length);
     2881            $encoded .= $chunk . $linebreak;
     2882        }
     2883
     2884        // Chomp the last linefeed
     2885        $encoded = substr($encoded, 0, -strlen($linebreak));
     2886        return $encoded;
     2887    }
     2888
     2889    /**
     2890     * Encode a string in quoted-printable format.
     2891     * According to RFC2045 section 6.7.
     2892     * @access public
     2893     * @param string $string The text to encode
     2894     * @param integer $line_max Number of chars allowed on a line before wrapping
     2895     * @return string
     2896     * @link http://www.php.net/manual/en/function.quoted-printable-decode.php#89417 Adapted from this comment
     2897     */
     2898    public function encodeQP($string, $line_max = 76)
     2899    {
     2900        // Use native function if it's available (>= PHP5.3)
     2901        if (function_exists('quoted_printable_encode')) {
     2902            return quoted_printable_encode($string);
     2903        }
     2904        // Fall back to a pure PHP implementation
     2905        $string = str_replace(
     2906            array('%20', '%0D%0A.', '%0D%0A', '%'),
     2907            array(' ', "\r\n=2E", "\r\n", '='),
     2908            rawurlencode($string)
     2909        );
     2910        return preg_replace('/[^\r\n]{' . ($line_max - 3) . '}[^=\r\n]{2}/', "$0=\r\n", $string);
     2911    }
     2912
     2913    /**
     2914     * Backward compatibility wrapper for an old QP encoding function that was removed.
     2915     * @see PHPMailer::encodeQP()
     2916     * @access public
     2917     * @param string $string
     2918     * @param integer $line_max
     2919     * @param boolean $space_conv
     2920     * @return string
     2921     * @deprecated Use encodeQP instead.
     2922     */
     2923    public function encodeQPphp(
     2924        $string,
     2925        $line_max = 76,
     2926        /** @noinspection PhpUnusedParameterInspection */ $space_conv = false
     2927    ) {
     2928        return $this->encodeQP($string, $line_max);
     2929    }
     2930
     2931    /**
     2932     * Encode a string using Q encoding.
     2933     * @link http://tools.ietf.org/html/rfc2047
     2934     * @param string $str the text to encode
     2935     * @param string $position Where the text is going to be used, see the RFC for what that means
     2936     * @access public
     2937     * @return string
     2938     */
     2939    public function encodeQ($str, $position = 'text')
     2940    {
     2941        // There should not be any EOL in the string
     2942        $pattern = '';
     2943        $encoded = str_replace(array("\r", "\n"), '', $str);
     2944        switch (strtolower($position)) {
     2945            case 'phrase':
     2946                // RFC 2047 section 5.3
     2947                $pattern = '^A-Za-z0-9!*+\/ -';
     2948                break;
     2949            /** @noinspection PhpMissingBreakStatementInspection */
     2950            case 'comment':
     2951                // RFC 2047 section 5.2
     2952                $pattern = '\(\)"';
     2953                // intentional fall-through
     2954                // for this reason we build the $pattern without including delimiters and []
     2955            case 'text':
     2956            default:
     2957                // RFC 2047 section 5.1
     2958                // Replace every high ascii, control, =, ? and _ characters
     2959                $pattern = '\000-\011\013\014\016-\037\075\077\137\177-\377' . $pattern;
     2960                break;
     2961        }
     2962        $matches = array();
     2963        if (preg_match_all("/[{$pattern}]/", $encoded, $matches)) {
     2964            // If the string contains an '=', make sure it's the first thing we replace
     2965            // so as to avoid double-encoding
     2966            $eqkey = array_search('=', $matches[0]);
     2967            if (false !== $eqkey) {
     2968                unset($matches[0][$eqkey]);
     2969                array_unshift($matches[0], '=');
     2970            }
     2971            foreach (array_unique($matches[0]) as $char) {
     2972                $encoded = str_replace($char, '=' . sprintf('%02X', ord($char)), $encoded);
     2973            }
     2974        }
     2975        // Replace every spaces to _ (more readable than =20)
     2976        return str_replace(' ', '_', $encoded);
     2977    }
     2978
     2979    /**
     2980     * Add a string or binary attachment (non-filesystem).
     2981     * This method can be used to attach ascii or binary data,
     2982     * such as a BLOB record from a database.
     2983     * @param string $string String attachment data.
     2984     * @param string $filename Name of the attachment.
     2985     * @param string $encoding File encoding (see $Encoding).
     2986     * @param string $type File extension (MIME) type.
     2987     * @param string $disposition Disposition to use
     2988     * @return void
     2989     */
     2990    public function addStringAttachment(
     2991        $string,
     2992        $filename,
     2993        $encoding = 'base64',
     2994        $type = '',
     2995        $disposition = 'attachment'
     2996    ) {
     2997        // If a MIME type is not specified, try to work it out from the file name
     2998        if ($type == '') {
     2999            $type = self::filenameToType($filename);
     3000        }
     3001        // Append to $attachment array
     3002        $this->attachment[] = array(
     3003            0 => $string,
     3004            1 => $filename,
     3005            2 => basename($filename),
     3006            3 => $encoding,
     3007            4 => $type,
     3008            5 => true, // isStringAttachment
     3009            6 => $disposition,
     3010            7 => 0
     3011        );
     3012    }
     3013
     3014    /**
     3015     * Add an embedded (inline) attachment from a file.
     3016     * This can include images, sounds, and just about any other document type.
     3017     * These differ from 'regular' attachments in that they are intended to be
     3018     * displayed inline with the message, not just attached for download.
     3019     * This is used in HTML messages that embed the images
     3020     * the HTML refers to using the $cid value.
     3021     * Never use a user-supplied path to a file!
     3022     * @param string $path Path to the attachment.
     3023     * @param string $cid Content ID of the attachment; Use this to reference
     3024     *        the content when using an embedded image in HTML.
     3025     * @param string $name Overrides the attachment name.
     3026     * @param string $encoding File encoding (see $Encoding).
     3027     * @param string $type File MIME type.
     3028     * @param string $disposition Disposition to use
     3029     * @return boolean True on successfully adding an attachment
     3030     */
     3031    public function addEmbeddedImage($path, $cid, $name = '', $encoding = 'base64', $type = '', $disposition = 'inline')
     3032    {
     3033        if (!@is_file($path)) {
     3034            $this->setError($this->lang('file_access') . $path);
     3035            return false;
     3036        }
     3037
     3038        // If a MIME type is not specified, try to work it out from the file name
     3039        if ($type == '') {
     3040            $type = self::filenameToType($path);
     3041        }
     3042
     3043        $filename = basename($path);
     3044        if ($name == '') {
     3045            $name = $filename;
     3046        }
     3047
     3048        // Append to $attachment array
     3049        $this->attachment[] = array(
     3050            0 => $path,
     3051            1 => $filename,
     3052            2 => $name,
     3053            3 => $encoding,
     3054            4 => $type,
     3055            5 => false, // isStringAttachment
     3056            6 => $disposition,
     3057            7 => $cid
     3058        );
     3059        return true;
     3060    }
     3061
     3062    /**
     3063     * Add an embedded stringified attachment.
     3064     * This can include images, sounds, and just about any other document type.
     3065     * Be sure to set the $type to an image type for images:
     3066     * JPEG images use 'image/jpeg', GIF uses 'image/gif', PNG uses 'image/png'.
     3067     * @param string $string The attachment binary data.
     3068     * @param string $cid Content ID of the attachment; Use this to reference
     3069     *        the content when using an embedded image in HTML.
     3070     * @param string $name
     3071     * @param string $encoding File encoding (see $Encoding).
     3072     * @param string $type MIME type.
     3073     * @param string $disposition Disposition to use
     3074     * @return boolean True on successfully adding an attachment
     3075     */
     3076    public function addStringEmbeddedImage(
     3077        $string,
     3078        $cid,
     3079        $name = '',
     3080        $encoding = 'base64',
     3081        $type = '',
     3082        $disposition = 'inline'
     3083    ) {
     3084        // If a MIME type is not specified, try to work it out from the name
     3085        if ($type == '' and !empty($name)) {
     3086            $type = self::filenameToType($name);
     3087        }
     3088
     3089        // Append to $attachment array
     3090        $this->attachment[] = array(
     3091            0 => $string,
     3092            1 => $name,
     3093            2 => $name,
     3094            3 => $encoding,
     3095            4 => $type,
     3096            5 => true, // isStringAttachment
     3097            6 => $disposition,
     3098            7 => $cid
     3099        );
     3100        return true;
     3101    }
     3102
     3103    /**
     3104     * Check if an inline attachment is present.
     3105     * @access public
     3106     * @return boolean
     3107     */
     3108    public function inlineImageExists()
     3109    {
     3110        foreach ($this->attachment as $attachment) {
     3111            if ($attachment[6] == 'inline') {
     3112                return true;
     3113            }
     3114        }
     3115        return false;
     3116    }
     3117
     3118    /**
     3119     * Check if an attachment (non-inline) is present.
     3120     * @return boolean
     3121     */
     3122    public function attachmentExists()
     3123    {
     3124        foreach ($this->attachment as $attachment) {
     3125            if ($attachment[6] == 'attachment') {
     3126                return true;
     3127            }
     3128        }
     3129        return false;
     3130    }
     3131
     3132    /**
     3133     * Check if this message has an alternative body set.
     3134     * @return boolean
     3135     */
     3136    public function alternativeExists()
     3137    {
     3138        return !empty($this->AltBody);
     3139    }
     3140
     3141    /**
     3142     * Clear queued addresses of given kind.
     3143     * @access protected
     3144     * @param string $kind 'to', 'cc', or 'bcc'
     3145     * @return void
     3146     */
     3147    public function clearQueuedAddresses($kind)
     3148    {
     3149        $RecipientsQueue = $this->RecipientsQueue;
     3150        foreach ($RecipientsQueue as $address => $params) {
     3151            if ($params[0] == $kind) {
     3152                unset($this->RecipientsQueue[$address]);
     3153            }
     3154        }
     3155    }
     3156
     3157    /**
     3158     * Clear all To recipients.
     3159     * @return void
     3160     */
     3161    public function clearAddresses()
     3162    {
     3163        foreach ($this->to as $to) {
     3164            unset($this->all_recipients[strtolower($to[0])]);
     3165        }
     3166        $this->to = array();
     3167        $this->clearQueuedAddresses('to');
     3168    }
     3169
     3170    /**
     3171     * Clear all CC recipients.
     3172     * @return void
     3173     */
     3174    public function clearCCs()
     3175    {
     3176        foreach ($this->cc as $cc) {
     3177            unset($this->all_recipients[strtolower($cc[0])]);
     3178        }
     3179        $this->cc = array();
     3180        $this->clearQueuedAddresses('cc');
     3181    }
     3182
     3183    /**
     3184     * Clear all BCC recipients.
     3185     * @return void
     3186     */
     3187    public function clearBCCs()
     3188    {
     3189        foreach ($this->bcc as $bcc) {
     3190            unset($this->all_recipients[strtolower($bcc[0])]);
     3191        }
     3192        $this->bcc = array();
     3193        $this->clearQueuedAddresses('bcc');
     3194    }
     3195
     3196    /**
     3197     * Clear all ReplyTo recipients.
     3198     * @return void
     3199     */
     3200    public function clearReplyTos()
     3201    {
     3202        $this->ReplyTo = array();
     3203        $this->ReplyToQueue = array();
     3204    }
     3205
     3206    /**
     3207     * Clear all recipient types.
     3208     * @return void
     3209     */
     3210    public function clearAllRecipients()
     3211    {
     3212        $this->to = array();
     3213        $this->cc = array();
     3214        $this->bcc = array();
     3215        $this->all_recipients = array();
     3216        $this->RecipientsQueue = array();
     3217    }
     3218
     3219    /**
     3220     * Clear all filesystem, string, and binary attachments.
     3221     * @return void
     3222     */
     3223    public function clearAttachments()
     3224    {
     3225        $this->attachment = array();
     3226    }
     3227
     3228    /**
     3229     * Clear all custom headers.
     3230     * @return void
     3231     */
     3232    public function clearCustomHeaders()
     3233    {
     3234        $this->CustomHeader = array();
     3235    }
     3236
     3237    /**
     3238     * Add an error message to the error container.
     3239     * @access protected
     3240     * @param string $msg
     3241     * @return void
     3242     */
     3243    protected function setError($msg)
     3244    {
     3245        $this->error_count++;
     3246        if ($this->Mailer == 'smtp' and !is_null($this->smtp)) {
     3247            $lasterror = $this->smtp->getError();
     3248            if (!empty($lasterror['error'])) {
     3249                $msg .= $this->lang('smtp_error') . $lasterror['error'];
     3250                if (!empty($lasterror['detail'])) {
     3251                    $msg .= ' Detail: '. $lasterror['detail'];
     3252                }
     3253                if (!empty($lasterror['smtp_code'])) {
     3254                    $msg .= ' SMTP code: ' . $lasterror['smtp_code'];
     3255                }
     3256                if (!empty($lasterror['smtp_code_ex'])) {
     3257                    $msg .= ' Additional SMTP info: ' . $lasterror['smtp_code_ex'];
     3258                }
     3259            }
     3260        }
     3261        $this->ErrorInfo = $msg;
     3262    }
     3263
     3264    /**
     3265     * Return an RFC 822 formatted date.
     3266     * @access public
     3267     * @return string
     3268     * @static
     3269     */
     3270    public static function rfcDate()
     3271    {
     3272        // Set the time zone to whatever the default is to avoid 500 errors
     3273        // Will default to UTC if it's not set properly in php.ini
     3274        date_default_timezone_set(@date_default_timezone_get());
     3275        return date('D, j M Y H:i:s O');
     3276    }
     3277
     3278    /**
     3279     * Get the server hostname.
     3280     * Returns 'localhost.localdomain' if unknown.
     3281     * @access protected
     3282     * @return string
     3283     */
     3284    protected function serverHostname()
     3285    {
     3286        $result = 'localhost.localdomain';
     3287        if (!empty($this->Hostname)) {
     3288            $result = $this->Hostname;
     3289        } elseif (isset($_SERVER) and array_key_exists('SERVER_NAME', $_SERVER) and !empty($_SERVER['SERVER_NAME'])) {
     3290            $result = $_SERVER['SERVER_NAME'];
     3291        } elseif (function_exists('gethostname') && gethostname() !== false) {
     3292            $result = gethostname();
     3293        } elseif (php_uname('n') !== false) {
     3294            $result = php_uname('n');
     3295        }
     3296        return $result;
     3297    }
     3298
     3299    /**
     3300     * Get an error message in the current language.
     3301     * @access protected
     3302     * @param string $key
     3303     * @return string
     3304     */
     3305    protected function lang($key)
     3306    {
     3307        if (count($this->language) < 1) {
     3308            $this->setLanguage('en'); // set the default language
     3309        }
     3310
     3311        if (array_key_exists($key, $this->language)) {
     3312            if ($key == 'smtp_connect_failed') {
     3313                //Include a link to troubleshooting docs on SMTP connection failure
     3314                //this is by far the biggest cause of support questions
     3315                //but it's usually not PHPMailer's fault.
     3316                return $this->language[$key] . ' https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting';
     3317            }
     3318            return $this->language[$key];
     3319        } else {
     3320            //Return the key as a fallback
     3321            return $key;
     3322        }
     3323    }
     3324
     3325    /**
     3326     * Check if an error occurred.
     3327     * @access public
     3328     * @return boolean True if an error did occur.
     3329     */
     3330    public function isError()
     3331    {
     3332        return ($this->error_count > 0);
     3333    }
     3334
     3335    /**
     3336     * Ensure consistent line endings in a string.
     3337     * Changes every end of line from CRLF, CR or LF to $this->LE.
     3338     * @access public
     3339     * @param string $str String to fixEOL
     3340     * @return string
     3341     */
     3342    public function fixEOL($str)
     3343    {
     3344        // Normalise to \n
     3345        $nstr = str_replace(array("\r\n", "\r"), "\n", $str);
     3346        // Now convert LE as needed
     3347        if ($this->LE !== "\n") {
     3348            $nstr = str_replace("\n", $this->LE, $nstr);
     3349        }
     3350        return $nstr;
     3351    }
     3352
     3353    /**
     3354     * Add a custom header.
     3355     * $name value can be overloaded to contain
     3356     * both header name and value (name:value)
     3357     * @access public
     3358     * @param string $name Custom header name
     3359     * @param string $value Header value
     3360     * @return void
     3361     */
     3362    public function addCustomHeader($name, $value = null)
     3363    {
     3364        if ($value === null) {
     3365            // Value passed in as name:value
     3366            $this->CustomHeader[] = explode(':', $name, 2);
     3367        } else {
     3368            $this->CustomHeader[] = array($name, $value);
     3369        }
     3370    }
     3371
     3372    /**
     3373     * Returns all custom headers.
     3374     * @return array
     3375     */
     3376    public function getCustomHeaders()
     3377    {
     3378        return $this->CustomHeader;
     3379    }
     3380
     3381    /**
     3382     * Create a message body from an HTML string.
     3383     * Automatically inlines images and creates a plain-text version by converting the HTML,
     3384     * overwriting any existing values in Body and AltBody.
     3385     * Do not source $message content from user input!
     3386     * $basedir is prepended when handling relative URLs, e.g. <img src="/images/a.png"> and must not be empty
     3387     * will look for an image file in $basedir/images/a.png and convert it to inline.
     3388     * If you don't provide a $basedir, relative paths will be left untouched (and thus probably break in email)
     3389     * If you don't want to apply these transformations to your HTML, just set Body and AltBody directly.
     3390     * @access public
     3391     * @param string $message HTML message string
     3392     * @param string $basedir Absolute path to a base directory to prepend to relative paths to images
     3393     * @param boolean|callable $advanced Whether to use the internal HTML to text converter
     3394     *    or your own custom converter @see PHPMailer::html2text()
     3395     * @return string $message The transformed message Body
     3396     */
     3397    public function msgHTML($message, $basedir = '', $advanced = false)
     3398    {
     3399        preg_match_all('/(src|background)=["\'](.*)["\']/Ui', $message, $images);
     3400        if (array_key_exists(2, $images)) {
     3401            if (strlen($basedir) > 1 && substr($basedir, -1) != '/') {
     3402                // Ensure $basedir has a trailing /
     3403                $basedir .= '/';
     3404            }
     3405            foreach ($images[2] as $imgindex => $url) {
     3406                // Convert data URIs into embedded images
     3407                if (preg_match('#^data:(image[^;,]*)(;base64)?,#', $url, $match)) {
     3408                    $data = substr($url, strpos($url, ','));
     3409                    if ($match[2]) {
     3410                        $data = base64_decode($data);
     3411                    } else {
     3412                        $data = rawurldecode($data);
     3413                    }
     3414                    $cid = md5($url) . '@phpmailer.0'; // RFC2392 S 2
     3415                    if ($this->addStringEmbeddedImage($data, $cid, 'embed' . $imgindex, 'base64', $match[1])) {
     3416                        $message = str_replace(
     3417                            $images[0][$imgindex],
     3418                            $images[1][$imgindex] . '="cid:' . $cid . '"',
     3419                            $message
     3420                        );
     3421                    }
     3422                    continue;
     3423                }
     3424                if (
     3425                    // Only process relative URLs if a basedir is provided (i.e. no absolute local paths)
     3426                    !empty($basedir)
     3427                    // Ignore URLs containing parent dir traversal (..)
     3428                    && (strpos($url, '..') === false)
     3429                    // Do not change urls that are already inline images
     3430                    && substr($url, 0, 4) !== 'cid:'
     3431                    // Do not change absolute URLs, including anonymous protocol
     3432                    && !preg_match('#^[a-z][a-z0-9+.-]*:?//#i', $url)
     3433                ) {
     3434                    $filename = basename($url);
     3435                    $directory = dirname($url);
     3436                    if ($directory == '.') {
     3437                        $directory = '';
     3438                    }
     3439                    $cid = md5($url) . '@phpmailer.0'; // RFC2392 S 2
     3440                    if (strlen($directory) > 1 && substr($directory, -1) != '/') {
     3441                        $directory .= '/';
     3442                    }
     3443                    if ($this->addEmbeddedImage(
     3444                        $basedir . $directory . $filename,
     3445                        $cid,
     3446                        $filename,
     3447                        'base64',
     3448                        self::_mime_types((string)self::mb_pathinfo($filename, PATHINFO_EXTENSION))
     3449                    )
     3450                    ) {
     3451                        $message = preg_replace(
     3452                            '/' . $images[1][$imgindex] . '=["\']' . preg_quote($url, '/') . '["\']/Ui',
     3453                            $images[1][$imgindex] . '="cid:' . $cid . '"',
     3454                            $message
     3455                        );
     3456                    }
     3457                }
     3458            }
     3459        }
     3460        $this->isHTML(true);
     3461        // Convert all message body line breaks to CRLF, makes quoted-printable encoding work much better
     3462        $this->Body = $this->normalizeBreaks($message);
     3463        $this->AltBody = $this->normalizeBreaks($this->html2text($message, $advanced));
     3464        if (!$this->alternativeExists()) {
     3465            $this->AltBody = 'To view this email message, open it in a program that understands HTML!' .
     3466                self::CRLF . self::CRLF;
     3467        }
     3468        return $this->Body;
     3469    }
     3470
     3471    /**
     3472     * Convert an HTML string into plain text.
     3473     * This is used by msgHTML().
     3474     * Note - older versions of this function used a bundled advanced converter
     3475     * which was been removed for license reasons in #232.
     3476     * Example usage:
     3477     * <code>
     3478     * // Use default conversion
     3479     * $plain = $mail->html2text($html);
     3480     * // Use your own custom converter
     3481     * $plain = $mail->html2text($html, function($html) {
     3482     *     $converter = new MyHtml2text($html);
     3483     *     return $converter->get_text();
     3484     * });
     3485     * </code>
     3486     * @param string $html The HTML text to convert
     3487     * @param boolean|callable $advanced Any boolean value to use the internal converter,
     3488     *   or provide your own callable for custom conversion.
     3489     * @return string
     3490     */
     3491    public function html2text($html, $advanced = false)
     3492    {
     3493        if (is_callable($advanced)) {
     3494            return call_user_func($advanced, $html);
     3495        }
     3496        return html_entity_decode(
     3497            trim(strip_tags(preg_replace('/<(head|title|style|script)[^>]*>.*?<\/\\1>/si', '', $html))),
     3498            ENT_QUOTES,
     3499            $this->CharSet
     3500        );
     3501    }
     3502
     3503    /**
     3504     * Get the MIME type for a file extension.
     3505     * @param string $ext File extension
     3506     * @access public
     3507     * @return string MIME type of file.
     3508     * @static
     3509     */
     3510    public static function _mime_types($ext = '')
     3511    {
     3512        $mimes = array(
     3513            'xl'    => 'application/excel',
     3514            'js'    => 'application/javascript',
     3515            'hqx'   => 'application/mac-binhex40',
     3516            'cpt'   => 'application/mac-compactpro',
     3517            'bin'   => 'application/macbinary',
     3518            'doc'   => 'application/msword',
     3519            'word'  => 'application/msword',
     3520            'xlsx'  => 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
     3521            'xltx'  => 'application/vnd.openxmlformats-officedocument.spreadsheetml.template',
     3522            'potx'  => 'application/vnd.openxmlformats-officedocument.presentationml.template',
     3523            'ppsx'  => 'application/vnd.openxmlformats-officedocument.presentationml.slideshow',
     3524            'pptx'  => 'application/vnd.openxmlformats-officedocument.presentationml.presentation',
     3525            'sldx'  => 'application/vnd.openxmlformats-officedocument.presentationml.slide',
     3526            'docx'  => 'application/vnd.openxmlformats-officedocument.wordprocessingml.document',
     3527            'dotx'  => 'application/vnd.openxmlformats-officedocument.wordprocessingml.template',
     3528            'xlam'  => 'application/vnd.ms-excel.addin.macroEnabled.12',
     3529            'xlsb'  => 'application/vnd.ms-excel.sheet.binary.macroEnabled.12',
     3530            'class' => 'application/octet-stream',
     3531            'dll'   => 'application/octet-stream',
     3532            'dms'   => 'application/octet-stream',
     3533            'exe'   => 'application/octet-stream',
     3534            'lha'   => 'application/octet-stream',
     3535            'lzh'   => 'application/octet-stream',
     3536            'psd'   => 'application/octet-stream',
     3537            'sea'   => 'application/octet-stream',
     3538            'so'    => 'application/octet-stream',
     3539            'oda'   => 'application/oda',
     3540            'pdf'   => 'application/pdf',
     3541            'ai'    => 'application/postscript',
     3542            'eps'   => 'application/postscript',
     3543            'ps'    => 'application/postscript',
     3544            'smi'   => 'application/smil',
     3545            'smil'  => 'application/smil',
     3546            'mif'   => 'application/vnd.mif',
     3547            'xls'   => 'application/vnd.ms-excel',
     3548            'ppt'   => 'application/vnd.ms-powerpoint',
     3549            'wbxml' => 'application/vnd.wap.wbxml',
     3550            'wmlc'  => 'application/vnd.wap.wmlc',
     3551            'dcr'   => 'application/x-director',
     3552            'dir'   => 'application/x-director',
     3553            'dxr'   => 'application/x-director',
     3554            'dvi'   => 'application/x-dvi',
     3555            'gtar'  => 'application/x-gtar',
     3556            'php3'  => 'application/x-httpd-php',
     3557            'php4'  => 'application/x-httpd-php',
     3558            'php'   => 'application/x-httpd-php',
     3559            'phtml' => 'application/x-httpd-php',
     3560            'phps'  => 'application/x-httpd-php-source',
     3561            'swf'   => 'application/x-shockwave-flash',
     3562            'sit'   => 'application/x-stuffit',
     3563            'tar'   => 'application/x-tar',
     3564            'tgz'   => 'application/x-tar',
     3565            'xht'   => 'application/xhtml+xml',
     3566            'xhtml' => 'application/xhtml+xml',
     3567            'zip'   => 'application/zip',
     3568            'mid'   => 'audio/midi',
     3569            'midi'  => 'audio/midi',
     3570            'mp2'   => 'audio/mpeg',
     3571            'mp3'   => 'audio/mpeg',
     3572            'mpga'  => 'audio/mpeg',
     3573            'aif'   => 'audio/x-aiff',
     3574            'aifc'  => 'audio/x-aiff',
     3575            'aiff'  => 'audio/x-aiff',
     3576            'ram'   => 'audio/x-pn-realaudio',
     3577            'rm'    => 'audio/x-pn-realaudio',
     3578            'rpm'   => 'audio/x-pn-realaudio-plugin',
     3579            'ra'    => 'audio/x-realaudio',
     3580            'wav'   => 'audio/x-wav',
     3581            'bmp'   => 'image/bmp',
     3582            'gif'   => 'image/gif',
     3583            'jpeg'  => 'image/jpeg',
     3584            'jpe'   => 'image/jpeg',
     3585            'jpg'   => 'image/jpeg',
     3586            'png'   => 'image/png',
     3587            'tiff'  => 'image/tiff',
     3588            'tif'   => 'image/tiff',
     3589            'eml'   => 'message/rfc822',
     3590            'css'   => 'text/css',
     3591            'html'  => 'text/html',
     3592            'htm'   => 'text/html',
     3593            'shtml' => 'text/html',
     3594            'log'   => 'text/plain',
     3595            'text'  => 'text/plain',
     3596            'txt'   => 'text/plain',
     3597            'rtx'   => 'text/richtext',
     3598            'rtf'   => 'text/rtf',
     3599            'vcf'   => 'text/vcard',
     3600            'vcard' => 'text/vcard',
     3601            'xml'   => 'text/xml',
     3602            'xsl'   => 'text/xml',
     3603            'mpeg'  => 'video/mpeg',
     3604            'mpe'   => 'video/mpeg',
     3605            'mpg'   => 'video/mpeg',
     3606            'mov'   => 'video/quicktime',
     3607            'qt'    => 'video/quicktime',
     3608            'rv'    => 'video/vnd.rn-realvideo',
     3609            'avi'   => 'video/x-msvideo',
     3610            'movie' => 'video/x-sgi-movie'
     3611        );
     3612        if (array_key_exists(strtolower($ext), $mimes)) {
     3613            return $mimes[strtolower($ext)];
     3614        }
     3615        return 'application/octet-stream';
     3616    }
     3617
     3618    /**
     3619     * Map a file name to a MIME type.
     3620     * Defaults to 'application/octet-stream', i.e.. arbitrary binary data.
     3621     * @param string $filename A file name or full path, does not need to exist as a file
     3622     * @return string
     3623     * @static
     3624     */
     3625    public static function filenameToType($filename)
     3626    {
     3627        // In case the path is a URL, strip any query string before getting extension
     3628        $qpos = strpos($filename, '?');
     3629        if (false !== $qpos) {
     3630            $filename = substr($filename, 0, $qpos);
     3631        }
     3632        $pathinfo = self::mb_pathinfo($filename);
     3633        return self::_mime_types($pathinfo['extension']);
     3634    }
     3635
     3636    /**
     3637     * Multi-byte-safe pathinfo replacement.
     3638     * Drop-in replacement for pathinfo(), but multibyte-safe, cross-platform-safe, old-version-safe.
     3639     * Works similarly to the one in PHP >= 5.2.0
     3640     * @link http://www.php.net/manual/en/function.pathinfo.php#107461
     3641     * @param string $path A filename or path, does not need to exist as a file
     3642     * @param integer|string $options Either a PATHINFO_* constant,
     3643     *      or a string name to return only the specified piece, allows 'filename' to work on PHP < 5.2
     3644     * @return string|array
     3645     * @static
     3646     */
     3647    public static function mb_pathinfo($path, $options = null)
     3648    {
     3649        $ret = array('dirname' => '', 'basename' => '', 'extension' => '', 'filename' => '');
     3650        $pathinfo = array();
     3651        if (preg_match('%^(.*?)[\\\\/]*(([^/\\\\]*?)(\.([^\.\\\\/]+?)|))[\\\\/\.]*$%im', $path, $pathinfo)) {
     3652            if (array_key_exists(1, $pathinfo)) {
     3653                $ret['dirname'] = $pathinfo[1];
     3654            }
     3655            if (array_key_exists(2, $pathinfo)) {
     3656                $ret['basename'] = $pathinfo[2];
     3657            }
     3658            if (array_key_exists(5, $pathinfo)) {
     3659                $ret['extension'] = $pathinfo[5];
     3660            }
     3661            if (array_key_exists(3, $pathinfo)) {
     3662                $ret['filename'] = $pathinfo[3];
     3663            }
     3664        }
     3665        switch ($options) {
     3666            case PATHINFO_DIRNAME:
     3667            case 'dirname':
     3668                return $ret['dirname'];
     3669            case PATHINFO_BASENAME:
     3670            case 'basename':
     3671                return $ret['basename'];
     3672            case PATHINFO_EXTENSION:
     3673            case 'extension':
     3674                return $ret['extension'];
     3675            case PATHINFO_FILENAME:
     3676            case 'filename':
     3677                return $ret['filename'];
     3678            default:
     3679                return $ret;
     3680        }
     3681    }
     3682
     3683    /**
     3684     * Set or reset instance properties.
     3685     * You should avoid this function - it's more verbose, less efficient, more error-prone and
     3686     * harder to debug than setting properties directly.
     3687     * Usage Example:
     3688     * `$mail->set('SMTPSecure', 'tls');`
     3689     *   is the same as:
     3690     * `$mail->SMTPSecure = 'tls';`
     3691     * @access public
     3692     * @param string $name The property name to set
     3693     * @param mixed $value The value to set the property to
     3694     * @return boolean
     3695     * @TODO Should this not be using the __set() magic function?
     3696     */
     3697    public function set($name, $value = '')
     3698    {
     3699        if (property_exists($this, $name)) {
     3700            $this->$name = $value;
     3701            return true;
     3702        } else {
     3703            $this->setError($this->lang('variable_set') . $name);
     3704            return false;
     3705        }
     3706    }
     3707
     3708    /**
     3709     * Strip newlines to prevent header injection.
     3710     * @access public
     3711     * @param string $str
     3712     * @return string
     3713     */
     3714    public function secureHeader($str)
     3715    {
     3716        return trim(str_replace(array("\r", "\n"), '', $str));
     3717    }
     3718
     3719    /**
     3720     * Normalize line breaks in a string.
     3721     * Converts UNIX LF, Mac CR and Windows CRLF line breaks into a single line break format.
     3722     * Defaults to CRLF (for message bodies) and preserves consecutive breaks.
     3723     * @param string $text
     3724     * @param string $breaktype What kind of line break to use, defaults to CRLF
     3725     * @return string
     3726     * @access public
     3727     * @static
     3728     */
     3729    public static function normalizeBreaks($text, $breaktype = "\r\n")
     3730    {
     3731        return preg_replace('/(\r\n|\r|\n)/ms', $breaktype, $text);
     3732    }
     3733
     3734    /**
     3735     * Set the public and private key files and password for S/MIME signing.
     3736     * @access public
     3737     * @param string $cert_filename
     3738     * @param string $key_filename
     3739     * @param string $key_pass Password for private key
     3740     * @param string $extracerts_filename Optional path to chain certificate
     3741     */
     3742    public function sign($cert_filename, $key_filename, $key_pass, $extracerts_filename = '')
     3743    {
     3744        $this->sign_cert_file = $cert_filename;
     3745        $this->sign_key_file = $key_filename;
     3746        $this->sign_key_pass = $key_pass;
     3747        $this->sign_extracerts_file = $extracerts_filename;
     3748    }
     3749
     3750    /**
     3751     * Quoted-Printable-encode a DKIM header.
     3752     * @access public
     3753     * @param string $txt
     3754     * @return string
     3755     */
     3756    public function DKIM_QP($txt)
     3757    {
     3758        $line = '';
     3759        for ($i = 0; $i < strlen($txt); $i++) {
     3760            $ord = ord($txt[$i]);
     3761            if (((0x21 <= $ord) && ($ord <= 0x3A)) || $ord == 0x3C || ((0x3E <= $ord) && ($ord <= 0x7E))) {
     3762                $line .= $txt[$i];
     3763            } else {
     3764                $line .= '=' . sprintf('%02X', $ord);
     3765            }
     3766        }
     3767        return $line;
     3768    }
     3769
     3770    /**
     3771     * Generate a DKIM signature.
     3772     * @access public
     3773     * @param string $signHeader
     3774     * @throws phpmailerException
     3775     * @return string The DKIM signature value
     3776     */
     3777    public function DKIM_Sign($signHeader)
     3778    {
     3779        if (!defined('PKCS7_TEXT')) {
     3780            if ($this->exceptions) {
     3781                throw new phpmailerException($this->lang('extension_missing') . 'openssl');
     3782            }
     3783            return '';
     3784        }
     3785        $privKeyStr = !empty($this->DKIM_private_string) ? $this->DKIM_private_string : file_get_contents($this->DKIM_private);
     3786        if ('' != $this->DKIM_passphrase) {
     3787            $privKey = openssl_pkey_get_private($privKeyStr, $this->DKIM_passphrase);
     3788        } else {
     3789            $privKey = openssl_pkey_get_private($privKeyStr);
     3790        }
     3791        //Workaround for missing digest algorithms in old PHP & OpenSSL versions
     3792        //@link http://stackoverflow.com/a/11117338/333340
     3793        if (version_compare(PHP_VERSION, '5.3.0') >= 0 and
     3794            in_array('sha256WithRSAEncryption', openssl_get_md_methods(true))) {
     3795            if (openssl_sign($signHeader, $signature, $privKey, 'sha256WithRSAEncryption')) {
     3796                openssl_pkey_free($privKey);
     3797                return base64_encode($signature);
     3798            }
     3799        } else {
     3800            $pinfo = openssl_pkey_get_details($privKey);
     3801            $hash = hash('sha256', $signHeader);
     3802            //'Magic' constant for SHA256 from RFC3447
     3803            //@link https://tools.ietf.org/html/rfc3447#page-43
     3804            $t = '3031300d060960864801650304020105000420' . $hash;
     3805            $pslen = $pinfo['bits'] / 8 - (strlen($t) / 2 + 3);
     3806            $eb = pack('H*', '0001' . str_repeat('FF', $pslen) . '00' . $t);
     3807
     3808            if (openssl_private_encrypt($eb, $signature, $privKey, OPENSSL_NO_PADDING)) {
     3809                openssl_pkey_free($privKey);
     3810                return base64_encode($signature);
     3811            }
     3812        }
     3813        openssl_pkey_free($privKey);
     3814        return '';
     3815    }
     3816
     3817    /**
     3818     * Generate a DKIM canonicalization header.
     3819     * @access public
     3820     * @param string $signHeader Header
     3821     * @return string
     3822     */
     3823    public function DKIM_HeaderC($signHeader)
     3824    {
     3825        $signHeader = preg_replace('/\r\n\s+/', ' ', $signHeader);
     3826        $lines = explode("\r\n", $signHeader);
     3827        foreach ($lines as $key => $line) {
     3828            list($heading, $value) = explode(':', $line, 2);
     3829            $heading = strtolower($heading);
     3830            $value = preg_replace('/\s{2,}/', ' ', $value); // Compress useless spaces
     3831            $lines[$key] = $heading . ':' . trim($value); // Don't forget to remove WSP around the value
     3832        }
     3833        $signHeader = implode("\r\n", $lines);
     3834        return $signHeader;
     3835    }
     3836
     3837    /**
     3838     * Generate a DKIM canonicalization body.
     3839     * @access public
     3840     * @param string $body Message Body
     3841     * @return string
     3842     */
     3843    public function DKIM_BodyC($body)
     3844    {
     3845        if ($body == '') {
     3846            return "\r\n";
     3847        }
     3848        // stabilize line endings
     3849        $body = str_replace("\r\n", "\n", $body);
     3850        $body = str_replace("\n", "\r\n", $body);
     3851        // END stabilize line endings
     3852        while (substr($body, strlen($body) - 4, 4) == "\r\n\r\n") {
     3853            $body = substr($body, 0, strlen($body) - 2);
     3854        }
     3855        return $body;
     3856    }
     3857
     3858    /**
     3859     * Create the DKIM header and body in a new message header.
     3860     * @access public
     3861     * @param string $headers_line Header lines
     3862     * @param string $subject Subject
     3863     * @param string $body Body
     3864     * @return string
     3865     */
     3866    public function DKIM_Add($headers_line, $subject, $body)
     3867    {
     3868        $DKIMsignatureType = 'rsa-sha256'; // Signature & hash algorithms
     3869        $DKIMcanonicalization = 'relaxed/simple'; // Canonicalization of header/body
     3870        $DKIMquery = 'dns/txt'; // Query method
     3871        $DKIMtime = time(); // Signature Timestamp = seconds since 00:00:00 - Jan 1, 1970 (UTC time zone)
     3872        $subject_header = "Subject: $subject";
     3873        $headers = explode($this->LE, $headers_line);
     3874        $from_header = '';
     3875        $to_header = '';
     3876        $date_header = '';
     3877        $current = '';
     3878        foreach ($headers as $header) {
     3879            if (strpos($header, 'From:') === 0) {
     3880                $from_header = $header;
     3881                $current = 'from_header';
     3882            } elseif (strpos($header, 'To:') === 0) {
     3883                $to_header = $header;
     3884                $current = 'to_header';
     3885            } elseif (strpos($header, 'Date:') === 0) {
     3886                $date_header = $header;
     3887                $current = 'date_header';
     3888            } else {
     3889                if (!empty($$current) && strpos($header, ' =?') === 0) {
     3890                    $$current .= $header;
     3891                } else {
     3892                    $current = '';
     3893                }
     3894            }
     3895        }
     3896        $from = str_replace('|', '=7C', $this->DKIM_QP($from_header));
     3897        $to = str_replace('|', '=7C', $this->DKIM_QP($to_header));
     3898        $date = str_replace('|', '=7C', $this->DKIM_QP($date_header));
     3899        $subject = str_replace(
     3900            '|',
     3901            '=7C',
     3902            $this->DKIM_QP($subject_header)
     3903        ); // Copied header fields (dkim-quoted-printable)
     3904        $body = $this->DKIM_BodyC($body);
     3905        $DKIMlen = strlen($body); // Length of body
     3906        $DKIMb64 = base64_encode(pack('H*', hash('sha256', $body))); // Base64 of packed binary SHA-256 hash of body
     3907        if ('' == $this->DKIM_identity) {
     3908            $ident = '';
     3909        } else {
     3910            $ident = ' i=' . $this->DKIM_identity . ';';
     3911        }
     3912        $dkimhdrs = 'DKIM-Signature: v=1; a=' .
     3913            $DKIMsignatureType . '; q=' .
     3914            $DKIMquery . '; l=' .
     3915            $DKIMlen . '; s=' .
     3916            $this->DKIM_selector .
     3917            ";\r\n" .
     3918            "\tt=" . $DKIMtime . '; c=' . $DKIMcanonicalization . ";\r\n" .
     3919            "\th=From:To:Date:Subject;\r\n" .
     3920            "\td=" . $this->DKIM_domain . ';' . $ident . "\r\n" .
     3921            "\tz=$from\r\n" .
     3922            "\t|$to\r\n" .
     3923            "\t|$date\r\n" .
     3924            "\t|$subject;\r\n" .
     3925            "\tbh=" . $DKIMb64 . ";\r\n" .
     3926            "\tb=";
     3927        $toSign = $this->DKIM_HeaderC(
     3928            $from_header . "\r\n" .
     3929            $to_header . "\r\n" .
     3930            $date_header . "\r\n" .
     3931            $subject_header . "\r\n" .
     3932            $dkimhdrs
     3933        );
     3934        $signed = $this->DKIM_Sign($toSign);
     3935        return $dkimhdrs . $signed . "\r\n";
     3936    }
     3937
     3938    /**
     3939     * Detect if a string contains a line longer than the maximum line length allowed.
     3940     * @param string $str
     3941     * @return boolean
     3942     * @static
     3943     */
     3944    public static function hasLineLongerThanMax($str)
     3945    {
     3946        //+2 to include CRLF line break for a 1000 total
     3947        return (boolean)preg_match('/^(.{'.(self::MAX_LINE_LENGTH + 2).',})/m', $str);
     3948    }
     3949
     3950    /**
     3951     * Allows for public read access to 'to' property.
     3952     * @note: Before the send() call, queued addresses (i.e. with IDN) are not yet included.
     3953     * @access public
     3954     * @return array
     3955     */
     3956    public function getToAddresses()
     3957    {
     3958        return $this->to;
     3959    }
     3960
     3961    /**
     3962     * Allows for public read access to 'cc' property.
     3963     * @note: Before the send() call, queued addresses (i.e. with IDN) are not yet included.
     3964     * @access public
     3965     * @return array
     3966     */
     3967    public function getCcAddresses()
     3968    {
     3969        return $this->cc;
     3970    }
     3971
     3972    /**
     3973     * Allows for public read access to 'bcc' property.
     3974     * @note: Before the send() call, queued addresses (i.e. with IDN) are not yet included.
     3975     * @access public
     3976     * @return array
     3977     */
     3978    public function getBccAddresses()
     3979    {
     3980        return $this->bcc;
     3981    }
     3982
     3983    /**
     3984     * Allows for public read access to 'ReplyTo' property.
     3985     * @note: Before the send() call, queued addresses (i.e. with IDN) are not yet included.
     3986     * @access public
     3987     * @return array
     3988     */
     3989    public function getReplyToAddresses()
     3990    {
     3991        return $this->ReplyTo;
     3992    }
     3993
     3994    /**
     3995     * Allows for public read access to 'all_recipients' property.
     3996     * @note: Before the send() call, queued addresses (i.e. with IDN) are not yet included.
     3997     * @access public
     3998     * @return array
     3999     */
     4000    public function getAllRecipientAddresses()
     4001    {
     4002        return $this->all_recipients;
     4003    }
     4004
     4005    /**
     4006     * Perform a callback.
     4007     * @param boolean $isSent
     4008     * @param array $to
     4009     * @param array $cc
     4010     * @param array $bcc
     4011     * @param string $subject
     4012     * @param string $body
     4013     * @param string $from
     4014     */
     4015    protected function doCallback($isSent, $to, $cc, $bcc, $subject, $body, $from)
     4016    {
     4017        if (!empty($this->action_function) && is_callable($this->action_function)) {
     4018            $params = array($isSent, $to, $cc, $bcc, $subject, $body, $from);
     4019            call_user_func_array($this->action_function, $params);
     4020        }
     4021    }
     4022}
     4023
     4024/**
     4025 * PHPMailer exception handler
     4026 * @package PHPMailer
     4027 */
     4028class phpmailerException extends Exception
     4029{
     4030    /**
     4031     * Prettify error message output
     4032     * @return string
     4033     */
     4034    public function errorMessage()
     4035    {
     4036        $errorMsg = '<strong>' . $this->getMessage() . "</strong><br />\n";
     4037        return $errorMsg;
     4038    }
     4039}
  • new file wp-includes/PHPMailer/class.phpmaileroauth.php

    diff --git wp-includes/PHPMailer/class.phpmaileroauth.php wp-includes/PHPMailer/class.phpmaileroauth.php
    new file mode 100644
    index 0000000..b1bb09f
    - +  
     1<?php
     2/**
     3 * PHPMailer - PHP email creation and transport class.
     4 * PHP Version 5.4
     5 * @package PHPMailer
     6 * @link https://github.com/PHPMailer/PHPMailer/ The PHPMailer GitHub project
     7 * @author Marcus Bointon (Synchro/coolbru) <phpmailer@synchromedia.co.uk>
     8 * @author Jim Jagielski (jimjag) <jimjag@gmail.com>
     9 * @author Andy Prevost (codeworxtech) <codeworxtech@users.sourceforge.net>
     10 * @author Brent R. Matzelle (original founder)
     11 * @copyright 2012 - 2014 Marcus Bointon
     12 * @copyright 2010 - 2012 Jim Jagielski
     13 * @copyright 2004 - 2009 Andy Prevost
     14 * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License
     15 * @note This program is distributed in the hope that it will be useful - WITHOUT
     16 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
     17 * FITNESS FOR A PARTICULAR PURPOSE.
     18 */
     19
     20/**
     21 * PHPMailerOAuth - PHPMailer subclass adding OAuth support.
     22 * @package PHPMailer
     23 * @author @sherryl4george
     24 * @author Marcus Bointon (@Synchro) <phpmailer@synchromedia.co.uk>
     25 */
     26class PHPMailerOAuth extends PHPMailer
     27{
     28    /**
     29     * The OAuth user's email address
     30     * @var string
     31     */
     32    public $oauthUserEmail = '';
     33
     34    /**
     35     * The OAuth refresh token
     36     * @var string
     37     */
     38    public $oauthRefreshToken = '';
     39
     40    /**
     41     * The OAuth client ID
     42     * @var string
     43     */
     44    public $oauthClientId = '';
     45
     46    /**
     47     * The OAuth client secret
     48     * @var string
     49     */
     50    public $oauthClientSecret = '';
     51
     52    /**
     53     * An instance of the PHPMailerOAuthGoogle class.
     54     * @var PHPMailerOAuthGoogle
     55     * @access protected
     56     */
     57    protected $oauth = null;
     58
     59    /**
     60     * Get a PHPMailerOAuthGoogle instance to use.
     61     * @return PHPMailerOAuthGoogle
     62     */
     63    public function getOAUTHInstance()
     64    {
     65        if (!is_object($this->oauth)) {
     66            $this->oauth = new PHPMailerOAuthGoogle(
     67                $this->oauthUserEmail,
     68                $this->oauthClientSecret,
     69                $this->oauthClientId,
     70                $this->oauthRefreshToken
     71            );
     72        }
     73        return $this->oauth;
     74    }
     75
     76    /**
     77     * Initiate a connection to an SMTP server.
     78     * Overrides the original smtpConnect method to add support for OAuth.
     79     * @param array $options An array of options compatible with stream_context_create()
     80     * @uses SMTP
     81     * @access public
     82     * @return bool
     83     * @throws phpmailerException
     84     */
     85    public function smtpConnect($options = array())
     86    {
     87        if (is_null($this->smtp)) {
     88            $this->smtp = $this->getSMTPInstance();
     89        }
     90
     91        if (is_null($this->oauth)) {
     92            $this->oauth = $this->getOAUTHInstance();
     93        }
     94
     95        // Already connected?
     96        if ($this->smtp->connected()) {
     97            return true;
     98        }
     99
     100        $this->smtp->setTimeout($this->Timeout);
     101        $this->smtp->setDebugLevel($this->SMTPDebug);
     102        $this->smtp->setDebugOutput($this->Debugoutput);
     103        $this->smtp->setVerp($this->do_verp);
     104        $hosts = explode(';', $this->Host);
     105        $lastexception = null;
     106
     107        foreach ($hosts as $hostentry) {
     108            $hostinfo = array();
     109            if (!preg_match('/^((ssl|tls):\/\/)*([a-zA-Z0-9\.-]*):?([0-9]*)$/', trim($hostentry), $hostinfo)) {
     110                // Not a valid host entry
     111                continue;
     112            }
     113            // $hostinfo[2]: optional ssl or tls prefix
     114            // $hostinfo[3]: the hostname
     115            // $hostinfo[4]: optional port number
     116            // The host string prefix can temporarily override the current setting for SMTPSecure
     117            // If it's not specified, the default value is used
     118            $prefix = '';
     119            $secure = $this->SMTPSecure;
     120            $tls = ($this->SMTPSecure == 'tls');
     121            if ('ssl' == $hostinfo[2] or ('' == $hostinfo[2] and 'ssl' == $this->SMTPSecure)) {
     122                $prefix = 'ssl://';
     123                $tls = false; // Can't have SSL and TLS at the same time
     124                $secure = 'ssl';
     125            } elseif ($hostinfo[2] == 'tls') {
     126                $tls = true;
     127                // tls doesn't use a prefix
     128                $secure = 'tls';
     129            }
     130            //Do we need the OpenSSL extension?
     131            $sslext = defined('OPENSSL_ALGO_SHA1');
     132            if ('tls' === $secure or 'ssl' === $secure) {
     133                //Check for an OpenSSL constant rather than using extension_loaded, which is sometimes disabled
     134                if (!$sslext) {
     135                    throw new phpmailerException($this->lang('extension_missing').'openssl', self::STOP_CRITICAL);
     136                }
     137            }
     138            $host = $hostinfo[3];
     139            $port = $this->Port;
     140            $tport = (integer)$hostinfo[4];
     141            if ($tport > 0 and $tport < 65536) {
     142                $port = $tport;
     143            }
     144            if ($this->smtp->connect($prefix . $host, $port, $this->Timeout, $options)) {
     145                try {
     146                    if ($this->Helo) {
     147                        $hello = $this->Helo;
     148                    } else {
     149                        $hello = $this->serverHostname();
     150                    }
     151                    $this->smtp->hello($hello);
     152                    //Automatically enable TLS encryption if:
     153                    // * it's not disabled
     154                    // * we have openssl extension
     155                    // * we are not already using SSL
     156                    // * the server offers STARTTLS
     157                    if ($this->SMTPAutoTLS and $sslext and $secure != 'ssl' and $this->smtp->getServerExt('STARTTLS')) {
     158                        $tls = true;
     159                    }
     160                    if ($tls) {
     161                        if (!$this->smtp->startTLS()) {
     162                            throw new phpmailerException($this->lang('connect_host'));
     163                        }
     164                        // We must resend HELO after tls negotiation
     165                        $this->smtp->hello($hello);
     166                    }
     167                    if ($this->SMTPAuth) {
     168                        if (!$this->smtp->authenticate(
     169                            $this->Username,
     170                            $this->Password,
     171                            $this->AuthType,
     172                            $this->Realm,
     173                            $this->Workstation,
     174                            $this->oauth
     175                        )
     176                        ) {
     177                            throw new phpmailerException($this->lang('authenticate'));
     178                        }
     179                    }
     180                    return true;
     181                } catch (phpmailerException $exc) {
     182                    $lastexception = $exc;
     183                    $this->edebug($exc->getMessage());
     184                    // We must have connected, but then failed TLS or Auth, so close connection nicely
     185                    $this->smtp->quit();
     186                }
     187            }
     188        }
     189        // If we get here, all connection attempts have failed, so close connection hard
     190        $this->smtp->close();
     191        // As we've caught all exceptions, just report whatever the last one was
     192        if ($this->exceptions and !is_null($lastexception)) {
     193            throw $lastexception;
     194        }
     195        return false;
     196    }
     197}
  • new file wp-includes/PHPMailer/class.phpmaileroauthgoogle.php

    diff --git wp-includes/PHPMailer/class.phpmaileroauthgoogle.php wp-includes/PHPMailer/class.phpmaileroauthgoogle.php
    new file mode 100644
    index 0000000..71c9bd3
    - +  
     1<?php
     2/**
     3 * PHPMailer - PHP email creation and transport class.
     4 * PHP Version 5.4
     5 * @package PHPMailer
     6 * @link https://github.com/PHPMailer/PHPMailer/ The PHPMailer GitHub project
     7 * @author Marcus Bointon (Synchro/coolbru) <phpmailer@synchromedia.co.uk>
     8 * @author Jim Jagielski (jimjag) <jimjag@gmail.com>
     9 * @author Andy Prevost (codeworxtech) <codeworxtech@users.sourceforge.net>
     10 * @author Brent R. Matzelle (original founder)
     11 * @copyright 2012 - 2014 Marcus Bointon
     12 * @copyright 2010 - 2012 Jim Jagielski
     13 * @copyright 2004 - 2009 Andy Prevost
     14 * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License
     15 * @note This program is distributed in the hope that it will be useful - WITHOUT
     16 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
     17 * FITNESS FOR A PARTICULAR PURPOSE.
     18 */
     19
     20/**
     21 * PHPMailerOAuthGoogle - Wrapper for League OAuth2 Google provider.
     22 * @package PHPMailer
     23 * @author @sherryl4george
     24 * @author Marcus Bointon (@Synchro) <phpmailer@synchromedia.co.uk>
     25 * @link https://github.com/thephpleague/oauth2-client
     26 */
     27class PHPMailerOAuthGoogle
     28{
     29    private $oauthUserEmail = '';
     30    private $oauthRefreshToken = '';
     31    private $oauthClientId = '';
     32    private $oauthClientSecret = '';
     33
     34    /**
     35     * @param string $UserEmail
     36     * @param string $ClientSecret
     37     * @param string $ClientId
     38     * @param string $RefreshToken
     39     */
     40    public function __construct(
     41        $UserEmail,
     42        $ClientSecret,
     43        $ClientId,
     44        $RefreshToken
     45    ) {
     46        $this->oauthClientId = $ClientId;
     47        $this->oauthClientSecret = $ClientSecret;
     48        $this->oauthRefreshToken = $RefreshToken;
     49        $this->oauthUserEmail = $UserEmail;
     50    }
     51
     52    private function getProvider()
     53    {
     54        return new League\OAuth2\Client\Provider\Google([
     55            'clientId' => $this->oauthClientId,
     56            'clientSecret' => $this->oauthClientSecret
     57        ]);
     58    }
     59
     60    private function getGrant()
     61    {
     62        return new \League\OAuth2\Client\Grant\RefreshToken();
     63    }
     64
     65    private function getToken()
     66    {
     67        $provider = $this->getProvider();
     68        $grant = $this->getGrant();
     69        return $provider->getAccessToken($grant, ['refresh_token' => $this->oauthRefreshToken]);
     70    }
     71
     72    public function getOauth64()
     73    {
     74        $token = $this->getToken();
     75        return base64_encode("user=" . $this->oauthUserEmail . "\001auth=Bearer " . $token . "\001\001");
     76    }
     77}
  • new file wp-includes/PHPMailer/class.pop3.php

    diff --git wp-includes/PHPMailer/class.pop3.php wp-includes/PHPMailer/class.pop3.php
    new file mode 100644
    index 0000000..f10e688
    - +  
     1<?php
     2/**
     3 * PHPMailer POP-Before-SMTP Authentication Class.
     4 * PHP Version 5
     5 * @package PHPMailer
     6 * @link https://github.com/PHPMailer/PHPMailer/
     7 * @author Marcus Bointon (Synchro/coolbru) <phpmailer@synchromedia.co.uk>
     8 * @author Jim Jagielski (jimjag) <jimjag@gmail.com>
     9 * @author Andy Prevost (codeworxtech) <codeworxtech@users.sourceforge.net>
     10 * @author Brent R. Matzelle (original founder)
     11 * @copyright 2012 - 2014 Marcus Bointon
     12 * @copyright 2010 - 2012 Jim Jagielski
     13 * @copyright 2004 - 2009 Andy Prevost
     14 * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License
     15 * @note This program is distributed in the hope that it will be useful - WITHOUT
     16 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
     17 * FITNESS FOR A PARTICULAR PURPOSE.
     18 */
     19
     20/**
     21 * PHPMailer POP-Before-SMTP Authentication Class.
     22 * Specifically for PHPMailer to use for RFC1939 POP-before-SMTP authentication.
     23 * Does not support APOP.
     24 * @package PHPMailer
     25 * @author Richard Davey (original author) <rich@corephp.co.uk>
     26 * @author Marcus Bointon (Synchro/coolbru) <phpmailer@synchromedia.co.uk>
     27 * @author Jim Jagielski (jimjag) <jimjag@gmail.com>
     28 * @author Andy Prevost (codeworxtech) <codeworxtech@users.sourceforge.net>
     29 */
     30class POP3
     31{
     32    /**
     33     * The POP3 PHPMailer Version number.
     34     * @var string
     35     * @access public
     36     */
     37    public $Version = '5.2.22';
     38
     39    /**
     40     * Default POP3 port number.
     41     * @var integer
     42     * @access public
     43     */
     44    public $POP3_PORT = 110;
     45
     46    /**
     47     * Default timeout in seconds.
     48     * @var integer
     49     * @access public
     50     */
     51    public $POP3_TIMEOUT = 30;
     52
     53    /**
     54     * POP3 Carriage Return + Line Feed.
     55     * @var string
     56     * @access public
     57     * @deprecated Use the constant instead
     58     */
     59    public $CRLF = "\r\n";
     60
     61    /**
     62     * Debug display level.
     63     * Options: 0 = no, 1+ = yes
     64     * @var integer
     65     * @access public
     66     */
     67    public $do_debug = 0;
     68
     69    /**
     70     * POP3 mail server hostname.
     71     * @var string
     72     * @access public
     73     */
     74    public $host;
     75
     76    /**
     77     * POP3 port number.
     78     * @var integer
     79     * @access public
     80     */
     81    public $port;
     82
     83    /**
     84     * POP3 Timeout Value in seconds.
     85     * @var integer
     86     * @access public
     87     */
     88    public $tval;
     89
     90    /**
     91     * POP3 username
     92     * @var string
     93     * @access public
     94     */
     95    public $username;
     96
     97    /**
     98     * POP3 password.
     99     * @var string
     100     * @access public
     101     */
     102    public $password;
     103
     104    /**
     105     * Resource handle for the POP3 connection socket.
     106     * @var resource
     107     * @access protected
     108     */
     109    protected $pop_conn;
     110
     111    /**
     112     * Are we connected?
     113     * @var boolean
     114     * @access protected
     115     */
     116    protected $connected = false;
     117
     118    /**
     119     * Error container.
     120     * @var array
     121     * @access protected
     122     */
     123    protected $errors = array();
     124
     125    /**
     126     * Line break constant
     127     */
     128    const CRLF = "\r\n";
     129
     130    /**
     131     * Simple static wrapper for all-in-one POP before SMTP
     132     * @param $host
     133     * @param integer|boolean $port The port number to connect to
     134     * @param integer|boolean $timeout The timeout value
     135     * @param string $username
     136     * @param string $password
     137     * @param integer $debug_level
     138     * @return boolean
     139     */
     140    public static function popBeforeSmtp(
     141        $host,
     142        $port = false,
     143        $timeout = false,
     144        $username = '',
     145        $password = '',
     146        $debug_level = 0
     147    ) {
     148        $pop = new POP3;
     149        return $pop->authorise($host, $port, $timeout, $username, $password, $debug_level);
     150    }
     151
     152    /**
     153     * Authenticate with a POP3 server.
     154     * A connect, login, disconnect sequence
     155     * appropriate for POP-before SMTP authorisation.
     156     * @access public
     157     * @param string $host The hostname to connect to
     158     * @param integer|boolean $port The port number to connect to
     159     * @param integer|boolean $timeout The timeout value
     160     * @param string $username
     161     * @param string $password
     162     * @param integer $debug_level
     163     * @return boolean
     164     */
     165    public function authorise($host, $port = false, $timeout = false, $username = '', $password = '', $debug_level = 0)
     166    {
     167        $this->host = $host;
     168        // If no port value provided, use default
     169        if (false === $port) {
     170            $this->port = $this->POP3_PORT;
     171        } else {
     172            $this->port = (integer)$port;
     173        }
     174        // If no timeout value provided, use default
     175        if (false === $timeout) {
     176            $this->tval = $this->POP3_TIMEOUT;
     177        } else {
     178            $this->tval = (integer)$timeout;
     179        }
     180        $this->do_debug = $debug_level;
     181        $this->username = $username;
     182        $this->password = $password;
     183        //  Reset the error log
     184        $this->errors = array();
     185        //  connect
     186        $result = $this->connect($this->host, $this->port, $this->tval);
     187        if ($result) {
     188            $login_result = $this->login($this->username, $this->password);
     189            if ($login_result) {
     190                $this->disconnect();
     191                return true;
     192            }
     193        }
     194        // We need to disconnect regardless of whether the login succeeded
     195        $this->disconnect();
     196        return false;
     197    }
     198
     199    /**
     200     * Connect to a POP3 server.
     201     * @access public
     202     * @param string $host
     203     * @param integer|boolean $port
     204     * @param integer $tval
     205     * @return boolean
     206     */
     207    public function connect($host, $port = false, $tval = 30)
     208    {
     209        //  Are we already connected?
     210        if ($this->connected) {
     211            return true;
     212        }
     213
     214        //On Windows this will raise a PHP Warning error if the hostname doesn't exist.
     215        //Rather than suppress it with @fsockopen, capture it cleanly instead
     216        set_error_handler(array($this, 'catchWarning'));
     217
     218        if (false === $port) {
     219            $port = $this->POP3_PORT;
     220        }
     221
     222        //  connect to the POP3 server
     223        $this->pop_conn = fsockopen(
     224            $host, //  POP3 Host
     225            $port, //  Port #
     226            $errno, //  Error Number
     227            $errstr, //  Error Message
     228            $tval
     229        ); //  Timeout (seconds)
     230        //  Restore the error handler
     231        restore_error_handler();
     232
     233        //  Did we connect?
     234        if (false === $this->pop_conn) {
     235            //  It would appear not...
     236            $this->setError(array(
     237                'error' => "Failed to connect to server $host on port $port",
     238                'errno' => $errno,
     239                'errstr' => $errstr
     240            ));
     241            return false;
     242        }
     243
     244        //  Increase the stream time-out
     245        stream_set_timeout($this->pop_conn, $tval, 0);
     246
     247        //  Get the POP3 server response
     248        $pop3_response = $this->getResponse();
     249        //  Check for the +OK
     250        if ($this->checkResponse($pop3_response)) {
     251            //  The connection is established and the POP3 server is talking
     252            $this->connected = true;
     253            return true;
     254        }
     255        return false;
     256    }
     257
     258    /**
     259     * Log in to the POP3 server.
     260     * Does not support APOP (RFC 2828, 4949).
     261     * @access public
     262     * @param string $username
     263     * @param string $password
     264     * @return boolean
     265     */
     266    public function login($username = '', $password = '')
     267    {
     268        if (!$this->connected) {
     269            $this->setError('Not connected to POP3 server');
     270        }
     271        if (empty($username)) {
     272            $username = $this->username;
     273        }
     274        if (empty($password)) {
     275            $password = $this->password;
     276        }
     277
     278        // Send the Username
     279        $this->sendString("USER $username" . self::CRLF);
     280        $pop3_response = $this->getResponse();
     281        if ($this->checkResponse($pop3_response)) {
     282            // Send the Password
     283            $this->sendString("PASS $password" . self::CRLF);
     284            $pop3_response = $this->getResponse();
     285            if ($this->checkResponse($pop3_response)) {
     286                return true;
     287            }
     288        }
     289        return false;
     290    }
     291
     292    /**
     293     * Disconnect from the POP3 server.
     294     * @access public
     295     */
     296    public function disconnect()
     297    {
     298        $this->sendString('QUIT');
     299        //The QUIT command may cause the daemon to exit, which will kill our connection
     300        //So ignore errors here
     301        try {
     302            @fclose($this->pop_conn);
     303        } catch (Exception $e) {
     304            //Do nothing
     305        };
     306    }
     307
     308    /**
     309     * Get a response from the POP3 server.
     310     * $size is the maximum number of bytes to retrieve
     311     * @param integer $size
     312     * @return string
     313     * @access protected
     314     */
     315    protected function getResponse($size = 128)
     316    {
     317        $response = fgets($this->pop_conn, $size);
     318        if ($this->do_debug >= 1) {
     319            echo "Server -> Client: $response";
     320        }
     321        return $response;
     322    }
     323
     324    /**
     325     * Send raw data to the POP3 server.
     326     * @param string $string
     327     * @return integer
     328     * @access protected
     329     */
     330    protected function sendString($string)
     331    {
     332        if ($this->pop_conn) {
     333            if ($this->do_debug >= 2) { //Show client messages when debug >= 2
     334                echo "Client -> Server: $string";
     335            }
     336            return fwrite($this->pop_conn, $string, strlen($string));
     337        }
     338        return 0;
     339    }
     340
     341    /**
     342     * Checks the POP3 server response.
     343     * Looks for for +OK or -ERR.
     344     * @param string $string
     345     * @return boolean
     346     * @access protected
     347     */
     348    protected function checkResponse($string)
     349    {
     350        if (substr($string, 0, 3) !== '+OK') {
     351            $this->setError(array(
     352                'error' => "Server reported an error: $string",
     353                'errno' => 0,
     354                'errstr' => ''
     355            ));
     356            return false;
     357        } else {
     358            return true;
     359        }
     360    }
     361
     362    /**
     363     * Add an error to the internal error store.
     364     * Also display debug output if it's enabled.
     365     * @param $error
     366     * @access protected
     367     */
     368    protected function setError($error)
     369    {
     370        $this->errors[] = $error;
     371        if ($this->do_debug >= 1) {
     372            echo '<pre>';
     373            foreach ($this->errors as $error) {
     374                print_r($error);
     375            }
     376            echo '</pre>';
     377        }
     378    }
     379
     380    /**
     381     * Get an array of error messages, if any.
     382     * @return array
     383     */
     384    public function getErrors()
     385    {
     386        return $this->errors;
     387    }
     388
     389    /**
     390     * POP3 connection error handler.
     391     * @param integer $errno
     392     * @param string $errstr
     393     * @param string $errfile
     394     * @param integer $errline
     395     * @access protected
     396     */
     397    protected function catchWarning($errno, $errstr, $errfile, $errline)
     398    {
     399        $this->setError(array(
     400            'error' => "Connecting to the POP3 server raised a PHP warning: ",
     401            'errno' => $errno,
     402            'errstr' => $errstr,
     403            'errfile' => $errfile,
     404            'errline' => $errline
     405        ));
     406    }
     407}
  • new file wp-includes/PHPMailer/class.smtp.php

    diff --git wp-includes/PHPMailer/class.smtp.php wp-includes/PHPMailer/class.smtp.php
    new file mode 100644
    index 0000000..8932117
    - +  
     1<?php
     2/**
     3 * PHPMailer RFC821 SMTP email transport class.
     4 * PHP Version 5
     5 * @package PHPMailer
     6 * @link https://github.com/PHPMailer/PHPMailer/ The PHPMailer GitHub project
     7 * @author Marcus Bointon (Synchro/coolbru) <phpmailer@synchromedia.co.uk>
     8 * @author Jim Jagielski (jimjag) <jimjag@gmail.com>
     9 * @author Andy Prevost (codeworxtech) <codeworxtech@users.sourceforge.net>
     10 * @author Brent R. Matzelle (original founder)
     11 * @copyright 2014 Marcus Bointon
     12 * @copyright 2010 - 2012 Jim Jagielski
     13 * @copyright 2004 - 2009 Andy Prevost
     14 * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License
     15 * @note This program is distributed in the hope that it will be useful - WITHOUT
     16 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
     17 * FITNESS FOR A PARTICULAR PURPOSE.
     18 */
     19
     20/**
     21 * PHPMailer RFC821 SMTP email transport class.
     22 * Implements RFC 821 SMTP commands and provides some utility methods for sending mail to an SMTP server.
     23 * @package PHPMailer
     24 * @author Chris Ryan
     25 * @author Marcus Bointon <phpmailer@synchromedia.co.uk>
     26 */
     27class SMTP
     28{
     29    /**
     30     * The PHPMailer SMTP version number.
     31     * @var string
     32     */
     33    const VERSION = '5.2.22';
     34
     35    /**
     36     * SMTP line break constant.
     37     * @var string
     38     */
     39    const CRLF = "\r\n";
     40
     41    /**
     42     * The SMTP port to use if one is not specified.
     43     * @var integer
     44     */
     45    const DEFAULT_SMTP_PORT = 25;
     46
     47    /**
     48     * The maximum line length allowed by RFC 2822 section 2.1.1
     49     * @var integer
     50     */
     51    const MAX_LINE_LENGTH = 998;
     52
     53    /**
     54     * Debug level for no output
     55     */
     56    const DEBUG_OFF = 0;
     57
     58    /**
     59     * Debug level to show client -> server messages
     60     */
     61    const DEBUG_CLIENT = 1;
     62
     63    /**
     64     * Debug level to show client -> server and server -> client messages
     65     */
     66    const DEBUG_SERVER = 2;
     67
     68    /**
     69     * Debug level to show connection status, client -> server and server -> client messages
     70     */
     71    const DEBUG_CONNECTION = 3;
     72
     73    /**
     74     * Debug level to show all messages
     75     */
     76    const DEBUG_LOWLEVEL = 4;
     77
     78    /**
     79     * The PHPMailer SMTP Version number.
     80     * @var string
     81     * @deprecated Use the `VERSION` constant instead
     82     * @see SMTP::VERSION
     83     */
     84    public $Version = '5.2.22';
     85
     86    /**
     87     * SMTP server port number.
     88     * @var integer
     89     * @deprecated This is only ever used as a default value, so use the `DEFAULT_SMTP_PORT` constant instead
     90     * @see SMTP::DEFAULT_SMTP_PORT
     91     */
     92    public $SMTP_PORT = 25;
     93
     94    /**
     95     * SMTP reply line ending.
     96     * @var string
     97     * @deprecated Use the `CRLF` constant instead
     98     * @see SMTP::CRLF
     99     */
     100    public $CRLF = "\r\n";
     101
     102    /**
     103     * Debug output level.
     104     * Options:
     105     * * self::DEBUG_OFF (`0`) No debug output, default
     106     * * self::DEBUG_CLIENT (`1`) Client commands
     107     * * self::DEBUG_SERVER (`2`) Client commands and server responses
     108     * * self::DEBUG_CONNECTION (`3`) As DEBUG_SERVER plus connection status
     109     * * self::DEBUG_LOWLEVEL (`4`) Low-level data output, all messages
     110     * @var integer
     111     */
     112    public $do_debug = self::DEBUG_OFF;
     113
     114    /**
     115     * How to handle debug output.
     116     * Options:
     117     * * `echo` Output plain-text as-is, appropriate for CLI
     118     * * `html` Output escaped, line breaks converted to `<br>`, appropriate for browser output
     119     * * `error_log` Output to error log as configured in php.ini
     120     *
     121     * Alternatively, you can provide a callable expecting two params: a message string and the debug level:
     122     * <code>
     123     * $smtp->Debugoutput = function($str, $level) {echo "debug level $level; message: $str";};
     124     * </code>
     125     * @var string|callable
     126     */
     127    public $Debugoutput = 'echo';
     128
     129    /**
     130     * Whether to use VERP.
     131     * @link http://en.wikipedia.org/wiki/Variable_envelope_return_path
     132     * @link http://www.postfix.org/VERP_README.html Info on VERP
     133     * @var boolean
     134     */
     135    public $do_verp = false;
     136
     137    /**
     138     * The timeout value for connection, in seconds.
     139     * Default of 5 minutes (300sec) is from RFC2821 section 4.5.3.2
     140     * This needs to be quite high to function correctly with hosts using greetdelay as an anti-spam measure.
     141     * @link http://tools.ietf.org/html/rfc2821#section-4.5.3.2
     142     * @var integer
     143     */
     144    public $Timeout = 300;
     145
     146    /**
     147     * How long to wait for commands to complete, in seconds.
     148     * Default of 5 minutes (300sec) is from RFC2821 section 4.5.3.2
     149     * @var integer
     150     */
     151    public $Timelimit = 300;
     152
     153        /**
     154         * @var array patterns to extract smtp transaction id from smtp reply
     155         * Only first capture group will be use, use non-capturing group to deal with it
     156         * Extend this class to override this property to fulfil your needs.
     157         */
     158        protected $smtp_transaction_id_patterns = array(
     159                'exim' => '/[0-9]{3} OK id=(.*)/',
     160                'sendmail' => '/[0-9]{3} 2.0.0 (.*) Message/',
     161                'postfix' => '/[0-9]{3} 2.0.0 Ok: queued as (.*)/'
     162        );
     163
     164    /**
     165     * The socket for the server connection.
     166     * @var resource
     167     */
     168    protected $smtp_conn;
     169
     170    /**
     171     * Error information, if any, for the last SMTP command.
     172     * @var array
     173     */
     174    protected $error = array(
     175        'error' => '',
     176        'detail' => '',
     177        'smtp_code' => '',
     178        'smtp_code_ex' => ''
     179    );
     180
     181    /**
     182     * The reply the server sent to us for HELO.
     183     * If null, no HELO string has yet been received.
     184     * @var string|null
     185     */
     186    protected $helo_rply = null;
     187
     188    /**
     189     * The set of SMTP extensions sent in reply to EHLO command.
     190     * Indexes of the array are extension names.
     191     * Value at index 'HELO' or 'EHLO' (according to command that was sent)
     192     * represents the server name. In case of HELO it is the only element of the array.
     193     * Other values can be boolean TRUE or an array containing extension options.
     194     * If null, no HELO/EHLO string has yet been received.
     195     * @var array|null
     196     */
     197    protected $server_caps = null;
     198
     199    /**
     200     * The most recent reply received from the server.
     201     * @var string
     202     */
     203    protected $last_reply = '';
     204
     205    /**
     206     * Output debugging info via a user-selected method.
     207     * @see SMTP::$Debugoutput
     208     * @see SMTP::$do_debug
     209     * @param string $str Debug string to output
     210     * @param integer $level The debug level of this message; see DEBUG_* constants
     211     * @return void
     212     */
     213    protected function edebug($str, $level = 0)
     214    {
     215        if ($level > $this->do_debug) {
     216            return;
     217        }
     218        //Avoid clash with built-in function names
     219        if (!in_array($this->Debugoutput, array('error_log', 'html', 'echo')) and is_callable($this->Debugoutput)) {
     220            call_user_func($this->Debugoutput, $str, $level);
     221            return;
     222        }
     223        switch ($this->Debugoutput) {
     224            case 'error_log':
     225                //Don't output, just log
     226                error_log($str);
     227                break;
     228            case 'html':
     229                //Cleans up output a bit for a better looking, HTML-safe output
     230                echo htmlentities(
     231                    preg_replace('/[\r\n]+/', '', $str),
     232                    ENT_QUOTES,
     233                    'UTF-8'
     234                )
     235                . "<br>\n";
     236                break;
     237            case 'echo':
     238            default:
     239                //Normalize line breaks
     240                $str = preg_replace('/(\r\n|\r|\n)/ms', "\n", $str);
     241                echo gmdate('Y-m-d H:i:s') . "\t" . str_replace(
     242                    "\n",
     243                    "\n                   \t                  ",
     244                    trim($str)
     245                )."\n";
     246        }
     247    }
     248
     249    /**
     250     * Connect to an SMTP server.
     251     * @param string $host SMTP server IP or host name
     252     * @param integer $port The port number to connect to
     253     * @param integer $timeout How long to wait for the connection to open
     254     * @param array $options An array of options for stream_context_create()
     255     * @access public
     256     * @return boolean
     257     */
     258    public function connect($host, $port = null, $timeout = 30, $options = array())
     259    {
     260        static $streamok;
     261        //This is enabled by default since 5.0.0 but some providers disable it
     262        //Check this once and cache the result
     263        if (is_null($streamok)) {
     264            $streamok = function_exists('stream_socket_client');
     265        }
     266        // Clear errors to avoid confusion
     267        $this->setError('');
     268        // Make sure we are __not__ connected
     269        if ($this->connected()) {
     270            // Already connected, generate error
     271            $this->setError('Already connected to a server');
     272            return false;
     273        }
     274        if (empty($port)) {
     275            $port = self::DEFAULT_SMTP_PORT;
     276        }
     277        // Connect to the SMTP server
     278        $this->edebug(
     279            "Connection: opening to $host:$port, timeout=$timeout, options=".var_export($options, true),
     280            self::DEBUG_CONNECTION
     281        );
     282        $errno = 0;
     283        $errstr = '';
     284        if ($streamok) {
     285            $socket_context = stream_context_create($options);
     286            set_error_handler(array($this, 'errorHandler'));
     287            $this->smtp_conn = stream_socket_client(
     288                $host . ":" . $port,
     289                $errno,
     290                $errstr,
     291                $timeout,
     292                STREAM_CLIENT_CONNECT,
     293                $socket_context
     294            );
     295            restore_error_handler();
     296        } else {
     297            //Fall back to fsockopen which should work in more places, but is missing some features
     298            $this->edebug(
     299                "Connection: stream_socket_client not available, falling back to fsockopen",
     300                self::DEBUG_CONNECTION
     301            );
     302            set_error_handler(array($this, 'errorHandler'));
     303            $this->smtp_conn = fsockopen(
     304                $host,
     305                $port,
     306                $errno,
     307                $errstr,
     308                $timeout
     309            );
     310            restore_error_handler();
     311        }
     312        // Verify we connected properly
     313        if (!is_resource($this->smtp_conn)) {
     314            $this->setError(
     315                'Failed to connect to server',
     316                $errno,
     317                $errstr
     318            );
     319            $this->edebug(
     320                'SMTP ERROR: ' . $this->error['error']
     321                . ": $errstr ($errno)",
     322                self::DEBUG_CLIENT
     323            );
     324            return false;
     325        }
     326        $this->edebug('Connection: opened', self::DEBUG_CONNECTION);
     327        // SMTP server can take longer to respond, give longer timeout for first read
     328        // Windows does not have support for this timeout function
     329        if (substr(PHP_OS, 0, 3) != 'WIN') {
     330            $max = ini_get('max_execution_time');
     331            // Don't bother if unlimited
     332            if ($max != 0 && $timeout > $max) {
     333                @set_time_limit($timeout);
     334            }
     335            stream_set_timeout($this->smtp_conn, $timeout, 0);
     336        }
     337        // Get any announcement
     338        $announce = $this->get_lines();
     339        $this->edebug('SERVER -> CLIENT: ' . $announce, self::DEBUG_SERVER);
     340        return true;
     341    }
     342
     343    /**
     344     * Initiate a TLS (encrypted) session.
     345     * @access public
     346     * @return boolean
     347     */
     348    public function startTLS()
     349    {
     350        if (!$this->sendCommand('STARTTLS', 'STARTTLS', 220)) {
     351            return false;
     352        }
     353
     354        //Allow the best TLS version(s) we can
     355        $crypto_method = STREAM_CRYPTO_METHOD_TLS_CLIENT;
     356
     357        //PHP 5.6.7 dropped inclusion of TLS 1.1 and 1.2 in STREAM_CRYPTO_METHOD_TLS_CLIENT
     358        //so add them back in manually if we can
     359        if (defined('STREAM_CRYPTO_METHOD_TLSv1_2_CLIENT')) {
     360            $crypto_method |= STREAM_CRYPTO_METHOD_TLSv1_2_CLIENT;
     361            $crypto_method |= STREAM_CRYPTO_METHOD_TLSv1_1_CLIENT;
     362        }
     363
     364        // Begin encrypted connection
     365        if (!stream_socket_enable_crypto(
     366            $this->smtp_conn,
     367            true,
     368            $crypto_method
     369        )) {
     370            return false;
     371        }
     372        return true;
     373    }
     374
     375    /**
     376     * Perform SMTP authentication.
     377     * Must be run after hello().
     378     * @see hello()
     379     * @param string $username The user name
     380     * @param string $password The password
     381     * @param string $authtype The auth type (PLAIN, LOGIN, NTLM, CRAM-MD5, XOAUTH2)
     382     * @param string $realm The auth realm for NTLM
     383     * @param string $workstation The auth workstation for NTLM
     384     * @param null|OAuth $OAuth An optional OAuth instance (@see PHPMailerOAuth)
     385     * @return bool True if successfully authenticated.* @access public
     386     */
     387    public function authenticate(
     388        $username,
     389        $password,
     390        $authtype = null,
     391        $realm = '',
     392        $workstation = '',
     393        $OAuth = null
     394    ) {
     395        if (!$this->server_caps) {
     396            $this->setError('Authentication is not allowed before HELO/EHLO');
     397            return false;
     398        }
     399
     400        if (array_key_exists('EHLO', $this->server_caps)) {
     401        // SMTP extensions are available. Let's try to find a proper authentication method
     402
     403            if (!array_key_exists('AUTH', $this->server_caps)) {
     404                $this->setError('Authentication is not allowed at this stage');
     405                // 'at this stage' means that auth may be allowed after the stage changes
     406                // e.g. after STARTTLS
     407                return false;
     408            }
     409
     410            self::edebug('Auth method requested: ' . ($authtype ? $authtype : 'UNKNOWN'), self::DEBUG_LOWLEVEL);
     411            self::edebug(
     412                'Auth methods available on the server: ' . implode(',', $this->server_caps['AUTH']),
     413                self::DEBUG_LOWLEVEL
     414            );
     415
     416            if (empty($authtype)) {
     417                foreach (array('CRAM-MD5', 'LOGIN', 'PLAIN', 'NTLM', 'XOAUTH2') as $method) {
     418                    if (in_array($method, $this->server_caps['AUTH'])) {
     419                        $authtype = $method;
     420                        break;
     421                    }
     422                }
     423                if (empty($authtype)) {
     424                    $this->setError('No supported authentication methods found');
     425                    return false;
     426                }
     427                self::edebug('Auth method selected: '.$authtype, self::DEBUG_LOWLEVEL);
     428            }
     429
     430            if (!in_array($authtype, $this->server_caps['AUTH'])) {
     431                $this->setError("The requested authentication method \"$authtype\" is not supported by the server");
     432                return false;
     433            }
     434        } elseif (empty($authtype)) {
     435            $authtype = 'LOGIN';
     436        }
     437        switch ($authtype) {
     438            case 'PLAIN':
     439                // Start authentication
     440                if (!$this->sendCommand('AUTH', 'AUTH PLAIN', 334)) {
     441                    return false;
     442                }
     443                // Send encoded username and password
     444                if (!$this->sendCommand(
     445                    'User & Password',
     446                    base64_encode("\0" . $username . "\0" . $password),
     447                    235
     448                )
     449                ) {
     450                    return false;
     451                }
     452                break;
     453            case 'LOGIN':
     454                // Start authentication
     455                if (!$this->sendCommand('AUTH', 'AUTH LOGIN', 334)) {
     456                    return false;
     457                }
     458                if (!$this->sendCommand("Username", base64_encode($username), 334)) {
     459                    return false;
     460                }
     461                if (!$this->sendCommand("Password", base64_encode($password), 235)) {
     462                    return false;
     463                }
     464                break;
     465            case 'XOAUTH2':
     466                //If the OAuth Instance is not set. Can be a case when PHPMailer is used
     467                //instead of PHPMailerOAuth
     468                if (is_null($OAuth)) {
     469                    return false;
     470                }
     471                $oauth = $OAuth->getOauth64();
     472
     473                // Start authentication
     474                if (!$this->sendCommand('AUTH', 'AUTH XOAUTH2 ' . $oauth, 235)) {
     475                    return false;
     476                }
     477                break;
     478            case 'NTLM':
     479                /*
     480                 * ntlm_sasl_client.php
     481                 * Bundled with Permission
     482                 *
     483                 * How to telnet in windows:
     484                 * http://technet.microsoft.com/en-us/library/aa995718%28EXCHG.65%29.aspx
     485                 * PROTOCOL Docs http://curl.haxx.se/rfc/ntlm.html#ntlmSmtpAuthentication
     486                 */
     487                require_once 'extras/ntlm_sasl_client.php';
     488                $temp = new stdClass;
     489                $ntlm_client = new ntlm_sasl_client_class;
     490                //Check that functions are available
     491                if (!$ntlm_client->initialize($temp)) {
     492                    $this->setError($temp->error);
     493                    $this->edebug(
     494                        'You need to enable some modules in your php.ini file: '
     495                        . $this->error['error'],
     496                        self::DEBUG_CLIENT
     497                    );
     498                    return false;
     499                }
     500                //msg1
     501                $msg1 = $ntlm_client->typeMsg1($realm, $workstation); //msg1
     502
     503                if (!$this->sendCommand(
     504                    'AUTH NTLM',
     505                    'AUTH NTLM ' . base64_encode($msg1),
     506                    334
     507                )
     508                ) {
     509                    return false;
     510                }
     511                //Though 0 based, there is a white space after the 3 digit number
     512                //msg2
     513                $challenge = substr($this->last_reply, 3);
     514                $challenge = base64_decode($challenge);
     515                $ntlm_res = $ntlm_client->NTLMResponse(
     516                    substr($challenge, 24, 8),
     517                    $password
     518                );
     519                //msg3
     520                $msg3 = $ntlm_client->typeMsg3(
     521                    $ntlm_res,
     522                    $username,
     523                    $realm,
     524                    $workstation
     525                );
     526                // send encoded username
     527                return $this->sendCommand('Username', base64_encode($msg3), 235);
     528            case 'CRAM-MD5':
     529                // Start authentication
     530                if (!$this->sendCommand('AUTH CRAM-MD5', 'AUTH CRAM-MD5', 334)) {
     531                    return false;
     532                }
     533                // Get the challenge
     534                $challenge = base64_decode(substr($this->last_reply, 4));
     535
     536                // Build the response
     537                $response = $username . ' ' . $this->hmac($challenge, $password);
     538
     539                // send encoded credentials
     540                return $this->sendCommand('Username', base64_encode($response), 235);
     541            default:
     542                $this->setError("Authentication method \"$authtype\" is not supported");
     543                return false;
     544        }
     545        return true;
     546    }
     547
     548    /**
     549     * Calculate an MD5 HMAC hash.
     550     * Works like hash_hmac('md5', $data, $key)
     551     * in case that function is not available
     552     * @param string $data The data to hash
     553     * @param string $key  The key to hash with
     554     * @access protected
     555     * @return string
     556     */
     557    protected function hmac($data, $key)
     558    {
     559        if (function_exists('hash_hmac')) {
     560            return hash_hmac('md5', $data, $key);
     561        }
     562
     563        // The following borrowed from
     564        // http://php.net/manual/en/function.mhash.php#27225
     565
     566        // RFC 2104 HMAC implementation for php.
     567        // Creates an md5 HMAC.
     568        // Eliminates the need to install mhash to compute a HMAC
     569        // by Lance Rushing
     570
     571        $bytelen = 64; // byte length for md5
     572        if (strlen($key) > $bytelen) {
     573            $key = pack('H*', md5($key));
     574        }
     575        $key = str_pad($key, $bytelen, chr(0x00));
     576        $ipad = str_pad('', $bytelen, chr(0x36));
     577        $opad = str_pad('', $bytelen, chr(0x5c));
     578        $k_ipad = $key ^ $ipad;
     579        $k_opad = $key ^ $opad;
     580
     581        return md5($k_opad . pack('H*', md5($k_ipad . $data)));
     582    }
     583
     584    /**
     585     * Check connection state.
     586     * @access public
     587     * @return boolean True if connected.
     588     */
     589    public function connected()
     590    {
     591        if (is_resource($this->smtp_conn)) {
     592            $sock_status = stream_get_meta_data($this->smtp_conn);
     593            if ($sock_status['eof']) {
     594                // The socket is valid but we are not connected
     595                $this->edebug(
     596                    'SMTP NOTICE: EOF caught while checking if connected',
     597                    self::DEBUG_CLIENT
     598                );
     599                $this->close();
     600                return false;
     601            }
     602            return true; // everything looks good
     603        }
     604        return false;
     605    }
     606
     607    /**
     608     * Close the socket and clean up the state of the class.
     609     * Don't use this function without first trying to use QUIT.
     610     * @see quit()
     611     * @access public
     612     * @return void
     613     */
     614    public function close()
     615    {
     616        $this->setError('');
     617        $this->server_caps = null;
     618        $this->helo_rply = null;
     619        if (is_resource($this->smtp_conn)) {
     620            // close the connection and cleanup
     621            fclose($this->smtp_conn);
     622            $this->smtp_conn = null; //Makes for cleaner serialization
     623            $this->edebug('Connection: closed', self::DEBUG_CONNECTION);
     624        }
     625    }
     626
     627    /**
     628     * Send an SMTP DATA command.
     629     * Issues a data command and sends the msg_data to the server,
     630     * finializing the mail transaction. $msg_data is the message
     631     * that is to be send with the headers. Each header needs to be
     632     * on a single line followed by a <CRLF> with the message headers
     633     * and the message body being separated by and additional <CRLF>.
     634     * Implements rfc 821: DATA <CRLF>
     635     * @param string $msg_data Message data to send
     636     * @access public
     637     * @return boolean
     638     */
     639    public function data($msg_data)
     640    {
     641        //This will use the standard timelimit
     642        if (!$this->sendCommand('DATA', 'DATA', 354)) {
     643            return false;
     644        }
     645
     646        /* The server is ready to accept data!
     647         * According to rfc821 we should not send more than 1000 characters on a single line (including the CRLF)
     648         * so we will break the data up into lines by \r and/or \n then if needed we will break each of those into
     649         * smaller lines to fit within the limit.
     650         * We will also look for lines that start with a '.' and prepend an additional '.'.
     651         * NOTE: this does not count towards line-length limit.
     652         */
     653
     654        // Normalize line breaks before exploding
     655        $lines = explode("\n", str_replace(array("\r\n", "\r"), "\n", $msg_data));
     656
     657        /* To distinguish between a complete RFC822 message and a plain message body, we check if the first field
     658         * of the first line (':' separated) does not contain a space then it _should_ be a header and we will
     659         * process all lines before a blank line as headers.
     660         */
     661
     662        $field = substr($lines[0], 0, strpos($lines[0], ':'));
     663        $in_headers = false;
     664        if (!empty($field) && strpos($field, ' ') === false) {
     665            $in_headers = true;
     666        }
     667
     668        foreach ($lines as $line) {
     669            $lines_out = array();
     670            if ($in_headers and $line == '') {
     671                $in_headers = false;
     672            }
     673            //Break this line up into several smaller lines if it's too long
     674            //Micro-optimisation: isset($str[$len]) is faster than (strlen($str) > $len),
     675            while (isset($line[self::MAX_LINE_LENGTH])) {
     676                //Working backwards, try to find a space within the last MAX_LINE_LENGTH chars of the line to break on
     677                //so as to avoid breaking in the middle of a word
     678                $pos = strrpos(substr($line, 0, self::MAX_LINE_LENGTH), ' ');
     679                //Deliberately matches both false and 0
     680                if (!$pos) {
     681                    //No nice break found, add a hard break
     682                    $pos = self::MAX_LINE_LENGTH - 1;
     683                    $lines_out[] = substr($line, 0, $pos);
     684                    $line = substr($line, $pos);
     685                } else {
     686                    //Break at the found point
     687                    $lines_out[] = substr($line, 0, $pos);
     688                    //Move along by the amount we dealt with
     689                    $line = substr($line, $pos + 1);
     690                }
     691                //If processing headers add a LWSP-char to the front of new line RFC822 section 3.1.1
     692                if ($in_headers) {
     693                    $line = "\t" . $line;
     694                }
     695            }
     696            $lines_out[] = $line;
     697
     698            //Send the lines to the server
     699            foreach ($lines_out as $line_out) {
     700                //RFC2821 section 4.5.2
     701                if (!empty($line_out) and $line_out[0] == '.') {
     702                    $line_out = '.' . $line_out;
     703                }
     704                $this->client_send($line_out . self::CRLF);
     705            }
     706        }
     707
     708        //Message data has been sent, complete the command
     709        //Increase timelimit for end of DATA command
     710        $savetimelimit = $this->Timelimit;
     711        $this->Timelimit = $this->Timelimit * 2;
     712        $result = $this->sendCommand('DATA END', '.', 250);
     713        //Restore timelimit
     714        $this->Timelimit = $savetimelimit;
     715        return $result;
     716    }
     717
     718    /**
     719     * Send an SMTP HELO or EHLO command.
     720     * Used to identify the sending server to the receiving server.
     721     * This makes sure that client and server are in a known state.
     722     * Implements RFC 821: HELO <SP> <domain> <CRLF>
     723     * and RFC 2821 EHLO.
     724     * @param string $host The host name or IP to connect to
     725     * @access public
     726     * @return boolean
     727     */
     728    public function hello($host = '')
     729    {
     730        //Try extended hello first (RFC 2821)
     731        return (boolean)($this->sendHello('EHLO', $host) or $this->sendHello('HELO', $host));
     732    }
     733
     734    /**
     735     * Send an SMTP HELO or EHLO command.
     736     * Low-level implementation used by hello()
     737     * @see hello()
     738     * @param string $hello The HELO string
     739     * @param string $host The hostname to say we are
     740     * @access protected
     741     * @return boolean
     742     */
     743    protected function sendHello($hello, $host)
     744    {
     745        $noerror = $this->sendCommand($hello, $hello . ' ' . $host, 250);
     746        $this->helo_rply = $this->last_reply;
     747        if ($noerror) {
     748            $this->parseHelloFields($hello);
     749        } else {
     750            $this->server_caps = null;
     751        }
     752        return $noerror;
     753    }
     754
     755    /**
     756     * Parse a reply to HELO/EHLO command to discover server extensions.
     757     * In case of HELO, the only parameter that can be discovered is a server name.
     758     * @access protected
     759     * @param string $type - 'HELO' or 'EHLO'
     760     */
     761    protected function parseHelloFields($type)
     762    {
     763        $this->server_caps = array();
     764        $lines = explode("\n", $this->helo_rply);
     765
     766        foreach ($lines as $n => $s) {
     767            //First 4 chars contain response code followed by - or space
     768            $s = trim(substr($s, 4));
     769            if (empty($s)) {
     770                continue;
     771            }
     772            $fields = explode(' ', $s);
     773            if (!empty($fields)) {
     774                if (!$n) {
     775                    $name = $type;
     776                    $fields = $fields[0];
     777                } else {
     778                    $name = array_shift($fields);
     779                    switch ($name) {
     780                        case 'SIZE':
     781                            $fields = ($fields ? $fields[0] : 0);
     782                            break;
     783                        case 'AUTH':
     784                            if (!is_array($fields)) {
     785                                $fields = array();
     786                            }
     787                            break;
     788                        default:
     789                            $fields = true;
     790                    }
     791                }
     792                $this->server_caps[$name] = $fields;
     793            }
     794        }
     795    }
     796
     797    /**
     798     * Send an SMTP MAIL command.
     799     * Starts a mail transaction from the email address specified in
     800     * $from. Returns true if successful or false otherwise. If True
     801     * the mail transaction is started and then one or more recipient
     802     * commands may be called followed by a data command.
     803     * Implements rfc 821: MAIL <SP> FROM:<reverse-path> <CRLF>
     804     * @param string $from Source address of this message
     805     * @access public
     806     * @return boolean
     807     */
     808    public function mail($from)
     809    {
     810        $useVerp = ($this->do_verp ? ' XVERP' : '');
     811        return $this->sendCommand(
     812            'MAIL FROM',
     813            'MAIL FROM:<' . $from . '>' . $useVerp,
     814            250
     815        );
     816    }
     817
     818    /**
     819     * Send an SMTP QUIT command.
     820     * Closes the socket if there is no error or the $close_on_error argument is true.
     821     * Implements from rfc 821: QUIT <CRLF>
     822     * @param boolean $close_on_error Should the connection close if an error occurs?
     823     * @access public
     824     * @return boolean
     825     */
     826    public function quit($close_on_error = true)
     827    {
     828        $noerror = $this->sendCommand('QUIT', 'QUIT', 221);
     829        $err = $this->error; //Save any error
     830        if ($noerror or $close_on_error) {
     831            $this->close();
     832            $this->error = $err; //Restore any error from the quit command
     833        }
     834        return $noerror;
     835    }
     836
     837    /**
     838     * Send an SMTP RCPT command.
     839     * Sets the TO argument to $toaddr.
     840     * Returns true if the recipient was accepted false if it was rejected.
     841     * Implements from rfc 821: RCPT <SP> TO:<forward-path> <CRLF>
     842     * @param string $address The address the message is being sent to
     843     * @access public
     844     * @return boolean
     845     */
     846    public function recipient($address)
     847    {
     848        return $this->sendCommand(
     849            'RCPT TO',
     850            'RCPT TO:<' . $address . '>',
     851            array(250, 251)
     852        );
     853    }
     854
     855    /**
     856     * Send an SMTP RSET command.
     857     * Abort any transaction that is currently in progress.
     858     * Implements rfc 821: RSET <CRLF>
     859     * @access public
     860     * @return boolean True on success.
     861     */
     862    public function reset()
     863    {
     864        return $this->sendCommand('RSET', 'RSET', 250);
     865    }
     866
     867    /**
     868     * Send a command to an SMTP server and check its return code.
     869     * @param string $command The command name - not sent to the server
     870     * @param string $commandstring The actual command to send
     871     * @param integer|array $expect One or more expected integer success codes
     872     * @access protected
     873     * @return boolean True on success.
     874     */
     875    protected function sendCommand($command, $commandstring, $expect)
     876    {
     877        if (!$this->connected()) {
     878            $this->setError("Called $command without being connected");
     879            return false;
     880        }
     881        //Reject line breaks in all commands
     882        if (strpos($commandstring, "\n") !== false or strpos($commandstring, "\r") !== false) {
     883            $this->setError("Command '$command' contained line breaks");
     884            return false;
     885        }
     886        $this->client_send($commandstring . self::CRLF);
     887
     888        $this->last_reply = $this->get_lines();
     889        // Fetch SMTP code and possible error code explanation
     890        $matches = array();
     891        if (preg_match("/^([0-9]{3})[ -](?:([0-9]\\.[0-9]\\.[0-9]) )?/", $this->last_reply, $matches)) {
     892            $code = $matches[1];
     893            $code_ex = (count($matches) > 2 ? $matches[2] : null);
     894            // Cut off error code from each response line
     895            $detail = preg_replace(
     896                "/{$code}[ -]".($code_ex ? str_replace('.', '\\.', $code_ex).' ' : '')."/m",
     897                '',
     898                $this->last_reply
     899            );
     900        } else {
     901            // Fall back to simple parsing if regex fails
     902            $code = substr($this->last_reply, 0, 3);
     903            $code_ex = null;
     904            $detail = substr($this->last_reply, 4);
     905        }
     906
     907        $this->edebug('SERVER -> CLIENT: ' . $this->last_reply, self::DEBUG_SERVER);
     908
     909        if (!in_array($code, (array)$expect)) {
     910            $this->setError(
     911                "$command command failed",
     912                $detail,
     913                $code,
     914                $code_ex
     915            );
     916            $this->edebug(
     917                'SMTP ERROR: ' . $this->error['error'] . ': ' . $this->last_reply,
     918                self::DEBUG_CLIENT
     919            );
     920            return false;
     921        }
     922
     923        $this->setError('');
     924        return true;
     925    }
     926
     927    /**
     928     * Send an SMTP SAML command.
     929     * Starts a mail transaction from the email address specified in $from.
     930     * Returns true if successful or false otherwise. If True
     931     * the mail transaction is started and then one or more recipient
     932     * commands may be called followed by a data command. This command
     933     * will send the message to the users terminal if they are logged
     934     * in and send them an email.
     935     * Implements rfc 821: SAML <SP> FROM:<reverse-path> <CRLF>
     936     * @param string $from The address the message is from
     937     * @access public
     938     * @return boolean
     939     */
     940    public function sendAndMail($from)
     941    {
     942        return $this->sendCommand('SAML', "SAML FROM:$from", 250);
     943    }
     944
     945    /**
     946     * Send an SMTP VRFY command.
     947     * @param string $name The name to verify
     948     * @access public
     949     * @return boolean
     950     */
     951    public function verify($name)
     952    {
     953        return $this->sendCommand('VRFY', "VRFY $name", array(250, 251));
     954    }
     955
     956    /**
     957     * Send an SMTP NOOP command.
     958     * Used to keep keep-alives alive, doesn't actually do anything
     959     * @access public
     960     * @return boolean
     961     */
     962    public function noop()
     963    {
     964        return $this->sendCommand('NOOP', 'NOOP', 250);
     965    }
     966
     967    /**
     968     * Send an SMTP TURN command.
     969     * This is an optional command for SMTP that this class does not support.
     970     * This method is here to make the RFC821 Definition complete for this class
     971     * and _may_ be implemented in future
     972     * Implements from rfc 821: TURN <CRLF>
     973     * @access public
     974     * @return boolean
     975     */
     976    public function turn()
     977    {
     978        $this->setError('The SMTP TURN command is not implemented');
     979        $this->edebug('SMTP NOTICE: ' . $this->error['error'], self::DEBUG_CLIENT);
     980        return false;
     981    }
     982
     983    /**
     984     * Send raw data to the server.
     985     * @param string $data The data to send
     986     * @access public
     987     * @return integer|boolean The number of bytes sent to the server or false on error
     988     */
     989    public function client_send($data)
     990    {
     991        $this->edebug("CLIENT -> SERVER: $data", self::DEBUG_CLIENT);
     992        return fwrite($this->smtp_conn, $data);
     993    }
     994
     995    /**
     996     * Get the latest error.
     997     * @access public
     998     * @return array
     999     */
     1000    public function getError()
     1001    {
     1002        return $this->error;
     1003    }
     1004
     1005    /**
     1006     * Get SMTP extensions available on the server
     1007     * @access public
     1008     * @return array|null
     1009     */
     1010    public function getServerExtList()
     1011    {
     1012        return $this->server_caps;
     1013    }
     1014
     1015    /**
     1016     * A multipurpose method
     1017     * The method works in three ways, dependent on argument value and current state
     1018     *   1. HELO/EHLO was not sent - returns null and set up $this->error
     1019     *   2. HELO was sent
     1020     *     $name = 'HELO': returns server name
     1021     *     $name = 'EHLO': returns boolean false
     1022     *     $name = any string: returns null and set up $this->error
     1023     *   3. EHLO was sent
     1024     *     $name = 'HELO'|'EHLO': returns server name
     1025     *     $name = any string: if extension $name exists, returns boolean True
     1026     *       or its options. Otherwise returns boolean False
     1027     * In other words, one can use this method to detect 3 conditions:
     1028     *  - null returned: handshake was not or we don't know about ext (refer to $this->error)
     1029     *  - false returned: the requested feature exactly not exists
     1030     *  - positive value returned: the requested feature exists
     1031     * @param string $name Name of SMTP extension or 'HELO'|'EHLO'
     1032     * @return mixed
     1033     */
     1034    public function getServerExt($name)
     1035    {
     1036        if (!$this->server_caps) {
     1037            $this->setError('No HELO/EHLO was sent');
     1038            return null;
     1039        }
     1040
     1041        // the tight logic knot ;)
     1042        if (!array_key_exists($name, $this->server_caps)) {
     1043            if ($name == 'HELO') {
     1044                return $this->server_caps['EHLO'];
     1045            }
     1046            if ($name == 'EHLO' || array_key_exists('EHLO', $this->server_caps)) {
     1047                return false;
     1048            }
     1049            $this->setError('HELO handshake was used. Client knows nothing about server extensions');
     1050            return null;
     1051        }
     1052
     1053        return $this->server_caps[$name];
     1054    }
     1055
     1056    /**
     1057     * Get the last reply from the server.
     1058     * @access public
     1059     * @return string
     1060     */
     1061    public function getLastReply()
     1062    {
     1063        return $this->last_reply;
     1064    }
     1065
     1066    /**
     1067     * Read the SMTP server's response.
     1068     * Either before eof or socket timeout occurs on the operation.
     1069     * With SMTP we can tell if we have more lines to read if the
     1070     * 4th character is '-' symbol. If it is a space then we don't
     1071     * need to read anything else.
     1072     * @access protected
     1073     * @return string
     1074     */
     1075    protected function get_lines()
     1076    {
     1077        // If the connection is bad, give up straight away
     1078        if (!is_resource($this->smtp_conn)) {
     1079            return '';
     1080        }
     1081        $data = '';
     1082        $endtime = 0;
     1083        stream_set_timeout($this->smtp_conn, $this->Timeout);
     1084        if ($this->Timelimit > 0) {
     1085            $endtime = time() + $this->Timelimit;
     1086        }
     1087        while (is_resource($this->smtp_conn) && !feof($this->smtp_conn)) {
     1088            $str = @fgets($this->smtp_conn, 515);
     1089            $this->edebug("SMTP -> get_lines(): \$data is \"$data\"", self::DEBUG_LOWLEVEL);
     1090            $this->edebug("SMTP -> get_lines(): \$str is  \"$str\"", self::DEBUG_LOWLEVEL);
     1091            $data .= $str;
     1092            // If 4th character is a space, we are done reading, break the loop, micro-optimisation over strlen
     1093            if ((isset($str[3]) and $str[3] == ' ')) {
     1094                break;
     1095            }
     1096            // Timed-out? Log and break
     1097            $info = stream_get_meta_data($this->smtp_conn);
     1098            if ($info['timed_out']) {
     1099                $this->edebug(
     1100                    'SMTP -> get_lines(): timed-out (' . $this->Timeout . ' sec)',
     1101                    self::DEBUG_LOWLEVEL
     1102                );
     1103                break;
     1104            }
     1105            // Now check if reads took too long
     1106            if ($endtime and time() > $endtime) {
     1107                $this->edebug(
     1108                    'SMTP -> get_lines(): timelimit reached ('.
     1109                    $this->Timelimit . ' sec)',
     1110                    self::DEBUG_LOWLEVEL
     1111                );
     1112                break;
     1113            }
     1114        }
     1115        return $data;
     1116    }
     1117
     1118    /**
     1119     * Enable or disable VERP address generation.
     1120     * @param boolean $enabled
     1121     */
     1122    public function setVerp($enabled = false)
     1123    {
     1124        $this->do_verp = $enabled;
     1125    }
     1126
     1127    /**
     1128     * Get VERP address generation mode.
     1129     * @return boolean
     1130     */
     1131    public function getVerp()
     1132    {
     1133        return $this->do_verp;
     1134    }
     1135
     1136    /**
     1137     * Set error messages and codes.
     1138     * @param string $message The error message
     1139     * @param string $detail Further detail on the error
     1140     * @param string $smtp_code An associated SMTP error code
     1141     * @param string $smtp_code_ex Extended SMTP code
     1142     */
     1143    protected function setError($message, $detail = '', $smtp_code = '', $smtp_code_ex = '')
     1144    {
     1145        $this->error = array(
     1146            'error' => $message,
     1147            'detail' => $detail,
     1148            'smtp_code' => $smtp_code,
     1149            'smtp_code_ex' => $smtp_code_ex
     1150        );
     1151    }
     1152
     1153    /**
     1154     * Set debug output method.
     1155     * @param string|callable $method The name of the mechanism to use for debugging output, or a callable to handle it.
     1156     */
     1157    public function setDebugOutput($method = 'echo')
     1158    {
     1159        $this->Debugoutput = $method;
     1160    }
     1161
     1162    /**
     1163     * Get debug output method.
     1164     * @return string
     1165     */
     1166    public function getDebugOutput()
     1167    {
     1168        return $this->Debugoutput;
     1169    }
     1170
     1171    /**
     1172     * Set debug output level.
     1173     * @param integer $level
     1174     */
     1175    public function setDebugLevel($level = 0)
     1176    {
     1177        $this->do_debug = $level;
     1178    }
     1179
     1180    /**
     1181     * Get debug output level.
     1182     * @return integer
     1183     */
     1184    public function getDebugLevel()
     1185    {
     1186        return $this->do_debug;
     1187    }
     1188
     1189    /**
     1190     * Set SMTP timeout.
     1191     * @param integer $timeout
     1192     */
     1193    public function setTimeout($timeout = 0)
     1194    {
     1195        $this->Timeout = $timeout;
     1196    }
     1197
     1198    /**
     1199     * Get SMTP timeout.
     1200     * @return integer
     1201     */
     1202    public function getTimeout()
     1203    {
     1204        return $this->Timeout;
     1205    }
     1206
     1207    /**
     1208     * Reports an error number and string.
     1209     * @param integer $errno The error number returned by PHP.
     1210     * @param string $errmsg The error message returned by PHP.
     1211     */
     1212    protected function errorHandler($errno, $errmsg)
     1213    {
     1214        $notice = 'Connection: Failed to connect to server.';
     1215        $this->setError(
     1216            $notice,
     1217            $errno,
     1218            $errmsg
     1219        );
     1220        $this->edebug(
     1221            $notice . ' Error number ' . $errno . '. "Error notice: ' . $errmsg,
     1222            self::DEBUG_CONNECTION
     1223        );
     1224    }
     1225
     1226        /**
     1227         * Will return the ID of the last smtp transaction based on a list of patterns provided
     1228         * in SMTP::$smtp_transaction_id_patterns.
     1229         * If no reply has been received yet, it will return null.
     1230         * If no pattern has been matched, it will return false.
     1231         * @return bool|null|string
     1232         */
     1233        public function getLastTransactionID()
     1234        {
     1235                $reply = $this->getLastReply();
     1236
     1237                if (empty($reply)) {
     1238                        return null;
     1239                }
     1240
     1241                foreach($this->smtp_transaction_id_patterns as $smtp_transaction_id_pattern) {
     1242                        if(preg_match($smtp_transaction_id_pattern, $reply, $matches)) {
     1243                                return $matches[1];
     1244                        }
     1245                }
     1246
     1247                return false;
     1248    }
     1249}
  • new file wp-includes/PHPMailer/composer.json

    diff --git wp-includes/PHPMailer/composer.json wp-includes/PHPMailer/composer.json
    new file mode 100644
    index 0000000..1112fb9
    - +  
     1{
     2    "name": "phpmailer/phpmailer",
     3    "type": "library",
     4    "description": "PHPMailer is a full-featured email creation and transfer class for PHP",
     5    "authors": [
     6        {
     7            "name": "Marcus Bointon",
     8            "email": "phpmailer@synchromedia.co.uk"
     9        },
     10        {
     11            "name": "Jim Jagielski",
     12            "email": "jimjag@gmail.com"
     13        },
     14        {
     15            "name": "Andy Prevost",
     16            "email": "codeworxtech@users.sourceforge.net"
     17        },
     18        {
     19            "name": "Brent R. Matzelle"
     20        }
     21    ],
     22    "require": {
     23        "php": ">=5.0.0"
     24    },
     25    "require-dev": {
     26        "phpdocumentor/phpdocumentor": "*",
     27        "phpunit/phpunit": "4.7.*"
     28    },
     29    "suggest": {
     30        "league/oauth2-google": "Needed for Google XOAUTH2 authentication"
     31    },
     32    "autoload": {
     33        "classmap": [
     34            "class.phpmailer.php",
     35            "class.phpmaileroauth.php",
     36            "class.phpmaileroauthgoogle.php",
     37            "class.smtp.php",
     38            "class.pop3.php",
     39            "extras/EasyPeasyICS.php",
     40            "extras/ntlm_sasl_client.php"
     41        ]
     42    },
     43    "license": "LGPL-2.1"
     44}
  • new file wp-includes/PHPMailer/composer.lock

    diff --git wp-includes/PHPMailer/composer.lock wp-includes/PHPMailer/composer.lock
    new file mode 100644
    index 0000000..9edbf55
    - +  
     1{
     2    "_readme": [
     3        "This file locks the dependencies of your project to a known state",
     4        "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
     5        "This file is @generated automatically"
     6    ],
     7    "hash": "ca5abc72444d9608a35c39f9064c139b",
     8    "content-hash": "8b66ed71ae9ca8cd0258c814615d624f",
     9    "packages": [],
     10    "packages-dev": [
     11        {
     12            "name": "cilex/cilex",
     13            "version": "1.1.0",
     14            "source": {
     15                "type": "git",
     16                "url": "https://github.com/Cilex/Cilex.git",
     17                "reference": "7acd965a609a56d0345e8b6071c261fbdb926cb5"
     18            },
     19            "dist": {
     20                "type": "zip",
     21                "url": "https://api.github.com/repos/Cilex/Cilex/zipball/7acd965a609a56d0345e8b6071c261fbdb926cb5",
     22                "reference": "7acd965a609a56d0345e8b6071c261fbdb926cb5",
     23                "shasum": ""
     24            },
     25            "require": {
     26                "cilex/console-service-provider": "1.*",
     27                "php": ">=5.3.3",
     28                "pimple/pimple": "~1.0",
     29                "symfony/finder": "~2.1",
     30                "symfony/process": "~2.1"
     31            },
     32            "require-dev": {
     33                "phpunit/phpunit": "3.7.*",
     34                "symfony/validator": "~2.1"
     35            },
     36            "suggest": {
     37                "monolog/monolog": ">=1.0.0",
     38                "symfony/validator": ">=1.0.0",
     39                "symfony/yaml": ">=1.0.0"
     40            },
     41            "type": "library",
     42            "extra": {
     43                "branch-alias": {
     44                    "dev-master": "1.0-dev"
     45                }
     46            },
     47            "autoload": {
     48                "psr-0": {
     49                    "Cilex": "src/"
     50                }
     51            },
     52            "notification-url": "https://packagist.org/downloads/",
     53            "license": [
     54                "MIT"
     55            ],
     56            "authors": [
     57                {
     58                    "name": "Mike van Riel",
     59                    "email": "mike.vanriel@naenius.com"
     60                }
     61            ],
     62            "description": "The PHP micro-framework for Command line tools based on the Symfony2 Components",
     63            "homepage": "http://cilex.github.com",
     64            "keywords": [
     65                "cli",
     66                "microframework"
     67            ],
     68            "time": "2014-03-29 14:03:13"
     69        },
     70        {
     71            "name": "cilex/console-service-provider",
     72            "version": "1.0.0",
     73            "source": {
     74                "type": "git",
     75                "url": "https://github.com/Cilex/console-service-provider.git",
     76                "reference": "25ee3d1875243d38e1a3448ff94bdf944f70d24e"
     77            },
     78            "dist": {
     79                "type": "zip",
     80                "url": "https://api.github.com/repos/Cilex/console-service-provider/zipball/25ee3d1875243d38e1a3448ff94bdf944f70d24e",
     81                "reference": "25ee3d1875243d38e1a3448ff94bdf944f70d24e",
     82                "shasum": ""
     83            },
     84            "require": {
     85                "php": ">=5.3.3",
     86                "pimple/pimple": "1.*@dev",
     87                "symfony/console": "~2.1"
     88            },
     89            "require-dev": {
     90                "cilex/cilex": "1.*@dev",
     91                "silex/silex": "1.*@dev"
     92            },
     93            "type": "library",
     94            "extra": {
     95                "branch-alias": {
     96                    "dev-master": "1.0-dev"
     97                }
     98            },
     99            "autoload": {
     100                "psr-0": {
     101                    "Cilex\\Provider\\Console": "src"
     102                }
     103            },
     104            "notification-url": "https://packagist.org/downloads/",
     105            "license": [
     106                "MIT"
     107            ],
     108            "authors": [
     109                {
     110                    "name": "Beau Simensen",
     111                    "email": "beau@dflydev.com",
     112                    "homepage": "http://beausimensen.com"
     113                },
     114                {
     115                    "name": "Mike van Riel",
     116                    "email": "mike.vanriel@naenius.com"
     117                }
     118            ],
     119            "description": "Console Service Provider",
     120            "keywords": [
     121                "cilex",
     122                "console",
     123                "pimple",
     124                "service-provider",
     125                "silex"
     126            ],
     127            "time": "2012-12-19 10:50:58"
     128        },
     129        {
     130            "name": "container-interop/container-interop",
     131            "version": "1.1.0",
     132            "source": {
     133                "type": "git",
     134                "url": "https://github.com/container-interop/container-interop.git",
     135                "reference": "fc08354828f8fd3245f77a66b9e23a6bca48297e"
     136            },
     137            "dist": {
     138                "type": "zip",
     139                "url": "https://api.github.com/repos/container-interop/container-interop/zipball/fc08354828f8fd3245f77a66b9e23a6bca48297e",
     140                "reference": "fc08354828f8fd3245f77a66b9e23a6bca48297e",
     141                "shasum": ""
     142            },
     143            "type": "library",
     144            "autoload": {
     145                "psr-4": {
     146                    "Interop\\Container\\": "src/Interop/Container/"
     147                }
     148            },
     149            "notification-url": "https://packagist.org/downloads/",
     150            "license": [
     151                "MIT"
     152            ],
     153            "description": "Promoting the interoperability of container objects (DIC, SL, etc.)",
     154            "time": "2014-12-30 15:22:37"
     155        },
     156        {
     157            "name": "doctrine/annotations",
     158            "version": "v1.2.7",
     159            "source": {
     160                "type": "git",
     161                "url": "https://github.com/doctrine/annotations.git",
     162                "reference": "f25c8aab83e0c3e976fd7d19875f198ccf2f7535"
     163            },
     164            "dist": {
     165                "type": "zip",
     166                "url": "https://api.github.com/repos/doctrine/annotations/zipball/f25c8aab83e0c3e976fd7d19875f198ccf2f7535",
     167                "reference": "f25c8aab83e0c3e976fd7d19875f198ccf2f7535",
     168                "shasum": ""
     169            },
     170            "require": {
     171                "doctrine/lexer": "1.*",
     172                "php": ">=5.3.2"
     173            },
     174            "require-dev": {
     175                "doctrine/cache": "1.*",
     176                "phpunit/phpunit": "4.*"
     177            },
     178            "type": "library",
     179            "extra": {
     180                "branch-alias": {
     181                    "dev-master": "1.3.x-dev"
     182                }
     183            },
     184            "autoload": {
     185                "psr-0": {
     186                    "Doctrine\\Common\\Annotations\\": "lib/"
     187                }
     188            },
     189            "notification-url": "https://packagist.org/downloads/",
     190            "license": [
     191                "MIT"
     192            ],
     193            "authors": [
     194                {
     195                    "name": "Roman Borschel",
     196                    "email": "roman@code-factory.org"
     197                },
     198                {
     199                    "name": "Benjamin Eberlei",
     200                    "email": "kontakt@beberlei.de"
     201                },
     202                {
     203                    "name": "Guilherme Blanco",
     204                    "email": "guilhermeblanco@gmail.com"
     205                },
     206                {
     207                    "name": "Jonathan Wage",
     208                    "email": "jonwage@gmail.com"
     209                },
     210                {
     211                    "name": "Johannes Schmitt",
     212                    "email": "schmittjoh@gmail.com"
     213                }
     214            ],
     215            "description": "Docblock Annotations Parser",
     216            "homepage": "http://www.doctrine-project.org",
     217            "keywords": [
     218                "annotations",
     219                "docblock",
     220                "parser"
     221            ],
     222            "time": "2015-08-31 12:32:49"
     223        },
     224        {
     225            "name": "doctrine/instantiator",
     226            "version": "1.0.5",
     227            "source": {
     228                "type": "git",
     229                "url": "https://github.com/doctrine/instantiator.git",
     230                "reference": "8e884e78f9f0eb1329e445619e04456e64d8051d"
     231            },
     232            "dist": {
     233                "type": "zip",
     234                "url": "https://api.github.com/repos/doctrine/instantiator/zipball/8e884e78f9f0eb1329e445619e04456e64d8051d",
     235                "reference": "8e884e78f9f0eb1329e445619e04456e64d8051d",
     236                "shasum": ""
     237            },
     238            "require": {
     239                "php": ">=5.3,<8.0-DEV"
     240            },
     241            "require-dev": {
     242                "athletic/athletic": "~0.1.8",
     243                "ext-pdo": "*",
     244                "ext-phar": "*",
     245                "phpunit/phpunit": "~4.0",
     246                "squizlabs/php_codesniffer": "~2.0"
     247            },
     248            "type": "library",
     249            "extra": {
     250                "branch-alias": {
     251                    "dev-master": "1.0.x-dev"
     252                }
     253            },
     254            "autoload": {
     255                "psr-4": {
     256                    "Doctrine\\Instantiator\\": "src/Doctrine/Instantiator/"
     257                }
     258            },
     259            "notification-url": "https://packagist.org/downloads/",
     260            "license": [
     261                "MIT"
     262            ],
     263            "authors": [
     264                {
     265                    "name": "Marco Pivetta",
     266                    "email": "ocramius@gmail.com",
     267                    "homepage": "http://ocramius.github.com/"
     268                }
     269            ],
     270            "description": "A small, lightweight utility to instantiate objects in PHP without invoking their constructors",
     271            "homepage": "https://github.com/doctrine/instantiator",
     272            "keywords": [
     273                "constructor",
     274                "instantiate"
     275            ],
     276            "time": "2015-06-14 21:17:01"
     277        },
     278        {
     279            "name": "doctrine/lexer",
     280            "version": "v1.0.1",
     281            "source": {
     282                "type": "git",
     283                "url": "https://github.com/doctrine/lexer.git",
     284                "reference": "83893c552fd2045dd78aef794c31e694c37c0b8c"
     285            },
     286            "dist": {
     287                "type": "zip",
     288                "url": "https://api.github.com/repos/doctrine/lexer/zipball/83893c552fd2045dd78aef794c31e694c37c0b8c",
     289                "reference": "83893c552fd2045dd78aef794c31e694c37c0b8c",
     290                "shasum": ""
     291            },
     292            "require": {
     293                "php": ">=5.3.2"
     294            },
     295            "type": "library",
     296            "extra": {
     297                "branch-alias": {
     298                    "dev-master": "1.0.x-dev"
     299                }
     300            },
     301            "autoload": {
     302                "psr-0": {
     303                    "Doctrine\\Common\\Lexer\\": "lib/"
     304                }
     305            },
     306            "notification-url": "https://packagist.org/downloads/",
     307            "license": [
     308                "MIT"
     309            ],
     310            "authors": [
     311                {
     312                    "name": "Roman Borschel",
     313                    "email": "roman@code-factory.org"
     314                },
     315                {
     316                    "name": "Guilherme Blanco",
     317                    "email": "guilhermeblanco@gmail.com"
     318                },
     319                {
     320                    "name": "Johannes Schmitt",
     321                    "email": "schmittjoh@gmail.com"
     322                }
     323            ],
     324            "description": "Base library for a lexer that can be used in Top-Down, Recursive Descent Parsers.",
     325            "homepage": "http://www.doctrine-project.org",
     326            "keywords": [
     327                "lexer",
     328                "parser"
     329            ],
     330            "time": "2014-09-09 13:34:57"
     331        },
     332        {
     333            "name": "erusev/parsedown",
     334            "version": "1.6.0",
     335            "source": {
     336                "type": "git",
     337                "url": "https://github.com/erusev/parsedown.git",
     338                "reference": "3ebbd730b5c2cf5ce78bc1bf64071407fc6674b7"
     339            },
     340            "dist": {
     341                "type": "zip",
     342                "url": "https://api.github.com/repos/erusev/parsedown/zipball/3ebbd730b5c2cf5ce78bc1bf64071407fc6674b7",
     343                "reference": "3ebbd730b5c2cf5ce78bc1bf64071407fc6674b7",
     344                "shasum": ""
     345            },
     346            "type": "library",
     347            "autoload": {
     348                "psr-0": {
     349                    "Parsedown": ""
     350                }
     351            },
     352            "notification-url": "https://packagist.org/downloads/",
     353            "license": [
     354                "MIT"
     355            ],
     356            "authors": [
     357                {
     358                    "name": "Emanuil Rusev",
     359                    "email": "hello@erusev.com",
     360                    "homepage": "http://erusev.com"
     361                }
     362            ],
     363            "description": "Parser for Markdown.",
     364            "homepage": "http://parsedown.org",
     365            "keywords": [
     366                "markdown",
     367                "parser"
     368            ],
     369            "time": "2015-10-04 16:44:32"
     370        },
     371        {
     372            "name": "herrera-io/json",
     373            "version": "1.0.3",
     374            "source": {
     375                "type": "git",
     376                "url": "https://github.com/kherge-abandoned/php-json.git",
     377                "reference": "60c696c9370a1e5136816ca557c17f82a6fa83f1"
     378            },
     379            "dist": {
     380                "type": "zip",
     381                "url": "https://api.github.com/repos/kherge-abandoned/php-json/zipball/60c696c9370a1e5136816ca557c17f82a6fa83f1",
     382                "reference": "60c696c9370a1e5136816ca557c17f82a6fa83f1",
     383                "shasum": ""
     384            },
     385            "require": {
     386                "ext-json": "*",
     387                "justinrainbow/json-schema": ">=1.0,<2.0-dev",
     388                "php": ">=5.3.3",
     389                "seld/jsonlint": ">=1.0,<2.0-dev"
     390            },
     391            "require-dev": {
     392                "herrera-io/phpunit-test-case": "1.*",
     393                "mikey179/vfsstream": "1.1.0",
     394                "phpunit/phpunit": "3.7.*"
     395            },
     396            "type": "library",
     397            "extra": {
     398                "branch-alias": {
     399                    "dev-master": "1.0-dev"
     400                }
     401            },
     402            "autoload": {
     403                "files": [
     404                    "src/lib/json_version.php"
     405                ],
     406                "psr-0": {
     407                    "Herrera\\Json": "src/lib"
     408                }
     409            },
     410            "notification-url": "https://packagist.org/downloads/",
     411            "license": [
     412                "MIT"
     413            ],
     414            "authors": [
     415                {
     416                    "name": "Kevin Herrera",
     417                    "email": "kevin@herrera.io",
     418                    "homepage": "http://kevin.herrera.io/",
     419                    "role": "Developer"
     420                }
     421            ],
     422            "description": "A library for simplifying JSON linting and validation.",
     423            "homepage": "http://herrera-io.github.com/php-json",
     424            "keywords": [
     425                "json",
     426                "lint",
     427                "schema",
     428                "validate"
     429            ],
     430            "time": "2013-10-30 16:51:34"
     431        },
     432        {
     433            "name": "herrera-io/phar-update",
     434            "version": "1.0.3",
     435            "source": {
     436                "type": "git",
     437                "url": "https://github.com/kherge-abandoned/php-phar-update.git",
     438                "reference": "00a79e1d5b8cf3c080a2e3becf1ddf7a7fea025b"
     439            },
     440            "dist": {
     441                "type": "zip",
     442                "url": "https://api.github.com/repos/kherge-abandoned/php-phar-update/zipball/00a79e1d5b8cf3c080a2e3becf1ddf7a7fea025b",
     443                "reference": "00a79e1d5b8cf3c080a2e3becf1ddf7a7fea025b",
     444                "shasum": ""
     445            },
     446            "require": {
     447                "herrera-io/json": "1.*",
     448                "kherge/version": "1.*",
     449                "php": ">=5.3.3"
     450            },
     451            "require-dev": {
     452                "herrera-io/phpunit-test-case": "1.*",
     453                "mikey179/vfsstream": "1.1.0",
     454                "phpunit/phpunit": "3.7.*"
     455            },
     456            "type": "library",
     457            "extra": {
     458                "branch-alias": {
     459                    "dev-master": "1.0-dev"
     460                }
     461            },
     462            "autoload": {
     463                "files": [
     464                    "src/lib/constants.php"
     465                ],
     466                "psr-0": {
     467                    "Herrera\\Phar\\Update": "src/lib"
     468                }
     469            },
     470            "notification-url": "https://packagist.org/downloads/",
     471            "license": [
     472                "MIT"
     473            ],
     474            "authors": [
     475                {
     476                    "name": "Kevin Herrera",
     477                    "email": "kevin@herrera.io",
     478                    "homepage": "http://kevin.herrera.io/",
     479                    "role": "Developer"
     480                }
     481            ],
     482            "description": "A library for self-updating Phars.",
     483            "homepage": "http://herrera-io.github.com/php-phar-update",
     484            "keywords": [
     485                "phar",
     486                "update"
     487            ],
     488            "time": "2013-10-30 17:23:01"
     489        },
     490        {
     491            "name": "jms/metadata",
     492            "version": "1.5.1",
     493            "source": {
     494                "type": "git",
     495                "url": "https://github.com/schmittjoh/metadata.git",
     496                "reference": "22b72455559a25777cfd28c4ffda81ff7639f353"
     497            },
     498            "dist": {
     499                "type": "zip",
     500                "url": "https://api.github.com/repos/schmittjoh/metadata/zipball/22b72455559a25777cfd28c4ffda81ff7639f353",
     501                "reference": "22b72455559a25777cfd28c4ffda81ff7639f353",
     502                "shasum": ""
     503            },
     504            "require": {
     505                "php": ">=5.3.0"
     506            },
     507            "require-dev": {
     508                "doctrine/cache": "~1.0"
     509            },
     510            "type": "library",
     511            "extra": {
     512                "branch-alias": {
     513                    "dev-master": "1.5.x-dev"
     514                }
     515            },
     516            "autoload": {
     517                "psr-0": {
     518                    "Metadata\\": "src/"
     519                }
     520            },
     521            "notification-url": "https://packagist.org/downloads/",
     522            "license": [
     523                "Apache"
     524            ],
     525            "authors": [
     526                {
     527                    "name": "Johannes Schmitt",
     528                    "email": "schmittjoh@gmail.com",
     529                    "homepage": "https://github.com/schmittjoh",
     530                    "role": "Developer of wrapped JMSSerializerBundle"
     531                }
     532            ],
     533            "description": "Class/method/property metadata management in PHP",
     534            "keywords": [
     535                "annotations",
     536                "metadata",
     537                "xml",
     538                "yaml"
     539            ],
     540            "time": "2014-07-12 07:13:19"
     541        },
     542        {
     543            "name": "jms/parser-lib",
     544            "version": "1.0.0",
     545            "source": {
     546                "type": "git",
     547                "url": "https://github.com/schmittjoh/parser-lib.git",
     548                "reference": "c509473bc1b4866415627af0e1c6cc8ac97fa51d"
     549            },
     550            "dist": {
     551                "type": "zip",
     552                "url": "https://api.github.com/repos/schmittjoh/parser-lib/zipball/c509473bc1b4866415627af0e1c6cc8ac97fa51d",
     553                "reference": "c509473bc1b4866415627af0e1c6cc8ac97fa51d",
     554                "shasum": ""
     555            },
     556            "require": {
     557                "phpoption/phpoption": ">=0.9,<2.0-dev"
     558            },
     559            "type": "library",
     560            "extra": {
     561                "branch-alias": {
     562                    "dev-master": "1.0-dev"
     563                }
     564            },
     565            "autoload": {
     566                "psr-0": {
     567                    "JMS\\": "src/"
     568                }
     569            },
     570            "notification-url": "https://packagist.org/downloads/",
     571            "license": [
     572                "Apache2"
     573            ],
     574            "description": "A library for easily creating recursive-descent parsers.",
     575            "time": "2012-11-18 18:08:43"
     576        },
     577        {
     578            "name": "jms/serializer",
     579            "version": "1.1.0",
     580            "source": {
     581                "type": "git",
     582                "url": "https://github.com/schmittjoh/serializer.git",
     583                "reference": "fe13a1f993ea3456e195b7820692f2eb2b6bbb48"
     584            },
     585            "dist": {
     586                "type": "zip",
     587                "url": "https://api.github.com/repos/schmittjoh/serializer/zipball/fe13a1f993ea3456e195b7820692f2eb2b6bbb48",
     588                "reference": "fe13a1f993ea3456e195b7820692f2eb2b6bbb48",
     589                "shasum": ""
     590            },
     591            "require": {
     592                "doctrine/annotations": "1.*",
     593                "doctrine/instantiator": "~1.0.3",
     594                "jms/metadata": "~1.1",
     595                "jms/parser-lib": "1.*",
     596                "php": ">=5.4.0",
     597                "phpcollection/phpcollection": "~0.1"
     598            },
     599            "conflict": {
     600                "twig/twig": "<1.12"
     601            },
     602            "require-dev": {
     603                "doctrine/orm": "~2.1",
     604                "doctrine/phpcr-odm": "~1.0.1",
     605                "jackalope/jackalope-doctrine-dbal": "1.0.*",
     606                "phpunit/phpunit": "~4.0",
     607                "propel/propel1": "~1.7",
     608                "symfony/filesystem": "2.*",
     609                "symfony/form": "~2.1",
     610                "symfony/translation": "~2.0",
     611                "symfony/validator": "~2.0",
     612                "symfony/yaml": "2.*",
     613                "twig/twig": "~1.12|~2.0"
     614            },
     615            "suggest": {
     616                "symfony/yaml": "Required if you'd like to serialize data to YAML format."
     617            },
     618            "type": "library",
     619            "extra": {
     620                "branch-alias": {
     621                    "dev-master": "1.1-dev"
     622                }
     623            },
     624            "autoload": {
     625                "psr-0": {
     626                    "JMS\\Serializer": "src/"
     627                }
     628            },
     629            "notification-url": "https://packagist.org/downloads/",
     630            "license": [
     631                "Apache2"
     632            ],
     633            "authors": [
     634                {
     635                    "name": "Johannes M. Schmitt",
     636                    "email": "schmittjoh@gmail.com"
     637                }
     638            ],
     639            "description": "Library for (de-)serializing data of any complexity; supports XML, JSON, and YAML.",
     640            "homepage": "http://jmsyst.com/libs/serializer",
     641            "keywords": [
     642                "deserialization",
     643                "jaxb",
     644                "json",
     645                "serialization",
     646                "xml"
     647            ],
     648            "time": "2015-10-27 09:24:41"
     649        },
     650        {
     651            "name": "justinrainbow/json-schema",
     652            "version": "1.6.1",
     653            "source": {
     654                "type": "git",
     655                "url": "https://github.com/justinrainbow/json-schema.git",
     656                "reference": "cc84765fb7317f6b07bd8ac78364747f95b86341"
     657            },
     658            "dist": {
     659                "type": "zip",
     660                "url": "https://api.github.com/repos/justinrainbow/json-schema/zipball/cc84765fb7317f6b07bd8ac78364747f95b86341",
     661                "reference": "cc84765fb7317f6b07bd8ac78364747f95b86341",
     662                "shasum": ""
     663            },
     664            "require": {
     665                "php": ">=5.3.29"
     666            },
     667            "require-dev": {
     668                "json-schema/json-schema-test-suite": "1.1.0",
     669                "phpdocumentor/phpdocumentor": "~2",
     670                "phpunit/phpunit": "~3.7"
     671            },
     672            "bin": [
     673                "bin/validate-json"
     674            ],
     675            "type": "library",
     676            "extra": {
     677                "branch-alias": {
     678                    "dev-master": "1.6.x-dev"
     679                }
     680            },
     681            "autoload": {
     682                "psr-4": {
     683                    "JsonSchema\\": "src/JsonSchema/"
     684                }
     685            },
     686            "notification-url": "https://packagist.org/downloads/",
     687            "license": [
     688                "BSD-3-Clause"
     689            ],
     690            "authors": [
     691                {
     692                    "name": "Bruno Prieto Reis",
     693                    "email": "bruno.p.reis@gmail.com"
     694                },
     695                {
     696                    "name": "Justin Rainbow",
     697                    "email": "justin.rainbow@gmail.com"
     698                },
     699                {
     700                    "name": "Igor Wiedler",
     701                    "email": "igor@wiedler.ch"
     702                },
     703                {
     704                    "name": "Robert Schönthal",
     705                    "email": "seroscho@googlemail.com"
     706                }
     707            ],
     708            "description": "A library to validate a json schema.",
     709            "homepage": "https://github.com/justinrainbow/json-schema",
     710            "keywords": [
     711                "json",
     712                "schema"
     713            ],
     714            "time": "2016-01-25 15:43:01"
     715        },
     716        {
     717            "name": "kherge/version",
     718            "version": "1.0.1",
     719            "source": {
     720                "type": "git",
     721                "url": "https://github.com/kherge-abandoned/Version.git",
     722                "reference": "f07cf83f8ce533be8f93d2893d96d674bbeb7e30"
     723            },
     724            "dist": {
     725                "type": "zip",
     726                "url": "https://api.github.com/repos/kherge-abandoned/Version/zipball/f07cf83f8ce533be8f93d2893d96d674bbeb7e30",
     727                "reference": "f07cf83f8ce533be8f93d2893d96d674bbeb7e30",
     728                "shasum": ""
     729            },
     730            "require": {
     731                "php": ">=5.3.3"
     732            },
     733            "type": "library",
     734            "extra": {
     735                "branch-alias": {
     736                    "dev-master": "1.0-dev"
     737                }
     738            },
     739            "autoload": {
     740                "psr-0": {
     741                    "KevinGH\\Version": "src/lib/"
     742                }
     743            },
     744            "notification-url": "https://packagist.org/downloads/",
     745            "license": [
     746                "MIT"
     747            ],
     748            "authors": [
     749                {
     750                    "name": "Kevin Herrera",
     751                    "email": "me@kevingh.com",
     752                    "homepage": "http://www.kevingh.com/"
     753                }
     754            ],
     755            "description": "A parsing and comparison library for semantic versioning.",
     756            "homepage": "http://github.com/kherge/Version",
     757            "time": "2012-08-16 17:13:03"
     758        },
     759        {
     760            "name": "monolog/monolog",
     761            "version": "1.19.0",
     762            "source": {
     763                "type": "git",
     764                "url": "https://github.com/Seldaek/monolog.git",
     765                "reference": "5f56ed5212dc509c8dc8caeba2715732abb32dbf"
     766            },
     767            "dist": {
     768                "type": "zip",
     769                "url": "https://api.github.com/repos/Seldaek/monolog/zipball/5f56ed5212dc509c8dc8caeba2715732abb32dbf",
     770                "reference": "5f56ed5212dc509c8dc8caeba2715732abb32dbf",
     771                "shasum": ""
     772            },
     773            "require": {
     774                "php": ">=5.3.0",
     775                "psr/log": "~1.0"
     776            },
     777            "provide": {
     778                "psr/log-implementation": "1.0.0"
     779            },
     780            "require-dev": {
     781                "aws/aws-sdk-php": "^2.4.9",
     782                "doctrine/couchdb": "~1.0@dev",
     783                "graylog2/gelf-php": "~1.0",
     784                "jakub-onderka/php-parallel-lint": "0.9",
     785                "php-amqplib/php-amqplib": "~2.4",
     786                "php-console/php-console": "^3.1.3",
     787                "phpunit/phpunit": "~4.5",
     788                "phpunit/phpunit-mock-objects": "2.3.0",
     789                "raven/raven": "^0.13",
     790                "ruflin/elastica": ">=0.90 <3.0",
     791                "swiftmailer/swiftmailer": "~5.3"
     792            },
     793            "suggest": {
     794                "aws/aws-sdk-php": "Allow sending log messages to AWS services like DynamoDB",
     795                "doctrine/couchdb": "Allow sending log messages to a CouchDB server",
     796                "ext-amqp": "Allow sending log messages to an AMQP server (1.0+ required)",
     797                "ext-mongo": "Allow sending log messages to a MongoDB server",
     798                "graylog2/gelf-php": "Allow sending log messages to a GrayLog2 server",
     799                "mongodb/mongodb": "Allow sending log messages to a MongoDB server via PHP Driver",
     800                "php-amqplib/php-amqplib": "Allow sending log messages to an AMQP server using php-amqplib",
     801                "php-console/php-console": "Allow sending log messages to Google Chrome",
     802                "raven/raven": "Allow sending log messages to a Sentry server",
     803                "rollbar/rollbar": "Allow sending log messages to Rollbar",
     804                "ruflin/elastica": "Allow sending log messages to an Elastic Search server"
     805            },
     806            "type": "library",
     807            "extra": {
     808                "branch-alias": {
     809                    "dev-master": "2.0.x-dev"
     810                }
     811            },
     812            "autoload": {
     813                "psr-4": {
     814                    "Monolog\\": "src/Monolog"
     815                }
     816            },
     817            "notification-url": "https://packagist.org/downloads/",
     818            "license": [
     819                "MIT"
     820            ],
     821            "authors": [
     822                {
     823                    "name": "Jordi Boggiano",
     824                    "email": "j.boggiano@seld.be",
     825                    "homepage": "http://seld.be"
     826                }
     827            ],
     828            "description": "Sends your logs to files, sockets, inboxes, databases and various web services",
     829            "homepage": "http://github.com/Seldaek/monolog",
     830            "keywords": [
     831                "log",
     832                "logging",
     833                "psr-3"
     834            ],
     835            "time": "2016-04-12 18:29:35"
     836        },
     837        {
     838            "name": "nikic/php-parser",
     839            "version": "v1.4.1",
     840            "source": {
     841                "type": "git",
     842                "url": "https://github.com/nikic/PHP-Parser.git",
     843                "reference": "f78af2c9c86107aa1a34cd1dbb5bbe9eeb0d9f51"
     844            },
     845            "dist": {
     846                "type": "zip",
     847                "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/f78af2c9c86107aa1a34cd1dbb5bbe9eeb0d9f51",
     848                "reference": "f78af2c9c86107aa1a34cd1dbb5bbe9eeb0d9f51",
     849                "shasum": ""
     850            },
     851            "require": {
     852                "ext-tokenizer": "*",
     853                "php": ">=5.3"
     854            },
     855            "type": "library",
     856            "extra": {
     857                "branch-alias": {
     858                    "dev-master": "1.4-dev"
     859                }
     860            },
     861            "autoload": {
     862                "files": [
     863                    "lib/bootstrap.php"
     864                ]
     865            },
     866            "notification-url": "https://packagist.org/downloads/",
     867            "license": [
     868                "BSD-3-Clause"
     869            ],
     870            "authors": [
     871                {
     872                    "name": "Nikita Popov"
     873                }
     874            ],
     875            "description": "A PHP parser written in PHP",
     876            "keywords": [
     877                "parser",
     878                "php"
     879            ],
     880            "time": "2015-09-19 14:15:08"
     881        },
     882        {
     883            "name": "phpcollection/phpcollection",
     884            "version": "0.4.0",
     885            "source": {
     886                "type": "git",
     887                "url": "https://github.com/schmittjoh/php-collection.git",
     888                "reference": "b8bf55a0a929ca43b01232b36719f176f86c7e83"
     889            },
     890            "dist": {
     891                "type": "zip",
     892                "url": "https://api.github.com/repos/schmittjoh/php-collection/zipball/b8bf55a0a929ca43b01232b36719f176f86c7e83",
     893                "reference": "b8bf55a0a929ca43b01232b36719f176f86c7e83",
     894                "shasum": ""
     895            },
     896            "require": {
     897                "phpoption/phpoption": "1.*"
     898            },
     899            "type": "library",
     900            "extra": {
     901                "branch-alias": {
     902                    "dev-master": "0.3-dev"
     903                }
     904            },
     905            "autoload": {
     906                "psr-0": {
     907                    "PhpCollection": "src/"
     908                }
     909            },
     910            "notification-url": "https://packagist.org/downloads/",
     911            "license": [
     912                "Apache2"
     913            ],
     914            "authors": [
     915                {
     916                    "name": "Johannes M. Schmitt",
     917                    "email": "schmittjoh@gmail.com",
     918                    "homepage": "http://jmsyst.com",
     919                    "role": "Developer of wrapped JMSSerializerBundle"
     920                }
     921            ],
     922            "description": "General-Purpose Collection Library for PHP",
     923            "keywords": [
     924                "collection",
     925                "list",
     926                "map",
     927                "sequence",
     928                "set"
     929            ],
     930            "time": "2014-03-11 13:46:42"
     931        },
     932        {
     933            "name": "phpdocumentor/fileset",
     934            "version": "1.0.0",
     935            "source": {
     936                "type": "git",
     937                "url": "https://github.com/phpDocumentor/Fileset.git",
     938                "reference": "bfa78d8fa9763dfce6d0e5d3730c1d8ab25d34b0"
     939            },
     940            "dist": {
     941                "type": "zip",
     942                "url": "https://api.github.com/repos/phpDocumentor/Fileset/zipball/bfa78d8fa9763dfce6d0e5d3730c1d8ab25d34b0",
     943                "reference": "bfa78d8fa9763dfce6d0e5d3730c1d8ab25d34b0",
     944                "shasum": ""
     945            },
     946            "require": {
     947                "php": ">=5.3.3",
     948                "symfony/finder": "~2.1"
     949            },
     950            "require-dev": {
     951                "phpunit/phpunit": "~3.7"
     952            },
     953            "type": "library",
     954            "autoload": {
     955                "psr-0": {
     956                    "phpDocumentor": [
     957                        "src/",
     958                        "tests/unit/"
     959                    ]
     960                }
     961            },
     962            "notification-url": "https://packagist.org/downloads/",
     963            "license": [
     964                "MIT"
     965            ],
     966            "description": "Fileset component for collecting a set of files given directories and file paths",
     967            "homepage": "http://www.phpdoc.org",
     968            "keywords": [
     969                "files",
     970                "fileset",
     971                "phpdoc"
     972            ],
     973            "time": "2013-08-06 21:07:42"
     974        },
     975        {
     976            "name": "phpdocumentor/graphviz",
     977            "version": "1.0.4",
     978            "source": {
     979                "type": "git",
     980                "url": "https://github.com/phpDocumentor/GraphViz.git",
     981                "reference": "a906a90a9f230535f25ea31caf81b2323956283f"
     982            },
     983            "dist": {
     984                "type": "zip",
     985                "url": "https://api.github.com/repos/phpDocumentor/GraphViz/zipball/a906a90a9f230535f25ea31caf81b2323956283f",
     986                "reference": "a906a90a9f230535f25ea31caf81b2323956283f",
     987                "shasum": ""
     988            },
     989            "require": {
     990                "php": ">=5.3.3"
     991            },
     992            "require-dev": {
     993                "phpunit/phpunit": "~4.0"
     994            },
     995            "type": "library",
     996            "autoload": {
     997                "psr-0": {
     998                    "phpDocumentor": [
     999                        "src/",
     1000                        "tests/unit"
     1001                    ]
     1002                }
     1003            },
     1004            "notification-url": "https://packagist.org/downloads/",
     1005            "license": [
     1006                "MIT"
     1007            ],
     1008            "authors": [
     1009                {
     1010                    "name": "Mike van Riel",
     1011                    "email": "mike.vanriel@naenius.com"
     1012                }
     1013            ],
     1014            "time": "2016-02-02 13:00:08"
     1015        },
     1016        {
     1017            "name": "phpdocumentor/phpdocumentor",
     1018            "version": "v2.9.0",
     1019            "source": {
     1020                "type": "git",
     1021                "url": "https://github.com/phpDocumentor/phpDocumentor2.git",
     1022                "reference": "be607da0eef9b9249c43c5b4820d25d631c73667"
     1023            },
     1024            "dist": {
     1025                "type": "zip",
     1026                "url": "https://api.github.com/repos/phpDocumentor/phpDocumentor2/zipball/be607da0eef9b9249c43c5b4820d25d631c73667",
     1027                "reference": "be607da0eef9b9249c43c5b4820d25d631c73667",
     1028                "shasum": ""
     1029            },
     1030            "require": {
     1031                "cilex/cilex": "~1.0",
     1032                "erusev/parsedown": "~1.0",
     1033                "herrera-io/phar-update": "1.0.3",
     1034                "jms/serializer": ">=0.12",
     1035                "monolog/monolog": "~1.6",
     1036                "php": ">=5.3.3",
     1037                "phpdocumentor/fileset": "~1.0",
     1038                "phpdocumentor/graphviz": "~1.0",
     1039                "phpdocumentor/reflection": "^3.0",
     1040                "phpdocumentor/reflection-docblock": "~2.0",
     1041                "symfony/config": "~2.3",
     1042                "symfony/console": "~2.3",
     1043                "symfony/event-dispatcher": "~2.1",
     1044                "symfony/process": "~2.0",
     1045                "symfony/stopwatch": "~2.3",
     1046                "symfony/validator": "~2.2",
     1047                "twig/twig": "~1.3",
     1048                "zendframework/zend-cache": "~2.1",
     1049                "zendframework/zend-config": "~2.1",
     1050                "zendframework/zend-filter": "~2.1",
     1051                "zendframework/zend-i18n": "~2.1",
     1052                "zendframework/zend-serializer": "~2.1",
     1053                "zendframework/zend-servicemanager": "~2.1",
     1054                "zendframework/zend-stdlib": "~2.1",
     1055                "zetacomponents/document": ">=1.3.1"
     1056            },
     1057            "require-dev": {
     1058                "behat/behat": "~3.0",
     1059                "mikey179/vfsstream": "~1.2",
     1060                "mockery/mockery": "~0.9@dev",
     1061                "phpunit/phpunit": "~4.0",
     1062                "squizlabs/php_codesniffer": "~1.4",
     1063                "symfony/expression-language": "~2.4"
     1064            },
     1065            "suggest": {
     1066                "ext-twig": "Enabling the twig extension improves the generation of twig based templates.",
     1067                "ext-xslcache": "Enabling the XSLCache extension improves the generation of xml based templates."
     1068            },
     1069            "bin": [
     1070                "bin/phpdoc.php",
     1071                "bin/phpdoc"
     1072            ],
     1073            "type": "library",
     1074            "extra": {
     1075                "branch-alias": {
     1076                    "dev-develop": "2.9-dev"
     1077                }
     1078            },
     1079            "autoload": {
     1080                "psr-0": {
     1081                    "phpDocumentor": [
     1082                        "src/",
     1083                        "tests/unit/"
     1084                    ],
     1085                    "Cilex\\Provider": [
     1086                        "src/"
     1087                    ]
     1088                }
     1089            },
     1090            "notification-url": "https://packagist.org/downloads/",
     1091            "license": [
     1092                "MIT"
     1093            ],
     1094            "description": "Documentation Generator for PHP",
     1095            "homepage": "http://www.phpdoc.org",
     1096            "keywords": [
     1097                "api",
     1098                "application",
     1099                "dga",
     1100                "documentation",
     1101                "phpdoc"
     1102            ],
     1103            "time": "2016-05-22 09:50:56"
     1104        },
     1105        {
     1106            "name": "phpdocumentor/reflection",
     1107            "version": "3.0.1",
     1108            "source": {
     1109                "type": "git",
     1110                "url": "https://github.com/phpDocumentor/Reflection.git",
     1111                "reference": "793bfd92d9a0fc96ae9608fb3e947c3f59fb3a0d"
     1112            },
     1113            "dist": {
     1114                "type": "zip",
     1115                "url": "https://api.github.com/repos/phpDocumentor/Reflection/zipball/793bfd92d9a0fc96ae9608fb3e947c3f59fb3a0d",
     1116                "reference": "793bfd92d9a0fc96ae9608fb3e947c3f59fb3a0d",
     1117                "shasum": ""
     1118            },
     1119            "require": {
     1120                "nikic/php-parser": "^1.0",
     1121                "php": ">=5.3.3",
     1122                "phpdocumentor/reflection-docblock": "~2.0",
     1123                "psr/log": "~1.0"
     1124            },
     1125            "require-dev": {
     1126                "behat/behat": "~2.4",
     1127                "mockery/mockery": "~0.8",
     1128                "phpunit/phpunit": "~4.0"
     1129            },
     1130            "type": "library",
     1131            "extra": {
     1132                "branch-alias": {
     1133                    "dev-master": "1.0.x-dev"
     1134                }
     1135            },
     1136            "autoload": {
     1137                "psr-0": {
     1138                    "phpDocumentor": [
     1139                        "src/",
     1140                        "tests/unit/",
     1141                        "tests/mocks/"
     1142                    ]
     1143                }
     1144            },
     1145            "notification-url": "https://packagist.org/downloads/",
     1146            "license": [
     1147                "MIT"
     1148            ],
     1149            "description": "Reflection library to do Static Analysis for PHP Projects",
     1150            "homepage": "http://www.phpdoc.org",
     1151            "keywords": [
     1152                "phpDocumentor",
     1153                "phpdoc",
     1154                "reflection",
     1155                "static analysis"
     1156            ],
     1157            "time": "2016-05-21 08:42:32"
     1158        },
     1159        {
     1160            "name": "phpdocumentor/reflection-docblock",
     1161            "version": "2.0.4",
     1162            "source": {
     1163                "type": "git",
     1164                "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git",
     1165                "reference": "d68dbdc53dc358a816f00b300704702b2eaff7b8"
     1166            },
     1167            "dist": {
     1168                "type": "zip",
     1169                "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/d68dbdc53dc358a816f00b300704702b2eaff7b8",
     1170                "reference": "d68dbdc53dc358a816f00b300704702b2eaff7b8",
     1171                "shasum": ""
     1172            },
     1173            "require": {
     1174                "php": ">=5.3.3"
     1175            },
     1176            "require-dev": {
     1177                "phpunit/phpunit": "~4.0"
     1178            },
     1179            "suggest": {
     1180                "dflydev/markdown": "~1.0",
     1181                "erusev/parsedown": "~1.0"
     1182            },
     1183            "type": "library",
     1184            "extra": {
     1185                "branch-alias": {
     1186                    "dev-master": "2.0.x-dev"
     1187                }
     1188            },
     1189            "autoload": {
     1190                "psr-0": {
     1191                    "phpDocumentor": [
     1192                        "src/"
     1193                    ]
     1194                }
     1195            },
     1196            "notification-url": "https://packagist.org/downloads/",
     1197            "license": [
     1198                "MIT"
     1199            ],
     1200            "authors": [
     1201                {
     1202                    "name": "Mike van Riel",
     1203                    "email": "mike.vanriel@naenius.com"
     1204                }
     1205            ],
     1206            "time": "2015-02-03 12:10:50"
     1207        },
     1208        {
     1209            "name": "phpoption/phpoption",
     1210            "version": "1.5.0",
     1211            "source": {
     1212                "type": "git",
     1213                "url": "https://github.com/schmittjoh/php-option.git",
     1214                "reference": "94e644f7d2051a5f0fcf77d81605f152eecff0ed"
     1215            },
     1216            "dist": {
     1217                "type": "zip",
     1218                "url": "https://api.github.com/repos/schmittjoh/php-option/zipball/94e644f7d2051a5f0fcf77d81605f152eecff0ed",
     1219                "reference": "94e644f7d2051a5f0fcf77d81605f152eecff0ed",
     1220                "shasum": ""
     1221            },
     1222            "require": {
     1223                "php": ">=5.3.0"
     1224            },
     1225            "require-dev": {
     1226                "phpunit/phpunit": "4.7.*"
     1227            },
     1228            "type": "library",
     1229            "extra": {
     1230                "branch-alias": {
     1231                    "dev-master": "1.3-dev"
     1232                }
     1233            },
     1234            "autoload": {
     1235                "psr-0": {
     1236                    "PhpOption\\": "src/"
     1237                }
     1238            },
     1239            "notification-url": "https://packagist.org/downloads/",
     1240            "license": [
     1241                "Apache2"
     1242            ],
     1243            "authors": [
     1244                {
     1245                    "name": "Johannes M. Schmitt",
     1246                    "email": "schmittjoh@gmail.com"
     1247                }
     1248            ],
     1249            "description": "Option Type for PHP",
     1250            "keywords": [
     1251                "language",
     1252                "option",
     1253                "php",
     1254                "type"
     1255            ],
     1256            "time": "2015-07-25 16:39:46"
     1257        },
     1258        {
     1259            "name": "phpspec/prophecy",
     1260            "version": "v1.6.1",
     1261            "source": {
     1262                "type": "git",
     1263                "url": "https://github.com/phpspec/prophecy.git",
     1264                "reference": "58a8137754bc24b25740d4281399a4a3596058e0"
     1265            },
     1266            "dist": {
     1267                "type": "zip",
     1268                "url": "https://api.github.com/repos/phpspec/prophecy/zipball/58a8137754bc24b25740d4281399a4a3596058e0",
     1269                "reference": "58a8137754bc24b25740d4281399a4a3596058e0",
     1270                "shasum": ""
     1271            },
     1272            "require": {
     1273                "doctrine/instantiator": "^1.0.2",
     1274                "php": "^5.3|^7.0",
     1275                "phpdocumentor/reflection-docblock": "^2.0|^3.0.2",
     1276                "sebastian/comparator": "^1.1",
     1277                "sebastian/recursion-context": "^1.0"
     1278            },
     1279            "require-dev": {
     1280                "phpspec/phpspec": "^2.0"
     1281            },
     1282            "type": "library",
     1283            "extra": {
     1284                "branch-alias": {
     1285                    "dev-master": "1.6.x-dev"
     1286                }
     1287            },
     1288            "autoload": {
     1289                "psr-0": {
     1290                    "Prophecy\\": "src/"
     1291                }
     1292            },
     1293            "notification-url": "https://packagist.org/downloads/",
     1294            "license": [
     1295                "MIT"
     1296            ],
     1297            "authors": [
     1298                {
     1299                    "name": "Konstantin Kudryashov",
     1300                    "email": "ever.zet@gmail.com",
     1301                    "homepage": "http://everzet.com"
     1302                },
     1303                {
     1304                    "name": "Marcello Duarte",
     1305                    "email": "marcello.duarte@gmail.com"
     1306                }
     1307            ],
     1308            "description": "Highly opinionated mocking framework for PHP 5.3+",
     1309            "homepage": "https://github.com/phpspec/prophecy",
     1310            "keywords": [
     1311                "Double",
     1312                "Dummy",
     1313                "fake",
     1314                "mock",
     1315                "spy",
     1316                "stub"
     1317            ],
     1318            "time": "2016-06-07 08:13:47"
     1319        },
     1320        {
     1321            "name": "phpunit/php-code-coverage",
     1322            "version": "2.2.4",
     1323            "source": {
     1324                "type": "git",
     1325                "url": "https://github.com/sebastianbergmann/php-code-coverage.git",
     1326                "reference": "eabf68b476ac7d0f73793aada060f1c1a9bf8979"
     1327            },
     1328            "dist": {
     1329                "type": "zip",
     1330                "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/eabf68b476ac7d0f73793aada060f1c1a9bf8979",
     1331                "reference": "eabf68b476ac7d0f73793aada060f1c1a9bf8979",
     1332                "shasum": ""
     1333            },
     1334            "require": {
     1335                "php": ">=5.3.3",
     1336                "phpunit/php-file-iterator": "~1.3",
     1337                "phpunit/php-text-template": "~1.2",
     1338                "phpunit/php-token-stream": "~1.3",
     1339                "sebastian/environment": "^1.3.2",
     1340                "sebastian/version": "~1.0"
     1341            },
     1342            "require-dev": {
     1343                "ext-xdebug": ">=2.1.4",
     1344                "phpunit/phpunit": "~4"
     1345            },
     1346            "suggest": {
     1347                "ext-dom": "*",
     1348                "ext-xdebug": ">=2.2.1",
     1349                "ext-xmlwriter": "*"
     1350            },
     1351            "type": "library",
     1352            "extra": {
     1353                "branch-alias": {
     1354                    "dev-master": "2.2.x-dev"
     1355                }
     1356            },
     1357            "autoload": {
     1358                "classmap": [
     1359                    "src/"
     1360                ]
     1361            },
     1362            "notification-url": "https://packagist.org/downloads/",
     1363            "license": [
     1364                "BSD-3-Clause"
     1365            ],
     1366            "authors": [
     1367                {
     1368                    "name": "Sebastian Bergmann",
     1369                    "email": "sb@sebastian-bergmann.de",
     1370                    "role": "lead"
     1371                }
     1372            ],
     1373            "description": "Library that provides collection, processing, and rendering functionality for PHP code coverage information.",
     1374            "homepage": "https://github.com/sebastianbergmann/php-code-coverage",
     1375            "keywords": [
     1376                "coverage",
     1377                "testing",
     1378                "xunit"
     1379            ],
     1380            "time": "2015-10-06 15:47:00"
     1381        },
     1382        {
     1383            "name": "phpunit/php-file-iterator",
     1384            "version": "1.4.1",
     1385            "source": {
     1386                "type": "git",
     1387                "url": "https://github.com/sebastianbergmann/php-file-iterator.git",
     1388                "reference": "6150bf2c35d3fc379e50c7602b75caceaa39dbf0"
     1389            },
     1390            "dist": {
     1391                "type": "zip",
     1392                "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/6150bf2c35d3fc379e50c7602b75caceaa39dbf0",
     1393                "reference": "6150bf2c35d3fc379e50c7602b75caceaa39dbf0",
     1394                "shasum": ""
     1395            },
     1396            "require": {
     1397                "php": ">=5.3.3"
     1398            },
     1399            "type": "library",
     1400            "extra": {
     1401                "branch-alias": {
     1402                    "dev-master": "1.4.x-dev"
     1403                }
     1404            },
     1405            "autoload": {
     1406                "classmap": [
     1407                    "src/"
     1408                ]
     1409            },
     1410            "notification-url": "https://packagist.org/downloads/",
     1411            "license": [
     1412                "BSD-3-Clause"
     1413            ],
     1414            "authors": [
     1415                {
     1416                    "name": "Sebastian Bergmann",
     1417                    "email": "sb@sebastian-bergmann.de",
     1418                    "role": "lead"
     1419                }
     1420            ],
     1421            "description": "FilterIterator implementation that filters files based on a list of suffixes.",
     1422            "homepage": "https://github.com/sebastianbergmann/php-file-iterator/",
     1423            "keywords": [
     1424                "filesystem",
     1425                "iterator"
     1426            ],
     1427            "time": "2015-06-21 13:08:43"
     1428        },
     1429        {
     1430            "name": "phpunit/php-text-template",
     1431            "version": "1.2.1",
     1432            "source": {
     1433                "type": "git",
     1434                "url": "https://github.com/sebastianbergmann/php-text-template.git",
     1435                "reference": "31f8b717e51d9a2afca6c9f046f5d69fc27c8686"
     1436            },
     1437            "dist": {
     1438                "type": "zip",
     1439                "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/31f8b717e51d9a2afca6c9f046f5d69fc27c8686",
     1440                "reference": "31f8b717e51d9a2afca6c9f046f5d69fc27c8686",
     1441                "shasum": ""
     1442            },
     1443            "require": {
     1444                "php": ">=5.3.3"
     1445            },
     1446            "type": "library",
     1447            "autoload": {
     1448                "classmap": [
     1449                    "src/"
     1450                ]
     1451            },
     1452            "notification-url": "https://packagist.org/downloads/",
     1453            "license": [
     1454                "BSD-3-Clause"
     1455            ],
     1456            "authors": [
     1457                {
     1458                    "name": "Sebastian Bergmann",
     1459                    "email": "sebastian@phpunit.de",
     1460                    "role": "lead"
     1461                }
     1462            ],
     1463            "description": "Simple template engine.",
     1464            "homepage": "https://github.com/sebastianbergmann/php-text-template/",
     1465            "keywords": [
     1466                "template"
     1467            ],
     1468            "time": "2015-06-21 13:50:34"
     1469        },
     1470        {
     1471            "name": "phpunit/php-timer",
     1472            "version": "1.0.8",
     1473            "source": {
     1474                "type": "git",
     1475                "url": "https://github.com/sebastianbergmann/php-timer.git",
     1476                "reference": "38e9124049cf1a164f1e4537caf19c99bf1eb260"
     1477            },
     1478            "dist": {
     1479                "type": "zip",
     1480                "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/38e9124049cf1a164f1e4537caf19c99bf1eb260",
     1481                "reference": "38e9124049cf1a164f1e4537caf19c99bf1eb260",
     1482                "shasum": ""
     1483            },
     1484            "require": {
     1485                "php": ">=5.3.3"
     1486            },
     1487            "require-dev": {
     1488                "phpunit/phpunit": "~4|~5"
     1489            },
     1490            "type": "library",
     1491            "autoload": {
     1492                "classmap": [
     1493                    "src/"
     1494                ]
     1495            },
     1496            "notification-url": "https://packagist.org/downloads/",
     1497            "license": [
     1498                "BSD-3-Clause"
     1499            ],
     1500            "authors": [
     1501                {
     1502                    "name": "Sebastian Bergmann",
     1503                    "email": "sb@sebastian-bergmann.de",
     1504                    "role": "lead"
     1505                }
     1506            ],
     1507            "description": "Utility class for timing",
     1508            "homepage": "https://github.com/sebastianbergmann/php-timer/",
     1509            "keywords": [
     1510                "timer"
     1511            ],
     1512            "time": "2016-05-12 18:03:57"
     1513        },
     1514        {
     1515            "name": "phpunit/php-token-stream",
     1516            "version": "1.4.8",
     1517            "source": {
     1518                "type": "git",
     1519                "url": "https://github.com/sebastianbergmann/php-token-stream.git",
     1520                "reference": "3144ae21711fb6cac0b1ab4cbe63b75ce3d4e8da"
     1521            },
     1522            "dist": {
     1523                "type": "zip",
     1524                "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/3144ae21711fb6cac0b1ab4cbe63b75ce3d4e8da",
     1525                "reference": "3144ae21711fb6cac0b1ab4cbe63b75ce3d4e8da",
     1526                "shasum": ""
     1527            },
     1528            "require": {
     1529                "ext-tokenizer": "*",
     1530                "php": ">=5.3.3"
     1531            },
     1532            "require-dev": {
     1533                "phpunit/phpunit": "~4.2"
     1534            },
     1535            "type": "library",
     1536            "extra": {
     1537                "branch-alias": {
     1538                    "dev-master": "1.4-dev"
     1539                }
     1540            },
     1541            "autoload": {
     1542                "classmap": [
     1543                    "src/"
     1544                ]
     1545            },
     1546            "notification-url": "https://packagist.org/downloads/",
     1547            "license": [
     1548                "BSD-3-Clause"
     1549            ],
     1550            "authors": [
     1551                {
     1552                    "name": "Sebastian Bergmann",
     1553                    "email": "sebastian@phpunit.de"
     1554                }
     1555            ],
     1556            "description": "Wrapper around PHP's tokenizer extension.",
     1557            "homepage": "https://github.com/sebastianbergmann/php-token-stream/",
     1558            "keywords": [
     1559                "tokenizer"
     1560            ],
     1561            "time": "2015-09-15 10:49:45"
     1562        },
     1563        {
     1564            "name": "phpunit/phpunit",
     1565            "version": "4.7.7",
     1566            "source": {
     1567                "type": "git",
     1568                "url": "https://github.com/sebastianbergmann/phpunit.git",
     1569                "reference": "9b97f9d807b862c2de2a36e86690000801c85724"
     1570            },
     1571            "dist": {
     1572                "type": "zip",
     1573                "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/9b97f9d807b862c2de2a36e86690000801c85724",
     1574                "reference": "9b97f9d807b862c2de2a36e86690000801c85724",
     1575                "shasum": ""
     1576            },
     1577            "require": {
     1578                "ext-dom": "*",
     1579                "ext-json": "*",
     1580                "ext-pcre": "*",
     1581                "ext-reflection": "*",
     1582                "ext-spl": "*",
     1583                "php": ">=5.3.3",
     1584                "phpspec/prophecy": "~1.3,>=1.3.1",
     1585                "phpunit/php-code-coverage": "~2.1",
     1586                "phpunit/php-file-iterator": "~1.4",
     1587                "phpunit/php-text-template": "~1.2",
     1588                "phpunit/php-timer": ">=1.0.6",
     1589                "phpunit/phpunit-mock-objects": "~2.3",
     1590                "sebastian/comparator": "~1.1",
     1591                "sebastian/diff": "~1.2",
     1592                "sebastian/environment": "~1.2",
     1593                "sebastian/exporter": "~1.2",
     1594                "sebastian/global-state": "~1.0",
     1595                "sebastian/version": "~1.0",
     1596                "symfony/yaml": "~2.1|~3.0"
     1597            },
     1598            "suggest": {
     1599                "phpunit/php-invoker": "~1.1"
     1600            },
     1601            "bin": [
     1602                "phpunit"
     1603            ],
     1604            "type": "library",
     1605            "extra": {
     1606                "branch-alias": {
     1607                    "dev-master": "4.7.x-dev"
     1608                }
     1609            },
     1610            "autoload": {
     1611                "classmap": [
     1612                    "src/"
     1613                ]
     1614            },
     1615            "notification-url": "https://packagist.org/downloads/",
     1616            "license": [
     1617                "BSD-3-Clause"
     1618            ],
     1619            "authors": [
     1620                {
     1621                    "name": "Sebastian Bergmann",
     1622                    "email": "sebastian@phpunit.de",
     1623                    "role": "lead"
     1624                }
     1625            ],
     1626            "description": "The PHP Unit Testing framework.",
     1627            "homepage": "https://phpunit.de/",
     1628            "keywords": [
     1629                "phpunit",
     1630                "testing",
     1631                "xunit"
     1632            ],
     1633            "time": "2015-07-13 11:28:34"
     1634        },
     1635        {
     1636            "name": "phpunit/phpunit-mock-objects",
     1637            "version": "2.3.8",
     1638            "source": {
     1639                "type": "git",
     1640                "url": "https://github.com/sebastianbergmann/phpunit-mock-objects.git",
     1641                "reference": "ac8e7a3db35738d56ee9a76e78a4e03d97628983"
     1642            },
     1643            "dist": {
     1644                "type": "zip",
     1645                "url": "https://api.github.com/repos/sebastianbergmann/phpunit-mock-objects/zipball/ac8e7a3db35738d56ee9a76e78a4e03d97628983",
     1646                "reference": "ac8e7a3db35738d56ee9a76e78a4e03d97628983",
     1647                "shasum": ""
     1648            },
     1649            "require": {
     1650                "doctrine/instantiator": "^1.0.2",
     1651                "php": ">=5.3.3",
     1652                "phpunit/php-text-template": "~1.2",
     1653                "sebastian/exporter": "~1.2"
     1654            },
     1655            "require-dev": {
     1656                "phpunit/phpunit": "~4.4"
     1657            },
     1658            "suggest": {
     1659                "ext-soap": "*"
     1660            },
     1661            "type": "library",
     1662            "extra": {
     1663                "branch-alias": {
     1664                    "dev-master": "2.3.x-dev"
     1665                }
     1666            },
     1667            "autoload": {
     1668                "classmap": [
     1669                    "src/"
     1670                ]
     1671            },
     1672            "notification-url": "https://packagist.org/downloads/",
     1673            "license": [
     1674                "BSD-3-Clause"
     1675            ],
     1676            "authors": [
     1677                {
     1678                    "name": "Sebastian Bergmann",
     1679                    "email": "sb@sebastian-bergmann.de",
     1680                    "role": "lead"
     1681                }
     1682            ],
     1683            "description": "Mock Object library for PHPUnit",
     1684            "homepage": "https://github.com/sebastianbergmann/phpunit-mock-objects/",
     1685            "keywords": [
     1686                "mock",
     1687                "xunit"
     1688            ],
     1689            "time": "2015-10-02 06:51:40"
     1690        },
     1691        {
     1692            "name": "pimple/pimple",
     1693            "version": "v1.1.1",
     1694            "source": {
     1695                "type": "git",
     1696                "url": "https://github.com/silexphp/Pimple.git",
     1697                "reference": "2019c145fe393923f3441b23f29bbdfaa5c58c4d"
     1698            },
     1699            "dist": {
     1700                "type": "zip",
     1701                "url": "https://api.github.com/repos/silexphp/Pimple/zipball/2019c145fe393923f3441b23f29bbdfaa5c58c4d",
     1702                "reference": "2019c145fe393923f3441b23f29bbdfaa5c58c4d",
     1703                "shasum": ""
     1704            },
     1705            "require": {
     1706                "php": ">=5.3.0"
     1707            },
     1708            "type": "library",
     1709            "extra": {
     1710                "branch-alias": {
     1711                    "dev-master": "1.1.x-dev"
     1712                }
     1713            },
     1714            "autoload": {
     1715                "psr-0": {
     1716                    "Pimple": "lib/"
     1717                }
     1718            },
     1719            "notification-url": "https://packagist.org/downloads/",
     1720            "license": [
     1721                "MIT"
     1722            ],
     1723            "authors": [
     1724                {
     1725                    "name": "Fabien Potencier",
     1726                    "email": "fabien@symfony.com",
     1727                    "homepage": "http://fabien.potencier.org",
     1728                    "role": "Lead Developer"
     1729                }
     1730            ],
     1731            "description": "Pimple is a simple Dependency Injection Container for PHP 5.3",
     1732            "homepage": "http://pimple.sensiolabs.org",
     1733            "keywords": [
     1734                "container",
     1735                "dependency injection"
     1736            ],
     1737            "time": "2013-11-22 08:30:29"
     1738        },
     1739        {
     1740            "name": "psr/log",
     1741            "version": "1.0.0",
     1742            "source": {
     1743                "type": "git",
     1744                "url": "https://github.com/php-fig/log.git",
     1745                "reference": "fe0936ee26643249e916849d48e3a51d5f5e278b"
     1746            },
     1747            "dist": {
     1748                "type": "zip",
     1749                "url": "https://api.github.com/repos/php-fig/log/zipball/fe0936ee26643249e916849d48e3a51d5f5e278b",
     1750                "reference": "fe0936ee26643249e916849d48e3a51d5f5e278b",
     1751                "shasum": ""
     1752            },
     1753            "type": "library",
     1754            "autoload": {
     1755                "psr-0": {
     1756                    "Psr\\Log\\": ""
     1757                }
     1758            },
     1759            "notification-url": "https://packagist.org/downloads/",
     1760            "license": [
     1761                "MIT"
     1762            ],
     1763            "authors": [
     1764                {
     1765                    "name": "PHP-FIG",
     1766                    "homepage": "http://www.php-fig.org/"
     1767                }
     1768            ],
     1769            "description": "Common interface for logging libraries",
     1770            "keywords": [
     1771                "log",
     1772                "psr",
     1773                "psr-3"
     1774            ],
     1775            "time": "2012-12-21 11:40:51"
     1776        },
     1777        {
     1778            "name": "sebastian/comparator",
     1779            "version": "1.2.0",
     1780            "source": {
     1781                "type": "git",
     1782                "url": "https://github.com/sebastianbergmann/comparator.git",
     1783                "reference": "937efb279bd37a375bcadf584dec0726f84dbf22"
     1784            },
     1785            "dist": {
     1786                "type": "zip",
     1787                "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/937efb279bd37a375bcadf584dec0726f84dbf22",
     1788                "reference": "937efb279bd37a375bcadf584dec0726f84dbf22",
     1789                "shasum": ""
     1790            },
     1791            "require": {
     1792                "php": ">=5.3.3",
     1793                "sebastian/diff": "~1.2",
     1794                "sebastian/exporter": "~1.2"
     1795            },
     1796            "require-dev": {
     1797                "phpunit/phpunit": "~4.4"
     1798            },
     1799            "type": "library",
     1800            "extra": {
     1801                "branch-alias": {
     1802                    "dev-master": "1.2.x-dev"
     1803                }
     1804            },
     1805            "autoload": {
     1806                "classmap": [
     1807                    "src/"
     1808                ]
     1809            },
     1810            "notification-url": "https://packagist.org/downloads/",
     1811            "license": [
     1812                "BSD-3-Clause"
     1813            ],
     1814            "authors": [
     1815                {
     1816                    "name": "Jeff Welch",
     1817                    "email": "whatthejeff@gmail.com"
     1818                },
     1819                {
     1820                    "name": "Volker Dusch",
     1821                    "email": "github@wallbash.com"
     1822                },
     1823                {
     1824                    "name": "Bernhard Schussek",
     1825                    "email": "bschussek@2bepublished.at"
     1826                },
     1827                {
     1828                    "name": "Sebastian Bergmann",
     1829                    "email": "sebastian@phpunit.de"
     1830                }
     1831            ],
     1832            "description": "Provides the functionality to compare PHP values for equality",
     1833            "homepage": "http://www.github.com/sebastianbergmann/comparator",
     1834            "keywords": [
     1835                "comparator",
     1836                "compare",
     1837                "equality"
     1838            ],
     1839            "time": "2015-07-26 15:48:44"
     1840        },
     1841        {
     1842            "name": "sebastian/diff",
     1843            "version": "1.4.1",
     1844            "source": {
     1845                "type": "git",
     1846                "url": "https://github.com/sebastianbergmann/diff.git",
     1847                "reference": "13edfd8706462032c2f52b4b862974dd46b71c9e"
     1848            },
     1849            "dist": {
     1850                "type": "zip",
     1851                "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/13edfd8706462032c2f52b4b862974dd46b71c9e",
     1852                "reference": "13edfd8706462032c2f52b4b862974dd46b71c9e",
     1853                "shasum": ""
     1854            },
     1855            "require": {
     1856                "php": ">=5.3.3"
     1857            },
     1858            "require-dev": {
     1859                "phpunit/phpunit": "~4.8"
     1860            },
     1861            "type": "library",
     1862            "extra": {
     1863                "branch-alias": {
     1864                    "dev-master": "1.4-dev"
     1865                }
     1866            },
     1867            "autoload": {
     1868                "classmap": [
     1869                    "src/"
     1870                ]
     1871            },
     1872            "notification-url": "https://packagist.org/downloads/",
     1873            "license": [
     1874                "BSD-3-Clause"
     1875            ],
     1876            "authors": [
     1877                {
     1878                    "name": "Kore Nordmann",
     1879                    "email": "mail@kore-nordmann.de"
     1880                },
     1881                {
     1882                    "name": "Sebastian Bergmann",
     1883                    "email": "sebastian@phpunit.de"
     1884                }
     1885            ],
     1886            "description": "Diff implementation",
     1887            "homepage": "https://github.com/sebastianbergmann/diff",
     1888            "keywords": [
     1889                "diff"
     1890            ],
     1891            "time": "2015-12-08 07:14:41"
     1892        },
     1893        {
     1894            "name": "sebastian/environment",
     1895            "version": "1.3.7",
     1896            "source": {
     1897                "type": "git",
     1898                "url": "https://github.com/sebastianbergmann/environment.git",
     1899                "reference": "4e8f0da10ac5802913afc151413bc8c53b6c2716"
     1900            },
     1901            "dist": {
     1902                "type": "zip",
     1903                "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/4e8f0da10ac5802913afc151413bc8c53b6c2716",
     1904                "reference": "4e8f0da10ac5802913afc151413bc8c53b6c2716",
     1905                "shasum": ""
     1906            },
     1907            "require": {
     1908                "php": ">=5.3.3"
     1909            },
     1910            "require-dev": {
     1911                "phpunit/phpunit": "~4.4"
     1912            },
     1913            "type": "library",
     1914            "extra": {
     1915                "branch-alias": {
     1916                    "dev-master": "1.3.x-dev"
     1917                }
     1918            },
     1919            "autoload": {
     1920                "classmap": [
     1921                    "src/"
     1922                ]
     1923            },
     1924            "notification-url": "https://packagist.org/downloads/",
     1925            "license": [
     1926                "BSD-3-Clause"
     1927            ],
     1928            "authors": [
     1929                {
     1930                    "name": "Sebastian Bergmann",
     1931                    "email": "sebastian@phpunit.de"
     1932                }
     1933            ],
     1934            "description": "Provides functionality to handle HHVM/PHP environments",
     1935            "homepage": "http://www.github.com/sebastianbergmann/environment",
     1936            "keywords": [
     1937                "Xdebug",
     1938                "environment",
     1939                "hhvm"
     1940            ],
     1941            "time": "2016-05-17 03:18:57"
     1942        },
     1943        {
     1944            "name": "sebastian/exporter",
     1945            "version": "1.2.2",
     1946            "source": {
     1947                "type": "git",
     1948                "url": "https://github.com/sebastianbergmann/exporter.git",
     1949                "reference": "42c4c2eec485ee3e159ec9884f95b431287edde4"
     1950            },
     1951            "dist": {
     1952                "type": "zip",
     1953                "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/42c4c2eec485ee3e159ec9884f95b431287edde4",
     1954                "reference": "42c4c2eec485ee3e159ec9884f95b431287edde4",
     1955                "shasum": ""
     1956            },
     1957            "require": {
     1958                "php": ">=5.3.3",
     1959                "sebastian/recursion-context": "~1.0"
     1960            },
     1961            "require-dev": {
     1962                "ext-mbstring": "*",
     1963                "phpunit/phpunit": "~4.4"
     1964            },
     1965            "type": "library",
     1966            "extra": {
     1967                "branch-alias": {
     1968                    "dev-master": "1.3.x-dev"
     1969                }
     1970            },
     1971            "autoload": {
     1972                "classmap": [
     1973                    "src/"
     1974                ]
     1975            },
     1976            "notification-url": "https://packagist.org/downloads/",
     1977            "license": [
     1978                "BSD-3-Clause"
     1979            ],
     1980            "authors": [
     1981                {
     1982                    "name": "Jeff Welch",
     1983                    "email": "whatthejeff@gmail.com"
     1984                },
     1985                {
     1986                    "name": "Volker Dusch",
     1987                    "email": "github@wallbash.com"
     1988                },
     1989                {
     1990                    "name": "Bernhard Schussek",
     1991                    "email": "bschussek@2bepublished.at"
     1992                },
     1993                {
     1994                    "name": "Sebastian Bergmann",
     1995                    "email": "sebastian@phpunit.de"
     1996                },
     1997                {
     1998                    "name": "Adam Harvey",
     1999                    "email": "aharvey@php.net"
     2000                }
     2001            ],
     2002            "description": "Provides the functionality to export PHP variables for visualization",
     2003            "homepage": "http://www.github.com/sebastianbergmann/exporter",
     2004            "keywords": [
     2005                "export",
     2006                "exporter"
     2007            ],
     2008            "time": "2016-06-17 09:04:28"
     2009        },
     2010        {
     2011            "name": "sebastian/global-state",
     2012            "version": "1.1.1",
     2013            "source": {
     2014                "type": "git",
     2015                "url": "https://github.com/sebastianbergmann/global-state.git",
     2016                "reference": "bc37d50fea7d017d3d340f230811c9f1d7280af4"
     2017            },
     2018            "dist": {
     2019                "type": "zip",
     2020                "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/bc37d50fea7d017d3d340f230811c9f1d7280af4",
     2021                "reference": "bc37d50fea7d017d3d340f230811c9f1d7280af4",
     2022                "shasum": ""
     2023            },
     2024            "require": {
     2025                "php": ">=5.3.3"
     2026            },
     2027            "require-dev": {
     2028                "phpunit/phpunit": "~4.2"
     2029            },
     2030            "suggest": {
     2031                "ext-uopz": "*"
     2032            },
     2033            "type": "library",
     2034            "extra": {
     2035                "branch-alias": {
     2036                    "dev-master": "1.0-dev"
     2037                }
     2038            },
     2039            "autoload": {
     2040                "classmap": [
     2041                    "src/"
     2042                ]
     2043            },
     2044            "notification-url": "https://packagist.org/downloads/",
     2045            "license": [
     2046                "BSD-3-Clause"
     2047            ],
     2048            "authors": [
     2049                {
     2050                    "name": "Sebastian Bergmann",
     2051                    "email": "sebastian@phpunit.de"
     2052                }
     2053            ],
     2054            "description": "Snapshotting of global state",
     2055            "homepage": "http://www.github.com/sebastianbergmann/global-state",
     2056            "keywords": [
     2057                "global state"
     2058            ],
     2059            "time": "2015-10-12 03:26:01"
     2060        },
     2061        {
     2062            "name": "sebastian/recursion-context",
     2063            "version": "1.0.2",
     2064            "source": {
     2065                "type": "git",
     2066                "url": "https://github.com/sebastianbergmann/recursion-context.git",
     2067                "reference": "913401df809e99e4f47b27cdd781f4a258d58791"
     2068            },
     2069            "dist": {
     2070                "type": "zip",
     2071                "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/913401df809e99e4f47b27cdd781f4a258d58791",
     2072                "reference": "913401df809e99e4f47b27cdd781f4a258d58791",
     2073                "shasum": ""
     2074            },
     2075            "require": {
     2076                "php": ">=5.3.3"
     2077            },
     2078            "require-dev": {
     2079                "phpunit/phpunit": "~4.4"
     2080            },
     2081            "type": "library",
     2082            "extra": {
     2083                "branch-alias": {
     2084                    "dev-master": "1.0.x-dev"
     2085                }
     2086            },
     2087            "autoload": {
     2088                "classmap": [
     2089                    "src/"
     2090                ]
     2091            },
     2092            "notification-url": "https://packagist.org/downloads/",
     2093            "license": [
     2094                "BSD-3-Clause"
     2095            ],
     2096            "authors": [
     2097                {
     2098                    "name": "Jeff Welch",
     2099                    "email": "whatthejeff@gmail.com"
     2100                },
     2101                {
     2102                    "name": "Sebastian Bergmann",
     2103                    "email": "sebastian@phpunit.de"
     2104                },
     2105                {
     2106                    "name": "Adam Harvey",
     2107                    "email": "aharvey@php.net"
     2108                }
     2109            ],
     2110            "description": "Provides functionality to recursively process PHP variables",
     2111            "homepage": "http://www.github.com/sebastianbergmann/recursion-context",
     2112            "time": "2015-11-11 19:50:13"
     2113        },
     2114        {
     2115            "name": "sebastian/version",
     2116            "version": "1.0.6",
     2117            "source": {
     2118                "type": "git",
     2119                "url": "https://github.com/sebastianbergmann/version.git",
     2120                "reference": "58b3a85e7999757d6ad81c787a1fbf5ff6c628c6"
     2121            },
     2122            "dist": {
     2123                "type": "zip",
     2124                "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/58b3a85e7999757d6ad81c787a1fbf5ff6c628c6",
     2125                "reference": "58b3a85e7999757d6ad81c787a1fbf5ff6c628c6",
     2126                "shasum": ""
     2127            },
     2128            "type": "library",
     2129            "autoload": {
     2130                "classmap": [
     2131                    "src/"
     2132                ]
     2133            },
     2134            "notification-url": "https://packagist.org/downloads/",
     2135            "license": [
     2136                "BSD-3-Clause"
     2137            ],
     2138            "authors": [
     2139                {
     2140                    "name": "Sebastian Bergmann",
     2141                    "email": "sebastian@phpunit.de",
     2142                    "role": "lead"
     2143                }
     2144            ],
     2145            "description": "Library that helps with managing the version number of Git-hosted PHP projects",
     2146            "homepage": "https://github.com/sebastianbergmann/version",
     2147            "time": "2015-06-21 13:59:46"
     2148        },
     2149        {
     2150            "name": "seld/jsonlint",
     2151            "version": "1.4.0",
     2152            "source": {
     2153                "type": "git",
     2154                "url": "https://github.com/Seldaek/jsonlint.git",
     2155                "reference": "66834d3e3566bb5798db7294619388786ae99394"
     2156            },
     2157            "dist": {
     2158                "type": "zip",
     2159                "url": "https://api.github.com/repos/Seldaek/jsonlint/zipball/66834d3e3566bb5798db7294619388786ae99394",
     2160                "reference": "66834d3e3566bb5798db7294619388786ae99394",
     2161                "shasum": ""
     2162            },
     2163            "require": {
     2164                "php": "^5.3 || ^7.0"
     2165            },
     2166            "bin": [
     2167                "bin/jsonlint"
     2168            ],
     2169            "type": "library",
     2170            "autoload": {
     2171                "psr-4": {
     2172                    "Seld\\JsonLint\\": "src/Seld/JsonLint/"
     2173                }
     2174            },
     2175            "notification-url": "https://packagist.org/downloads/",
     2176            "license": [
     2177                "MIT"
     2178            ],
     2179            "authors": [
     2180                {
     2181                    "name": "Jordi Boggiano",
     2182                    "email": "j.boggiano@seld.be",
     2183                    "homepage": "http://seld.be"
     2184                }
     2185            ],
     2186            "description": "JSON Linter",
     2187            "keywords": [
     2188                "json",
     2189                "linter",
     2190                "parser",
     2191                "validator"
     2192            ],
     2193            "time": "2015-11-21 02:21:41"
     2194        },
     2195        {
     2196            "name": "symfony/config",
     2197            "version": "v2.8.7",
     2198            "source": {
     2199                "type": "git",
     2200                "url": "https://github.com/symfony/config.git",
     2201                "reference": "a2edd59c2163c65747fc3f35d132b5a39266bd05"
     2202            },
     2203            "dist": {
     2204                "type": "zip",
     2205                "url": "https://api.github.com/repos/symfony/config/zipball/a2edd59c2163c65747fc3f35d132b5a39266bd05",
     2206                "reference": "a2edd59c2163c65747fc3f35d132b5a39266bd05",
     2207                "shasum": ""
     2208            },
     2209            "require": {
     2210                "php": ">=5.3.9",
     2211                "symfony/filesystem": "~2.3|~3.0.0"
     2212            },
     2213            "suggest": {
     2214                "symfony/yaml": "To use the yaml reference dumper"
     2215            },
     2216            "type": "library",
     2217            "extra": {
     2218                "branch-alias": {
     2219                    "dev-master": "2.8-dev"
     2220                }
     2221            },
     2222            "autoload": {
     2223                "psr-4": {
     2224                    "Symfony\\Component\\Config\\": ""
     2225                },
     2226                "exclude-from-classmap": [
     2227                    "/Tests/"
     2228                ]
     2229            },
     2230            "notification-url": "https://packagist.org/downloads/",
     2231            "license": [
     2232                "MIT"
     2233            ],
     2234            "authors": [
     2235                {
     2236                    "name": "Fabien Potencier",
     2237                    "email": "fabien@symfony.com"
     2238                },
     2239                {
     2240                    "name": "Symfony Community",
     2241                    "homepage": "https://symfony.com/contributors"
     2242                }
     2243            ],
     2244            "description": "Symfony Config Component",
     2245            "homepage": "https://symfony.com",
     2246            "time": "2016-06-06 11:11:27"
     2247        },
     2248        {
     2249            "name": "symfony/console",
     2250            "version": "v2.8.7",
     2251            "source": {
     2252                "type": "git",
     2253                "url": "https://github.com/symfony/console.git",
     2254                "reference": "5ac8bc9aa77bb2edf06af3a1bb6bc1020d23acd3"
     2255            },
     2256            "dist": {
     2257                "type": "zip",
     2258                "url": "https://api.github.com/repos/symfony/console/zipball/5ac8bc9aa77bb2edf06af3a1bb6bc1020d23acd3",
     2259                "reference": "5ac8bc9aa77bb2edf06af3a1bb6bc1020d23acd3",
     2260                "shasum": ""
     2261            },
     2262            "require": {
     2263                "php": ">=5.3.9",
     2264                "symfony/polyfill-mbstring": "~1.0"
     2265            },
     2266            "require-dev": {
     2267                "psr/log": "~1.0",
     2268                "symfony/event-dispatcher": "~2.1|~3.0.0",
     2269                "symfony/process": "~2.1|~3.0.0"
     2270            },
     2271            "suggest": {
     2272                "psr/log": "For using the console logger",
     2273                "symfony/event-dispatcher": "",
     2274                "symfony/process": ""
     2275            },
     2276            "type": "library",
     2277            "extra": {
     2278                "branch-alias": {
     2279                    "dev-master": "2.8-dev"
     2280                }
     2281            },
     2282            "autoload": {
     2283                "psr-4": {
     2284                    "Symfony\\Component\\Console\\": ""
     2285                },
     2286                "exclude-from-classmap": [
     2287                    "/Tests/"
     2288                ]
     2289            },
     2290            "notification-url": "https://packagist.org/downloads/",
     2291            "license": [
     2292                "MIT"
     2293            ],
     2294            "authors": [
     2295                {
     2296                    "name": "Fabien Potencier",
     2297                    "email": "fabien@symfony.com"
     2298                },
     2299                {
     2300                    "name": "Symfony Community",
     2301                    "homepage": "https://symfony.com/contributors"
     2302                }
     2303            ],
     2304            "description": "Symfony Console Component",
     2305            "homepage": "https://symfony.com",
     2306            "time": "2016-06-06 15:06:25"
     2307        },
     2308        {
     2309            "name": "symfony/event-dispatcher",
     2310            "version": "v2.8.7",
     2311            "source": {
     2312                "type": "git",
     2313                "url": "https://github.com/symfony/event-dispatcher.git",
     2314                "reference": "2a6b8713f8bdb582058cfda463527f195b066110"
     2315            },
     2316            "dist": {
     2317                "type": "zip",
     2318                "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/2a6b8713f8bdb582058cfda463527f195b066110",
     2319                "reference": "2a6b8713f8bdb582058cfda463527f195b066110",
     2320                "shasum": ""
     2321            },
     2322            "require": {
     2323                "php": ">=5.3.9"
     2324            },
     2325            "require-dev": {
     2326                "psr/log": "~1.0",
     2327                "symfony/config": "~2.0,>=2.0.5|~3.0.0",
     2328                "symfony/dependency-injection": "~2.6|~3.0.0",
     2329                "symfony/expression-language": "~2.6|~3.0.0",
     2330                "symfony/stopwatch": "~2.3|~3.0.0"
     2331            },
     2332            "suggest": {
     2333                "symfony/dependency-injection": "",
     2334                "symfony/http-kernel": ""
     2335            },
     2336            "type": "library",
     2337            "extra": {
     2338                "branch-alias": {
     2339                    "dev-master": "2.8-dev"
     2340                }
     2341            },
     2342            "autoload": {
     2343                "psr-4": {
     2344                    "Symfony\\Component\\EventDispatcher\\": ""
     2345                },
     2346                "exclude-from-classmap": [
     2347                    "/Tests/"
     2348                ]
     2349            },
     2350            "notification-url": "https://packagist.org/downloads/",
     2351            "license": [
     2352                "MIT"
     2353            ],
     2354            "authors": [
     2355                {
     2356                    "name": "Fabien Potencier",
     2357                    "email": "fabien@symfony.com"
     2358                },
     2359                {
     2360                    "name": "Symfony Community",
     2361                    "homepage": "https://symfony.com/contributors"
     2362                }
     2363            ],
     2364            "description": "Symfony EventDispatcher Component",
     2365            "homepage": "https://symfony.com",
     2366            "time": "2016-06-06 11:11:27"
     2367        },
     2368        {
     2369            "name": "symfony/filesystem",
     2370            "version": "v3.0.7",
     2371            "source": {
     2372                "type": "git",
     2373                "url": "https://github.com/symfony/filesystem.git",
     2374                "reference": "74fec3511b62cb934b64bce1d96f06fffa4beafd"
     2375            },
     2376            "dist": {
     2377                "type": "zip",
     2378                "url": "https://api.github.com/repos/symfony/filesystem/zipball/74fec3511b62cb934b64bce1d96f06fffa4beafd",
     2379                "reference": "74fec3511b62cb934b64bce1d96f06fffa4beafd",
     2380                "shasum": ""
     2381            },
     2382            "require": {
     2383                "php": ">=5.5.9"
     2384            },
     2385            "type": "library",
     2386            "extra": {
     2387                "branch-alias": {
     2388                    "dev-master": "3.0-dev"
     2389                }
     2390            },
     2391            "autoload": {
     2392                "psr-4": {
     2393                    "Symfony\\Component\\Filesystem\\": ""
     2394                },
     2395                "exclude-from-classmap": [
     2396                    "/Tests/"
     2397                ]
     2398            },
     2399            "notification-url": "https://packagist.org/downloads/",
     2400            "license": [
     2401                "MIT"
     2402            ],
     2403            "authors": [
     2404                {
     2405                    "name": "Fabien Potencier",
     2406                    "email": "fabien@symfony.com"
     2407                },
     2408                {
     2409                    "name": "Symfony Community",
     2410                    "homepage": "https://symfony.com/contributors"
     2411                }
     2412            ],
     2413            "description": "Symfony Filesystem Component",
     2414            "homepage": "https://symfony.com",
     2415            "time": "2016-04-12 18:09:53"
     2416        },
     2417        {
     2418            "name": "symfony/finder",
     2419            "version": "v2.8.7",
     2420            "source": {
     2421                "type": "git",
     2422                "url": "https://github.com/symfony/finder.git",
     2423                "reference": "3ec095fab1800222732ca522a95dce8fa124007b"
     2424            },
     2425            "dist": {
     2426                "type": "zip",
     2427                "url": "https://api.github.com/repos/symfony/finder/zipball/3ec095fab1800222732ca522a95dce8fa124007b",
     2428                "reference": "3ec095fab1800222732ca522a95dce8fa124007b",
     2429                "shasum": ""
     2430            },
     2431            "require": {
     2432                "php": ">=5.3.9"
     2433            },
     2434            "type": "library",
     2435            "extra": {
     2436                "branch-alias": {
     2437                    "dev-master": "2.8-dev"
     2438                }
     2439            },
     2440            "autoload": {
     2441                "psr-4": {
     2442                    "Symfony\\Component\\Finder\\": ""
     2443                },
     2444                "exclude-from-classmap": [
     2445                    "/Tests/"
     2446                ]
     2447            },
     2448            "notification-url": "https://packagist.org/downloads/",
     2449            "license": [
     2450                "MIT"
     2451            ],
     2452            "authors": [
     2453                {
     2454                    "name": "Fabien Potencier",
     2455                    "email": "fabien@symfony.com"
     2456                },
     2457                {
     2458                    "name": "Symfony Community",
     2459                    "homepage": "https://symfony.com/contributors"
     2460                }
     2461            ],
     2462            "description": "Symfony Finder Component",
     2463            "homepage": "https://symfony.com",
     2464            "time": "2016-06-06 11:11:27"
     2465        },
     2466        {
     2467            "name": "symfony/polyfill-mbstring",
     2468            "version": "v1.2.0",
     2469            "source": {
     2470                "type": "git",
     2471                "url": "https://github.com/symfony/polyfill-mbstring.git",
     2472                "reference": "dff51f72b0706335131b00a7f49606168c582594"
     2473            },
     2474            "dist": {
     2475                "type": "zip",
     2476                "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/dff51f72b0706335131b00a7f49606168c582594",
     2477                "reference": "dff51f72b0706335131b00a7f49606168c582594",
     2478                "shasum": ""
     2479            },
     2480            "require": {
     2481                "php": ">=5.3.3"
     2482            },
     2483            "suggest": {
     2484                "ext-mbstring": "For best performance"
     2485            },
     2486            "type": "library",
     2487            "extra": {
     2488                "branch-alias": {
     2489                    "dev-master": "1.2-dev"
     2490                }
     2491            },
     2492            "autoload": {
     2493                "psr-4": {
     2494                    "Symfony\\Polyfill\\Mbstring\\": ""
     2495                },
     2496                "files": [
     2497                    "bootstrap.php"
     2498                ]
     2499            },
     2500            "notification-url": "https://packagist.org/downloads/",
     2501            "license": [
     2502                "MIT"
     2503            ],
     2504            "authors": [
     2505                {
     2506                    "name": "Nicolas Grekas",
     2507                    "email": "p@tchwork.com"
     2508                },
     2509                {
     2510                    "name": "Symfony Community",
     2511                    "homepage": "https://symfony.com/contributors"
     2512                }
     2513            ],
     2514            "description": "Symfony polyfill for the Mbstring extension",
     2515            "homepage": "https://symfony.com",
     2516            "keywords": [
     2517                "compatibility",
     2518                "mbstring",
     2519                "polyfill",
     2520                "portable",
     2521                "shim"
     2522            ],
     2523            "time": "2016-05-18 14:26:46"
     2524        },
     2525        {
     2526            "name": "symfony/process",
     2527            "version": "v2.8.7",
     2528            "source": {
     2529                "type": "git",
     2530                "url": "https://github.com/symfony/process.git",
     2531                "reference": "115347d00c342198cdc52a7bd8bc15b5ab43500c"
     2532            },
     2533            "dist": {
     2534                "type": "zip",
     2535                "url": "https://api.github.com/repos/symfony/process/zipball/115347d00c342198cdc52a7bd8bc15b5ab43500c",
     2536                "reference": "115347d00c342198cdc52a7bd8bc15b5ab43500c",
     2537                "shasum": ""
     2538            },
     2539            "require": {
     2540                "php": ">=5.3.9"
     2541            },
     2542            "type": "library",
     2543            "extra": {
     2544                "branch-alias": {
     2545                    "dev-master": "2.8-dev"
     2546                }
     2547            },
     2548            "autoload": {
     2549                "psr-4": {
     2550                    "Symfony\\Component\\Process\\": ""
     2551                },
     2552                "exclude-from-classmap": [
     2553                    "/Tests/"
     2554                ]
     2555            },
     2556            "notification-url": "https://packagist.org/downloads/",
     2557            "license": [
     2558                "MIT"
     2559            ],
     2560            "authors": [
     2561                {
     2562                    "name": "Fabien Potencier",
     2563                    "email": "fabien@symfony.com"
     2564                },
     2565                {
     2566                    "name": "Symfony Community",
     2567                    "homepage": "https://symfony.com/contributors"
     2568                }
     2569            ],
     2570            "description": "Symfony Process Component",
     2571            "homepage": "https://symfony.com",
     2572            "time": "2016-06-06 11:11:27"
     2573        },
     2574        {
     2575            "name": "symfony/stopwatch",
     2576            "version": "v2.8.7",
     2577            "source": {
     2578                "type": "git",
     2579                "url": "https://github.com/symfony/stopwatch.git",
     2580                "reference": "5e628055488bcc42dbace3af65be435d094e37e4"
     2581            },
     2582            "dist": {
     2583                "type": "zip",
     2584                "url": "https://api.github.com/repos/symfony/stopwatch/zipball/5e628055488bcc42dbace3af65be435d094e37e4",
     2585                "reference": "5e628055488bcc42dbace3af65be435d094e37e4",
     2586                "shasum": ""
     2587            },
     2588            "require": {
     2589                "php": ">=5.3.9"
     2590            },
     2591            "type": "library",
     2592            "extra": {
     2593                "branch-alias": {
     2594                    "dev-master": "2.8-dev"
     2595                }
     2596            },
     2597            "autoload": {
     2598                "psr-4": {
     2599                    "Symfony\\Component\\Stopwatch\\": ""
     2600                },
     2601                "exclude-from-classmap": [
     2602                    "/Tests/"
     2603                ]
     2604            },
     2605            "notification-url": "https://packagist.org/downloads/",
     2606            "license": [
     2607                "MIT"
     2608            ],
     2609            "authors": [
     2610                {
     2611                    "name": "Fabien Potencier",
     2612                    "email": "fabien@symfony.com"
     2613                },
     2614                {
     2615                    "name": "Symfony Community",
     2616                    "homepage": "https://symfony.com/contributors"
     2617                }
     2618            ],
     2619            "description": "Symfony Stopwatch Component",
     2620            "homepage": "https://symfony.com",
     2621            "time": "2016-06-06 11:11:27"
     2622        },
     2623        {
     2624            "name": "symfony/translation",
     2625            "version": "v3.0.7",
     2626            "source": {
     2627                "type": "git",
     2628                "url": "https://github.com/symfony/translation.git",
     2629                "reference": "2b0aacaa613c0ec1ad8046f972d8abdcb19c1db7"
     2630            },
     2631            "dist": {
     2632                "type": "zip",
     2633                "url": "https://api.github.com/repos/symfony/translation/zipball/2b0aacaa613c0ec1ad8046f972d8abdcb19c1db7",
     2634                "reference": "2b0aacaa613c0ec1ad8046f972d8abdcb19c1db7",
     2635                "shasum": ""
     2636            },
     2637            "require": {
     2638                "php": ">=5.5.9",
     2639                "symfony/polyfill-mbstring": "~1.0"
     2640            },
     2641            "conflict": {
     2642                "symfony/config": "<2.8"
     2643            },
     2644            "require-dev": {
     2645                "psr/log": "~1.0",
     2646                "symfony/config": "~2.8|~3.0",
     2647                "symfony/intl": "~2.8|~3.0",
     2648                "symfony/yaml": "~2.8|~3.0"
     2649            },
     2650            "suggest": {
     2651                "psr/log": "To use logging capability in translator",
     2652                "symfony/config": "",
     2653                "symfony/yaml": ""
     2654            },
     2655            "type": "library",
     2656            "extra": {
     2657                "branch-alias": {
     2658                    "dev-master": "3.0-dev"
     2659                }
     2660            },
     2661            "autoload": {
     2662                "psr-4": {
     2663                    "Symfony\\Component\\Translation\\": ""
     2664                },
     2665                "exclude-from-classmap": [
     2666                    "/Tests/"
     2667                ]
     2668            },
     2669            "notification-url": "https://packagist.org/downloads/",
     2670            "license": [
     2671                "MIT"
     2672            ],
     2673            "authors": [
     2674                {
     2675                    "name": "Fabien Potencier",
     2676                    "email": "fabien@symfony.com"
     2677                },
     2678                {
     2679                    "name": "Symfony Community",
     2680                    "homepage": "https://symfony.com/contributors"
     2681                }
     2682            ],
     2683            "description": "Symfony Translation Component",
     2684            "homepage": "https://symfony.com",
     2685            "time": "2016-06-06 11:33:26"
     2686        },
     2687        {
     2688            "name": "symfony/validator",
     2689            "version": "v2.8.7",
     2690            "source": {
     2691                "type": "git",
     2692                "url": "https://github.com/symfony/validator.git",
     2693                "reference": "4c8f9fd8e2150dbc4745ef13378e690588365df0"
     2694            },
     2695            "dist": {
     2696                "type": "zip",
     2697                "url": "https://api.github.com/repos/symfony/validator/zipball/4c8f9fd8e2150dbc4745ef13378e690588365df0",
     2698                "reference": "4c8f9fd8e2150dbc4745ef13378e690588365df0",
     2699                "shasum": ""
     2700            },
     2701            "require": {
     2702                "php": ">=5.3.9",
     2703                "symfony/polyfill-mbstring": "~1.0",
     2704                "symfony/translation": "~2.4|~3.0.0"
     2705            },
     2706            "require-dev": {
     2707                "doctrine/annotations": "~1.0",
     2708                "doctrine/cache": "~1.0",
     2709                "egulias/email-validator": "~1.2,>=1.2.1",
     2710                "symfony/config": "~2.2|~3.0.0",
     2711                "symfony/expression-language": "~2.4|~3.0.0",
     2712                "symfony/http-foundation": "~2.1|~3.0.0",
     2713                "symfony/intl": "~2.7.4|~2.8|~3.0.0",
     2714                "symfony/property-access": "~2.3|~3.0.0",
     2715                "symfony/yaml": "~2.0,>=2.0.5|~3.0.0"
     2716            },
     2717            "suggest": {
     2718                "doctrine/annotations": "For using the annotation mapping. You will also need doctrine/cache.",
     2719                "doctrine/cache": "For using the default cached annotation reader and metadata cache.",
     2720                "egulias/email-validator": "Strict (RFC compliant) email validation",
     2721                "symfony/config": "",
     2722                "symfony/expression-language": "For using the 2.4 Expression validator",
     2723                "symfony/http-foundation": "",
     2724                "symfony/intl": "",
     2725                "symfony/property-access": "For using the 2.4 Validator API",
     2726                "symfony/yaml": ""
     2727            },
     2728            "type": "library",
     2729            "extra": {
     2730                "branch-alias": {
     2731                    "dev-master": "2.8-dev"
     2732                }
     2733            },
     2734            "autoload": {
     2735                "psr-4": {
     2736                    "Symfony\\Component\\Validator\\": ""
     2737                },
     2738                "exclude-from-classmap": [
     2739                    "/Tests/"
     2740                ]
     2741            },
     2742            "notification-url": "https://packagist.org/downloads/",
     2743            "license": [
     2744                "MIT"
     2745            ],
     2746            "authors": [
     2747                {
     2748                    "name": "Fabien Potencier",
     2749                    "email": "fabien@symfony.com"
     2750                },
     2751                {
     2752                    "name": "Symfony Community",
     2753                    "homepage": "https://symfony.com/contributors"
     2754                }
     2755            ],
     2756            "description": "Symfony Validator Component",
     2757            "homepage": "https://symfony.com",
     2758            "time": "2016-04-14 08:48:44"
     2759        },
     2760        {
     2761            "name": "symfony/yaml",
     2762            "version": "v3.1.1",
     2763            "source": {
     2764                "type": "git",
     2765                "url": "https://github.com/symfony/yaml.git",
     2766                "reference": "c5a7e7fc273c758b92b85dcb9c46149ccda89623"
     2767            },
     2768            "dist": {
     2769                "type": "zip",
     2770                "url": "https://api.github.com/repos/symfony/yaml/zipball/c5a7e7fc273c758b92b85dcb9c46149ccda89623",
     2771                "reference": "c5a7e7fc273c758b92b85dcb9c46149ccda89623",
     2772                "shasum": ""
     2773            },
     2774            "require": {
     2775                "php": ">=5.5.9"
     2776            },
     2777            "type": "library",
     2778            "extra": {
     2779                "branch-alias": {
     2780                    "dev-master": "3.1-dev"
     2781                }
     2782            },
     2783            "autoload": {
     2784                "psr-4": {
     2785                    "Symfony\\Component\\Yaml\\": ""
     2786                },
     2787                "exclude-from-classmap": [
     2788                    "/Tests/"
     2789                ]
     2790            },
     2791            "notification-url": "https://packagist.org/downloads/",
     2792            "license": [
     2793                "MIT"
     2794            ],
     2795            "authors": [
     2796                {
     2797                    "name": "Fabien Potencier",
     2798                    "email": "fabien@symfony.com"
     2799                },
     2800                {
     2801                    "name": "Symfony Community",
     2802                    "homepage": "https://symfony.com/contributors"
     2803                }
     2804            ],
     2805            "description": "Symfony Yaml Component",
     2806            "homepage": "https://symfony.com",
     2807            "time": "2016-06-14 11:18:07"
     2808        },
     2809        {
     2810            "name": "twig/twig",
     2811            "version": "v1.24.1",
     2812            "source": {
     2813                "type": "git",
     2814                "url": "https://github.com/twigphp/Twig.git",
     2815                "reference": "3566d311a92aae4deec6e48682dc5a4528c4a512"
     2816            },
     2817            "dist": {
     2818                "type": "zip",
     2819                "url": "https://api.github.com/repos/twigphp/Twig/zipball/3566d311a92aae4deec6e48682dc5a4528c4a512",
     2820                "reference": "3566d311a92aae4deec6e48682dc5a4528c4a512",
     2821                "shasum": ""
     2822            },
     2823            "require": {
     2824                "php": ">=5.2.7"
     2825            },
     2826            "require-dev": {
     2827                "symfony/debug": "~2.7",
     2828                "symfony/phpunit-bridge": "~2.7"
     2829            },
     2830            "type": "library",
     2831            "extra": {
     2832                "branch-alias": {
     2833                    "dev-master": "1.24-dev"
     2834                }
     2835            },
     2836            "autoload": {
     2837                "psr-0": {
     2838                    "Twig_": "lib/"
     2839                }
     2840            },
     2841            "notification-url": "https://packagist.org/downloads/",
     2842            "license": [
     2843                "BSD-3-Clause"
     2844            ],
     2845            "authors": [
     2846                {
     2847                    "name": "Fabien Potencier",
     2848                    "email": "fabien@symfony.com",
     2849                    "homepage": "http://fabien.potencier.org",
     2850                    "role": "Lead Developer"
     2851                },
     2852                {
     2853                    "name": "Armin Ronacher",
     2854                    "email": "armin.ronacher@active-4.com",
     2855                    "role": "Project Founder"
     2856                },
     2857                {
     2858                    "name": "Twig Team",
     2859                    "homepage": "http://twig.sensiolabs.org/contributors",
     2860                    "role": "Contributors"
     2861                }
     2862            ],
     2863            "description": "Twig, the flexible, fast, and secure template language for PHP",
     2864            "homepage": "http://twig.sensiolabs.org",
     2865            "keywords": [
     2866                "templating"
     2867            ],
     2868            "time": "2016-05-30 09:11:59"
     2869        },
     2870        {
     2871            "name": "zendframework/zend-cache",
     2872            "version": "2.7.1",
     2873            "source": {
     2874                "type": "git",
     2875                "url": "https://github.com/zendframework/zend-cache.git",
     2876                "reference": "2c68def8f96ce842d2f2a9a69e2f3508c2f5312d"
     2877            },
     2878            "dist": {
     2879                "type": "zip",
     2880                "url": "https://api.github.com/repos/zendframework/zend-cache/zipball/2c68def8f96ce842d2f2a9a69e2f3508c2f5312d",
     2881                "reference": "2c68def8f96ce842d2f2a9a69e2f3508c2f5312d",
     2882                "shasum": ""
     2883            },
     2884            "require": {
     2885                "php": "^5.5 || ^7.0",
     2886                "zendframework/zend-eventmanager": "^2.6.2 || ^3.0",
     2887                "zendframework/zend-servicemanager": "^2.7.5 || ^3.0.3",
     2888                "zendframework/zend-stdlib": "^2.7 || ^3.0"
     2889            },
     2890            "require-dev": {
     2891                "fabpot/php-cs-fixer": "1.7.*",
     2892                "phpbench/phpbench": "^0.10.0",
     2893                "phpunit/phpunit": "^4.5",
     2894                "zendframework/zend-serializer": "^2.6",
     2895                "zendframework/zend-session": "^2.6.2"
     2896            },
     2897            "suggest": {
     2898                "ext-apc": "APC or compatible extension, to use the APC storage adapter",
     2899                "ext-apcu": "APCU >= 5.1.0, to use the APCu storage adapter",
     2900                "ext-dba": "DBA, to use the DBA storage adapter",
     2901                "ext-memcache": "Memcache >= 2.0.0 to use the Memcache storage adapter",
     2902                "ext-memcached": "Memcached >= 1.0.0 to use the Memcached storage adapter",
     2903                "ext-mongo": "Mongo, to use MongoDb storage adapter",
     2904                "ext-redis": "Redis, to use Redis storage adapter",
     2905                "ext-wincache": "WinCache, to use the WinCache storage adapter",
     2906                "ext-xcache": "XCache, to use the XCache storage adapter",
     2907                "mongofill/mongofill": "Alternative to ext-mongo - a pure PHP implementation designed as a drop in replacement",
     2908                "zendframework/zend-serializer": "Zend\\Serializer component",
     2909                "zendframework/zend-session": "Zend\\Session component"
     2910            },
     2911            "type": "library",
     2912            "extra": {
     2913                "branch-alias": {
     2914                    "dev-master": "2.7-dev",
     2915                    "dev-develop": "2.8-dev"
     2916                },
     2917                "zf": {
     2918                    "component": "Zend\\Cache",
     2919                    "config-provider": "Zend\\Cache\\ConfigProvider"
     2920                }
     2921            },
     2922            "autoload": {
     2923                "psr-4": {
     2924                    "Zend\\Cache\\": "src/"
     2925                }
     2926            },
     2927            "notification-url": "https://packagist.org/downloads/",
     2928            "license": [
     2929                "BSD-3-Clause"
     2930            ],
     2931            "description": "provides a generic way to cache any data",
     2932            "homepage": "https://github.com/zendframework/zend-cache",
     2933            "keywords": [
     2934                "cache",
     2935                "zf2"
     2936            ],
     2937            "time": "2016-05-12 21:47:55"
     2938        },
     2939        {
     2940            "name": "zendframework/zend-config",
     2941            "version": "2.6.0",
     2942            "source": {
     2943                "type": "git",
     2944                "url": "https://github.com/zendframework/zend-config.git",
     2945                "reference": "2920e877a9f6dca9fa8f6bd3b1ffc2e19bb1e30d"
     2946            },
     2947            "dist": {
     2948                "type": "zip",
     2949                "url": "https://api.github.com/repos/zendframework/zend-config/zipball/2920e877a9f6dca9fa8f6bd3b1ffc2e19bb1e30d",
     2950                "reference": "2920e877a9f6dca9fa8f6bd3b1ffc2e19bb1e30d",
     2951                "shasum": ""
     2952            },
     2953            "require": {
     2954                "php": "^5.5 || ^7.0",
     2955                "zendframework/zend-stdlib": "^2.7 || ^3.0"
     2956            },
     2957            "require-dev": {
     2958                "fabpot/php-cs-fixer": "1.7.*",
     2959                "phpunit/phpunit": "~4.0",
     2960                "zendframework/zend-filter": "^2.6",
     2961                "zendframework/zend-i18n": "^2.5",
     2962                "zendframework/zend-json": "^2.6.1",
     2963                "zendframework/zend-servicemanager": "^2.7.5 || ^3.0.3"
     2964            },
     2965            "suggest": {
     2966                "zendframework/zend-filter": "Zend\\Filter component",
     2967                "zendframework/zend-i18n": "Zend\\I18n component",
     2968                "zendframework/zend-json": "Zend\\Json to use the Json reader or writer classes",
     2969                "zendframework/zend-servicemanager": "Zend\\ServiceManager for use with the Config Factory to retrieve reader and writer instances"
     2970            },
     2971            "type": "library",
     2972            "extra": {
     2973                "branch-alias": {
     2974                    "dev-master": "2.6-dev",
     2975                    "dev-develop": "2.7-dev"
     2976                }
     2977            },
     2978            "autoload": {
     2979                "psr-4": {
     2980                    "Zend\\Config\\": "src/"
     2981                }
     2982            },
     2983            "notification-url": "https://packagist.org/downloads/",
     2984            "license": [
     2985                "BSD-3-Clause"
     2986            ],
     2987            "description": "provides a nested object property based user interface for accessing this configuration data within application code",
     2988            "homepage": "https://github.com/zendframework/zend-config",
     2989            "keywords": [
     2990                "config",
     2991                "zf2"
     2992            ],
     2993            "time": "2016-02-04 23:01:10"
     2994        },
     2995        {
     2996            "name": "zendframework/zend-eventmanager",
     2997            "version": "3.0.1",
     2998            "source": {
     2999                "type": "git",
     3000                "url": "https://github.com/zendframework/zend-eventmanager.git",
     3001                "reference": "5c80bdee0e952be112dcec0968bad770082c3a6e"
     3002            },
     3003            "dist": {
     3004                "type": "zip",
     3005                "url": "https://api.github.com/repos/zendframework/zend-eventmanager/zipball/5c80bdee0e952be112dcec0968bad770082c3a6e",
     3006                "reference": "5c80bdee0e952be112dcec0968bad770082c3a6e",
     3007                "shasum": ""
     3008            },
     3009            "require": {
     3010                "php": "^5.5 || ^7.0"
     3011            },
     3012            "require-dev": {
     3013                "athletic/athletic": "^0.1",
     3014                "container-interop/container-interop": "^1.1.0",
     3015                "phpunit/phpunit": "~4.0",
     3016                "squizlabs/php_codesniffer": "^2.0",
     3017                "zendframework/zend-stdlib": "^2.7.3 || ^3.0"
     3018            },
     3019            "suggest": {
     3020                "container-interop/container-interop": "^1.1.0, to use the lazy listeners feature",
     3021                "zendframework/zend-stdlib": "^2.7.3 || ^3.0, to use the FilterChain feature"
     3022            },
     3023            "type": "library",
     3024            "extra": {
     3025                "branch-alias": {
     3026                    "dev-master": "3.0-dev",
     3027                    "dev-develop": "3.1-dev"
     3028                }
     3029            },
     3030            "autoload": {
     3031                "psr-4": {
     3032                    "Zend\\EventManager\\": "src/"
     3033                }
     3034            },
     3035            "notification-url": "https://packagist.org/downloads/",
     3036            "license": [
     3037                "BSD-3-Clause"
     3038            ],
     3039            "description": "Trigger and listen to events within a PHP application",
     3040            "homepage": "https://github.com/zendframework/zend-eventmanager",
     3041            "keywords": [
     3042                "event",
     3043                "eventmanager",
     3044                "events",
     3045                "zf2"
     3046            ],
     3047            "time": "2016-02-18 20:53:00"
     3048        },
     3049        {
     3050            "name": "zendframework/zend-filter",
     3051            "version": "2.7.1",
     3052            "source": {
     3053                "type": "git",
     3054                "url": "https://github.com/zendframework/zend-filter.git",
     3055                "reference": "84c50246428efb0a1e52868e162dab3e149d5b80"
     3056            },
     3057            "dist": {
     3058                "type": "zip",
     3059                "url": "https://api.github.com/repos/zendframework/zend-filter/zipball/84c50246428efb0a1e52868e162dab3e149d5b80",
     3060                "reference": "84c50246428efb0a1e52868e162dab3e149d5b80",
     3061                "shasum": ""
     3062            },
     3063            "require": {
     3064                "php": "^5.5 || ^7.0",
     3065                "zendframework/zend-stdlib": "^2.7 || ^3.0"
     3066            },
     3067            "require-dev": {
     3068                "fabpot/php-cs-fixer": "1.7.*",
     3069                "pear/archive_tar": "^1.4",
     3070                "phpunit/phpunit": "~4.0",
     3071                "zendframework/zend-crypt": "^2.6",
     3072                "zendframework/zend-servicemanager": "^2.7.5 || ^3.0.3",
     3073                "zendframework/zend-uri": "^2.5"
     3074            },
     3075            "suggest": {
     3076                "zendframework/zend-crypt": "Zend\\Crypt component, for encryption filters",
     3077                "zendframework/zend-i18n": "Zend\\I18n component for filters depending on i18n functionality",
     3078                "zendframework/zend-servicemanager": "Zend\\ServiceManager component, for using the filter chain functionality",
     3079                "zendframework/zend-uri": "Zend\\Uri component, for the UriNormalize filter"
     3080            },
     3081            "type": "library",
     3082            "extra": {
     3083                "branch-alias": {
     3084                    "dev-master": "2.7-dev",
     3085                    "dev-develop": "2.8-dev"
     3086                },
     3087                "zf": {
     3088                    "component": "Zend\\Filter",
     3089                    "config-provider": "Zend\\Filter\\ConfigProvider"
     3090                }
     3091            },
     3092            "autoload": {
     3093                "psr-4": {
     3094                    "Zend\\Filter\\": "src/"
     3095                }
     3096            },
     3097            "notification-url": "https://packagist.org/downloads/",
     3098            "license": [
     3099                "BSD-3-Clause"
     3100            ],
     3101            "description": "provides a set of commonly needed data filters",
     3102            "homepage": "https://github.com/zendframework/zend-filter",
     3103            "keywords": [
     3104                "filter",
     3105                "zf2"
     3106            ],
     3107            "time": "2016-04-18 18:32:43"
     3108        },
     3109        {
     3110            "name": "zendframework/zend-hydrator",
     3111            "version": "1.1.0",
     3112            "source": {
     3113                "type": "git",
     3114                "url": "https://github.com/zendframework/zend-hydrator.git",
     3115                "reference": "22652e1661a5a10b3f564cf7824a2206cf5a4a65"
     3116            },
     3117            "dist": {
     3118                "type": "zip",
     3119                "url": "https://api.github.com/repos/zendframework/zend-hydrator/zipball/22652e1661a5a10b3f564cf7824a2206cf5a4a65",
     3120                "reference": "22652e1661a5a10b3f564cf7824a2206cf5a4a65",
     3121                "shasum": ""
     3122            },
     3123            "require": {
     3124                "php": "^5.5 || ^7.0",
     3125                "zendframework/zend-stdlib": "^2.7 || ^3.0"
     3126            },
     3127            "require-dev": {
     3128                "phpunit/phpunit": "~4.0",
     3129                "squizlabs/php_codesniffer": "^2.0@dev",
     3130                "zendframework/zend-eventmanager": "^2.6.2 || ^3.0",
     3131                "zendframework/zend-filter": "^2.6",
     3132                "zendframework/zend-inputfilter": "^2.6",
     3133                "zendframework/zend-serializer": "^2.6.1",
     3134                "zendframework/zend-servicemanager": "^2.7.5 || ^3.0.3"
     3135            },
     3136            "suggest": {
     3137                "zendframework/zend-eventmanager": "^2.6.2 || ^3.0, to support aggregate hydrator usage",
     3138                "zendframework/zend-filter": "^2.6, to support naming strategy hydrator usage",
     3139                "zendframework/zend-serializer": "^2.6.1, to use the SerializableStrategy",
     3140                "zendframework/zend-servicemanager": "^2.7.5 || ^3.0.3, to support hydrator plugin manager usage"
     3141            },
     3142            "type": "library",
     3143            "extra": {
     3144                "branch-alias": {
     3145                    "dev-release-1.0": "1.0-dev",
     3146                    "dev-release-1.1": "1.1-dev",
     3147                    "dev-master": "2.0-dev",
     3148                    "dev-develop": "2.1-dev"
     3149                }
     3150            },
     3151            "autoload": {
     3152                "psr-4": {
     3153                    "Zend\\Hydrator\\": "src/"
     3154                }
     3155            },
     3156            "notification-url": "https://packagist.org/downloads/",
     3157            "license": [
     3158                "BSD-3-Clause"
     3159            ],
     3160            "homepage": "https://github.com/zendframework/zend-hydrator",
     3161            "keywords": [
     3162                "hydrator",
     3163                "zf2"
     3164            ],
     3165            "time": "2016-02-18 22:38:26"
     3166        },
     3167        {
     3168            "name": "zendframework/zend-i18n",
     3169            "version": "2.7.3",
     3170            "source": {
     3171                "type": "git",
     3172                "url": "https://github.com/zendframework/zend-i18n.git",
     3173                "reference": "b2db0d8246a865c659f93199f90f5fc2cd2f3cd8"
     3174            },
     3175            "dist": {
     3176                "type": "zip",
     3177                "url": "https://api.github.com/repos/zendframework/zend-i18n/zipball/b2db0d8246a865c659f93199f90f5fc2cd2f3cd8",
     3178                "reference": "b2db0d8246a865c659f93199f90f5fc2cd2f3cd8",
     3179                "shasum": ""
     3180            },
     3181            "require": {
     3182                "php": "^5.5 || ^7.0",
     3183                "zendframework/zend-stdlib": "^2.7 || ^3.0"
     3184            },
     3185            "require-dev": {
     3186                "fabpot/php-cs-fixer": "1.7.*",
     3187                "phpunit/phpunit": "~4.0",
     3188                "zendframework/zend-cache": "^2.6.1",
     3189                "zendframework/zend-config": "^2.6",
     3190                "zendframework/zend-eventmanager": "^2.6.2 || ^3.0",
     3191                "zendframework/zend-filter": "^2.6.1",
     3192                "zendframework/zend-servicemanager": "^2.7.5 || ^3.0.3",
     3193                "zendframework/zend-validator": "^2.6",
     3194                "zendframework/zend-view": "^2.6.3"
     3195            },
     3196            "suggest": {
     3197                "ext-intl": "Required for most features of Zend\\I18n; included in default builds of PHP",
     3198                "zendframework/zend-cache": "Zend\\Cache component",
     3199                "zendframework/zend-config": "Zend\\Config component",
     3200                "zendframework/zend-eventmanager": "You should install this package to use the events in the translator",
     3201                "zendframework/zend-filter": "You should install this package to use the provided filters",
     3202                "zendframework/zend-i18n-resources": "Translation resources",
     3203                "zendframework/zend-servicemanager": "Zend\\ServiceManager component",
     3204                "zendframework/zend-validator": "You should install this package to use the provided validators",
     3205                "zendframework/zend-view": "You should install this package to use the provided view helpers"
     3206            },
     3207            "type": "library",
     3208            "extra": {
     3209                "branch-alias": {
     3210                    "dev-master": "2.7-dev",
     3211                    "dev-develop": "2.8-dev"
     3212                },
     3213                "zf": {
     3214                    "component": "Zend\\I18n",
     3215                    "config-provider": "Zend\\I18n\\ConfigProvider"
     3216                }
     3217            },
     3218            "autoload": {
     3219                "psr-4": {
     3220                    "Zend\\I18n\\": "src/"
     3221                }
     3222            },
     3223            "notification-url": "https://packagist.org/downloads/",
     3224            "license": [
     3225                "BSD-3-Clause"
     3226            ],
     3227            "homepage": "https://github.com/zendframework/zend-i18n",
     3228            "keywords": [
     3229                "i18n",
     3230                "zf2"
     3231            ],
     3232            "time": "2016-06-07 21:08:30"
     3233        },
     3234        {
     3235            "name": "zendframework/zend-json",
     3236            "version": "3.0.0",
     3237            "source": {
     3238                "type": "git",
     3239                "url": "https://github.com/zendframework/zend-json.git",
     3240                "reference": "f42a1588e75c2a3e338cd94c37906231e616daab"
     3241            },
     3242            "dist": {
     3243                "type": "zip",
     3244                "url": "https://api.github.com/repos/zendframework/zend-json/zipball/f42a1588e75c2a3e338cd94c37906231e616daab",
     3245                "reference": "f42a1588e75c2a3e338cd94c37906231e616daab",
     3246                "shasum": ""
     3247            },
     3248            "require": {
     3249                "php": "^5.5 || ^7.0"
     3250            },
     3251            "require-dev": {
     3252                "phpunit/phpunit": "~4.0",
     3253                "squizlabs/php_codesniffer": "^2.3",
     3254                "zendframework/zend-stdlib": "^2.7 || ^3.0"
     3255            },
     3256            "suggest": {
     3257                "zendframework/zend-json-server": "For implementing JSON-RPC servers",
     3258                "zendframework/zend-xml2json": "For converting XML documents to JSON"
     3259            },
     3260            "type": "library",
     3261            "extra": {
     3262                "branch-alias": {
     3263                    "dev-master": "3.0-dev",
     3264                    "dev-develop": "3.1-dev"
     3265                }
     3266            },
     3267            "autoload": {
     3268                "psr-4": {
     3269                    "Zend\\Json\\": "src/"
     3270                }
     3271            },
     3272            "notification-url": "https://packagist.org/downloads/",
     3273            "license": [
     3274                "BSD-3-Clause"
     3275            ],
     3276            "description": "provides convenience methods for serializing native PHP to JSON and decoding JSON to native PHP",
     3277            "homepage": "https://github.com/zendframework/zend-json",
     3278            "keywords": [
     3279                "json",
     3280                "zf2"
     3281            ],
     3282            "time": "2016-04-01 02:34:00"
     3283        },
     3284        {
     3285            "name": "zendframework/zend-serializer",
     3286            "version": "2.8.0",
     3287            "source": {
     3288                "type": "git",
     3289                "url": "https://github.com/zendframework/zend-serializer.git",
     3290                "reference": "ff74ea020f5f90866eb28365327e9bc765a61a6e"
     3291            },
     3292            "dist": {
     3293                "type": "zip",
     3294                "url": "https://api.github.com/repos/zendframework/zend-serializer/zipball/ff74ea020f5f90866eb28365327e9bc765a61a6e",
     3295                "reference": "ff74ea020f5f90866eb28365327e9bc765a61a6e",
     3296                "shasum": ""
     3297            },
     3298            "require": {
     3299                "php": "^5.6 || ^7.0",
     3300                "zendframework/zend-json": "^2.5 || ^3.0",
     3301                "zendframework/zend-stdlib": "^2.7 || ^3.0"
     3302            },
     3303            "require-dev": {
     3304                "phpunit/phpunit": "^4.5",
     3305                "squizlabs/php_codesniffer": "^2.3.1",
     3306                "zendframework/zend-math": "^2.6",
     3307                "zendframework/zend-servicemanager": "^2.7.5 || ^3.0.3"
     3308            },
     3309            "suggest": {
     3310                "zendframework/zend-math": "(^2.6 || ^3.0) To support Python Pickle serialization",
     3311                "zendframework/zend-servicemanager": "(^2.7.5 || ^3.0.3) To support plugin manager support"
     3312            },
     3313            "type": "library",
     3314            "extra": {
     3315                "branch-alias": {
     3316                    "dev-master": "2.8-dev",
     3317                    "dev-develop": "2.9-dev"
     3318                },
     3319                "zf": {
     3320                    "component": "Zend\\Serializer",
     3321                    "config-provider": "Zend\\Serializer\\ConfigProvider"
     3322                }
     3323            },
     3324            "autoload": {
     3325                "psr-4": {
     3326                    "Zend\\Serializer\\": "src/"
     3327                }
     3328            },
     3329            "notification-url": "https://packagist.org/downloads/",
     3330            "license": [
     3331                "BSD-3-Clause"
     3332            ],
     3333            "description": "provides an adapter based interface to simply generate storable representation of PHP types by different facilities, and recover",
     3334            "homepage": "https://github.com/zendframework/zend-serializer",
     3335            "keywords": [
     3336                "serializer",
     3337                "zf2"
     3338            ],
     3339            "time": "2016-06-21 17:01:55"
     3340        },
     3341        {
     3342            "name": "zendframework/zend-servicemanager",
     3343            "version": "2.7.6",
     3344            "source": {
     3345                "type": "git",
     3346                "url": "https://github.com/zendframework/zend-servicemanager.git",
     3347                "reference": "a6db4d13b9141fccce5dcb553df0295d6ad7d477"
     3348            },
     3349            "dist": {
     3350                "type": "zip",
     3351                "url": "https://api.github.com/repos/zendframework/zend-servicemanager/zipball/a6db4d13b9141fccce5dcb553df0295d6ad7d477",
     3352                "reference": "a6db4d13b9141fccce5dcb553df0295d6ad7d477",
     3353                "shasum": ""
     3354            },
     3355            "require": {
     3356                "container-interop/container-interop": "~1.0",
     3357                "php": "^5.5 || ^7.0"
     3358            },
     3359            "require-dev": {
     3360                "athletic/athletic": "dev-master",
     3361                "fabpot/php-cs-fixer": "1.7.*",
     3362                "phpunit/phpunit": "~4.0",
     3363                "zendframework/zend-di": "~2.5",
     3364                "zendframework/zend-mvc": "~2.5"
     3365            },
     3366            "suggest": {
     3367                "ocramius/proxy-manager": "ProxyManager 0.5.* to handle lazy initialization of services",
     3368                "zendframework/zend-di": "Zend\\Di component"
     3369            },
     3370            "type": "library",
     3371            "extra": {
     3372                "branch-alias": {
     3373                    "dev-master": "2.7-dev",
     3374                    "dev-develop": "3.0-dev"
     3375                }
     3376            },
     3377            "autoload": {
     3378                "psr-4": {
     3379                    "Zend\\ServiceManager\\": "src/"
     3380                }
     3381            },
     3382            "notification-url": "https://packagist.org/downloads/",
     3383            "license": [
     3384                "BSD-3-Clause"
     3385            ],
     3386            "homepage": "https://github.com/zendframework/zend-servicemanager",
     3387            "keywords": [
     3388                "servicemanager",
     3389                "zf2"
     3390            ],
     3391            "time": "2016-04-27 19:07:40"
     3392        },
     3393        {
     3394            "name": "zendframework/zend-stdlib",
     3395            "version": "2.7.7",
     3396            "source": {
     3397                "type": "git",
     3398                "url": "https://github.com/zendframework/zend-stdlib.git",
     3399                "reference": "0e44eb46788f65e09e077eb7f44d2659143bcc1f"
     3400            },
     3401            "dist": {
     3402                "type": "zip",
     3403                "url": "https://api.github.com/repos/zendframework/zend-stdlib/zipball/0e44eb46788f65e09e077eb7f44d2659143bcc1f",
     3404                "reference": "0e44eb46788f65e09e077eb7f44d2659143bcc1f",
     3405                "shasum": ""
     3406            },
     3407            "require": {
     3408                "php": "^5.5 || ^7.0",
     3409                "zendframework/zend-hydrator": "~1.1"
     3410            },
     3411            "require-dev": {
     3412                "athletic/athletic": "~0.1",
     3413                "fabpot/php-cs-fixer": "1.7.*",
     3414                "phpunit/phpunit": "~4.0",
     3415                "zendframework/zend-config": "~2.5",
     3416                "zendframework/zend-eventmanager": "~2.5",
     3417                "zendframework/zend-filter": "~2.5",
     3418                "zendframework/zend-inputfilter": "~2.5",
     3419                "zendframework/zend-serializer": "~2.5",
     3420                "zendframework/zend-servicemanager": "~2.5"
     3421            },
     3422            "suggest": {
     3423                "zendframework/zend-eventmanager": "To support aggregate hydrator usage",
     3424                "zendframework/zend-filter": "To support naming strategy hydrator usage",
     3425                "zendframework/zend-serializer": "Zend\\Serializer component",
     3426                "zendframework/zend-servicemanager": "To support hydrator plugin manager usage"
     3427            },
     3428            "type": "library",
     3429            "extra": {
     3430                "branch-alias": {
     3431                    "dev-release-2.7": "2.7-dev",
     3432                    "dev-master": "3.0-dev",
     3433                    "dev-develop": "3.1-dev"
     3434                }
     3435            },
     3436            "autoload": {
     3437                "psr-4": {
     3438                    "Zend\\Stdlib\\": "src/"
     3439                }
     3440            },
     3441            "notification-url": "https://packagist.org/downloads/",
     3442            "license": [
     3443                "BSD-3-Clause"
     3444            ],
     3445            "homepage": "https://github.com/zendframework/zend-stdlib",
     3446            "keywords": [
     3447                "stdlib",
     3448                "zf2"
     3449            ],
     3450            "time": "2016-04-12 21:17:31"
     3451        },
     3452        {
     3453            "name": "zetacomponents/base",
     3454            "version": "1.9",
     3455            "source": {
     3456                "type": "git",
     3457                "url": "https://github.com/zetacomponents/Base.git",
     3458                "reference": "f20df24e8de3e48b6b69b2503f917e457281e687"
     3459            },
     3460            "dist": {
     3461                "type": "zip",
     3462                "url": "https://api.github.com/repos/zetacomponents/Base/zipball/f20df24e8de3e48b6b69b2503f917e457281e687",
     3463                "reference": "f20df24e8de3e48b6b69b2503f917e457281e687",
     3464                "shasum": ""
     3465            },
     3466            "require-dev": {
     3467                "zetacomponents/unit-test": "*"
     3468            },
     3469            "type": "library",
     3470            "autoload": {
     3471                "classmap": [
     3472                    "src"
     3473                ]
     3474            },
     3475            "notification-url": "https://packagist.org/downloads/",
     3476            "license": [
     3477                "Apache-2.0"
     3478            ],
     3479            "authors": [
     3480                {
     3481                    "name": "Sergey Alexeev"
     3482                },
     3483                {
     3484                    "name": "Sebastian Bergmann"
     3485                },
     3486                {
     3487                    "name": "Jan Borsodi"
     3488                },
     3489                {
     3490                    "name": "Raymond Bosman"
     3491                },
     3492                {
     3493                    "name": "Frederik Holljen"
     3494                },
     3495                {
     3496                    "name": "Kore Nordmann"
     3497                },
     3498                {
     3499                    "name": "Derick Rethans"
     3500                },
     3501                {
     3502                    "name": "Vadym Savchuk"
     3503                },
     3504                {
     3505                    "name": "Tobias Schlitt"
     3506                },
     3507                {
     3508                    "name": "Alexandru Stanoi"
     3509                }
     3510            ],
     3511            "description": "The Base package provides the basic infrastructure that all packages rely on. Therefore every component relies on this package.",
     3512            "homepage": "https://github.com/zetacomponents",
     3513            "time": "2014-09-19 03:28:34"
     3514        },
     3515        {
     3516            "name": "zetacomponents/document",
     3517            "version": "1.3.1",
     3518            "source": {
     3519                "type": "git",
     3520                "url": "https://github.com/zetacomponents/Document.git",
     3521                "reference": "688abfde573cf3fe0730f82538fbd7aa9fc95bc8"
     3522            },
     3523            "dist": {
     3524                "type": "zip",
     3525                "url": "https://api.github.com/repos/zetacomponents/Document/zipball/688abfde573cf3fe0730f82538fbd7aa9fc95bc8",
     3526                "reference": "688abfde573cf3fe0730f82538fbd7aa9fc95bc8",
     3527                "shasum": ""
     3528            },
     3529            "require": {
     3530                "zetacomponents/base": "*"
     3531            },
     3532            "require-dev": {
     3533                "zetacomponents/unit-test": "dev-master"
     3534            },
     3535            "type": "library",
     3536            "autoload": {
     3537                "classmap": [
     3538                    "src"
     3539                ]
     3540            },
     3541            "notification-url": "https://packagist.org/downloads/",
     3542            "license": [
     3543                "Apache-2.0"
     3544            ],
     3545            "authors": [
     3546                {
     3547                    "name": "Sebastian Bergmann"
     3548                },
     3549                {
     3550                    "name": "Kore Nordmann"
     3551                },
     3552                {
     3553                    "name": "Derick Rethans"
     3554                },
     3555                {
     3556                    "name": "Tobias Schlitt"
     3557                },
     3558                {
     3559                    "name": "Alexandru Stanoi"
     3560                }
     3561            ],
     3562            "description": "The Document components provides a general conversion framework for different semantic document markup languages like XHTML, Docbook, RST and similar.",
     3563            "homepage": "https://github.com/zetacomponents",
     3564            "time": "2013-12-19 11:40:00"
     3565        }
     3566    ],
     3567    "aliases": [],
     3568    "minimum-stability": "stable",
     3569    "stability-flags": [],
     3570    "prefer-stable": false,
     3571    "prefer-lowest": false,
     3572    "platform": {
     3573        "php": ">=5.0.0"
     3574    },
     3575    "platform-dev": []
     3576}
  • new file wp-includes/PHPMailer/extras/EasyPeasyICS.php

    diff --git wp-includes/PHPMailer/extras/EasyPeasyICS.php wp-includes/PHPMailer/extras/EasyPeasyICS.php
    new file mode 100644
    index 0000000..d8bfcfa
    - +  
     1<?php
     2/**
     3 * EasyPeasyICS Simple ICS/vCal data generator.
     4 * @author Marcus Bointon <phpmailer@synchromedia.co.uk>
     5 * @author Manuel Reinhard <manu@sprain.ch>
     6 *
     7 * Built with inspiration from
     8 * http://stackoverflow.com/questions/1463480/how-can-i-use-php-to-dynamically-publish-an-ical-file-to-be-read-by-google-calend/1464355#1464355
     9 * History:
     10 * 2010/12/17 - Manuel Reinhard - when it all started
     11 * 2014 PHPMailer project becomes maintainer
     12 */
     13
     14/**
     15 * Class EasyPeasyICS.
     16 * Simple ICS data generator
     17 * @package phpmailer
     18 * @subpackage easypeasyics
     19 */
     20class EasyPeasyICS
     21{
     22    /**
     23     * The name of the calendar
     24     * @var string
     25     */
     26    protected $calendarName;
     27    /**
     28     * The array of events to add to this calendar
     29     * @var array
     30     */
     31    protected $events = array();
     32
     33    /**
     34     * Constructor
     35     * @param string $calendarName
     36     */
     37    public function __construct($calendarName = "")
     38    {
     39        $this->calendarName = $calendarName;
     40    }
     41
     42    /**
     43     * Add an event to this calendar.
     44     * @param string $start The start date and time as a unix timestamp
     45     * @param string $end The end date and time as a unix timestamp
     46     * @param string $summary A summary or title for the event
     47     * @param string $description A description of the event
     48     * @param string $url A URL for the event
     49     * @param string $uid A unique identifier for the event - generated automatically if not provided
     50     * @return array An array of event details, including any generated UID
     51     */
     52    public function addEvent($start, $end, $summary = '', $description = '', $url = '', $uid = '')
     53    {
     54        if (empty($uid)) {
     55            $uid = md5(uniqid(mt_rand(), true)) . '@EasyPeasyICS';
     56        }
     57        $event = array(
     58            'start' => gmdate('Ymd', $start) . 'T' . gmdate('His', $start) . 'Z',
     59            'end' => gmdate('Ymd', $end) . 'T' . gmdate('His', $end) . 'Z',
     60            'summary' => $summary,
     61            'description' => $description,
     62            'url' => $url,
     63            'uid' => $uid
     64        );
     65        $this->events[] = $event;
     66        return $event;
     67    }
     68
     69    /**
     70     * @return array Get the array of events.
     71     */
     72    public function getEvents()
     73    {
     74        return $this->events;
     75    }
     76
     77    /**
     78     * Clear all events.
     79     */
     80    public function clearEvents()
     81    {
     82        $this->events = array();
     83    }
     84
     85    /**
     86     * Get the name of the calendar.
     87     * @return string
     88     */
     89    public function getName()
     90    {
     91        return $this->calendarName;
     92    }
     93
     94    /**
     95     * Set the name of the calendar.
     96     * @param $name
     97     */
     98    public function setName($name)
     99    {
     100        $this->calendarName = $name;
     101    }
     102
     103    /**
     104     * Render and optionally output a vcal string.
     105     * @param bool $output Whether to output the calendar data directly (the default).
     106     * @return string The complete rendered vlal
     107     */
     108    public function render($output = true)
     109    {
     110        //Add header
     111        $ics = 'BEGIN:VCALENDAR
     112METHOD:PUBLISH
     113VERSION:2.0
     114X-WR-CALNAME:' . $this->calendarName . '
     115PRODID:-//hacksw/handcal//NONSGML v1.0//EN';
     116
     117        //Add events
     118        foreach ($this->events as $event) {
     119            $ics .= '
     120BEGIN:VEVENT
     121UID:' . $event['uid'] . '
     122DTSTAMP:' . gmdate('Ymd') . 'T' . gmdate('His') . 'Z
     123DTSTART:' . $event['start'] . '
     124DTEND:' . $event['end'] . '
     125SUMMARY:' . str_replace("\n", "\\n", $event['summary']) . '
     126DESCRIPTION:' . str_replace("\n", "\\n", $event['description']) . '
     127URL;VALUE=URI:' . $event['url'] . '
     128END:VEVENT';
     129        }
     130
     131        //Add footer
     132        $ics .= '
     133END:VCALENDAR';
     134
     135        if ($output) {
     136            //Output
     137            $filename = $this->calendarName;
     138            //Filename needs quoting if it contains spaces
     139            if (strpos($filename, ' ') !== false) {
     140                $filename = '"'.$filename.'"';
     141            }
     142            header('Content-type: text/calendar; charset=utf-8');
     143            header('Content-Disposition: inline; filename=' . $filename . '.ics');
     144            echo $ics;
     145        }
     146        return $ics;
     147    }
     148}
  • new file wp-includes/PHPMailer/extras/README.md

    diff --git wp-includes/PHPMailer/extras/README.md wp-includes/PHPMailer/extras/README.md
    new file mode 100644
    index 0000000..dac79e0
    - +  
     1#PHPMailer Extras
     2
     3These classes provide optional additional functions to PHPMailer.
     4
     5These are not loaded by the PHPMailer autoloader, so in some cases you may need to `require` them yourself before using them.
     6
     7##EasyPeasyICS
     8
     9This class was originally written by Manuel Reinhard and provides a simple means of generating ICS/vCal files that are used in sending calendar events. PHPMailer does not use it directly, but you can use it to generate content appropriate for placing in the `Ical` property of PHPMailer. The PHPMailer project is now its official home as Manuel has given permission for that and is no longer maintaining it himself.
     10
     11##htmlfilter
     12
     13This class by Konstantin Riabitsev and Jim Jagielski implements HTML filtering to remove potentially malicious tags, such as `<script>` or `onclick=` attributes that can result in XSS attacks. This is a simple filter and is not as comprehensive as [HTMLawed](http://www.bioinformatics.org/phplabware/internal_utilities/htmLawed/) or [HTMLPurifier](http://htmlpurifier.org), but it's easier to use and considerably better than nothing! PHPMailer does not use it directly, but you may want to apply it to user-supplied HTML before using it as a message body.
     14
     15##NTLM_SASL_client
     16
     17This class by Manuel Lemos (bundled with permission) adds the ability to authenticate with Microsoft Windows mail servers that use NTLM-based authentication. It is used by PHPMailer if you send via SMTP and set the `AuthType` property to `NTLM`; you will also need to use the `Realm` and `Workstation` properties. The original source is [here](http://www.phpclasses.org/browse/file/7495.html).
  • new file wp-includes/PHPMailer/extras/htmlfilter.php

    diff --git wp-includes/PHPMailer/extras/htmlfilter.php wp-includes/PHPMailer/extras/htmlfilter.php
    new file mode 100644
    index 0000000..a86ef57
    - +  
     1<?php
     2/**
     3 * htmlfilter.inc
     4 * ---------------
     5 * This set of functions allows you to filter html in order to remove
     6 * any malicious tags from it. Useful in cases when you need to filter
     7 * user input for any cross-site-scripting attempts.
     8 *
     9 * Copyright (C) 2002-2004 by Duke University
     10 *
     11 * This library is free software; you can redistribute it and/or
     12 * modify it under the terms of the GNU Lesser General Public
     13 * License as published by the Free Software Foundation; either
     14 * version 2.1 of the License, or (at your option) any later version.
     15 *
     16 * This library is distributed in the hope that it will be useful,
     17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
     18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
     19 * Lesser General Public License for more details.
     20 *
     21 * You should have received a copy of the GNU Lesser General Public
     22 * License along with this library; if not, write to the Free Software
     23 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
     24 * 02110-1301  USA
     25 *
     26 * @Author      Konstantin Riabitsev <icon@linux.duke.edu>
     27 * @Author  Jim Jagielski <jim@jaguNET.com / jimjag@gmail.com>
     28 * @Version 1.1 ($Date$)
     29 */
     30
     31/**
     32 * This function returns the final tag out of the tag name, an array
     33 * of attributes, and the type of the tag. This function is called by
     34 * tln_sanitize internally.
     35 *
     36 * @param string $tagname the name of the tag.
     37 * @param array $attary the array of attributes and their values
     38 * @param integer $tagtype The type of the tag (see in comments).
     39 * @return string A string with the final tag representation.
     40 */
     41function tln_tagprint($tagname, $attary, $tagtype)
     42{
     43    if ($tagtype == 2) {
     44        $fulltag = '</' . $tagname . '>';
     45    } else {
     46        $fulltag = '<' . $tagname;
     47        if (is_array($attary) && sizeof($attary)) {
     48            $atts = array();
     49            while (list($attname, $attvalue) = each($attary)) {
     50                array_push($atts, "$attname=$attvalue");
     51            }
     52            $fulltag .= ' ' . join(' ', $atts);
     53        }
     54        if ($tagtype == 3) {
     55            $fulltag .= ' /';
     56        }
     57        $fulltag .= '>';
     58    }
     59    return $fulltag;
     60}
     61
     62/**
     63 * A small helper function to use with array_walk. Modifies a by-ref
     64 * value and makes it lowercase.
     65 *
     66 * @param string $val a value passed by-ref.
     67 * @return              void since it modifies a by-ref value.
     68 */
     69function tln_casenormalize(&$val)
     70{
     71    $val = strtolower($val);
     72}
     73
     74/**
     75 * This function skips any whitespace from the current position within
     76 * a string and to the next non-whitespace value.
     77 *
     78 * @param string $body the string
     79 * @param integer $offset the offset within the string where we should start
     80 *                                 looking for the next non-whitespace character.
     81 * @return integer          the location within the $body where the next
     82 *                                 non-whitespace char is located.
     83 */
     84function tln_skipspace($body, $offset)
     85{
     86    preg_match('/^(\s*)/s', substr($body, $offset), $matches);
     87    if (sizeof($matches[1])) {
     88        $count = strlen($matches[1]);
     89        $offset += $count;
     90    }
     91    return $offset;
     92}
     93
     94/**
     95 * This function looks for the next character within a string.  It's
     96 * really just a glorified "strpos", except it catches the failures
     97 * nicely.
     98 *
     99 * @param string $body   The string to look for needle in.
     100 * @param integer $offset Start looking from this position.
     101 * @param string $needle The character/string to look for.
     102 * @return integer           location of the next occurrence of the needle, or
     103 *                                 strlen($body) if needle wasn't found.
     104 */
     105function tln_findnxstr($body, $offset, $needle)
     106{
     107    $pos = strpos($body, $needle, $offset);
     108    if ($pos === false) {
     109        $pos = strlen($body);
     110    }
     111    return $pos;
     112}
     113
     114/**
     115 * This function takes a PCRE-style regexp and tries to match it
     116 * within the string.
     117 *
     118 * @param string $body   The string to look for needle in.
     119 * @param integer $offset Start looking from here.
     120 * @param string $reg       A PCRE-style regex to match.
     121 * @return array|boolean  Returns a false if no matches found, or an array
     122 *                                 with the following members:
     123 *                                 - integer with the location of the match within $body
     124 *                                 - string with whatever content between offset and the match
     125 *                                 - string with whatever it is we matched
     126 */
     127function tln_findnxreg($body, $offset, $reg)
     128{
     129    $matches = array();
     130    $retarr = array();
     131    $preg_rule = '%^(.*?)(' . $reg . ')%s';
     132    preg_match($preg_rule, substr($body, $offset), $matches);
     133    if (!isset($matches[0]) || !$matches[0]) {
     134        $retarr = false;
     135    } else {
     136        $retarr[0] = $offset + strlen($matches[1]);
     137        $retarr[1] = $matches[1];
     138        $retarr[2] = $matches[2];
     139    }
     140    return $retarr;
     141}
     142
     143/**
     144 * This function looks for the next tag.
     145 *
     146 * @param string $body   String where to look for the next tag.
     147 * @param integer $offset Start looking from here.
     148 * @return array|boolean false if no more tags exist in the body, or
     149 *                                 an array with the following members:
     150 *                                 - string with the name of the tag
     151 *                                 - array with attributes and their values
     152 *                                 - integer with tag type (1, 2, or 3)
     153 *                                 - integer where the tag starts (starting "<")
     154 *                                 - integer where the tag ends (ending ">")
     155 *                                 first three members will be false, if the tag is invalid.
     156 */
     157function tln_getnxtag($body, $offset)
     158{
     159    if ($offset > strlen($body)) {
     160        return false;
     161    }
     162    $lt = tln_findnxstr($body, $offset, '<');
     163    if ($lt == strlen($body)) {
     164        return false;
     165    }
     166    /**
     167     * We are here:
     168     * blah blah <tag attribute="value">
     169     * \---------^
     170     */
     171    $pos = tln_skipspace($body, $lt + 1);
     172    if ($pos >= strlen($body)) {
     173        return array(false, false, false, $lt, strlen($body));
     174    }
     175    /**
     176     * There are 3 kinds of tags:
     177     * 1. Opening tag, e.g.:
     178     *    <a href="blah">
     179     * 2. Closing tag, e.g.:
     180     *    </a>
     181     * 3. XHTML-style content-less tag, e.g.:
     182     *    <img src="blah"/>
     183     */
     184    switch (substr($body, $pos, 1)) {
     185    case '/':
     186        $tagtype = 2;
     187        $pos++;
     188        break;
     189    case '!':
     190        /**
     191         * A comment or an SGML declaration.
     192         */
     193            if (substr($body, $pos + 1, 2) == '--') {
     194            $gt = strpos($body, '-->', $pos);
     195            if ($gt === false) {
     196                $gt = strlen($body);
     197            } else {
     198                $gt += 2;
     199            }
     200            return array(false, false, false, $lt, $gt);
     201        } else {
     202            $gt = tln_findnxstr($body, $pos, '>');
     203            return array(false, false, false, $lt, $gt);
     204        }
     205        break;
     206    default:
     207        /**
     208         * Assume tagtype 1 for now. If it's type 3, we'll switch values
     209         * later.
     210         */
     211        $tagtype = 1;
     212        break;
     213    }
     214
     215    /**
     216     * Look for next [\W-_], which will indicate the end of the tag name.
     217     */
     218    $regary = tln_findnxreg($body, $pos, '[^\w\-_]');
     219    if ($regary == false) {
     220        return array(false, false, false, $lt, strlen($body));
     221    }
     222    list($pos, $tagname, $match) = $regary;
     223    $tagname = strtolower($tagname);
     224
     225    /**
     226     * $match can be either of these:
     227     * '>'      indicating the end of the tag entirely.
     228     * '\s' indicating the end of the tag name.
     229     * '/'      indicating that this is type-3 xhtml tag.
     230     *
     231     * Whatever else we find there indicates an invalid tag.
     232     */
     233    switch ($match) {
     234    case '/':
     235        /**
     236         * This is an xhtml-style tag with a closing / at the
     237         * end, like so: <img src="blah"/>. Check if it's followed
     238         * by the closing bracket. If not, then this tag is invalid
     239         */
     240        if (substr($body, $pos, 2) == '/>') {
     241            $pos++;
     242            $tagtype = 3;
     243        } else {
     244            $gt = tln_findnxstr($body, $pos, '>');
     245            $retary = array(false, false, false, $lt, $gt);
     246            return $retary;
     247        }
     248            //intentional fall-through
     249    case '>':
     250        return array($tagname, false, $tagtype, $lt, $pos);
     251        break;
     252    default:
     253        /**
     254         * Check if it's whitespace
     255         */
     256        if (!preg_match('/\s/', $match)) {
     257            /**
     258             * This is an invalid tag! Look for the next closing ">".
     259             */
     260            $gt = tln_findnxstr($body, $lt, '>');
     261            return array(false, false, false, $lt, $gt);
     262        }
     263        break;
     264    }
     265
     266    /**
     267     * At this point we're here:
     268     * <tagname  attribute='blah'>
     269     * \-------^
     270     *
     271     * At this point we loop in order to find all attributes.
     272     */
     273    $attary = array();
     274
     275    while ($pos <= strlen($body)) {
     276        $pos = tln_skipspace($body, $pos);
     277        if ($pos == strlen($body)) {
     278            /**
     279             * Non-closed tag.
     280             */
     281            return array(false, false, false, $lt, $pos);
     282        }
     283        /**
     284         * See if we arrived at a ">" or "/>", which means that we reached
     285         * the end of the tag.
     286         */
     287        $matches = array();
     288        if (preg_match('%^(\s*)(>|/>)%s', substr($body, $pos), $matches)) {
     289            /**
     290             * Yep. So we did.
     291             */
     292            $pos += strlen($matches[1]);
     293            if ($matches[2] == '/>') {
     294                $tagtype = 3;
     295                $pos++;
     296            }
     297            return array($tagname, $attary, $tagtype, $lt, $pos);
     298        }
     299
     300        /**
     301         * There are several types of attributes, with optional
     302         * [:space:] between members.
     303         * Type 1:
     304         *       attrname[:space:]=[:space:]'CDATA'
     305         * Type 2:
     306         *       attrname[:space:]=[:space:]"CDATA"
     307         * Type 3:
     308         *       attr[:space:]=[:space:]CDATA
     309         * Type 4:
     310         *       attrname
     311         *
     312         * We leave types 1 and 2 the same, type 3 we check for
     313         * '"' and convert to "&quot" if needed, then wrap in
     314         * double quotes. Type 4 we convert into:
     315         * attrname="yes".
     316         */
     317        $regary = tln_findnxreg($body, $pos, '[^\w\-_]');
     318        if ($regary == false) {
     319            /**
     320             * Looks like body ended before the end of tag.
     321             */
     322            return array(false, false, false, $lt, strlen($body));
     323        }
     324        list($pos, $attname, $match) = $regary;
     325        $attname = strtolower($attname);
     326        /**
     327         * We arrived at the end of attribute name. Several things possible
     328         * here:
     329         * '>'  means the end of the tag and this is attribute type 4
     330         * '/'  if followed by '>' means the same thing as above
     331         * '\s' means a lot of things -- look what it's followed by.
     332         *              anything else means the attribute is invalid.
     333         */
     334        switch ($match) {
     335        case '/':
     336            /**
     337             * This is an xhtml-style tag with a closing / at the
     338             * end, like so: <img src="blah"/>. Check if it's followed
     339             * by the closing bracket. If not, then this tag is invalid
     340             */
     341            if (substr($body, $pos, 2) == '/>') {
     342                $pos++;
     343                $tagtype = 3;
     344            } else {
     345                $gt = tln_findnxstr($body, $pos, '>');
     346                $retary = array(false, false, false, $lt, $gt);
     347                return $retary;
     348            }
     349                //intentional fall-through
     350        case '>':
     351            $attary{$attname} = '"yes"';
     352            return array($tagname, $attary, $tagtype, $lt, $pos);
     353            break;
     354        default:
     355            /**
     356             * Skip whitespace and see what we arrive at.
     357             */
     358            $pos = tln_skipspace($body, $pos);
     359            $char = substr($body, $pos, 1);
     360            /**
     361             * Two things are valid here:
     362             * '=' means this is attribute type 1 2 or 3.
     363             * \w means this was attribute type 4.
     364             * anything else we ignore and re-loop. End of tag and
     365             * invalid stuff will be caught by our checks at the beginning
     366             * of the loop.
     367             */
     368            if ($char == '=') {
     369                $pos++;
     370                $pos = tln_skipspace($body, $pos);
     371                /**
     372                 * Here are 3 possibilities:
     373                 * "'"  attribute type 1
     374                 * '"'  attribute type 2
     375                 * everything else is the content of tag type 3
     376                 */
     377                $quot = substr($body, $pos, 1);
     378                if ($quot == '\'') {
     379                        $regary = tln_findnxreg($body, $pos + 1, '\'');
     380                    if ($regary == false) {
     381                        return array(false, false, false, $lt, strlen($body));
     382                    }
     383                    list($pos, $attval, $match) = $regary;
     384                    $pos++;
     385                    $attary{$attname} = '\'' . $attval . '\'';
     386                } elseif ($quot == '"') {
     387                    $regary = tln_findnxreg($body, $pos + 1, '\"');
     388                    if ($regary == false) {
     389                        return array(false, false, false, $lt, strlen($body));
     390                    }
     391                    list($pos, $attval, $match) = $regary;
     392                    $pos++;
     393                            $attary{$attname} = '"' . $attval . '"';
     394                } else {
     395                    /**
     396                     * These are hateful. Look for \s, or >.
     397                     */
     398                    $regary = tln_findnxreg($body, $pos, '[\s>]');
     399                    if ($regary == false) {
     400                        return array(false, false, false, $lt, strlen($body));
     401                    }
     402                    list($pos, $attval, $match) = $regary;
     403                    /**
     404                     * If it's ">" it will be caught at the top.
     405                     */
     406                    $attval = preg_replace('/\"/s', '&quot;', $attval);
     407                    $attary{$attname} = '"' . $attval . '"';
     408                }
     409            } elseif (preg_match('|[\w/>]|', $char)) {
     410                /**
     411                 * That was attribute type 4.
     412                 */
     413                $attary{$attname} = '"yes"';
     414            } else {
     415                /**
     416                 * An illegal character. Find next '>' and return.
     417                 */
     418                $gt = tln_findnxstr($body, $pos, '>');
     419                return array(false, false, false, $lt, $gt);
     420            }
     421            break;
     422        }
     423    }
     424    /**
     425     * The fact that we got here indicates that the tag end was never
     426     * found. Return invalid tag indication so it gets stripped.
     427     */
     428    return array(false, false, false, $lt, strlen($body));
     429}
     430
     431/**
     432 * Translates entities into literal values so they can be checked.
     433 *
     434 * @param string $attvalue the by-ref value to check.
     435 * @param string $regex    the regular expression to check against.
     436 * @param boolean $hex        whether the entities are hexadecimal.
     437 * @return boolean            True or False depending on whether there were matches.
     438 */
     439function tln_deent(&$attvalue, $regex, $hex = false)
     440{
     441    preg_match_all($regex, $attvalue, $matches);
     442    if (is_array($matches) && sizeof($matches[0]) > 0) {
     443        $repl = array();
     444        for ($i = 0; $i < sizeof($matches[0]); $i++) {
     445            $numval = $matches[1][$i];
     446            if ($hex) {
     447                $numval = hexdec($numval);
     448            }
     449            $repl{$matches[0][$i]} = chr($numval);
     450        }
     451        $attvalue = strtr($attvalue, $repl);
     452        return true;
     453    } else {
     454        return false;
     455    }
     456}
     457
     458/**
     459 * This function checks attribute values for entity-encoded values
     460 * and returns them translated into 8-bit strings so we can run
     461 * checks on them.
     462 *
     463 * @param string $attvalue A string to run entity check against.
     464 */
     465function tln_defang(&$attvalue)
     466{
     467    /**
     468     * Skip this if there aren't ampersands or backslashes.
     469     */
     470    if (strpos($attvalue, '&') === false
     471        && strpos($attvalue, '\\') === false
     472    ) {
     473        return;
     474    }
     475    do {
     476        $m = false;
     477        $m = $m || tln_deent($attvalue, '/\&#0*(\d+);*/s');
     478        $m = $m || tln_deent($attvalue, '/\&#x0*((\d|[a-f])+);*/si', true);
     479        $m = $m || tln_deent($attvalue, '/\\\\(\d+)/s', true);
     480    } while ($m == true);
     481    $attvalue = stripslashes($attvalue);
     482}
     483
     484/**
     485 * Kill any tabs, newlines, or carriage returns. Our friends the
     486 * makers of the browser with 95% market value decided that it'd
     487 * be funny to make "java[tab]script" be just as good as "javascript".
     488 *
     489 * @param string $attvalue     The attribute value before extraneous spaces removed.
     490 */
     491function tln_unspace(&$attvalue)
     492{
     493    if (strcspn($attvalue, "\t\r\n\0 ") != strlen($attvalue)) {
     494        $attvalue = str_replace(
     495            array("\t", "\r", "\n", "\0", " "),
     496            array('', '', '', '', ''),
     497            $attvalue
     498        );
     499    }
     500}
     501
     502/**
     503 * This function runs various checks against the attributes.
     504 *
     505 * @param string $tagname            String with the name of the tag.
     506 * @param array $attary            Array with all tag attributes.
     507 * @param array $rm_attnames        See description for tln_sanitize
     508 * @param array $bad_attvals        See description for tln_sanitize
     509 * @param array $add_attr_to_tag See description for tln_sanitize
     510 * @param string $trans_image_path
     511 * @param boolean $block_external_images
     512 * @return array with modified attributes.
     513 */
     514function tln_fixatts(
     515    $tagname,
     516    $attary,
     517    $rm_attnames,
     518    $bad_attvals,
     519    $add_attr_to_tag,
     520    $trans_image_path,
     521    $block_external_images
     522) {
     523    while (list($attname, $attvalue) = each($attary)) {
     524        /**
     525         * See if this attribute should be removed.
     526         */
     527        foreach ($rm_attnames as $matchtag => $matchattrs) {
     528            if (preg_match($matchtag, $tagname)) {
     529                foreach ($matchattrs as $matchattr) {
     530                    if (preg_match($matchattr, $attname)) {
     531                        unset($attary{$attname});
     532                        continue;
     533                    }
     534                }
     535            }
     536        }
     537        /**
     538         * Remove any backslashes, entities, or extraneous whitespace.
     539         */
     540        $oldattvalue = $attvalue;
     541        tln_defang($attvalue);
     542        if ($attname == 'style' && $attvalue !== $oldattvalue) {
     543            $attvalue = "idiocy";
     544            $attary{$attname} = $attvalue;
     545        }
     546        tln_unspace($attvalue);
     547
     548        /**
     549         * Now let's run checks on the attvalues.
     550         * I don't expect anyone to comprehend this. If you do,
     551         * get in touch with me so I can drive to where you live and
     552         * shake your hand personally. :)
     553         */
     554        foreach ($bad_attvals as $matchtag => $matchattrs) {
     555            if (preg_match($matchtag, $tagname)) {
     556                foreach ($matchattrs as $matchattr => $valary) {
     557                    if (preg_match($matchattr, $attname)) {
     558                        /**
     559                         * There are two arrays in valary.
     560                         * First is matches.
     561                         * Second one is replacements
     562                         */
     563                        list($valmatch, $valrepl) = $valary;
     564                        $newvalue = preg_replace($valmatch, $valrepl, $attvalue);
     565                        if ($newvalue != $attvalue) {
     566                            $attary{$attname} = $newvalue;
     567                            $attvalue = $newvalue;
     568                        }
     569                    }
     570                }
     571            }
     572        }
     573        if ($attname == 'style') {
     574            if (preg_match('/[\0-\37\200-\377]+/', $attvalue)) {
     575                $attary{$attname} = '"disallowed character"';
     576            }
     577            preg_match_all("/url\s*\((.+)\)/si", $attvalue, $aMatch);
     578            if (count($aMatch)) {
     579                foreach($aMatch[1] as $sMatch) {
     580                    $urlvalue = $sMatch;
     581                    tln_fixurl($attname, $urlvalue, $trans_image_path, $block_external_images);
     582                    $attary{$attname} = str_replace($sMatch, $urlvalue, $attvalue);
     583                }
     584            }
     585        }
     586     }
     587    /**
     588     * See if we need to append any attributes to this tag.
     589     */
     590    foreach ($add_attr_to_tag as $matchtag => $addattary) {
     591        if (preg_match($matchtag, $tagname)) {
     592            $attary = array_merge($attary, $addattary);
     593        }
     594    }
     595    return $attary;
     596}
     597
     598function tln_fixurl($attname, &$attvalue, $trans_image_path, $block_external_images)
     599{
     600    $sQuote = '"';
     601    $attvalue = trim($attvalue);
     602    if ($attvalue && ($attvalue[0] =='"'|| $attvalue[0] == "'")) {
     603        // remove the double quotes
     604        $sQuote = $attvalue[0];
     605        $attvalue = trim(substr($attvalue,1,-1));
     606    }
     607
     608    /**
     609     * Replace empty src tags with the blank image.  src is only used
     610     * for frames, images, and image inputs.  Doing a replace should
     611     * not affect them working as should be, however it will stop
     612     * IE from being kicked off when src for img tags are not set
     613     */
     614    if ($attvalue == '') {
     615        $attvalue = $sQuote . $trans_image_path . $sQuote;
     616    } else {
     617        // first, disallow 8 bit characters and control characters
     618        if (preg_match('/[\0-\37\200-\377]+/',$attvalue)) {
     619            switch ($attname) {
     620                case 'href':
     621                    $attvalue = $sQuote . 'http://invalid-stuff-detected.example.com' . $sQuote;
     622                    break;
     623                default:
     624                    $attvalue = $sQuote . $trans_image_path . $sQuote;
     625                    break;
     626            }
     627        } else {
     628            $aUrl = parse_url($attvalue);
     629            if (isset($aUrl['scheme'])) {
     630                switch(strtolower($aUrl['scheme'])) {
     631                    case 'mailto':
     632                    case 'http':
     633                    case 'https':
     634                    case 'ftp':
     635                        if ($attname != 'href') {
     636                            if ($block_external_images == true) {
     637                                $attvalue = $sQuote . $trans_image_path . $sQuote;
     638                            } else {
     639                                if (!isset($aUrl['path'])) {
     640                                    $attvalue = $sQuote . $trans_image_path . $sQuote;
     641                                }
     642                            }
     643                        } else {
     644                            $attvalue = $sQuote . $attvalue . $sQuote;
     645                        }
     646                        break;
     647                    case 'outbind':
     648                        $attvalue = $sQuote . $attvalue . $sQuote;
     649                        break;
     650                    case 'cid':
     651                        $attvalue = $sQuote . $attvalue . $sQuote;
     652                        break;
     653                    default:
     654                        $attvalue = $sQuote . $trans_image_path . $sQuote;
     655                        break;
     656                }
     657            } else {
     658                if (!isset($aUrl['path']) || $aUrl['path'] != $trans_image_path) {
     659                    $$attvalue = $sQuote . $trans_image_path . $sQuote;
     660                }
     661            }
     662        }
     663    }
     664}
     665
     666function tln_fixstyle($body, $pos, $trans_image_path, $block_external_images)
     667{
     668    // workaround for </style> in between comments
     669    $content = '';
     670    $sToken = '';
     671    $bSucces = false;
     672    $bEndTag = false;
     673    for ($i=$pos,$iCount=strlen($body);$i<$iCount;++$i) {
     674        $char = $body{$i};
     675        switch ($char) {
     676            case '<':
     677                $sToken = $char;
     678                break;
     679            case '/':
     680                 if ($sToken == '<') {
     681                    $sToken .= $char;
     682                    $bEndTag = true;
     683                 } else {
     684                    $content .= $char;
     685                 }
     686                 break;
     687            case '>':
     688                 if ($bEndTag) {
     689                    $sToken .= $char;
     690                    if (preg_match('/\<\/\s*style\s*\>/i',$sToken,$aMatch)) {
     691                        $newpos = $i + 1;
     692                        $bSucces = true;
     693                        break 2;
     694                    } else {
     695                        $content .= $sToken;
     696                    }
     697                    $bEndTag = false;
     698                 } else {
     699                    $content .= $char;
     700                 }
     701                 break;
     702            case '!':
     703                if ($sToken == '<') {
     704                    // possible comment
     705                    if (isset($body{$i+2}) && substr($body,$i,3) == '!--') {
     706                        $i = strpos($body,'-->',$i+3);
     707                        if ($i === false) { // no end comment
     708                            $i = strlen($body);
     709                        }
     710                        $sToken = '';
     711                    }
     712                } else {
     713                    $content .= $char;
     714                }
     715                break;
     716            default:
     717                if ($bEndTag) {
     718                    $sToken .= $char;
     719                } else {
     720                    $content .= $char;
     721                }
     722                break;
     723        }
     724    }
     725    if ($bSucces == FALSE){
     726        return array(FALSE, strlen($body));
     727    }
     728
     729
     730
     731    /**
     732     * First look for general BODY style declaration, which would be
     733     * like so:
     734     * body {background: blah-blah}
     735     * and change it to .bodyclass so we can just assign it to a <div>
     736     */
     737    $content = preg_replace("|body(\s*\{.*?\})|si", ".bodyclass\\1", $content);
     738
     739    /**
     740    * Fix url('blah') declarations.
     741    */
     742    //   $content = preg_replace("|url\s*\(\s*([\'\"])\s*\S+script\s*:.*?([\'\"])\s*\)|si",
     743    //                           "url(\\1$trans_image_path\\2)", $content);
     744
     745    // first check for 8bit sequences and disallowed control characters
     746    if (preg_match('/[\16-\37\200-\377]+/',$content)) {
     747        $content = '<!-- style block removed by html filter due to presence of 8bit characters -->';
     748        return array($content, $newpos);
     749    }
     750
     751    // remove @import line
     752    $content = preg_replace("/^\s*(@import.*)$/mi","\n<!-- @import rules forbidden -->\n",$content);
     753
     754    $content = preg_replace("/(\\\\)?u(\\\\)?r(\\\\)?l(\\\\)?/i", 'url', $content);
     755    preg_match_all("/url\s*\((.+)\)/si",$content,$aMatch);
     756    if (count($aMatch)) {
     757        $aValue = $aReplace = array();
     758        foreach($aMatch[1] as $sMatch) {
     759            // url value
     760            $urlvalue = $sMatch;
     761            tln_fixurl('style',$urlvalue, $trans_image_path, $block_external_images);
     762            $aValue[] = $sMatch;
     763            $aReplace[] = $urlvalue;
     764        }
     765        $content = str_replace($aValue,$aReplace,$content);
     766    }
     767
     768    /**
     769     * Remove any backslashes, entities, and extraneous whitespace.
     770     */
     771    $contentTemp = $content;
     772    tln_defang($contentTemp);
     773    tln_unspace($contentTemp);
     774
     775    $match   = array('/\/\*.*\*\//',
     776                    '/expression/i',
     777                    '/behaviou*r/i',
     778                    '/binding/i',
     779                    '/include-source/i',
     780                    '/javascript/i',
     781                    '/script/i',
     782                    '/position/i');
     783    $replace = array('','idiocy', 'idiocy', 'idiocy', 'idiocy', 'idiocy', 'idiocy', '');
     784    $contentNew = preg_replace($match, $replace, $contentTemp);
     785    if ($contentNew !== $contentTemp) {
     786        $content = $contentNew;
     787    }
     788    return array($content, $newpos);
     789}
     790
     791function tln_body2div($attary, $trans_image_path)
     792{
     793    $divattary = array('class' => "'bodyclass'");
     794    $text = '#000000';
     795    $has_bgc_stl = $has_txt_stl = false;
     796    $styledef = '';
     797    if (is_array($attary) && sizeof($attary) > 0){
     798        foreach ($attary as $attname=>$attvalue){
     799            $quotchar = substr($attvalue, 0, 1);
     800            $attvalue = str_replace($quotchar, "", $attvalue);
     801            switch ($attname){
     802                case 'background':
     803                    $styledef .= "background-image: url('$trans_image_path'); ";
     804                    break;
     805                case 'bgcolor':
     806                    $has_bgc_stl = true;
     807                    $styledef .= "background-color: $attvalue; ";
     808                    break;
     809                case 'text':
     810                    $has_txt_stl = true;
     811                    $styledef .= "color: $attvalue; ";
     812                    break;
     813            }
     814        }
     815        // Outlook defines a white bgcolor and no text color. This can lead to
     816        // white text on a white bg with certain themes.
     817        if ($has_bgc_stl && !$has_txt_stl) {
     818            $styledef .= "color: $text; ";
     819        }
     820        if (strlen($styledef) > 0){
     821            $divattary{"style"} = "\"$styledef\"";
     822        }
     823    }
     824    return $divattary;
     825}
     826
     827/**
     828 *
     829 * @param string $body                    The HTML you wish to filter
     830 * @param array $tag_list                see description above
     831 * @param array $rm_tags_with_content see description above
     832 * @param array $self_closing_tags    see description above
     833 * @param boolean $force_tag_closing    see description above
     834 * @param array $rm_attnames            see description above
     835 * @param array $bad_attvals            see description above
     836 * @param array $add_attr_to_tag        see description above
     837 * @param string $trans_image_path
     838 * @param boolean $block_external_images
     839
     840 * @return string                       Sanitized html safe to show on your pages.
     841 */
     842function tln_sanitize(
     843    $body,
     844    $tag_list,
     845    $rm_tags_with_content,
     846    $self_closing_tags,
     847    $force_tag_closing,
     848    $rm_attnames,
     849    $bad_attvals,
     850    $add_attr_to_tag,
     851    $trans_image_path,
     852    $block_external_images
     853) {
     854    /**
     855     * Normalize rm_tags and rm_tags_with_content.
     856     */
     857    $rm_tags = array_shift($tag_list);
     858    @array_walk($tag_list, 'tln_casenormalize');
     859    @array_walk($rm_tags_with_content, 'tln_casenormalize');
     860    @array_walk($self_closing_tags, 'tln_casenormalize');
     861    /**
     862     * See if tag_list is of tags to remove or tags to allow.
     863     * false  means remove these tags
     864     * true       means allow these tags
     865     */
     866    $curpos = 0;
     867    $open_tags = array();
     868    $trusted = "<!-- begin tln_sanitized html -->\n";
     869    $skip_content = false;
     870    /**
     871     * Take care of netscape's stupid javascript entities like
     872     * &{alert('boo')};
     873     */
     874    $body = preg_replace('/&(\{.*?\};)/si', '&amp;\\1', $body);
     875    while (($curtag = tln_getnxtag($body, $curpos)) != false) {
     876        list($tagname, $attary, $tagtype, $lt, $gt) = $curtag;
     877        $free_content = substr($body, $curpos, $lt-$curpos);
     878        /**
     879         * Take care of <style>
     880         */
     881        if ($tagname == "style" && $tagtype == 1){
     882            list($free_content, $curpos) =
     883                tln_fixstyle($body, $gt+1, $trans_image_path, $block_external_images);
     884            if ($free_content != FALSE){
     885                if ( !empty($attary) ) {
     886                    $attary = tln_fixatts($tagname,
     887                                         $attary,
     888                                         $rm_attnames,
     889                                         $bad_attvals,
     890                                         $add_attr_to_tag,
     891                                         $trans_image_path,
     892                                         $block_external_images
     893                                         );
     894                }
     895                $trusted .= tln_tagprint($tagname, $attary, $tagtype);
     896                $trusted .= $free_content;
     897                $trusted .= tln_tagprint($tagname, null, 2);
     898            }
     899            continue;
     900        }
     901        if ($skip_content == false){
     902            $trusted .= $free_content;
     903        }
     904        if ($tagname != false) {
     905            if ($tagtype == 2) {
     906                if ($skip_content == $tagname) {
     907                    /**
     908                     * Got to the end of tag we needed to remove.
     909                     */
     910                    $tagname = false;
     911                    $skip_content = false;
     912                } else {
     913                    if ($skip_content == false) {
     914                        if ($tagname == "body") {
     915                            $tagname = "div";
     916                        }
     917                        if (isset($open_tags{$tagname}) &&
     918                            $open_tags{$tagname} > 0
     919                        ) {
     920                            $open_tags{$tagname}--;
     921                        } else {
     922                            $tagname = false;
     923                        }
     924                    }
     925                }
     926            } else {
     927                /**
     928                 * $rm_tags_with_content
     929                 */
     930                if ($skip_content == false) {
     931                    /**
     932                     * See if this is a self-closing type and change
     933                     * tagtype appropriately.
     934                     */
     935                    if ($tagtype == 1
     936                        && in_array($tagname, $self_closing_tags)
     937                    ) {
     938                        $tagtype = 3;
     939                    }
     940                    /**
     941                     * See if we should skip this tag and any content
     942                     * inside it.
     943                     */
     944                    if ($tagtype == 1
     945                        && in_array($tagname, $rm_tags_with_content)
     946                    ) {
     947                        $skip_content = $tagname;
     948                    } else {
     949                        if (($rm_tags == false
     950                             && in_array($tagname, $tag_list)) ||
     951                            ($rm_tags == true
     952                                && !in_array($tagname, $tag_list))
     953                        ) {
     954                            $tagname = false;
     955                        } else {
     956                            /**
     957                             * Convert body into div.
     958                             */
     959                            if ($tagname == "body"){
     960                                $tagname = "div";
     961                                $attary = tln_body2div($attary, $trans_image_path);
     962                            }
     963                            if ($tagtype == 1) {
     964                                if (isset($open_tags{$tagname})) {
     965                                    $open_tags{$tagname}++;
     966                                } else {
     967                                    $open_tags{$tagname} = 1;
     968                                }
     969                            }
     970                            /**
     971                             * This is where we run other checks.
     972                             */
     973                            if (is_array($attary) && sizeof($attary) > 0) {
     974                                $attary = tln_fixatts(
     975                                    $tagname,
     976                                    $attary,
     977                                    $rm_attnames,
     978                                    $bad_attvals,
     979                                    $add_attr_to_tag,
     980                                    $trans_image_path,
     981                                    $block_external_images
     982                                );
     983                            }
     984                        }
     985                    }
     986                }
     987            }
     988            if ($tagname != false && $skip_content == false) {
     989                $trusted .= tln_tagprint($tagname, $attary, $tagtype);
     990            }
     991        }
     992        $curpos = $gt + 1;
     993    }
     994    $trusted .= substr($body, $curpos, strlen($body) - $curpos);
     995    if ($force_tag_closing == true) {
     996        foreach ($open_tags as $tagname => $opentimes) {
     997            while ($opentimes > 0) {
     998                $trusted .= '</' . $tagname . '>';
     999                $opentimes--;
     1000            }
     1001        }
     1002        $trusted .= "\n";
     1003    }
     1004    $trusted .= "<!-- end tln_sanitized html -->\n";
     1005    return $trusted;
     1006}
     1007
     1008//
     1009// Use the nifty htmlfilter library
     1010//
     1011
     1012
     1013function HTMLFilter($body, $trans_image_path, $block_external_images = false)
     1014{
     1015
     1016    $tag_list = array(
     1017        false,
     1018        "object",
     1019        "meta",
     1020        "html",
     1021        "head",
     1022        "base",
     1023        "link",
     1024        "frame",
     1025        "iframe",
     1026        "plaintext",
     1027        "marquee"
     1028    );
     1029
     1030    $rm_tags_with_content = array(
     1031        "script",
     1032        "applet",
     1033        "embed",
     1034        "title",
     1035        "frameset",
     1036        "xmp",
     1037        "xml"
     1038    );
     1039
     1040    $self_closing_tags =  array(
     1041        "img",
     1042        "br",
     1043        "hr",
     1044        "input",
     1045        "outbind"
     1046    );
     1047
     1048    $force_tag_closing = true;
     1049
     1050    $rm_attnames = array(
     1051        "/.*/" =>
     1052            array(
     1053                // "/target/i",
     1054                "/^on.*/i",
     1055                "/^dynsrc/i",
     1056                "/^data.*/i",
     1057                "/^lowsrc.*/i"
     1058            )
     1059    );
     1060
     1061    $bad_attvals = array(
     1062        "/.*/" =>
     1063        array(
     1064            "/^src|background/i" =>
     1065            array(
     1066                array(
     1067                    '/^([\'"])\s*\S+script\s*:.*([\'"])/si',
     1068                    '/^([\'"])\s*mocha\s*:*.*([\'"])/si',
     1069                    '/^([\'"])\s*about\s*:.*([\'"])/si'
     1070                ),
     1071                array(
     1072                    "\\1$trans_image_path\\2",
     1073                    "\\1$trans_image_path\\2",
     1074                    "\\1$trans_image_path\\2"
     1075                )
     1076            ),
     1077            "/^href|action/i" =>
     1078            array(
     1079                array(
     1080                    '/^([\'"])\s*\S+script\s*:.*([\'"])/si',
     1081                    '/^([\'"])\s*mocha\s*:*.*([\'"])/si',
     1082                    '/^([\'"])\s*about\s*:.*([\'"])/si'
     1083                ),
     1084                array(
     1085                    "\\1#\\1",
     1086                    "\\1#\\1",
     1087                    "\\1#\\1"
     1088                )
     1089            ),
     1090            "/^style/i" =>
     1091            array(
     1092                array(
     1093                    "/\/\*.*\*\//",
     1094                    "/expression/i",
     1095                    "/binding/i",
     1096                    "/behaviou*r/i",
     1097                    "/include-source/i",
     1098                    '/position\s*:/i',
     1099                    '/(\\\\)?u(\\\\)?r(\\\\)?l(\\\\)?/i',
     1100                    '/url\s*\(\s*([\'"])\s*\S+script\s*:.*([\'"])\s*\)/si',
     1101                    '/url\s*\(\s*([\'"])\s*mocha\s*:.*([\'"])\s*\)/si',
     1102                    '/url\s*\(\s*([\'"])\s*about\s*:.*([\'"])\s*\)/si',
     1103                    '/(.*)\s*:\s*url\s*\(\s*([\'"]*)\s*\S+script\s*:.*([\'"]*)\s*\)/si'
     1104                ),
     1105                array(
     1106                    "",
     1107                    "idiocy",
     1108                    "idiocy",
     1109                    "idiocy",
     1110                    "idiocy",
     1111                    "idiocy",
     1112                    "url",
     1113                    "url(\\1#\\1)",
     1114                    "url(\\1#\\1)",
     1115                    "url(\\1#\\1)",
     1116                    "\\1:url(\\2#\\3)"
     1117                )
     1118            )
     1119        )
     1120    );
     1121
     1122    if ($block_external_images) {
     1123        array_push(
     1124            $bad_attvals{'/.*/'}{'/^src|background/i'}[0],
     1125            '/^([\'\"])\s*https*:.*([\'\"])/si'
     1126        );
     1127        array_push(
     1128            $bad_attvals{'/.*/'}{'/^src|background/i'}[1],
     1129            "\\1$trans_image_path\\1"
     1130        );
     1131        array_push(
     1132            $bad_attvals{'/.*/'}{'/^style/i'}[0],
     1133            '/url\(([\'\"])\s*https*:.*([\'\"])\)/si'
     1134        );
     1135        array_push(
     1136            $bad_attvals{'/.*/'}{'/^style/i'}[1],
     1137            "url(\\1$trans_image_path\\1)"
     1138        );
     1139    }
     1140
     1141    $add_attr_to_tag = array(
     1142        "/^a$/i" =>
     1143            array('target' => '"_blank"')
     1144    );
     1145
     1146    $trusted = tln_sanitize(
     1147        $body,
     1148        $tag_list,
     1149        $rm_tags_with_content,
     1150        $self_closing_tags,
     1151        $force_tag_closing,
     1152        $rm_attnames,
     1153        $bad_attvals,
     1154        $add_attr_to_tag,
     1155        $trans_image_path,
     1156        $block_external_images
     1157    );
     1158    return $trusted;
     1159}
  • new file wp-includes/PHPMailer/extras/ntlm_sasl_client.php

    diff --git wp-includes/PHPMailer/extras/ntlm_sasl_client.php wp-includes/PHPMailer/extras/ntlm_sasl_client.php
    new file mode 100644
    index 0000000..3fd5392
    - +  
     1<?php
     2/*
     3 * ntlm_sasl_client.php
     4 *
     5 * @(#) $Id: ntlm_sasl_client.php,v 1.3 2004/11/17 08:00:37 mlemos Exp $
     6 *
     7 */
     8
     9define("SASL_NTLM_STATE_START", 0);
     10define("SASL_NTLM_STATE_IDENTIFY_DOMAIN", 1);
     11define("SASL_NTLM_STATE_RESPOND_CHALLENGE", 2);
     12define("SASL_NTLM_STATE_DONE", 3);
     13define("SASL_FAIL", -1);
     14define("SASL_CONTINUE", 1);
     15
     16class ntlm_sasl_client_class
     17{
     18    public $credentials = array();
     19    public $state = SASL_NTLM_STATE_START;
     20
     21    public function initialize(&$client)
     22    {
     23        if (!function_exists($function = "mcrypt_encrypt")
     24            || !function_exists($function = "mhash")
     25        ) {
     26            $extensions = array(
     27                "mcrypt_encrypt" => "mcrypt",
     28                "mhash" => "mhash"
     29            );
     30            $client->error = "the extension " . $extensions[$function] .
     31                " required by the NTLM SASL client class is not available in this PHP configuration";
     32            return (0);
     33        }
     34        return (1);
     35    }
     36
     37    public function ASCIIToUnicode($ascii)
     38    {
     39        for ($unicode = "", $a = 0; $a < strlen($ascii); $a++) {
     40            $unicode .= substr($ascii, $a, 1) . chr(0);
     41        }
     42        return ($unicode);
     43    }
     44
     45    public function typeMsg1($domain, $workstation)
     46    {
     47        $domain_length = strlen($domain);
     48        $workstation_length = strlen($workstation);
     49        $workstation_offset = 32;
     50        $domain_offset = $workstation_offset + $workstation_length;
     51        return (
     52            "NTLMSSP\0" .
     53            "\x01\x00\x00\x00" .
     54            "\x07\x32\x00\x00" .
     55            pack("v", $domain_length) .
     56            pack("v", $domain_length) .
     57            pack("V", $domain_offset) .
     58            pack("v", $workstation_length) .
     59            pack("v", $workstation_length) .
     60            pack("V", $workstation_offset) .
     61            $workstation .
     62            $domain
     63        );
     64    }
     65
     66    public function NTLMResponse($challenge, $password)
     67    {
     68        $unicode = $this->ASCIIToUnicode($password);
     69        $md4 = mhash(MHASH_MD4, $unicode);
     70        $padded = $md4 . str_repeat(chr(0), 21 - strlen($md4));
     71        $iv_size = mcrypt_get_iv_size(MCRYPT_DES, MCRYPT_MODE_ECB);
     72        $iv = mcrypt_create_iv($iv_size, MCRYPT_RAND);
     73        for ($response = "", $third = 0; $third < 21; $third += 7) {
     74            for ($packed = "", $p = $third; $p < $third + 7; $p++) {
     75                $packed .= str_pad(decbin(ord(substr($padded, $p, 1))), 8, "0", STR_PAD_LEFT);
     76            }
     77            for ($key = "", $p = 0; $p < strlen($packed); $p += 7) {
     78                $s = substr($packed, $p, 7);
     79                $b = $s . ((substr_count($s, "1") % 2) ? "0" : "1");
     80                $key .= chr(bindec($b));
     81            }
     82            $ciphertext = mcrypt_encrypt(MCRYPT_DES, $key, $challenge, MCRYPT_MODE_ECB, $iv);
     83            $response .= $ciphertext;
     84        }
     85        return $response;
     86    }
     87
     88    public function typeMsg3($ntlm_response, $user, $domain, $workstation)
     89    {
     90        $domain_unicode = $this->ASCIIToUnicode($domain);
     91        $domain_length = strlen($domain_unicode);
     92        $domain_offset = 64;
     93        $user_unicode = $this->ASCIIToUnicode($user);
     94        $user_length = strlen($user_unicode);
     95        $user_offset = $domain_offset + $domain_length;
     96        $workstation_unicode = $this->ASCIIToUnicode($workstation);
     97        $workstation_length = strlen($workstation_unicode);
     98        $workstation_offset = $user_offset + $user_length;
     99        $lm = "";
     100        $lm_length = strlen($lm);
     101        $lm_offset = $workstation_offset + $workstation_length;
     102        $ntlm = $ntlm_response;
     103        $ntlm_length = strlen($ntlm);
     104        $ntlm_offset = $lm_offset + $lm_length;
     105        $session = "";
     106        $session_length = strlen($session);
     107        $session_offset = $ntlm_offset + $ntlm_length;
     108        return (
     109            "NTLMSSP\0" .
     110            "\x03\x00\x00\x00" .
     111            pack("v", $lm_length) .
     112            pack("v", $lm_length) .
     113            pack("V", $lm_offset) .
     114            pack("v", $ntlm_length) .
     115            pack("v", $ntlm_length) .
     116            pack("V", $ntlm_offset) .
     117            pack("v", $domain_length) .
     118            pack("v", $domain_length) .
     119            pack("V", $domain_offset) .
     120            pack("v", $user_length) .
     121            pack("v", $user_length) .
     122            pack("V", $user_offset) .
     123            pack("v", $workstation_length) .
     124            pack("v", $workstation_length) .
     125            pack("V", $workstation_offset) .
     126            pack("v", $session_length) .
     127            pack("v", $session_length) .
     128            pack("V", $session_offset) .
     129            "\x01\x02\x00\x00" .
     130            $domain_unicode .
     131            $user_unicode .
     132            $workstation_unicode .
     133            $lm .
     134            $ntlm
     135        );
     136    }
     137
     138    public function start(&$client, &$message, &$interactions)
     139    {
     140        if ($this->state != SASL_NTLM_STATE_START) {
     141            $client->error = "NTLM authentication state is not at the start";
     142            return (SASL_FAIL);
     143        }
     144        $this->credentials = array(
     145            "user" => "",
     146            "password" => "",
     147            "realm" => "",
     148            "workstation" => ""
     149        );
     150        $defaults = array();
     151        $status = $client->GetCredentials($this->credentials, $defaults, $interactions);
     152        if ($status == SASL_CONTINUE) {
     153            $this->state = SASL_NTLM_STATE_IDENTIFY_DOMAIN;
     154        }
     155        unset($message);
     156        return ($status);
     157    }
     158
     159    public function step(&$client, $response, &$message, &$interactions)
     160    {
     161        switch ($this->state) {
     162            case SASL_NTLM_STATE_IDENTIFY_DOMAIN:
     163                $message = $this->typeMsg1($this->credentials["realm"], $this->credentials["workstation"]);
     164                $this->state = SASL_NTLM_STATE_RESPOND_CHALLENGE;
     165                break;
     166            case SASL_NTLM_STATE_RESPOND_CHALLENGE:
     167                $ntlm_response = $this->NTLMResponse(substr($response, 24, 8), $this->credentials["password"]);
     168                $message = $this->typeMsg3(
     169                    $ntlm_response,
     170                    $this->credentials["user"],
     171                    $this->credentials["realm"],
     172                    $this->credentials["workstation"]
     173                );
     174                $this->state = SASL_NTLM_STATE_DONE;
     175                break;
     176            case SASL_NTLM_STATE_DONE:
     177                $client->error = "NTLM authentication was finished without success";
     178                return (SASL_FAIL);
     179            default:
     180                $client->error = "invalid NTLM authentication step state";
     181                return (SASL_FAIL);
     182        }
     183        return (SASL_CONTINUE);
     184    }
     185}
  • new file wp-includes/PHPMailer/get_oauth_token.php

    diff --git wp-includes/PHPMailer/get_oauth_token.php wp-includes/PHPMailer/get_oauth_token.php
    new file mode 100644
    index 0000000..2c26d0f
    - +  
     1<?php
     2/**
     3 * Get an OAuth2 token from Google.
     4 * * Install this script on your server so that it's accessible
     5 * as [https/http]://<yourdomain>/<folder>/get_oauth_token.php
     6 * e.g.: http://localhost/phpmail/get_oauth_token.php
     7 * * Ensure dependencies are installed with 'composer install'
     8 * * Set up an app in your Google developer console
     9 * * Set the script address as the app's redirect URL
     10 * If no refresh token is obtained when running this file, revoke access to your app
     11 * using link: https://accounts.google.com/b/0/IssuedAuthSubTokens and run the script again.
     12 * This script requires PHP 5.4 or later
     13 * PHP Version 5.4
     14 */
     15
     16namespace League\OAuth2\Client\Provider;
     17
     18require 'vendor/autoload.php';
     19
     20use League\OAuth2\Client\Provider\Exception\IdentityProviderException;
     21use League\OAuth2\Client\Token\AccessToken;
     22use League\OAuth2\Client\Tool\BearerAuthorizationTrait;
     23use Psr\Http\Message\ResponseInterface;
     24
     25session_start();
     26
     27//If this automatic URL doesn't work, set it yourself manually
     28$redirectUri = isset($_SERVER['HTTPS']) ? 'https://' : 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['PHP_SELF'];
     29//$redirectUri = 'http://localhost/phpmailer/get_oauth_token.php';
     30
     31//These details obtained are by setting up app in Google developer console.
     32$clientId = 'RANDOMCHARS-----duv1n2.apps.googleusercontent.com';
     33$clientSecret = 'RANDOMCHARS-----lGyjPcRtvP';
     34
     35class Google extends AbstractProvider
     36{
     37    use BearerAuthorizationTrait;
     38
     39    const ACCESS_TOKEN_RESOURCE_OWNER_ID = 'id';
     40
     41    /**
     42     * @var string If set, this will be sent to google as the "access_type" parameter.
     43     * @link https://developers.google.com/accounts/docs/OAuth2WebServer#offline
     44     */
     45    protected $accessType;
     46
     47    /**
     48     * @var string If set, this will be sent to google as the "hd" parameter.
     49     * @link https://developers.google.com/accounts/docs/OAuth2Login#hd-param
     50     */
     51    protected $hostedDomain;
     52
     53    /**
     54     * @var string If set, this will be sent to google as the "scope" parameter.
     55     * @link https://developers.google.com/gmail/api/auth/scopes
     56     */
     57    protected $scope;
     58
     59    public function getBaseAuthorizationUrl()
     60    {
     61        return 'https://accounts.google.com/o/oauth2/auth';
     62    }
     63
     64    public function getBaseAccessTokenUrl(array $params)
     65    {
     66        return 'https://accounts.google.com/o/oauth2/token';
     67    }
     68
     69    public function getResourceOwnerDetailsUrl(AccessToken $token)
     70    {
     71        return ' ';
     72    }
     73
     74    protected function getAuthorizationParameters(array $options)
     75    {
     76        if (is_array($this->scope)) {
     77            $separator = $this->getScopeSeparator();
     78            $this->scope = implode($separator, $this->scope);
     79        }
     80
     81        $params = array_merge(
     82            parent::getAuthorizationParameters($options),
     83            array_filter([
     84                'hd'          => $this->hostedDomain,
     85                'access_type' => $this->accessType,
     86                'scope'       => $this->scope,
     87                // if the user is logged in with more than one account ask which one to use for the login!
     88                'authuser'    => '-1'
     89            ])
     90        );
     91        return $params;
     92    }
     93
     94    protected function getDefaultScopes()
     95    {
     96        return [
     97            'email',
     98            'openid',
     99            'profile',
     100        ];
     101    }
     102
     103    protected function getScopeSeparator()
     104    {
     105        return ' ';
     106    }
     107
     108    protected function checkResponse(ResponseInterface $response, $data)
     109    {
     110        if (!empty($data['error'])) {
     111            $code  = 0;
     112            $error = $data['error'];
     113
     114            if (is_array($error)) {
     115                $code  = $error['code'];
     116                $error = $error['message'];
     117            }
     118
     119            throw new IdentityProviderException($error, $code, $data);
     120        }
     121    }
     122
     123    protected function createResourceOwner(array $response, AccessToken $token)
     124    {
     125        return new GoogleUser($response);
     126    }
     127}
     128
     129
     130//Set Redirect URI in Developer Console as [https/http]://<yourdomain>/<folder>/get_oauth_token.php
     131$provider = new Google(
     132    array(
     133        'clientId' => $clientId,
     134        'clientSecret' => $clientSecret,
     135        'redirectUri' => $redirectUri,
     136        'scope' => array('https://mail.google.com/'),
     137        'accessType' => 'offline'
     138    )
     139);
     140
     141if (!isset($_GET['code'])) {
     142    // If we don't have an authorization code then get one
     143    $authUrl = $provider->getAuthorizationUrl();
     144    $_SESSION['oauth2state'] = $provider->getState();
     145    header('Location: ' . $authUrl);
     146    exit;
     147// Check given state against previously stored one to mitigate CSRF attack
     148} elseif (empty($_GET['state']) || ($_GET['state'] !== $_SESSION['oauth2state'])) {
     149    unset($_SESSION['oauth2state']);
     150    exit('Invalid state');
     151} else {
     152    // Try to get an access token (using the authorization code grant)
     153    $token = $provider->getAccessToken(
     154        'authorization_code',
     155        array(
     156            'code' => $_GET['code']
     157        )
     158    );
     159
     160    // Use this to get a new access token if the old one expires
     161    echo 'Refresh Token: ' . $token->getRefreshToken();
     162}
  • new file wp-includes/PHPMailer/language/phpmailer.lang-am.php

    diff --git wp-includes/PHPMailer/language/phpmailer.lang-am.php wp-includes/PHPMailer/language/phpmailer.lang-am.php
    new file mode 100644
    index 0000000..ff2a969
    - +  
     1<?php
     2/**
     3 * Armenian PHPMailer language file: refer to English translation for definitive list
     4 * @package PHPMailer
     5 * @author Hrayr Grigoryan <hrayr@bits.am>
     6 */
     7 
     8$PHPMAILER_LANG['authenticate']         = 'SMTP -ի սխալ: չհաջողվեց ստուգել իսկությունը.';
     9$PHPMAILER_LANG['connect_host']         = 'SMTP -ի սխալ: չհաջողվեց կապ հաստատել SMTP սերվերի հետ.';
     10$PHPMAILER_LANG['data_not_accepted']    = 'SMTP -ի սխալ: տվյալները ընդունված չեն.';
     11$PHPMAILER_LANG['empty_message']        = 'Հաղորդագրությունը դատարկ է';
     12$PHPMAILER_LANG['encoding']             = 'Կոդավորման անհայտ տեսակ: ';
     13$PHPMAILER_LANG['execute']              = 'Չհաջողվեց իրականացնել հրամանը: ';
     14$PHPMAILER_LANG['file_access']          = 'Ֆայլը հասանելի չէ: ';
     15$PHPMAILER_LANG['file_open']            = 'Ֆայլի սխալ: ֆայլը չհաջողվեց բացել: ';
     16$PHPMAILER_LANG['from_failed']          = 'Ուղարկողի հետևյալ հասցեն սխալ է: ';
     17$PHPMAILER_LANG['instantiate']          = 'Հնարավոր չէ կանչել mail ֆունկցիան.';
     18$PHPMAILER_LANG['invalid_address']      = 'Հասցեն սխալ է: ';
     19$PHPMAILER_LANG['mailer_not_supported'] = ' փոստային սերվերի հետ չի աշխատում.';
     20$PHPMAILER_LANG['provide_address']      = 'Անհրաժեշտ է տրամադրել գոնե մեկ ստացողի e-mail հասցե.';
     21$PHPMAILER_LANG['recipients_failed']    = 'SMTP -ի սխալ: չի հաջողվել ուղարկել հետևյալ ստացողների հասցեներին: ';
     22$PHPMAILER_LANG['signing']              = 'Ստորագրման սխալ: ';
     23$PHPMAILER_LANG['smtp_connect_failed']  = 'SMTP -ի connect() ֆունկցիան չի հաջողվել';
     24$PHPMAILER_LANG['smtp_error']           = 'SMTP սերվերի սխալ: ';
     25$PHPMAILER_LANG['variable_set']         = 'Չի հաջողվում ստեղծել կամ վերափոխել փոփոխականը: ';
     26$PHPMAILER_LANG['extension_missing']    = 'Հավելվածը բացակայում է: ';
  • new file wp-includes/PHPMailer/language/phpmailer.lang-ar.php

    diff --git wp-includes/PHPMailer/language/phpmailer.lang-ar.php wp-includes/PHPMailer/language/phpmailer.lang-ar.php
    new file mode 100644
    index 0000000..790e2a5
    - +  
     1<?php
     2/**
     3 * Arabic PHPMailer language file: refer to English translation for definitive list
     4 * @package PHPMailer
     5 * @author bahjat al mostafa <bahjat983@hotmail.com>
     6 */
     7
     8$PHPMAILER_LANG['authenticate']         = 'خطأ SMTP : لا يمكن تأكيد الهوية.';
     9$PHPMAILER_LANG['connect_host']         = 'خطأ SMTP: لا يمكن الاتصال بالخادم SMTP.';
     10$PHPMAILER_LANG['data_not_accepted']    = 'خطأ SMTP: لم يتم قبول المعلومات .';
     11$PHPMAILER_LANG['empty_message']        = 'نص الرسالة فارغ';
     12$PHPMAILER_LANG['encoding']             = 'ترميز غير معروف: ';
     13$PHPMAILER_LANG['execute']              = 'لا يمكن تنفيذ : ';
     14$PHPMAILER_LANG['file_access']          = 'لا يمكن الوصول للملف: ';
     15$PHPMAILER_LANG['file_open']            = 'خطأ في الملف: لا يمكن فتحه: ';
     16$PHPMAILER_LANG['from_failed']          = 'خطأ على مستوى عنوان المرسل : ';
     17$PHPMAILER_LANG['instantiate']          = 'لا يمكن توفير خدمة البريد.';
     18$PHPMAILER_LANG['invalid_address']      = 'الإرسال غير ممكن لأن عنوان البريد الإلكتروني غير صالح: ';
     19$PHPMAILER_LANG['mailer_not_supported'] = ' برنامج الإرسال غير مدعوم.';
     20$PHPMAILER_LANG['provide_address']      = 'يجب توفير عنوان البريد الإلكتروني لمستلم واحد على الأقل.';
     21$PHPMAILER_LANG['recipients_failed']    = 'خطأ SMTP: الأخطاء التالية ' .
     22                                          'فشل في الارسال لكل من : ';
     23$PHPMAILER_LANG['signing']              = 'خطأ في التوقيع: ';
     24$PHPMAILER_LANG['smtp_connect_failed']  = 'SMTP Connect() غير ممكن.';
     25$PHPMAILER_LANG['smtp_error']           = 'خطأ على مستوى الخادم SMTP: ';
     26$PHPMAILER_LANG['variable_set']         = 'لا يمكن تعيين أو إعادة تعيين متغير: ';
     27//$PHPMAILER_LANG['extension_missing']    = 'Extension missing: ';
  • new file wp-includes/PHPMailer/language/phpmailer.lang-az.php

    diff --git wp-includes/PHPMailer/language/phpmailer.lang-az.php wp-includes/PHPMailer/language/phpmailer.lang-az.php
    new file mode 100644
    index 0000000..3749d83
    - +  
     1<?php
     2/**
     3 * Azerbaijani PHPMailer language file: refer to English translation for definitive list
     4 * @package PHPMailer
     5 * @author @mirjalal
     6 */
     7
     8$PHPMAILER_LANG['authenticate']         = 'SMTP xətası: Giriş uğursuz oldu.';
     9$PHPMAILER_LANG['connect_host']         = 'SMTP xətası: SMTP serverinə qoşulma uğursuz oldu.';
     10$PHPMAILER_LANG['data_not_accepted']    = 'SMTP xətası: Verilənlər qəbul edilməyib.';
     11$PHPMAILER_LANG['empty_message']        = 'Boş mesaj göndərilə bilməz.';
     12$PHPMAILER_LANG['encoding']             = 'Qeyri-müəyyən kodlaşdırma: ';
     13$PHPMAILER_LANG['execute']              = 'Əmr yerinə yetirilmədi: ';
     14$PHPMAILER_LANG['file_access']          = 'Fayla giriş yoxdur: ';
     15$PHPMAILER_LANG['file_open']            = 'Fayl xətası: Fayl açıla bilmədi: ';
     16$PHPMAILER_LANG['from_failed']          = 'Göstərilən poçtlara göndərmə uğursuz oldu: ';
     17$PHPMAILER_LANG['instantiate']          = 'Mail funksiyası işə salına bilmədi.';
     18$PHPMAILER_LANG['invalid_address']      = 'Düzgün olmayan e-mail adresi: ';
     19$PHPMAILER_LANG['mailer_not_supported'] = ' - e-mail kitabxanası dəstəklənmir.';
     20$PHPMAILER_LANG['provide_address']      = 'Ən azı bir e-mail adresi daxil edilməlidir.';
     21$PHPMAILER_LANG['recipients_failed']    = 'SMTP xətası: Aşağıdakı ünvanlar üzrə alıcılara göndərmə uğursuzdur: ';
     22$PHPMAILER_LANG['signing']              = 'İmzalama xətası: ';
     23$PHPMAILER_LANG['smtp_connect_failed']  = 'SMTP serverinə qoşulma uğursuz oldu.';
     24$PHPMAILER_LANG['smtp_error']           = 'SMTP serveri xətası: ';
     25$PHPMAILER_LANG['variable_set']         = 'Dəyişənin quraşdırılması uğursuz oldu: ';
     26//$PHPMAILER_LANG['extension_missing']    = 'Extension missing: ';
  • new file wp-includes/PHPMailer/language/phpmailer.lang-be.php

    diff --git wp-includes/PHPMailer/language/phpmailer.lang-be.php wp-includes/PHPMailer/language/phpmailer.lang-be.php
    new file mode 100644
    index 0000000..e2f98f0
    - +  
     1<?php
     2/**
     3 * Belarusian PHPMailer language file: refer to English translation for definitive list
     4 * @package PHPMailer
     5 * @author Aleksander Maksymiuk <info@setpro.pl>
     6 */
     7
     8$PHPMAILER_LANG['authenticate']         = 'Памылка SMTP: памылка ідэнтыфікацыі.';
     9$PHPMAILER_LANG['connect_host']         = 'Памылка SMTP: нельга ўстанавіць сувязь з SMTP-серверам.';
     10$PHPMAILER_LANG['data_not_accepted']    = 'Памылка SMTP: звесткі непрынятыя.';
     11$PHPMAILER_LANG['empty_message']        = 'Пустое паведамленне.';
     12$PHPMAILER_LANG['encoding']             = 'Невядомая кадыроўка тэксту: ';
     13$PHPMAILER_LANG['execute']              = 'Нельга выканаць каманду: ';
     14$PHPMAILER_LANG['file_access']          = 'Няма доступу да файла: ';
     15$PHPMAILER_LANG['file_open']            = 'Нельга адкрыць файл: ';
     16$PHPMAILER_LANG['from_failed']          = 'Няправільны адрас адпраўніка: ';
     17$PHPMAILER_LANG['instantiate']          = 'Нельга прымяніць функцыю mail().';
     18$PHPMAILER_LANG['invalid_address']      = 'Нельга даслаць паведамленне, няправільны email атрымальніка: ';
     19$PHPMAILER_LANG['provide_address']      = 'Запоўніце, калі ласка, правільны email атрымальніка.';
     20$PHPMAILER_LANG['mailer_not_supported'] = ' - паштовы сервер не падтрымліваецца.';
     21$PHPMAILER_LANG['recipients_failed']    = 'Памылка SMTP: няправільныя атрымальнікі: ';
     22$PHPMAILER_LANG['signing']              = 'Памылка подпісу паведамлення: ';
     23$PHPMAILER_LANG['smtp_connect_failed']  = 'Памылка сувязі з SMTP-серверам.';
     24$PHPMAILER_LANG['smtp_error']           = 'Памылка SMTP: ';
     25$PHPMAILER_LANG['variable_set']         = 'Нельга ўстанавіць або перамяніць значэнне пераменнай: ';
     26//$PHPMAILER_LANG['extension_missing']    = 'Extension missing: ';
  • new file wp-includes/PHPMailer/language/phpmailer.lang-bg.php

    diff --git wp-includes/PHPMailer/language/phpmailer.lang-bg.php wp-includes/PHPMailer/language/phpmailer.lang-bg.php
    new file mode 100644
    index 0000000..b22941f
    - +  
     1<?php
     2/**
     3 * Bulgarian PHPMailer language file: refer to English translation for definitive list
     4 * @package PHPMailer
     5 * @author Mikhail Kyosev <mialygk@gmail.com>
     6 */
     7
     8$PHPMAILER_LANG['authenticate']         = 'SMTP грешка: Не може да се удостовери пред сървъра.';
     9$PHPMAILER_LANG['connect_host']         = 'SMTP грешка: Не може да се свърже с SMTP хоста.';
     10$PHPMAILER_LANG['data_not_accepted']    = 'SMTP грешка: данните не са приети.';
     11$PHPMAILER_LANG['empty_message']        = 'Съдържанието на съобщението е празно';
     12$PHPMAILER_LANG['encoding']             = 'Неизвестно кодиране: ';
     13$PHPMAILER_LANG['execute']              = 'Не може да се изпълни: ';
     14$PHPMAILER_LANG['file_access']          = 'Няма достъп до файл: ';
     15$PHPMAILER_LANG['file_open']            = 'Файлова грешка: Не може да се отвори файл: ';
     16$PHPMAILER_LANG['from_failed']          = 'Следните адреси за подател са невалидни: ';
     17$PHPMAILER_LANG['instantiate']          = 'Не може да се инстанцира функцията mail.';
     18$PHPMAILER_LANG['invalid_address']      = 'Невалиден адрес: ';
     19$PHPMAILER_LANG['mailer_not_supported'] = ' - пощенски сървър не се поддържа.';
     20$PHPMAILER_LANG['provide_address']      = 'Трябва да предоставите поне един email адрес за получател.';
     21$PHPMAILER_LANG['recipients_failed']    = 'SMTP грешка: Следните адреси за Получател са невалидни: ';
     22$PHPMAILER_LANG['signing']              = 'Грешка при подписване: ';
     23$PHPMAILER_LANG['smtp_connect_failed']  = 'SMTP провален connect().';
     24$PHPMAILER_LANG['smtp_error']           = 'SMTP сървърна грешка: ';
     25$PHPMAILER_LANG['variable_set']         = 'Не може да се установи или възстанови променлива: ';
     26$PHPMAILER_LANG['extension_missing']    = 'Липсва разширение: ';
  • new file wp-includes/PHPMailer/language/phpmailer.lang-ca.php

    diff --git wp-includes/PHPMailer/language/phpmailer.lang-ca.php wp-includes/PHPMailer/language/phpmailer.lang-ca.php
    new file mode 100644
    index 0000000..4117596
    - +  
     1<?php
     2/**
     3 * Catalan PHPMailer language file: refer to English translation for definitive list
     4 * @package PHPMailer
     5 * @author Ivan <web AT microstudi DOT com>
     6 */
     7
     8$PHPMAILER_LANG['authenticate']         = 'Error SMTP: No s’ha pogut autenticar.';
     9$PHPMAILER_LANG['connect_host']         = 'Error SMTP: No es pot connectar al servidor SMTP.';
     10$PHPMAILER_LANG['data_not_accepted']    = 'Error SMTP: Dades no acceptades.';
     11$PHPMAILER_LANG['empty_message']        = 'El cos del missatge està buit.';
     12$PHPMAILER_LANG['encoding']             = 'Codificació desconeguda: ';
     13$PHPMAILER_LANG['execute']              = 'No es pot executar: ';
     14$PHPMAILER_LANG['file_access']          = 'No es pot accedir a l’arxiu: ';
     15$PHPMAILER_LANG['file_open']            = 'Error d’Arxiu: No es pot obrir l’arxiu: ';
     16$PHPMAILER_LANG['from_failed']          = 'La(s) següent(s) adreces de remitent han fallat: ';
     17$PHPMAILER_LANG['instantiate']          = 'No s’ha pogut crear una instància de la funció Mail.';
     18$PHPMAILER_LANG['invalid_address']      = 'Adreça d’email invalida: ';
     19$PHPMAILER_LANG['mailer_not_supported'] = ' mailer no està suportat';
     20$PHPMAILER_LANG['provide_address']      = 'S’ha de proveir almenys una adreça d’email com a destinatari.';
     21$PHPMAILER_LANG['recipients_failed']    = 'Error SMTP: Els següents destinataris han fallat: ';
     22$PHPMAILER_LANG['signing']              = 'Error al signar: ';
     23$PHPMAILER_LANG['smtp_connect_failed']  = 'Ha fallat el SMTP Connect().';
     24$PHPMAILER_LANG['smtp_error']           = 'Error del servidor SMTP: ';
     25$PHPMAILER_LANG['variable_set']         = 'No s’ha pogut establir o restablir la variable: ';
     26//$PHPMAILER_LANG['extension_missing']    = 'Extension missing: ';
  • new file wp-includes/PHPMailer/language/phpmailer.lang-ch.php

    diff --git wp-includes/PHPMailer/language/phpmailer.lang-ch.php wp-includes/PHPMailer/language/phpmailer.lang-ch.php
    new file mode 100644
    index 0000000..4fda6b8
    - +  
     1<?php
     2/**
     3 * Chinese PHPMailer language file: refer to English translation for definitive list
     4 * @package PHPMailer
     5 * @author LiuXin <http://www.80x86.cn/blog/>
     6 */
     7
     8$PHPMAILER_LANG['authenticate']         = 'SMTP 错误:身份验证失败。';
     9$PHPMAILER_LANG['connect_host']         = 'SMTP 错误: 不能连接SMTP主机。';
     10$PHPMAILER_LANG['data_not_accepted']    = 'SMTP 错误: 数据不可接受。';
     11//$PHPMAILER_LANG['empty_message']        = 'Message body empty';
     12$PHPMAILER_LANG['encoding']             = '未知编码:';
     13$PHPMAILER_LANG['execute']              = '不能执行: ';
     14$PHPMAILER_LANG['file_access']          = '不能访问文件:';
     15$PHPMAILER_LANG['file_open']            = '文件错误:不能打开文件:';
     16$PHPMAILER_LANG['from_failed']          = '下面的发送地址邮件发送失败了: ';
     17$PHPMAILER_LANG['instantiate']          = '不能实现mail方法。';
     18//$PHPMAILER_LANG['invalid_address']      = 'Invalid address: ';
     19$PHPMAILER_LANG['mailer_not_supported'] = ' 您所选择的发送邮件的方法并不支持。';
     20$PHPMAILER_LANG['provide_address']      = '您必须提供至少一个 收信人的email地址。';
     21$PHPMAILER_LANG['recipients_failed']    = 'SMTP 错误: 下面的 收件人失败了: ';
     22//$PHPMAILER_LANG['signing']              = 'Signing Error: ';
     23//$PHPMAILER_LANG['smtp_connect_failed']  = 'SMTP Connect() failed.';
     24//$PHPMAILER_LANG['smtp_error']           = 'SMTP server error: ';
     25//$PHPMAILER_LANG['variable_set']         = 'Cannot set or reset variable: ';
     26//$PHPMAILER_LANG['extension_missing']    = 'Extension missing: ';
  • new file wp-includes/PHPMailer/language/phpmailer.lang-cs.php

    diff --git wp-includes/PHPMailer/language/phpmailer.lang-cs.php wp-includes/PHPMailer/language/phpmailer.lang-cs.php
    new file mode 100644
    index 0000000..8cb1a3d
    - +  
     1<?php
     2/**
     3 * Czech PHPMailer language file: refer to English translation for definitive list
     4 * @package PHPMailer
     5 */
     6
     7$PHPMAILER_LANG['authenticate']         = 'Chyba SMTP: Autentizace selhala.';
     8$PHPMAILER_LANG['connect_host']         = 'Chyba SMTP: Nelze navázat spojení se SMTP serverem.';
     9$PHPMAILER_LANG['data_not_accepted']    = 'Chyba SMTP: Data nebyla přijata.';
     10$PHPMAILER_LANG['empty_message']        = 'Prázdné tělo zprávy';
     11$PHPMAILER_LANG['encoding']             = 'Neznámé kódování: ';
     12$PHPMAILER_LANG['execute']              = 'Nelze provést: ';
     13$PHPMAILER_LANG['file_access']          = 'Nelze získat přístup k souboru: ';
     14$PHPMAILER_LANG['file_open']            = 'Chyba souboru: Nelze otevřít soubor pro čtení: ';
     15$PHPMAILER_LANG['from_failed']          = 'Následující adresa odesílatele je nesprávná: ';
     16$PHPMAILER_LANG['instantiate']          = 'Nelze vytvořit instanci emailové funkce.';
     17$PHPMAILER_LANG['invalid_address']      = 'Neplatná adresa: ';
     18$PHPMAILER_LANG['mailer_not_supported'] = ' mailer není podporován.';
     19$PHPMAILER_LANG['provide_address']      = 'Musíte zadat alespoň jednu emailovou adresu příjemce.';
     20$PHPMAILER_LANG['recipients_failed']    = 'Chyba SMTP: Následující adresy příjemců nejsou správně: ';
     21$PHPMAILER_LANG['signing']              = 'Chyba přihlašování: ';
     22$PHPMAILER_LANG['smtp_connect_failed']  = 'SMTP Connect() selhal.';
     23$PHPMAILER_LANG['smtp_error']           = 'Chyba SMTP serveru: ';
     24$PHPMAILER_LANG['variable_set']         = 'Nelze nastavit nebo změnit proměnnou: ';
     25//$PHPMAILER_LANG['extension_missing']    = 'Extension missing: ';
  • new file wp-includes/PHPMailer/language/phpmailer.lang-da.php

    diff --git wp-includes/PHPMailer/language/phpmailer.lang-da.php wp-includes/PHPMailer/language/phpmailer.lang-da.php
    new file mode 100644
    index 0000000..e725f4b
    - +  
     1<?php
     2/**
     3 * Danish PHPMailer language file: refer to English translation for definitive list
     4 * @package PHPMailer
     5 * @author Mikael Stokkebro <info@stokkebro.dk>
     6 */
     7
     8$PHPMAILER_LANG['authenticate']         = 'SMTP fejl: Kunne ikke logge på.';
     9$PHPMAILER_LANG['connect_host']         = 'SMTP fejl: Kunne ikke tilslutte SMTP serveren.';
     10$PHPMAILER_LANG['data_not_accepted']    = 'SMTP fejl: Data kunne ikke accepteres.';
     11//$PHPMAILER_LANG['empty_message']        = 'Message body empty';
     12$PHPMAILER_LANG['encoding']             = 'Ukendt encode-format: ';
     13$PHPMAILER_LANG['execute']              = 'Kunne ikke køre: ';
     14$PHPMAILER_LANG['file_access']          = 'Ingen adgang til fil: ';
     15$PHPMAILER_LANG['file_open']            = 'Fil fejl: Kunne ikke åbne filen: ';
     16$PHPMAILER_LANG['from_failed']          = 'Følgende afsenderadresse er forkert: ';
     17$PHPMAILER_LANG['instantiate']          = 'Kunne ikke initialisere email funktionen.';
     18//$PHPMAILER_LANG['invalid_address']        = 'Invalid address: ';
     19$PHPMAILER_LANG['mailer_not_supported'] = ' mailer understøttes ikke.';
     20$PHPMAILER_LANG['provide_address']      = 'Du skal indtaste mindst en modtagers emailadresse.';
     21$PHPMAILER_LANG['recipients_failed']    = 'SMTP fejl: Følgende modtagere er forkerte: ';
     22//$PHPMAILER_LANG['signing']              = 'Signing Error: ';
     23//$PHPMAILER_LANG['smtp_connect_failed']  = 'SMTP Connect() failed.';
     24//$PHPMAILER_LANG['smtp_error']           = 'SMTP server error: ';
     25//$PHPMAILER_LANG['variable_set']         = 'Cannot set or reset variable: ';
     26//$PHPMAILER_LANG['extension_missing']    = 'Extension missing: ';
  • new file wp-includes/PHPMailer/language/phpmailer.lang-de.php

    diff --git wp-includes/PHPMailer/language/phpmailer.lang-de.php wp-includes/PHPMailer/language/phpmailer.lang-de.php
    new file mode 100644
    index 0000000..aa987a9
    - +  
     1<?php
     2/**
     3 * German PHPMailer language file: refer to English translation for definitive list
     4 * @package PHPMailer
     5 */
     6
     7$PHPMAILER_LANG['authenticate']         = 'SMTP-Fehler: Authentifizierung fehlgeschlagen.';
     8$PHPMAILER_LANG['connect_host']         = 'SMTP-Fehler: Konnte keine Verbindung zum SMTP-Host herstellen.';
     9$PHPMAILER_LANG['data_not_accepted']    = 'SMTP-Fehler: Daten werden nicht akzeptiert.';
     10$PHPMAILER_LANG['empty_message']        = 'E-Mail-Inhalt ist leer.';
     11$PHPMAILER_LANG['encoding']             = 'Unbekannte Kodierung: ';
     12$PHPMAILER_LANG['execute']              = 'Konnte folgenden Befehl nicht ausführen: ';
     13$PHPMAILER_LANG['file_access']          = 'Zugriff auf folgende Datei fehlgeschlagen: ';
     14$PHPMAILER_LANG['file_open']            = 'Dateifehler: Konnte folgende Datei nicht öffnen: ';
     15$PHPMAILER_LANG['from_failed']          = 'Die folgende Absenderadresse ist nicht korrekt: ';
     16$PHPMAILER_LANG['instantiate']          = 'Mail-Funktion konnte nicht initialisiert werden.';
     17$PHPMAILER_LANG['invalid_address']      = 'Die Adresse ist ungültig: ';
     18$PHPMAILER_LANG['mailer_not_supported'] = ' mailer wird nicht unterstützt.';
     19$PHPMAILER_LANG['provide_address']      = 'Bitte geben Sie mindestens eine Empfängeradresse an.';
     20$PHPMAILER_LANG['recipients_failed']    = 'SMTP-Fehler: Die folgenden Empfänger sind nicht korrekt: ';
     21$PHPMAILER_LANG['signing']              = 'Fehler beim Signieren: ';
     22$PHPMAILER_LANG['smtp_connect_failed']  = 'Verbindung zum SMTP-Server fehlgeschlagen.';
     23$PHPMAILER_LANG['smtp_error']           = 'Fehler vom SMTP-Server: ';
     24$PHPMAILER_LANG['variable_set']         = 'Kann Variable nicht setzen oder zurücksetzen: ';
     25$PHPMAILER_LANG['extension_missing']    = 'Fehlende Erweiterung: ';
  • new file wp-includes/PHPMailer/language/phpmailer.lang-el.php

    diff --git wp-includes/PHPMailer/language/phpmailer.lang-el.php wp-includes/PHPMailer/language/phpmailer.lang-el.php
    new file mode 100644
    index 0000000..7109641
    - +  
     1<?php
     2/**
     3 * Greek PHPMailer language file: refer to English translation for definitive list
     4 * @package PHPMailer
     5 */
     6
     7$PHPMAILER_LANG['authenticate']         = 'SMTP Σφάλμα: Αδυναμία πιστοποίησης (authentication).';
     8$PHPMAILER_LANG['connect_host']         = 'SMTP Σφάλμα: Αδυναμία σύνδεσης στον SMTP-Host.';
     9$PHPMAILER_LANG['data_not_accepted']    = 'SMTP Σφάλμα: Τα δεδομένα δεν έγιναν αποδεκτά.';
     10$PHPMAILER_LANG['empty_message']        = 'Το E-Mail δεν έχει περιεχόμενο .';
     11$PHPMAILER_LANG['encoding']             = 'Αγνωστο Encoding-Format: ';
     12$PHPMAILER_LANG['execute']              = 'Αδυναμία εκτέλεσης ακόλουθης εντολής: ';
     13$PHPMAILER_LANG['file_access']          = 'Αδυναμία προσπέλασης του αρχείου: ';
     14$PHPMAILER_LANG['file_open']            = 'Σφάλμα Αρχείου: Δεν είναι δυνατό το άνοιγμα του ακόλουθου αρχείου: ';
     15$PHPMAILER_LANG['from_failed']          = 'Η παρακάτω διεύθυνση αποστολέα δεν είναι σωστή: ';
     16$PHPMAILER_LANG['instantiate']          = 'Αδυναμία εκκίνησης Mail function.';
     17$PHPMAILER_LANG['invalid_address']      = 'Το μήνυμα δεν εστάλη, η διεύθυνση δεν είναι έγκυρη: ';
     18$PHPMAILER_LANG['mailer_not_supported'] = ' mailer δεν υποστηρίζεται.';
     19$PHPMAILER_LANG['provide_address']      = 'Παρακαλούμε δώστε τουλάχιστον μια e-mail διεύθυνση παραλήπτη.';
     20$PHPMAILER_LANG['recipients_failed']    = 'SMTP Σφάλμα: Οι παρακάτω διευθύνσεις παραλήπτη δεν είναι έγκυρες: ';
     21$PHPMAILER_LANG['signing']              = 'Σφάλμα υπογραφής: ';
     22$PHPMAILER_LANG['smtp_connect_failed']  = 'Αποτυχία σύνδεσης στον SMTP Server.';
     23$PHPMAILER_LANG['smtp_error']           = 'Σφάλμα από τον SMTP Server: ';
     24$PHPMAILER_LANG['variable_set']         = 'Αδυναμία ορισμού ή αρχικοποίησης μεταβλητής: ';
     25//$PHPMAILER_LANG['extension_missing']    = 'Extension missing: ';
  • new file wp-includes/PHPMailer/language/phpmailer.lang-eo.php

    diff --git wp-includes/PHPMailer/language/phpmailer.lang-eo.php wp-includes/PHPMailer/language/phpmailer.lang-eo.php
    new file mode 100644
    index 0000000..2cf7d5c
    - +  
     1<?php
     2/**
     3 * Esperanto PHPMailer language file: refer to English translation for definitive list
     4 * @package PHPMailer
     5 */
     6
     7$PHPMAILER_LANG['authenticate']         = 'Eraro de servilo SMTP : aŭtentigo malsukcesis.';
     8$PHPMAILER_LANG['connect_host']         = 'Eraro de servilo SMTP : konektado al servilo malsukcesis.';
     9$PHPMAILER_LANG['data_not_accepted']    = 'Eraro de servilo SMTP : neĝustaj datumoj.';
     10$PHPMAILER_LANG['empty_message']        = 'Teksto de mesaĝo mankas.';
     11$PHPMAILER_LANG['encoding']             = 'Nekonata kodoprezento: ';
     12$PHPMAILER_LANG['execute']              = 'Lanĉi rulumadon ne eblis: ';
     13$PHPMAILER_LANG['file_access']          = 'Aliro al dosiero ne sukcesis: ';
     14$PHPMAILER_LANG['file_open']            = 'Eraro de dosiero: malfermo neeblas: ';
     15$PHPMAILER_LANG['from_failed']          = 'Jena adreso de sendinto malsukcesis: ';
     16$PHPMAILER_LANG['instantiate']          = 'Genero de retmesaĝa funkcio neeblis.';
     17$PHPMAILER_LANG['invalid_address']      = 'Retadreso ne validas: ';
     18$PHPMAILER_LANG['mailer_not_supported'] = ' mesaĝilo ne subtenata.';
     19$PHPMAILER_LANG['provide_address']      = 'Vi devas tajpi almenaŭ unu recevontan retadreson.';
     20$PHPMAILER_LANG['recipients_failed']    = 'Eraro de servilo SMTP : la jenaj poŝtrecivuloj kaŭzis eraron: ';
     21$PHPMAILER_LANG['signing']              = 'Eraro de subskribo: ';
     22$PHPMAILER_LANG['smtp_connect_failed']  = 'SMTP konektado malsukcesis.';
     23$PHPMAILER_LANG['smtp_error']           = 'Eraro de servilo SMTP : ';
     24$PHPMAILER_LANG['variable_set']         = 'Variablo ne pravalorizeblas aŭ ne repravalorizeblas: ';
     25//$PHPMAILER_LANG['extension_missing']    = 'Extension missing: ';
  • new file wp-includes/PHPMailer/language/phpmailer.lang-es.php

    diff --git wp-includes/PHPMailer/language/phpmailer.lang-es.php wp-includes/PHPMailer/language/phpmailer.lang-es.php
    new file mode 100644
    index 0000000..d2eac8d
    - +  
     1<?php
     2/**
     3 * Spanish PHPMailer language file: refer to English translation for definitive list
     4 * @package PHPMailer
     5 * @author Matt Sturdy <matt.sturdy@gmail.com>
     6 */
     7
     8$PHPMAILER_LANG['authenticate']         = 'Error SMTP: Imposible autentificar.';
     9$PHPMAILER_LANG['connect_host']         = 'Error SMTP: Imposible conectar al servidor SMTP.';
     10$PHPMAILER_LANG['data_not_accepted']    = 'Error SMTP: Datos no aceptados.';
     11$PHPMAILER_LANG['empty_message']        = 'El cuerpo del mensaje está vacío';
     12$PHPMAILER_LANG['encoding']             = 'Codificación desconocida: ';
     13$PHPMAILER_LANG['execute']              = 'Imposible ejecutar: ';
     14$PHPMAILER_LANG['file_access']          = 'Imposible acceder al archivo: ';
     15$PHPMAILER_LANG['file_open']            = 'Error de Archivo: Imposible abrir el archivo: ';
     16$PHPMAILER_LANG['from_failed']          = 'La(s) siguiente(s) direcciones de remitente fallaron: ';
     17$PHPMAILER_LANG['instantiate']          = 'Imposible crear una instancia de la función Mail.';
     18$PHPMAILER_LANG['invalid_address']      = 'Imposible enviar: dirección de email inválido: ';
     19$PHPMAILER_LANG['mailer_not_supported'] = ' mailer no está soportado.';
     20$PHPMAILER_LANG['provide_address']      = 'Debe proporcionar al menos una dirección de email de destino.';
     21$PHPMAILER_LANG['recipients_failed']    = 'Error SMTP: Los siguientes destinos fallaron: ';
     22$PHPMAILER_LANG['signing']              = 'Error al firmar: ';
     23$PHPMAILER_LANG['smtp_connect_failed']  = 'SMTP Connect() falló.';
     24$PHPMAILER_LANG['smtp_error']           = 'Error del servidor SMTP: ';
     25$PHPMAILER_LANG['variable_set']         = 'No se pudo configurar la variable: ';
     26$PHPMAILER_LANG['extension_missing']    = 'Extensión faltante: ';
  • new file wp-includes/PHPMailer/language/phpmailer.lang-et.php

    diff --git wp-includes/PHPMailer/language/phpmailer.lang-et.php wp-includes/PHPMailer/language/phpmailer.lang-et.php
    new file mode 100644
    index 0000000..7e06da1
    - +  
     1<?php
     2/**
     3 * Estonian PHPMailer language file: refer to English translation for definitive list
     4 * @package PHPMailer
     5 * @author Indrek Päri
     6 * @author Elan Ruusamäe <glen@delfi.ee>
     7 */
     8
     9$PHPMAILER_LANG['authenticate']         = 'SMTP Viga: Autoriseerimise viga.';
     10$PHPMAILER_LANG['connect_host']         = 'SMTP Viga: Ei õnnestunud luua ühendust SMTP serveriga.';
     11$PHPMAILER_LANG['data_not_accepted']    = 'SMTP Viga: Vigased andmed.';
     12$PHPMAILER_LANG['empty_message']        = 'Tühi kirja sisu';
     13$PHPMAILER_LANG["encoding"]             = 'Tundmatu kodeering: ';
     14$PHPMAILER_LANG['execute']              = 'Tegevus ebaõnnestus: ';
     15$PHPMAILER_LANG['file_access']          = 'Pole piisavalt õiguseid järgneva faili avamiseks: ';
     16$PHPMAILER_LANG['file_open']            = 'Faili Viga: Faili avamine ebaõnnestus: ';
     17$PHPMAILER_LANG['from_failed']          = 'Järgnev saatja e-posti aadress on vigane: ';
     18$PHPMAILER_LANG['instantiate']          = 'mail funktiooni käivitamine ebaõnnestus.';
     19$PHPMAILER_LANG['invalid_address']      = 'Saatmine peatatud, e-posti address vigane: ';
     20$PHPMAILER_LANG['provide_address']      = 'Te peate määrama vähemalt ühe saaja e-posti aadressi.';
     21$PHPMAILER_LANG['mailer_not_supported'] = ' maileri tugi puudub.';
     22$PHPMAILER_LANG['recipients_failed']    = 'SMTP Viga: Järgnevate saajate e-posti aadressid on vigased: ';
     23$PHPMAILER_LANG["signing"]              = 'Viga allkirjastamisel: ';
     24$PHPMAILER_LANG['smtp_connect_failed']  = 'SMTP Connect() ebaõnnestus.';
     25$PHPMAILER_LANG['smtp_error']           = 'SMTP serveri viga: ';
     26$PHPMAILER_LANG['variable_set']         = 'Ei õnnestunud määrata või lähtestada muutujat: ';
     27$PHPMAILER_LANG['extension_missing']    = 'Nõutud laiendus on puudu: ';
  • new file wp-includes/PHPMailer/language/phpmailer.lang-fa.php

    diff --git wp-includes/PHPMailer/language/phpmailer.lang-fa.php wp-includes/PHPMailer/language/phpmailer.lang-fa.php
    new file mode 100644
    index 0000000..ad0745c
    - +  
     1<?php
     2/**
     3 * Persian/Farsi PHPMailer language file: refer to English translation for definitive list
     4 * @package PHPMailer
     5 * @author Ali Jazayeri <jaza.ali@gmail.com>
     6 * @author Mohammad Hossein Mojtahedi <mhm5000@gmail.com>
     7 */
     8
     9$PHPMAILER_LANG['authenticate']         = 'خطای SMTP: احراز هویت با شکست مواجه شد.';
     10$PHPMAILER_LANG['connect_host']         = 'خطای SMTP: اتصال به سرور SMTP برقرار نشد.';
     11$PHPMAILER_LANG['data_not_accepted']    = 'خطای SMTP: داده‌ها نا‌درست هستند.';
     12$PHPMAILER_LANG['empty_message']        = 'بخش متن پیام خالی است.';
     13$PHPMAILER_LANG['encoding']             = 'کد‌گذاری نا‌شناخته: ';
     14$PHPMAILER_LANG['execute']              = 'امکان اجرا وجود ندارد: ';
     15$PHPMAILER_LANG['file_access']          = 'امکان دسترسی به فایل وجود ندارد: ';
     16$PHPMAILER_LANG['file_open']            = 'خطای File: امکان بازکردن فایل وجود ندارد: ';
     17$PHPMAILER_LANG['from_failed']          = 'آدرس فرستنده اشتباه است: ';
     18$PHPMAILER_LANG['instantiate']          = 'امکان معرفی تابع ایمیل وجود ندارد.';
     19$PHPMAILER_LANG['invalid_address']      = 'آدرس ایمیل معتبر نیست: ';
     20$PHPMAILER_LANG['mailer_not_supported'] = ' mailer پشتیبانی نمی‌شود.';
     21$PHPMAILER_LANG['provide_address']      = 'باید حداقل یک آدرس گیرنده وارد کنید.';
     22$PHPMAILER_LANG['recipients_failed']    = 'خطای SMTP: ارسال به آدرس گیرنده با خطا مواجه شد: ';
     23$PHPMAILER_LANG['signing']              = 'خطا در امضا: ';
     24$PHPMAILER_LANG['smtp_connect_failed']  = 'خطا در اتصال به SMTP.';
     25$PHPMAILER_LANG['smtp_error']           = 'خطا در SMTP Server: ';
     26$PHPMAILER_LANG['variable_set']         = 'امکان ارسال یا ارسال مجدد متغیر‌ها وجود ندارد: ';
     27//$PHPMAILER_LANG['extension_missing']    = 'Extension missing: ';
  • new file wp-includes/PHPMailer/language/phpmailer.lang-fi.php

    diff --git wp-includes/PHPMailer/language/phpmailer.lang-fi.php wp-includes/PHPMailer/language/phpmailer.lang-fi.php
    new file mode 100644
    index 0000000..ec4e752
    - +  
     1<?php
     2/**
     3 * Finnish PHPMailer language file: refer to English translation for definitive list
     4 * @package PHPMailer
     5 * @author Jyry Kuukanen
     6 */
     7
     8$PHPMAILER_LANG['authenticate']         = 'SMTP-virhe: käyttäjätunnistus epäonnistui.';
     9$PHPMAILER_LANG['connect_host']         = 'SMTP-virhe: yhteys palvelimeen ei onnistu.';
     10$PHPMAILER_LANG['data_not_accepted']    = 'SMTP-virhe: data on virheellinen.';
     11//$PHPMAILER_LANG['empty_message']        = 'Message body empty';
     12$PHPMAILER_LANG['encoding']             = 'Tuntematon koodaustyyppi: ';
     13$PHPMAILER_LANG['execute']              = 'Suoritus epäonnistui: ';
     14$PHPMAILER_LANG['file_access']          = 'Seuraavaan tiedostoon ei ole oikeuksia: ';
     15$PHPMAILER_LANG['file_open']            = 'Tiedostovirhe: Ei voida avata tiedostoa: ';
     16$PHPMAILER_LANG['from_failed']          = 'Seuraava lähettäjän osoite on virheellinen: ';
     17$PHPMAILER_LANG['instantiate']          = 'mail-funktion luonti epäonnistui.';
     18//$PHPMAILER_LANG['invalid_address']      = 'Invalid address: ';
     19$PHPMAILER_LANG['mailer_not_supported'] = 'postivälitintyyppiä ei tueta.';
     20$PHPMAILER_LANG['provide_address']      = 'Aseta vähintään yksi vastaanottajan sähk&ouml;postiosoite.';
     21$PHPMAILER_LANG['recipients_failed']    = 'SMTP-virhe: seuraava vastaanottaja osoite on virheellinen.';
     22$PHPMAILER_LANG['encoding']             = 'Tuntematon koodaustyyppi: ';
     23//$PHPMAILER_LANG['signing']              = 'Signing Error: ';
     24//$PHPMAILER_LANG['smtp_connect_failed']  = 'SMTP Connect() failed.';
     25//$PHPMAILER_LANG['smtp_error']           = 'SMTP server error: ';
     26//$PHPMAILER_LANG['variable_set']         = 'Cannot set or reset variable: ';
     27//$PHPMAILER_LANG['extension_missing']    = 'Extension missing: ';
  • new file wp-includes/PHPMailer/language/phpmailer.lang-fo.php

    diff --git wp-includes/PHPMailer/language/phpmailer.lang-fo.php wp-includes/PHPMailer/language/phpmailer.lang-fo.php
    new file mode 100644
    index 0000000..68cdef1
    - +  
     1<?php
     2/**
     3 * Faroese PHPMailer language file: refer to English translation for definitive list
     4 * @package PHPMailer
     5 * @author Dávur Sørensen <http://www.profo-webdesign.dk>
     6 */
     7
     8$PHPMAILER_LANG['authenticate']         = 'SMTP feilur: Kundi ikki góðkenna.';
     9$PHPMAILER_LANG['connect_host']         = 'SMTP feilur: Kundi ikki knýta samband við SMTP vert.';
     10$PHPMAILER_LANG['data_not_accepted']    = 'SMTP feilur: Data ikki góðkent.';
     11//$PHPMAILER_LANG['empty_message']        = 'Message body empty';
     12$PHPMAILER_LANG['encoding']             = 'Ókend encoding: ';
     13$PHPMAILER_LANG['execute']              = 'Kundi ikki útføra: ';
     14$PHPMAILER_LANG['file_access']          = 'Kundi ikki tilganga fílu: ';
     15$PHPMAILER_LANG['file_open']            = 'Fílu feilur: Kundi ikki opna fílu: ';
     16$PHPMAILER_LANG['from_failed']          = 'fylgjandi Frá/From adressa miseydnaðist: ';
     17$PHPMAILER_LANG['instantiate']          = 'Kuni ikki instantiera mail funktión.';
     18//$PHPMAILER_LANG['invalid_address']      = 'Invalid address: ';
     19$PHPMAILER_LANG['mailer_not_supported'] = ' er ikki supporterað.';
     20$PHPMAILER_LANG['provide_address']      = 'Tú skal uppgeva minst móttakara-emailadressu(r).';
     21$PHPMAILER_LANG['recipients_failed']    = 'SMTP Feilur: Fylgjandi móttakarar miseydnaðust: ';
     22//$PHPMAILER_LANG['signing']              = 'Signing Error: ';
     23//$PHPMAILER_LANG['smtp_connect_failed']  = 'SMTP Connect() failed.';
     24//$PHPMAILER_LANG['smtp_error']           = 'SMTP server error: ';
     25//$PHPMAILER_LANG['variable_set']         = 'Cannot set or reset variable: ';
     26//$PHPMAILER_LANG['extension_missing']    = 'Extension missing: ';
  • new file wp-includes/PHPMailer/language/phpmailer.lang-fr.php

    diff --git wp-includes/PHPMailer/language/phpmailer.lang-fr.php wp-includes/PHPMailer/language/phpmailer.lang-fr.php
    new file mode 100644
    index 0000000..a661f98
    - +  
     1<?php
     2/**
     3 * French PHPMailer language file: refer to English translation for definitive list
     4 * @package PHPMailer
     5 * Some French punctuation requires a thin non-breaking space (U+202F) character before it,
     6 * for example before a colon or exclamation mark.
     7 * There is one of these characters between these quotes: " "
     8 * @link http://unicode.org/udhr/n/notes_fra.html
     9 */
     10
     11$PHPMAILER_LANG['authenticate']         = 'Erreur SMTP : échec de l\'authentification.';
     12$PHPMAILER_LANG['connect_host']         = 'Erreur SMTP : impossible de se connecter au serveur SMTP.';
     13$PHPMAILER_LANG['data_not_accepted']    = 'Erreur SMTP : données incorrectes.';
     14$PHPMAILER_LANG['empty_message']        = 'Corps du message vide.';
     15$PHPMAILER_LANG['encoding']             = 'Encodage inconnu : ';
     16$PHPMAILER_LANG['execute']              = 'Impossible de lancer l\'exécution : ';
     17$PHPMAILER_LANG['file_access']          = 'Impossible d\'accéder au fichier : ';
     18$PHPMAILER_LANG['file_open']            = 'Ouverture du fichier impossible : ';
     19$PHPMAILER_LANG['from_failed']          = 'L\'adresse d\'expéditeur suivante a échoué : ';
     20$PHPMAILER_LANG['instantiate']          = 'Impossible d\'instancier la fonction mail.';
     21$PHPMAILER_LANG['invalid_address']      = 'L\'adresse courriel n\'est pas valide : ';
     22$PHPMAILER_LANG['mailer_not_supported'] = ' client de messagerie non supporté.';
     23$PHPMAILER_LANG['provide_address']      = 'Vous devez fournir au moins une adresse de destinataire.';
     24$PHPMAILER_LANG['recipients_failed']    = 'Erreur SMTP : les destinataires suivants sont en erreur : ';
     25$PHPMAILER_LANG['signing']              = 'Erreur de signature : ';
     26$PHPMAILER_LANG['smtp_connect_failed']  = 'Échec de la connexion SMTP.';
     27$PHPMAILER_LANG['smtp_error']           = 'Erreur du serveur SMTP : ';
     28$PHPMAILER_LANG['variable_set']         = 'Impossible d\'initialiser ou de réinitialiser une variable : ';
     29$PHPMAILER_LANG['extension_missing']    = 'Extension manquante : ';
  • new file wp-includes/PHPMailer/language/phpmailer.lang-gl.php

    diff --git wp-includes/PHPMailer/language/phpmailer.lang-gl.php wp-includes/PHPMailer/language/phpmailer.lang-gl.php
    new file mode 100644
    index 0000000..9b4ce4d
    - +  
     1<?php
     2/**
     3 * Galician PHPMailer language file: refer to English translation for definitive list
     4 * @package PHPMailer
     5 * @author by Donato Rouco <donatorouco@gmail.com>
     6 */
     7
     8$PHPMAILER_LANG['authenticate']         = 'Erro SMTP: Non puido ser autentificado.';
     9$PHPMAILER_LANG['connect_host']         = 'Erro SMTP: Non puido conectar co servidor SMTP.';
     10$PHPMAILER_LANG['data_not_accepted']    = 'Erro SMTP: Datos non aceptados.';
     11$PHPMAILER_LANG['empty_message']        = 'Corpo da mensaxe vacía';
     12$PHPMAILER_LANG['encoding']             = 'Codificación descoñecida: ';
     13$PHPMAILER_LANG['execute']              = 'Non puido ser executado: ';
     14$PHPMAILER_LANG['file_access']          = 'Nob puido acceder ó arquivo: ';
     15$PHPMAILER_LANG['file_open']            = 'Erro de Arquivo: No puido abrir o arquivo: ';
     16$PHPMAILER_LANG['from_failed']          = 'A(s) seguinte(s) dirección(s) de remitente(s) deron erro: ';
     17$PHPMAILER_LANG['instantiate']          = 'Non puido crear unha instancia da función Mail.';
     18$PHPMAILER_LANG['invalid_address']      = 'Non puido envia-lo correo: dirección de email inválida: ';
     19$PHPMAILER_LANG['mailer_not_supported'] = ' mailer non está soportado.';
     20$PHPMAILER_LANG['provide_address']      = 'Debe engadir polo menos unha dirección de email coma destino.';
     21$PHPMAILER_LANG['recipients_failed']    = 'Erro SMTP: Os seguintes destinos fallaron: ';
     22$PHPMAILER_LANG['signing']              = 'Erro ó firmar: ';
     23$PHPMAILER_LANG['smtp_connect_failed']  = 'SMTP Connect() fallou.';
     24$PHPMAILER_LANG['smtp_error']           = 'Erro do servidor SMTP: ';
     25$PHPMAILER_LANG['variable_set']         = 'Non puidemos axustar ou reaxustar a variábel: ';
     26//$PHPMAILER_LANG['extension_missing']    = 'Extension missing: ';
  • new file wp-includes/PHPMailer/language/phpmailer.lang-he.php

    diff --git wp-includes/PHPMailer/language/phpmailer.lang-he.php wp-includes/PHPMailer/language/phpmailer.lang-he.php
    new file mode 100644
    index 0000000..70eb717
    - +  
     1<?php
     2/**
     3 * Hebrew PHPMailer language file: refer to English translation for definitive list
     4 * @package PHPMailer
     5 * @author Ronny Sherer <ronny@hoojima.com>
     6 */
     7
     8$PHPMAILER_LANG['authenticate']         = 'שגיאת SMTP: פעולת האימות נכשלה.';
     9$PHPMAILER_LANG['connect_host']         = 'שגיאת SMTP: לא הצלחתי להתחבר לשרת SMTP.';
     10$PHPMAILER_LANG['data_not_accepted']    = 'שגיאת SMTP: מידע לא התקבל.';
     11$PHPMAILER_LANG['empty_message']        = 'גוף ההודעה ריק';
     12$PHPMAILER_LANG['invalid_address']      = 'כתובת שגויה: ';
     13$PHPMAILER_LANG['encoding']             = 'קידוד לא מוכר: ';
     14$PHPMAILER_LANG['execute']              = 'לא הצלחתי להפעיל את: ';
     15$PHPMAILER_LANG['file_access']          = 'לא ניתן לגשת לקובץ: ';
     16$PHPMAILER_LANG['file_open']            = 'שגיאת קובץ: לא ניתן לגשת לקובץ: ';
     17$PHPMAILER_LANG['from_failed']          = 'כתובות הנמענים הבאות נכשלו: ';
     18$PHPMAILER_LANG['instantiate']          = 'לא הצלחתי להפעיל את פונקציית המייל.';
     19$PHPMAILER_LANG['mailer_not_supported'] = ' אינה נתמכת.';
     20$PHPMAILER_LANG['provide_address']      = 'חובה לספק לפחות כתובת אחת של מקבל המייל.';
     21$PHPMAILER_LANG['recipients_failed']    = 'שגיאת SMTP: הנמענים הבאים נכשלו: ';
     22$PHPMAILER_LANG['signing']              = 'שגיאת חתימה: ';
     23$PHPMAILER_LANG['smtp_connect_failed']  = 'SMTP Connect() failed.';
     24$PHPMAILER_LANG['smtp_error']           = 'שגיאת שרת SMTP: ';
     25$PHPMAILER_LANG['variable_set']         = 'לא ניתן לקבוע או לשנות את המשתנה: ';
     26//$PHPMAILER_LANG['extension_missing']    = 'Extension missing: ';
  • new file wp-includes/PHPMailer/language/phpmailer.lang-hr.php

    diff --git wp-includes/PHPMailer/language/phpmailer.lang-hr.php wp-includes/PHPMailer/language/phpmailer.lang-hr.php
    new file mode 100644
    index 0000000..3822920
    - +  
     1<?php
     2/**
     3 * Croatian PHPMailer language file: refer to English translation for definitive list
     4 * @package PHPMailer
     5 * @author Hrvoj3e <hrvoj3e@gmail.com>
     6 */
     7
     8$PHPMAILER_LANG['authenticate']         = 'SMTP Greška: Neuspjela autentikacija.';
     9$PHPMAILER_LANG['connect_host']         = 'SMTP Greška: Ne mogu se spojiti na SMTP poslužitelj.';
     10$PHPMAILER_LANG['data_not_accepted']    = 'SMTP Greška: Podatci nisu prihvaćeni.';
     11$PHPMAILER_LANG['empty_message']        = 'Sadržaj poruke je prazan.';
     12$PHPMAILER_LANG['encoding']             = 'Nepoznati encoding: ';
     13$PHPMAILER_LANG['execute']              = 'Nije moguće izvršiti naredbu: ';
     14$PHPMAILER_LANG['file_access']          = 'Nije moguće pristupiti datoteci: ';
     15$PHPMAILER_LANG['file_open']            = 'Nije moguće otvoriti datoteku: ';
     16$PHPMAILER_LANG['from_failed']          = 'SMTP Greška: Slanje s navedenih e-mail adresa nije uspjelo: ';
     17$PHPMAILER_LANG['recipients_failed']    = 'SMTP Greška: Slanje na navedenih e-mail adresa nije uspjelo: ';
     18$PHPMAILER_LANG['instantiate']          = 'Ne mogu pokrenuti mail funkcionalnost.';
     19$PHPMAILER_LANG['invalid_address']      = 'E-mail nije poslan. Neispravna e-mail adresa: ';
     20$PHPMAILER_LANG['mailer_not_supported'] = ' mailer nije podržan.';
     21$PHPMAILER_LANG['provide_address']      = 'Definirajte barem jednu adresu primatelja.';
     22$PHPMAILER_LANG['signing']              = 'Greška prilikom prijave: ';
     23$PHPMAILER_LANG['smtp_connect_failed']  = 'Spajanje na SMTP poslužitelj nije uspjelo.';
     24$PHPMAILER_LANG['smtp_error']           = 'Greška SMTP poslužitelja: ';
     25$PHPMAILER_LANG['variable_set']         = 'Ne mogu postaviti varijablu niti ju vratiti nazad: ';
     26$PHPMAILER_LANG['extension_missing']    = 'Nedostaje proširenje: ';
  • new file wp-includes/PHPMailer/language/phpmailer.lang-hu.php

    diff --git wp-includes/PHPMailer/language/phpmailer.lang-hu.php wp-includes/PHPMailer/language/phpmailer.lang-hu.php
    new file mode 100644
    index 0000000..d7ca888
    - +  
     1<?php
     2/**
     3 * Hungarian PHPMailer language file: refer to English translation for definitive list
     4 * @package PHPMailer
     5 * @author @dominicus-75
     6 */
     7
     8$PHPMAILER_LANG['authenticate']         = 'SMTP hiba: az azonosítás sikertelen.';
     9$PHPMAILER_LANG['connect_host']         = 'SMTP hiba: nem lehet kapcsolódni az SMTP-szerverhez.';
     10$PHPMAILER_LANG['data_not_accepted']    = 'SMTP hiba: adatok visszautasítva.';
     11$PHPMAILER_LANG['empty_message']        = 'Üres az üzenettörzs.';
     12$PHPMAILER_LANG['encoding']             = 'Ismeretlen kódolás: ';
     13$PHPMAILER_LANG['execute']              = 'Nem lehet végrehajtani: ';
     14$PHPMAILER_LANG['file_access']          = 'A következő fájl nem elérhető: ';
     15$PHPMAILER_LANG['file_open']            = 'Fájl hiba: a következő fájlt nem lehet megnyitni: ';
     16$PHPMAILER_LANG['from_failed']          = 'A feladóként megadott következő cím hibás: ';
     17$PHPMAILER_LANG['instantiate']          = 'A PHP mail() függvényt nem sikerült végrehajtani.';
     18$PHPMAILER_LANG['invalid_address']      = 'Érvénytelen cím: ';
     19$PHPMAILER_LANG['mailer_not_supported'] = ' a mailer-osztály nem támogatott.';
     20$PHPMAILER_LANG['provide_address']      = 'Legalább egy címzettet fel kell tüntetni.';
     21$PHPMAILER_LANG['recipients_failed']    = 'SMTP hiba: a címzettként megadott következő címek hibásak: ';
     22$PHPMAILER_LANG['signing']              = 'Hibás aláírás: ';
     23$PHPMAILER_LANG['smtp_connect_failed']  = 'Hiba az SMTP-kapcsolatban.';
     24$PHPMAILER_LANG['smtp_error']           = 'SMTP-szerver hiba: ';
     25$PHPMAILER_LANG['variable_set']         = 'A következő változók beállítása nem sikerült: ';
     26//$PHPMAILER_LANG['extension_missing']    = 'Extension missing: ';
  • new file wp-includes/PHPMailer/language/phpmailer.lang-id.php

    diff --git wp-includes/PHPMailer/language/phpmailer.lang-id.php wp-includes/PHPMailer/language/phpmailer.lang-id.php
    new file mode 100644
    index 0000000..e57b524
    - +  
     1<?php
     2/**
     3 * Indonesian PHPMailer language file: refer to English translation for definitive list
     4 * @package PHPMailer
     5 * @author Cecep Prawiro <cecep.prawiro@gmail.com>
     6 */
     7
     8$PHPMAILER_LANG['authenticate']         = 'Kesalahan SMTP: Tidak dapat mengautentikasi.';
     9$PHPMAILER_LANG['connect_host']         = 'Kesalahan SMTP: Tidak dapat terhubung ke host SMTP.';
     10$PHPMAILER_LANG['data_not_accepted']    = 'Kesalahan SMTP: Data tidak diterima peladen.';
     11$PHPMAILER_LANG['empty_message']        = 'Isi pesan kosong';
     12$PHPMAILER_LANG['encoding']             = 'Pengkodean karakter tidak dikenali: ';
     13$PHPMAILER_LANG['execute']              = 'Tidak dapat menjalankan proses : ';
     14$PHPMAILER_LANG['file_access']          = 'Tidak dapat mengakses berkas : ';
     15$PHPMAILER_LANG['file_open']            = 'Kesalahan File: Berkas tidak bisa dibuka : ';
     16$PHPMAILER_LANG['from_failed']          = 'Alamat pengirim berikut mengakibatkan error : ';
     17$PHPMAILER_LANG['instantiate']          = 'Tidak dapat menginisialisasi fungsi email';
     18$PHPMAILER_LANG['invalid_address']      = 'Gagal terkirim, alamat email tidak valid : ';
     19$PHPMAILER_LANG['provide_address']      = 'Harus disediakan minimal satu alamat tujuan';
     20$PHPMAILER_LANG['mailer_not_supported'] = 'Mailer tidak didukung';
     21$PHPMAILER_LANG['recipients_failed']    = 'Kesalahan SMTP: Alamat tujuan berikut menghasilkan error : ';
     22$PHPMAILER_LANG['signing']              = 'Kesalahan dalam tanda tangan : ';
     23$PHPMAILER_LANG['smtp_connect_failed']  = 'SMTP Connect() gagal.';
     24$PHPMAILER_LANG['smtp_error']           = 'Kesalahan peladen SMTP : ';
     25$PHPMAILER_LANG['variable_set']         = 'Tidak berhasil mengatur atau mengatur ulang variable : ';
     26//$PHPMAILER_LANG['extension_missing']    = 'Extension missing: ';
  • new file wp-includes/PHPMailer/language/phpmailer.lang-it.php

    diff --git wp-includes/PHPMailer/language/phpmailer.lang-it.php wp-includes/PHPMailer/language/phpmailer.lang-it.php
    new file mode 100644
    index 0000000..d2f4643
    - +  
     1<?php
     2/**
     3 * Italian PHPMailer language file: refer to English translation for definitive list
     4 * @package PHPMailer
     5 * @author Ilias Bartolini <brain79@inwind.it>
     6 * @author Stefano Sabatini <sabas88@gmail.com>
     7 */
     8
     9$PHPMAILER_LANG['authenticate']         = 'SMTP Error: Impossibile autenticarsi.';
     10$PHPMAILER_LANG['connect_host']         = 'SMTP Error: Impossibile connettersi all\'host SMTP.';
     11$PHPMAILER_LANG['data_not_accepted']    = 'SMTP Error: Dati non accettati dal server.';
     12$PHPMAILER_LANG['empty_message']        = 'Il corpo del messaggio è vuoto';
     13$PHPMAILER_LANG['encoding']             = 'Codifica dei caratteri sconosciuta: ';
     14$PHPMAILER_LANG['execute']              = 'Impossibile eseguire l\'operazione: ';
     15$PHPMAILER_LANG['file_access']          = 'Impossibile accedere al file: ';
     16$PHPMAILER_LANG['file_open']            = 'File Error: Impossibile aprire il file: ';
     17$PHPMAILER_LANG['from_failed']          = 'I seguenti indirizzi mittenti hanno generato errore: ';
     18$PHPMAILER_LANG['instantiate']          = 'Impossibile istanziare la funzione mail';
     19$PHPMAILER_LANG['invalid_address']      = 'Impossibile inviare, l\'indirizzo email non è valido: ';
     20$PHPMAILER_LANG['provide_address']      = 'Deve essere fornito almeno un indirizzo ricevente';
     21$PHPMAILER_LANG['mailer_not_supported'] = 'Mailer non supportato';
     22$PHPMAILER_LANG['recipients_failed']    = 'SMTP Error: I seguenti indirizzi destinatari hanno generato un errore: ';
     23$PHPMAILER_LANG['signing']              = 'Errore nella firma: ';
     24$PHPMAILER_LANG['smtp_connect_failed']  = 'SMTP Connect() fallita.';
     25$PHPMAILER_LANG['smtp_error']           = 'Errore del server SMTP: ';
     26$PHPMAILER_LANG['variable_set']         = 'Impossibile impostare o resettare la variabile: ';
     27//$PHPMAILER_LANG['extension_missing']    = 'Extension missing: ';
  • new file wp-includes/PHPMailer/language/phpmailer.lang-ja.php

    diff --git wp-includes/PHPMailer/language/phpmailer.lang-ja.php wp-includes/PHPMailer/language/phpmailer.lang-ja.php
    new file mode 100644
    index 0000000..2d77872
    - +  
     1<?php
     2/**
     3 * Japanese PHPMailer language file: refer to English translation for definitive list
     4 * @package PHPMailer
     5 * @author Mitsuhiro Yoshida <http://mitstek.com/>
     6 * @author Yoshi Sakai <http://bluemooninc.jp/>
     7 */
     8
     9$PHPMAILER_LANG['authenticate']         = 'SMTPエラー: 認証できませんでした。';
     10$PHPMAILER_LANG['connect_host']         = 'SMTPエラー: SMTPホストに接続できませんでした。';
     11$PHPMAILER_LANG['data_not_accepted']    = 'SMTPエラー: データが受け付けられませんでした。';
     12//$PHPMAILER_LANG['empty_message']        = 'Message body empty';
     13$PHPMAILER_LANG['encoding']             = '不明なエンコーディング: ';
     14$PHPMAILER_LANG['execute']              = '実行できませんでした: ';
     15$PHPMAILER_LANG['file_access']          = 'ファイルにアクセスできません: ';
     16$PHPMAILER_LANG['file_open']            = 'ファイルエラー: ファイルを開けません: ';
     17$PHPMAILER_LANG['from_failed']          = 'Fromアドレスを登録する際にエラーが発生しました: ';
     18$PHPMAILER_LANG['instantiate']          = 'メール関数が正常に動作しませんでした。';
     19//$PHPMAILER_LANG['invalid_address']      = 'Invalid address: ';
     20$PHPMAILER_LANG['provide_address']      = '少なくとも1つメールアドレスを 指定する必要があります。';
     21$PHPMAILER_LANG['mailer_not_supported'] = ' メーラーがサポートされていません。';
     22$PHPMAILER_LANG['recipients_failed']    = 'SMTPエラー: 次の受信者アドレスに 間違いがあります: ';
     23//$PHPMAILER_LANG['signing']              = 'Signing Error: ';
     24//$PHPMAILER_LANG['smtp_connect_failed']  = 'SMTP Connect() failed.';
     25//$PHPMAILER_LANG['smtp_error']           = 'SMTP server error: ';
     26//$PHPMAILER_LANG['variable_set']         = 'Cannot set or reset variable: ';
     27//$PHPMAILER_LANG['extension_missing']    = 'Extension missing: ';
  • new file wp-includes/PHPMailer/language/phpmailer.lang-ka.php

    diff --git wp-includes/PHPMailer/language/phpmailer.lang-ka.php wp-includes/PHPMailer/language/phpmailer.lang-ka.php
    new file mode 100644
    index 0000000..dd1af8a
    - +  
     1<?php
     2/**
     3 * Georgian PHPMailer language file: refer to English translation for definitive list
     4 * @package PHPMailer
     5 * @author Avtandil Kikabidze aka LONGMAN <akalongman@gmail.com>
     6 */
     7
     8$PHPMAILER_LANG['authenticate']         = 'SMTP შეცდომა: ავტორიზაცია შეუძლებელია.';
     9$PHPMAILER_LANG['connect_host']         = 'SMTP შეცდომა: SMTP სერვერთან დაკავშირება შეუძლებელია.';
     10$PHPMAILER_LANG['data_not_accepted']    = 'SMTP შეცდომა: მონაცემები არ იქნა მიღებული.';
     11$PHPMAILER_LANG['encoding']             = 'კოდირების უცნობი ტიპი: ';
     12$PHPMAILER_LANG['execute']              = 'შეუძლებელია შემდეგი ბრძანების შესრულება: ';
     13$PHPMAILER_LANG['file_access']          = 'შეუძლებელია წვდომა ფაილთან: ';
     14$PHPMAILER_LANG['file_open']            = 'ფაილური სისტემის შეცდომა: არ იხსნება ფაილი: ';
     15$PHPMAILER_LANG['from_failed']          = 'გამგზავნის არასწორი მისამართი: ';
     16$PHPMAILER_LANG['instantiate']          = 'mail ფუნქციის გაშვება ვერ ხერხდება.';
     17$PHPMAILER_LANG['provide_address']      = 'გთხოვთ მიუთითოთ ერთი ადრესატის e-mail მისამართი მაინც.';
     18$PHPMAILER_LANG['mailer_not_supported'] = ' - საფოსტო სერვერის მხარდაჭერა არ არის.';
     19$PHPMAILER_LANG['recipients_failed']    = 'SMTP შეცდომა: შემდეგ მისამართებზე გაგზავნა ვერ მოხერხდა: ';
     20$PHPMAILER_LANG['empty_message']        = 'შეტყობინება ცარიელია';
     21$PHPMAILER_LANG['invalid_address']      = 'არ გაიგზავნა, e-mail მისამართის არასწორი ფორმატი: ';
     22$PHPMAILER_LANG['signing']              = 'ხელმოწერის შეცდომა: ';
     23$PHPMAILER_LANG['smtp_connect_failed']  = 'შეცდომა SMTP სერვერთან დაკავშირებისას';
     24$PHPMAILER_LANG['smtp_error']           = 'SMTP სერვერის შეცდომა: ';
     25$PHPMAILER_LANG['variable_set']         = 'შეუძლებელია შემდეგი ცვლადის შექმნა ან შეცვლა: ';
     26$PHPMAILER_LANG['extension_missing']    = 'ბიბლიოთეკა არ არსებობს: ';
  • new file wp-includes/PHPMailer/language/phpmailer.lang-ko.php

    diff --git wp-includes/PHPMailer/language/phpmailer.lang-ko.php wp-includes/PHPMailer/language/phpmailer.lang-ko.php
    new file mode 100644
    index 0000000..9599fa6
    - +  
     1<?php
     2/**
     3 * Korean PHPMailer language file: refer to English translation for definitive list
     4 * @package PHPMailer
     5 * @author ChalkPE <amato0617@gmail.com>
     6 */
     7
     8$PHPMAILER_LANG['authenticate']         = 'SMTP 오류: 인증할 수 없습니다.';
     9$PHPMAILER_LANG['connect_host']         = 'SMTP 오류: SMTP 호스트에 접속할 수 없습니다.';
     10$PHPMAILER_LANG['data_not_accepted']    = 'SMTP 오류: 데이터가 받아들여지지 않았습니다.';
     11$PHPMAILER_LANG['empty_message']        = '메세지 내용이 없습니다';
     12$PHPMAILER_LANG['encoding']             = '알 수 없는 인코딩: ';
     13$PHPMAILER_LANG['execute']              = '실행 불가: ';
     14$PHPMAILER_LANG['file_access']          = '파일 접근 불가: ';
     15$PHPMAILER_LANG['file_open']            = '파일 오류: 파일을 열 수 없습니다: ';
     16$PHPMAILER_LANG['from_failed']          = '다음 From 주소에서 오류가 발생했습니다: ';
     17$PHPMAILER_LANG['instantiate']          = 'mail 함수를 인스턴스화할 수 없습니다';
     18$PHPMAILER_LANG['invalid_address']      = '잘못된 주소: ';
     19$PHPMAILER_LANG['mailer_not_supported'] = ' 메일러는 지원되지 않습니다.';
     20$PHPMAILER_LANG['provide_address']      = '적어도 한 개 이상의 수신자 메일 주소를 제공해야 합니다.';
     21$PHPMAILER_LANG['recipients_failed']    = 'SMTP 오류: 다음 수신자에서 오류가 발생했습니다: ';
     22$PHPMAILER_LANG['signing']              = '서명 오류: ';
     23$PHPMAILER_LANG['smtp_connect_failed']  = 'SMTP 연결을 실패하였습니다.';
     24$PHPMAILER_LANG['smtp_error']           = 'SMTP 서버 오류: ';
     25$PHPMAILER_LANG['variable_set']         = '변수 설정 및 초기화 불가: ';
     26$PHPMAILER_LANG['extension_missing']    = '확장자 없음: ';
  • new file wp-includes/PHPMailer/language/phpmailer.lang-lt.php

    diff --git wp-includes/PHPMailer/language/phpmailer.lang-lt.php wp-includes/PHPMailer/language/phpmailer.lang-lt.php
    new file mode 100644
    index 0000000..1253a4f
    - +  
     1<?php
     2/**
     3 * Lithuanian PHPMailer language file: refer to English translation for definitive list
     4 * @package PHPMailer
     5 * @author Dainius Kaupaitis <dk@sum.lt>
     6 */
     7
     8$PHPMAILER_LANG['authenticate']         = 'SMTP klaida: autentifikacija nepavyko.';
     9$PHPMAILER_LANG['connect_host']         = 'SMTP klaida: nepavyksta prisijungti prie SMTP stoties.';
     10$PHPMAILER_LANG['data_not_accepted']    = 'SMTP klaida: duomenys nepriimti.';
     11$PHPMAILER_LANG['empty_message']        = 'Laiško turinys tuščias';
     12$PHPMAILER_LANG['encoding']             = 'Neatpažinta koduotė: ';
     13$PHPMAILER_LANG['execute']              = 'Nepavyko įvykdyti komandos: ';
     14$PHPMAILER_LANG['file_access']          = 'Byla nepasiekiama: ';
     15$PHPMAILER_LANG['file_open']            = 'Bylos klaida: Nepavyksta atidaryti: ';
     16$PHPMAILER_LANG['from_failed']          = 'Neteisingas siuntėjo adresas: ';
     17$PHPMAILER_LANG['instantiate']          = 'Nepavyko paleisti mail funkcijos.';
     18$PHPMAILER_LANG['invalid_address']      = 'Neteisingas adresas: ';
     19$PHPMAILER_LANG['mailer_not_supported'] = ' pašto stotis nepalaikoma.';
     20$PHPMAILER_LANG['provide_address']      = 'Nurodykite bent vieną gavėjo adresą.';
     21$PHPMAILER_LANG['recipients_failed']    = 'SMTP klaida: nepavyko išsiųsti šiems gavėjams: ';
     22$PHPMAILER_LANG['signing']              = 'Prisijungimo klaida: ';
     23$PHPMAILER_LANG['smtp_connect_failed']  = 'SMTP susijungimo klaida';
     24$PHPMAILER_LANG['smtp_error']           = 'SMTP stoties klaida: ';
     25$PHPMAILER_LANG['variable_set']         = 'Nepavyko priskirti reikšmės kintamajam: ';
     26//$PHPMAILER_LANG['extension_missing']    = 'Extension missing: ';
  • new file wp-includes/PHPMailer/language/phpmailer.lang-lv.php

    diff --git wp-includes/PHPMailer/language/phpmailer.lang-lv.php wp-includes/PHPMailer/language/phpmailer.lang-lv.php
    new file mode 100644
    index 0000000..39bf9a1
    - +  
     1<?php
     2/**
     3 * Latvian PHPMailer language file: refer to English translation for definitive list
     4 * @package PHPMailer
     5 * @author Eduards M. <e@npd.lv>
     6 */
     7
     8$PHPMAILER_LANG['authenticate']         = 'SMTP kļūda: Autorizācija neizdevās.';
     9$PHPMAILER_LANG['connect_host']         = 'SMTP Kļūda: Nevar izveidot savienojumu ar SMTP serveri.';
     10$PHPMAILER_LANG['data_not_accepted']    = 'SMTP Kļūda: Nepieņem informāciju.';
     11$PHPMAILER_LANG['empty_message']        = 'Ziņojuma teksts ir tukšs';
     12$PHPMAILER_LANG['encoding']             = 'Neatpazīts kodējums: ';
     13$PHPMAILER_LANG['execute']              = 'Neizdevās izpildīt komandu: ';
     14$PHPMAILER_LANG['file_access']          = 'Fails nav pieejams: ';
     15$PHPMAILER_LANG['file_open']            = 'Faila kļūda: Nevar atvērt failu: ';
     16$PHPMAILER_LANG['from_failed']          = 'Nepareiza sūtītāja adrese: ';
     17$PHPMAILER_LANG['instantiate']          = 'Nevar palaist sūtīšanas funkciju.';
     18$PHPMAILER_LANG['invalid_address']      = 'Nepareiza adrese: ';
     19$PHPMAILER_LANG['mailer_not_supported'] = ' sūtītājs netiek atbalstīts.';
     20$PHPMAILER_LANG['provide_address']      = 'Lūdzu, norādiet vismaz vienu adresātu.';
     21$PHPMAILER_LANG['recipients_failed']    = 'SMTP kļūda: neizdevās nosūtīt šādiem saņēmējiem: ';
     22$PHPMAILER_LANG['signing']              = 'Autorizācijas kļūda: ';
     23$PHPMAILER_LANG['smtp_connect_failed']  = 'SMTP savienojuma kļūda';
     24$PHPMAILER_LANG['smtp_error']           = 'SMTP servera kļūda: ';
     25$PHPMAILER_LANG['variable_set']         = 'Nevar piešķirt mainīgā vērtību: ';
     26//$PHPMAILER_LANG['extension_missing']    = 'Extension missing: ';
  • new file wp-includes/PHPMailer/language/phpmailer.lang-ms.php

    diff --git wp-includes/PHPMailer/language/phpmailer.lang-ms.php wp-includes/PHPMailer/language/phpmailer.lang-ms.php
    new file mode 100644
    index 0000000..4e2c340
    - +  
     1<?php
     2/**
     3 * Malaysian PHPMailer language file: refer to English translation for definitive list
     4 * @package PHPMailer
     5 * @author Nawawi Jamili <nawawi@rutweb.com>
     6 */
     7
     8$PHPMAILER_LANG['authenticate']         = 'Ralat SMTP: Tidak dapat pengesahan.';
     9$PHPMAILER_LANG['connect_host']         = 'Ralat SMTP: Tidak dapat menghubungi hos pelayan SMTP.';
     10$PHPMAILER_LANG['data_not_accepted']    = 'Ralat SMTP: Data tidak diterima oleh pelayan.';
     11$PHPMAILER_LANG['empty_message']        = 'Tiada isi untuk mesej';
     12$PHPMAILER_LANG['encoding']             = 'Pengekodan tidak diketahui: ';
     13$PHPMAILER_LANG['execute']              = 'Tidak dapat melaksanakan: ';
     14$PHPMAILER_LANG['file_access']          = 'Tidak dapat mengakses fail: ';
     15$PHPMAILER_LANG['file_open']            = 'Ralat Fail: Tidak dapat membuka fail: ';
     16$PHPMAILER_LANG['from_failed']          = 'Berikut merupakan ralat dari alamat e-mel: ';
     17$PHPMAILER_LANG['instantiate']          = 'Tidak dapat memberi contoh fungsi e-mel.';
     18$PHPMAILER_LANG['invalid_address']      = 'Alamat emel tidak sah: ';
     19$PHPMAILER_LANG['mailer_not_supported'] = ' jenis penghantar emel tidak disokong.';
     20$PHPMAILER_LANG['provide_address']      = 'Anda perlu menyediakan sekurang-kurangnya satu alamat e-mel penerima.';
     21$PHPMAILER_LANG['recipients_failed']    = 'Ralat SMTP: Penerima e-mel berikut telah gagal: ';
     22$PHPMAILER_LANG['signing']              = 'Ralat pada tanda tangan: ';
     23$PHPMAILER_LANG['smtp_connect_failed']  = 'SMTP Connect() telah gagal.';
     24$PHPMAILER_LANG['smtp_error']           = 'Ralat pada pelayan SMTP: ';
     25$PHPMAILER_LANG['variable_set']         = 'Tidak boleh menetapkan atau menetapkan semula pembolehubah: ';
     26//$PHPMAILER_LANG['extension_missing']    = 'Extension missing: ';
  • new file wp-includes/PHPMailer/language/phpmailer.lang-nb.php

    diff --git wp-includes/PHPMailer/language/phpmailer.lang-nb.php wp-includes/PHPMailer/language/phpmailer.lang-nb.php
    new file mode 100644
    index 0000000..383dd51
    - +  
     1<?php
     2/**
     3 * Norwegian PHPMailer language file: refer to English translation for definitive list
     4 * @package PHPMailer
     5 */
     6
     7$PHPMAILER_LANG['authenticate']         = 'SMTP Feil: Kunne ikke autentisere.';
     8$PHPMAILER_LANG['connect_host']         = 'SMTP Feil: Kunne ikke koble til SMTP tjener.';
     9$PHPMAILER_LANG['data_not_accepted']    = 'SMTP Feil: Data ble ikke akseptert.';
     10$PHPMAILER_LANG['empty_message']        = 'Meldingsinnholdet er tomt';
     11$PHPMAILER_LANG['encoding']             = 'Ukjent tegnkoding: ';
     12$PHPMAILER_LANG['execute']              = 'Kunne ikke utføre: ';
     13$PHPMAILER_LANG['file_access']          = 'Får ikke tilgang til filen: ';
     14$PHPMAILER_LANG['file_open']            = 'Fil feil: Kunne ikke åpne filen: ';
     15$PHPMAILER_LANG['from_failed']          = 'Følgende avsenderadresse feilet: ';
     16$PHPMAILER_LANG['instantiate']          = 'Kunne ikke initialisere mailfunksjonen.';
     17$PHPMAILER_LANG['invalid_address']      = 'Meldingen ble ikke sendt, følgende adresse er ugyldig: ';
     18$PHPMAILER_LANG['provide_address']      = 'Du må angi minst en mottakeradresse.';
     19$PHPMAILER_LANG['mailer_not_supported'] = ' mailer er ikke supportert.';
     20$PHPMAILER_LANG['recipients_failed']    = 'SMTP Feil: Følgende mottagere feilet: ';
     21$PHPMAILER_LANG['signing']              = 'Signeringsfeil: ';
     22$PHPMAILER_LANG['smtp_connect_failed']  = 'SMTP Connect() feilet.';
     23$PHPMAILER_LANG['smtp_error']           = 'SMTP-serverfeil: ';
     24$PHPMAILER_LANG['variable_set']         = 'Kan ikke sette eller resette variabelen: ';
     25//$PHPMAILER_LANG['extension_missing']    = 'Extension missing: ';
  • new file wp-includes/PHPMailer/language/phpmailer.lang-nl.php

    diff --git wp-includes/PHPMailer/language/phpmailer.lang-nl.php wp-includes/PHPMailer/language/phpmailer.lang-nl.php
    new file mode 100644
    index 0000000..0fc38be
    - +  
     1<?php
     2/**
     3 * Dutch PHPMailer language file: refer to class.phpmailer.php for definitive list.
     4 * @package PHPMailer
     5 * @author Tuxion <team@tuxion.nl>
     6 */
     7
     8$PHPMAILER_LANG['authenticate']         = 'SMTP-fout: authenticatie mislukt.';
     9$PHPMAILER_LANG['connect_host']         = 'SMTP-fout: kon niet verbinden met SMTP-host.';
     10$PHPMAILER_LANG['data_not_accepted']    = 'SMTP-fout: data niet geaccepteerd.';
     11$PHPMAILER_LANG['empty_message']        = 'Berichttekst is leeg';
     12$PHPMAILER_LANG['encoding']             = 'Onbekende codering: ';
     13$PHPMAILER_LANG['execute']              = 'Kon niet uitvoeren: ';
     14$PHPMAILER_LANG['file_access']          = 'Kreeg geen toegang tot bestand: ';
     15$PHPMAILER_LANG['file_open']            = 'Bestandsfout: kon bestand niet openen: ';
     16$PHPMAILER_LANG['from_failed']          = 'Het volgende afzendersadres is mislukt: ';
     17$PHPMAILER_LANG['instantiate']          = 'Kon mailfunctie niet initialiseren.';
     18$PHPMAILER_LANG['invalid_address']      = 'Ongeldig adres: ';
     19$PHPMAILER_LANG['mailer_not_supported'] = ' mailer wordt niet ondersteund.';
     20$PHPMAILER_LANG['provide_address']      = 'Er moet minstens één ontvanger worden opgegeven.';
     21$PHPMAILER_LANG['recipients_failed']    = 'SMTP-fout: de volgende ontvangers zijn mislukt: ';
     22$PHPMAILER_LANG['signing']              = 'Signeerfout: ';
     23$PHPMAILER_LANG['smtp_connect_failed']  = 'SMTP Verbinding mislukt.';
     24$PHPMAILER_LANG['smtp_error']           = 'SMTP-serverfout: ';
     25$PHPMAILER_LANG['variable_set']         = 'Kan de volgende variabele niet instellen of resetten: ';
     26//$PHPMAILER_LANG['extension_missing']    = 'Extension missing: ';
  • new file wp-includes/PHPMailer/language/phpmailer.lang-pl.php

    diff --git wp-includes/PHPMailer/language/phpmailer.lang-pl.php wp-includes/PHPMailer/language/phpmailer.lang-pl.php
    new file mode 100644
    index 0000000..3da0dee
    - +  
     1<?php
     2/**
     3 * Polish PHPMailer language file: refer to English translation for definitive list
     4 * @package PHPMailer
     5 */
     6
     7$PHPMAILER_LANG['authenticate']         = 'Błąd SMTP: Nie można przeprowadzić uwierzytelnienia.';
     8$PHPMAILER_LANG['connect_host']         = 'Błąd SMTP: Nie można połączyć się z wybranym hostem.';
     9$PHPMAILER_LANG['data_not_accepted']    = 'Błąd SMTP: Dane nie zostały przyjęte.';
     10$PHPMAILER_LANG['empty_message']        = 'Wiadomość jest pusta.';
     11$PHPMAILER_LANG['encoding']             = 'Nieznany sposób kodowania znaków: ';
     12$PHPMAILER_LANG['execute']              = 'Nie można uruchomić: ';
     13$PHPMAILER_LANG['file_access']          = 'Brak dostępu do pliku: ';
     14$PHPMAILER_LANG['file_open']            = 'Nie można otworzyć pliku: ';
     15$PHPMAILER_LANG['from_failed']          = 'Następujący adres Nadawcy jest nieprawidłowy: ';
     16$PHPMAILER_LANG['instantiate']          = 'Nie można wywołać funkcji mail(). Sprawdź konfigurację serwera.';
     17$PHPMAILER_LANG['invalid_address']      = 'Nie można wysłać wiadomości, '.
     18    'następujący adres Odbiorcy jest nieprawidłowy: ';
     19$PHPMAILER_LANG['provide_address']      = 'Należy podać prawidłowy adres email Odbiorcy.';
     20$PHPMAILER_LANG['mailer_not_supported'] = 'Wybrana metoda wysyłki wiadomości nie jest obsługiwana.';
     21$PHPMAILER_LANG['recipients_failed']    = 'Błąd SMTP: Następujący odbiorcy są nieprawidłowi: ';
     22$PHPMAILER_LANG['signing']              = 'Błąd podpisywania wiadomości: ';
     23$PHPMAILER_LANG['smtp_connect_failed']  = 'SMTP Connect() zakończone niepowodzeniem.';
     24$PHPMAILER_LANG['smtp_error']           = 'Błąd SMTP: ';
     25$PHPMAILER_LANG['variable_set']         = 'Nie można ustawić lub zmodyfikować zmiennej: ';
     26$PHPMAILER_LANG['extension_missing']    = 'Brakujące rozszerzenie: ';
  • new file wp-includes/PHPMailer/language/phpmailer.lang-pt.php

    diff --git wp-includes/PHPMailer/language/phpmailer.lang-pt.php wp-includes/PHPMailer/language/phpmailer.lang-pt.php
    new file mode 100644
    index 0000000..f365d5d
    - +  
     1<?php
     2/**
     3 * Portuguese (European) PHPMailer language file: refer to English translation for definitive list
     4 * @package PHPMailer
     5 * @author Jonadabe <jonadabe@hotmail.com>
     6 */
     7
     8$PHPMAILER_LANG['authenticate']         = 'Erro do SMTP: Não foi possível realizar a autenticação.';
     9$PHPMAILER_LANG['connect_host']         = 'Erro do SMTP: Não foi possível realizar ligação com o servidor SMTP.';
     10$PHPMAILER_LANG['data_not_accepted']    = 'Erro do SMTP: Os dados foram rejeitados.';
     11$PHPMAILER_LANG['empty_message']        = 'A mensagem no e-mail está vazia.';
     12$PHPMAILER_LANG['encoding']             = 'Codificação desconhecida: ';
     13$PHPMAILER_LANG['execute']              = 'Não foi possível executar: ';
     14$PHPMAILER_LANG['file_access']          = 'Não foi possível aceder o ficheiro: ';
     15$PHPMAILER_LANG['file_open']            = 'Abertura do ficheiro: Não foi possível abrir o ficheiro: ';
     16$PHPMAILER_LANG['from_failed']          = 'Ocorreram falhas nos endereços dos seguintes remententes: ';
     17$PHPMAILER_LANG['instantiate']          = 'Não foi possível iniciar uma instância da função mail.';
     18$PHPMAILER_LANG['invalid_address']      = 'Não foi enviado nenhum e-mail para o endereço de e-mail inválido: ';
     19$PHPMAILER_LANG['mailer_not_supported'] = ' mailer não é suportado.';
     20$PHPMAILER_LANG['provide_address']      = 'Tem de fornecer pelo menos um endereço como destinatário do e-mail.';
     21$PHPMAILER_LANG['recipients_failed']    = 'Erro do SMTP: O endereço do seguinte destinatário falhou: ';
     22$PHPMAILER_LANG['signing']              = 'Erro ao assinar: ';
     23$PHPMAILER_LANG['smtp_connect_failed']  = 'SMTP Connect() falhou.';
     24$PHPMAILER_LANG['smtp_error']           = 'Erro de servidor SMTP: ';
     25$PHPMAILER_LANG['variable_set']         = 'Não foi possível definir ou redefinir a variável: ';
     26$PHPMAILER_LANG['extension_missing']    = 'Extensão em falta: ';
  • new file wp-includes/PHPMailer/language/phpmailer.lang-pt_br.php

    diff --git wp-includes/PHPMailer/language/phpmailer.lang-pt_br.php wp-includes/PHPMailer/language/phpmailer.lang-pt_br.php
    new file mode 100644
    index 0000000..fecbbe3
    - +  
     1<?php
     2/**
     3 * Brazilian Portuguese PHPMailer language file: refer to English translation for definitive list
     4 * @package PHPMailer
     5 * @author Paulo Henrique Garcia <paulo@controllerweb.com.br>
     6 * @author Lucas Guimarães <lucas@lucasguimaraes.com>
     7 * @author Phelipe Alves <phelipealvesdesouza@gmail.com>
     8 */
     9
     10$PHPMAILER_LANG['authenticate']         = 'Erro de SMTP: Não foi possível autenticar.';
     11$PHPMAILER_LANG['connect_host']         = 'Erro de SMTP: Não foi possível conectar ao servidor SMTP.';
     12$PHPMAILER_LANG['data_not_accepted']    = 'Erro de SMTP: Dados rejeitados.';
     13$PHPMAILER_LANG['empty_message']        = 'Mensagem vazia';
     14$PHPMAILER_LANG['encoding']             = 'Codificação desconhecida: ';
     15$PHPMAILER_LANG['execute']              = 'Não foi possível executar: ';
     16$PHPMAILER_LANG['file_access']          = 'Não foi possível acessar o arquivo: ';
     17$PHPMAILER_LANG['file_open']            = 'Erro de Arquivo: Não foi possível abrir o arquivo: ';
     18$PHPMAILER_LANG['from_failed']          = 'Os seguintes remententes falharam: ';
     19$PHPMAILER_LANG['instantiate']          = 'Não foi possível instanciar a função mail.';
     20$PHPMAILER_LANG['invalid_address']      = 'Endereço de e-mail inválido: ';
     21$PHPMAILER_LANG['mailer_not_supported'] = ' mailer não é suportado.';
     22$PHPMAILER_LANG['provide_address']      = 'Você deve informar pelo menos um destinatário.';
     23$PHPMAILER_LANG['recipients_failed']    = 'Erro de SMTP: Os seguintes destinatários falharam: ';
     24$PHPMAILER_LANG['signing']              = 'Erro de Assinatura: ';
     25$PHPMAILER_LANG['smtp_connect_failed']  = 'SMTP Connect() falhou.';
     26$PHPMAILER_LANG['smtp_error']           = 'Erro de servidor SMTP: ';
     27$PHPMAILER_LANG['variable_set']         = 'Não foi possível definir ou redefinir a variável: ';
     28$PHPMAILER_LANG['extension_missing']    = 'Extensão ausente: ';
  • new file wp-includes/PHPMailer/language/phpmailer.lang-ro.php

    diff --git wp-includes/PHPMailer/language/phpmailer.lang-ro.php wp-includes/PHPMailer/language/phpmailer.lang-ro.php
    new file mode 100644
    index 0000000..fa100ea
    - +  
     1<?php
     2/**
     3 * Romanian PHPMailer language file: refer to English translation for definitive list
     4 * @package PHPMailer
     5 * @author Alex Florea <alecz.fia@gmail.com>
     6 */
     7
     8$PHPMAILER_LANG['authenticate']         = 'Eroare SMTP: Autentificarea a eșuat.';
     9$PHPMAILER_LANG['connect_host']         = 'Eroare SMTP: Conectarea la serverul SMTP a eșuat.';
     10$PHPMAILER_LANG['data_not_accepted']    = 'Eroare SMTP: Datele nu au fost acceptate.';
     11$PHPMAILER_LANG['empty_message']        = 'Mesajul este gol.';
     12$PHPMAILER_LANG['encoding']             = 'Encodare necunoscută: ';
     13$PHPMAILER_LANG['execute']              = 'Nu se poate executa următoarea comandă:  ';
     14$PHPMAILER_LANG['file_access']          = 'Nu se poate accesa următorul fișier: ';
     15$PHPMAILER_LANG['file_open']            = 'Eroare fișier: Nu se poate deschide următorul fișier: ';
     16$PHPMAILER_LANG['from_failed']          = 'Următoarele adrese From au dat eroare: ';
     17$PHPMAILER_LANG['instantiate']          = 'Funcția mail nu a putut fi inițializată.';
     18$PHPMAILER_LANG['invalid_address']      = 'Adresa de email nu este validă: ';
     19$PHPMAILER_LANG['mailer_not_supported'] = ' mailer nu este suportat.';
     20$PHPMAILER_LANG['provide_address']      = 'Trebuie să adăugați cel puțin o adresă de email.';
     21$PHPMAILER_LANG['recipients_failed']    = 'Eroare SMTP: Următoarele adrese de email au eșuat: ';
     22$PHPMAILER_LANG['signing']              = 'A aparut o problemă la semnarea emailului. ';
     23$PHPMAILER_LANG['smtp_connect_failed']  = 'Conectarea la serverul SMTP a eșuat.';
     24$PHPMAILER_LANG['smtp_error']           = 'Eroare server SMTP: ';
     25$PHPMAILER_LANG['variable_set']         = 'Nu se poate seta/reseta variabila. ';
     26$PHPMAILER_LANG['extension_missing']    = 'Lipsește extensia: ';
  • new file wp-includes/PHPMailer/language/phpmailer.lang-ru.php

    diff --git wp-includes/PHPMailer/language/phpmailer.lang-ru.php wp-includes/PHPMailer/language/phpmailer.lang-ru.php
    new file mode 100644
    index 0000000..4066f6b
    - +  
     1<?php
     2/**
     3 * Russian PHPMailer language file: refer to English translation for definitive list
     4 * @package PHPMailer
     5 * @author Alexey Chumakov <alex@chumakov.ru>
     6 * @author Foster Snowhill <i18n@forstwoof.ru>
     7 */
     8
     9$PHPMAILER_LANG['authenticate']         = 'Ошибка SMTP: ошибка авторизации.';
     10$PHPMAILER_LANG['connect_host']         = 'Ошибка SMTP: не удается подключиться к серверу SMTP.';
     11$PHPMAILER_LANG['data_not_accepted']    = 'Ошибка SMTP: данные не приняты.';
     12$PHPMAILER_LANG['encoding']             = 'Неизвестный вид кодировки: ';
     13$PHPMAILER_LANG['execute']              = 'Невозможно выполнить команду: ';
     14$PHPMAILER_LANG['file_access']          = 'Нет доступа к файлу: ';
     15$PHPMAILER_LANG['file_open']            = 'Файловая ошибка: не удается открыть файл: ';
     16$PHPMAILER_LANG['from_failed']          = 'Неверный адрес отправителя: ';
     17$PHPMAILER_LANG['instantiate']          = 'Невозможно запустить функцию mail.';
     18$PHPMAILER_LANG['provide_address']      = 'Пожалуйста, введите хотя бы один адрес e-mail получателя.';
     19$PHPMAILER_LANG['mailer_not_supported'] = ' — почтовый сервер не поддерживается.';
     20$PHPMAILER_LANG['recipients_failed']    = 'Ошибка SMTP: отправка по следующим адресам получателей не удалась: ';
     21$PHPMAILER_LANG['empty_message']        = 'Пустое сообщение';
     22$PHPMAILER_LANG['invalid_address']      = 'Не отослано, неправильный формат email адреса: ';
     23$PHPMAILER_LANG['signing']              = 'Ошибка подписи: ';
     24$PHPMAILER_LANG['smtp_connect_failed']  = 'Ошибка соединения с SMTP-сервером';
     25$PHPMAILER_LANG['smtp_error']           = 'Ошибка SMTP-сервера: ';
     26$PHPMAILER_LANG['variable_set']         = 'Невозможно установить или переустановить переменную: ';
     27$PHPMAILER_LANG['extension_missing']    = 'Расширение отсутствует: ';
  • new file wp-includes/PHPMailer/language/phpmailer.lang-sk.php

    diff --git wp-includes/PHPMailer/language/phpmailer.lang-sk.php wp-includes/PHPMailer/language/phpmailer.lang-sk.php
    new file mode 100644
    index 0000000..a38f4e5
    - +  
     1<?php
     2/**
     3 * Slovak PHPMailer language file: refer to English translation for definitive list
     4 * @package PHPMailer
     5 * @author Michal Tinka <michaltinka@gmail.com>
     6 */
     7
     8$PHPMAILER_LANG['authenticate']         = 'SMTP Error: Chyba autentifikácie.';
     9$PHPMAILER_LANG['connect_host']         = 'SMTP Error: Nebolo možné nadviazať spojenie so SMTP serverom.';
     10$PHPMAILER_LANG['data_not_accepted']    = 'SMTP Error: Dáta neboli prijaté';
     11$PHPMAILER_LANG['empty_message']        = 'Prázdne telo správy.';
     12$PHPMAILER_LANG['encoding']             = 'Neznáme kódovanie: ';
     13$PHPMAILER_LANG['execute']              = 'Nedá sa vykonať: ';
     14$PHPMAILER_LANG['file_access']          = 'Súbor nebol nájdený: ';
     15$PHPMAILER_LANG['file_open']            = 'File Error: Súbor sa otvoriť pre čítanie: ';
     16$PHPMAILER_LANG['from_failed']          = 'Následujúca adresa From je nesprávna: ';
     17$PHPMAILER_LANG['instantiate']          = 'Nedá sa vytvoriť inštancia emailovej funkcie.';
     18$PHPMAILER_LANG['invalid_address']      = 'Neodoslané, emailová adresa je nesprávna: ';
     19$PHPMAILER_LANG['mailer_not_supported'] = ' emailový klient nieje podporovaný.';
     20$PHPMAILER_LANG['provide_address']      = 'Musíte zadať aspoň jednu emailovú adresu príjemcu.';
     21$PHPMAILER_LANG['recipients_failed']    = 'SMTP Error: Adresy príjemcov niesu správne ';
     22$PHPMAILER_LANG['signing']              = 'Chyba prihlasovania: ';
     23$PHPMAILER_LANG['smtp_connect_failed']  = 'SMTP Connect() zlyhalo.';
     24$PHPMAILER_LANG['smtp_error']           = 'SMTP chyba serveru: ';
     25$PHPMAILER_LANG['variable_set']         = 'Nemožno nastaviť alebo resetovať premennú: ';
     26//$PHPMAILER_LANG['extension_missing']    = 'Extension missing: ';
  • new file wp-includes/PHPMailer/language/phpmailer.lang-sl.php

    diff --git wp-includes/PHPMailer/language/phpmailer.lang-sl.php wp-includes/PHPMailer/language/phpmailer.lang-sl.php
    new file mode 100644
    index 0000000..54c9572
    - +  
     1<?php
     2/**
     3 * Slovene PHPMailer language file: refer to English translation for definitive list
     4 * @package PHPMailer
     5 * @author Klemen Tušar <techouse@gmail.com>
     6 */
     7
     8$PHPMAILER_LANG['authenticate']         = 'SMTP napaka: Avtentikacija ni uspela.';
     9$PHPMAILER_LANG['connect_host']         = 'SMTP napaka: Ne morem vzpostaviti povezave s SMTP gostiteljem.';
     10$PHPMAILER_LANG['data_not_accepted']    = 'SMTP napaka: Strežnik zavrača podatke.';
     11$PHPMAILER_LANG['empty_message']        = 'E-poštno sporočilo nima vsebine.';
     12$PHPMAILER_LANG['encoding']             = 'Nepoznan tip kodiranja: ';
     13$PHPMAILER_LANG['execute']              = 'Operacija ni uspela: ';
     14$PHPMAILER_LANG['file_access']          = 'Nimam dostopa do datoteke: ';
     15$PHPMAILER_LANG['file_open']            = 'Ne morem odpreti datoteke: ';
     16$PHPMAILER_LANG['from_failed']          = 'Neveljaven e-naslov pošiljatelja: ';
     17$PHPMAILER_LANG['instantiate']          = 'Ne morem inicializirati mail funkcije.';
     18$PHPMAILER_LANG['invalid_address']      = 'E-poštno sporočilo ni bilo poslano. E-naslov je neveljaven: ';
     19$PHPMAILER_LANG['mailer_not_supported'] = ' mailer ni podprt.';
     20$PHPMAILER_LANG['provide_address']      = 'Prosim vnesite vsaj enega naslovnika.';
     21$PHPMAILER_LANG['recipients_failed']    = 'SMTP napaka: Sledeči naslovniki so neveljavni: ';
     22$PHPMAILER_LANG['signing']              = 'Napaka pri podpisovanju: ';
     23$PHPMAILER_LANG['smtp_connect_failed']  = 'Ne morem vzpostaviti povezave s SMTP strežnikom.';
     24$PHPMAILER_LANG['smtp_error']           = 'Napaka SMTP strežnika: ';
     25$PHPMAILER_LANG['variable_set']         = 'Ne morem nastaviti oz. ponastaviti spremenljivke: ';
     26//$PHPMAILER_LANG['extension_missing']    = 'Extension missing: ';
  • new file wp-includes/PHPMailer/language/phpmailer.lang-sr.php

    diff --git wp-includes/PHPMailer/language/phpmailer.lang-sr.php wp-includes/PHPMailer/language/phpmailer.lang-sr.php
    new file mode 100644
    index 0000000..ed95ca6
    - +  
     1<?php
     2/**
     3 * Serbian PHPMailer language file: refer to English translation for definitive list
     4 * @package PHPMailer
     5 * @author Александар Јевремовић <ajevremovic@gmail.com>
     6 */
     7
     8$PHPMAILER_LANG['authenticate']         = 'SMTP грешка: аутентификација није успела.';
     9$PHPMAILER_LANG['connect_host']         = 'SMTP грешка: није могуће повезивање са SMTP сервером.';
     10$PHPMAILER_LANG['data_not_accepted']    = 'SMTP грешка: подаци нису прихваћени.';
     11$PHPMAILER_LANG['empty_message']        = 'Садржај поруке је празан.';
     12$PHPMAILER_LANG['encoding']             = 'Непознато кодовање: ';
     13$PHPMAILER_LANG['execute']              = 'Није могуће извршити наредбу: ';
     14$PHPMAILER_LANG['file_access']          = 'Није могуће приступити датотеци: ';
     15$PHPMAILER_LANG['file_open']            = 'Није могуће отворити датотеку: ';
     16$PHPMAILER_LANG['from_failed']          = 'SMTP грешка: слање са следећих адреса није успело: ';
     17$PHPMAILER_LANG['recipients_failed']    = 'SMTP грешка: слање на следеће адресе није успело: ';
     18$PHPMAILER_LANG['instantiate']          = 'Није могуће покренути mail функцију.';
     19$PHPMAILER_LANG['invalid_address']      = 'Порука није послата због неисправне адресе: ';
     20$PHPMAILER_LANG['mailer_not_supported'] = ' мејлер није подржан.';
     21$PHPMAILER_LANG['provide_address']      = 'Потребно је задати најмање једну адресу.';
     22$PHPMAILER_LANG['signing']              = 'Грешка приликом пријављивања: ';
     23$PHPMAILER_LANG['smtp_connect_failed']  = 'Повезивање са SMTP сервером није успело.';
     24$PHPMAILER_LANG['smtp_error']           = 'Грешка SMTP сервера: ';
     25$PHPMAILER_LANG['variable_set']         = 'Није могуће задати променљиву, нити је вратити уназад: ';
     26//$PHPMAILER_LANG['extension_missing']    = 'Extension missing: ';
  • new file wp-includes/PHPMailer/language/phpmailer.lang-sv.php

    diff --git wp-includes/PHPMailer/language/phpmailer.lang-sv.php wp-includes/PHPMailer/language/phpmailer.lang-sv.php
    new file mode 100644
    index 0000000..4408e63
    - +  
     1<?php
     2/**
     3 * Swedish PHPMailer language file: refer to English translation for definitive list
     4 * @package PHPMailer
     5 * @author Johan Linnér <johan@linner.biz>
     6 */
     7
     8$PHPMAILER_LANG['authenticate']         = 'SMTP fel: Kunde inte autentisera.';
     9$PHPMAILER_LANG['connect_host']         = 'SMTP fel: Kunde inte ansluta till SMTP-server.';
     10$PHPMAILER_LANG['data_not_accepted']    = 'SMTP fel: Data accepterades inte.';
     11//$PHPMAILER_LANG['empty_message']        = 'Message body empty';
     12$PHPMAILER_LANG['encoding']             = 'Okänt encode-format: ';
     13$PHPMAILER_LANG['execute']              = 'Kunde inte köra: ';
     14$PHPMAILER_LANG['file_access']          = 'Ingen åtkomst till fil: ';
     15$PHPMAILER_LANG['file_open']            = 'Fil fel: Kunde inte öppna fil: ';
     16$PHPMAILER_LANG['from_failed']          = 'Följande avsändaradress är felaktig: ';
     17$PHPMAILER_LANG['instantiate']          = 'Kunde inte initiera e-postfunktion.';
     18$PHPMAILER_LANG['invalid_address']      = 'Felaktig adress: ';
     19$PHPMAILER_LANG['provide_address']      = 'Du måste ange minst en mottagares e-postadress.';
     20$PHPMAILER_LANG['mailer_not_supported'] = ' mailer stöds inte.';
     21$PHPMAILER_LANG['recipients_failed']    = 'SMTP fel: Följande mottagare är felaktig: ';
     22$PHPMAILER_LANG['signing']              = 'Signerings fel: ';
     23$PHPMAILER_LANG['smtp_connect_failed']  = 'SMTP Connect() misslyckades.';
     24$PHPMAILER_LANG['smtp_error']           = 'SMTP server fel: ';
     25$PHPMAILER_LANG['variable_set']         = 'Kunde inte definiera eller återställa variabel: ';
     26$PHPMAILER_LANG['extension_missing']    = 'Tillägg ej tillgängligt: ';
  • new file wp-includes/PHPMailer/language/phpmailer.lang-tr.php

    diff --git wp-includes/PHPMailer/language/phpmailer.lang-tr.php wp-includes/PHPMailer/language/phpmailer.lang-tr.php
    new file mode 100644
    index 0000000..323fb4b
    - +  
     1<?php
     2/**
     3 * Turkish PHPMailer language file: refer to English translation for definitive list
     4 * @package PHPMailer
     5 * @author Elçin Özel
     6 * @author Can Yılmaz
     7 * @author Mehmet Benlioğlu
     8 * @author @yasinaydin
     9 */
     10
     11$PHPMAILER_LANG['authenticate']         = 'SMTP Hatası: Oturum açılamadı.';
     12$PHPMAILER_LANG['connect_host']         = 'SMTP Hatası: SMTP sunucusuna bağlanılamadı.';
     13$PHPMAILER_LANG['data_not_accepted']    = 'SMTP Hatası: Veri kabul edilmedi.';
     14$PHPMAILER_LANG['empty_message']        = 'Mesajın içeriği boş';
     15$PHPMAILER_LANG['encoding']             = 'Bilinmeyen karakter kodlama: ';
     16$PHPMAILER_LANG['execute']              = 'Çalıştırılamadı: ';
     17$PHPMAILER_LANG['file_access']          = 'Dosyaya erişilemedi: ';
     18$PHPMAILER_LANG['file_open']            = 'Dosya Hatası: Dosya açılamadı: ';
     19$PHPMAILER_LANG['from_failed']          = 'Belirtilen adreslere gönderme başarısız: ';
     20$PHPMAILER_LANG['instantiate']          = 'Örnek e-posta fonksiyonu oluşturulamadı.';
     21$PHPMAILER_LANG['invalid_address']      = 'Geçersiz e-posta adresi: ';
     22$PHPMAILER_LANG['mailer_not_supported'] = ' e-posta kütüphanesi desteklenmiyor.';
     23$PHPMAILER_LANG['provide_address']      = 'En az bir alıcı e-posta adresi belirtmelisiniz.';
     24$PHPMAILER_LANG['recipients_failed']    = 'SMTP Hatası: Belirtilen alıcılara ulaşılamadı: ';
     25$PHPMAILER_LANG['signing']              = 'İmzalama hatası: ';
     26$PHPMAILER_LANG['smtp_connect_failed']  = 'SMTP connect() fonksiyonu başarısız.';
     27$PHPMAILER_LANG['smtp_error']           = 'SMTP sunucu hatası: ';
     28$PHPMAILER_LANG['variable_set']         = 'Değişken ayarlanamadı ya da sıfırlanamadı: ';
     29//$PHPMAILER_LANG['extension_missing']    = 'Extension missing: ';
  • new file wp-includes/PHPMailer/language/phpmailer.lang-uk.php

    diff --git wp-includes/PHPMailer/language/phpmailer.lang-uk.php wp-includes/PHPMailer/language/phpmailer.lang-uk.php
    new file mode 100644
    index 0000000..9a7b346
    - +  
     1<?php
     2/**
     3 * Ukrainian PHPMailer language file: refer to English translation for definitive list
     4 * @package PHPMailer
     5 * @author Yuriy Rudyy <yrudyy@prs.net.ua>
     6 * @fixed by Boris Yurchenko <boris@yurchenko.pp.ua>
     7 */
     8
     9$PHPMAILER_LANG['authenticate']         = 'Помилка SMTP: помилка авторизації.';
     10$PHPMAILER_LANG['connect_host']         = 'Помилка SMTP: не вдається під\'єднатися до серверу SMTP.';
     11$PHPMAILER_LANG['data_not_accepted']    = 'Помилка SMTP: дані не прийняті.';
     12$PHPMAILER_LANG['encoding']             = 'Невідомий тип кодування: ';
     13$PHPMAILER_LANG['execute']              = 'Неможливо виконати команду: ';
     14$PHPMAILER_LANG['file_access']          = 'Немає доступу до файлу: ';
     15$PHPMAILER_LANG['file_open']            = 'Помилка файлової системи: не вдається відкрити файл: ';
     16$PHPMAILER_LANG['from_failed']          = 'Невірна адреса відправника: ';
     17$PHPMAILER_LANG['instantiate']          = 'Неможливо запустити функцію mail.';
     18$PHPMAILER_LANG['provide_address']      = 'Будь-ласка, введіть хоча б одну адресу e-mail отримувача.';
     19$PHPMAILER_LANG['mailer_not_supported'] = ' - поштовий сервер не підтримується.';
     20$PHPMAILER_LANG['recipients_failed']    = 'Помилка SMTP: відправлення наступним отримувачам не вдалося: ';
     21$PHPMAILER_LANG['empty_message']        = 'Пусте тіло повідомлення';
     22$PHPMAILER_LANG['invalid_address']      = 'Не відправлено, невірний формат адреси e-mail: ';
     23$PHPMAILER_LANG['signing']              = 'Помилка підпису: ';
     24$PHPMAILER_LANG['smtp_connect_failed']  = 'Помилка з\'єднання із SMTP-сервером';
     25$PHPMAILER_LANG['smtp_error']           = 'Помилка SMTP-сервера: ';
     26$PHPMAILER_LANG['variable_set']         = 'Неможливо встановити або перевстановити змінну: ';
     27//$PHPMAILER_LANG['extension_missing']    = 'Extension missing: ';
  • new file wp-includes/PHPMailer/language/phpmailer.lang-vi.php

    diff --git wp-includes/PHPMailer/language/phpmailer.lang-vi.php wp-includes/PHPMailer/language/phpmailer.lang-vi.php
    new file mode 100644
    index 0000000..c60dade
    - +  
     1<?php
     2/**
     3 * Vietnamese (Tiếng Việt) PHPMailer language file: refer to English translation for definitive list.
     4 * @package PHPMailer
     5 * @author VINADES.,JSC <contact@vinades.vn>
     6 */
     7
     8$PHPMAILER_LANG['authenticate']         = 'Lỗi SMTP: Không thể xác thực.';
     9$PHPMAILER_LANG['connect_host']         = 'Lỗi SMTP: Không thể kết nối máy chủ SMTP.';
     10$PHPMAILER_LANG['data_not_accepted']    = 'Lỗi SMTP: Dữ liệu không được chấp nhận.';
     11$PHPMAILER_LANG['empty_message']        = 'Không có nội dung';
     12$PHPMAILER_LANG['encoding']             = 'Mã hóa không xác định: ';
     13$PHPMAILER_LANG['execute']              = 'Không thực hiện được: ';
     14$PHPMAILER_LANG['file_access']          = 'Không thể truy cập tệp tin ';
     15$PHPMAILER_LANG['file_open']            = 'Lỗi Tập tin: Không thể mở tệp tin: ';
     16$PHPMAILER_LANG['from_failed']          = 'Lỗi địa chỉ gửi đi: ';
     17$PHPMAILER_LANG['instantiate']          = 'Không dùng được các hàm gửi thư.';
     18$PHPMAILER_LANG['invalid_address']      = 'Đại chỉ emai không đúng: ';
     19$PHPMAILER_LANG['mailer_not_supported'] = ' trình gửi thư không được hỗ trợ.';
     20$PHPMAILER_LANG['provide_address']      = 'Bạn phải cung cấp ít nhất một địa chỉ người nhận.';
     21$PHPMAILER_LANG['recipients_failed']    = 'Lỗi SMTP: lỗi địa chỉ người nhận: ';
     22$PHPMAILER_LANG['signing']              = 'Lỗi đăng nhập: ';
     23$PHPMAILER_LANG['smtp_connect_failed']  = 'Lỗi kết nối với SMTP';
     24$PHPMAILER_LANG['smtp_error']           = 'Lỗi máy chủ smtp ';
     25$PHPMAILER_LANG['variable_set']         = 'Không thể thiết lập hoặc thiết lập lại biến: ';
     26//$PHPMAILER_LANG['extension_missing']    = 'Extension missing: ';
  • new file wp-includes/PHPMailer/language/phpmailer.lang-zh.php

    diff --git wp-includes/PHPMailer/language/phpmailer.lang-zh.php wp-includes/PHPMailer/language/phpmailer.lang-zh.php
    new file mode 100644
    index 0000000..3e9e358
    - +  
     1<?php
     2/**
     3 * Traditional Chinese PHPMailer language file: refer to English translation for definitive list
     4 * @package PHPMailer
     5 * @author liqwei <liqwei@liqwei.com>
     6 * @author Peter Dave Hello <@PeterDaveHello/>
     7 * @author Jason Chiang <xcojad@gmail.com>
     8 */
     9
     10$PHPMAILER_LANG['authenticate']         = 'SMTP 錯誤:登入失敗。';
     11$PHPMAILER_LANG['connect_host']         = 'SMTP 錯誤:無法連線到 SMTP 主機。';
     12$PHPMAILER_LANG['data_not_accepted']    = 'SMTP 錯誤:無法接受的資料。';
     13$PHPMAILER_LANG['empty_message']        = '郵件內容為空';
     14$PHPMAILER_LANG['encoding']             = '未知編碼: ';
     15$PHPMAILER_LANG['execute']              = '無法執行:';
     16$PHPMAILER_LANG['file_access']          = '無法存取檔案:';
     17$PHPMAILER_LANG['file_open']            = '檔案錯誤:無法開啟檔案:';
     18$PHPMAILER_LANG['from_failed']          = '發送地址錯誤:';
     19$PHPMAILER_LANG['instantiate']          = '未知函數呼叫。';
     20$PHPMAILER_LANG['invalid_address']      = '因為電子郵件地址無效,無法傳送: ';
     21$PHPMAILER_LANG['mailer_not_supported'] = '不支援的發信客戶端。';
     22$PHPMAILER_LANG['provide_address']      = '必須提供至少一個收件人地址。';
     23$PHPMAILER_LANG['recipients_failed']    = 'SMTP 錯誤:以下收件人地址錯誤:';
     24$PHPMAILER_LANG['signing']              = '電子簽章錯誤: ';
     25$PHPMAILER_LANG['smtp_connect_failed']  = 'SMTP 連線失敗';
     26$PHPMAILER_LANG['smtp_error']           = 'SMTP 伺服器錯誤: ';
     27$PHPMAILER_LANG['variable_set']         = '無法設定或重設變數: ';
     28$PHPMAILER_LANG['extension_missing']    = '遺失模組 Extension: ';
  • new file wp-includes/PHPMailer/language/phpmailer.lang-zh_cn.php

    diff --git wp-includes/PHPMailer/language/phpmailer.lang-zh_cn.php wp-includes/PHPMailer/language/phpmailer.lang-zh_cn.php
    new file mode 100644
    index 0000000..d85a0b1
    - +  
     1<?php
     2/**
     3 * Simplified Chinese PHPMailer language file: refer to English translation for definitive list
     4 * @package PHPMailer
     5 * @author liqwei <liqwei@liqwei.com>
     6 * @author young <masxy@foxmail.com>
     7 */
     8
     9$PHPMAILER_LANG['authenticate']         = 'SMTP 错误:登录失败。';
     10$PHPMAILER_LANG['connect_host']         = 'SMTP 错误:无法连接到 SMTP 主机。';
     11$PHPMAILER_LANG['data_not_accepted']    = 'SMTP 错误:数据不被接受。';
     12$PHPMAILER_LANG['empty_message']        = '邮件正文为空。';
     13$PHPMAILER_LANG['encoding']             = '未知编码: ';
     14$PHPMAILER_LANG['execute']              = '无法执行:';
     15$PHPMAILER_LANG['file_access']          = '无法访问文件:';
     16$PHPMAILER_LANG['file_open']            = '文件错误:无法打开文件:';
     17$PHPMAILER_LANG['from_failed']          = '发送地址错误:';
     18$PHPMAILER_LANG['instantiate']          = '未知函数调用。';
     19$PHPMAILER_LANG['invalid_address']      = '发送失败,电子邮箱地址是无效的:';
     20$PHPMAILER_LANG['mailer_not_supported'] = '发信客户端不被支持。';
     21$PHPMAILER_LANG['provide_address']      = '必须提供至少一个收件人地址。';
     22$PHPMAILER_LANG['recipients_failed']    = 'SMTP 错误:收件人地址错误:';
     23$PHPMAILER_LANG['signing']              = '登录失败:';
     24$PHPMAILER_LANG['smtp_connect_failed']  = 'SMTP服务器连接失败。';
     25$PHPMAILER_LANG['smtp_error']           = 'SMTP服务器出错: ';
     26$PHPMAILER_LANG['variable_set']         = '无法设置或重置变量:';
     27//$PHPMAILER_LANG['extension_missing']    = 'Extension missing: ';
  • wp-includes/pluggable.php

    diff --git wp-includes/pluggable.php wp-includes/pluggable.php
    index 3e6fbe1..2ced529 100644
    function wp_mail( $to, $subject, $message, $headers = '', $attachments = array() 
    214214
    215215        // (Re)create it, if it's gone missing
    216216        if ( ! ( $phpmailer instanceof PHPMailer ) ) {
    217                 require_once ABSPATH . WPINC . '/class-phpmailer.php';
    218                 require_once ABSPATH . WPINC . '/class-smtp.php';
     217                require_once ABSPATH . WPINC . 'PHPMailer/class.phpmailer.php';
     218                require_once ABSPATH . WPINC . 'PHPMailer/class.smtp.php';
    219219                $phpmailer = new PHPMailer( true );
    220220        }
    221221
    function wp_text_diff( $left_string, $right_string, $args = null ) { 
    25062506        return $r;
    25072507}
    25082508endif;
    2509