From 34d2c9ca2a3bfdd2fdd93ce77e76e97b7c0dfb5e Mon Sep 17 00:00:00 2001 From: "o.pinke" Date: Thu, 9 Feb 2023 08:11:56 +0100 Subject: [PATCH 01/37] setup: add local defines file --- .gitignore | 1 + setup/lib/defines.php | 7 ++++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 28c19a2..94e22d4 100644 --- a/.gitignore +++ b/.gitignore @@ -22,3 +22,4 @@ /cms/data/config/production/config.mod_rewrite.php /cms/data/config/production/config.local.php /cms/cache/* +/setup/lib/defines.local.php diff --git a/setup/lib/defines.php b/setup/lib/defines.php index 1ee4ecd..596d2e8 100644 --- a/setup/lib/defines.php +++ b/setup/lib/defines.php @@ -39,4 +39,9 @@ define('C_SETUP_STEPWIDTH', 28); define('C_SETUP_STEPHEIGHT', 28); define('C_SETUP_MIN_PHP_VERSION', '7.4.0'); define('C_SETUP_MAX_PHP_VERSION', '8.3.0'); -define('C_SETUP_VERSION', '2.3.0 alpha'); +define('C_SETUP_VERSION', '2.3.0'); + +$sDefLocalPath = dirname(__FILE__).DIRECTORY_SEPARATOR.'defines.local.php'; +if(file_exists($sDefLocalPath)) { + include_once $sDefLocalPath; +} \ No newline at end of file From 7ca3bf10bb34dff4c2df8f3d8fdb6504cd3ccf19 Mon Sep 17 00:00:00 2001 From: "o.pinke" Date: Fri, 10 Feb 2023 10:57:30 +0100 Subject: [PATCH 02/37] recode wrapper functions; fixed encoding problems in mod translate; change handling for encoding and charset in page widget --- conlite/classes/class.genericdb.php | 2 +- conlite/classes/class.i18n.php | 2 +- .../classes/widgets/class.widgets.page.php | 8 +- .../external/endroid/qr-code/composer.json | 0 .../external/endroid/qr-code/src/QrCode.php | 0 .../includes/api/functions.api.general.php | 42 +++--- conlite/includes/functions.general.php | 64 +++++++- conlite/includes/functions.php54.php | 45 ++---- conlite/includes/include.mod_translate.php | 142 ++++++++---------- .../include.mod_translate_stringlist.php | 50 +++--- .../includes/include.pretplcfg_edit_form.php | 8 +- conlite/includes/startup.php | 2 +- conlite/plugins/cl-mod-rewrite | 2 +- .../standard/html5/template.generic_page.html | 1 - 14 files changed, 198 insertions(+), 170 deletions(-) mode change 100755 => 100644 conlite/external/endroid/qr-code/composer.json mode change 100755 => 100644 conlite/external/endroid/qr-code/src/QrCode.php diff --git a/conlite/classes/class.genericdb.php b/conlite/classes/class.genericdb.php index ee774fd..a3a070e 100644 --- a/conlite/classes/class.genericdb.php +++ b/conlite/classes/class.genericdb.php @@ -1311,7 +1311,7 @@ abstract class Item extends cItemBaseAbstract { * List of funcion names of the filtersused when data is retrieved from the db * @var array */ - protected $_arrOutFilters = array('stripslashes', 'htmldecode', 'urldecode'); + protected $_arrOutFilters = array('stripslashes', 'htmldecode','urldecode'); /** * Class name of meta object diff --git a/conlite/classes/class.i18n.php b/conlite/classes/class.i18n.php index 0c68760..469575e 100644 --- a/conlite/classes/class.i18n.php +++ b/conlite/classes/class.i18n.php @@ -130,7 +130,7 @@ class cI18n { // Is emulator to use? if (!$cfg['native_i18n']) { - return htmlentities(self::emulateGettext($string, $domain)); + return self::emulateGettext($string, $domain); } // Try to use native gettext implementation diff --git a/conlite/classes/widgets/class.widgets.page.php b/conlite/classes/widgets/class.widgets.page.php index de56dae..54495b7 100644 --- a/conlite/classes/widgets/class.widgets.page.php +++ b/conlite/classes/widgets/class.widgets.page.php @@ -320,8 +320,12 @@ class cPage extends cHTML { } $meta = ''; - if ($this->_encoding != "" && !$this->_isHtml5) { - $meta .= '' . "\n"; + if(!empty($this->_encoding)) { + if($this->_isHtml5) { + $meta .= '' . "\n"; + } else { + $meta .= '' . "\n"; + } } if ($this->_object !== false && method_exists($this->_object, "render")) { diff --git a/conlite/external/endroid/qr-code/composer.json b/conlite/external/endroid/qr-code/composer.json old mode 100755 new mode 100644 diff --git a/conlite/external/endroid/qr-code/src/QrCode.php b/conlite/external/endroid/qr-code/src/QrCode.php old mode 100755 new mode 100644 diff --git a/conlite/includes/api/functions.api.general.php b/conlite/includes/api/functions.api.general.php index 8b54d7e..f250631 100644 --- a/conlite/includes/api/functions.api.general.php +++ b/conlite/includes/api/functions.api.general.php @@ -1,4 +1,5 @@ = 2) { $tmp = $aPaths[1]; $aPaths[1] = $aPaths[$iLast]; @@ -176,14 +175,14 @@ function contenido_include($sWhere, $sWhat, $bForce = false, $bReturnPath = fals if ($bError) { $aBackTrace = debug_backtrace(); - if(is_array($aBackTrace[1])) { - $sError = " in ".$aBackTrace[1]['file'] - ." on line ".$aBackTrace[1]['line'] - ." function: ".$aBackTrace[1]['function']." "; + if (is_array($aBackTrace[1])) { + $sError = " in " . $aBackTrace[1]['file'] + . " on line " . $aBackTrace[1]['line'] + . " function: " . $aBackTrace[1]['function'] . " "; } else { $sError = ""; } - + trigger_error("Can't include $sInclude $sError", E_USER_ERROR); return; } @@ -196,7 +195,6 @@ function contenido_include($sWhere, $sWhat, $bForce = false, $bReturnPath = fals } } - /** * Shortcut to contenido_include. * @@ -207,8 +205,7 @@ function contenido_include($sWhere, $sWhat, $bForce = false, $bReturnPath = fals * @param bool $bForce If true, force the file to be included * @return void */ -function cInclude($sWhere, $sWhat, $bForce = false) -{ +function cInclude($sWhere, $sWhat, $bForce = false) { contenido_include($sWhere, $sWhat, $bForce); } @@ -224,21 +221,18 @@ function cInclude($sWhere, $sWhat, $bForce = false) */ function plugin_include($sWhere, $sWhat) { global $cfg; - $sInclude = $cfg['path']['contenido'] . $cfg['path']['plugins'] . $sWhere. '/' . $sWhat; - if(is_readable($sInclude)) { + $sInclude = $cfg['path']['contenido'] . $cfg['path']['plugins'] . $sWhere . '/' . $sWhat; + if (is_readable($sInclude)) { include_once($sInclude); } else { $sCaller = ""; $aTrace = debug_backtrace(); - foreach($aTrace as $iKey=>$aValue) { - if($aValue['function'] == __METHOD__) { - $sCaller = $aValue['file']." line ".$aValue['line']; + foreach ($aTrace as $iKey => $aValue) { + if ($aValue['function'] == __METHOD__) { + $sCaller = $aValue['file'] . " line " . $aValue['line']; break; } - } - trigger_error("Function ".__METHOD__.": Can't include $sInclude in ".$sCaller, E_USER_WARNING); + } + trigger_error("Function " . __METHOD__ . ": Can't include $sInclude in " . $sCaller, E_USER_WARNING); } } - - -?> \ No newline at end of file diff --git a/conlite/includes/functions.general.php b/conlite/includes/functions.general.php index 8fc9813..a0c46a8 100644 --- a/conlite/includes/functions.general.php +++ b/conlite/includes/functions.general.php @@ -2221,4 +2221,66 @@ function IP_match($network, $mask, $ip) { } } -?> \ No newline at end of file +/** + * Wrapper for php-function htmlspecialchars + * + * @author Ortwin Pinke + * @since 2.3.0 + * @uses htmlspecialchars php-function + * + * @param string $value + * @param int $flags + * @param string $encoding default UTF-8 + * @return string Returns the converted string + */ +function clHtmlSpecialChars(string $value, int $flags = ENT_COMPAT|ENT_HTML401, string $encoding = 'UTF-8') { + return htmlspecialchars($value, $flags, $encoding); +} + +/** + * Wrapper for php-function html_entity_decode + * + * @author Ortwin Pinke + * @since 2.3.0 + * @uses html_entity_decode php-function + * + * @param string $value + * @param int $flags + * @param string $encoding default UTF-8 + * @return string Returns the decoded string + */ +function clHtmlEntityDecode(string $value, int $flags = ENT_COMPAT|ENT_HTML401, string $encoding = 'UTF-8') { + return html_entity_decode($value, $flags, $encoding); +} + +/** + * Wrapper for php-function htmlentities + * + * @author Ortwin Pinke + * @since 2.3.0 + * @uses htmlentities php-function + * + * @param string $value + * @param int $flags + * @param string $encoding default UTF-8 + * @return string Returns the converted string + */ +function clHtmlEntities(string $value, int $flags = ENT_COMPAT|ENT_HTML401, string $encoding = 'UTF-8') { + return htmlentities($value, $flags, $encoding); +} + +/** + * Wrapper for php-function get_html_translation_table + * + * @author Ortwin Pinke + * @since 2.3.0 + * @uses get_html_translation_table php-function + * + * @param int $table + * @param int $flags + * @param string $encoding + * @return array + */ +function clGetHtmlTranslationTable(int $table = HTML_SPECIALCHARS, int $flags = ENT_COMPAT|ENT_HTML401, string $encoding = null) { + return get_html_translation_table($table, $flags, $encoding); +} \ No newline at end of file diff --git a/conlite/includes/functions.php54.php b/conlite/includes/functions.php54.php index c9c335b..f037d44 100644 --- a/conlite/includes/functions.php54.php +++ b/conlite/includes/functions.php54.php @@ -60,10 +60,11 @@ function clPhp54FixedFunc($funcname, $value, $flags = '', $encoding = '') { * @param string $encoding * @return string */ +/* function clHtmlSpecialChars($value, $flags = '', $encoding = '') { return clPhp54FixedFunc("htmlspecialchars", $value, $flags, $encoding); } - +*/ /** * * @uses clPhp54FixedFunc multi fix func for PHP5.4 @@ -74,9 +75,12 @@ function clHtmlSpecialChars($value, $flags = '', $encoding = '') { * @param string $encoding * @return string */ +/* function clHtmlEntityDecode($value, $flags = '', $encoding = '') { return clPhp54FixedFunc("html_entity_decode", $value, $flags, $encoding); } + * + */ /** * @@ -88,9 +92,12 @@ function clHtmlEntityDecode($value, $flags = '', $encoding = '') { * @param string $encoding * @return string */ +/* function clHtmlEntities($value, $flags = '', $encoding = '') { return clPhp54FixedFunc("htmlentities", $value, $flags, $encoding); } + * + */ /** * @@ -101,9 +108,12 @@ function clHtmlEntities($value, $flags = '', $encoding = '') { * @param mixed $flags * @return string */ +/* function clGetHtmlTranslationTable($table = '', $flags = '') { return clPhp54FixedFunc("get_html_translation_table", $table, $flags); } + * + */ // hold old functions from con 4.8 but use new ConLite functions, mark them as deprecated @@ -112,38 +122,11 @@ function clGetHtmlTranslationTable($table = '', $flags = '') { * Use compatible clHtmlSpecialChars instead * @deprecated since version 2.0 */ +/** if (function_exists('conHtmlSpecialChars') == false) { function conHtmlSpecialChars($value, $flags = '', $encoding = '') { return clHtmlSpecialChars($value, $flags, $encoding); } } - -/** - * Use compatible clHtmlEntityDecode instead - * @deprecated since version 2.0 - */ -if (function_exists('conHtmlEntityDecode') == false) { - function conHtmlEntityDecode($value, $flags = '', $encoding = '') { - return clHtmlEntityDecode($value, $flags, $encoding); - } -} - -/** - * Use compatible clHtmlEntities instead - * @deprecated since version 2.0 - */ -if (function_exists('conHtmlentities') == false) { - function conHtmlentities($value, $flags = '', $encoding = '') { - return clHtmlEntities($value, $flags, $encoding); - } -} - -/** - * Use compatible clGetHtmlTranslationTable instead - * @deprecated since version 2.0 - */ -if (function_exists('conGetHtmlTranslationTable') == false) { - function conGetHtmlTranslationTable($table = '', $flags = '') { - return clGetHtmlTranslationTable($table, $flags); - } -} \ No newline at end of file + * + */ \ No newline at end of file diff --git a/conlite/includes/include.mod_translate.php b/conlite/includes/include.mod_translate.php index 701a2f7..4a2b5a8 100644 --- a/conlite/includes/include.mod_translate.php +++ b/conlite/includes/include.mod_translate.php @@ -1,4 +1,5 @@ get("name") . ' ('.$lang.')'; +$langstring = $langobj->get("name") . ' (' . $lang . ')'; $moduletranslations = new cApiModuleTranslationCollection; $module = new cApiModule($idmod); -if ($action == "mod_translation_save") -{ - $strans = new cApiModuleTranslation; - $strans->loadByPrimaryKey($idmodtranslation); +if ($action == "mod_translation_save") { + $strans = new cApiModuleTranslation; + $strans->loadByPrimaryKey($idmodtranslation); - if ($strans->get("idmod") == $idmod) - { - $module->setTranslatedName($translatedname); + if ($strans->get("idmod") == $idmod) { + $module->setTranslatedName($translatedname); - $strans->set("translation", stripslashes($t_trans)); - $strans->store(); + $strans->set("translation", stripslashes($t_trans)); + $strans->store(); - /* Increase idmodtranslation */ - $moduletranslations->select("idmod = '$idmod' AND idlang = '$lang'"); + /* Increase idmodtranslation */ + $moduletranslations->select("idmod = '$idmod' AND idlang = '$lang'"); - while ($mitem = $moduletranslations->next()) - { - if ($mitem->get("idmodtranslation") == $idmodtranslation) - { - $mitem2 = $moduletranslations->next(); + while ($mitem = $moduletranslations->next()) { + if ($mitem->get("idmodtranslation") == $idmodtranslation) { + $mitem2 = $moduletranslations->next(); - if (is_object($mitem2)) - { - $idmodtranslation = $mitem2->get("idmodtranslation"); - break; - } - } - } - } + if (is_object($mitem2)) { + $idmodtranslation = $mitem2->get("idmodtranslation"); + break; + } + } + } + } } -if ($action == "mod_importexport_translation") -{ - if ($mode == "export") - { - $sFileName = uplCreateFriendlyName(strtolower($module->get("name") . "_" . $langobj->get("name"))); +if ($action == "mod_importexport_translation") { + if ($mode == "export") { + $sFileName = uplCreateFriendlyName(strtolower($module->get("name") . "_" . $langobj->get("name"))); - if ($sFileName != "") - { - $moduletranslations->export($idmod, $lang, $sFileName . ".xml"); - } - } - if ($mode == "import") - { - if (file_exists($_FILES["upload"]["tmp_name"])) - { - $moduletranslations->import($idmod, $lang, $_FILES["upload"]["tmp_name"]); - } - } -} + if ($sFileName != "") { + $moduletranslations->export($idmod, $lang, $sFileName . ".xml"); + } + } + if ($mode == "import") { + if (file_exists($_FILES["upload"]["tmp_name"])) { + $moduletranslations->import($idmod, $lang, $_FILES["upload"]["tmp_name"]); + } + } +} -if (!isset($idmodtranslation)) -{ - $idmodtranslation = 0; +if (!isset($idmodtranslation)) { + $idmodtranslation = 0; } $mtrans = new cApiModuleTranslation; $mtrans->loadByPrimaryKey($idmodtranslation); -if ($mtrans->get("idmod") != $idmod) -{ - $moduletranslations->select("idmod = '$idmod' AND idlang = '$lang'", '', 'idmodtranslation DESC', '1'); - $mtrans = $moduletranslations->next(); - - if (is_object($mtrans)) - { - $idmodtranslation = $mtrans->get("idmodtranslation"); - } else { - $mtrans = new cApiModuleTranslation; - } +if ($mtrans->get("idmod") != $idmod) { + $moduletranslations->select("idmod = '$idmod' AND idlang = '$lang'", '', 'idmodtranslation DESC', '1'); + $mtrans = $moduletranslations->next(); + + if (is_object($mtrans)) { + $idmodtranslation = $mtrans->get("idmodtranslation"); + } else { + $mtrans = new cApiModuleTranslation; + } } $strings = $module->parseModuleForStrings(); /* Insert new strings */ -foreach ($strings as $string) -{ - $moduletranslations->create($idmod, $lang, $string); +foreach ($strings as $string) { + $moduletranslations->create($idmod, $lang, $string); } $moduletranslations->select("idmod = '$idmod' AND idlang = '$lang'"); -while ($d_modtrans = $moduletranslations->next()) -{ - if (!in_array($d_modtrans->get("original"), $strings)) - { - $moduletranslations->delete($d_modtrans->get("idmodtranslation")); - } +while ($d_modtrans = $moduletranslations->next()) { + if (!in_array($d_modtrans->get("original"), $strings)) { + $moduletranslations->delete($d_modtrans->get("idmodtranslation")); + } } $page = new cPage; +$page->setHtml5(); +$page->setEncoding('UTF-8'); $form = new UI_Table_Form("translation"); $form->addHeader(sprintf(i18n("Translate module '%s'"), $module->get("name"))); @@ -142,7 +128,7 @@ $form->setVar("idmod", $idmod); $form->setVar("idmodtranslation", $idmodtranslation); $form->setVar("action", "mod_translation_save"); -$transmodname = new cHTMLTextbox("translatedname", $module->getTranslatedName(),60); +$transmodname = new cHTMLTextbox("translatedname", $module->getTranslatedName(), 60); $form->add(i18n("Translated Name"), $transmodname); @@ -152,22 +138,21 @@ $ilink->setCustom("idmod", $idmod); $ilink->setCustom("idmodtranslation", $mtrans->get("idmodtranslation")); $ilink->setAnchor($mtrans->get("idmodtranslation")); -$iframe = ''; +$iframe = ''; -$table = ''; +$table = '
'.i18n("Original module string").''.sprintf(i18n("Translation for %s"), $langstring).' 
'.$iframe.'
'; -$original = new cHTMLTextarea("t_orig",clHtmlSpecialChars($mtrans->get("original"))); +$original = new cHTMLTextarea("t_orig", clHtmlSpecialChars($mtrans->get("original"))); $original->setStyle("width: 300px;"); -$translated = new cHTMLTextarea("t_trans",clHtmlSpecialChars($mtrans->get("translation"))); +$translated = new cHTMLTextarea("t_trans", $mtrans->get("translation")); $translated->setStyle("width: 300px;"); -$table .= '
' . i18n("Original module string") . '' . sprintf(i18n("Translation for %s"), $langstring) . ' 
' . $iframe . '
'.$original->render().''.$translated->render().' 
'; +$table .= '' . $original->render() . '' . $translated->render() . ' '; $table .= i18n("Hint: Hit ALT+SHIFT+S to save the translated entry and advance to the next string."); $form->add(i18n("String list"), $table); $mark = ''; - $import = new cHTMLRadiobutton("mode", "import"); $export = new cHTMLRadiobutton("mode", "export"); $export->setLabelText(i18n("Export to file")); @@ -189,15 +174,14 @@ $form2->setVar("idmod", $idmod); $form2->setVar("idmodtranslation", $idmodtranslation); $form2->custom["submit"]["accesskey"] = ''; -$page->setContent($form->render(). $mark ."
". $form2->render()); +$page->setContent($form->render() . $mark . "
" . $form2->render()); $page->setMarkScript(2); $clang = new cApiLanguage($lang); $page->setEncoding($clang->get("encoding")); -if (!($action == "mod_importexport_translation" && $mode == "export")) -{ - $page->render(); +if (!($action == "mod_importexport_translation" && $mode == "export")) { + $page->render(); } ?> \ No newline at end of file diff --git a/conlite/includes/include.mod_translate_stringlist.php b/conlite/includes/include.mod_translate_stringlist.php index d11653c..ab03558 100644 --- a/conlite/includes/include.mod_translate_stringlist.php +++ b/conlite/includes/include.mod_translate_stringlist.php @@ -1,4 +1,5 @@ select("idmod = '$idmod' AND idlang='$lang'"); $page = new cPage; +$page->setHtml5(); +$page->setEncoding('UTF-8'); $page->setMargin(0); $v = ''; @@ -46,32 +48,35 @@ $link->setCLink("mod_translate", 4, ""); $mylink = new cHTMLLink; -while ($translation = $translations->next()) -{ - $string = $translation->get("original"); - $tstring = $translation->get("translation"); - +while ($translation = $translations->next()) { + + $string = utf8_encode($translation->get("original")); + $tstring = utf8_encode($translation->get("translation")); + $link->setCustom("idmod", $idmod); $link->setCustom("idmodtranslation", $translation->get("idmodtranslation")); $href = $link->getHREF(); - - $mylink->setLink('javascript:parent.location="'.$href.'"'); + + $mylink->setLink('javascript:parent.location="' . $href . '"'); $mylink->setContent($string); - $dark = !$dark; + $dark = !$dark; - if ($dark) - { - $bgcol = $cfg["color"]["table_dark"]; - } else { - $bgcol = $cfg["color"]["table_light"]; - } + if ($dark) { + $bgcol = $cfg["color"]["table_dark"]; + } else { + $bgcol = $cfg["color"]["table_light"]; + } - if ($idmodtranslation == $translation->get("idmodtranslation")) - { - $bgcol = $cfg["color"]["table_active"]; - } - $v .= ''; + if ($idmodtranslation == $translation->get("idmodtranslation")) { + $bgcol = $cfg["color"]["table_active"]; + } + $v .= ''."\n" + . ''."\n" + . ''."\n" + . ''."\n"; } $v .= '
'.$mylink->render().''.$tstring.'
'."\n" + . ''."\n" + . $mylink->render() . '' . $tstring . '
'; @@ -82,5 +87,4 @@ $clang = new cApiLanguage($lang); $page->setEncoding($clang->get("encoding")); $page->render(); - ?> \ No newline at end of file diff --git a/conlite/includes/include.pretplcfg_edit_form.php b/conlite/includes/include.pretplcfg_edit_form.php index 8cc4e41..17fbf4c 100644 --- a/conlite/includes/include.pretplcfg_edit_form.php +++ b/conlite/includes/include.pretplcfg_edit_form.php @@ -50,8 +50,8 @@ $formaction = $sess->url("main.php"); # $hidden = ' - - + + @@ -154,7 +154,5 @@ $buttons = ''; $tpl->set('s', 'BUTTONS', $buttons); - # Generate template -$tpl->generate($cfg['path']['templates'] . $cfg['templates']['tplcfg_edit_form']); -?> \ No newline at end of file +$tpl->generate($cfg['path']['templates'] . $cfg['templates']['tplcfg_edit_form']); \ No newline at end of file diff --git a/conlite/includes/startup.php b/conlite/includes/startup.php index 9a51ad9..451bffb 100644 --- a/conlite/includes/startup.php +++ b/conlite/includes/startup.php @@ -71,7 +71,7 @@ if (!defined('CL_ENVIRONMENT')) { */ if (!defined('CL_VERSION')) { -define('CL_VERSION', '2.2.0 beta'); +define('CL_VERSION', '2.3.0 RC'); } diff --git a/conlite/plugins/cl-mod-rewrite b/conlite/plugins/cl-mod-rewrite index 91b0fd8..4c3d78a 160000 --- a/conlite/plugins/cl-mod-rewrite +++ b/conlite/plugins/cl-mod-rewrite @@ -1 +1 @@ -Subproject commit 91b0fd8c15cdf1b5e9704c8720a40f959e7eb4fe +Subproject commit 4c3d78a0443921bdc3adcaf89c151d94e8f4a876 diff --git a/conlite/templates/standard/html5/template.generic_page.html b/conlite/templates/standard/html5/template.generic_page.html index 47ef937..eea3476 100644 --- a/conlite/templates/standard/html5/template.generic_page.html +++ b/conlite/templates/standard/html5/template.generic_page.html @@ -1,7 +1,6 @@ - {META} From 3f15c205a04d7b9d244ac3c0fcffdb2d7cd2c98b Mon Sep 17 00:00:00 2001 From: "o.pinke" Date: Fri, 10 Feb 2023 11:03:53 +0100 Subject: [PATCH 03/37] remove end tag php --- cms/includes/class.input.helper.php | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/cms/includes/class.input.helper.php b/cms/includes/class.input.helper.php index bd0bc52..f4c8c04 100644 --- a/cms/includes/class.input.helper.php +++ b/cms/includes/class.input.helper.php @@ -525,6 +525,4 @@ class UI_Config_Table { } } -} - -?> \ No newline at end of file +} \ No newline at end of file From af5bf9be94e0ad0758e7ba1c54edb34f48359d6d Mon Sep 17 00:00:00 2001 From: "o.pinke" Date: Fri, 10 Feb 2023 11:06:45 +0100 Subject: [PATCH 04/37] gitadmin: add ignore --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 94e22d4..c1ac363 100644 --- a/.gitignore +++ b/.gitignore @@ -23,3 +23,4 @@ /cms/data/config/production/config.local.php /cms/cache/* /setup/lib/defines.local.php +/cms/js/fancybox/ From d3e73bfe0aa3d0247e44a0501bf84eae38f8f50c Mon Sep 17 00:00:00 2001 From: "o.pinke" Date: Fri, 10 Feb 2023 11:43:45 +0100 Subject: [PATCH 05/37] add utf8_encode to out filter of item class; --- conlite/classes/class.genericdb.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/conlite/classes/class.genericdb.php b/conlite/classes/class.genericdb.php index a3a070e..ba08eda 100644 --- a/conlite/classes/class.genericdb.php +++ b/conlite/classes/class.genericdb.php @@ -1311,7 +1311,7 @@ abstract class Item extends cItemBaseAbstract { * List of funcion names of the filtersused when data is retrieved from the db * @var array */ - protected $_arrOutFilters = array('stripslashes', 'htmldecode','urldecode'); + protected $_arrOutFilters = array('stripslashes', 'htmldecode','urldecode', 'utf8_encode'); /** * Class name of meta object From efa03003be6f0ca0c03c69e06ba845f2bda6fac8 Mon Sep 17 00:00:00 2001 From: "o.pinke" Date: Fri, 10 Feb 2023 11:45:26 +0100 Subject: [PATCH 06/37] fixed bug with empty file information array --- .../includes/include.html_tpl_edit_form.php | 7 ++++- conlite/includes/include.js_edit_form.php | 7 ++++- conlite/includes/include.style_edit_form.php | 31 +++++++++++-------- .../standard/template.tplcfg_edit_form.html | 2 +- 4 files changed, 31 insertions(+), 16 deletions(-) diff --git a/conlite/includes/include.html_tpl_edit_form.php b/conlite/includes/include.html_tpl_edit_form.php index 15b78ff..d3a5346 100644 --- a/conlite/includes/include.html_tpl_edit_form.php +++ b/conlite/includes/include.html_tpl_edit_form.php @@ -174,6 +174,11 @@ if (!$perm->have_perm_area_action($area, $action)) { } $aFileInfo = getFileInformation($client, $sTempFilename, $sTypeContent, $db); + if(!empty($aFileInfo["description"])) { + $sDescription = clHtmlSpecialChars($aFileInfo["description"]); + } else { + $sDescription = ''; + } $form = new UI_Table_Form("file_editor"); $form->addHeader(i18n("Edit file")); @@ -186,7 +191,7 @@ if (!$perm->have_perm_area_action($area, $action)) { $tb_name = new cHTMLTextbox("file", $sFilename, 60); $ta_code = new cHTMLTextarea("code", clHtmlSpecialChars($sCode), 100, 35, "code"); - $descr = new cHTMLTextarea("description", clHtmlSpecialChars($aFileInfo["description"]), 100, 5); + $descr = new cHTMLTextarea("description", $sDescription, 100, 5); $ta_code->setStyle("font-family: monospace;width: 100%;"); $descr->setStyle("font-family: monospace;width: 100%;"); diff --git a/conlite/includes/include.js_edit_form.php b/conlite/includes/include.js_edit_form.php index 3c663b1..0f03770 100644 --- a/conlite/includes/include.js_edit_form.php +++ b/conlite/includes/include.js_edit_form.php @@ -134,6 +134,11 @@ if (!$perm->have_perm_area_action($area, $action)) { # generate edit form if (isset($_REQUEST['action'])) { $aFileInfo = getFileInformation($client, $sFilename, $sTypeContent, $db); + if(!empty($aFileInfo["description"])) { + $sDescription = clHtmlSpecialChars($aFileInfo["description"]); + } else { + $sDescription = ''; + } $sAction = ($bEdit) ? $sActionEdit : $_REQUEST['action']; @@ -154,7 +159,7 @@ if (!$perm->have_perm_area_action($area, $action)) { $tb_name = new cHTMLTextbox("file", $sFilename, 60); $ta_code = new cHTMLTextarea("code", clHtmlSpecialChars($sCode), 100, 35, "code"); - $descr = new cHTMLTextarea("description", clHtmlSpecialChars($aFileInfo["description"]), 100, 5); + $descr = new cHTMLTextarea("description", $sDescription, 100, 5); $ta_code->setStyle("font-family: monospace;width: 100%;"); $descr->setStyle("font-family: monospace;width: 100%;"); diff --git a/conlite/includes/include.style_edit_form.php b/conlite/includes/include.style_edit_form.php index 078bcc7..4c6b271 100644 --- a/conlite/includes/include.style_edit_form.php +++ b/conlite/includes/include.style_edit_form.php @@ -158,11 +158,9 @@ if (!$perm->have_perm_area_action($area, $action)) { if ($_REQUEST['action'] == $sActionEdit) { $sCode = getFileContent($sFilename, $path); } else { - $sCode = $_REQUEST['code']; # stripslashes is required here in case of creating a new file + $sCode = $_REQUEST['code']; } - $aFileInfo = getFileInformation($client, $sTempFilename, "css", $db); - $form = new UI_Table_Form("file_editor"); $form->addHeader(i18n("Edit file")); $form->setWidth("100%"); @@ -173,16 +171,24 @@ if (!$perm->have_perm_area_action($area, $action)) { $form->setVar("tmp_file", $sTempFilename); $tb_name = new cHTMLTextbox("file", $sFilename, 60); - $ta_code = new cHTMLTextarea("code", clHtmlSpecialChars($sCode), 100, 35, "code"); - $descr = new cHTMLTextarea("description", clHtmlSpecialChars($aFileInfo["description"]), 100, 5); - - $ta_code->setStyle("font-family: monospace;width: 100%;"); - $descr->setStyle("font-family: monospace;width: 100%;"); - $ta_code->updateAttributes(array("wrap" => getEffectiveSetting('style_editor', 'wrap', 'off'))); - $form->add(i18n("Name"), $tb_name); - $form->add(i18n("Description"), $descr->render()); + + $ta_code = new cHTMLTextarea("code", clHtmlSpecialChars($sCode), 100, 35, "code"); + $ta_code->updateAttributes(array("wrap" => getEffectiveSetting('style_editor', 'wrap', 'off'))); + $ta_code->setStyle("font-family: monospace;width: 100%;"); $form->add(i18n("Code"), $ta_code); + + $aFileInfo = getFileInformation($client, $sTempFilename, "css", $db); + if(!empty($aFileInfo["description"])) { + $sDescription = clHtmlSpecialChars($aFileInfo["description"]); + } else { + $sDescription = ''; + } + + $descr = new cHTMLTextarea("description", $sDescription, 100, 5); + + $descr->setStyle("font-family: monospace;width: 100%;"); + $form->add(i18n("Description"), $descr->render()); $page->setContent($form->render()); @@ -192,5 +198,4 @@ if (!$perm->have_perm_area_action($area, $action)) { $page->addScript('reload', $sReloadScript); $page->render(); } -} -?> \ No newline at end of file +} \ No newline at end of file diff --git a/conlite/templates/standard/template.tplcfg_edit_form.html b/conlite/templates/standard/template.tplcfg_edit_form.html index 3c00b3b..fa411bf 100644 --- a/conlite/templates/standard/template.tplcfg_edit_form.html +++ b/conlite/templates/standard/template.tplcfg_edit_form.html @@ -1,7 +1,7 @@ - + template.tplcfg_edit_form.html From c0e250a21f76bbb39f449cf71141e8abb78548f8 Mon Sep 17 00:00:00 2001 From: "o.pinke" Date: Fri, 10 Feb 2023 11:52:16 +0100 Subject: [PATCH 07/37] fixed bug with empty description --- conlite/includes/rights_lay.inc.php | 2 +- conlite/includes/rights_mod.inc.php | 2 +- conlite/includes/rights_tpl.inc.php | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/conlite/includes/rights_lay.inc.php b/conlite/includes/rights_lay.inc.php index daf534a..5c23b2d 100644 --- a/conlite/includes/rights_lay.inc.php +++ b/conlite/includes/rights_lay.inc.php @@ -118,7 +118,7 @@ $db->query($sql); while ($db->next_record()) { $tplname = clHtmlEntities($db->f("name")); - $description = clHtmlEntities($db->f("description")); + $description = empty($db->f("description"))?'':clHtmlEntities($db->f("description")); $sTable .= $table->row(); $sTable .= $table->cell($tplname,"", "", " class=\"td_rights0\"", false); diff --git a/conlite/includes/rights_mod.inc.php b/conlite/includes/rights_mod.inc.php index 390f7f2..1230fdf 100644 --- a/conlite/includes/rights_mod.inc.php +++ b/conlite/includes/rights_mod.inc.php @@ -117,7 +117,7 @@ $db->query($sql); while ($db->next_record()) { $tplname = clHtmlEntities($db->f("name")); - $description = clHtmlEntities($db->f("description")); + $description = empty($db->f("description"))?'':clHtmlEntities($db->f("description")); $sTable .= $table->row(); $sTable .= $table->cell($tplname,"", "", " class=\"td_rights0\"", false); diff --git a/conlite/includes/rights_tpl.inc.php b/conlite/includes/rights_tpl.inc.php index d045243..4aeba1f 100644 --- a/conlite/includes/rights_tpl.inc.php +++ b/conlite/includes/rights_tpl.inc.php @@ -112,14 +112,14 @@ foreach ($aSecondHeaderRow as $value) { $sTable .= $table->end_row(); -//Select the itemid�s +//Select the itemid $sql = "SELECT * FROM ".$cfg["tab"]["tpl"]." WHERE idclient='".Contenido_Security::toInteger($rights_client)."' ORDER BY name"; $db->query($sql); while ($db->next_record()) { - $tplname = clHtmlEntities($db->f("name")); - $description = clHtmlEntities($db->f("description")); + $tplname = clHtmlEntities($db->f("name")); + $description = empty($db->f("description"))?'':clHtmlEntities($db->f("description")); $sTable .= $table->row(); $sTable .= $table->cell($tplname,"", "", " class=\"td_rights0\"", false); From 0589fd287e3b3e29e70a73106c9c8404ea68a4b4 Mon Sep 17 00:00:00 2001 From: "o.pinke" Date: Fri, 10 Feb 2023 11:55:27 +0100 Subject: [PATCH 08/37] fixed bug with empty description --- conlite/includes/grouprights_lay.inc.php | 159 ++++++++++------------- conlite/includes/grouprights_mod.inc.php | 4 +- conlite/includes/grouprights_tpl.inc.php | 4 +- 3 files changed, 74 insertions(+), 93 deletions(-) diff --git a/conlite/includes/grouprights_lay.inc.php b/conlite/includes/grouprights_lay.inc.php index 9bfc145..6b52fb3 100644 --- a/conlite/includes/grouprights_lay.inc.php +++ b/conlite/includes/grouprights_lay.inc.php @@ -1,4 +1,5 @@ showareas("lay")])."'"; -$sql = "SELECT A.idarea, A.idaction, A.idcat, B.name, C.name FROM ".$cfg["tab"]["rights"]." AS A, ".$cfg["tab"]["area"]." AS B, ".$cfg["tab"]["actions"]." AS C WHERE user_id='".Contenido_Security::escapeDB($groupid, $db)."' AND idclient='".Contenido_Security::toInteger($rights_client)."' AND A.type = 1 AND idlang='".Contenido_Security::toInteger($rights_lang)."' AND B.idarea IN ($possible_area) AND idcat!='0' AND A.idaction = C.idaction AND A.idarea = C.idarea AND A.idarea = B.idarea"; +$possible_area = "'" . implode("','", $area_tree[$perm->showareas("lay")]) . "'"; +$sql = "SELECT A.idarea, A.idaction, A.idcat, B.name, C.name FROM " . $cfg["tab"]["rights"] . " AS A, " . $cfg["tab"]["area"] . " AS B, " . $cfg["tab"]["actions"] . " AS C WHERE user_id='" . Contenido_Security::escapeDB($groupid, $db) . "' AND idclient='" . Contenido_Security::toInteger($rights_client) . "' AND A.type = 1 AND idlang='" . Contenido_Security::toInteger($rights_lang) . "' AND B.idarea IN ($possible_area) AND idcat!='0' AND A.idaction = C.idaction AND A.idarea = C.idarea AND A.idarea = B.idarea"; $db->query($sql); -$rights_list_old = array (); +$rights_list_old = array(); while ($db->next_record()) { //set a new rights list fore this user - $rights_list_old[$db->f(3)."|".$db->f(4)."|".$db->f("idcat")] = "x"; + $rights_list_old[$db->f(3) . "|" . $db->f(4) . "|" . $db->f("idcat")] = "x"; } -if (($perm->have_perm_area_action($area, $action)) && ($action == "user_edit")) -{ - saverights(); -}else { - if (!$perm->have_perm_area_action($area, $action)) - { - $notification->displayNotification("error", i18n("Permission denied")); - } +if (($perm->have_perm_area_action($area, $action)) && ($action == "user_edit")) { + saverights(); +} else { + if (!$perm->have_perm_area_action($area, $action)) { + $notification->displayNotification("error", i18n("Permission denied")); + } } // declare temp variables @@ -65,52 +63,47 @@ $sTable = ''; $sJsBefore .= "var itemids=new Array(); var actareaids=new Array(); \n"; -if (($perm->have_perm_area_action($area, $action)) && ($action == "group_edit")) -{ - saverights(); -}else { - if (!$perm->have_perm_area_action($area, $action)) - { - $notification->displayNotification("error", i18n("Permission denied")); - } +if (($perm->have_perm_area_action($area, $action)) && ($action == "group_edit")) { + saverights(); +} else { + if (!$perm->have_perm_area_action($area, $action)) { + $notification->displayNotification("error", i18n("Permission denied")); + } } -$colspan=0; +$colspan = 0; $oTable = new Table($cfg["color"]["table_border"], "solid", 0, 2, $cfg["color"]["table_header"], $cfg["color"]["table_light"], $cfg["color"]["table_dark"], 0, 0); $sTable .= $oTable->start_table(); $sTable .= $oTable->header_row(); $sTable .= $oTable->header_cell(i18n("Layout name")); -$sTable .= $oTable->header_cell(i18n("Description")); +$sTable .= $oTable->header_cell(i18n("Description")); -$possible_areas=array(); +$possible_areas = array(); $sCheckboxesRow = ''; $aSecondHeaderRow = array(); // look for possible actions in mainarea [] -foreach($right_list["lay"] as $value2) -{ - //if there are some actions - if(is_array($value2["action"])) - //set the areas that are in use - foreach($value2["action"] as $key3 => $value3) - { - $possible_areas[$value2["perm"]]=""; - $colspan++; - //set the possible areas and actions for this areas - $sJsBefore .= "actareaids[\"$value3|".$value2["perm"]."\"]=\"x\";\n"; - - //checkbox for the whole action - $sTable .= $oTable->header_cell($lngAct[$value2["perm"]][$value3]); - array_push($aSecondHeaderRow, ""); +foreach ($right_list["lay"] as $value2) { + //if there are some actions + if (is_array($value2["action"])) + //set the areas that are in use + foreach ($value2["action"] as $key3 => $value3) { + $possible_areas[$value2["perm"]] = ""; + $colspan++; + //set the possible areas and actions for this areas + $sJsBefore .= "actareaids[\"$value3|" . $value2["perm"] . "\"]=\"x\";\n"; - } + //checkbox for the whole action + $sTable .= $oTable->header_cell($lngAct[$value2["perm"]][$value3]); + array_push($aSecondHeaderRow, ""); + } } - //checkbox for all rights -$sTable .= $oTable->header_cell(i18n("Check all")); +//checkbox for all rights +$sTable .= $oTable->header_cell(i18n("Check all")); array_push($aSecondHeaderRow, ""); $sTable .= $oTable->end_row(); @@ -121,71 +114,59 @@ $sTable .= $oTable->header_cell(' ', 'center', '', '', 0); $sTable .= $oTable->header_cell(' ', 'center', '', '', 0); // Put the checkbox in the table -foreach($aSecondHeaderRow as $value){ - $sTable .= $oTable->header_cell($value, "center", "", "", 0); +foreach ($aSecondHeaderRow as $value) { + $sTable .= $oTable->header_cell($value, "center", "", "", 0); } $sTable .= $oTable->end_row(); //Select the itemid�s -$sql = "SELECT * FROM ".$cfg["tab"]["lay"]." WHERE idclient='".Contenido_Security::toInteger($rights_client)."' ORDER BY name"; +$sql = "SELECT * FROM " . $cfg["tab"]["lay"] . " WHERE idclient='" . Contenido_Security::toInteger($rights_client) . "' ORDER BY name"; $db->query($sql); - while ($db->next_record()) { - $sTplName = clHtmlEntities($db->f("name")); - $sDescription = clHtmlEntities($db->f("description")); + $sTplName = clHtmlEntities($db->f("name")); + $sDescription = empty($db->f("description")) ? '' : clHtmlEntities($db->f("description")); + + $sTable .= $oTable->row(); + $sTable .= $oTable->cell($sTplName, "", "", " class=\"td_rights0\"", false); + $sTable .= $oTable->cell($sDescription, "", "", " class=\"td_rights1\" style=\"white-space:normal; \"", false); + + //set javscript array for itemids + $sJsBefore .= "itemids[\"" . $db->f("idlay") . "\"]=\"x\";\n"; + + // look for possible actions in mainarea[] + foreach ($right_list["lay"] as $value2) { + + //if there area some + if (is_array($value2["action"])) + foreach ($value2["action"] as $key3 => $value3) { + //does the user have the right + if (in_array($value2["perm"] . "|$value3|" . $db->f("idlay"), array_keys($rights_list_old))) + $checked = "checked=\"checked\""; + else + $checked = ""; - $sTable .= $oTable->row(); - $sTable .= $oTable->cell($sTplName, "", "", " class=\"td_rights0\"", false); - $sTable .= $oTable->cell($sDescription, "", "", " class=\"td_rights1\" style=\"white-space:normal; \"", false); - - - //set javscript array for itemids - $sJsBefore .= "itemids[\"".$db->f("idlay")."\"]=\"x\";\n"; - - // look for possible actions in mainarea[] - foreach($right_list["lay"] as $value2) - { - - //if there area some - if(is_array($value2["action"])) - foreach($value2["action"] as $key3 => $value3) - { - //does the user have the right - if(in_array($value2["perm"]."|$value3|".$db->f("idlay"),array_keys($rights_list_old))) - $checked="checked=\"checked\""; - else - $checked=""; - - - //set the checkbox the name consits of areait+actionid+itemid - //"f("idlay")."]\" value=\"x\" $checked> - $sTable .= $oTable->cell("f("idlay")."]\" value=\"x\" $checked>", "", "", " class=\"td_rights3\"", false ); - - } - - - } + //set the checkbox the name consits of areait+actionid+itemid + //"f("idlay")."]\" value=\"x\" $checked> + $sTable .= $oTable->cell("f("idlay") . "]\" value=\"x\" $checked>", "", "", " class=\"td_rights3\"", false); + } + } //checkbox for checking all actions fore this itemid - $sTable .= $oTable->cell("f("idlay")."\" value=\"\" onClick=\"setRightsFor('".$value2["perm"]."','$value3','".$db->f("idlay")."')\">","", "", " class=\"td_rights3\"", false); - $sTable .= $oTable->end_row(); - + $sTable .= $oTable->cell("f("idlay") . "\" value=\"\" onClick=\"setRightsFor('" . $value2["perm"] . "','$value3','" . $db->f("idlay") . "')\">", "", "", " class=\"td_rights3\"", false); + $sTable .= $oTable->end_row(); } $sTable .= $oTable->end_row(); $sTable .= $oTable->row(); -$sTable .= $oTable->sumcell(" ","right"); +$sTable .= $oTable->sumcell(" ", "right"); $sTable .= $oTable->end_row(); $sTable .= $oTable->end_table(); - // generate Template $oTpl->set('s', 'JS_SCRIPT_BEFORE', $sJsBefore); $oTpl->set('s', 'JS_SCRIPT_AFTER', $sJsAfter); $oTpl->set('s', 'RIGHTS_CONTENT', $sTable); $oTpl->set('s', 'EXTERNAL_SCRIPTS', $sJsExternal); -$oTpl->generate('templates/standard/'.$cfg['templates']['rights_inc']); - -?> +$oTpl->generate('templates/standard/' . $cfg['templates']['rights_inc']); \ No newline at end of file diff --git a/conlite/includes/grouprights_mod.inc.php b/conlite/includes/grouprights_mod.inc.php index 2d17fad..7752eb6 100644 --- a/conlite/includes/grouprights_mod.inc.php +++ b/conlite/includes/grouprights_mod.inc.php @@ -116,8 +116,8 @@ $db->query($sql); while ($db->next_record()) { - $tplname = clHtmlEntities($db->f("name")); - $description = clHtmlEntities($db->f("description")); + $tplname = clHtmlEntities($db->f("name")); + $description = empty($db->f("description"))?'':clHtmlEntities($db->f("description")); $sTable .= $table->row(); $sTable .= $table->cell($tplname,"", "", " class=\"td_rights0\"", false); diff --git a/conlite/includes/grouprights_tpl.inc.php b/conlite/includes/grouprights_tpl.inc.php index dbe6fac..b6d47fb 100644 --- a/conlite/includes/grouprights_tpl.inc.php +++ b/conlite/includes/grouprights_tpl.inc.php @@ -121,8 +121,8 @@ $db->query($sql); while ($db->next_record()) { - $tplname = clHtmlEntities($db->f("name")); - $description = clHtmlEntities($db->f("description")); + $tplname = clHtmlEntities($db->f("name")); + $description = empty($db->f("description"))?'':clHtmlEntities($db->f("description")); $sTable .= $table->row(); $sTable .= $table->cell($tplname,"", "", " class=\"td_rights0\"", false); From 6f0385f4bab711b253e30c2162808587249b4e11 Mon Sep 17 00:00:00 2001 From: "o.pinke" Date: Sun, 12 Feb 2023 12:59:50 +0100 Subject: [PATCH 09/37] bugfixes HTML-Elements and cHTML --- conlite/classes/cHTML5/class.chtml.php | 23 +++++++------- conlite/classes/class.htmlelements.php | 42 +++++++++++--------------- 2 files changed, 28 insertions(+), 37 deletions(-) diff --git a/conlite/classes/cHTML5/class.chtml.php b/conlite/classes/cHTML5/class.chtml.php index 1448d46..24842d8 100644 --- a/conlite/classes/cHTML5/class.chtml.php +++ b/conlite/classes/cHTML5/class.chtml.php @@ -415,7 +415,7 @@ class cHTML extends cHTML5Common { $style = $this->getAttribute("style"); /* If the style doesn't end with a semicolon, append one */ - if(is_string($style)) { + if(!empty($style) && is_string($style)) { $style = trim($style); if (substr($style, strlen($style) - 1) != ";") { @@ -423,12 +423,20 @@ class cHTML extends cHTML5Common { } } - foreach($this->_aStyleDefinitions as $sEntry) { - $style .= $sEntry; + foreach($this->_aStyleDefinitions as $sKey => $sEntry) { + $style .= $sKey.': '.$sEntry; if (substr($style, strlen($style) - 1) != ";") { $style .= ";"; } + } + /* Apply all stored styles */ + foreach ($this->_styledefs as $key => $value) { + $style .= "$key: $value;"; + } + + if ($style != "") { + $this->setStyle($style); } foreach($this->_aEventDefinitions as $sEventName => $sEntry) { @@ -440,15 +448,6 @@ class cHTML extends cHTML5Common { $this->setAttribute($sEventName, $this->getAttribute($sEventName).implode(" ", $aFullCode)); } - /* Apply all stored styles */ - foreach ($this->_styledefs as $key => $value) { - $style .= "$key: $value;"; - } - - if ($style != "") { - $this->setStyle($style); - } - if ($this->_content != "" || $this->_contentlessTag == false) { $attributes = $this->getAttributes(true); return $this->fillSkeleton($attributes).$this->_content.$this->fillCloseSkeleton(); diff --git a/conlite/classes/class.htmlelements.php b/conlite/classes/class.htmlelements.php index 0bab486..4d579f9 100644 --- a/conlite/classes/class.htmlelements.php +++ b/conlite/classes/class.htmlelements.php @@ -57,8 +57,7 @@ class cHTMLFormElement extends cHTML { if (is_string($id) && !empty($id)) { $this->updateAttributes(array("id" => $id)); } - - $this->setClass("text_medium"); // TODO: Remove this... + $this->setDisabled($disabled); $this->setTabindex($tabindex); $this->setAccessKey($accesskey); @@ -931,7 +930,7 @@ class cHTMLRadiobutton extends cHTMLFormElement { */ function toHtml($renderLabel = true) { $attributes = $this->getAttributes(true); - + //print_r($attributes); if ($renderLabel == false) { return $this->fillSkeleton($attributes); } @@ -1029,37 +1028,30 @@ class cHTMLCheckbox extends cHTMLFormElement { * @return string Rendered HTML */ function toHtml($renderlabel = true) { + $attributes = $this->getAttributes(true); + + if ($renderlabel == false) { + return $this->fillSkeleton($attributes); + } + $id = $this->getAttribute("id"); + $renderedLabel = ""; - if ($renderlabel == true) { - if ($id != "") { - $label = new cHTMLLabel($this->_value, $this->getAttribute("id")); + if ($id != "") { + $label = new cHTMLLabel($this->_value, $this->getAttribute("id")); - $label->setClass($this->getAttribute("class")); - - if ($this->_labelText != "") { - $label->setLabelText($this->_labelText); - } - - $renderedLabel = $label->toHtml(); - } else { - - $renderedLabel = $this->_value; - - if ($this->_labelText != "") { - $label = new cHTMLLabel($this->_value, $this->getAttribute("id")); - $label->setLabelText($this->_labelText); - $renderedLabel = $label->toHtml(); - } + if ($this->_labelText != "") { + $label->setLabelText($this->_labelText); } - return '
' . parent::toHTML() . '' . $renderedLabel . '
'; + $renderedLabel = $label->toHtml(); } else { - return parent::toHTML(); + $renderedLabel = $this->_value; } - } + return $this->fillSkeleton($attributes) . $renderedLabel; + } } /** From 106f003bfa2b7368a4812061f2491e0eab1e99e2 Mon Sep 17 00:00:00 2001 From: "o.pinke" Date: Wed, 15 Feb 2023 11:56:45 +0100 Subject: [PATCH 10/37] bugfix variable --- conlite/templates/standard/template.tplcfg_edit_form.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/conlite/templates/standard/template.tplcfg_edit_form.html b/conlite/templates/standard/template.tplcfg_edit_form.html index fa411bf..4167106 100644 --- a/conlite/templates/standard/template.tplcfg_edit_form.html +++ b/conlite/templates/standard/template.tplcfg_edit_form.html @@ -56,7 +56,7 @@ {MARKSUBMENU} From d1528111e2b3e29b077bf1f15c803e9bee10ee37 Mon Sep 17 00:00:00 2001 From: "o.pinke" Date: Wed, 15 Feb 2023 11:58:35 +0100 Subject: [PATCH 11/37] add default to option var; typo --- conlite/classes/class.htmlelements.php | 2 +- conlite/classes/contenido/class.category.php | 4 +--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/conlite/classes/class.htmlelements.php b/conlite/classes/class.htmlelements.php index 4d579f9..c20f353 100644 --- a/conlite/classes/class.htmlelements.php +++ b/conlite/classes/class.htmlelements.php @@ -593,7 +593,7 @@ class cHTMLSelectElement extends cHTMLFormElement { * All cHTMLOptionElements * @var array */ - var $_options; + var $_options = []; /** * Constructor. Creates an HTML select field (aka "DropDown"). diff --git a/conlite/classes/contenido/class.category.php b/conlite/classes/contenido/class.category.php index ffe743d..f560e7a 100644 --- a/conlite/classes/contenido/class.category.php +++ b/conlite/classes/contenido/class.category.php @@ -52,6 +52,4 @@ class cApiCategory extends Item { } } -} - -?> \ No newline at end of file +} \ No newline at end of file From 9367766e7d876d02b238082aea719986207307d2 Mon Sep 17 00:00:00 2001 From: "o.pinke" Date: Fri, 17 Feb 2023 15:10:36 +0100 Subject: [PATCH 12/37] remove old php5 support --- .../include.chain.content.createmetatags.php | 75 +++--- .../includes/keyword_density_php52.php | 221 ------------------ 2 files changed, 35 insertions(+), 261 deletions(-) delete mode 100644 conlite/plugins/chains/createmetatags/includes/keyword_density_php52.php diff --git a/conlite/plugins/chains/createmetatags/include.chain.content.createmetatags.php b/conlite/plugins/chains/createmetatags/include.chain.content.createmetatags.php index c827743..c2b2c88 100644 --- a/conlite/plugins/chains/createmetatags/include.chain.content.createmetatags.php +++ b/conlite/plugins/chains/createmetatags/include.chain.content.createmetatags.php @@ -1,4 +1,5 @@ = 5.3 -if(version_compare(PHP_VERSION, "5.3", "<")) { - cInclude("plugins", "chains/createmetatags/includes/keyword_density_php52.php"); -} else { - cInclude("plugins", "chains/createmetatags/includes/keyword_density.php"); -} + +cInclude("plugins", "chains/createmetatags/includes/keyword_density.php"); cInclude("plugins", "chains/createmetatags/classes/class.metatag.creator.html5.php"); function cecCreateMetatags($metatags) { global $cfg, $lang, $idart, $client, $cfgClient, $idcat, $idartlang; - - $bIsHTML5 = ((getEffectiveSetting('generator', 'html5', 'false') == 'false') ? false : true); - - if($bIsHTML5) { + + $bIsHTML5 = ((getEffectiveSetting('generator', 'html5', 'false') == 'false') ? false : true); + + if ($bIsHTML5) { $aConfig = array( 'cachetime' => 3600, - 'cachedir' => $cfgClient[$client]['path']['frontend'] . "cache/" + 'cachedir' => $cfgClient[$client]['path']['frontend'] . "cache/" ); - - $oHtml5MetaCreator = new MetaTagCreatorHtml5($metatags, $aConfig); + + $oHtml5MetaCreator = new MetaTagCreatorHtml5($metatags, $aConfig); return $oHtml5MetaCreator->generateMetaTags(); - } + } //Basic settings $cachetime = 3600; // measured in seconds @@ -59,8 +55,8 @@ function cecCreateMetatags($metatags) { $metatags = array(); } - $hash = 'metatag_'.md5($idart.'/'.$lang); - $cachefilename = $cachedir.$hash.'.tmp'; + $hash = 'metatag_' . md5($idart . '/' . $lang); + $cachefilename = $cachedir . $hash . '.tmp'; #Check if rebuilding of metatags is necessary $reload = true; @@ -70,7 +66,7 @@ function cecCreateMetatags($metatags) { if (file_exists($cachefilename)) { $fileexists = true; - $diff = time() - filemtime($cachefilename); + $diff = time() - filemtime($cachefilename); if ($diff > $cachetime) { $reload = true; @@ -84,7 +80,7 @@ function cecCreateMetatags($metatags) { $db = new DB_ConLite(); #Get encoding - $sql = "SELECT * FROM ".$cfg['tab']['lang']." WHERE idlang=".(int)$lang; + $sql = "SELECT * FROM " . $cfg['tab']['lang'] . " WHERE idlang=" . (int) $lang; $db->query($sql); if ($db->next_record()) { $sEncoding = strtoupper($db->f('encoding')); @@ -95,12 +91,12 @@ function cecCreateMetatags($metatags) { #Get idcat of homepage $sql = "SELECT a.idcat FROM - ".$cfg['tab']['cat_tree']." AS a, - ".$cfg['tab']['cat_lang']." AS b + " . $cfg['tab']['cat_tree'] . " AS a, + " . $cfg['tab']['cat_lang'] . " AS b WHERE (a.idcat = b.idcat) AND (b.visible = 1) AND - (b.idlang = ".Contenido_Security::toInteger($lang).") + (b.idlang = " . Contenido_Security::toInteger($lang) . ") ORDER BY a.idtree LIMIT 1"; $db->query($sql); @@ -112,7 +108,7 @@ function cecCreateMetatags($metatags) { $availableTags = conGetAvailableMetaTagTypes(); #Get first headline and first text for current article - $oArt = new Article ($idart, $client, $lang); + $oArt = new Article($idart, $client, $lang); #Set idartlang, if not set if ($idartlang == '') { @@ -140,7 +136,7 @@ function cecCreateMetatags($metatags) { } $sHeadline = strip_tags($sHeadline); - $sHeadline = substr(str_replace(chr(13).chr(10),' ',$sHeadline),0,100); + $sHeadline = substr(str_replace(chr(13) . chr(10), ' ', $sHeadline), 0, 100); $arrText1 = $oArt->getContent("html"); $arrText2 = $oArt->getContent("text"); @@ -163,19 +159,19 @@ function cecCreateMetatags($metatags) { } $sText = strip_tags(urldecode($sText)); - $sText = keywordDensity ('', $sText); + $sText = keywordDensity('', $sText); //Get metatags for homeapge $arrHomepageMetaTags = array(); - $sql = "SELECT startidartlang FROM ".$cfg["tab"]["cat_lang"]." WHERE (idcat=".Contenido_Security::toInteger($idcat_homepage).") AND(idlang=".Contenido_Security::toInteger($lang).")"; + $sql = "SELECT startidartlang FROM " . $cfg["tab"]["cat_lang"] . " WHERE (idcat=" . Contenido_Security::toInteger($idcat_homepage) . ") AND(idlang=" . Contenido_Security::toInteger($lang) . ")"; $db->query($sql); - if($db->next_record()){ + if ($db->next_record()) { $iIdArtLangHomepage = $db->f('startidartlang'); #get idart of homepage - $sql = "SELECT idart FROM ".$cfg["tab"]["art_lang"]." WHERE idartlang =".Contenido_Security::toInteger($iIdArtLangHomepage); + $sql = "SELECT idart FROM " . $cfg["tab"]["art_lang"] . " WHERE idartlang =" . Contenido_Security::toInteger($iIdArtLangHomepage); $db->query($sql); @@ -186,10 +182,10 @@ function cecCreateMetatags($metatags) { $t1 = $cfg["tab"]["meta_tag"]; $t2 = $cfg["tab"]["meta_type"]; - $sql = "SELECT ".$t1.".metavalue,".$t2.".metatype FROM ".$t1. - " INNER JOIN ".$t2." ON ".$t1.".idmetatype = ".$t2.".idmetatype WHERE ". - $t1.".idartlang =".$iIdArtLangHomepage. - " ORDER BY ".$t2.".metatype"; + $sql = "SELECT " . $t1 . ".metavalue," . $t2 . ".metatype FROM " . $t1 . + " INNER JOIN " . $t2 . " ON " . $t1 . ".idmetatype = " . $t2 . ".idmetatype WHERE " . + $t1 . ".idartlang =" . $iIdArtLangHomepage . + " ORDER BY " . $t2 . ".metatype"; $db->query($sql); @@ -197,7 +193,7 @@ function cecCreateMetatags($metatags) { $arrHomepageMetaTags[$db->f("metatype")] = $db->f("metavalue"); } - $oArt = new Article ($iIdArtHomepage, $client, $lang); + $oArt = new Article($iIdArtHomepage, $client, $lang); $arrHomepageMetaTags['pagetitle'] = $oArt->getField('title'); } @@ -206,12 +202,12 @@ function cecCreateMetatags($metatags) { foreach ($availableTags as $key => $value) { $metavalue = conGetMetaValue($idartlang, $key); - if (strlen($metavalue) == 0){ + if (strlen($metavalue) == 0) { //Add values for metatags that don't have a value in the current article - switch(strtolower($value["name"])){ + switch (strtolower($value["name"])) { case 'author': //Build author metatag from name of last modifier - $oArt = new Article ($idart, $client, $lang); + $oArt = new Article($idart, $client, $lang); $lastmodifier = $oArt->getField("modifiedby"); $oUser = new User(); $oUser->loadUserByUserID(md5($lastmodifier)); @@ -224,7 +220,7 @@ function cecCreateMetatags($metatags) { break; case 'date': //Build date metatag from date of last modification - $oArt = new Article ($idart, $client, $lang); + $oArt = new Article($idart, $client, $lang); $lastmodified = $oArt->getField("lastmodified"); $iCheck = CheckIfMetaTagExists($metatags, 'date'); @@ -260,7 +256,6 @@ function cecCreateMetatags($metatags) { // save metatags in cache file file_put_contents($cachefilename, serialize($metatags)); - } else { #Get metatags from file system cache $metatags = unserialize(file_get_contents($cachefilename)); @@ -269,7 +264,6 @@ function cecCreateMetatags($metatags) { return $metatags; } - /** * Checks if the metatag allready exists inside the metatag list. * @@ -295,4 +289,5 @@ function CheckIfMetaTagExists($arrMetatags, $sCheckForMetaTag) { // metatag doesn't exists, return next position return count($arrMetatags); } + ?> \ No newline at end of file diff --git a/conlite/plugins/chains/createmetatags/includes/keyword_density_php52.php b/conlite/plugins/chains/createmetatags/includes/keyword_density_php52.php deleted file mode 100644 index 887f9c4..0000000 --- a/conlite/plugins/chains/createmetatags/includes/keyword_density_php52.php +++ /dev/null @@ -1,221 +0,0 @@ - $b) ? -1 : 1; -} - -/** - * - * @param array $singlewordcounter - * @param int $maxKeywords - * @return array Array with valued keywords - */ -function stripCount($singlewordcounter, $maxKeywords = 15) { - // strip all with only 1 - $tmp = array(); - $result = array(); - $tmpToRemove = 1; - - foreach ($singlewordcounter as $key => $value) { - if ($value > $tmpToRemove) { - $tmp[$key] = $value; - } - } - - if (sizeof($tmp) <= $maxKeywords) { - foreach ($tmp as $key => $value) { - $result[] = $key; - } - } else { - $dist = array(); - foreach ($tmp as $key => $value) { - $dist[$value]++; - } - uksort($dist, "__cmp"); - reset($dist); - $count = 0; - $resultset = array(); - $useQuantity = array(); - - foreach ($dist as $key => $value) { - $_count = $count + $value; - if ($_count <= $maxKeywords) { - $count += $value; - $useQuantity[] = $key; - } else { - break; - } - } - // run all keywords and select by quantities to use - foreach ($singlewordcounter as $key => $value) { - if (in_array($value, $useQuantity)) { - $result[] = $key; - } - } - } - return $result; -} - -/** - * Generate keywords from content - * - * @version 1.0 - * @since 2.0.0 - * @author Ortwin Pinke - * - * @param string $sHeadline - * @param string $sText - * @param string $sEncoding - * @param int $iMinLen - * @return mixed commaseparated string of keywords or false - */ -function keywordDensity($sHeadline, $sText, $sEncoding = "UTF-8", $iMinLen = 5) { - global $aAllWords; - $sHeadline = strip_tags($sHeadline); - $sText = strip_tags($sText); - $sText = clHtmlEntityDecode($sText, ENT_QUOTES, $sEncoding); - - $aSingleWordHeadline = str_word_count($sHeadline, 1); - // double array for higher valenz of headline - $aSingleWordHeadline = array_merge($aSingleWordHeadline,$aSingleWordHeadline); - $aSingleWordHeadline = array_count_values($aSingleWordHeadline); - - $aSingleWordText = str_word_count($sText, 1); - $aSingleWordText = array_count_values($aSingleWordText); - - $aAllWords = array_merge($aSingleWordHeadline, $aSingleWordText); - array_walk($aAllWords, create_function('&$n, $key, $iLen', ' - global $aAllWords; - if(strlen($key) < $iLen || clIsStopWord($key)) { - unset($aAllWords[$key]); - }'), $iMinLen); - arsort($aAllWords, SORT_NUMERIC); - $aAllWords = stripCount($aAllWords); - if(is_array($aAllWords)) { - return implode(', ', $aAllWords); - } - return false; -} - -/** - * Check keyword against stopword list - * - * @version 1.0 - * @since 2.0.0 - * @author Ortwin Pinke - * @todo move stopwords to sqlite - * - * @global int $lang - * @global array $encoding - * @param string $sWord - * @return boolean - */ -function clIsStopWord($sWord) { - global $lang, $encoding; - $aStopWords = array(); - $aStopWords['de_DE'] = array("aber", "als", "am", "an", "auch", "auf", "aus", "bei", "bin", - "bis", "bist", "da", "dadurch", "daher", "darum", "das", "daß", "dass", "dein", - "deine", "dem", "den", "der", "des", "dessen", "deshalb", "die", "dies", "dieser", "dieses", - "doch", "dort", "du", "durch", "ein", "eine", "einem", "einen", "einer", "eines", "er", - "es", "euer", "eure", "für", "hatte", "hatten", "hattest", "hattet", "hier", "hinter", - "ich", "ihr", "ihre", "im", "in", "ist", "ja", "jede", "jedem", "jeden", "jeder", "jedes", - "jener", "jenes", "jetzt", "kann", "kannst", "können", "könnt", "machen", "mein", - "meine", "mit", "muß", "mußt", "musst", "müssen", "müßt", "nach", "nachdem", "nein", - "nicht", "nun", "oder", "seid", "sein", "seine", "sich", "sie", - "sind", "soll", "sollen", "sollst", "sollt", "sonst", "soweit", "sowie", "und", "unser", - "unsere", "unter", "vom", "von", "vor", "wann", "warum", "was", "weiter", "weitere", "wenn", - "wer", "werde", "werden", "werdet", "weshalb", "wie", "wieder", "wieso", "wir", "wird", - "wirst", "wo", "woher", "wohin", "zu", "zum", "zur", "über"); - $aStopWords['en_EN'] = $aStopWords['en_US'] = array("a", "able", "about", "above", "abst", - "accordance", "according", "accordingly", "across", "act", "actually", "added", "adj", - "affected", "affecting", "affects", "after", "afterwards", "again", "against", "ah", "all", - "almost", "alone", "along", "already", "also", "although", "always", "am", "among", - "amongst", "an", "and", "announce", "another", "any", "anybody", "anyhow", "anymore", - "anyone", "anything", "anyway", "anyways", "anywhere", "apparently", "approximately", - "are", "aren", "arent", "arise", "around", "as", "aside", "ask", "asking", "at", "auth", - "available", "away", "awfully", "b", "back", "be", "became", "because", "become", "becomes", - "becoming", "been", "before", "beforehand", "begin", "beginning", "beginnings", "begins", - "behind", "being", "believe", "below", "beside", "besides", "between", "beyond", "biol", - "both", "brief", "briefly", "but", "by", "c", "ca", "came", "can", "cannot", "can't", - "cause", "causes", "certain", "certainly", "co", "com", "come", "comes", "contain", - "containing", "contains", "could", "couldnt", "d", "date", "did", "didn't", "different", - "do", "does", "doesn't", "doing", "done", "don't", "down", "downwards", "due", "during", - "e", "each", "ed", "edu", "effect", "eg", "eight", "eighty", "either", "else", "elsewhere", - "end", "ending", "enough", "especially", "et", "et-al", "etc", "even", "ever", "every", - "everybody", "everyone", "everything", "everywhere", "ex", "except", "f", "far", "few", - "ff", "fifth", "first", "five", "fix", "followed", "following", "follows", "for", "former", - "formerly", "forth", "found", "four", "from", "further", "furthermore", "g", "gave", "get", - "gets", "getting", "give", "given", "gives", "giving", "go", "goes", "gone", "got", "gotten", - "h", "had", "happens", "hardly", "has", "hasn't", "have", "haven't", "having", "he", "hed", - "hence", "her", "here", "hereafter", "hereby", "herein", "heres", "hereupon", "hers", - "herself", "hes", "hi", "hid", "him", "himself", "his", "hither", "home", "how", "howbeit", - "however", "hundred", "i", "id", "ie", "if", "i'll", "im", "immediate", "immediately", - "importance", "important", "in", "inc", "indeed", "index", "information", "instead", "into", - "invention", "inward", "is", "isn't", "it", "itd", "it'll", "its", "itself", "i've", "j", - "just", "k", "keep", "keeps", "kept", "kg", "km", "know", "known", "knows", "l", "largely", - "last", "lately", "later", "latter", "latterly", "least", "less", "lest", "let", "lets", - "like", "liked", "likely", "line", "little", "'ll", "look", "looking", "looks", "ltd", "m", - "made", "mainly", "make", "makes", "many", "may", "maybe", "me", "mean", "means", "meantime", - "meanwhile", "merely", "mg", "might", "million", "miss", "ml", "more", "moreover", "most", - "mostly", "mr", "mrs", "much", "mug", "must", "my", "myself", "n", "na", "name", "namely", - "nay", "nd", "near", "nearly", "necessarily", "necessary", "need", "needs", "neither", - "never", "nevertheless", "new", "next", "nine", "ninety", "no", "nobody", "non", "none", - "nonetheless", "noone", "nor", "normally", "nos", "not", "noted", "nothing", "now", "nowhere", - "o", "obtain", "obtained", "obviously", "of", "off", "often", "oh", "ok", "okay", "old", - "omitted", "on", "once", "one", "ones", "only", "onto", "or", "ord", "other", "others", - "otherwise", "ought", "our", "ours", "ourselves", "out", "outside", "over", "overall", "owing", - "own", "p", "page", "pages", "part", "particular", "particularly", "past", "per", "perhaps", - "placed", "please", "plus", "poorly", "possible", "possibly", "potentially", "pp", "predominantly", - "present", "previously", "primarily", "probably", "promptly", "proud", "provides", "put", - "q", "que", "quickly", "quite", "qv", "r", "ran", "rather", "rd", "re", "readily", "really", - "recent", "recently", "ref", "refs", "regarding", "regardless", "regards", "related", - "relatively", "research", "respectively", "resulted", "resulting", "results", "right", - "run", "s", "said", "same", "saw", "say", "saying", "says", "sec", "section", "see", - "seeing", "seem", "seemed", "seeming", "seems", "seen", "self", "selves", "sent", "seven", - "several", "shall", "she", "shed", "she'll", "shes", "should", "shouldn't", "show", - "showed", "shown", "showns", "shows", "significant", "significantly", "similar", "similarly", - "since", "six", "slightly", "so", "some", "somebody", "somehow", "someone", "somethan", - "something", "sometime", "sometimes", "somewhat", "somewhere", "soon", "sorry", "specifically", - "specified", "specify", "specifying", "still", "stop", "strongly", "sub", "substantially", - "successfully", "such", "sufficiently", "suggest", "sup", "sure", "t", "take", "taken", - "taking", "tell", "tends", "th", "than", "thank", "thanks", "thanx", "that", "that'll", - "thats", "that've", "the", "their", "theirs", "them", "themselves", "then", "thence", - "there", "thereafter", "thereby", "thered", "therefore", "therein", "there'll", "thereof", - "therere", "theres", "thereto", "thereupon", "there've", "these", "they", "theyd", "they'll", - "theyre", "they've", "think", "this", "those", "thou", "though", "thoughh", "thousand", - "throug", "through", "throughout", "thru", "thus", "til", "tip", "to", "together", "too", - "took", "toward", "towards", "tried", "tries", "truly", "try", "trying", "ts", "twice", - "two", "u", "un", "under", "unfortunately", "unless", "unlike", "unlikely", "until", "unto", - "up", "upon", "ups", "us", "use", "used", "useful", "usefully", "usefulness", "uses", "using", - "usually", "v", "value", "various", "'ve", "very", "via", "viz", "vol", "vols", "vs", "w", - "want", "wants", "was", "wasn't", "way", "we", "wed", "welcome", "we'll", "went", "were", - "weren't", "we've", "what", "whatever", "what'll", "whats", "when", "whence", "whenever", - "where", "whereafter", "whereas", "whereby", "wherein", "wheres", "whereupon", "wherever", - "whether", "which", "while", "whim", "whither", "who", "whod", "whoever", "whole", "who'll", - "whom", "whomever", "whos", "whose", "why", "widely", "willing", "wish", "with", "within", - "without", "won't", "words", "world", "would", "wouldn't", "www", "x", "y", "yes", "yet", - "you", "youd", "you'll", "your", "youre", "yours", "yourself", "yourselves", "you've", "z", "zero"); - - if(is_int($lang) && is_array($encoding)) { - $sUseEnc = $encoding[$lang]; - if(empty($sUseEnc) || !array_key_exists($sUseEnc, $aStopWords)) { - $sUseEnc = "de_DE"; - } - } - - if(in_array(utf8_encode($sWord), $aStopWords['de_DE'])) { - return true; - } - return false; -} -?> \ No newline at end of file From 97a3370258dd2173e11c2e3c50eda27a3509a7cd Mon Sep 17 00:00:00 2001 From: "o.pinke" Date: Fri, 17 Feb 2023 15:13:58 +0100 Subject: [PATCH 13/37] remove pear stuff, fix php8.x issues --- conlite/classes/cHTML5/class.chtml.php | 6 +- conlite/classes/class.inuse.php | 4 +- conlite/classes/class.smtp.php | 1065 ------------------- conlite/classes/template/class.template.php | 6 +- conlite/includes/functions.general.php | 51 - conlite/includes/include.str_overview.php | 95 -- 6 files changed, 7 insertions(+), 1220 deletions(-) delete mode 100644 conlite/classes/class.smtp.php diff --git a/conlite/classes/cHTML5/class.chtml.php b/conlite/classes/cHTML5/class.chtml.php index 24842d8..605504c 100644 --- a/conlite/classes/cHTML5/class.chtml.php +++ b/conlite/classes/cHTML5/class.chtml.php @@ -20,11 +20,7 @@ // security check defined('CON_FRAMEWORK') or die('Illegal call'); -/* -if (!class_exists("HTML_Common2")) { - cInclude("pear", "HTML/Common2.php"); -} -*/ + /* Global ID counter */ $cHTMLIDCount = 0; diff --git a/conlite/classes/class.inuse.php b/conlite/classes/class.inuse.php index 7108270..d217cb7 100644 --- a/conlite/classes/class.inuse.php +++ b/conlite/classes/class.inuse.php @@ -293,6 +293,4 @@ class InUseItem extends Item $this->loadByPrimaryKey($mId); } } -} - -?> \ No newline at end of file +} \ No newline at end of file diff --git a/conlite/classes/class.smtp.php b/conlite/classes/class.smtp.php deleted file mode 100644 index ef4da76..0000000 --- a/conlite/classes/class.smtp.php +++ /dev/null @@ -1,1065 +0,0 @@ -smtp_conn = 0; - $this->error = null; - $this->helo_rply = null; - - $this->do_debug = 0; - } - - /************************************************************* - * CONNECTION FUNCTIONS * - ***********************************************************/ - - /** - * Connect to the server specified on the port specified. - * If the port is not specified use the default SMTP_PORT. - * If tval is specified then a connection will try and be - * established with the server for that number of seconds. - * If tval is not specified the default is 30 seconds to - * try on the connection. - * - * SMTP CODE SUCCESS: 220 - * SMTP CODE FAILURE: 421 - * @access public - * @return bool - */ - function Connect($host,$port=0,$tval=30) { - # set the error val to null so there is no confusion - $this->error = null; - - # make sure we are __not__ connected - if($this->connected()) { - # ok we are connected! what should we do? - # for now we will just give an error saying we - # are already connected - $this->error = - array("error" => "Already connected to a server"); - return false; - } - - if(empty($port)) { - $port = $this->SMTP_PORT; - } - - #connect to the smtp server - $this->smtp_conn = fsockopen($host, # the host of the server - $port, # the port to use - $errno, # error number if any - $errstr, # error message if any - $tval); # give up after ? secs - # verify we connected properly - if(empty($this->smtp_conn)) { - $this->error = array("error" => "Failed to connect to server", - "errno" => $errno, - "errstr" => $errstr); - if($this->do_debug >= 1) { - echo "SMTP -> ERROR: " . $this->error["error"] . - ": $errstr ($errno)" . $this->CRLF; - } - return false; - } - - # sometimes the SMTP server takes a little longer to respond - # so we will give it a longer timeout for the first read - // Windows still does not have support for this timeout function - if(substr(PHP_OS, 0, 3) != "WIN") - socket_set_timeout($this->smtp_conn, $tval, 0); - - # get any announcement stuff - $announce = $this->get_lines(); - - # set the timeout of any socket functions at 1/10 of a second - //if(function_exists("socket_set_timeout")) - // socket_set_timeout($this->smtp_conn, 0, 100000); - - if($this->do_debug >= 2) { - echo "SMTP -> FROM SERVER:" . $this->CRLF . $announce; - } - - return true; - } - - /** - * Performs SMTP authentication. Must be run after running the - * Hello() method. Returns true if successfully authenticated. - * @access public - * @return bool - */ - function Authenticate($username, $password) { - // Start authentication - fputs($this->smtp_conn,"AUTH LOGIN" . $this->CRLF); - - $rply = $this->get_lines(); - $code = substr($rply,0,3); - - if($code != 334) { - $this->error = - array("error" => "AUTH not accepted from server", - "smtp_code" => $code, - "smtp_msg" => substr($rply,4)); - if($this->do_debug >= 1) { - echo "SMTP -> ERROR: " . $this->error["error"] . - ": " . $rply . $this->CRLF; - } - return false; - } - - // Send encoded username - fputs($this->smtp_conn, base64_encode($username) . $this->CRLF); - - $rply = $this->get_lines(); - $code = substr($rply,0,3); - - if($code != 334) { - $this->error = - array("error" => "Username not accepted from server", - "smtp_code" => $code, - "smtp_msg" => substr($rply,4)); - if($this->do_debug >= 1) { - echo "SMTP -> ERROR: " . $this->error["error"] . - ": " . $rply . $this->CRLF; - } - return false; - } - - // Send encoded password - fputs($this->smtp_conn, base64_encode($password) . $this->CRLF); - - $rply = $this->get_lines(); - $code = substr($rply,0,3); - - if($code != 235) { - $this->error = - array("error" => "Password not accepted from server", - "smtp_code" => $code, - "smtp_msg" => substr($rply,4)); - if($this->do_debug >= 1) { - echo "SMTP -> ERROR: " . $this->error["error"] . - ": " . $rply . $this->CRLF; - } - return false; - } - - return true; - } - - /** - * Returns true if connected to a server otherwise false - * @access private - * @return bool - */ - function Connected() { - if(!empty($this->smtp_conn)) { - $sock_status = socket_get_status($this->smtp_conn); - if($sock_status["eof"]) { - # hmm this is an odd situation... the socket is - # valid but we aren't connected anymore - if($this->do_debug >= 1) { - echo "SMTP -> NOTICE:" . $this->CRLF . - "EOF caught while checking if connected"; - } - $this->Close(); - return false; - } - return true; # everything looks good - } - return false; - } - - /** - * Closes the socket and cleans up the state of the class. - * It is not considered good to use this function without - * first trying to use QUIT. - * @access public - * @return void - */ - function Close() { - $this->error = null; # so there is no confusion - $this->helo_rply = null; - if(!empty($this->smtp_conn)) { - # close the connection and cleanup - fclose($this->smtp_conn); - $this->smtp_conn = 0; - } - } - - - /*************************************************************** - * SMTP COMMANDS * - *************************************************************/ - - /** - * Issues a data command and sends the msg_data to the server - * finializing the mail transaction. $msg_data is the message - * that is to be send with the headers. Each header needs to be - * on a single line followed by a with the message headers - * and the message body being seperated by and additional . - * - * Implements rfc 821: DATA - * - * SMTP CODE INTERMEDIATE: 354 - * [data] - * . - * SMTP CODE SUCCESS: 250 - * SMTP CODE FAILURE: 552,554,451,452 - * SMTP CODE FAILURE: 451,554 - * SMTP CODE ERROR : 500,501,503,421 - * @access public - * @return bool - */ - function Data($msg_data) { - $this->error = null; # so no confusion is caused - - if(!$this->connected()) { - $this->error = array( - "error" => "Called Data() without being connected"); - return false; - } - - fputs($this->smtp_conn,"DATA" . $this->CRLF); - - $rply = $this->get_lines(); - $code = substr($rply,0,3); - - if($this->do_debug >= 2) { - echo "SMTP -> FROM SERVER:" . $this->CRLF . $rply; - } - - if($code != 354) { - $this->error = - array("error" => "DATA command not accepted from server", - "smtp_code" => $code, - "smtp_msg" => substr($rply,4)); - if($this->do_debug >= 1) { - echo "SMTP -> ERROR: " . $this->error["error"] . - ": " . $rply . $this->CRLF; - } - return false; - } - - # the server is ready to accept data! - # according to rfc 821 we should not send more than 1000 - # including the CRLF - # characters on a single line so we will break the data up - # into lines by \r and/or \n then if needed we will break - # each of those into smaller lines to fit within the limit. - # in addition we will be looking for lines that start with - # a period '.' and append and additional period '.' to that - # line. NOTE: this does not count towards are limit. - - # normalize the line breaks so we know the explode works - $msg_data = str_replace("\r\n","\n",$msg_data); - $msg_data = str_replace("\r","\n",$msg_data); - $lines = explode("\n",$msg_data); - - # we need to find a good way to determine is headers are - # in the msg_data or if it is a straight msg body - # currently I'm assuming rfc 822 definitions of msg headers - # and if the first field of the first line (':' sperated) - # does not contain a space then it _should_ be a header - # and we can process all lines before a blank "" line as - # headers. - $field = substr($lines[0],0,strpos($lines[0],":")); - $in_headers = false; - if(!empty($field) && !strstr($field," ")) { - $in_headers = true; - } - - $max_line_length = 998; # used below; set here for ease in change - - while(list(,$line) = @each($lines)) { - $lines_out = null; - if($line == "" && $in_headers) { - $in_headers = false; - } - # ok we need to break this line up into several - # smaller lines - while(strlen($line) > $max_line_length) { - $pos = strrpos(substr($line,0,$max_line_length)," "); - - # Patch to fix DOS attack - if(!$pos) { - $pos = $max_line_length - 1; - } - - $lines_out[] = substr($line,0,$pos); - $line = substr($line,$pos + 1); - # if we are processing headers we need to - # add a LWSP-char to the front of the new line - # rfc 822 on long msg headers - if($in_headers) { - $line = "\t" . $line; - } - } - $lines_out[] = $line; - - # now send the lines to the server - while(list(,$line_out) = @each($lines_out)) { - if(strlen($line_out) > 0) - { - if(substr($line_out, 0, 1) == ".") { - $line_out = "." . $line_out; - } - } - fputs($this->smtp_conn,$line_out . $this->CRLF); - } - } - - # ok all the message data has been sent so lets get this - # over with aleady - fputs($this->smtp_conn, $this->CRLF . "." . $this->CRLF); - - $rply = $this->get_lines(); - $code = substr($rply,0,3); - - if($this->do_debug >= 2) { - echo "SMTP -> FROM SERVER:" . $this->CRLF . $rply; - } - - if($code != 250) { - $this->error = - array("error" => "DATA not accepted from server", - "smtp_code" => $code, - "smtp_msg" => substr($rply,4)); - if($this->do_debug >= 1) { - echo "SMTP -> ERROR: " . $this->error["error"] . - ": " . $rply . $this->CRLF; - } - return false; - } - return true; - } - - /** - * Expand takes the name and asks the server to list all the - * people who are members of the _list_. Expand will return - * back and array of the result or false if an error occurs. - * Each value in the array returned has the format of: - * [ ] - * The definition of is defined in rfc 821 - * - * Implements rfc 821: EXPN - * - * SMTP CODE SUCCESS: 250 - * SMTP CODE FAILURE: 550 - * SMTP CODE ERROR : 500,501,502,504,421 - * @access public - * @return string array - */ - function Expand($name) { - $this->error = null; # so no confusion is caused - - if(!$this->connected()) { - $this->error = array( - "error" => "Called Expand() without being connected"); - return false; - } - - fputs($this->smtp_conn,"EXPN " . $name . $this->CRLF); - - $rply = $this->get_lines(); - $code = substr($rply,0,3); - - if($this->do_debug >= 2) { - echo "SMTP -> FROM SERVER:" . $this->CRLF . $rply; - } - - if($code != 250) { - $this->error = - array("error" => "EXPN not accepted from server", - "smtp_code" => $code, - "smtp_msg" => substr($rply,4)); - if($this->do_debug >= 1) { - echo "SMTP -> ERROR: " . $this->error["error"] . - ": " . $rply . $this->CRLF; - } - return false; - } - - # parse the reply and place in our array to return to user - $entries = explode($this->CRLF,$rply); - while(list(,$l) = @each($entries)) { - $list[] = substr($l,4); - } - - return $list; - } - - /** - * Sends the HELO command to the smtp server. - * This makes sure that we and the server are in - * the same known state. - * - * Implements from rfc 821: HELO - * - * SMTP CODE SUCCESS: 250 - * SMTP CODE ERROR : 500, 501, 504, 421 - * @access public - * @return bool - */ - function Hello($host="") { - $this->error = null; # so no confusion is caused - - if(!$this->connected()) { - $this->error = array( - "error" => "Called Hello() without being connected"); - return false; - } - - # if a hostname for the HELO wasn't specified determine - # a suitable one to send - if(empty($host)) { - # we need to determine some sort of appopiate default - # to send to the server - $host = "localhost"; - } - - // Send extended hello first (RFC 2821) - if(!$this->SendHello("EHLO", $host)) - { - if(!$this->SendHello("HELO", $host)) - return false; - } - - return true; - } - - /** - * Sends a HELO/EHLO command. - * @access private - * @return bool - */ - function SendHello($hello, $host) { - fputs($this->smtp_conn, $hello . " " . $host . $this->CRLF); - - $rply = $this->get_lines(); - $code = substr($rply,0,3); - - if($this->do_debug >= 2) { - echo "SMTP -> FROM SERVER: " . $this->CRLF . $rply; - } - - if($code != 250) { - $this->error = - array("error" => $hello . " not accepted from server", - "smtp_code" => $code, - "smtp_msg" => substr($rply,4)); - if($this->do_debug >= 1) { - echo "SMTP -> ERROR: " . $this->error["error"] . - ": " . $rply . $this->CRLF; - } - return false; - } - - $this->helo_rply = $rply; - - return true; - } - - /** - * Gets help information on the keyword specified. If the keyword - * is not specified then returns generic help, ussually contianing - * A list of keywords that help is available on. This function - * returns the results back to the user. It is up to the user to - * handle the returned data. If an error occurs then false is - * returned with $this->error set appropiately. - * - * Implements rfc 821: HELP [ ] - * - * SMTP CODE SUCCESS: 211,214 - * SMTP CODE ERROR : 500,501,502,504,421 - * @access public - * @return string - */ - function Help($keyword="") { - $this->error = null; # to avoid confusion - - if(!$this->connected()) { - $this->error = array( - "error" => "Called Help() without being connected"); - return false; - } - - $extra = ""; - if(!empty($keyword)) { - $extra = " " . $keyword; - } - - fputs($this->smtp_conn,"HELP" . $extra . $this->CRLF); - - $rply = $this->get_lines(); - $code = substr($rply,0,3); - - if($this->do_debug >= 2) { - echo "SMTP -> FROM SERVER:" . $this->CRLF . $rply; - } - - if($code != 211 && $code != 214) { - $this->error = - array("error" => "HELP not accepted from server", - "smtp_code" => $code, - "smtp_msg" => substr($rply,4)); - if($this->do_debug >= 1) { - echo "SMTP -> ERROR: " . $this->error["error"] . - ": " . $rply . $this->CRLF; - } - return false; - } - - return $rply; - } - - /** - * Starts a mail transaction from the email address specified in - * $from. Returns true if successful or false otherwise. If True - * the mail transaction is started and then one or more Recipient - * commands may be called followed by a Data command. - * - * Implements rfc 821: MAIL FROM: - * - * SMTP CODE SUCCESS: 250 - * SMTP CODE SUCCESS: 552,451,452 - * SMTP CODE SUCCESS: 500,501,421 - * @access public - * @return bool - */ - function Mail($from) { - $this->error = null; # so no confusion is caused - - if(!$this->connected()) { - $this->error = array( - "error" => "Called Mail() without being connected"); - return false; - } - - fputs($this->smtp_conn,"MAIL FROM:<" . $from . ">" . $this->CRLF); - - $rply = $this->get_lines(); - $code = substr($rply,0,3); - - if($this->do_debug >= 2) { - echo "SMTP -> FROM SERVER:" . $this->CRLF . $rply; - } - - if($code != 250) { - $this->error = - array("error" => "MAIL not accepted from server", - "smtp_code" => $code, - "smtp_msg" => substr($rply,4)); - if($this->do_debug >= 1) { - echo "SMTP -> ERROR: " . $this->error["error"] . - ": " . $rply . $this->CRLF; - } - return false; - } - return true; - } - - /** - * Sends the command NOOP to the SMTP server. - * - * Implements from rfc 821: NOOP - * - * SMTP CODE SUCCESS: 250 - * SMTP CODE ERROR : 500, 421 - * @access public - * @return bool - */ - function Noop() { - $this->error = null; # so no confusion is caused - - if(!$this->connected()) { - $this->error = array( - "error" => "Called Noop() without being connected"); - return false; - } - - fputs($this->smtp_conn,"NOOP" . $this->CRLF); - - $rply = $this->get_lines(); - $code = substr($rply,0,3); - - if($this->do_debug >= 2) { - echo "SMTP -> FROM SERVER:" . $this->CRLF . $rply; - } - - if($code != 250) { - $this->error = - array("error" => "NOOP not accepted from server", - "smtp_code" => $code, - "smtp_msg" => substr($rply,4)); - if($this->do_debug >= 1) { - echo "SMTP -> ERROR: " . $this->error["error"] . - ": " . $rply . $this->CRLF; - } - return false; - } - return true; - } - - /** - * Sends the quit command to the server and then closes the socket - * if there is no error or the $close_on_error argument is true. - * - * Implements from rfc 821: QUIT - * - * SMTP CODE SUCCESS: 221 - * SMTP CODE ERROR : 500 - * @access public - * @return bool - */ - function Quit($close_on_error=true) { - $this->error = null; # so there is no confusion - - if(!$this->connected()) { - $this->error = array( - "error" => "Called Quit() without being connected"); - return false; - } - - # send the quit command to the server - fputs($this->smtp_conn,"quit" . $this->CRLF); - - # get any good-bye messages - $byemsg = $this->get_lines(); - - if($this->do_debug >= 2) { - echo "SMTP -> FROM SERVER:" . $this->CRLF . $byemsg; - } - - $rval = true; - $e = null; - - $code = substr($byemsg,0,3); - if($code != 221) { - # use e as a tmp var cause Close will overwrite $this->error - $e = array("error" => "SMTP server rejected quit command", - "smtp_code" => $code, - "smtp_rply" => substr($byemsg,4)); - $rval = false; - if($this->do_debug >= 1) { - echo "SMTP -> ERROR: " . $e["error"] . ": " . - $byemsg . $this->CRLF; - } - } - - if(empty($e) || $close_on_error) { - $this->Close(); - } - - return $rval; - } - - /** - * Sends the command RCPT to the SMTP server with the TO: argument of $to. - * Returns true if the recipient was accepted false if it was rejected. - * - * Implements from rfc 821: RCPT TO: - * - * SMTP CODE SUCCESS: 250,251 - * SMTP CODE FAILURE: 550,551,552,553,450,451,452 - * SMTP CODE ERROR : 500,501,503,421 - * @access public - * @return bool - */ - function Recipient($to) { - $this->error = null; # so no confusion is caused - - if(!$this->connected()) { - $this->error = array( - "error" => "Called Recipient() without being connected"); - return false; - } - - fputs($this->smtp_conn,"RCPT TO:<" . $to . ">" . $this->CRLF); - - $rply = $this->get_lines(); - $code = substr($rply,0,3); - - if($this->do_debug >= 2) { - echo "SMTP -> FROM SERVER:" . $this->CRLF . $rply; - } - - if($code != 250 && $code != 251) { - $this->error = - array("error" => "RCPT not accepted from server", - "smtp_code" => $code, - "smtp_msg" => substr($rply,4)); - if($this->do_debug >= 1) { - echo "SMTP -> ERROR: " . $this->error["error"] . - ": " . $rply . $this->CRLF; - } - return false; - } - return true; - } - - /** - * Sends the RSET command to abort and transaction that is - * currently in progress. Returns true if successful false - * otherwise. - * - * Implements rfc 821: RSET - * - * SMTP CODE SUCCESS: 250 - * SMTP CODE ERROR : 500,501,504,421 - * @access public - * @return bool - */ - function Reset() { - $this->error = null; # so no confusion is caused - - if(!$this->connected()) { - $this->error = array( - "error" => "Called Reset() without being connected"); - return false; - } - - fputs($this->smtp_conn,"RSET" . $this->CRLF); - - $rply = $this->get_lines(); - $code = substr($rply,0,3); - - if($this->do_debug >= 2) { - echo "SMTP -> FROM SERVER:" . $this->CRLF . $rply; - } - - if($code != 250) { - $this->error = - array("error" => "RSET failed", - "smtp_code" => $code, - "smtp_msg" => substr($rply,4)); - if($this->do_debug >= 1) { - echo "SMTP -> ERROR: " . $this->error["error"] . - ": " . $rply . $this->CRLF; - } - return false; - } - - return true; - } - - /** - * Starts a mail transaction from the email address specified in - * $from. Returns true if successful or false otherwise. If True - * the mail transaction is started and then one or more Recipient - * commands may be called followed by a Data command. This command - * will send the message to the users terminal if they are logged - * in. - * - * Implements rfc 821: SEND FROM: - * - * SMTP CODE SUCCESS: 250 - * SMTP CODE SUCCESS: 552,451,452 - * SMTP CODE SUCCESS: 500,501,502,421 - * @access public - * @return bool - */ - function Send($from) { - $this->error = null; # so no confusion is caused - - if(!$this->connected()) { - $this->error = array( - "error" => "Called Send() without being connected"); - return false; - } - - fputs($this->smtp_conn,"SEND FROM:" . $from . $this->CRLF); - - $rply = $this->get_lines(); - $code = substr($rply,0,3); - - if($this->do_debug >= 2) { - echo "SMTP -> FROM SERVER:" . $this->CRLF . $rply; - } - - if($code != 250) { - $this->error = - array("error" => "SEND not accepted from server", - "smtp_code" => $code, - "smtp_msg" => substr($rply,4)); - if($this->do_debug >= 1) { - echo "SMTP -> ERROR: " . $this->error["error"] . - ": " . $rply . $this->CRLF; - } - return false; - } - return true; - } - - /** - * Starts a mail transaction from the email address specified in - * $from. Returns true if successful or false otherwise. If True - * the mail transaction is started and then one or more Recipient - * commands may be called followed by a Data command. This command - * will send the message to the users terminal if they are logged - * in and send them an email. - * - * Implements rfc 821: SAML FROM: - * - * SMTP CODE SUCCESS: 250 - * SMTP CODE SUCCESS: 552,451,452 - * SMTP CODE SUCCESS: 500,501,502,421 - * @access public - * @return bool - */ - function SendAndMail($from) { - $this->error = null; # so no confusion is caused - - if(!$this->connected()) { - $this->error = array( - "error" => "Called SendAndMail() without being connected"); - return false; - } - - fputs($this->smtp_conn,"SAML FROM:" . $from . $this->CRLF); - - $rply = $this->get_lines(); - $code = substr($rply,0,3); - - if($this->do_debug >= 2) { - echo "SMTP -> FROM SERVER:" . $this->CRLF . $rply; - } - - if($code != 250) { - $this->error = - array("error" => "SAML not accepted from server", - "smtp_code" => $code, - "smtp_msg" => substr($rply,4)); - if($this->do_debug >= 1) { - echo "SMTP -> ERROR: " . $this->error["error"] . - ": " . $rply . $this->CRLF; - } - return false; - } - return true; - } - - /** - * Starts a mail transaction from the email address specified in - * $from. Returns true if successful or false otherwise. If True - * the mail transaction is started and then one or more Recipient - * commands may be called followed by a Data command. This command - * will send the message to the users terminal if they are logged - * in or mail it to them if they are not. - * - * Implements rfc 821: SOML FROM: - * - * SMTP CODE SUCCESS: 250 - * SMTP CODE SUCCESS: 552,451,452 - * SMTP CODE SUCCESS: 500,501,502,421 - * @access public - * @return bool - */ - function SendOrMail($from) { - $this->error = null; # so no confusion is caused - - if(!$this->connected()) { - $this->error = array( - "error" => "Called SendOrMail() without being connected"); - return false; - } - - fputs($this->smtp_conn,"SOML FROM:" . $from . $this->CRLF); - - $rply = $this->get_lines(); - $code = substr($rply,0,3); - - if($this->do_debug >= 2) { - echo "SMTP -> FROM SERVER:" . $this->CRLF . $rply; - } - - if($code != 250) { - $this->error = - array("error" => "SOML not accepted from server", - "smtp_code" => $code, - "smtp_msg" => substr($rply,4)); - if($this->do_debug >= 1) { - echo "SMTP -> ERROR: " . $this->error["error"] . - ": " . $rply . $this->CRLF; - } - return false; - } - return true; - } - - /** - * This is an optional command for SMTP that this class does not - * support. This method is here to make the RFC821 Definition - * complete for this class and __may__ be implimented in the future - * - * Implements from rfc 821: TURN - * - * SMTP CODE SUCCESS: 250 - * SMTP CODE FAILURE: 502 - * SMTP CODE ERROR : 500, 503 - * @access public - * @return bool - */ - function Turn() { - $this->error = array("error" => "This method, TURN, of the SMTP ". - "is not implemented"); - if($this->do_debug >= 1) { - echo "SMTP -> NOTICE: " . $this->error["error"] . $this->CRLF; - } - return false; - } - - /** - * Verifies that the name is recognized by the server. - * Returns false if the name could not be verified otherwise - * the response from the server is returned. - * - * Implements rfc 821: VRFY - * - * SMTP CODE SUCCESS: 250,251 - * SMTP CODE FAILURE: 550,551,553 - * SMTP CODE ERROR : 500,501,502,421 - * @access public - * @return int - */ - function Verify($name) { - $this->error = null; # so no confusion is caused - - if(!$this->connected()) { - $this->error = array( - "error" => "Called Verify() without being connected"); - return false; - } - - fputs($this->smtp_conn,"VRFY " . $name . $this->CRLF); - - $rply = $this->get_lines(); - $code = substr($rply,0,3); - - if($this->do_debug >= 2) { - echo "SMTP -> FROM SERVER:" . $this->CRLF . $rply; - } - - if($code != 250 && $code != 251) { - $this->error = - array("error" => "VRFY failed on name '$name'", - "smtp_code" => $code, - "smtp_msg" => substr($rply,4)); - if($this->do_debug >= 1) { - echo "SMTP -> ERROR: " . $this->error["error"] . - ": " . $rply . $this->CRLF; - } - return false; - } - return $rply; - } - - /******************************************************************* - * INTERNAL FUNCTIONS * - ******************************************************************/ - - /** - * Read in as many lines as possible - * either before eof or socket timeout occurs on the operation. - * With SMTP we can tell if we have more lines to read if the - * 4th character is '-' symbol. If it is a space then we don't - * need to read anything else. - * @access private - * @return string - */ - function get_lines() { - $data = ""; - while($str = fgets($this->smtp_conn,515)) { - if($this->do_debug >= 4) { - echo "SMTP -> get_lines(): \$data was \"$data\"" . - $this->CRLF; - echo "SMTP -> get_lines(): \$str is \"$str\"" . - $this->CRLF; - } - $data .= $str; - if($this->do_debug >= 4) { - echo "SMTP -> get_lines(): \$data is \"$data\"" . $this->CRLF; - } - # if the 4th character is a space then we are done reading - # so just break the loop - if(substr($str,3,1) == " ") { break; } - } - return $data; - } - -} - - - ?> diff --git a/conlite/classes/template/class.template.php b/conlite/classes/template/class.template.php index 8004a23..738eb90 100644 --- a/conlite/classes/template/class.template.php +++ b/conlite/classes/template/class.template.php @@ -209,7 +209,11 @@ class Template { if (!is_file($template)) { $content = & $template; //template is a string (it is a reference to save memory!!!) } else { - $content = implode("", file($template)); //template is a file + if(cFileHandler::readable($template)) { + $content = implode("", file($template)); //template is a file + } else { + return $template; + } } $content = (($note) ? "\n" : "") . $content; diff --git a/conlite/includes/functions.general.php b/conlite/includes/functions.general.php index a0c46a8..1f49250 100644 --- a/conlite/includes/functions.general.php +++ b/conlite/includes/functions.general.php @@ -2052,57 +2052,6 @@ function notifyOnError($errortitle, $errormessage) { } } -function cIDNAEncode($sourceEncoding, $string) { - if (extension_loaded("iconv")) { - cInclude('pear', 'Net/IDNA.php'); - - $idn = Net_IDNA :: getInstance(); - - $string = iconv("UTF-8", $sourceEncoding, $string); - $string = $idn->encode($string); - - return ($string); - } - - if (extension_loaded("recode")) { - cInclude('pear', 'Net/IDNA.php'); - - $idn = Net_IDNA :: getInstance(); - - $string = $idn->decode($string); - $string = recode_string("UTF-8.." . $sourceEncoding, $string); - return $string; - } - - return $string; -} - -function cIDNADecode($targetEncoding, $string) { - if (extension_loaded("iconv")) { - cInclude('pear', 'Net/IDNA.php'); - - $idn = Net_IDNA :: getInstance(); - - $string = $idn->decode($string); - $string = iconv($targetEncoding, "UTF-8", $string); - - return ($string); - } - - if (extension_loaded("recode")) { - cInclude('pear', 'Net/IDNA.php'); - - $idn = Net_IDNA :: getInstance(); - - $string = recode_string($targetEncoding . "..UTF-8", $string); - $string = $idn->decode($string); - - return $string; - } - - return $string; -} - /** * Checks for a named key of an array, pushes it if not set with a default value * diff --git a/conlite/includes/include.str_overview.php b/conlite/includes/include.str_overview.php index 3563da8..1a4631b 100644 --- a/conlite/includes/include.str_overview.php +++ b/conlite/includes/include.str_overview.php @@ -233,101 +233,6 @@ if (!isset($idcat)) $idcat = 0; if (!isset($action)) $action = 0; -/* -function buildTree(&$rootItem, &$items) { - global $nextItem, $perm, $tmp_area; - - while ($item_list = each($items)) { - list($key, $item) = $item_list; - - unset($newItem); - - $bCheck = false; - if (!$bCheck) { - $bCheck = $perm->have_perm_area_action($tmp_area, "str_newtree"); - } - if (!$bCheck) { - $bCheck = $perm->have_perm_area_action($tmp_area, "str_newcat"); - } - if (!$bCheck) { - $bCheck = $perm->have_perm_area_action($tmp_area, "str_makevisible"); - } - if (!$bCheck) { - $bCheck = $perm->have_perm_area_action($tmp_area, "str_makepublic"); - } - if (!$bCheck) { - $bCheck = $perm->have_perm_area_action($tmp_area, "str_deletecat"); - } - if (!$bCheck) { - $bCheck = $perm->have_perm_area_action($tmp_area, "str_moveupcat"); - } - if (!$bCheck) { - $bCheck = $perm->have_perm_area_action($tmp_area, "str_movedowncat"); - } - if (!$bCheck) { - $bCheck = $perm->have_perm_area_action($tmp_area, "str_movesubtree"); - } - if (!$bCheck) { - $bCheck = $perm->have_perm_area_action($tmp_area, "str_renamecat"); - } - if (!$bCheck) { - $bCheck = $perm->have_perm_area_action("str_tplcfg", "str_tplcfg"); - } - if (!$bCheck) { - $bCheck = $perm->have_perm_item($tmp_area, $item['idcat']); - } - - if ($bCheck) { - $newItem = new TreeItem($item['name'], $item['idcat'], true); - } else { - $newItem = new TreeItem($item['name'], $item['idcat'], false); - } - - $newItem->collapsed_icon = 'images/open_all.gif'; - $newItem->expanded_icon = 'images/close_all.gif'; - $newItem->custom['idtree'] = $item['idtree']; - $newItem->custom['level'] = $item['level']; - $newItem->custom['idcat'] = $item['idcat']; - $newItem->custom['idtree'] = $item['idtree']; - $newItem->custom['parentid'] = $item['parentid']; - $newItem->custom['alias'] = $item['alias']; - $newItem->custom['preid'] = $item['preid']; - $newItem->custom['postid'] = $item['postid']; - $newItem->custom['visible'] = $item['visible']; - $newItem->custom['idtplcfg'] = $item['idtplcfg']; - $newItem->custom['public'] = $item['public']; - - if ($perm->have_perm_item("str", $item['idcat'])) { - $newItem->custom['forcedisplay'] = 1; - } - - if (array_key_exists($key + 1, $items)) { - $nextItem = $items[$key + 1]; - } else { - $nextItem = 0; - } - - if (array_key_exists($key - 1, $items)) { - $lastItem = $items[$key - 1]; - } else { - $lastItem = 0; - } - - $rootItem->addItem($newItem); - - if ($nextItem['level'] > $item['level']) { - $oldRoot = $rootItem; - buildTree($newItem, $items); - $rootItem = $oldRoot; - } - - if ($nextItem['level'] < $item['level']) { - return; - } - } -} - * - */ function buildTree(&$rootItem, $itemsIterator) { global $nextItem, $perm, $tmp_area; From 965c7054f4e907499e876d666ac32cd7c073945e Mon Sep 17 00:00:00 2001 From: "o.pinke" Date: Fri, 17 Feb 2023 15:14:30 +0100 Subject: [PATCH 14/37] increase CL version --- conlite/includes/startup.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/conlite/includes/startup.php b/conlite/includes/startup.php index 451bffb..8b0f655 100644 --- a/conlite/includes/startup.php +++ b/conlite/includes/startup.php @@ -71,7 +71,7 @@ if (!defined('CL_ENVIRONMENT')) { */ if (!defined('CL_VERSION')) { -define('CL_VERSION', '2.3.0 RC'); +define('CL_VERSION', '3.0.0 RC'); } From 44382f8da0bfd4f00d93d3f551f87c3c3a5f1959 Mon Sep 17 00:00:00 2001 From: "o.pinke" Date: Fri, 17 Feb 2023 15:14:57 +0100 Subject: [PATCH 15/37] increase CL version --- setup/lib/defines.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup/lib/defines.php b/setup/lib/defines.php index 596d2e8..4ea1ba8 100644 --- a/setup/lib/defines.php +++ b/setup/lib/defines.php @@ -39,7 +39,7 @@ define('C_SETUP_STEPWIDTH', 28); define('C_SETUP_STEPHEIGHT', 28); define('C_SETUP_MIN_PHP_VERSION', '7.4.0'); define('C_SETUP_MAX_PHP_VERSION', '8.3.0'); -define('C_SETUP_VERSION', '2.3.0'); +define('C_SETUP_VERSION', '3.0.0'); $sDefLocalPath = dirname(__FILE__).DIRECTORY_SEPARATOR.'defines.local.php'; if(file_exists($sDefLocalPath)) { From 6847130805290392f4041a7687334c335573df82 Mon Sep 17 00:00:00 2001 From: "o.pinke" Date: Fri, 17 Feb 2023 15:17:20 +0100 Subject: [PATCH 16/37] add new methods, cleanup, PHP8 fixes --- cms/includes/class.input.helper.php | 142 ++++++++++++++++++++++------ 1 file changed, 112 insertions(+), 30 deletions(-) diff --git a/cms/includes/class.input.helper.php b/cms/includes/class.input.helper.php index f4c8c04..4526bc6 100644 --- a/cms/includes/class.input.helper.php +++ b/cms/includes/class.input.helper.php @@ -144,8 +144,7 @@ class cHTMLInputSelectElement extends cHTMLSelectElement { * * @return int Number of items added * */ - function addCategories($iMaxLevel = 0, $bColored = false, $bCatVisible = true, $bCatPublic = true, - $bWithArt = false, $bArtOnline = true) { + function addCategories($iMaxLevel = 0, $bColored = false, $bCatVisible = true, $bCatPublic = true, $bWithArt = false, $bArtOnline = true) { global $cfg, $client, $lang; $oDB = new DB_Contenido; @@ -259,27 +258,18 @@ class cHTMLInputSelectElement extends cHTMLSelectElement { } } - /** - * Selects specified elements as selected - * - * @param array $aElements Array with "values" of the cHTMLOptionElement to set - * - * @return none - */ - function setSelected($aElements) { - if (is_array($this->_options) && is_array($aElements)) { - foreach ($this->_options as $sKey => $oOption) { - if (in_array($oOption->getAttribute("value"), $aElements)) { - $oOption->setSelected(true); - $this->_options[$sKey] = $oOption; - } else { - $oOption->setSelected(false); - $this->_options[$sKey] = $oOption; - } - } - } + public function addFiles($sPath) { + $iCount = 0; + $aFiles = cDirHandler::read($sPath); + asort($aFiles); + $iCounter = count($this->_options); + foreach ($aFiles as $sValue) { + $oOption = new cHTMLOptionElement($sValue, $sValue); + $this->addOptionElement($iCounter, $oOption); + $iCounter++; + } + return count($aFiles); } - } class UI_Config_Table { @@ -302,16 +292,24 @@ class UI_Config_Table { var $_sColorLight; var $_sColorDark; + /** + * + * @var type + */ + protected $_iRowCnt = 0; + function __construct() { - global $cfg; + $cfg = cRegistry::getConfig(); $this->_sPadding = 2; $this->_sBorder = 0; - $this->_sBorderColor = $cfg['color']['table_border']; - $this->_sTplCellCode = ' {CONTENT}' . "\n"; + $this->_sBorderColor = cRegistry::getConfigValue('color', 'table_border'); + $this->_sTplCellCode = '' . "\n" + . '{CONTENT}' . "\n" + . '' . "\n"; $this->_sTplTableFile = $cfg['path']['contenido'] . $cfg['path']['templates'] . $cfg['templates']['generic_list']; - $this->_sColorLight = $cfg['color']['table_light']; - $this->_sColorDark = $cfg['color']['table_dark']; + $this->_sColorLight = cRegistry::getConfigValue('color', 'table_light'); + $this->_sColorDark = cRegistry::getConfigValue('color', 'table_dark'); } function setCellTemplate($sCode) { @@ -417,8 +415,37 @@ class UI_Config_Table { return $sSkript; } - function render($bPrint = false) { - $oTable = new Template; + /** + * increase row counter + */ + public function nextRow() { + $this->_iRowCnt++; + } + + /** + * get current row count + * + * @return int row count + */ + public function getRowCount() : int { + return $this->_iRowCnt; + } + + public function setRowCell(int $iCell, $mContent) { + $this->setCell($this->_iRowCnt, $iCell, $mContent); + } + + public function setRowBorder(string $sWhich = 'bottom') { + $sStyle = ''; + switch ($sWhich) { + case 'bottom': + $this->setRowExtra($this->_iRowCnt, 'border-bottom: 1px solid silver;'); + break; + } + } + + public function render($bPrint = false) { + $oTable = new Template(); $oTable->reset(); $oTable->set('s', 'CELLPADDING', $this->_sPadding); @@ -437,6 +464,8 @@ class UI_Config_Table { $iCount = 0; foreach ($aCells as $sCell => $sData) { + $sData = $this->_processContentData($sData); + $iCount++; $sTplCell = $this->_sTplCellCode; @@ -525,4 +554,57 @@ class UI_Config_Table { } } -} \ No newline at end of file + /** + * returns different types of content data as string + * you can use + * - string + * - object, needs to have a render method + * - array of objects and/or strings + * + * @author Ortwin Pinke + * @since 2.3.0 + * + * + * @param mixed $mData + * @return string + */ + protected function _processContentData($mData): string { + if (is_string($mData)) { + return $mData; + } + + $sData = ''; + + if (is_array($mData) && count($mData) > 0) { + foreach ($mData as $mElement) { + if (is_string($mElement)) { + $sData .= $mElement; + continue; + } + $sData .= $this->_renderObject($mElement); + } + } else { + $sData = $this->_renderObject($mData); + } + + return $sData; + } + + /** + * Renders an object using its render method + * + * @author Ortwin Pinke + * @since 2.3.0 + * + * @param type $oObject + * @return string rendered string from object | empty string + */ + protected function _renderObject($oObject): string { + $sReturn = ''; + if (is_object($oObject) && method_exists($oObject, 'render')) { + $sReturn = $oObject->render(); + } + return $sReturn; + } + +} From b199edaf8e4a1fc322d98e83f452dbea3de05d40 Mon Sep 17 00:00:00 2001 From: "o.pinke" Date: Fri, 17 Feb 2023 15:18:01 +0100 Subject: [PATCH 17/37] gitadmin --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index c1ac363..f1affa7 100644 --- a/.gitignore +++ b/.gitignore @@ -24,3 +24,4 @@ /cms/cache/* /setup/lib/defines.local.php /cms/js/fancybox/ +/.dev/ From 4aba95edd1281d5b4acfb9c396412cd0912caba6 Mon Sep 17 00:00:00 2001 From: "o.pinke" Date: Fri, 17 Feb 2023 15:38:31 +0100 Subject: [PATCH 18/37] fix PHP8 errors --- setup/lib/functions.filesystem.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/setup/lib/functions.filesystem.php b/setup/lib/functions.filesystem.php index 5ea0950..bf5b40b 100644 --- a/setup/lib/functions.filesystem.php +++ b/setup/lib/functions.filesystem.php @@ -122,7 +122,7 @@ function canWriteFile($sFilename) { * a wrong information */ $fp = @fopen($sRandFilenamePath, "w"); - if ($fp) { + if (is_resource($fp)) { @fclose($fp); unlink($sRandFilenamePath); return true; @@ -143,8 +143,10 @@ function canWriteFile($sFilename) { /* Ignore errors in case isWriteable() returns * a wrong information */ - $fp = @fopen($sFilename, "w"); - @fclose($fp); + $fp = fopen($sFilename, "w"); + if (is_resource($fp)) { + fclose($fp); + } if (file_exists($sFilename)) { @unlink($sFilename); From 33dcc58748d4341877605afaa0e133ba3132e58d Mon Sep 17 00:00:00 2001 From: "o.pinke" Date: Sun, 19 Feb 2023 10:00:57 +0100 Subject: [PATCH 19/37] always return string --- conlite/includes/functions.con2.php | 25 +++++++++++-------------- 1 file changed, 11 insertions(+), 14 deletions(-) diff --git a/conlite/includes/functions.con2.php b/conlite/includes/functions.con2.php index 7183c4c..b424656 100644 --- a/conlite/includes/functions.con2.php +++ b/conlite/includes/functions.con2.php @@ -237,7 +237,7 @@ function conGenerateCode($idcat, $idart, $lang, $client, $layout = false) { $a_container = explode("&", $tmp_returnstring); foreach ($a_container as $key => $value) { - + if (is_numeric($a_d[$value])) { $thisModule = ''; $thisContainer = ''; @@ -573,21 +573,18 @@ function conGetAvailableMetaTagTypes() { * @return string tag value or empty string */ function conGetMetaValue($idartlang, $idmetatype) { + $sRet = ""; + if (!empty($idartlang)) { + $oMetaTags = new cApiMetaTagCollection(); + $oMetaTags->setWhere('idartlang', Contenido_Security::toInteger($idartlang)); + $oMetaTags->setWhere('idmetatype', Contenido_Security::toInteger($idmetatype)); + $oMetaTags->query(); - if ($idartlang == 0) - return; - - $oMetaTags = new cApiMetaTagCollection(); - $oMetaTags->setWhere('idartlang', Contenido_Security::toInteger($idartlang)); - $oMetaTags->setWhere('idmetatype', Contenido_Security::toInteger($idmetatype)); - $oMetaTags->query(); - - if ($oMetaTags->count() > 0) { - $sRet = $oMetaTags->next()->get('metavalue'); - } else { - $sRet = ""; + if ($oMetaTags->count() > 0) { + $sRet = $oMetaTags->next()->get('metavalue'); + } + unset($oMetaTags); // save mem } - unset($oMetaTags); // save mem return $sRet; } From 90dbc01650509cbf12274536e69a110ef0f611c9 Mon Sep 17 00:00:00 2001 From: "o.pinke" Date: Sun, 19 Feb 2023 10:30:38 +0100 Subject: [PATCH 20/37] always string in $sCode --- conlite/includes/include.style_edit_form.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/conlite/includes/include.style_edit_form.php b/conlite/includes/include.style_edit_form.php index 4c6b271..8c59965 100644 --- a/conlite/includes/include.style_edit_form.php +++ b/conlite/includes/include.style_edit_form.php @@ -158,7 +158,7 @@ if (!$perm->have_perm_area_action($area, $action)) { if ($_REQUEST['action'] == $sActionEdit) { $sCode = getFileContent($sFilename, $path); } else { - $sCode = $_REQUEST['code']; + $sCode = empty($_REQUEST['code'])?'':$_REQUEST['code']; } $form = new UI_Table_Form("file_editor"); From 1ff067d6153005ae57a904b7ea697b1808d48647 Mon Sep 17 00:00:00 2001 From: "o.pinke" Date: Sun, 19 Feb 2023 10:39:09 +0100 Subject: [PATCH 21/37] always string in $sCode --- conlite/includes/include.js_edit_form.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/conlite/includes/include.js_edit_form.php b/conlite/includes/include.js_edit_form.php index 0f03770..8796094 100644 --- a/conlite/includes/include.js_edit_form.php +++ b/conlite/includes/include.js_edit_form.php @@ -145,7 +145,7 @@ if (!$perm->have_perm_area_action($area, $action)) { if ($_REQUEST['action'] == $sActionEdit) { $sCode = getFileContent($sFilename, $path); } else { - $sCode = $_REQUEST['code']; # stripslashes is required here in case of creating a new file + $sCode = empty($_REQUEST['code'])?'':$_REQUEST['code']; } $form = new UI_Table_Form("file_editor"); From 7638a62ace09df4e6bd6919f0ebd58ea298a5efc Mon Sep 17 00:00:00 2001 From: "o.pinke" Date: Sun, 19 Feb 2023 10:41:40 +0100 Subject: [PATCH 22/37] always string in $sCode --- conlite/includes/include.html_tpl_edit_form.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/conlite/includes/include.html_tpl_edit_form.php b/conlite/includes/include.html_tpl_edit_form.php index d3a5346..59c6ddd 100644 --- a/conlite/includes/include.html_tpl_edit_form.php +++ b/conlite/includes/include.html_tpl_edit_form.php @@ -138,7 +138,7 @@ if (!$perm->have_perm_area_action($area, $action)) { if ($_REQUEST['action'] == $sActionEdit) { $sCode = getFileContent($sFilename, $path); } else { - $sCode = $_REQUEST['code']; # stripslashes is required here in case of creating a new file + $sCode = empty($_REQUEST['code'])?'':$_REQUEST['code']; } /* Try to validate html */ From fa3c96b94da2067b69c07e1c16991e172e106210 Mon Sep 17 00:00:00 2001 From: "o.pinke" Date: Tue, 21 Feb 2023 13:23:36 +0100 Subject: [PATCH 23/37] param with type|null --- conlite/includes/functions.general.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/conlite/includes/functions.general.php b/conlite/includes/functions.general.php index 1f49250..0074816 100644 --- a/conlite/includes/functions.general.php +++ b/conlite/includes/functions.general.php @@ -2182,7 +2182,7 @@ function IP_match($network, $mask, $ip) { * @param string $encoding default UTF-8 * @return string Returns the converted string */ -function clHtmlSpecialChars(string $value, int $flags = ENT_COMPAT|ENT_HTML401, string $encoding = 'UTF-8') { +function clHtmlSpecialChars(string $value, ?int $flags = ENT_COMPAT|ENT_HTML401, ?string $encoding = 'UTF-8') { return htmlspecialchars($value, $flags, $encoding); } @@ -2198,7 +2198,7 @@ function clHtmlSpecialChars(string $value, int $flags = ENT_COMPAT|ENT_HTML401, * @param string $encoding default UTF-8 * @return string Returns the decoded string */ -function clHtmlEntityDecode(string $value, int $flags = ENT_COMPAT|ENT_HTML401, string $encoding = 'UTF-8') { +function clHtmlEntityDecode(string $value, ?int $flags = ENT_COMPAT|ENT_HTML401, ?string $encoding = 'UTF-8') { return html_entity_decode($value, $flags, $encoding); } @@ -2214,7 +2214,7 @@ function clHtmlEntityDecode(string $value, int $flags = ENT_COMPAT|ENT_HTML401, * @param string $encoding default UTF-8 * @return string Returns the converted string */ -function clHtmlEntities(string $value, int $flags = ENT_COMPAT|ENT_HTML401, string $encoding = 'UTF-8') { +function clHtmlEntities(string $value, ?int $flags = ENT_COMPAT|ENT_HTML401, ?string $encoding = 'UTF-8') { return htmlentities($value, $flags, $encoding); } @@ -2230,6 +2230,6 @@ function clHtmlEntities(string $value, int $flags = ENT_COMPAT|ENT_HTML401, stri * @param string $encoding * @return array */ -function clGetHtmlTranslationTable(int $table = HTML_SPECIALCHARS, int $flags = ENT_COMPAT|ENT_HTML401, string $encoding = null) { +function clGetHtmlTranslationTable(?int $table = HTML_SPECIALCHARS, ?int $flags = ENT_COMPAT|ENT_HTML401, ?string $encoding = null) { return get_html_translation_table($table, $flags, $encoding); } \ No newline at end of file From 434b483fac58e2e462dbc7584af28bebc5dea9ed Mon Sep 17 00:00:00 2001 From: "o.pinke" Date: Tue, 21 Feb 2023 15:33:03 +0100 Subject: [PATCH 24/37] set flags to php8.1 standard --- conlite/includes/functions.general.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/conlite/includes/functions.general.php b/conlite/includes/functions.general.php index 0074816..8c190c5 100644 --- a/conlite/includes/functions.general.php +++ b/conlite/includes/functions.general.php @@ -2182,7 +2182,7 @@ function IP_match($network, $mask, $ip) { * @param string $encoding default UTF-8 * @return string Returns the converted string */ -function clHtmlSpecialChars(string $value, ?int $flags = ENT_COMPAT|ENT_HTML401, ?string $encoding = 'UTF-8') { +function clHtmlSpecialChars(string $value, ?int $flags = ENT_QUOTES | ENT_SUBSTITUTE | ENT_HTML401, string $encoding = 'UTF-8') { return htmlspecialchars($value, $flags, $encoding); } @@ -2198,7 +2198,7 @@ function clHtmlSpecialChars(string $value, ?int $flags = ENT_COMPAT|ENT_HTML401, * @param string $encoding default UTF-8 * @return string Returns the decoded string */ -function clHtmlEntityDecode(string $value, ?int $flags = ENT_COMPAT|ENT_HTML401, ?string $encoding = 'UTF-8') { +function clHtmlEntityDecode(string $value, ?int $flags = ENT_QUOTES | ENT_SUBSTITUTE | ENT_HTML401, string $encoding = 'UTF-8') { return html_entity_decode($value, $flags, $encoding); } @@ -2214,7 +2214,8 @@ function clHtmlEntityDecode(string $value, ?int $flags = ENT_COMPAT|ENT_HTML401, * @param string $encoding default UTF-8 * @return string Returns the converted string */ -function clHtmlEntities(string $value, ?int $flags = ENT_COMPAT|ENT_HTML401, ?string $encoding = 'UTF-8') { +function clHtmlEntities(string $value,?int $flags = ENT_QUOTES | ENT_SUBSTITUTE | ENT_HTML401, string $encoding = 'UTF-8') { + var_dump($flags); return htmlentities($value, $flags, $encoding); } @@ -2230,6 +2231,6 @@ function clHtmlEntities(string $value, ?int $flags = ENT_COMPAT|ENT_HTML401, ?st * @param string $encoding * @return array */ -function clGetHtmlTranslationTable(?int $table = HTML_SPECIALCHARS, ?int $flags = ENT_COMPAT|ENT_HTML401, ?string $encoding = null) { +function clGetHtmlTranslationTable(int $table = HTML_SPECIALCHARS, int $flags = ENT_QUOTES | ENT_SUBSTITUTE | ENT_HTML401, string $encoding = "UTF-8") { return get_html_translation_table($table, $flags, $encoding); } \ No newline at end of file From 6729446154807170ab00fa3309652fa2911ce15f Mon Sep 17 00:00:00 2001 From: "o.pinke" Date: Wed, 22 Feb 2023 15:34:23 +0100 Subject: [PATCH 25/37] bugfixes search and keywords generation --- conlite/classes/class.article.collector.php | 8 +- conlite/classes/class.search.php | 86 ++++++++++++++----- .../contenido/class.articlelanguage.php | 42 ++++----- conlite/includes/functions.con2.php | 62 +++++-------- conlite/includes/functions.general.php | 1 - 5 files changed, 110 insertions(+), 89 deletions(-) diff --git a/conlite/classes/class.article.collector.php b/conlite/classes/class.article.collector.php index 0d9a25e..26a3bdb 100644 --- a/conlite/classes/class.article.collector.php +++ b/conlite/classes/class.article.collector.php @@ -34,7 +34,7 @@ class cArticleCollector implements SeekableIterator, Countable { protected $_aStartArticles = array(); protected $_aOptions = array(); protected $_aOptionsDefault = array(); - private $_bAsObject = TRUE; + private $_bAsObject = true; /** * @@ -65,14 +65,12 @@ class cArticleCollector implements SeekableIterator, Countable { } if (count($this->_aStartArticles) > 0) { - print_r($this->_aStartArticles); if ($this->_aOptions['start'] == false) { $oArtLangColl->setWhere("cApiArticleLanguageCollection.idartlang", $this->_aStartArticles, "NOTIN"); //$sqlStartArticles = "a.idartlang NOT IN ('" . implode("','", $this->_startArticles) . "') AND "; } if ($this->_aOptions['startonly'] == true) { - echo "startonly"; $oArtLangColl->setWhere("cApiArticleLanguageCollection.idartlang", $this->_aStartArticles, "IN"); //$sqlStartArticles = "a.idartlang IN ('" . implode("','", $this->_startArticles) . "') AND "; } @@ -89,7 +87,6 @@ class cArticleCollector implements SeekableIterator, Countable { $oArtLangColl->setWhere("cApiArticleLanguageCollection.idlang", $this->_aOptions['lang']); $oArtLangColl->query(); - echo $oArtLangColl->_lastSQL; if ($oArtLangColl->count() > 0) { $aTable = $oArtLangColl->fetchTable(); //echo $oArtLangColl->_lastSQL; @@ -97,7 +94,6 @@ class cArticleCollector implements SeekableIterator, Countable { foreach ($aTable as $aItem) { $this->_aArticles[] = $aItem['idartlang']; } - print_r($this->_aArticles); } } @@ -162,7 +158,7 @@ class cArticleCollector implements SeekableIterator, Countable { * * @return cApiArticleLanguage|int returns article language object or idartlang */ - public function current() { + public function current() :cApiArticleLanguage|int{ $iIdartlang = $this->_aArticles[$this->_iCurrentPosition]; if ($this->_bAsObject) { $oArticle = new cApiArticleLanguage($iIdartlang); diff --git a/conlite/classes/class.search.php b/conlite/classes/class.search.php index b2f6599..5d314b5 100644 --- a/conlite/classes/class.search.php +++ b/conlite/classes/class.search.php @@ -225,13 +225,13 @@ class Index extends SearchBaseAbstract { * * @var array */ - var $cms_type = array(); + protected static $_cms_type = []; /** * the suffix of all available cms types * @var array */ - var $cms_type_suffix = array(); + protected static $_cms_type_suffix = []; /** * Constructor, set object properties @@ -270,6 +270,8 @@ class Index extends SearchBaseAbstract { $this->idart = $idart; } + $this->_debug('Start Index for ', $this->idart); + $this->place = $place; $this->keycode = $aContent; $this->setStopwords($aStopwords); @@ -283,7 +285,14 @@ class Index extends SearchBaseAbstract { $old_keys = array_keys($this->keywords_old); $this->keywords_del = array_diff($old_keys, $new_keys); - + /* + echo '
';
+          print_r($new_keys);
+          print_r($old_keys);
+          print_r($this->keywords_del);
+          echo '
'; + * + */ if (count($this->keywords_del) > 0) { $this->deleteKeywords(); } @@ -312,7 +321,7 @@ class Index extends SearchBaseAbstract { foreach ($this->keycode as $idtype => $data) { if ($this->checkCmsType($idtype)) { foreach ($data as $typeid => $code) { - $this->_debug('code', $code); + $this->_debug('createKeywords: raw code from data array', $code); $code = stripslashes($code); // remove backslash $code = str_ireplace(array('
', '
'), "\n", $code); // replace HTML line breaks with newlines @@ -320,13 +329,18 @@ class Index extends SearchBaseAbstract { if (strlen($code) > 0) { $code = clHtmlEntityDecode($code); } - $this->_debug('code', $code); + $this->_debug('createKeywords: code after clean', $code); $tmp_keys = preg_split('/[\s,]+/', trim($code)); // split content by any number of commas or space characters - $this->_debug('tmp_keys', $tmp_keys); + $this->_debug('createKeywords: tmp_keys', $tmp_keys); foreach ($tmp_keys as $value) { $value = strtolower($value); // index terms are stored with lower case + $value = preg_replace('/[^\w]+/u', '', $value); + + if (empty(trim($value))) { + continue; + } if (!in_array($value, $this->stopwords)) { // eliminate stopwords @@ -335,6 +349,7 @@ class Index extends SearchBaseAbstract { if (strlen($value) > 1) { // do not index single characters $this->keywords[$value] = $this->keywords[$value] . $idtype . '-' . $typeid . ' '; + $this->_debug('createKeywords: entry array keywords', $this->keywords); } } } @@ -345,7 +360,7 @@ class Index extends SearchBaseAbstract { } } - $this->_debug('keywords', $this->keywords); + $this->_debug('createKeywords: keywords returned', $this->keywords); } /** @@ -357,9 +372,10 @@ class Index extends SearchBaseAbstract { $tmp_count = array(); foreach ($this->keywords as $keyword => $count) { + $bProceed = true; + $this->_debug('keyword', $keyword); $tmp_count = preg_split('/[\s]/', trim($count)); $this->_debug('tmp_count', $tmp_count); - $occurrence = count($tmp_count); $tmp_count = array_unique($tmp_count); $cms_types = implode(',', $tmp_count); @@ -376,8 +392,12 @@ class Index extends SearchBaseAbstract { ('" . Contenido_Security::escapeDB($keyword, $this->db) . "', '" . Contenido_Security::escapeDB($index_string, $this->db) . "', " . Contenido_Security::toInteger($this->lang) . ", " . Contenido_Security::toInteger($nextid) . ")"; } else { // if keyword allready exists, create new index_string - if (preg_match("/&$this->idart=/", $this->keywords_old[$keyword])) { - $index_string = preg_replace("/&$this->idart=[0-9]+\([\w-,]+\)/", $index_string, $this->keywords_old[$keyword]); + if (preg_match("/&" . $this->idart . "=/", $this->keywords_old[$keyword])) { + $index_string = preg_replace("/&" . $this->idart . "=[0-9]+\([,\w-]+\)/", $index_string, $this->keywords_old[$keyword]); + if ($index_string === $this->keywords_old[$keyword]) { + $bProceed = false; + $this->_debug('db update', 'no update needed'); + } } else { $index_string = $this->keywords_old[$keyword] . $index_string; } @@ -386,9 +406,11 @@ class Index extends SearchBaseAbstract { SET " . $this->place . " = '" . $index_string . "' WHERE idlang='" . Contenido_Security::toInteger($this->lang) . "' AND keyword='" . Contenido_Security::escapeDB($keyword, $this->db) . "'"; } - $this->_debug('sql', $sql); - $this->db->query($sql); + if ($bProceed) { + $this->_debug('sql', $sql); + $this->db->query($sql); + } } } @@ -431,7 +453,7 @@ class Index extends SearchBaseAbstract { idlang=" . Contenido_Security::toInteger($this->lang) . " AND (keyword IN ('" . $keys . "') OR " . $this->place . " REGEXP '&" . Contenido_Security::toInteger($this->idart) . "=')"; - $this->_debug('sql', $sql); + $this->_debug('getKeywords: sql', $sql); $this->db->query($sql); @@ -440,6 +462,8 @@ class Index extends SearchBaseAbstract { while ($this->db->next_record()) { $this->keywords_old[$this->db->f('keyword')] = $this->db->f($place); } + + $this->_debug('getKeywords: array keywords_old', $this->keywords_old); } /** @@ -448,6 +472,7 @@ class Index extends SearchBaseAbstract { * @return $key */ function removeSpecialChars($key) { + $aSpecialChars = array( "-", "_", "'", ".", "!", "\"", "#", "$", "%", "&", "(", ")", "*", "+", ",", "/", ":", ";", "<", "=", ">", "?", "@", "[", "\\", "]", "^", "`", "{", "|", "}", "~" @@ -461,6 +486,7 @@ class Index extends SearchBaseAbstract { // a client and should not be treated in this method. // modified 2007-10-01, H. Librenz - added as hotfix for encoding problems (doesn't find any words with // umlaut vowels in it since you turn on UTF-8 as language encoding) + $sEncoding = getEncodingByLanguage($this->db, $this->lang, $this->cfg); if (strtolower($sEncoding) != 'iso-8859-2') { @@ -486,6 +512,9 @@ class Index extends SearchBaseAbstract { $key = clHtmlEntityDecode($key); $key = str_replace($aSpecialChars, '', $key); + ini_set('mbstring.substitute_character', "none"); + $key = mb_convert_encoding($key, 'UTF-8', 'UTF-8'); + return $key; } @@ -516,6 +545,21 @@ class Index extends SearchBaseAbstract { return $key; } + /** + * + * @return array array with arrays of type and typesuffix + */ + public function getContentTypes(): array { + if (empty(self::$_cms_type)) { + $this->setContentTypes(); + } + + return array( + 'cms_type' => self::$_cms_type, + 'cms_type_suffix' => self::$_cms_type_suffix + ); + } + /** * set the array of stopwords which should not be indexed * @param array $aStopwords @@ -537,8 +581,8 @@ class Index extends SearchBaseAbstract { $this->_debug('sql', $sql); $this->db->query($sql); while ($this->db->next_record()) { - $this->cms_type[$this->db->f('type')] = $this->db->f('idtype'); - $this->cms_type_suffix[$this->db->f('idtype')] = substr($this->db->f('type'), 4, strlen($this->db->f('type'))); + self::$_cms_type[$this->db->f('type')] = $this->db->f('idtype'); + self::$_cms_type_suffix[$this->db->f('idtype')] = substr($this->db->f('type'), 4, strlen($this->db->f('type'))); } } @@ -554,11 +598,11 @@ class Index extends SearchBaseAbstract { if (strlen($opt) > 0) { if (!stristr($opt, 'cms_')) { - if (in_array($opt, $this->cms_type_suffix)) { + if (in_array($opt, $this->getContentTypes()['cms_type_suffix'])) { $this->cms_options[$opt] = 'CMS_' . $opt; } } else { - if (array_key_exists($opt, $this->cms_type)) { + if (array_key_exists($opt, $this->getContentTypes()['cms_type'])) { $this->cms_options[$opt] = $opt; } } @@ -788,8 +832,8 @@ class Search extends SearchBaseAbstract { $this->index = new Index($oDB); - $this->cms_type = $this->index->cms_type; - $this->cms_type_suffix = $this->index->cms_type_suffix; + $this->cms_type = $this->index->getContentTypes()['cms_type']; + $this->cms_type_suffix = $this->index->getContentTypes()['cms_type_suffix']; $this->search_option = (array_key_exists('db', $options)) ? strtolower($options['db']) : 'regexp'; $this->search_combination = (array_key_exists('combine', $options)) ? strtolower($options['combine']) : 'or'; @@ -1339,11 +1383,11 @@ class SearchResult extends SearchBaseAbstract { $cms_type = strtoupper($cms_type); if (strlen($cms_type) > 0) { if (!stristr($cms_type, 'cms_')) { - if (in_array($cms_type, $this->index->cms_type_suffix)) { + if (in_array($cms_type, $this->index->getContentTypes()['cms_type'])) { $cms_type = 'CMS_' . $cms_type; } } else { - if (!array_key_exists($cms_type, $this->index->cms_type)) { + if (!array_key_exists($cms_type, $this->index->getContentTypes()['cms_type_suffix'])) { return array(); } } diff --git a/conlite/classes/contenido/class.articlelanguage.php b/conlite/classes/contenido/class.articlelanguage.php index 3f12816..3327008 100644 --- a/conlite/classes/contenido/class.articlelanguage.php +++ b/conlite/classes/contenido/class.articlelanguage.php @@ -1,4 +1,5 @@ select($select); } } - + public function getIdArtLang($iIdart, $iIdlang) { $this->setWhere('idart', Contenido_Security::toInteger($iIdart)); $this->setWhere('idlang', Contenido_Security::toInteger($iIdlang)); - if($this->query() && $this->count() > 0) { + if ($this->query() && $this->count() > 0) { return $this->next()->get('idartlang'); } return false; } + } +class cApiArticleLanguage extends Item { -class cApiArticleLanguage extends Item -{ /** - * Constructor Function - * @param mixed $mId Specifies the ID of item to load + * + * @global type $cfg + * @param type $mId */ - public function __construct($mId = false) - { + public function __construct($mId = false) { global $cfg; parent::__construct($cfg["tab"]["art_lang"], "idartlang"); $this->setFilters(array(), array()); @@ -63,24 +62,23 @@ class cApiArticleLanguage extends Item $this->loadByPrimaryKey($mId); } } - + public function loadByArticleAndLanguageId($idart, $idlang) { $result = true; - if (!$this->isLoaded()) { + if (!$this->isLoaded()) { $idartlang = $this->_getIdArtLang($idart, $idlang); $result = $this->loadByPrimaryKey($idartlang); } return $result; } - - + protected function _getIdArtLang($idart, $idlang) { $sql = sprintf('SELECT idartlang FROM `%s` WHERE idart = %d AND idlang = %d', cRegistry::getConfigValue('tab', 'art_lang'), $idart, $idlang); $this->db->query($sql); $this->db->next_record(); return $this->db->f('idartlang'); } - + public function getContent($type = '', $id = NULL) { if (NULL === $this->content) { $this->_loadArticleContent(); @@ -108,16 +106,16 @@ class cApiArticleLanguage extends Item // return String return (isset($this->content[$type][$id])) ? $this->content[$type][$id] : ''; } - + protected function _loadArticleContent() { if (NULL !== $this->content) { return; } - $sql = "SELECT b.type, a.typeid, a.value FROM `".cRegistry::getConfigValue('tab', 'content') - ."` AS a, `".cRegistry::getConfigValue('tab', 'type') - ."` AS b WHERE a.idartlang = ".$this->get('idartlang') - ." AND b.idtype = a.idtype ORDER BY a.idtype, a.typeid"; + $sql = "SELECT b.type, a.typeid, a.value FROM `" . cRegistry::getConfigValue('tab', 'content') + . "` AS a, `" . cRegistry::getConfigValue('tab', 'type') + . "` AS b WHERE a.idartlang = " . $this->get('idartlang') + . " AND b.idtype = a.idtype ORDER BY a.idtype, a.typeid"; $this->db->query($sql); @@ -126,5 +124,7 @@ class cApiArticleLanguage extends Item $this->content[strtolower($this->db->f('type'))][$this->db->f('typeid')] = urldecode($this->db->f('value')); } } + } + ?> \ No newline at end of file diff --git a/conlite/includes/functions.con2.php b/conlite/includes/functions.con2.php index b424656..51cf99d 100644 --- a/conlite/includes/functions.con2.php +++ b/conlite/includes/functions.con2.php @@ -619,48 +619,30 @@ function conSetMetaValue($idartlang, $idmetatype, $value) { } /** - * (re)generate keywords for all articles of a given client (with specified language) - * @param $client Client - * @param $lang Language of a client - * @return void - * - * @author Willi Man - * Created : 12.05.2004 - * Modified : 13.05.2004 - * @copyright four for business AG 2003 + * + * @param int $client + * @param int $lang */ -function conGenerateKeywords($client, $lang) { - global $cfg; - $db_art = new DB_ConLite; +function conGenerateKeywords(int $client = null, int $lang = null) { + $aOptions = []; + $aOptions['start'] = true; + $aOptions['offline'] = true; + $aOptions['client'] = $client ?? 0; + $aOptions['lang'] = $lang ?? 0; - $options = array("img", "link", "linktarget", "swf"); // cms types to be excluded from indexing - - $sql = "SELECT - a.idart, b.idartlang - FROM - " . $cfg["tab"]["art"] . " AS a, - " . $cfg["tab"]["art_lang"] . " AS b - WHERE - a.idart = b.idart AND - a.idclient = " . Contenido_Security::escapeDB($client, $db) . " AND - b.idlang = " . Contenido_Security::escapeDB($lang, $db); - - $db_art->query($sql); - - $articles = array(); - while ($db_art->next_record()) { - $articles[$db_art->f("idart")] = $db_art->f("idartlang"); - } - - if (count($articles) > 0) { - foreach ($articles as $artid => $article_lang) { - $article_content = array(); - $article_content = conGetContentFromArticle($article_lang); - - if (count($article_content) > 0) { - $art_index = new Index($db_art); - $art_index->lang = $lang; - $art_index->start($artid, $article_content, 'auto', $options); + $oArticleCollector = new cArticleCollector(); + $oArticleCollector->setOptions($aOptions); + $oArticleCollector->loadArticles(); + /* @var $oArticle cApiArticleLanguage */ + if ($oArticleCollector->count() > 0) { + foreach ($oArticleCollector as $oArticle) { + $aArticleContent = []; + $aArticleContent = $oArticle->getContent(); + if(!empty($aArticleContent)) { + /* @var $oIndex Index */ + $oIndex = new Index(); + //$oIndex->setDebug(true); + $oIndex->start($oArticle->get('idart'), $aArticleContent, 'auto', array("img", "link", "linktarget", "swf")); } } } diff --git a/conlite/includes/functions.general.php b/conlite/includes/functions.general.php index 8c190c5..f4cb963 100644 --- a/conlite/includes/functions.general.php +++ b/conlite/includes/functions.general.php @@ -2215,7 +2215,6 @@ function clHtmlEntityDecode(string $value, ?int $flags = ENT_QUOTES | ENT_SUBSTI * @return string Returns the converted string */ function clHtmlEntities(string $value,?int $flags = ENT_QUOTES | ENT_SUBSTITUTE | ENT_HTML401, string $encoding = 'UTF-8') { - var_dump($flags); return htmlentities($value, $flags, $encoding); } From 7c69afa32641fe5e25f6e95f36245b3958e8d72b Mon Sep 17 00:00:00 2001 From: "o.pinke" Date: Wed, 22 Feb 2023 20:10:59 +0100 Subject: [PATCH 26/37] temporary fix for inuse message if a module is used for body tag in layout --- conlite/classes/class.inuse.php | 2 +- .../external/backendedit/front_content.php | 25 +++++++++++-------- 2 files changed, 15 insertions(+), 12 deletions(-) diff --git a/conlite/classes/class.inuse.php b/conlite/classes/class.inuse.php index d217cb7..d995f5a 100644 --- a/conlite/classes/class.inuse.php +++ b/conlite/classes/class.inuse.php @@ -255,7 +255,7 @@ class InUseCollection extends ItemCollection } if (!is_object($notification)) { - $notification = new Contenido_Notification; + $notification = new Contenido_Notification(); } $noti = $notification->messageBox("warning", $message.$override, 0); diff --git a/conlite/external/backendedit/front_content.php b/conlite/external/backendedit/front_content.php index aa37f37..848cd38 100644 --- a/conlite/external/backendedit/front_content.php +++ b/conlite/external/backendedit/front_content.php @@ -92,7 +92,7 @@ if ($cfg["use_pseudocron"] == true) { * PHPLIB application development toolkit * @see http://sourceforge.net/projects/phplib */ -if (!empty($contenido)) { +if (isset($contenido)) { //Backend page_open(array('sess' => 'Contenido_Session', 'auth' => 'Contenido_Challenge_Crypt_Auth', 'perm' => 'Contenido_Perm')); i18nInit($cfg["path"]["contenido"] . $cfg["path"]["locale"], $belang); @@ -130,9 +130,6 @@ if (isset($_GET['action']) && $_GET['action'] == 'get_compressed') { exit(); } -// Call hook after plugins are loaded, added by Murat Purc, 2008-09-07 -CEC_Hook::execute('Contenido.Frontend.AfterLoadPlugins'); - if (!isset($encoding) || !is_array($encoding) || count($encoding) == 0) { // get encodings of all languages $encoding = array(); @@ -241,7 +238,7 @@ $errsite = 'Location: ' . Contenido_Url::getInstance()->buildRedirect($aParams); * Note: These variables can be set via http globals e.g. front_content.php?idcat=41&idart=34&idcatart=35&idartlang=42 * If not the values will be computed. */ -if ($idart && !$idcat && !$idcatart) { +if (!empty($idart) && empty($idcat) && empty($idcatart)) { /* Try to fetch the first idcat */ $sql = "SELECT idcat FROM " . $cfg["tab"]["cat_art"] . " WHERE idart = '" . Contenido_Security::toInteger($idart) . "'"; $db->query($sql); @@ -410,7 +407,7 @@ if ($cfg["cache"]["disable"] != '1') { * The reason is to avoid cross-site scripting errors in the backend, if the backend domain differs from * the frontend domain. */ -if ($contenido) { +if (isset($contenido)) { $perm->load_permissions(); /* Change mode edit / view */ @@ -533,7 +530,7 @@ if (empty($inUse) && (isset($allow) && $allow == true) && $view == "edit" && ($p ############################################## /* Mark submenuitem 'Preview' in the Contenido Backend (Area: Contenido --> Articles --> Preview) */ - if ($contenido) { + if (isset($contenido)) { $markscript = markSubMenuItem(4, true); } @@ -610,9 +607,11 @@ if (empty($inUse) && (isset($allow) && $allow == true) && $view == "edit" && ($p /* If article is in use, display notification */ if (!empty($sHtmlInUseCss) && !empty($sHtmlInUseMessage)) { $code = preg_replace("/<\/head>/i", "$sHtmlInUseCss\n", $code, 1); - $code = preg_replace("/(]*)>/i", "\${1}> \n $sHtmlInUseMessage", $code, 1); + if(!preg_match("/(]*)>.*/i", $code)) { + $code = preg_replace("/(]*)>/i", "\${1}> \n $sHtmlInUseMessage", $code, 1); + $bInUseSet = true; + } } - /* Check if category is public */ $sql = "SELECT public FROM " . $cfg["tab"]["cat_lang"] . " WHERE idcat='" . Contenido_Security::toInteger($idcat) . "' AND idlang='" . Contenido_Security::toInteger($lang) . "'"; @@ -651,7 +650,7 @@ if (empty($inUse) && (isset($allow) && $allow == true) && $view == "edit" && ($p WHERE B.name = 'front_allow' AND C.name = 'str' AND A.user_id = '" . Contenido_Security::escapeDB($user_id, $db2) . "' AND A.idcat = '" . Contenido_Security::toInteger($idcat) . "' AND A.idarea = C.idarea AND B.idaction = A.idaction"; - $db2 = new DB_ConLite; + $db2 = new DB_ConLite(); $db2->query($sql); if ($db2->num_rows() > 0) { @@ -795,12 +794,16 @@ if (empty($inUse) && (isset($allow) && $allow == true) && $view == "edit" && ($p if (in_array(Contenido_Security::toInteger($idart), $aExclude)) { eval("?>\n" . $code . "\n\n" . $code . "\n]*)>/i", "\${1}> \n $sHtmlInUseMessage", $htmlCode, 1); + } // process CEC to do some preparations before output $htmlCode = CEC_Hook::executeAndReturn('Contenido.Frontend.HTMLCodeOutput', $htmlCode); From dfcc1746265b2ce3ecbcb6e84c89e72c806312d9 Mon Sep 17 00:00:00 2001 From: "o.pinke" Date: Thu, 23 Feb 2023 12:53:23 +0100 Subject: [PATCH 27/37] fix get_file with PHP 8 --- conlite/classes/class.update.notifier.php | 57 ++++++++++++++++------- 1 file changed, 40 insertions(+), 17 deletions(-) diff --git a/conlite/classes/class.update.notifier.php b/conlite/classes/class.update.notifier.php index 7a74a31..75e2b1f 100644 --- a/conlite/classes/class.update.notifier.php +++ b/conlite/classes/class.update.notifier.php @@ -508,23 +508,47 @@ class Contenido_UpdateNotifier { $response = false; if ($this->_bUseCurl) { - if ($bCheckCon) { - $ch = $this->_checkCon2Host($sHost); - } else { - $ch = curl_init("http://" . $sHost); - } - if (is_resource($ch)) { - curl_setopt($ch, CURLOPT_URL, "http://" . $sHost . $sFile); + $sUrl = "https://" . $sHost . $sFile; + $ch = $this->_checkCon2Host($sUrl); + + if ($ch !== false) { curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); - curl_setopt($ch, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_0); - curl_setopt($ch, CURLOPT_HTTPHEADER, array('Connection: close')); - curl_setopt($ch, CURLOPT_TIMEOUT, 2); + curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false); + curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); $response = curl_exec($ch); + + //Check for errors. + if (curl_errno($ch)) { + throw new Exception(curl_error($ch)); + } curl_close($ch); } + /* + if ($bCheckCon) { + $ch = $this->_checkCon2Host($sHost); + } else { + $ch = curl_init("https://" . $sHost); + } + if (is_resource($ch)) { + curl_setopt($ch, CURLOPT_URL, "https://" . $sHost . $sFile); + curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); + curl_setopt($ch, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_0); + curl_setopt($ch, CURLOPT_HTTPHEADER, array('Connection: close')); + curl_setopt($ch, CURLOPT_TIMEOUT, 2); + $response = curl_exec($ch); + curl_close($ch); + } */ } else { - $source = file_get_contents("http://" . $sHost . $sFile); - if ($source !== false AND ! empty($source)) { + $arrContextOptions = array( + "ssl" => array( + "verify_peer" => false, + "verify_peer_name" => false, + ) + ); + + $source = file_get_contents("https://" . $sHost . $sFile, false, stream_context_create($arrContextOptions)); + + if ($source !== false AND !empty($source)) { $response = $source; } } @@ -539,13 +563,12 @@ class Contenido_UpdateNotifier { * @param string $sHost * @return obj|boolean curl object or false */ - protected function _checkCon2Host($sHost) { - $ch = curl_init("http://" . $sHost); - if (!is_resource($ch)) { + protected function _checkCon2Host($sUrl) { + $ch = curl_init($sUrl); + if ($ch === false) { $sErrorMessage = i18n('Unable to check for updates!') . " " . sprintf(i18n('Connection to %s failed!'), $sHost); $this->sErrorOutput = $this->renderOutput($sErrorMessage); - return false; } return $ch; } @@ -700,7 +723,7 @@ class Contenido_UpdateNotifier { if (strlen($sText) > 150) { $sText = capiStrTrimAfterWord($sText, 150) . '...'; } - //echo $aItem->title; + //echo $aItem->title; $oTpl->set("d", "NEWS_DATE", $aItem->pubDate); $oTpl->set("d", "NEWS_TITLE", utf8_decode($aItem->title)); $oTpl->set("d", "NEWS_TEXT", $sText); From 85d3f956e81f8b125d491c7acf61d056de584297 Mon Sep 17 00:00:00 2001 From: "o.pinke" Date: Thu, 2 Mar 2023 19:45:37 +0100 Subject: [PATCH 28/37] fix PHP8 errors --- conlib/perm.inc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/conlib/perm.inc b/conlib/perm.inc index 9c41d13..50719b3 100644 --- a/conlib/perm.inc +++ b/conlib/perm.inc @@ -232,8 +232,8 @@ class Contenido_Perm { return true; } elseif ($item_rights[$area] != "noright") { - $groupsForUser = $this->getGroupsForUser($auth->auth[uid]); - $groupsForUser[] = $auth->auth[uid]; + $groupsForUser = $this->getGroupsForUser($auth->auth['uid']); + $groupsForUser[] = $auth->auth['uid']; $tmp_userstring = implode("','", $groupsForUser); @@ -596,8 +596,8 @@ class Contenido_Perm { } } elseif ($item_rights[$value] != "noright") { - $groupsForUser = $this->getGroupsForUser($auth->auth[uid]); - $groupsForUser[] = $auth->auth[uid]; + $groupsForUser = $this->getGroupsForUser($auth->auth['uid']); + $groupsForUser[] = $auth->auth['uid']; //else search for rights for this user in this area $sql = "SELECT From 606f48500f97368dd93e037002c07decd842a6f5 Mon Sep 17 00:00:00 2001 From: "o.pinke" Date: Fri, 3 Mar 2023 08:52:50 +0100 Subject: [PATCH 29/37] fix PHP8 errors --- conlite/backend_search.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/conlite/backend_search.php b/conlite/backend_search.php index aeb740a..e63390f 100644 --- a/conlite/backend_search.php +++ b/conlite/backend_search.php @@ -555,8 +555,8 @@ if (empty($where) || $iAffectedRows <= 0) { #Check rights per cat if (!$check_rights) { //hotfix timo trautmann 2008-12-10 also check rights in associated groups - $aGroupsForUser = $perm->getGroupsForUser($auth->auth[uid]); - $aGroupsForUser[] = $auth->auth[uid]; + $aGroupsForUser = $perm->getGroupsForUser($auth->auth['uid']); + $aGroupsForUser[] = $auth->auth['uid']; $sTmpUserString = implode("','", $aGroupsForUser); #Check if any rights are applied to current user or his groups From fc6ea7746d5ea7d5729840bd50981f0ab8620ca2 Mon Sep 17 00:00:00 2001 From: "o.pinke" Date: Fri, 3 Mar 2023 09:02:11 +0100 Subject: [PATCH 30/37] handle empty or nulled content --- conlite/external/wysiwyg/tinymce3/editor.php | 94 ++++++++++---------- 1 file changed, 45 insertions(+), 49 deletions(-) diff --git a/conlite/external/wysiwyg/tinymce3/editor.php b/conlite/external/wysiwyg/tinymce3/editor.php index 439d6af..fe9c803 100644 --- a/conlite/external/wysiwyg/tinymce3/editor.php +++ b/conlite/external/wysiwyg/tinymce3/editor.php @@ -1,4 +1,5 @@ setSetting("height", $editor_height, true); +if ($editor_height !== false) { + $cTinyMCEEditor->setSetting("height", $editor_height, true); } /* -TODO: + TODO: --> see editor_template.js --> create own theme template engine --> maybe change the way icons are displayed -*/ + -> see editor_template.js + -> create own theme template engine + -> maybe change the way icons are displayed + */ $currentuser = new User; $currentuser->loadUserByUserID($auth->auth["uid"]); -if ($currentuser->getField("wysi") == 1) -{ - echo $cTinyMCEEditor->getScripts(); - echo $cTinyMCEEditor->getEditor(); +if ($currentuser->getField("wysi") == 1) { + echo $cTinyMCEEditor->getScripts(); + echo $cTinyMCEEditor->getEditor(); } else { - $oTextarea = new cHTMLTextarea($editor_name, $editor_content); - $oTextarea->setId($editor_name); - - $bgColor = getEffectiveSetting("wysiwyg", "tinymce-backgroundcolor", "white"); - $editor_width = getEffectiveSetting("wysiwyg", "tinymce-width", "600"); - $editor_height = getEffectiveSetting("wysiwyg", "tinymce-height", "480"); - - $oTextarea->setStyle("width: ".$editor_width."px; height: ".$editor_height."px; background-color: ".$bgColor.";"); + $oTextarea = new cHTMLTextarea($editor_name, $editor_content); + $oTextarea->setId($editor_name); - echo $oTextarea->render(); + $bgColor = getEffectiveSetting("wysiwyg", "tinymce-backgroundcolor", "white"); + $editor_width = getEffectiveSetting("wysiwyg", "tinymce-width", "600"); + $editor_height = getEffectiveSetting("wysiwyg", "tinymce-height", "480"); + + $oTextarea->setStyle("width: " . $editor_width . "px; height: " . $editor_height . "px; background-color: " . $bgColor . ";"); + + echo $oTextarea->render(); } ?> \ No newline at end of file From 7ecf03870a52b196e4596b753bf3da46e857a4bc Mon Sep 17 00:00:00 2001 From: "o.pinke" Date: Fri, 3 Mar 2023 10:37:53 +0100 Subject: [PATCH 31/37] fixed js error --- conlite/includes/include.con_edit_form.php | 8 ++++---- conlite/templates/standard/template.con_edit_form.html | 5 ++--- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/conlite/includes/include.con_edit_form.php b/conlite/includes/include.con_edit_form.php index 13fb349..e9fdc07 100644 --- a/conlite/includes/include.con_edit_form.php +++ b/conlite/includes/include.con_edit_form.php @@ -103,7 +103,7 @@ if ($action == "con_newart" && $newart != true) { $idtplinput = $db->f("idtplinput"); - if ($tmp_modifiedby == "") { + if (empty($tmp_modifiedby)) { $tmp_modifiedby = $tmp_author; } @@ -142,7 +142,7 @@ if ($action == "con_newart" && $newart != true) { $tmp_idartlang = 0; $tmp_idlang = $lang; - $tmp_page_title = stripslashes($db->f("pagetitle")); + $tmp_page_title = (empty($db->f("pagetitle")))?'':stripslashes($db->f("pagetitle")); $tmp_title = ""; $tmp_urlname = ""; // plugin Advanced Mod Rewrite - edit by stese $tmp_artspec = ""; @@ -152,6 +152,7 @@ if ($action == "con_newart" && $newart != true) { $tmp_published = date("Y-m-d H:i:s"); $tmp_publishedby = ""; $tmp_author = ""; + $tmp_modifiedby = ""; $tmp_online = "0"; $tmp_datestart = "0000-00-00 00:00:00"; $tmp_dateend = "0000-00-00 00:00:00"; @@ -713,5 +714,4 @@ if ($action == "con_newart" && $newart != true) { to see this form */ $notification->displayNotification("error", i18n("Permission denied")); } -} -?> +} \ No newline at end of file diff --git a/conlite/templates/standard/template.con_edit_form.html b/conlite/templates/standard/template.con_edit_form.html index 0076951..6155f23 100644 --- a/conlite/templates/standard/template.con_edit_form.html +++ b/conlite/templates/standard/template.con_edit_form.html @@ -1,3 +1,4 @@ + @@ -220,9 +221,7 @@ parent.parent.frames["right"].frames["right_top"].sub.clicked(menuItem.firstChild); } - { - DATAPUSH - } + {DATAPUSH} From 625c6ab405fe1f9d435e0812edd36c25b74c0b69 Mon Sep 17 00:00:00 2001 From: "o.pinke" Date: Fri, 3 Mar 2023 11:07:06 +0100 Subject: [PATCH 32/37] fixed wrong date expression for published --- conlite/includes/include.con_art_overview.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/conlite/includes/include.con_art_overview.php b/conlite/includes/include.con_art_overview.php index 1a0f806..7e02e43 100644 --- a/conlite/includes/include.con_art_overview.php +++ b/conlite/includes/include.con_art_overview.php @@ -305,8 +305,7 @@ if (is_numeric($idcat) && ($idcat >= 0)) { $sortkey = $sart["artsort"]; $locked = $sart["locked"]; $redirect = $sart["redirect"]; - - $published = ($published != '1000-01-01 00:00:00') ? date($dateformat, strtotime($published)) : i18n("not yet published"); + $published = (strtotime($published) > 0) ? date($dateformat, strtotime($published)) : i18n("not yet published"); $created = date($dateformat, strtotime($created)); $modified = date($dateformat, strtotime($modified)); $alttitle = "idart" . ': ' . $idart . ' ' . "idcatart" . ': ' . $idcatart . ' ' . "idartlang" . ': ' . $idartlang; From 903dbf8d4259ea49cb536f4b5a6110f517b4cf21 Mon Sep 17 00:00:00 2001 From: Ortwin Pinke Date: Fri, 7 Apr 2023 18:14:09 +0200 Subject: [PATCH 33/37] composer updates, add .idea folder --- .idea/.gitignore | 8 + .idea/ConLite.iml | 8 + .idea/modules.xml | 8 + .idea/vcs.xml | 7 + cms/securimage | 1 - composer.json | 3 +- composer.lock | 205 +- conlite/external/autoload.php | 17 +- .../external/composer/autoload_classmap.php | 8 - conlite/external/composer/autoload_psr4.php | 3 +- conlite/external/composer/autoload_static.php | 24 +- conlite/external/composer/installed.json | 213 +- conlite/external/composer/installed.php | 43 +- conlite/external/composer/platform_check.php | 4 +- conlite/external/endroid/qr-code/LICENSE | 19 - .../external/endroid/qr-code/composer.json | 45 - .../external/endroid/qr-code/src/QrCode.php | 1591 ----- .../external/phpmailer/phpmailer/COMMITMENT | 46 + .../phpmailer/phpmailer/PHPMailerAutoload.php | 49 - .../external/phpmailer/phpmailer/README.md | 230 + .../external/phpmailer/phpmailer/SECURITY.md | 37 + conlite/external/phpmailer/phpmailer/VERSION | 2 +- .../phpmailer/phpmailer/class.phpmailer.php | 4064 ------------- .../phpmailer/class.phpmaileroauth.php | 197 - .../phpmailer/class.phpmaileroauthgoogle.php | 77 - .../phpmailer/phpmailer/class.pop3.php | 407 -- .../phpmailer/phpmailer/composer.json | 77 +- .../phpmailer/phpmailer/composer.lock | 3593 ------------ .../phpmailer/phpmailer/examples/DKIM.phps | 38 - .../phpmailer/examples/code_generator.phps | 604 -- .../phpmailer/examples/contactform.phps | 71 - .../phpmailer/examples/contents.html | 17 - .../phpmailer/examples/contentsutf8.html | 21 - .../phpmailer/examples/exceptions.phps | 35 - .../phpmailer/phpmailer/examples/gmail.phps | 99 - .../phpmailer/examples/gmail_xoauth.phps | 85 - .../phpmailer/examples/images/phpmailer.png | Bin 5831 -> 0 bytes .../examples/images/phpmailer_mini.png | Bin 1842 -> 0 bytes .../phpmailer/phpmailer/examples/index.html | 48 - .../phpmailer/phpmailer/examples/mail.phps | 31 - .../phpmailer/examples/mailing_list.phps | 59 - .../phpmailer/examples/pop_before_smtp.phps | 54 - .../phpmailer/examples/scripts/XRegExp.js | 664 --- .../examples/scripts/shAutoloader.js | 122 - .../phpmailer/examples/scripts/shBrushPhp.js | 72 - .../phpmailer/examples/scripts/shCore.js | 1 - .../phpmailer/examples/scripts/shLegacy.js | 140 - .../phpmailer/examples/send_file_upload.phps | 49 - .../examples/send_multiple_file_upload.phps | 51 - .../phpmailer/examples/sendmail.phps | 33 - .../phpmailer/examples/signed-mail.phps | 89 - .../phpmailer/phpmailer/examples/smtp.phps | 54 - .../phpmailer/examples/smtp_check.phps | 55 - .../phpmailer/examples/smtp_no_auth.phps | 50 - .../phpmailer/examples/ssl_options.phps | 74 - .../phpmailer/examples/styles/shCore.css | 46 - .../examples/styles/shCoreDefault.css | 77 - .../examples/styles/shCoreDjango.css | 78 - .../examples/styles/shCoreEclipse.css | 80 - .../phpmailer/examples/styles/shCoreEmacs.css | 76 - .../examples/styles/shCoreFadeToGrey.css | 77 - .../examples/styles/shCoreMDUltra.css | 76 - .../examples/styles/shCoreMidnight.css | 76 - .../phpmailer/examples/styles/shCoreRDark.css | 76 - .../examples/styles/shThemeAppleScript.css | 21 - .../examples/styles/shThemeDefault.css | 31 - .../examples/styles/shThemeDjango.css | 32 - .../examples/styles/shThemeEclipse.css | 34 - .../examples/styles/shThemeEmacs.css | 30 - .../examples/styles/shThemeFadeToGrey.css | 31 - .../examples/styles/shThemeMDUltra.css | 30 - .../examples/styles/shThemeMidnight.css | 30 - .../examples/styles/shThemeRDark.css | 30 - .../examples/styles/shThemeVisualStudio.css | 31 - .../phpmailer/examples/styles/wrapping.png | Bin 631 -> 0 bytes .../phpmailer/extras/EasyPeasyICS.php | 148 - .../phpmailer/phpmailer/extras/README.md | 17 - .../phpmailer/phpmailer/extras/htmlfilter.php | 1159 ---- .../phpmailer/extras/ntlm_sasl_client.php | 185 - .../phpmailer/phpmailer/get_oauth_token.php | 290 +- .../phpmailer/language/phpmailer.lang-af.php | 26 + .../phpmailer/language/phpmailer.lang-ar.php | 6 +- .../phpmailer/language/phpmailer.lang-az.php | 1 + .../phpmailer/language/phpmailer.lang-ba.php | 5 +- .../phpmailer/language/phpmailer.lang-be.php | 1 + .../phpmailer/language/phpmailer.lang-bg.php | 1 + .../phpmailer/language/phpmailer.lang-ca.php | 1 + .../phpmailer/language/phpmailer.lang-ch.php | 26 - .../phpmailer/language/phpmailer.lang-cs.php | 3 + .../phpmailer/language/phpmailer.lang-da.php | 41 +- .../phpmailer/language/phpmailer.lang-de.php | 3 + .../phpmailer/language/phpmailer.lang-el.php | 42 +- .../phpmailer/language/phpmailer.lang-eo.php | 3 +- .../phpmailer/language/phpmailer.lang-es.php | 7 +- .../phpmailer/language/phpmailer.lang-et.php | 1 + .../phpmailer/language/phpmailer.lang-fa.php | 3 +- .../phpmailer/language/phpmailer.lang-fi.php | 1 + .../phpmailer/language/phpmailer.lang-fo.php | 1 + .../phpmailer/language/phpmailer.lang-fr.php | 29 +- .../phpmailer/language/phpmailer.lang-gl.php | 1 + .../phpmailer/language/phpmailer.lang-he.php | 1 + .../phpmailer/language/phpmailer.lang-hi.php | 35 + .../phpmailer/language/phpmailer.lang-hr.php | 1 + .../phpmailer/language/phpmailer.lang-hu.php | 3 +- ...iler.lang-am.php => phpmailer.lang-hy.php} | 3 +- .../phpmailer/language/phpmailer.lang-id.php | 35 +- .../phpmailer/language/phpmailer.lang-it.php | 3 +- .../phpmailer/language/phpmailer.lang-ja.php | 16 +- .../phpmailer/language/phpmailer.lang-ka.php | 1 + .../phpmailer/language/phpmailer.lang-ko.php | 1 + .../phpmailer/language/phpmailer.lang-lt.php | 1 + .../phpmailer/language/phpmailer.lang-lv.php | 1 + .../phpmailer/language/phpmailer.lang-mg.php | 27 + .../phpmailer/language/phpmailer.lang-mn.php | 27 + .../phpmailer/language/phpmailer.lang-ms.php | 3 +- .../phpmailer/language/phpmailer.lang-nb.php | 3 +- .../phpmailer/language/phpmailer.lang-nl.php | 12 +- .../phpmailer/language/phpmailer.lang-pl.php | 14 +- .../phpmailer/language/phpmailer.lang-pt.php | 1 + .../language/phpmailer.lang-pt_br.php | 11 +- .../phpmailer/language/phpmailer.lang-ro.php | 11 +- .../phpmailer/language/phpmailer.lang-ru.php | 17 +- .../phpmailer/language/phpmailer.lang-sk.php | 6 +- .../phpmailer/language/phpmailer.lang-sl.php | 16 +- ...iler.lang-rs.php => phpmailer.lang-sr.php} | 14 +- .../language/phpmailer.lang-sr_latn.php | 28 + .../phpmailer/language/phpmailer.lang-sv.php | 5 +- .../phpmailer/language/phpmailer.lang-tl.php | 28 + .../phpmailer/language/phpmailer.lang-tr.php | 1 + .../phpmailer/language/phpmailer.lang-uk.php | 23 +- .../phpmailer/language/phpmailer.lang-vi.php | 1 + .../phpmailer/language/phpmailer.lang-zh.php | 1 + .../language/phpmailer.lang-zh_cn.php | 1 + .../phpmailer/src/DSNConfigurator.php | 247 + .../phpmailer/phpmailer/src/Exception.php | 40 + .../phpmailer/phpmailer/src/OAuth.php | 139 + .../phpmailer/src/OAuthTokenProvider.php | 44 + .../phpmailer/phpmailer/src/PHPMailer.php | 5126 +++++++++++++++++ .../external/phpmailer/phpmailer/src/POP3.php | 467 ++ .../{class.smtp.php => src/SMTP.php} | 974 ++-- conlite/plugins/cl-content-allocation | 1 - conlite/plugins/cl-mod-rewrite | 1 - conlite/plugins/cl-newsletter | 1 - 143 files changed, 7677 insertions(+), 16279 deletions(-) create mode 100644 .idea/.gitignore create mode 100644 .idea/ConLite.iml create mode 100644 .idea/modules.xml create mode 100644 .idea/vcs.xml delete mode 160000 cms/securimage delete mode 100644 conlite/external/endroid/qr-code/LICENSE delete mode 100644 conlite/external/endroid/qr-code/composer.json delete mode 100644 conlite/external/endroid/qr-code/src/QrCode.php create mode 100644 conlite/external/phpmailer/phpmailer/COMMITMENT delete mode 100644 conlite/external/phpmailer/phpmailer/PHPMailerAutoload.php create mode 100644 conlite/external/phpmailer/phpmailer/README.md create mode 100644 conlite/external/phpmailer/phpmailer/SECURITY.md delete mode 100644 conlite/external/phpmailer/phpmailer/class.phpmailer.php delete mode 100644 conlite/external/phpmailer/phpmailer/class.phpmaileroauth.php delete mode 100644 conlite/external/phpmailer/phpmailer/class.phpmaileroauthgoogle.php delete mode 100644 conlite/external/phpmailer/phpmailer/class.pop3.php delete mode 100644 conlite/external/phpmailer/phpmailer/composer.lock delete mode 100644 conlite/external/phpmailer/phpmailer/examples/DKIM.phps delete mode 100644 conlite/external/phpmailer/phpmailer/examples/code_generator.phps delete mode 100644 conlite/external/phpmailer/phpmailer/examples/contactform.phps delete mode 100644 conlite/external/phpmailer/phpmailer/examples/contents.html delete mode 100644 conlite/external/phpmailer/phpmailer/examples/contentsutf8.html delete mode 100644 conlite/external/phpmailer/phpmailer/examples/exceptions.phps delete mode 100644 conlite/external/phpmailer/phpmailer/examples/gmail.phps delete mode 100644 conlite/external/phpmailer/phpmailer/examples/gmail_xoauth.phps delete mode 100644 conlite/external/phpmailer/phpmailer/examples/images/phpmailer.png delete mode 100644 conlite/external/phpmailer/phpmailer/examples/images/phpmailer_mini.png delete mode 100644 conlite/external/phpmailer/phpmailer/examples/index.html delete mode 100644 conlite/external/phpmailer/phpmailer/examples/mail.phps delete mode 100644 conlite/external/phpmailer/phpmailer/examples/mailing_list.phps delete mode 100644 conlite/external/phpmailer/phpmailer/examples/pop_before_smtp.phps delete mode 100644 conlite/external/phpmailer/phpmailer/examples/scripts/XRegExp.js delete mode 100644 conlite/external/phpmailer/phpmailer/examples/scripts/shAutoloader.js delete mode 100644 conlite/external/phpmailer/phpmailer/examples/scripts/shBrushPhp.js delete mode 100644 conlite/external/phpmailer/phpmailer/examples/scripts/shCore.js delete mode 100644 conlite/external/phpmailer/phpmailer/examples/scripts/shLegacy.js delete mode 100644 conlite/external/phpmailer/phpmailer/examples/send_file_upload.phps delete mode 100644 conlite/external/phpmailer/phpmailer/examples/send_multiple_file_upload.phps delete mode 100644 conlite/external/phpmailer/phpmailer/examples/sendmail.phps delete mode 100644 conlite/external/phpmailer/phpmailer/examples/signed-mail.phps delete mode 100644 conlite/external/phpmailer/phpmailer/examples/smtp.phps delete mode 100644 conlite/external/phpmailer/phpmailer/examples/smtp_check.phps delete mode 100644 conlite/external/phpmailer/phpmailer/examples/smtp_no_auth.phps delete mode 100644 conlite/external/phpmailer/phpmailer/examples/ssl_options.phps delete mode 100644 conlite/external/phpmailer/phpmailer/examples/styles/shCore.css delete mode 100644 conlite/external/phpmailer/phpmailer/examples/styles/shCoreDefault.css delete mode 100644 conlite/external/phpmailer/phpmailer/examples/styles/shCoreDjango.css delete mode 100644 conlite/external/phpmailer/phpmailer/examples/styles/shCoreEclipse.css delete mode 100644 conlite/external/phpmailer/phpmailer/examples/styles/shCoreEmacs.css delete mode 100644 conlite/external/phpmailer/phpmailer/examples/styles/shCoreFadeToGrey.css delete mode 100644 conlite/external/phpmailer/phpmailer/examples/styles/shCoreMDUltra.css delete mode 100644 conlite/external/phpmailer/phpmailer/examples/styles/shCoreMidnight.css delete mode 100644 conlite/external/phpmailer/phpmailer/examples/styles/shCoreRDark.css delete mode 100644 conlite/external/phpmailer/phpmailer/examples/styles/shThemeAppleScript.css delete mode 100644 conlite/external/phpmailer/phpmailer/examples/styles/shThemeDefault.css delete mode 100644 conlite/external/phpmailer/phpmailer/examples/styles/shThemeDjango.css delete mode 100644 conlite/external/phpmailer/phpmailer/examples/styles/shThemeEclipse.css delete mode 100644 conlite/external/phpmailer/phpmailer/examples/styles/shThemeEmacs.css delete mode 100644 conlite/external/phpmailer/phpmailer/examples/styles/shThemeFadeToGrey.css delete mode 100644 conlite/external/phpmailer/phpmailer/examples/styles/shThemeMDUltra.css delete mode 100644 conlite/external/phpmailer/phpmailer/examples/styles/shThemeMidnight.css delete mode 100644 conlite/external/phpmailer/phpmailer/examples/styles/shThemeRDark.css delete mode 100644 conlite/external/phpmailer/phpmailer/examples/styles/shThemeVisualStudio.css delete mode 100644 conlite/external/phpmailer/phpmailer/examples/styles/wrapping.png delete mode 100644 conlite/external/phpmailer/phpmailer/extras/EasyPeasyICS.php delete mode 100644 conlite/external/phpmailer/phpmailer/extras/README.md delete mode 100644 conlite/external/phpmailer/phpmailer/extras/htmlfilter.php delete mode 100644 conlite/external/phpmailer/phpmailer/extras/ntlm_sasl_client.php create mode 100644 conlite/external/phpmailer/phpmailer/language/phpmailer.lang-af.php delete mode 100644 conlite/external/phpmailer/phpmailer/language/phpmailer.lang-ch.php create mode 100644 conlite/external/phpmailer/phpmailer/language/phpmailer.lang-hi.php rename conlite/external/phpmailer/phpmailer/language/{phpmailer.lang-am.php => phpmailer.lang-hy.php} (99%) create mode 100644 conlite/external/phpmailer/phpmailer/language/phpmailer.lang-mg.php create mode 100644 conlite/external/phpmailer/phpmailer/language/phpmailer.lang-mn.php rename conlite/external/phpmailer/phpmailer/language/{phpmailer.lang-rs.php => phpmailer.lang-sr.php} (79%) create mode 100644 conlite/external/phpmailer/phpmailer/language/phpmailer.lang-sr_latn.php create mode 100644 conlite/external/phpmailer/phpmailer/language/phpmailer.lang-tl.php create mode 100644 conlite/external/phpmailer/phpmailer/src/DSNConfigurator.php create mode 100644 conlite/external/phpmailer/phpmailer/src/Exception.php create mode 100644 conlite/external/phpmailer/phpmailer/src/OAuth.php create mode 100644 conlite/external/phpmailer/phpmailer/src/OAuthTokenProvider.php create mode 100644 conlite/external/phpmailer/phpmailer/src/PHPMailer.php create mode 100644 conlite/external/phpmailer/phpmailer/src/POP3.php rename conlite/external/phpmailer/phpmailer/{class.smtp.php => src/SMTP.php} (58%) delete mode 160000 conlite/plugins/cl-content-allocation delete mode 160000 conlite/plugins/cl-mod-rewrite delete mode 160000 conlite/plugins/cl-newsletter diff --git a/.idea/.gitignore b/.idea/.gitignore new file mode 100644 index 0000000..13566b8 --- /dev/null +++ b/.idea/.gitignore @@ -0,0 +1,8 @@ +# Default ignored files +/shelf/ +/workspace.xml +# Editor-based HTTP Client requests +/httpRequests/ +# Datasource local storage ignored files +/dataSources/ +/dataSources.local.xml diff --git a/.idea/ConLite.iml b/.idea/ConLite.iml new file mode 100644 index 0000000..c956989 --- /dev/null +++ b/.idea/ConLite.iml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml new file mode 100644 index 0000000..37c4794 --- /dev/null +++ b/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 0000000..ddb69a7 --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/cms/securimage b/cms/securimage deleted file mode 160000 index 1cf005a..0000000 --- a/cms/securimage +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 1cf005afb5760e7e6e269579b18e47acb5821b6e diff --git a/composer.json b/composer.json index 28fb480..8e77cb5 100644 --- a/composer.json +++ b/composer.json @@ -12,8 +12,7 @@ "vendor-dir": "conlite/external" }, "require": { - "endroid/qr-code": "1.9.*", - "phpmailer/phpmailer": "v5.2.*" + "phpmailer/phpmailer": "v6.8.0" }, "autoload": { "psr-4": { diff --git a/composer.lock b/composer.lock index 232cd10..52423f7 100644 --- a/composer.lock +++ b/composer.lock @@ -4,128 +4,57 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "e89f8a75b1a9d3be271cdb0aafea0cfa", + "content-hash": "c6b6bf25155d9d1ebea60cf6cc6d02a5", "packages": [ - { - "name": "endroid/qr-code", - "version": "1.9.3", - "source": { - "type": "git", - "url": "https://github.com/endroid/qr-code.git", - "reference": "c9644bec2a9cc9318e98d1437de3c628dcd1ef93" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/endroid/qr-code/zipball/c9644bec2a9cc9318e98d1437de3c628dcd1ef93", - "reference": "c9644bec2a9cc9318e98d1437de3c628dcd1ef93", - "shasum": "" - }, - "require": { - "ext-gd": "*", - "php": ">=5.4", - "symfony/options-resolver": "^2.3|^3.0" - }, - "require-dev": { - "phpunit/phpunit": "^4.0|^5.0", - "sensio/framework-extra-bundle": "^3.0", - "symfony/browser-kit": "^2.3|^3.0", - "symfony/framework-bundle": "^2.3|^3.0", - "symfony/http-kernel": "^2.3|^3.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.x-dev" - } - }, - "autoload": { - "psr-4": { - "Endroid\\QrCode\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Jeroen van den Enden", - "email": "info@endroid.nl", - "homepage": "http://endroid.nl/" - } - ], - "description": "Endroid QR Code", - "homepage": "https://github.com/endroid/QrCode", - "keywords": [ - "bundle", - "code", - "endroid", - "qr", - "qrcode", - "symfony" - ], - "support": { - "issues": "https://github.com/endroid/qr-code/issues", - "source": "https://github.com/endroid/qr-code/tree/1.9.3" - }, - "time": "2017-04-08T09:13:59+00:00" - }, { "name": "phpmailer/phpmailer", - "version": "v5.2.28", + "version": "v6.8.0", "source": { "type": "git", "url": "https://github.com/PHPMailer/PHPMailer.git", - "reference": "acba50393dd03da69a50226c139722af8b153b11" + "reference": "df16b615e371d81fb79e506277faea67a1be18f1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/PHPMailer/PHPMailer/zipball/acba50393dd03da69a50226c139722af8b153b11", - "reference": "acba50393dd03da69a50226c139722af8b153b11", + "url": "https://api.github.com/repos/PHPMailer/PHPMailer/zipball/df16b615e371d81fb79e506277faea67a1be18f1", + "reference": "df16b615e371d81fb79e506277faea67a1be18f1", "shasum": "" }, "require": { "ext-ctype": "*", - "php": ">=5.0.0" + "ext-filter": "*", + "ext-hash": "*", + "php": ">=5.5.0" }, "require-dev": { - "doctrine/annotations": "1.2.*", - "jms/serializer": "0.16.*", - "phpdocumentor/phpdocumentor": "2.*", - "phpunit/phpunit": "4.8.*", - "symfony/debug": "2.8.*", - "symfony/filesystem": "2.8.*", - "symfony/translation": "2.8.*", - "symfony/yaml": "2.8.*", - "zendframework/zend-cache": "2.5.1", - "zendframework/zend-config": "2.5.1", - "zendframework/zend-eventmanager": "2.5.1", - "zendframework/zend-filter": "2.5.1", - "zendframework/zend-i18n": "2.5.1", - "zendframework/zend-json": "2.5.1", - "zendframework/zend-math": "2.5.1", - "zendframework/zend-serializer": "2.5.*", - "zendframework/zend-servicemanager": "2.5.*", - "zendframework/zend-stdlib": "2.5.1" + "dealerdirect/phpcodesniffer-composer-installer": "^0.7.2", + "doctrine/annotations": "^1.2.6 || ^1.13.3", + "php-parallel-lint/php-console-highlighter": "^1.0.0", + "php-parallel-lint/php-parallel-lint": "^1.3.2", + "phpcompatibility/php-compatibility": "^9.3.5", + "roave/security-advisories": "dev-latest", + "squizlabs/php_codesniffer": "^3.7.1", + "yoast/phpunit-polyfills": "^1.0.4" }, "suggest": { - "league/oauth2-google": "Needed for Google XOAUTH2 authentication" + "ext-mbstring": "Needed to send email in multibyte encoding charset or decode encoded addresses", + "ext-openssl": "Needed for secure SMTP sending and DKIM signing", + "greew/oauth2-azure-provider": "Needed for Microsoft Azure XOAUTH2 authentication", + "hayageek/oauth2-yahoo": "Needed for Yahoo XOAUTH2 authentication", + "league/oauth2-google": "Needed for Google XOAUTH2 authentication", + "psr/log": "For optional PSR-3 debug logging", + "symfony/polyfill-mbstring": "To support UTF-8 if the Mbstring PHP extension is not enabled (^1.2)", + "thenetworg/oauth2-azure": "Needed for Microsoft XOAUTH2 authentication" }, "type": "library", "autoload": { - "classmap": [ - "class.phpmailer.php", - "class.phpmaileroauth.php", - "class.phpmaileroauthgoogle.php", - "class.smtp.php", - "class.pop3.php", - "extras/EasyPeasyICS.php", - "extras/ntlm_sasl_client.php" - ] + "psr-4": { + "PHPMailer\\PHPMailer\\": "src/" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ - "LGPL-2.1" + "LGPL-2.1-only" ], "authors": [ { @@ -147,89 +76,15 @@ "description": "PHPMailer is a full-featured email creation and transfer class for PHP", "support": { "issues": "https://github.com/PHPMailer/PHPMailer/issues", - "source": "https://github.com/PHPMailer/PHPMailer/tree/v5.2.28" + "source": "https://github.com/PHPMailer/PHPMailer/tree/v6.8.0" }, "funding": [ - { - "url": "https://marcus.bointon.com/donations/", - "type": "custom" - }, { "url": "https://github.com/Synchro", "type": "github" - }, - { - "url": "https://www.patreon.com/marcusbointon", - "type": "patreon" } ], - "time": "2020-03-19T14:29:37+00:00" - }, - { - "name": "symfony/options-resolver", - "version": "v3.4.47", - "source": { - "type": "git", - "url": "https://github.com/symfony/options-resolver.git", - "reference": "c7efc97a47b2ebaabc19d5b6c6b50f5c37c92744" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/options-resolver/zipball/c7efc97a47b2ebaabc19d5b6c6b50f5c37c92744", - "reference": "c7efc97a47b2ebaabc19d5b6c6b50f5c37c92744", - "shasum": "" - }, - "require": { - "php": "^5.5.9|>=7.0.8" - }, - "type": "library", - "autoload": { - "psr-4": { - "Symfony\\Component\\OptionsResolver\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony OptionsResolver Component", - "homepage": "https://symfony.com", - "keywords": [ - "config", - "configuration", - "options" - ], - "support": { - "source": "https://github.com/symfony/options-resolver/tree/v3.4.47" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2020-10-24T10:57:07+00:00" + "time": "2023-03-06T14:43:22+00:00" } ], "packages-dev": [], diff --git a/conlite/external/autoload.php b/conlite/external/autoload.php index b69e093..955af5a 100644 --- a/conlite/external/autoload.php +++ b/conlite/external/autoload.php @@ -3,21 +3,8 @@ // autoload.php @generated by Composer if (PHP_VERSION_ID < 50600) { - if (!headers_sent()) { - header('HTTP/1.1 500 Internal Server Error'); - } - $err = 'Composer 2.3.0 dropped support for autoloading on PHP <5.6 and you are running '.PHP_VERSION.', please upgrade PHP or use Composer 2.2 LTS via "composer self-update --2.2". Aborting.'.PHP_EOL; - if (!ini_get('display_errors')) { - if (PHP_SAPI === 'cli' || PHP_SAPI === 'phpdbg') { - fwrite(STDERR, $err); - } elseif (!headers_sent()) { - echo $err; - } - } - trigger_error( - $err, - E_USER_ERROR - ); + echo 'Composer 2.3.0 dropped support for autoloading on PHP <5.6 and you are running '.PHP_VERSION.', please upgrade PHP or use Composer 2.2 LTS via "composer self-update --2.2". Aborting.'.PHP_EOL; + exit(1); } require_once __DIR__ . '/composer/autoload_real.php'; diff --git a/conlite/external/composer/autoload_classmap.php b/conlite/external/composer/autoload_classmap.php index 65cba2c..37e449b 100644 --- a/conlite/external/composer/autoload_classmap.php +++ b/conlite/external/composer/autoload_classmap.php @@ -7,12 +7,4 @@ $baseDir = dirname(dirname($vendorDir)); return array( 'Composer\\InstalledVersions' => $vendorDir . '/composer/InstalledVersions.php', - 'EasyPeasyICS' => $vendorDir . '/phpmailer/phpmailer/extras/EasyPeasyICS.php', - 'PHPMailer' => $vendorDir . '/phpmailer/phpmailer/class.phpmailer.php', - 'PHPMailerOAuth' => $vendorDir . '/phpmailer/phpmailer/class.phpmaileroauth.php', - 'PHPMailerOAuthGoogle' => $vendorDir . '/phpmailer/phpmailer/class.phpmaileroauthgoogle.php', - 'POP3' => $vendorDir . '/phpmailer/phpmailer/class.pop3.php', - 'SMTP' => $vendorDir . '/phpmailer/phpmailer/class.smtp.php', - 'ntlm_sasl_client_class' => $vendorDir . '/phpmailer/phpmailer/extras/ntlm_sasl_client.php', - 'phpmailerException' => $vendorDir . '/phpmailer/phpmailer/class.phpmailer.php', ); diff --git a/conlite/external/composer/autoload_psr4.php b/conlite/external/composer/autoload_psr4.php index 7359147..35cfe40 100644 --- a/conlite/external/composer/autoload_psr4.php +++ b/conlite/external/composer/autoload_psr4.php @@ -6,7 +6,6 @@ $vendorDir = dirname(__DIR__); $baseDir = dirname(dirname($vendorDir)); return array( - 'Symfony\\Component\\OptionsResolver\\' => array($vendorDir . '/symfony/options-resolver'), - 'Endroid\\QrCode\\' => array($vendorDir . '/endroid/qr-code/src'), + 'PHPMailer\\PHPMailer\\' => array($vendorDir . '/phpmailer/phpmailer/src'), 'Conlite\\External\\' => array($vendorDir . ''), ); diff --git a/conlite/external/composer/autoload_static.php b/conlite/external/composer/autoload_static.php index 01b957d..7f9ddc8 100644 --- a/conlite/external/composer/autoload_static.php +++ b/conlite/external/composer/autoload_static.php @@ -7,13 +7,9 @@ namespace Composer\Autoload; class ComposerStaticInit4710875e1096bb659e0da9fbf88400bb { public static $prefixLengthsPsr4 = array ( - 'S' => + 'P' => array ( - 'Symfony\\Component\\OptionsResolver\\' => 34, - ), - 'E' => - array ( - 'Endroid\\QrCode\\' => 15, + 'PHPMailer\\PHPMailer\\' => 20, ), 'C' => array ( @@ -22,13 +18,9 @@ class ComposerStaticInit4710875e1096bb659e0da9fbf88400bb ); public static $prefixDirsPsr4 = array ( - 'Symfony\\Component\\OptionsResolver\\' => + 'PHPMailer\\PHPMailer\\' => array ( - 0 => __DIR__ . '/..' . '/symfony/options-resolver', - ), - 'Endroid\\QrCode\\' => - array ( - 0 => __DIR__ . '/..' . '/endroid/qr-code/src', + 0 => __DIR__ . '/..' . '/phpmailer/phpmailer/src', ), 'Conlite\\External\\' => array ( @@ -38,14 +30,6 @@ class ComposerStaticInit4710875e1096bb659e0da9fbf88400bb public static $classMap = array ( 'Composer\\InstalledVersions' => __DIR__ . '/..' . '/composer/InstalledVersions.php', - 'EasyPeasyICS' => __DIR__ . '/..' . '/phpmailer/phpmailer/extras/EasyPeasyICS.php', - 'PHPMailer' => __DIR__ . '/..' . '/phpmailer/phpmailer/class.phpmailer.php', - 'PHPMailerOAuth' => __DIR__ . '/..' . '/phpmailer/phpmailer/class.phpmaileroauth.php', - 'PHPMailerOAuthGoogle' => __DIR__ . '/..' . '/phpmailer/phpmailer/class.phpmaileroauthgoogle.php', - 'POP3' => __DIR__ . '/..' . '/phpmailer/phpmailer/class.pop3.php', - 'SMTP' => __DIR__ . '/..' . '/phpmailer/phpmailer/class.smtp.php', - 'ntlm_sasl_client_class' => __DIR__ . '/..' . '/phpmailer/phpmailer/extras/ntlm_sasl_client.php', - 'phpmailerException' => __DIR__ . '/..' . '/phpmailer/phpmailer/class.phpmailer.php', ); public static function getInitializer(ClassLoader $loader) diff --git a/conlite/external/composer/installed.json b/conlite/external/composer/installed.json index 6d9b7c0..74cd011 100644 --- a/conlite/external/composer/installed.json +++ b/conlite/external/composer/installed.json @@ -1,131 +1,57 @@ { "packages": [ - { - "name": "endroid/qr-code", - "version": "1.9.3", - "version_normalized": "1.9.3.0", - "source": { - "type": "git", - "url": "https://github.com/endroid/qr-code.git", - "reference": "c9644bec2a9cc9318e98d1437de3c628dcd1ef93" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/endroid/qr-code/zipball/c9644bec2a9cc9318e98d1437de3c628dcd1ef93", - "reference": "c9644bec2a9cc9318e98d1437de3c628dcd1ef93", - "shasum": "" - }, - "require": { - "ext-gd": "*", - "php": ">=5.4", - "symfony/options-resolver": "^2.3|^3.0" - }, - "require-dev": { - "phpunit/phpunit": "^4.0|^5.0", - "sensio/framework-extra-bundle": "^3.0", - "symfony/browser-kit": "^2.3|^3.0", - "symfony/framework-bundle": "^2.3|^3.0", - "symfony/http-kernel": "^2.3|^3.0" - }, - "time": "2017-04-08T09:13:59+00:00", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.x-dev" - } - }, - "installation-source": "dist", - "autoload": { - "psr-4": { - "Endroid\\QrCode\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Jeroen van den Enden", - "email": "info@endroid.nl", - "homepage": "http://endroid.nl/" - } - ], - "description": "Endroid QR Code", - "homepage": "https://github.com/endroid/QrCode", - "keywords": [ - "bundle", - "code", - "endroid", - "qr", - "qrcode", - "symfony" - ], - "support": { - "issues": "https://github.com/endroid/qr-code/issues", - "source": "https://github.com/endroid/qr-code/tree/1.9.3" - }, - "install-path": "../endroid/qr-code" - }, { "name": "phpmailer/phpmailer", - "version": "v6.5.3", - "version_normalized": "6.5.3.0", + "version": "v6.8.0", + "version_normalized": "6.8.0.0", "source": { "type": "git", "url": "https://github.com/PHPMailer/PHPMailer.git", - "reference": "baeb7cde6b60b1286912690ab0693c7789a31e71" + "reference": "df16b615e371d81fb79e506277faea67a1be18f1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/PHPMailer/PHPMailer/zipball/baeb7cde6b60b1286912690ab0693c7789a31e71", - "reference": "baeb7cde6b60b1286912690ab0693c7789a31e71", + "url": "https://api.github.com/repos/PHPMailer/PHPMailer/zipball/df16b615e371d81fb79e506277faea67a1be18f1", + "reference": "df16b615e371d81fb79e506277faea67a1be18f1", "shasum": "" }, "require": { "ext-ctype": "*", - "php": ">=5.0.0" + "ext-filter": "*", + "ext-hash": "*", + "php": ">=5.5.0" }, "require-dev": { - "doctrine/annotations": "1.2.*", - "jms/serializer": "0.16.*", - "phpdocumentor/phpdocumentor": "2.*", - "phpunit/phpunit": "4.8.*", - "symfony/debug": "2.8.*", - "symfony/filesystem": "2.8.*", - "symfony/translation": "2.8.*", - "symfony/yaml": "2.8.*", - "zendframework/zend-cache": "2.5.1", - "zendframework/zend-config": "2.5.1", - "zendframework/zend-eventmanager": "2.5.1", - "zendframework/zend-filter": "2.5.1", - "zendframework/zend-i18n": "2.5.1", - "zendframework/zend-json": "2.5.1", - "zendframework/zend-math": "2.5.1", - "zendframework/zend-serializer": "2.5.*", - "zendframework/zend-servicemanager": "2.5.*", - "zendframework/zend-stdlib": "2.5.1" + "dealerdirect/phpcodesniffer-composer-installer": "^0.7.2", + "doctrine/annotations": "^1.2.6 || ^1.13.3", + "php-parallel-lint/php-console-highlighter": "^1.0.0", + "php-parallel-lint/php-parallel-lint": "^1.3.2", + "phpcompatibility/php-compatibility": "^9.3.5", + "roave/security-advisories": "dev-latest", + "squizlabs/php_codesniffer": "^3.7.1", + "yoast/phpunit-polyfills": "^1.0.4" }, "suggest": { - "league/oauth2-google": "Needed for Google XOAUTH2 authentication" + "ext-mbstring": "Needed to send email in multibyte encoding charset or decode encoded addresses", + "ext-openssl": "Needed for secure SMTP sending and DKIM signing", + "greew/oauth2-azure-provider": "Needed for Microsoft Azure XOAUTH2 authentication", + "hayageek/oauth2-yahoo": "Needed for Yahoo XOAUTH2 authentication", + "league/oauth2-google": "Needed for Google XOAUTH2 authentication", + "psr/log": "For optional PSR-3 debug logging", + "symfony/polyfill-mbstring": "To support UTF-8 if the Mbstring PHP extension is not enabled (^1.2)", + "thenetworg/oauth2-azure": "Needed for Microsoft XOAUTH2 authentication" }, - "time": "2021-11-25T16:34:11+00:00", + "time": "2023-03-06T14:43:22+00:00", "type": "library", "installation-source": "dist", "autoload": { - "classmap": [ - "class.phpmailer.php", - "class.phpmaileroauth.php", - "class.phpmaileroauthgoogle.php", - "class.smtp.php", - "class.pop3.php", - "extras/EasyPeasyICS.php", - "extras/ntlm_sasl_client.php" - ] + "psr-4": { + "PHPMailer\\PHPMailer\\": "src/" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ - "LGPL-2.1" + "LGPL-2.1-only" ], "authors": [ { @@ -147,94 +73,17 @@ "description": "PHPMailer is a full-featured email creation and transfer class for PHP", "support": { "issues": "https://github.com/PHPMailer/PHPMailer/issues", - "source": "https://github.com/PHPMailer/PHPMailer/tree/v6.5.3" + "source": "https://github.com/PHPMailer/PHPMailer/tree/v6.8.0" }, "funding": [ - { - "url": "https://marcus.bointon.com/donations/", - "type": "custom" - }, { "url": "https://github.com/Synchro", "type": "github" - }, - { - "url": "https://www.patreon.com/marcusbointon", - "type": "patreon" } ], "install-path": "../phpmailer/phpmailer" - }, - { - "name": "symfony/options-resolver", - "version": "v3.4.47", - "version_normalized": "3.4.47.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/options-resolver.git", - "reference": "c7efc97a47b2ebaabc19d5b6c6b50f5c37c92744" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/options-resolver/zipball/c7efc97a47b2ebaabc19d5b6c6b50f5c37c92744", - "reference": "c7efc97a47b2ebaabc19d5b6c6b50f5c37c92744", - "shasum": "" - }, - "require": { - "php": "^5.5.9|>=7.0.8" - }, - "time": "2020-10-24T10:57:07+00:00", - "type": "library", - "installation-source": "dist", - "autoload": { - "psr-4": { - "Symfony\\Component\\OptionsResolver\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony OptionsResolver Component", - "homepage": "https://symfony.com", - "keywords": [ - "config", - "configuration", - "options" - ], - "support": { - "source": "https://github.com/symfony/options-resolver/tree/v3.4.47" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "install-path": "../symfony/options-resolver" } ], - "dev": false, + "dev": true, "dev-package-names": [] } diff --git a/conlite/external/composer/installed.php b/conlite/external/composer/installed.php index 7ae3d3e..1706c7f 100644 --- a/conlite/external/composer/installed.php +++ b/conlite/external/composer/installed.php @@ -1,58 +1,31 @@ array( + 'name' => 'vendor/conlite', 'pretty_version' => 'dev-develop', 'version' => 'dev-develop', + 'reference' => '625c6ab405fe1f9d435e0812edd36c25b74c0b69', 'type' => 'library', 'install_path' => __DIR__ . '/../../../', 'aliases' => array(), - 'reference' => 'eea9100b3e2c72ca8b239c6a9fcb2671780ef12f', - 'name' => 'vendor/con-lite21', - 'dev' => false, + 'dev' => true, ), 'versions' => array( - 'bacon/bacon-qr-code' => array( - 'pretty_version' => '2.0.4', - 'version' => '2.0.4.0', - 'type' => 'library', - 'install_path' => __DIR__ . '/../bacon/bacon-qr-code', - 'aliases' => array(), - 'reference' => 'f73543ac4e1def05f1a70bcd1525c8a157a1ad09', - 'dev_requirement' => false, - ), - 'dasprid/enum' => array( - 'pretty_version' => '1.0.3', - 'version' => '1.0.3.0', - 'type' => 'library', - 'install_path' => __DIR__ . '/../dasprid/enum', - 'aliases' => array(), - 'reference' => '5abf82f213618696dda8e3bf6f64dd042d8542b2', - 'dev_requirement' => false, - ), - 'endroid/qr-code' => array( - 'pretty_version' => '4.2.2', - 'version' => '4.2.2.0', - 'type' => 'library', - 'install_path' => __DIR__ . '/../endroid/qr-code', - 'aliases' => array(), - 'reference' => '53bfce79da95bf082484301fecbc1d77a3907f78', - 'dev_requirement' => false, - ), 'phpmailer/phpmailer' => array( - 'pretty_version' => 'v6.5.3', - 'version' => '6.5.3.0', + 'pretty_version' => 'v6.8.0', + 'version' => '6.8.0.0', + 'reference' => 'df16b615e371d81fb79e506277faea67a1be18f1', 'type' => 'library', 'install_path' => __DIR__ . '/../phpmailer/phpmailer', 'aliases' => array(), - 'reference' => 'baeb7cde6b60b1286912690ab0693c7789a31e71', 'dev_requirement' => false, ), - 'vendor/con-lite21' => array( + 'vendor/conlite' => array( 'pretty_version' => 'dev-develop', 'version' => 'dev-develop', + 'reference' => '625c6ab405fe1f9d435e0812edd36c25b74c0b69', 'type' => 'library', 'install_path' => __DIR__ . '/../../../', 'aliases' => array(), - 'reference' => 'eea9100b3e2c72ca8b239c6a9fcb2671780ef12f', 'dev_requirement' => false, ), ), diff --git a/conlite/external/composer/platform_check.php b/conlite/external/composer/platform_check.php index d673084..454eefd 100644 --- a/conlite/external/composer/platform_check.php +++ b/conlite/external/composer/platform_check.php @@ -4,8 +4,8 @@ $issues = array(); -if (!(PHP_VERSION_ID >= 50509)) { - $issues[] = 'Your Composer dependencies require a PHP version ">= 5.5.9". You are running ' . PHP_VERSION . '.'; +if (!(PHP_VERSION_ID >= 50500)) { + $issues[] = 'Your Composer dependencies require a PHP version ">= 5.5.0". You are running ' . PHP_VERSION . '.'; } if ($issues) { diff --git a/conlite/external/endroid/qr-code/LICENSE b/conlite/external/endroid/qr-code/LICENSE deleted file mode 100644 index 0966ce0..0000000 --- a/conlite/external/endroid/qr-code/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) Jeroen van den Enden - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is furnished -to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/conlite/external/endroid/qr-code/composer.json b/conlite/external/endroid/qr-code/composer.json deleted file mode 100644 index eb785a0..0000000 --- a/conlite/external/endroid/qr-code/composer.json +++ /dev/null @@ -1,45 +0,0 @@ -{ - "name": "endroid/qrcode", - "description": "Endroid QR Code", - "keywords": ["endroid", "qrcode", "qr", "code", "bundle", "symfony"], - "homepage": "https://github.com/endroid/QrCode", - "type": "library", - "license": "MIT", - "authors": [ - { - "name": "Jeroen van den Enden", - "email": "info@endroid.nl", - "homepage": "http://endroid.nl/" - } - ], - "require": { - "php": ">=5.4", - "ext-gd": "*", - "symfony/options-resolver": "^2.3|^3.0" - }, - "require-dev": { - "symfony/browser-kit": "^2.3|^3.0", - "symfony/framework-bundle": "^2.3|^3.0", - "symfony/http-kernel": "^2.3|^3.0", - "sensio/framework-extra-bundle": "^3.0", - "phpunit/phpunit": "^4.0|^5.0" - }, - "autoload": { - "psr-4": { - "Endroid\\QrCode\\": "src/" - } - }, - "autoload-dev": { - "psr-4": { - "Endroid\\QrCode\\Tests\\": "tests/" - } - }, - "config": { - "bin-dir": "bin" - }, - "extra": { - "branch-alias": { - "dev-master": "1.x-dev" - } - } -} diff --git a/conlite/external/endroid/qr-code/src/QrCode.php b/conlite/external/endroid/qr-code/src/QrCode.php deleted file mode 100644 index b128cfc..0000000 --- a/conlite/external/endroid/qr-code/src/QrCode.php +++ /dev/null @@ -1,1591 +0,0 @@ - - * - * This source file is subject to the MIT license that is bundled - * with this source code in the file LICENSE. - */ - -namespace Endroid\QrCode; - -use Endroid\QrCode\Exceptions\DataDoesntExistsException; -use Endroid\QrCode\Exceptions\FreeTypeLibraryMissingException; -use Endroid\QrCode\Exceptions\ImageFunctionFailedException; -use Endroid\QrCode\Exceptions\ImageTypeInvalidException; -use Endroid\QrCode\Exceptions\VersionTooLargeException; -use Endroid\QrCode\Exceptions\ImageSizeTooLargeException; -use Endroid\QrCode\Exceptions\ImageFunctionUnknownException; -use ReflectionFunction; - -/** - * Generate QR Code. - */ -class QrCode -{ - /** @const int Error Correction Level Low (7%) */ - const LEVEL_LOW = 1; - - /** @const int Error Correction Level Medium (15%) */ - const LEVEL_MEDIUM = 0; - - /** @const int Error Correction Level Quartile (25%) */ - const LEVEL_QUARTILE = 3; - - /** @const int Error Correction Level High (30%) */ - const LEVEL_HIGH = 2; - - /** @const string Image type png */ - const IMAGE_TYPE_PNG = 'png'; - - /** @const string Image type gif */ - const IMAGE_TYPE_GIF = 'gif'; - - /** @const string Image type jpeg */ - const IMAGE_TYPE_JPEG = 'jpeg'; - - /** @const string Image type wbmp */ - const IMAGE_TYPE_WBMP = 'wbmp'; - - /** @const int Horizontal label alignment to the center of image */ - const LABEL_HALIGN_CENTER = 0; - - /** @const int Horizontal label alignment to the left side of image */ - const LABEL_HALIGN_LEFT = 1; - - /** @const int Horizontal label alignment to the left border of QR Code */ - const LABEL_HALIGN_LEFT_BORDER = 2; - - /** @const int Horizontal label alignment to the left side of QR Code */ - const LABEL_HALIGN_LEFT_CODE = 3; - - /** @const int Horizontal label alignment to the right side of image */ - const LABEL_HALIGN_RIGHT = 4; - - /** @const int Horizontal label alignment to the right border of QR Code */ - const LABEL_HALIGN_RIGHT_BORDER = 5; - - /** @const int Horizontal label alignment to the right side of QR Code */ - const LABEL_HALIGN_RIGHT_CODE = 6; - - /** @const int Vertical label alignment to the top */ - const LABEL_VALIGN_TOP = 1; - - /** @const int Vertical label alignment to the top and hide border */ - const LABEL_VALIGN_TOP_NO_BORDER = 2; - - /** @const int Vertical label alignment to the middle*/ - const LABEL_VALIGN_MIDDLE = 3; - - /** @const int Vertical label alignment to the bottom */ - const LABEL_VALIGN_BOTTOM = 4; - - /** @var string */ - protected $logo = null; - - protected $logo_size = 48; - - /** @var string */ - protected $text = ''; - - /** @var int */ - protected $size = 0; - - /** @var int */ - protected $padding = 16; - - /** @var bool */ - protected $draw_quiet_zone = false; - - /** @var bool */ - protected $draw_border = false; - - /** @var array */ - protected $color_foreground = ['r' => 0, 'g' => 0, 'b' => 0, 'a' => 0]; - - /** @var array */ - protected $color_background = ['r' => 255, 'g' => 255, 'b' => 255, 'a' => 0]; - - /** @var string */ - protected $label = ''; - - /** @var int */ - protected $label_font_size = 16; - - /** @var string */ - protected $label_font_path = ''; - - /** @var int */ - protected $label_halign = self::LABEL_HALIGN_CENTER; - - /** @var int */ - protected $label_valign = self::LABEL_VALIGN_MIDDLE; - - /** @var resource */ - protected $image = null; - - /** @var int */ - protected $version; - - /** @var int */ - protected $error_correction = self::LEVEL_MEDIUM; - - /** @var array */ - protected $error_corrections_available = [ - self::LEVEL_LOW, - self::LEVEL_MEDIUM, - self::LEVEL_QUARTILE, - self::LEVEL_HIGH, - ]; - - /** @var int */ - protected $module_size; - - /** @var string */ - protected $image_type = self::IMAGE_TYPE_PNG; - - /** @var array */ - protected $image_types_available = [ - self::IMAGE_TYPE_GIF, - self::IMAGE_TYPE_PNG, - self::IMAGE_TYPE_JPEG, - self::IMAGE_TYPE_WBMP, - ]; - - /** @var string */ - protected $image_path; - - /** @var string */ - protected $path; - - /** @var int */ - protected $structure_append_n; - - /** @var int */ - protected $structure_append_m; - - /** @var int */ - protected $structure_append_parity; - - /** @var string */ - protected $structure_append_original_data; - - /** - * Class constructor. - * - * @param string $text - */ - public function __construct($text = '') - { - $this->setPath(__DIR__.'/../assets/data'); - $this->setImagePath(__DIR__.'/../assets/image'); - $this->setLabelFontPath(__DIR__.'/../assets/font/opensans.ttf'); - $this->setText($text); - } - - /** - * Set structure append. - * - * @param int $n - * @param int $m - * @param int $parity Parity - * @param string $original_data Original data - * - * @return QrCode - */ - public function setStructureAppend($n, $m, $parity, $original_data) - { - $this->structure_append_n = $n; - $this->structure_append_m = $m; - $this->structure_append_parity = $parity; - $this->structure_append_original_data = $original_data; - - return $this; - } - - /** - * Set QR Code version. - * - * @param int $version QR Code version - * - * @return QrCode - */ - public function setVersion($version) - { - if ($version <= 40 && $version >= 0) { - $this->version = $version; - } - - return $this; - } - - /** - * Return QR Code version. - * - * @return int - */ - public function getVersion() - { - return $this->version; - } - - /** - * Set QR Code error correction level. - * - * @param mixed $error_correction Error Correction Level - * - * @return QrCode - */ - public function setErrorCorrection($error_correction) - { - if (!is_numeric($error_correction)) { - $level_constant = 'Endroid\QrCode\QrCode::LEVEL_'.strtoupper($error_correction); - $error_correction = constant($level_constant); - } - - if (in_array($error_correction, $this->error_corrections_available)) { - $this->error_correction = $error_correction; - } - - return $this; - } - - /** - * Return QR Code error correction level. - * - * @return int - */ - public function getErrorCorrection() - { - return $this->error_correction; - } - - /** - * Set QR Code module size. - * - * @param int $module_size Module size - * - * @return QrCode - */ - public function setModuleSize($module_size) - { - $this->module_size = $module_size; - - return $this; - } - - /** - * Return QR Code module size. - * - * @return int - */ - public function getModuleSize() - { - return $this->module_size; - } - - /** - * Set image type for rendering. - * - * @param string $image_type Image type - * - * @return QrCode - * - * @throws ImageTypeInvalidException - */ - public function setImageType($image_type) - { - if (!in_array($image_type, $this->image_types_available)) { - throw new ImageTypeInvalidException('QRCode: image type '.$image_type.' is invalid.'); - } - - $this->image_type = $image_type; - - return $this; - } - - /** - * Return image type for rendering. - * - * @return string - */ - public function getImageType() - { - return $this->image_type; - } - - /** - * Set image type for rendering via extension. - * - * @param string $extension Image extension - * - * @return QrCode - */ - public function setExtension($extension) - { - if ($extension == 'jpg') { - $this->setImageType('jpeg'); - } else { - $this->setImageType($extension); - } - - return $this; - } - - /** - * Set path to the images directory. - * - * @param string $image_path Image directory - * - * @return QrCode - */ - public function setImagePath($image_path) - { - $this->image_path = $image_path; - - return $this; - } - - /** - * Return path to the images directory. - * - * @return string - */ - public function getImagePath() - { - return $this->image_path; - } - - /** - * Set path to the data directory. - * - * @param string $path Data directory - * - * @return QrCode - */ - public function setPath($path) - { - $this->path = $path; - - return $this; - } - - /** - * Return path to the data directory. - * - * @return string - */ - public function getPath() - { - return $this->path; - } - - /** - * Set logo in QR Code. - * - * @param string $logo Logo Path - * - * @throws Exceptions\DataDoesntExistsException - * - * @return QrCode - */ - public function setLogo($logo) - { - if (!file_exists($logo)) { - throw new DataDoesntExistsException("$logo file does not exist"); - } - - $this->logo = $logo; - - return $this; - } - - /** - * Set logo size in QR Code(default 48). - * - * @param int $logo_size Logo Size - * - * @return QrCode - */ - public function setLogoSize($logo_size) - { - $this->logo_size = $logo_size; - - return $this; - } - - /** - * Set text to hide in QR Code. - * - * @param string $text Text to hide - * - * @return QrCode - */ - public function setText($text) - { - $this->text = $text; - - return $this; - } - - /** - * Return text that will be hid in QR Code. - * - * @return string - */ - public function getText() - { - return $this->text; - } - - /** - * Set QR Code size (width). - * - * @param int $size Width of the QR Code - * - * @return QrCode - */ - public function setSize($size) - { - $this->size = $size; - - return $this; - } - - /** - * Return QR Code size (width). - * - * @return int - */ - public function getSize() - { - return $this->size; - } - - /** - * Set padding around the QR Code. - * - * @param int $padding Padding around QR Code - * - * @return QrCode - */ - public function setPadding($padding) - { - $this->padding = $padding; - - return $this; - } - - /** - * Return padding around the QR Code. - * - * @return int - */ - public function getPadding() - { - return $this->padding; - } - - /** - * Set draw required four-module wide margin. - * - * @param bool $draw_quiet_zone State of required four-module wide margin drawing - * - * @return QrCode - */ - public function setDrawQuietZone($draw_quiet_zone) - { - $this->draw_quiet_zone = $draw_quiet_zone; - - return $this; - } - - /** - * Return draw required four-module wide margin. - * - * @return bool - */ - public function getDrawQuietZone() - { - return $this->draw_quiet_zone; - } - - /** - * Set draw border around QR Code. - * - * @param bool $draw_border State of border drawing - * - * @return QrCode - */ - public function setDrawBorder($draw_border) - { - $this->draw_border = $draw_border; - - return $this; - } - - /** - * Return draw border around QR Code. - * - * @return bool - */ - public function getDrawBorder() - { - return $this->draw_border; - } - - /** - * Set QR Code label (text). - * - * @param int|string $label Label to print under QR code - * - * @return QrCode - */ - public function setLabel($label) - { - $this->label = $label; - - return $this; - } - - /** - * Return QR Code label (text). - * - * @return string - */ - public function getLabel() - { - return $this->label; - } - - /** - * Set QR Code label font size. - * - * @param int $label_font_size Font size of the QR code label - * - * @return QrCode - */ - public function setLabelFontSize($label_font_size) - { - $this->label_font_size = $label_font_size; - - return $this; - } - - /** - * Return QR Code label font size. - * - * @return int - */ - public function getLabelFontSize() - { - return $this->label_font_size; - } - - /** - * Set QR Code label font path. - * - * @param int $label_font_path Path to the QR Code label's TTF font file - * - * @return QrCode - */ - public function setLabelFontPath($label_font_path) - { - $this->label_font_path = $label_font_path; - - return $this; - } - - /** - * Return path to the QR Code label's TTF font file. - * - * @return string - */ - public function getLabelFontPath() - { - return $this->label_font_path; - } - - /** - * Set label horizontal alignment. - * - * @param int $label_halign Label horizontal alignment - * - * @return QrCode - */ - public function setLabelHalign($label_halign) - { - $this->label_halign = $label_halign; - - return $this; - } - - /** - * Return label horizontal alignment. - * - * @return int - */ - public function getLabelHalign() - { - return $this->label_halign; - } - - /** - * Set label vertical alignment. - * - * @param int $label_valign Label vertical alignment - * - * @return QrCode - */ - public function setLabelValign($label_valign) - { - $this->label_valign = $label_valign; - - return $this; - } - - /** - * Return label vertical alignment. - * - * @return int - */ - public function getLabelValign() - { - return $this->label_valign; - } - - /** - * Set foreground color of the QR Code. - * - * @param array $color_foreground RGB color - * - * @return QrCode - */ - public function setForegroundColor($color_foreground) - { - if (!isset($color_foreground['a'])) { - $color_foreground['a'] = 0; - } - - $this->color_foreground = $color_foreground; - - return $this; - } - - /** - * Return foreground color of the QR Code. - * - * @return array - */ - public function getForegroundColor() - { - return $this->color_foreground; - } - - /** - * Set background color of the QR Code. - * - * @param array $color_background RGB color - * - * @return QrCode - */ - public function setBackgroundColor($color_background) - { - if (!isset($color_background['a'])) { - $color_background['a'] = 0; - } - - $this->color_background = $color_background; - - return $this; - } - - /** - * Return background color of the QR Code. - * - * @return array - */ - public function getBackgroundColor() - { - return $this->color_background; - } - - /** - * Return the image resource. - * - * @return resource - */ - public function getImage() - { - if (empty($this->image)) { - $this->create(); - } - - return $this->image; - } - - /** - * Return the data URI. - * - * @return string - */ - public function getDataUri() - { - if (empty($this->image)) { - $this->create(); - } - - ob_start(); - call_user_func('image'.$this->image_type, $this->image); - $contents = ob_get_clean(); - - return 'data:image/'.$this->image_type.';base64,'.base64_encode($contents); - } - - /** - * Render the QR Code then save it to given file name. - * - * @param string $filename File name of the QR Code - * - * @return QrCode - */ - public function save($filename) - { - $this->render($filename); - - return $this; - } - - /** - * Render the QR Code then save it to given file name or - * output it to the browser when file name omitted. - * - * @param null|string $filename File name of the QR Code - * @param null|string $format Format of the file (png, jpeg, jpg, gif, wbmp) - * - * @throws ImageFunctionUnknownException - * @throws ImageFunctionFailedException - * - * @return QrCode - */ - public function render($filename = null, $format = 'png') - { - $this->create(); - - if ($format == 'jpg') { - $format = 'jpeg'; - } - - if (!in_array($format, $this->image_types_available)) { - $format = $this->image_type; - } - - if (!function_exists('image'.$format)) { - throw new ImageFunctionUnknownException('QRCode: function image'.$format.' does not exists.'); - } - - if ($filename === null) { - $success = call_user_func('image'.$format, $this->image); - } else { - $success = call_user_func_array('image'.$format, [$this->image, $filename]); - } - - if ($success === false) { - throw new ImageFunctionFailedException('QRCode: function image'.$format.' failed.'); - } - - return $this; - } - - /** - * Returns the content type corresponding to the image type. - * - * @return string - */ - public function getContentType() - { - $contentType = 'image/'.$this->image_type; - - return $contentType; - } - - /** - * Create QR Code and return its content. - * - * @param string|null $format Image type (gif, png, wbmp, jpeg) - * - * @throws ImageFunctionUnknownException - * @throws ImageFunctionFailedException - * - * @return string - */ - public function get($format = null) - { - $this->create(); - - if ($format == 'jpg') { - $format = 'jpeg'; - } - - if (!in_array($format, $this->image_types_available)) { - $format = $this->image_type; - } - - if (!function_exists('image'.$format)) { - throw new ImageFunctionUnknownException('QRCode: function image'.$format.' does not exists.'); - } - - ob_start(); - $success = call_user_func('image'.$format, $this->image); - - if ($success === false) { - throw new ImageFunctionFailedException('QRCode: function image'.$format.' failed.'); - } - - $content = ob_get_clean(); - - return $content; - } - - /** - * Create the image. - * - * @throws Exceptions\DataDoesntExistsException - * @throws Exceptions\VersionTooLargeException - * @throws Exceptions\ImageSizeTooLargeException - * @throws \OverflowException - */ - public function create() - { - $image_path = $this->image_path; - $path = $this->path; - - $version_ul = 40; - - $qrcode_data_string = $this->text;//Previously from $_GET["d"]; - - $qrcode_error_correct = $this->error_correction;//Previously from $_GET["e"]; - $qrcode_module_size = $this->module_size;//Previously from $_GET["s"]; - $qrcode_version = $this->version;//Previously from $_GET["v"]; - $qrcode_image_type = $this->image_type;//Previously from $_GET["t"]; - - $qrcode_structureappend_n = $this->structure_append_n;//Previously from $_GET["n"]; - $qrcode_structureappend_m = $this->structure_append_m;//Previously from $_GET["m"]; - $qrcode_structureappend_parity = $this->structure_append_parity;//Previously from $_GET["p"]; - $qrcode_structureappend_originaldata = $this->structure_append_original_data;//Previously from $_GET["o"]; - - if ($qrcode_module_size > 0) { - } else { - if ($qrcode_image_type == 'jpeg') { - $qrcode_module_size = 8; - } else { - $qrcode_module_size = 4; - } - } - $data_length = strlen($qrcode_data_string); - if ($data_length <= 0) { - throw new DataDoesntExistsException('QRCode: data does not exist.'); - } - $data_counter = 0; - if ($qrcode_structureappend_n > 1 - && $qrcode_structureappend_n <= 16 - && $qrcode_structureappend_m > 0 - && $qrcode_structureappend_m <= 16) { - $data_value[0] = 3; - $data_bits[0] = 4; - - $data_value[1] = $qrcode_structureappend_m - 1; - $data_bits[1] = 4; - - $data_value[2] = $qrcode_structureappend_n - 1; - $data_bits[2] = 4; - - $originaldata_length = strlen($qrcode_structureappend_originaldata); - if ($originaldata_length > 1) { - $qrcode_structureappend_parity = 0; - $i = 0; - while ($i < $originaldata_length) { - $qrcode_structureappend_parity = ($qrcode_structureappend_parity ^ ord(substr($qrcode_structureappend_originaldata, $i, 1))); - ++$i; - } - } - - $data_value[3] = $qrcode_structureappend_parity; - $data_bits[3] = 8; - - $data_counter = 4; - } - - $data_bits[$data_counter] = 4; - - /* --- determine encode mode */ - - if (preg_match('/[^0-9]/', $qrcode_data_string) != 0) { - if (preg_match("/[^0-9A-Z \$\*\%\+\.\/\:\-]/", $qrcode_data_string) != 0) { - /* --- 8bit byte mode */ - - $codeword_num_plus = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, - 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8]; - - $data_value[$data_counter] = 4; - ++$data_counter; - $data_value[$data_counter] = $data_length; - $data_bits[$data_counter] = 8; /* #version 1-9 */ - $codeword_num_counter_value = $data_counter; - - ++$data_counter; - $i = 0; - while ($i < $data_length) { - $data_value[$data_counter] = ord(substr($qrcode_data_string, $i, 1)); - $data_bits[$data_counter] = 8; - ++$data_counter; - ++$i; - } - } else { - /* ---- alphanumeric mode */ - - $codeword_num_plus = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4]; - - $data_value[$data_counter] = 2; - ++$data_counter; - $data_value[$data_counter] = $data_length; - $data_bits[$data_counter] = 9; /* #version 1-9 */ - $codeword_num_counter_value = $data_counter; - - $alphanumeric_character_hash = ['0' => 0, '1' => 1, '2' => 2, '3' => 3, '4' => 4, - '5' => 5, '6' => 6, '7' => 7, '8' => 8, '9' => 9, 'A' => 10, 'B' => 11, 'C' => 12, 'D' => 13, 'E' => 14, - 'F' => 15, 'G' => 16, 'H' => 17, 'I' => 18, 'J' => 19, 'K' => 20, 'L' => 21, 'M' => 22, 'N' => 23, - 'O' => 24, 'P' => 25, 'Q' => 26, 'R' => 27, 'S' => 28, 'T' => 29, 'U' => 30, 'V' => 31, - 'W' => 32, 'X' => 33, 'Y' => 34, 'Z' => 35, ' ' => 36, '$' => 37, '%' => 38, '*' => 39, - '+' => 40, '-' => 41, '.' => 42, '/' => 43, ':' => 44]; - - $i = 0; - ++$data_counter; - while ($i < $data_length) { - if (($i % 2) == 0) { - $data_value[$data_counter] = $alphanumeric_character_hash[substr($qrcode_data_string, $i, 1)]; - $data_bits[$data_counter] = 6; - } else { - $data_value[$data_counter] = $data_value[$data_counter] * 45 + $alphanumeric_character_hash[substr($qrcode_data_string, $i, 1)]; - $data_bits[$data_counter] = 11; - ++$data_counter; - } - ++$i; - } - } - } else { - /* ---- numeric mode */ - - $codeword_num_plus = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4]; - - $data_value[$data_counter] = 1; - ++$data_counter; - $data_value[$data_counter] = $data_length; - $data_bits[$data_counter] = 10; /* #version 1-9 */ - $codeword_num_counter_value = $data_counter; - - $i = 0; - ++$data_counter; - while ($i < $data_length) { - if (($i % 3) == 0) { - $data_value[$data_counter] = substr($qrcode_data_string, $i, 1); - $data_bits[$data_counter] = 4; - } else { - $data_value[$data_counter] = $data_value[$data_counter] * 10 + substr($qrcode_data_string, $i, 1); - if (($i % 3) == 1) { - $data_bits[$data_counter] = 7; - } else { - $data_bits[$data_counter] = 10; - ++$data_counter; - } - } - ++$i; - } - } - if (array_key_exists($data_counter, $data_bits) && $data_bits[$data_counter] > 0) { - ++$data_counter; - } - $i = 0; - $total_data_bits = 0; - while ($i < $data_counter) { - $total_data_bits += $data_bits[$i]; - ++$i; - } - - $ecc_character_hash = [ - 'L' => '1', - 'l' => '1', - 'M' => '0', - 'm' => '0', - 'Q' => '3', - 'q' => '3', - 'H' => '2', - 'h' => '2', - ]; - - if (!is_numeric($qrcode_error_correct)) { - $ec = @$ecc_character_hash[$qrcode_error_correct]; - } else { - $ec = $qrcode_error_correct; - } - - if (!$ec) { - $ec = 0; - } - - $max_data_bits = 0; - - $max_data_bits_array = [ - 0, 128, 224, 352, 512, 688, 864, 992, 1232, 1456, 1728, - 2032, 2320, 2672, 2920, 3320, 3624, 4056, 4504, 5016, 5352, - 5712, 6256, 6880, 7312, 8000, 8496, 9024, 9544, 10136, 10984, - 11640, 12328, 13048, 13800, 14496, 15312, 15936, 16816, 17728, 18672, - - 152, 272, 440, 640, 864, 1088, 1248, 1552, 1856, 2192, - 2592, 2960, 3424, 3688, 4184, 4712, 5176, 5768, 6360, 6888, - 7456, 8048, 8752, 9392, 10208, 10960, 11744, 12248, 13048, 13880, - 14744, 15640, 16568, 17528, 18448, 19472, 20528, 21616, 22496, 23648, - - 72, 128, 208, 288, 368, 480, 528, 688, 800, 976, - 1120, 1264, 1440, 1576, 1784, 2024, 2264, 2504, 2728, 3080, - 3248, 3536, 3712, 4112, 4304, 4768, 5024, 5288, 5608, 5960, - 6344, 6760, 7208, 7688, 7888, 8432, 8768, 9136, 9776, 10208, - - 104, 176, 272, 384, 496, 608, 704, 880, 1056, 1232, - 1440, 1648, 1952, 2088, 2360, 2600, 2936, 3176, 3560, 3880, - 4096, 4544, 4912, 5312, 5744, 6032, 6464, 6968, 7288, 7880, - 8264, 8920, 9368, 9848, 10288, 10832, 11408, 12016, 12656, 13328 - ]; - if (!is_numeric($qrcode_version)) { - $qrcode_version = 0; - } - if (!$qrcode_version) { - /* #--- auto version select */ - $i = 1 + 40 * $ec; - $j = $i + 39; - $qrcode_version = 1; - while ($i <= $j) { - if (($max_data_bits_array[$i]) >= $total_data_bits + $codeword_num_plus[$qrcode_version]) { - $max_data_bits = $max_data_bits_array[$i]; - break; - } - ++$i; - ++$qrcode_version; - } - } else { - $max_data_bits = $max_data_bits_array[$qrcode_version + 40 * $ec]; - } - if ($qrcode_version > $version_ul) { - throw new VersionTooLargeException('QRCode : version too large'); - } - - $total_data_bits += $codeword_num_plus[$qrcode_version]; - $data_bits[$codeword_num_counter_value] += $codeword_num_plus[$qrcode_version]; - - $max_codewords_array = [0, 26, 44, 70, 100, 134, 172, 196, 242, - 292, 346, 404, 466, 532, 581, 655, 733, 815, 901, 991, 1085, 1156, - 1258, 1364, 1474, 1588, 1706, 1828, 1921, 2051, 2185, 2323, 2465, - 2611, 2761, 2876, 3034, 3196, 3362, 3532, 3706]; - - $max_codewords = $max_codewords_array[$qrcode_version]; - $max_modules_1side = 17 + ($qrcode_version << 2); - - $matrix_remain_bit = [0, 0, 7, 7, 7, 7, 7, 0, 0, 0, 0, 0, 0, 0, 3, 3, 3, 3, 3, 3, 3, - 4, 4, 4, 4, 4, 4, 4, 3, 3, 3, 3, 3, 3, 3, 0, 0, 0, 0, 0, 0]; - - /* ---- read version ECC data file */ - - $byte_num = $matrix_remain_bit[$qrcode_version] + ($max_codewords << 3); - $filename = $path.'/qrv'.$qrcode_version.'_'.$ec.'.dat'; - $fp1 = fopen($filename, 'rb'); - $matx = fread($fp1, $byte_num); - $maty = fread($fp1, $byte_num); - $masks = fread($fp1, $byte_num); - $fi_x = fread($fp1, 15); - $fi_y = fread($fp1, 15); - $rs_ecc_codewords = ord(fread($fp1, 1)); - $rso = fread($fp1, 128); - fclose($fp1); - - $matrix_x_array = unpack('C*', $matx); - $matrix_y_array = unpack('C*', $maty); - $mask_array = unpack('C*', $masks); - - $rs_block_order = unpack('C*', $rso); - - $format_information_x2 = unpack('C*', $fi_x); - $format_information_y2 = unpack('C*', $fi_y); - - $format_information_x1 = [0, 1, 2, 3, 4, 5, 7, 8, 8, 8, 8, 8, 8, 8, 8]; - $format_information_y1 = [8, 8, 8, 8, 8, 8, 8, 8, 7, 5, 4, 3, 2, 1, 0]; - - $max_data_codewords = ($max_data_bits >> 3); - - $filename = $path.'/rsc'.$rs_ecc_codewords.'.dat'; - $fp0 = fopen($filename, 'rb'); - $i = 0; - $rs_cal_table_array = []; - while ($i < 256) { - $rs_cal_table_array[$i] = fread($fp0, $rs_ecc_codewords); - ++$i; - } - fclose($fp0); - - /* --- set terminator */ - - if ($total_data_bits <= $max_data_bits - 4) { - $data_value[$data_counter] = 0; - $data_bits[$data_counter] = 4; - } else { - if ($total_data_bits < $max_data_bits) { - $data_value[$data_counter] = 0; - $data_bits[$data_counter] = $max_data_bits - $total_data_bits; - } else { - if ($total_data_bits > $max_data_bits) { - throw new \OverflowException('QRCode: overflow error'); - } - } - } - - /* ----divide data by 8bit */ - - $i = 0; - $codewords_counter = 0; - $codewords[0] = 0; - $remaining_bits = 8; - - while ($i <= $data_counter) { - $buffer = @$data_value[$i]; - $buffer_bits = @$data_bits[$i]; - - $flag = 1; - while ($flag) { - if ($remaining_bits > $buffer_bits) { - $codewords[$codewords_counter] = ((@$codewords[$codewords_counter] << $buffer_bits) | $buffer); - $remaining_bits -= $buffer_bits; - $flag = 0; - } else { - $buffer_bits -= $remaining_bits; - $codewords[$codewords_counter] = (($codewords[$codewords_counter] << $remaining_bits) | ($buffer >> $buffer_bits)); - - if ($buffer_bits == 0) { - $flag = 0; - } else { - $buffer = ($buffer & ((1 << $buffer_bits) - 1)); - $flag = 1; - } - - ++$codewords_counter; - if ($codewords_counter < $max_data_codewords - 1) { - $codewords[$codewords_counter] = 0; - } - $remaining_bits = 8; - } - } - ++$i; - } - if ($remaining_bits != 8) { - $codewords[$codewords_counter] = $codewords[$codewords_counter] << $remaining_bits; - } else { - --$codewords_counter; - } - - /* ---- set padding character */ - - if ($codewords_counter < $max_data_codewords - 1) { - $flag = 1; - while ($codewords_counter < $max_data_codewords - 1) { - ++$codewords_counter; - if ($flag == 1) { - $codewords[$codewords_counter] = 236; - } else { - $codewords[$codewords_counter] = 17; - } - $flag = $flag * (-1); - } - } - - /* ---- RS-ECC prepare */ - - $i = 0; - $j = 0; - $rs_block_number = 0; - $rs_temp[0] = ''; - - while ($i < $max_data_codewords) { - $rs_temp[$rs_block_number] .= chr($codewords[$i]); - ++$j; - - if ($j >= $rs_block_order[$rs_block_number + 1] - $rs_ecc_codewords) { - $j = 0; - ++$rs_block_number; - $rs_temp[$rs_block_number] = ''; - } - ++$i; - } - - /* - # - # RS-ECC main - # - */ - - $rs_block_number = 0; - $rs_block_order_num = count($rs_block_order); - - while ($rs_block_number < $rs_block_order_num) { - $rs_codewords = $rs_block_order[$rs_block_number + 1]; - $rs_data_codewords = $rs_codewords - $rs_ecc_codewords; - - $rstemp = $rs_temp[$rs_block_number].str_repeat(chr(0), $rs_ecc_codewords); - $padding_data = str_repeat(chr(0), $rs_data_codewords); - - $j = $rs_data_codewords; - while ($j > 0) { - $first = ord(substr($rstemp, 0, 1)); - - if ($first) { - $left_chr = substr($rstemp, 1); - $cal = $rs_cal_table_array[$first].$padding_data; - $rstemp = $left_chr ^ $cal; - } else { - $rstemp = substr($rstemp, 1); - } - - --$j; - } - - $codewords = array_merge($codewords, unpack('C*', $rstemp)); - - ++$rs_block_number; - } - - /* ---- flash matrix */ - $matrix_content = []; - $i = 0; - while ($i < $max_modules_1side) { - $j = 0; - while ($j < $max_modules_1side) { - $matrix_content[$j][$i] = 0; - ++$j; - } - ++$i; - } - - /* --- attach data */ - - $i = 0; - while ($i < $max_codewords) { - $codeword_i = $codewords[$i]; - $j = 8; - while ($j >= 1) { - $codeword_bits_number = ($i << 3) + $j; - $matrix_content[ $matrix_x_array[$codeword_bits_number] ][ $matrix_y_array[$codeword_bits_number] ] = ((255 * ($codeword_i & 1)) ^ $mask_array[$codeword_bits_number]); - $codeword_i = $codeword_i >> 1; - --$j; - } - ++$i; - } - - $matrix_remain = $matrix_remain_bit[$qrcode_version]; - while ($matrix_remain) { - $remain_bit_temp = $matrix_remain + ($max_codewords << 3); - $matrix_content[ $matrix_x_array[$remain_bit_temp] ][ $matrix_y_array[$remain_bit_temp] ] = (255 ^ $mask_array[$remain_bit_temp]); - --$matrix_remain; - } - - #--- mask select - - $min_demerit_score = 0; - $hor_master = ''; - $ver_master = ''; - $k = 0; - while ($k < $max_modules_1side) { - $l = 0; - while ($l < $max_modules_1side) { - $hor_master = $hor_master.chr($matrix_content[$l][$k]); - $ver_master = $ver_master.chr($matrix_content[$k][$l]); - ++$l; - } - ++$k; - } - $i = 0; - $all_matrix = $max_modules_1side * $max_modules_1side; - $mask_number = 0; - while ($i < 8) { - $demerit_n1 = 0; - $ptn_temp = []; - $bit = 1 << $i; - $bit_r = (~$bit) & 255; - $bit_mask = str_repeat(chr($bit), $all_matrix); - $hor = $hor_master & $bit_mask; - $ver = $ver_master & $bit_mask; - - $ver_shift1 = $ver.str_repeat(chr(170), $max_modules_1side); - $ver_shift2 = str_repeat(chr(170), $max_modules_1side).$ver; - $ver_shift1_0 = $ver.str_repeat(chr(0), $max_modules_1side); - $ver_shift2_0 = str_repeat(chr(0), $max_modules_1side).$ver; - $ver_or = chunk_split(~($ver_shift1 | $ver_shift2), $max_modules_1side, chr(170)); - $ver_and = chunk_split(~($ver_shift1_0 & $ver_shift2_0), $max_modules_1side, chr(170)); - - $hor = chunk_split(~$hor, $max_modules_1side, chr(170)); - $ver = chunk_split(~$ver, $max_modules_1side, chr(170)); - $hor = $hor.chr(170).$ver; - - $n1_search = '/'.str_repeat(chr(255), 5).'+|'.str_repeat(chr($bit_r), 5).'+/'; - $n3_search = chr($bit_r).chr(255).chr($bit_r).chr($bit_r).chr($bit_r).chr(255).chr($bit_r); - - $demerit_n3 = substr_count($hor, $n3_search) * 40; - $demerit_n4 = floor(abs(((100 * (substr_count($ver, chr($bit_r)) / ($byte_num))) - 50) / 5)) * 10; - - $n2_search1 = '/'.chr($bit_r).chr($bit_r).'+/'; - $n2_search2 = '/'.chr(255).chr(255).'+/'; - $demerit_n2 = 0; - preg_match_all($n2_search1, $ver_and, $ptn_temp); - foreach ($ptn_temp[0] as $str_temp) { - $demerit_n2 += (strlen($str_temp) - 1); - } - $ptn_temp = []; - preg_match_all($n2_search2, $ver_or, $ptn_temp); - foreach ($ptn_temp[0] as $str_temp) { - $demerit_n2 += (strlen($str_temp) - 1); - } - $demerit_n2 *= 3; - - $ptn_temp = []; - - preg_match_all($n1_search, $hor, $ptn_temp); - foreach ($ptn_temp[0] as $str_temp) { - $demerit_n1 += (strlen($str_temp) - 2); - } - - $demerit_score = $demerit_n1 + $demerit_n2 + $demerit_n3 + $demerit_n4; - - if ($demerit_score <= $min_demerit_score || $i == 0) { - $mask_number = $i; - $min_demerit_score = $demerit_score; - } - - ++$i; - } - - $mask_content = 1 << $mask_number; - - # --- format information - - $format_information_value = (($ec << 3) | $mask_number); - $format_information_array = ['101010000010010', '101000100100101', - '101111001111100', '101101101001011', '100010111111001', '100000011001110', - '100111110010111', '100101010100000', '111011111000100', '111001011110011', - '111110110101010', '111100010011101', '110011000101111', '110001100011000', - '110110001000001', '110100101110110', '001011010001001', '001001110111110', - '001110011100111', '001100111010000', '000011101100010', '000001001010101', - '000110100001100', '000100000111011', '011010101011111', '011000001101000', - '011111100110001', '011101000000110', '010010010110100', '010000110000011', - '010111011011010', '010101111101101']; - $i = 0; - while ($i < 15) { - $content = substr($format_information_array[$format_information_value], $i, 1); - - $matrix_content[$format_information_x1[$i]][$format_information_y1[$i]] = $content * 255; - $matrix_content[$format_information_x2[$i + 1]][$format_information_y2[$i + 1]] = $content * 255; - ++$i; - } - - $mib = $max_modules_1side; - if ($this->draw_quiet_zone) { - $mib += 8; - } - - if ($this->size == 0) { - $this->size = $mib * $qrcode_module_size; - if ($this->size > 1480) { - throw new ImageSizeTooLargeException('QRCode: image size too large'); - } - } - - $image_width = $this->size + $this->padding * 2; - $image_height = $this->size + $this->padding * 2; - - if (!empty($this->label)) { - if (!function_exists('imagettfbbox')) { - throw new FreeTypeLibraryMissingException('QRCode: missing function "imagettfbbox". Did you install the FreeType library?'); - } - $font_box = imagettfbbox($this->label_font_size, 0, $this->label_font_path, $this->label); - $label_width = (int) $font_box[2] - (int) $font_box[0]; - $label_height = (int) $font_box[0] - (int) $font_box[7]; - - if ($this->label_valign == self::LABEL_VALIGN_MIDDLE) { - $image_height += $label_height + $this->padding; - } else { - $image_height += $label_height; - } - } - - $output_image = imagecreate($image_width, $image_height); - imagecolorallocate($output_image, 255, 255, 255); - - $image_path = $image_path.'/qrv'.$qrcode_version.'.png'; - - $base_image = imagecreatefrompng($image_path); - $code_size = $this->size; - $module_size = function ($size = 1) use ($code_size, $base_image) { - return round($code_size / imagesx($base_image) * $size); - }; - - $col[1] = imagecolorallocate($base_image, 0, 0, 0); - $col[0] = imagecolorallocate($base_image, 255, 255, 255); - - $i = 4; - $mxe = 4 + $max_modules_1side; - $ii = 0; - while ($i < $mxe) { - $j = 4; - $jj = 0; - while ($j < $mxe) { - if ($matrix_content[$ii][$jj] & $mask_content) { - imagesetpixel($base_image, $i, $j, $col[1]); - } - ++$j; - ++$jj; - } - ++$i; - ++$ii; - } - - if ($this->draw_quiet_zone == true) { - imagecopyresampled($output_image, $base_image, $this->padding, $this->padding, 0, 0, $this->size, $this->size, $mib, $mib); - } else { - imagecopyresampled($output_image, $base_image, $this->padding, $this->padding, 4, 4, $this->size, $this->size, $mib, $mib); - } - - if ($this->draw_border == true) { - $border_width = $this->padding; - $border_height = $this->size + $this->padding - 1; - $border_color = imagecolorallocate($output_image, 0, 0, 0); - imagerectangle($output_image, $border_width, $border_width, $border_height, $border_height, $border_color); - } - - if (!empty($this->label)) { - // Label horizontal alignment - switch ($this->label_halign) { - case self::LABEL_HALIGN_LEFT: - $font_x = 0; - break; - - case self::LABEL_HALIGN_LEFT_BORDER: - $font_x = $this->padding; - break; - - case self::LABEL_HALIGN_LEFT_CODE: - if ($this->draw_quiet_zone == true) { - $font_x = $this->padding + $module_size(4); - } else { - $font_x = $this->padding; - } - break; - - case self::LABEL_HALIGN_RIGHT: - $font_x = $this->size + ($this->padding * 2) - $label_width; - break; - - case self::LABEL_HALIGN_RIGHT_BORDER: - $font_x = $this->size + $this->padding - $label_width; - break; - - case self::LABEL_HALIGN_RIGHT_CODE: - if ($this->draw_quiet_zone == true) { - $font_x = $this->size + $this->padding - $label_width - $module_size(4); - } else { - $font_x = $this->size + $this->padding - $label_width; - } - break; - - default: - $font_x = floor($image_width - $label_width) / 2; - } - - // Label vertical alignment - switch ($this->label_valign) { - case self::LABEL_VALIGN_TOP_NO_BORDER: - $font_y = $image_height - $this->padding - 1; - break; - - case self::LABEL_VALIGN_BOTTOM: - $font_y = $image_height; - break; - - default: - $font_y = $image_height - $this->padding; - } - - $label_bg_x1 = $font_x - $module_size(2); - $label_bg_y1 = $font_y - $label_height; - $label_bg_x2 = $font_x + $label_width + $module_size(2); - $label_bg_y2 = $font_y; - - $color = imagecolorallocate($output_image, 0, 0, 0); - $label_bg_color = imagecolorallocate($output_image, 255, 255, 255); - - imagefilledrectangle($output_image, $label_bg_x1, $label_bg_y1, $label_bg_x2, $label_bg_y2, $label_bg_color); - imagettftext($output_image, $this->label_font_size, 0, $font_x, $font_y, $color, $this->label_font_path, $this->label); - } - - $imagecolorset_function = new ReflectionFunction('imagecolorset'); - $allow_alpha = $imagecolorset_function->getNumberOfParameters() == 6; - - if ($this->color_background != null) { - $index = imagecolorclosest($output_image, 255, 255, 255); - if ($allow_alpha) { - imagecolorset($output_image, $index, $this->color_background['r'], $this->color_background['g'], $this->color_background['b'], $this->color_background['a']); - } else { - imagecolorset($output_image, $index, $this->color_background['r'], $this->color_background['g'], $this->color_background['b']); - } - } - - if ($this->color_foreground != null) { - $index = imagecolorclosest($output_image, 0, 0, 0); - if ($allow_alpha) { - imagecolorset($output_image, $index, $this->color_foreground['r'], $this->color_foreground['g'], $this->color_foreground['b'], $this->color_foreground['a']); - } else { - imagecolorset($output_image, $index, $this->color_foreground['r'], $this->color_foreground['g'], $this->color_foreground['b']); - } - } - - if (!empty($this->logo)) { - $output_image_org = $output_image; - $output_image = imagecreatetruecolor($image_width, $image_height); - imagecopy($output_image, $output_image_org, 0, 0, 0, 0, $image_width, $image_height); - - $image_info = getimagesize($this->logo); - - if ($image_info !== false) { - $image_type = strtolower(substr(image_type_to_extension($image_info [2]), 1)); - $logo_image = call_user_func('imagecreatefrom'.$image_type, $this->logo); - } else { - $logo_image = call_user_func('imagecreatefrom'.$this->image_type, $this->logo); - } - - if (!$logo_image) { - throw new ImageFunctionFailedException('imagecreatefrom'.$this->image_type.' '.$this->logo.' failed'); - } - $src_w = imagesx($logo_image); - $src_h = imagesy($logo_image); - - $dst_x = ($image_width - $this->logo_size) / 2; - $dst_y = ($this->size + $this->padding * 2 - $this->logo_size) / 2; - - $successful = imagecopyresampled($output_image, $logo_image, $dst_x, $dst_y, 0, 0, $this->logo_size, $this->logo_size, $src_w, $src_h); - if (!$successful) { - throw new ImageFunctionFailedException('add logo [image'.$this->format.'] failed.'); - } - imagedestroy($logo_image); - } - $this->image = $output_image; - } -} diff --git a/conlite/external/phpmailer/phpmailer/COMMITMENT b/conlite/external/phpmailer/phpmailer/COMMITMENT new file mode 100644 index 0000000..a687e0d --- /dev/null +++ b/conlite/external/phpmailer/phpmailer/COMMITMENT @@ -0,0 +1,46 @@ +GPL Cooperation Commitment +Version 1.0 + +Before filing or continuing to prosecute any legal proceeding or claim +(other than a Defensive Action) arising from termination of a Covered +License, we commit to extend to the person or entity ('you') accused +of violating the Covered License the following provisions regarding +cure and reinstatement, taken from GPL version 3. As used here, the +term 'this License' refers to the specific Covered License being +enforced. + + However, if you cease all violation of this License, then your + license from a particular copyright holder is reinstated (a) + provisionally, unless and until the copyright holder explicitly + and finally terminates your license, and (b) permanently, if the + copyright holder fails to notify you of the violation by some + reasonable means prior to 60 days after the cessation. + + Moreover, your license from a particular copyright holder is + reinstated permanently if the copyright holder notifies you of the + violation by some reasonable means, this is the first time you + have received notice of violation of this License (for any work) + from that copyright holder, and you cure the violation prior to 30 + days after your receipt of the notice. + +We intend this Commitment to be irrevocable, and binding and +enforceable against us and assignees of or successors to our +copyrights. + +Definitions + +'Covered License' means the GNU General Public License, version 2 +(GPLv2), the GNU Lesser General Public License, version 2.1 +(LGPLv2.1), or the GNU Library General Public License, version 2 +(LGPLv2), all as published by the Free Software Foundation. + +'Defensive Action' means a legal proceeding or claim that We bring +against you in response to a prior proceeding or claim initiated by +you or your affiliate. + +'We' means each contributor to this repository as of the date of +inclusion of this file, including subsidiaries of a corporate +contributor. + +This work is available under a Creative Commons Attribution-ShareAlike +4.0 International license (https://creativecommons.org/licenses/by-sa/4.0/). diff --git a/conlite/external/phpmailer/phpmailer/PHPMailerAutoload.php b/conlite/external/phpmailer/phpmailer/PHPMailerAutoload.php deleted file mode 100644 index eaa2e30..0000000 --- a/conlite/external/phpmailer/phpmailer/PHPMailerAutoload.php +++ /dev/null @@ -1,49 +0,0 @@ - - * @author Jim Jagielski (jimjag) - * @author Andy Prevost (codeworxtech) - * @author Brent R. Matzelle (original founder) - * @copyright 2012 - 2014 Marcus Bointon - * @copyright 2010 - 2012 Jim Jagielski - * @copyright 2004 - 2009 Andy Prevost - * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License - * @note This program is distributed in the hope that it will be useful - WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. - */ - -/** - * PHPMailer SPL autoloader. - * @param string $classname The name of the class to load - */ -function PHPMailerAutoload($classname) -{ - //Can't use __DIR__ as it's only in PHP 5.3+ - $filename = dirname(__FILE__).DIRECTORY_SEPARATOR.'class.'.strtolower($classname).'.php'; - if (is_readable($filename)) { - require $filename; - } -} - -if (version_compare(PHP_VERSION, '5.1.2', '>=')) { - //SPL autoloading was introduced in PHP 5.1.2 - if (version_compare(PHP_VERSION, '5.3.0', '>=')) { - spl_autoload_register('PHPMailerAutoload', true, true); - } else { - spl_autoload_register('PHPMailerAutoload'); - } -} else { - /** - * Fall back to traditional autoload for old PHP versions - * @param string $classname The name of the class to load - */ - function __autoload($classname) - { - PHPMailerAutoload($classname); - } -} diff --git a/conlite/external/phpmailer/phpmailer/README.md b/conlite/external/phpmailer/phpmailer/README.md new file mode 100644 index 0000000..53e66f1 --- /dev/null +++ b/conlite/external/phpmailer/phpmailer/README.md @@ -0,0 +1,230 @@ +[![SWUbanner](https://raw.githubusercontent.com/vshymanskyy/StandWithUkraine/main/banner2-direct.svg)](https://supportukrainenow.org/) + +![PHPMailer](https://raw.github.com/PHPMailer/PHPMailer/master/examples/images/phpmailer.png) + +# PHPMailer – A full-featured email creation and transfer class for PHP + +[![Test status](https://github.com/PHPMailer/PHPMailer/workflows/Tests/badge.svg)](https://github.com/PHPMailer/PHPMailer/actions) +[![codecov.io](https://codecov.io/gh/PHPMailer/PHPMailer/branch/master/graph/badge.svg?token=iORZpwmYmM)](https://codecov.io/gh/PHPMailer/PHPMailer) +[![Latest Stable Version](https://poser.pugx.org/phpmailer/phpmailer/v/stable.svg)](https://packagist.org/packages/phpmailer/phpmailer) +[![Total Downloads](https://poser.pugx.org/phpmailer/phpmailer/downloads)](https://packagist.org/packages/phpmailer/phpmailer) +[![License](https://poser.pugx.org/phpmailer/phpmailer/license.svg)](https://packagist.org/packages/phpmailer/phpmailer) +[![API Docs](https://github.com/phpmailer/phpmailer/workflows/Docs/badge.svg)](https://phpmailer.github.io/PHPMailer/) +[![OpenSSF Scorecard](https://api.securityscorecards.dev/projects/github.com/PHPMailer/PHPMailer/badge)](https://api.securityscorecards.dev/projects/github.com/PHPMailer/PHPMailer) + +## Features +- Probably the world's most popular code for sending email from PHP! +- Used by many open-source projects: WordPress, Drupal, 1CRM, SugarCRM, Yii, Joomla! and many more +- Integrated SMTP support – send without a local mail server +- Send emails with multiple To, CC, BCC, and Reply-to addresses +- Multipart/alternative emails for mail clients that do not read HTML email +- Add attachments, including inline +- Support for UTF-8 content and 8bit, base64, binary, and quoted-printable encodings +- SMTP authentication with LOGIN, PLAIN, CRAM-MD5, and XOAUTH2 mechanisms over SMTPS and SMTP+STARTTLS transports +- Validates email addresses automatically +- Protects against header injection attacks +- Error messages in over 50 languages! +- DKIM and S/MIME signing support +- Compatible with PHP 5.5 and later, including PHP 8.2 +- Namespaced to prevent name clashes +- Much more! + +## Why you might need it +Many PHP developers need to send email from their code. The only PHP function that supports this directly is [`mail()`](https://www.php.net/manual/en/function.mail.php). However, it does not provide any assistance for making use of popular features such as encryption, authentication, HTML messages, and attachments. + +Formatting email correctly is surprisingly difficult. There are myriad overlapping (and conflicting) standards, requiring tight adherence to horribly complicated formatting and encoding rules – the vast majority of code that you'll find online that uses the `mail()` function directly is just plain wrong, if not unsafe! + +The PHP `mail()` function usually sends via a local mail server, typically fronted by a `sendmail` binary on Linux, BSD, and macOS platforms, however, Windows usually doesn't include a local mail server; PHPMailer's integrated SMTP client allows email sending on all platforms without needing a local mail server. Be aware though, that the `mail()` function should be avoided when possible; it's both faster and [safer](https://exploitbox.io/paper/Pwning-PHP-Mail-Function-For-Fun-And-RCE.html) to use SMTP to localhost. + +*Please* don't be tempted to do it yourself – if you don't use PHPMailer, there are many other excellent libraries that +you should look at before rolling your own. Try [SwiftMailer](https://swiftmailer.symfony.com/) +, [Laminas/Mail](https://docs.laminas.dev/laminas-mail/), [ZetaComponents](https://github.com/zetacomponents/Mail), etc. + +## License +This software is distributed under the [LGPL 2.1](http://www.gnu.org/licenses/lgpl-2.1.html) license, along with the [GPL Cooperation Commitment](https://gplcc.github.io/gplcc/). Please read [LICENSE](https://github.com/PHPMailer/PHPMailer/blob/master/LICENSE) for information on the software availability and distribution. + +## Installation & loading +PHPMailer is available on [Packagist](https://packagist.org/packages/phpmailer/phpmailer) (using semantic versioning), and installation via [Composer](https://getcomposer.org) is the recommended way to install PHPMailer. Just add this line to your `composer.json` file: + +```json +"phpmailer/phpmailer": "^6.8.0" +``` + +or run + +```sh +composer require phpmailer/phpmailer +``` + +Note that the `vendor` folder and the `vendor/autoload.php` script are generated by Composer; they are not part of PHPMailer. + +If you want to use the Gmail XOAUTH2 authentication class, you will also need to add a dependency on the `league/oauth2-client` package in your `composer.json`. + +Alternatively, if you're not using Composer, you +can [download PHPMailer as a zip file](https://github.com/PHPMailer/PHPMailer/archive/master.zip), (note that docs and examples are not included in the zip file), then copy the contents of the PHPMailer folder into one of the `include_path` directories specified in your PHP configuration and load each class file manually: + +```php +SMTPDebug = SMTP::DEBUG_SERVER; //Enable verbose debug output + $mail->isSMTP(); //Send using SMTP + $mail->Host = 'smtp.example.com'; //Set the SMTP server to send through + $mail->SMTPAuth = true; //Enable SMTP authentication + $mail->Username = 'user@example.com'; //SMTP username + $mail->Password = 'secret'; //SMTP password + $mail->SMTPSecure = PHPMailer::ENCRYPTION_SMTPS; //Enable implicit TLS encryption + $mail->Port = 465; //TCP port to connect to; use 587 if you have set `SMTPSecure = PHPMailer::ENCRYPTION_STARTTLS` + + //Recipients + $mail->setFrom('from@example.com', 'Mailer'); + $mail->addAddress('joe@example.net', 'Joe User'); //Add a recipient + $mail->addAddress('ellen@example.com'); //Name is optional + $mail->addReplyTo('info@example.com', 'Information'); + $mail->addCC('cc@example.com'); + $mail->addBCC('bcc@example.com'); + + //Attachments + $mail->addAttachment('/var/tmp/file.tar.gz'); //Add attachments + $mail->addAttachment('/tmp/image.jpg', 'new.jpg'); //Optional name + + //Content + $mail->isHTML(true); //Set email format to HTML + $mail->Subject = 'Here is the subject'; + $mail->Body = 'This is the HTML message body in bold!'; + $mail->AltBody = 'This is the body in plain text for non-HTML mail clients'; + + $mail->send(); + echo 'Message has been sent'; +} catch (Exception $e) { + echo "Message could not be sent. Mailer Error: {$mail->ErrorInfo}"; +} +``` + +You'll find plenty to play with in the [examples](https://github.com/PHPMailer/PHPMailer/tree/master/examples) folder, which covers many common scenarios including sending through Gmail, building contact forms, sending to mailing lists, and more. + +If you are re-using the instance (e.g. when sending to a mailing list), you may need to clear the recipient list to avoid sending duplicate messages. See [the mailing list example](https://github.com/PHPMailer/PHPMailer/blob/master/examples/mailing_list.phps) for further guidance. + +That's it. You should now be ready to use PHPMailer! + +## Localization +PHPMailer defaults to English, but in the [language](https://github.com/PHPMailer/PHPMailer/tree/master/language/) folder, you'll find many translations for PHPMailer error messages that you may encounter. Their filenames contain [ISO 639-1](http://en.wikipedia.org/wiki/ISO_639-1) language code for the translations, for example `fr` for French. To specify a language, you need to tell PHPMailer which one to use, like this: + +```php +//To load the French version +$mail->setLanguage('fr', '/optional/path/to/language/directory/'); +``` + +We welcome corrections and new languages – if you're looking for corrections, run the [PHPMailerLangTest.php](https://github.com/PHPMailer/PHPMailer/tree/master/test/PHPMailerLangTest.php) script in the tests folder and it will show any missing translations. + +## Documentation +Start reading at the [GitHub wiki](https://github.com/PHPMailer/PHPMailer/wiki). If you're having trouble, head for [the troubleshooting guide](https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting) as it's frequently updated. + +Examples of how to use PHPMailer for common scenarios can be found in the [examples](https://github.com/PHPMailer/PHPMailer/tree/master/examples) folder. If you're looking for a good starting point, we recommend you start with [the Gmail example](https://github.com/PHPMailer/PHPMailer/tree/master/examples/gmail.phps). + +To reduce PHPMailer's deployed code footprint, examples are not included if you load PHPMailer via Composer or via [GitHub's zip file download](https://github.com/PHPMailer/PHPMailer/archive/master.zip), so you'll need to either clone the git repository or use the above links to get to the examples directly. + +Complete generated API documentation is [available online](https://phpmailer.github.io/PHPMailer/). + +You can generate complete API-level documentation by running `phpdoc` in the top-level folder, and documentation will appear in the `docs` folder, though you'll need to have [PHPDocumentor](http://www.phpdoc.org) installed. You may find [the unit tests](https://github.com/PHPMailer/PHPMailer/blob/master/test/PHPMailerTest.php) a good reference for how to do various operations such as encryption. + +If the documentation doesn't cover what you need, search the [many questions on Stack Overflow](http://stackoverflow.com/questions/tagged/phpmailer), and before you ask a question about "SMTP Error: Could not connect to SMTP host.", [read the troubleshooting guide](https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting). + +## Tests +[PHPMailer tests](https://github.com/PHPMailer/PHPMailer/tree/master/test/) use PHPUnit 9, with [a polyfill](https://github.com/Yoast/PHPUnit-Polyfills) to let 9-style tests run on older PHPUnit and PHP versions. + +[![Test status](https://github.com/PHPMailer/PHPMailer/workflows/Tests/badge.svg)](https://github.com/PHPMailer/PHPMailer/actions) + +If this isn't passing, is there something you can do to help? + +## Security +Please disclose any vulnerabilities found responsibly – report security issues to the maintainers privately. + +See [SECURITY](https://github.com/PHPMailer/PHPMailer/tree/master/SECURITY.md) and [PHPMailer's security advisories on GitHub](https://github.com/PHPMailer/PHPMailer/security). + +## Contributing +Please submit bug reports, suggestions, and pull requests to the [GitHub issue tracker](https://github.com/PHPMailer/PHPMailer/issues). + +We're particularly interested in fixing edge cases, expanding test coverage, and updating translations. + +If you found a mistake in the docs, or want to add something, go ahead and amend the wiki – anyone can edit it. + +If you have git clones from prior to the move to the PHPMailer GitHub organisation, you'll need to update any remote URLs referencing the old GitHub location with a command like this from within your clone: + +```sh +git remote set-url upstream https://github.com/PHPMailer/PHPMailer.git +``` + +Please *don't* use the SourceForge or Google Code projects any more; they are obsolete and no longer maintained. + +## Sponsorship +Development time and resources for PHPMailer are provided by [Smartmessages.net](https://info.smartmessages.net/), the world's only privacy-first email marketing system. + +Smartmessages.net privacy-first email marketing logo + +Donations are very welcome, whether in beer 🍺, T-shirts 👕, or cold, hard cash 💰. Sponsorship through GitHub is a simple and convenient way to say "thank you" to PHPMailer's maintainers and contributors – just click the "Sponsor" button [on the project page](https://github.com/PHPMailer/PHPMailer). If your company uses PHPMailer, consider taking part in Tidelift's enterprise support programme. + +## PHPMailer For Enterprise + +Available as part of the Tidelift Subscription. + +The maintainers of PHPMailer and thousands of other packages are working with Tidelift to deliver commercial +support and maintenance for the open-source packages you use to build your applications. Save time, reduce risk, and +improve code health, while paying the maintainers of the exact packages you +use. [Learn more.](https://tidelift.com/subscription/pkg/packagist-phpmailer-phpmailer?utm_source=packagist-phpmailer-phpmailer&utm_medium=referral&utm_campaign=enterprise&utm_term=repo) + +## Changelog +See [changelog](changelog.md). + +## History +- PHPMailer was originally written in 2001 by Brent R. Matzelle as a [SourceForge project](http://sourceforge.net/projects/phpmailer/). +- [Marcus Bointon](https://github.com/Synchro) (`coolbru` on SF) and Andy Prevost (`codeworxtech`) took over the project in 2004. +- Became an Apache incubator project on Google Code in 2010, managed by Jim Jagielski. +- Marcus created [his fork on GitHub](https://github.com/Synchro/PHPMailer) in 2008. +- Jim and Marcus decide to join forces and use GitHub as the canonical and official repo for PHPMailer in 2013. +- PHPMailer moves to [the PHPMailer organisation](https://github.com/PHPMailer) on GitHub in 2013. + +### What's changed since moving from SourceForge? +- Official successor to the SourceForge and Google Code projects. +- Test suite. +- Continuous integration with GitHub Actions. +- Composer support. +- Public development. +- Additional languages and language strings. +- CRAM-MD5 authentication support. +- Preserves full repo history of authors, commits, and branches from the original SourceForge project. diff --git a/conlite/external/phpmailer/phpmailer/SECURITY.md b/conlite/external/phpmailer/phpmailer/SECURITY.md new file mode 100644 index 0000000..035a87f --- /dev/null +++ b/conlite/external/phpmailer/phpmailer/SECURITY.md @@ -0,0 +1,37 @@ +# Security notices relating to PHPMailer + +Please disclose any security issues or vulnerabilities found through [Tidelift's coordinated disclosure system](https://tidelift.com/security) or to the maintainers privately. + +PHPMailer 6.4.1 and earlier contain a vulnerability that can result in untrusted code being called (if such code is injected into the host project's scope by other means). If the `$patternselect` parameter to `validateAddress()` is set to `'php'` (the default, defined by `PHPMailer::$validator`), and the global namespace contains a function called `php`, it will be called in preference to the built-in validator of the same name. Mitigated in PHPMailer 6.5.0 by denying the use of simple strings as validator function names. Recorded as [CVE-2021-3603](https://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2021-3603). Reported by [Vikrant Singh Chauhan](mailto:vi@hackberry.xyz) via [huntr.dev](https://www.huntr.dev/). + +PHPMailer versions 6.4.1 and earlier contain a possible remote code execution vulnerability through the `$lang_path` parameter of the `setLanguage()` method. If the `$lang_path` parameter is passed unfiltered from user input, it can be set to [a UNC path](https://docs.microsoft.com/en-us/dotnet/standard/io/file-path-formats#unc-paths), and if an attacker is also able to persuade the server to load a file from that UNC path, a script file under their control may be executed. This vulnerability only applies to systems that resolve UNC paths, typically only Microsoft Windows. +PHPMailer 6.5.0 mitigates this by no longer treating translation files as PHP code, but by parsing their text content directly. This approach avoids the possibility of executing unknown code while retaining backward compatibility. This isn't ideal, so the current translation format is deprecated and will be replaced in the next major release. Recorded as [CVE-2021-34551](https://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2021-34551). Reported by [Jilin Diting Information Technology Co., Ltd](https://listensec.com) via Tidelift. + +PHPMailer versions between 6.1.8 and 6.4.0 contain a regression of the earlier CVE-2018-19296 object injection vulnerability as a result of [a fix for Windows UNC paths in 6.1.8](https://github.com/PHPMailer/PHPMailer/commit/e2e07a355ee8ff36aba21d0242c5950c56e4c6f9). Recorded as [CVE-2020-36326](https://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2020-36326). Reported by Fariskhi Vidyan via Tidelift. 6.4.1 fixes this issue, and also enforces stricter checks for URL schemes in local path contexts. + +PHPMailer versions 6.1.5 and earlier contain an output escaping bug that occurs in `Content-Type` and `Content-Disposition` when filenames passed into `addAttachment` and other methods that accept attachment names contain double quote characters, in contravention of RFC822 3.4.1. No specific vulnerability has been found relating to this, but it could allow file attachments to bypass attachment filters that are based on matching filename extensions. Recorded as [CVE-2020-13625](https://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2020-13625). Reported by Elar Lang of Clarified Security. + +PHPMailer versions prior to 6.0.6 and 5.2.27 are vulnerable to an object injection attack by passing `phar://` paths into `addAttachment()` and other functions that may receive unfiltered local paths, possibly leading to RCE. Recorded as [CVE-2018-19296](https://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2018-19296). See [this article](https://knasmueller.net/5-answers-about-php-phar-exploitation) for more info on this type of vulnerability. Mitigated by blocking the use of paths containing URL-protocol style prefixes such as `phar://`. Reported by Sehun Oh of cyberone.kr. + +PHPMailer versions prior to 5.2.24 (released July 26th 2017) have an XSS vulnerability in one of the code examples, [CVE-2017-11503](https://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2017-11503). The `code_generator.phps` example did not filter user input prior to output. This file is distributed with a `.phps` extension, so it it not normally executable unless it is explicitly renamed, and the file is not included when PHPMailer is loaded through composer, so it is safe by default. There was also an undisclosed potential XSS vulnerability in the default exception handler (unused by default). Patches for both issues kindly provided by Patrick Monnerat of the Fedora Project. + +PHPMailer versions prior to 5.2.22 (released January 9th 2017) have a local file disclosure vulnerability, [CVE-2017-5223](https://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2017-5223). If content passed into `msgHTML()` is sourced from unfiltered user input, relative paths can map to absolute local file paths and added as attachments. Also note that `addAttachment` (just like `file_get_contents`, `passthru`, `unlink`, etc) should not be passed user-sourced params either! Reported by Yongxiang Li of Asiasecurity. + +PHPMailer versions prior to 5.2.20 (released December 28th 2016) are vulnerable to [CVE-2016-10045](https://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2016-10045) a remote code execution vulnerability, responsibly reported by [Dawid Golunski](https://legalhackers.com/advisories/PHPMailer-Exploit-Remote-Code-Exec-CVE-2016-10045-Vuln-Patch-Bypass.html), and patched by Paul Buonopane (@Zenexer). + +PHPMailer versions prior to 5.2.18 (released December 2016) are vulnerable to [CVE-2016-10033](https://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2016-10033) a remote code execution vulnerability, responsibly reported by [Dawid Golunski](http://legalhackers.com/advisories/PHPMailer-Exploit-Remote-Code-Exec-CVE-2016-10033-Vuln.html). + +PHPMailer versions prior to 5.2.14 (released November 2015) are vulnerable to [CVE-2015-8476](https://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2015-8476) an SMTP CRLF injection bug permitting arbitrary message sending. + +PHPMailer versions prior to 5.2.10 (released May 2015) are vulnerable to [CVE-2008-5619](https://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2008-5619), a remote code execution vulnerability in the bundled html2text library. This file was removed in 5.2.10, so if you are using a version prior to that and make use of the html2text function, it's vitally important that you upgrade and remove this file. + +PHPMailer versions prior to 2.0.7 and 2.2.1 are vulnerable to [CVE-2012-0796](https://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2012-0796), an email header injection attack. + +Joomla 1.6.0 uses PHPMailer in an unsafe way, allowing it to reveal local file paths, reported in [CVE-2011-3747](https://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2011-3747). + +PHPMailer didn't sanitise the `$lang_path` parameter in `SetLanguage`. This wasn't a problem in itself, but some apps (PHPClassifieds, ATutor) also failed to sanitise user-provided parameters passed to it, permitting semi-arbitrary local file inclusion, reported in [CVE-2010-4914](https://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2010-4914), [CVE-2007-2021](https://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2007-2021) and [CVE-2006-5734](https://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2006-5734). + +PHPMailer 1.7.2 and earlier contained a possible DDoS vulnerability reported in [CVE-2005-1807](https://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2005-1807). + +PHPMailer 1.7 and earlier (June 2003) have a possible vulnerability in the `SendmailSend` method where shell commands may not be sanitised. Reported in [CVE-2007-3215](https://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2007-3215). + diff --git a/conlite/external/phpmailer/phpmailer/VERSION b/conlite/external/phpmailer/phpmailer/VERSION index e25a447..8a1c5c7 100644 --- a/conlite/external/phpmailer/phpmailer/VERSION +++ b/conlite/external/phpmailer/phpmailer/VERSION @@ -1 +1 @@ -5.2.28 \ No newline at end of file +6.8.0 \ No newline at end of file diff --git a/conlite/external/phpmailer/phpmailer/class.phpmailer.php b/conlite/external/phpmailer/phpmailer/class.phpmailer.php deleted file mode 100644 index abb6796..0000000 --- a/conlite/external/phpmailer/phpmailer/class.phpmailer.php +++ /dev/null @@ -1,4064 +0,0 @@ - - * @author Jim Jagielski (jimjag) - * @author Andy Prevost (codeworxtech) - * @author Brent R. Matzelle (original founder) - * @copyright 2012 - 2014 Marcus Bointon - * @copyright 2010 - 2012 Jim Jagielski - * @copyright 2004 - 2009 Andy Prevost - * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License - * @note This program is distributed in the hope that it will be useful - WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. - */ - -/** - * PHPMailer - PHP email creation and transport class. - * @package PHPMailer - * @author Marcus Bointon (Synchro/coolbru) - * @author Jim Jagielski (jimjag) - * @author Andy Prevost (codeworxtech) - * @author Brent R. Matzelle (original founder) - */ -class PHPMailer -{ - /** - * The PHPMailer Version number. - * @var string - */ - public $Version = '5.2.28'; - - /** - * Email priority. - * Options: null (default), 1 = High, 3 = Normal, 5 = low. - * When null, the header is not set at all. - * @var integer - */ - public $Priority = null; - - /** - * The character set of the message. - * @var string - */ - public $CharSet = 'iso-8859-1'; - - /** - * The MIME Content-type of the message. - * @var string - */ - public $ContentType = 'text/plain'; - - /** - * The message encoding. - * Options: "8bit", "7bit", "binary", "base64", and "quoted-printable". - * @var string - */ - public $Encoding = '8bit'; - - /** - * Holds the most recent mailer error message. - * @var string - */ - public $ErrorInfo = ''; - - /** - * The From email address for the message. - * @var string - */ - public $From = 'root@localhost'; - - /** - * The From name of the message. - * @var string - */ - public $FromName = 'Root User'; - - /** - * The Sender email (Return-Path) of the message. - * If not empty, will be sent via -f to sendmail or as 'MAIL FROM' in smtp mode. - * @var string - */ - public $Sender = ''; - - /** - * The Return-Path of the message. - * If empty, it will be set to either From or Sender. - * @var string - * @deprecated Email senders should never set a return-path header; - * it's the receiver's job (RFC5321 section 4.4), so this no longer does anything. - * @link https://tools.ietf.org/html/rfc5321#section-4.4 RFC5321 reference - */ - public $ReturnPath = ''; - - /** - * The Subject of the message. - * @var string - */ - public $Subject = ''; - - /** - * An HTML or plain text message body. - * If HTML then call isHTML(true). - * @var string - */ - public $Body = ''; - - /** - * The plain-text message body. - * This body can be read by mail clients that do not have HTML email - * capability such as mutt & Eudora. - * Clients that can read HTML will view the normal Body. - * @var string - */ - public $AltBody = ''; - - /** - * An iCal message part body. - * Only supported in simple alt or alt_inline message types - * To generate iCal events, use the bundled extras/EasyPeasyICS.php class or iCalcreator - * @link http://sprain.ch/blog/downloads/php-class-easypeasyics-create-ical-files-with-php/ - * @link http://kigkonsult.se/iCalcreator/ - * @var string - */ - public $Ical = ''; - - /** - * The complete compiled MIME message body. - * @access protected - * @var string - */ - protected $MIMEBody = ''; - - /** - * The complete compiled MIME message headers. - * @var string - * @access protected - */ - protected $MIMEHeader = ''; - - /** - * Extra headers that createHeader() doesn't fold in. - * @var string - * @access protected - */ - protected $mailHeader = ''; - - /** - * Word-wrap the message body to this number of chars. - * Set to 0 to not wrap. A useful value here is 78, for RFC2822 section 2.1.1 compliance. - * @var integer - */ - public $WordWrap = 0; - - /** - * Which method to use to send mail. - * Options: "mail", "sendmail", or "smtp". - * @var string - */ - public $Mailer = 'mail'; - - /** - * The path to the sendmail program. - * @var string - */ - public $Sendmail = '/usr/sbin/sendmail'; - - /** - * Whether mail() uses a fully sendmail-compatible MTA. - * One which supports sendmail's "-oi -f" options. - * @var boolean - */ - public $UseSendmailOptions = true; - - /** - * Path to PHPMailer plugins. - * Useful if the SMTP class is not in the PHP include path. - * @var string - * @deprecated Should not be needed now there is an autoloader. - */ - public $PluginDir = ''; - - /** - * The email address that a reading confirmation should be sent to, also known as read receipt. - * @var string - */ - public $ConfirmReadingTo = ''; - - /** - * The hostname to use in the Message-ID header and as default HELO string. - * If empty, PHPMailer attempts to find one with, in order, - * $_SERVER['SERVER_NAME'], gethostname(), php_uname('n'), or the value - * 'localhost.localdomain'. - * @var string - */ - public $Hostname = ''; - - /** - * An ID to be used in the Message-ID header. - * If empty, a unique id will be generated. - * You can set your own, but it must be in the format "", - * as defined in RFC5322 section 3.6.4 or it will be ignored. - * @see https://tools.ietf.org/html/rfc5322#section-3.6.4 - * @var string - */ - public $MessageID = ''; - - /** - * The message Date to be used in the Date header. - * If empty, the current date will be added. - * @var string - */ - public $MessageDate = ''; - - /** - * SMTP hosts. - * Either a single hostname or multiple semicolon-delimited hostnames. - * You can also specify a different port - * for each host by using this format: [hostname:port] - * (e.g. "smtp1.example.com:25;smtp2.example.com"). - * You can also specify encryption type, for example: - * (e.g. "tls://smtp1.example.com:587;ssl://smtp2.example.com:465"). - * Hosts will be tried in order. - * @var string - */ - public $Host = 'localhost'; - - /** - * The default SMTP server port. - * @var integer - * @TODO Why is this needed when the SMTP class takes care of it? - */ - public $Port = 25; - - /** - * The SMTP HELO of the message. - * Default is $Hostname. If $Hostname is empty, PHPMailer attempts to find - * one with the same method described above for $Hostname. - * @var string - * @see PHPMailer::$Hostname - */ - public $Helo = ''; - - /** - * What kind of encryption to use on the SMTP connection. - * Options: '', 'ssl' or 'tls' - * @var string - */ - public $SMTPSecure = ''; - - /** - * Whether to enable TLS encryption automatically if a server supports it, - * even if `SMTPSecure` is not set to 'tls'. - * Be aware that in PHP >= 5.6 this requires that the server's certificates are valid. - * @var boolean - */ - public $SMTPAutoTLS = true; - - /** - * Whether to use SMTP authentication. - * Uses the Username and Password properties. - * @var boolean - * @see PHPMailer::$Username - * @see PHPMailer::$Password - */ - public $SMTPAuth = false; - - /** - * Options array passed to stream_context_create when connecting via SMTP. - * @var array - */ - public $SMTPOptions = array(); - - /** - * SMTP username. - * @var string - */ - public $Username = ''; - - /** - * SMTP password. - * @var string - */ - public $Password = ''; - - /** - * SMTP auth type. - * Options are CRAM-MD5, LOGIN, PLAIN, NTLM, XOAUTH2, attempted in that order if not specified - * @var string - */ - public $AuthType = ''; - - /** - * SMTP realm. - * Used for NTLM auth - * @var string - */ - public $Realm = ''; - - /** - * SMTP workstation. - * Used for NTLM auth - * @var string - */ - public $Workstation = ''; - - /** - * The SMTP server timeout in seconds. - * Default of 5 minutes (300sec) is from RFC2821 section 4.5.3.2 - * @var integer - */ - public $Timeout = 300; - - /** - * SMTP class debug output mode. - * Debug output level. - * Options: - * * `0` No output - * * `1` Commands - * * `2` Data and commands - * * `3` As 2 plus connection status - * * `4` Low-level data output - * @var integer - * @see SMTP::$do_debug - */ - public $SMTPDebug = 0; - - /** - * How to handle debug output. - * Options: - * * `echo` Output plain-text as-is, appropriate for CLI - * * `html` Output escaped, line breaks converted to `
`, appropriate for browser output - * * `error_log` Output to error log as configured in php.ini - * - * Alternatively, you can provide a callable expecting two params: a message string and the debug level: - * - * $mail->Debugoutput = function($str, $level) {echo "debug level $level; message: $str";}; - * - * @var string|callable - * @see SMTP::$Debugoutput - */ - public $Debugoutput = 'echo'; - - /** - * Whether to keep SMTP connection open after each message. - * If this is set to true then to close the connection - * requires an explicit call to smtpClose(). - * @var boolean - */ - public $SMTPKeepAlive = false; - - /** - * Whether to split multiple to addresses into multiple messages - * or send them all in one message. - * Only supported in `mail` and `sendmail` transports, not in SMTP. - * @var boolean - */ - public $SingleTo = false; - - /** - * Storage for addresses when SingleTo is enabled. - * @var array - * @TODO This should really not be public - */ - public $SingleToArray = array(); - - /** - * Whether to generate VERP addresses on send. - * Only applicable when sending via SMTP. - * @link https://en.wikipedia.org/wiki/Variable_envelope_return_path - * @link http://www.postfix.org/VERP_README.html Postfix VERP info - * @var boolean - */ - public $do_verp = false; - - /** - * Whether to allow sending messages with an empty body. - * @var boolean - */ - public $AllowEmpty = false; - - /** - * The default line ending. - * @note The default remains "\n". We force CRLF where we know - * it must be used via self::CRLF. - * @var string - */ - public $LE = "\n"; - - /** - * DKIM selector. - * @var string - */ - public $DKIM_selector = ''; - - /** - * DKIM Identity. - * Usually the email address used as the source of the email. - * @var string - */ - public $DKIM_identity = ''; - - /** - * DKIM passphrase. - * Used if your key is encrypted. - * @var string - */ - public $DKIM_passphrase = ''; - - /** - * DKIM signing domain name. - * @example 'example.com' - * @var string - */ - public $DKIM_domain = ''; - - /** - * DKIM private key file path. - * @var string - */ - public $DKIM_private = ''; - - /** - * DKIM private key string. - * If set, takes precedence over `$DKIM_private`. - * @var string - */ - public $DKIM_private_string = ''; - - /** - * Callback Action function name. - * - * The function that handles the result of the send email action. - * It is called out by send() for each email sent. - * - * Value can be any php callable: http://www.php.net/is_callable - * - * Parameters: - * boolean $result result of the send action - * array $to email addresses of the recipients - * array $cc cc email addresses - * array $bcc bcc email addresses - * string $subject the subject - * string $body the email body - * string $from email address of sender - * @var string - */ - public $action_function = ''; - - /** - * What to put in the X-Mailer header. - * Options: An empty string for PHPMailer default, whitespace for none, or a string to use - * @var string - */ - public $XMailer = ''; - - /** - * Which validator to use by default when validating email addresses. - * May be a callable to inject your own validator, but there are several built-in validators. - * @see PHPMailer::validateAddress() - * @var string|callable - * @static - */ - public static $validator = 'auto'; - - /** - * An instance of the SMTP sender class. - * @var SMTP - * @access protected - */ - protected $smtp = null; - - /** - * The array of 'to' names and addresses. - * @var array - * @access protected - */ - protected $to = array(); - - /** - * The array of 'cc' names and addresses. - * @var array - * @access protected - */ - protected $cc = array(); - - /** - * The array of 'bcc' names and addresses. - * @var array - * @access protected - */ - protected $bcc = array(); - - /** - * The array of reply-to names and addresses. - * @var array - * @access protected - */ - protected $ReplyTo = array(); - - /** - * An array of all kinds of addresses. - * Includes all of $to, $cc, $bcc - * @var array - * @access protected - * @see PHPMailer::$to @see PHPMailer::$cc @see PHPMailer::$bcc - */ - protected $all_recipients = array(); - - /** - * An array of names and addresses queued for validation. - * In send(), valid and non duplicate entries are moved to $all_recipients - * and one of $to, $cc, or $bcc. - * This array is used only for addresses with IDN. - * @var array - * @access protected - * @see PHPMailer::$to @see PHPMailer::$cc @see PHPMailer::$bcc - * @see PHPMailer::$all_recipients - */ - protected $RecipientsQueue = array(); - - /** - * An array of reply-to names and addresses queued for validation. - * In send(), valid and non duplicate entries are moved to $ReplyTo. - * This array is used only for addresses with IDN. - * @var array - * @access protected - * @see PHPMailer::$ReplyTo - */ - protected $ReplyToQueue = array(); - - /** - * The array of attachments. - * @var array - * @access protected - */ - protected $attachment = array(); - - /** - * The array of custom headers. - * @var array - * @access protected - */ - protected $CustomHeader = array(); - - /** - * The most recent Message-ID (including angular brackets). - * @var string - * @access protected - */ - protected $lastMessageID = ''; - - /** - * The message's MIME type. - * @var string - * @access protected - */ - protected $message_type = ''; - - /** - * The array of MIME boundary strings. - * @var array - * @access protected - */ - protected $boundary = array(); - - /** - * The array of available languages. - * @var array - * @access protected - */ - protected $language = array(); - - /** - * The number of errors encountered. - * @var integer - * @access protected - */ - protected $error_count = 0; - - /** - * The S/MIME certificate file path. - * @var string - * @access protected - */ - protected $sign_cert_file = ''; - - /** - * The S/MIME key file path. - * @var string - * @access protected - */ - protected $sign_key_file = ''; - - /** - * The optional S/MIME extra certificates ("CA Chain") file path. - * @var string - * @access protected - */ - protected $sign_extracerts_file = ''; - - /** - * The S/MIME password for the key. - * Used only if the key is encrypted. - * @var string - * @access protected - */ - protected $sign_key_pass = ''; - - /** - * Whether to throw exceptions for errors. - * @var boolean - * @access protected - */ - protected $exceptions = false; - - /** - * Unique ID used for message ID and boundaries. - * @var string - * @access protected - */ - protected $uniqueid = ''; - - /** - * Error severity: message only, continue processing. - */ - const STOP_MESSAGE = 0; - - /** - * Error severity: message, likely ok to continue processing. - */ - const STOP_CONTINUE = 1; - - /** - * Error severity: message, plus full stop, critical error reached. - */ - const STOP_CRITICAL = 2; - - /** - * SMTP RFC standard line ending. - */ - const CRLF = "\r\n"; - - /** - * The maximum line length allowed by RFC 2822 section 2.1.1 - * @var integer - */ - const MAX_LINE_LENGTH = 998; - - /** - * Constructor. - * @param boolean $exceptions Should we throw external exceptions? - */ - public function __construct($exceptions = null) - { - if ($exceptions !== null) { - $this->exceptions = (boolean)$exceptions; - } - //Pick an appropriate debug output format automatically - $this->Debugoutput = (strpos(PHP_SAPI, 'cli') !== false ? 'echo' : 'html'); - } - - /** - * Destructor. - */ - public function __destruct() - { - //Close any open SMTP connection nicely - $this->smtpClose(); - } - - /** - * Call mail() in a safe_mode-aware fashion. - * Also, unless sendmail_path points to sendmail (or something that - * claims to be sendmail), don't pass params (not a perfect fix, - * but it will do) - * @param string $to To - * @param string $subject Subject - * @param string $body Message Body - * @param string $header Additional Header(s) - * @param string $params Params - * @access private - * @return boolean - */ - private function mailPassthru($to, $subject, $body, $header, $params) - { - //Check overloading of mail function to avoid double-encoding - if (ini_get('mbstring.func_overload') & 1) { - $subject = $this->secureHeader($subject); - } else { - $subject = $this->encodeHeader($this->secureHeader($subject)); - } - - //Can't use additional_parameters in safe_mode, calling mail() with null params breaks - //@link http://php.net/manual/en/function.mail.php - if (ini_get('safe_mode') or !$this->UseSendmailOptions or is_null($params)) { - $result = @mail($to, $subject, $body, $header); - } else { - $result = @mail($to, $subject, $body, $header, $params); - } - return $result; - } - /** - * Output debugging info via user-defined method. - * Only generates output if SMTP debug output is enabled (@see SMTP::$do_debug). - * @see PHPMailer::$Debugoutput - * @see PHPMailer::$SMTPDebug - * @param string $str - */ - protected function edebug($str) - { - if ($this->SMTPDebug <= 0) { - return; - } - //Avoid clash with built-in function names - if (!in_array($this->Debugoutput, array('error_log', 'html', 'echo')) and is_callable($this->Debugoutput)) { - call_user_func($this->Debugoutput, $str, $this->SMTPDebug); - return; - } - switch ($this->Debugoutput) { - case 'error_log': - //Don't output, just log - error_log($str); - break; - case 'html': - //Cleans up output a bit for a better looking, HTML-safe output - echo htmlentities( - preg_replace('/[\r\n]+/', '', $str), - ENT_QUOTES, - 'UTF-8' - ) - . "
\n"; - break; - case 'echo': - default: - //Normalize line breaks - $str = preg_replace('/\r\n?/ms', "\n", $str); - echo gmdate('Y-m-d H:i:s') . "\t" . str_replace( - "\n", - "\n \t ", - trim($str) - ) . "\n"; - } - } - - /** - * Sets message type to HTML or plain. - * @param boolean $isHtml True for HTML mode. - * @return void - */ - public function isHTML($isHtml = true) - { - if ($isHtml) { - $this->ContentType = 'text/html'; - } else { - $this->ContentType = 'text/plain'; - } - } - - /** - * Send messages using SMTP. - * @return void - */ - public function isSMTP() - { - $this->Mailer = 'smtp'; - } - - /** - * Send messages using PHP's mail() function. - * @return void - */ - public function isMail() - { - $this->Mailer = 'mail'; - } - - /** - * Send messages using $Sendmail. - * @return void - */ - public function isSendmail() - { - $ini_sendmail_path = ini_get('sendmail_path'); - - if (!stristr($ini_sendmail_path, 'sendmail')) { - $this->Sendmail = '/usr/sbin/sendmail'; - } else { - $this->Sendmail = $ini_sendmail_path; - } - $this->Mailer = 'sendmail'; - } - - /** - * Send messages using qmail. - * @return void - */ - public function isQmail() - { - $ini_sendmail_path = ini_get('sendmail_path'); - - if (!stristr($ini_sendmail_path, 'qmail')) { - $this->Sendmail = '/var/qmail/bin/qmail-inject'; - } else { - $this->Sendmail = $ini_sendmail_path; - } - $this->Mailer = 'qmail'; - } - - /** - * Add a "To" address. - * @param string $address The email address to send to - * @param string $name - * @return boolean true on success, false if address already used or invalid in some way - */ - public function addAddress($address, $name = '') - { - return $this->addOrEnqueueAnAddress('to', $address, $name); - } - - /** - * Add a "CC" address. - * @note: This function works with the SMTP mailer on win32, not with the "mail" mailer. - * @param string $address The email address to send to - * @param string $name - * @return boolean true on success, false if address already used or invalid in some way - */ - public function addCC($address, $name = '') - { - return $this->addOrEnqueueAnAddress('cc', $address, $name); - } - - /** - * Add a "BCC" address. - * @note: This function works with the SMTP mailer on win32, not with the "mail" mailer. - * @param string $address The email address to send to - * @param string $name - * @return boolean true on success, false if address already used or invalid in some way - */ - public function addBCC($address, $name = '') - { - return $this->addOrEnqueueAnAddress('bcc', $address, $name); - } - - /** - * Add a "Reply-To" address. - * @param string $address The email address to reply to - * @param string $name - * @return boolean true on success, false if address already used or invalid in some way - */ - public function addReplyTo($address, $name = '') - { - return $this->addOrEnqueueAnAddress('Reply-To', $address, $name); - } - - /** - * Add an address to one of the recipient arrays or to the ReplyTo array. Because PHPMailer - * can't validate addresses with an IDN without knowing the PHPMailer::$CharSet (that can still - * be modified after calling this function), addition of such addresses is delayed until send(). - * Addresses that have been added already return false, but do not throw exceptions. - * @param string $kind One of 'to', 'cc', 'bcc', or 'ReplyTo' - * @param string $address The email address to send, resp. to reply to - * @param string $name - * @throws phpmailerException - * @return boolean true on success, false if address already used or invalid in some way - * @access protected - */ - protected function addOrEnqueueAnAddress($kind, $address, $name) - { - $address = trim($address); - $name = trim(preg_replace('/[\r\n]+/', '', $name)); //Strip breaks and trim - if (($pos = strrpos($address, '@')) === false) { - // At-sign is misssing. - $error_message = $this->lang('invalid_address') . " (addAnAddress $kind): $address"; - $this->setError($error_message); - $this->edebug($error_message); - if ($this->exceptions) { - throw new phpmailerException($error_message); - } - return false; - } - $params = array($kind, $address, $name); - // Enqueue addresses with IDN until we know the PHPMailer::$CharSet. - if ($this->has8bitChars(substr($address, ++$pos)) and $this->idnSupported()) { - if ($kind != 'Reply-To') { - if (!array_key_exists($address, $this->RecipientsQueue)) { - $this->RecipientsQueue[$address] = $params; - return true; - } - } else { - if (!array_key_exists($address, $this->ReplyToQueue)) { - $this->ReplyToQueue[$address] = $params; - return true; - } - } - return false; - } - // Immediately add standard addresses without IDN. - return call_user_func_array(array($this, 'addAnAddress'), $params); - } - - /** - * Add an address to one of the recipient arrays or to the ReplyTo array. - * Addresses that have been added already return false, but do not throw exceptions. - * @param string $kind One of 'to', 'cc', 'bcc', or 'ReplyTo' - * @param string $address The email address to send, resp. to reply to - * @param string $name - * @throws phpmailerException - * @return boolean true on success, false if address already used or invalid in some way - * @access protected - */ - protected function addAnAddress($kind, $address, $name = '') - { - if (!in_array($kind, array('to', 'cc', 'bcc', 'Reply-To'))) { - $error_message = $this->lang('Invalid recipient kind: ') . $kind; - $this->setError($error_message); - $this->edebug($error_message); - if ($this->exceptions) { - throw new phpmailerException($error_message); - } - return false; - } - if (!$this->validateAddress($address)) { - $error_message = $this->lang('invalid_address') . " (addAnAddress $kind): $address"; - $this->setError($error_message); - $this->edebug($error_message); - if ($this->exceptions) { - throw new phpmailerException($error_message); - } - return false; - } - if ($kind != 'Reply-To') { - if (!array_key_exists(strtolower($address), $this->all_recipients)) { - array_push($this->$kind, array($address, $name)); - $this->all_recipients[strtolower($address)] = true; - return true; - } - } else { - if (!array_key_exists(strtolower($address), $this->ReplyTo)) { - $this->ReplyTo[strtolower($address)] = array($address, $name); - return true; - } - } - return false; - } - - /** - * Parse and validate a string containing one or more RFC822-style comma-separated email addresses - * of the form "display name
" into an array of name/address pairs. - * Uses the imap_rfc822_parse_adrlist function if the IMAP extension is available. - * Note that quotes in the name part are removed. - * @param string $addrstr The address list string - * @param bool $useimap Whether to use the IMAP extension to parse the list - * @return array - * @link http://www.andrew.cmu.edu/user/agreen1/testing/mrbs/web/Mail/RFC822.php A more careful implementation - */ - public function parseAddresses($addrstr, $useimap = true) - { - $addresses = array(); - if ($useimap and function_exists('imap_rfc822_parse_adrlist')) { - //Use this built-in parser if it's available - $list = imap_rfc822_parse_adrlist($addrstr, ''); - foreach ($list as $address) { - if ($address->host != '.SYNTAX-ERROR.') { - if ($this->validateAddress($address->mailbox . '@' . $address->host)) { - $addresses[] = array( - 'name' => (property_exists($address, 'personal') ? $address->personal : ''), - 'address' => $address->mailbox . '@' . $address->host - ); - } - } - } - } else { - //Use this simpler parser - $list = explode(',', $addrstr); - foreach ($list as $address) { - $address = trim($address); - //Is there a separate name part? - if (strpos($address, '<') === false) { - //No separate name, just use the whole thing - if ($this->validateAddress($address)) { - $addresses[] = array( - 'name' => '', - 'address' => $address - ); - } - } else { - list($name, $email) = explode('<', $address); - $email = trim(str_replace('>', '', $email)); - if ($this->validateAddress($email)) { - $addresses[] = array( - 'name' => trim(str_replace(array('"', "'"), '', $name)), - 'address' => $email - ); - } - } - } - } - return $addresses; - } - - /** - * Set the From and FromName properties. - * @param string $address - * @param string $name - * @param boolean $auto Whether to also set the Sender address, defaults to true - * @throws phpmailerException - * @return boolean - */ - public function setFrom($address, $name = '', $auto = true) - { - $address = trim($address); - $name = trim(preg_replace('/[\r\n]+/', '', $name)); //Strip breaks and trim - // Don't validate now addresses with IDN. Will be done in send(). - if (($pos = strrpos($address, '@')) === false or - (!$this->has8bitChars(substr($address, ++$pos)) or !$this->idnSupported()) and - !$this->validateAddress($address)) { - $error_message = $this->lang('invalid_address') . " (setFrom) $address"; - $this->setError($error_message); - $this->edebug($error_message); - if ($this->exceptions) { - throw new phpmailerException($error_message); - } - return false; - } - $this->From = $address; - $this->FromName = $name; - if ($auto) { - if (empty($this->Sender)) { - $this->Sender = $address; - } - } - return true; - } - - /** - * Return the Message-ID header of the last email. - * Technically this is the value from the last time the headers were created, - * but it's also the message ID of the last sent message except in - * pathological cases. - * @return string - */ - public function getLastMessageID() - { - return $this->lastMessageID; - } - - /** - * Check that a string looks like an email address. - * @param string $address The email address to check - * @param string|callable $patternselect A selector for the validation pattern to use : - * * `auto` Pick best pattern automatically; - * * `pcre8` Use the squiloople.com pattern, requires PCRE > 8.0, PHP >= 5.3.2, 5.2.14; - * * `pcre` Use old PCRE implementation; - * * `php` Use PHP built-in FILTER_VALIDATE_EMAIL; - * * `html5` Use the pattern given by the HTML5 spec for 'email' type form input elements. - * * `noregex` Don't use a regex: super fast, really dumb. - * Alternatively you may pass in a callable to inject your own validator, for example: - * PHPMailer::validateAddress('user@example.com', function($address) { - * return (strpos($address, '@') !== false); - * }); - * You can also set the PHPMailer::$validator static to a callable, allowing built-in methods to use your validator. - * @return boolean - * @static - * @access public - */ - public static function validateAddress($address, $patternselect = null) - { - if (is_null($patternselect)) { - $patternselect = self::$validator; - } - if (is_callable($patternselect)) { - return call_user_func($patternselect, $address); - } - //Reject line breaks in addresses; it's valid RFC5322, but not RFC5321 - if (strpos($address, "\n") !== false or strpos($address, "\r") !== false) { - return false; - } - if (!$patternselect or $patternselect == 'auto') { - //Check this constant first so it works when extension_loaded() is disabled by safe mode - //Constant was added in PHP 5.2.4 - if (defined('PCRE_VERSION')) { - //This pattern can get stuck in a recursive loop in PCRE <= 8.0.2 - if (version_compare(PCRE_VERSION, '8.0.3') >= 0) { - $patternselect = 'pcre8'; - } else { - $patternselect = 'pcre'; - } - } elseif (function_exists('extension_loaded') and extension_loaded('pcre')) { - //Fall back to older PCRE - $patternselect = 'pcre'; - } else { - //Filter_var appeared in PHP 5.2.0 and does not require the PCRE extension - if (version_compare(PHP_VERSION, '5.2.0') >= 0) { - $patternselect = 'php'; - } else { - $patternselect = 'noregex'; - } - } - } - switch ($patternselect) { - case 'pcre8': - /** - * Uses the same RFC5322 regex on which FILTER_VALIDATE_EMAIL is based, but allows dotless domains. - * @link http://squiloople.com/2009/12/20/email-address-validation/ - * @copyright 2009-2010 Michael Rushton - * Feel free to use and redistribute this code. But please keep this copyright notice. - */ - return (boolean)preg_match( - '/^(?!(?>(?1)"?(?>\\\[ -~]|[^"])"?(?1)){255,})(?!(?>(?1)"?(?>\\\[ -~]|[^"])"?(?1)){65,}@)' . - '((?>(?>(?>((?>(?>(?>\x0D\x0A)?[\t ])+|(?>[\t ]*\x0D\x0A)?[\t ]+)?)(\((?>(?2)' . - '(?>[\x01-\x08\x0B\x0C\x0E-\'*-\[\]-\x7F]|\\\[\x00-\x7F]|(?3)))*(?2)\)))+(?2))|(?2))?)' . - '([!#-\'*+\/-9=?^-~-]+|"(?>(?2)(?>[\x01-\x08\x0B\x0C\x0E-!#-\[\]-\x7F]|\\\[\x00-\x7F]))*' . - '(?2)")(?>(?1)\.(?1)(?4))*(?1)@(?!(?1)[a-z0-9-]{64,})(?1)(?>([a-z0-9](?>[a-z0-9-]*[a-z0-9])?)' . - '(?>(?1)\.(?!(?1)[a-z0-9-]{64,})(?1)(?5)){0,126}|\[(?:(?>IPv6:(?>([a-f0-9]{1,4})(?>:(?6)){7}' . - '|(?!(?:.*[a-f0-9][:\]]){8,})((?6)(?>:(?6)){0,6})?::(?7)?))|(?>(?>IPv6:(?>(?6)(?>:(?6)){5}:' . - '|(?!(?:.*[a-f0-9]:){6,})(?8)?::(?>((?6)(?>:(?6)){0,4}):)?))?(25[0-5]|2[0-4][0-9]|1[0-9]{2}' . - '|[1-9]?[0-9])(?>\.(?9)){3}))\])(?1)$/isD', - $address - ); - case 'pcre': - //An older regex that doesn't need a recent PCRE - return (boolean)preg_match( - '/^(?!(?>"?(?>\\\[ -~]|[^"])"?){255,})(?!(?>"?(?>\\\[ -~]|[^"])"?){65,}@)(?>' . - '[!#-\'*+\/-9=?^-~-]+|"(?>(?>[\x01-\x08\x0B\x0C\x0E-!#-\[\]-\x7F]|\\\[\x00-\xFF]))*")' . - '(?>\.(?>[!#-\'*+\/-9=?^-~-]+|"(?>(?>[\x01-\x08\x0B\x0C\x0E-!#-\[\]-\x7F]|\\\[\x00-\xFF]))*"))*' . - '@(?>(?![a-z0-9-]{64,})(?>[a-z0-9](?>[a-z0-9-]*[a-z0-9])?)(?>\.(?![a-z0-9-]{64,})' . - '(?>[a-z0-9](?>[a-z0-9-]*[a-z0-9])?)){0,126}|\[(?:(?>IPv6:(?>(?>[a-f0-9]{1,4})(?>:' . - '[a-f0-9]{1,4}){7}|(?!(?:.*[a-f0-9][:\]]){8,})(?>[a-f0-9]{1,4}(?>:[a-f0-9]{1,4}){0,6})?' . - '::(?>[a-f0-9]{1,4}(?>:[a-f0-9]{1,4}){0,6})?))|(?>(?>IPv6:(?>[a-f0-9]{1,4}(?>:' . - '[a-f0-9]{1,4}){5}:|(?!(?:.*[a-f0-9]:){6,})(?>[a-f0-9]{1,4}(?>:[a-f0-9]{1,4}){0,4})?' . - '::(?>(?:[a-f0-9]{1,4}(?>:[a-f0-9]{1,4}){0,4}):)?))?(?>25[0-5]|2[0-4][0-9]|1[0-9]{2}' . - '|[1-9]?[0-9])(?>\.(?>25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9])){3}))\])$/isD', - $address - ); - case 'html5': - /** - * This is the pattern used in the HTML5 spec for validation of 'email' type form input elements. - * @link http://www.whatwg.org/specs/web-apps/current-work/#e-mail-state-(type=email) - */ - return (boolean)preg_match( - '/^[a-zA-Z0-9.!#$%&\'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}' . - '[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/sD', - $address - ); - case 'noregex': - //No PCRE! Do something _very_ approximate! - //Check the address is 3 chars or longer and contains an @ that's not the first or last char - return (strlen($address) >= 3 - and strpos($address, '@') >= 1 - and strpos($address, '@') != strlen($address) - 1); - case 'php': - default: - return (boolean)filter_var($address, FILTER_VALIDATE_EMAIL); - } - } - - /** - * Tells whether IDNs (Internationalized Domain Names) are supported or not. This requires the - * "intl" and "mbstring" PHP extensions. - * @return bool "true" if required functions for IDN support are present - */ - public function idnSupported() - { - // @TODO: Write our own "idn_to_ascii" function for PHP <= 5.2. - return function_exists('idn_to_ascii') and function_exists('mb_convert_encoding'); - } - - /** - * Converts IDN in given email address to its ASCII form, also known as punycode, if possible. - * Important: Address must be passed in same encoding as currently set in PHPMailer::$CharSet. - * This function silently returns unmodified address if: - * - No conversion is necessary (i.e. domain name is not an IDN, or is already in ASCII form) - * - Conversion to punycode is impossible (e.g. required PHP functions are not available) - * or fails for any reason (e.g. domain has characters not allowed in an IDN) - * @see PHPMailer::$CharSet - * @param string $address The email address to convert - * @return string The encoded address in ASCII form - */ - public function punyencodeAddress($address) - { - // Verify we have required functions, CharSet, and at-sign. - if ($this->idnSupported() and - !empty($this->CharSet) and - ($pos = strrpos($address, '@')) !== false) { - $domain = substr($address, ++$pos); - // Verify CharSet string is a valid one, and domain properly encoded in this CharSet. - if ($this->has8bitChars($domain) and @mb_check_encoding($domain, $this->CharSet)) { - $domain = mb_convert_encoding($domain, 'UTF-8', $this->CharSet); - if (($punycode = defined('INTL_IDNA_VARIANT_UTS46') ? - idn_to_ascii($domain, 0, INTL_IDNA_VARIANT_UTS46) : - idn_to_ascii($domain)) !== false) { - return substr($address, 0, $pos) . $punycode; - } - } - } - return $address; - } - - /** - * Create a message and send it. - * Uses the sending method specified by $Mailer. - * @throws phpmailerException - * @return boolean false on error - See the ErrorInfo property for details of the error. - */ - public function send() - { - try { - if (!$this->preSend()) { - return false; - } - return $this->postSend(); - } catch (phpmailerException $exc) { - $this->mailHeader = ''; - $this->setError($exc->getMessage()); - if ($this->exceptions) { - throw $exc; - } - return false; - } - } - - /** - * Prepare a message for sending. - * @throws phpmailerException - * @return boolean - */ - public function preSend() - { - try { - $this->error_count = 0; // Reset errors - $this->mailHeader = ''; - - // Dequeue recipient and Reply-To addresses with IDN - foreach (array_merge($this->RecipientsQueue, $this->ReplyToQueue) as $params) { - $params[1] = $this->punyencodeAddress($params[1]); - call_user_func_array(array($this, 'addAnAddress'), $params); - } - if ((count($this->to) + count($this->cc) + count($this->bcc)) < 1) { - throw new phpmailerException($this->lang('provide_address'), self::STOP_CRITICAL); - } - - // Validate From, Sender, and ConfirmReadingTo addresses - foreach (array('From', 'Sender', 'ConfirmReadingTo') as $address_kind) { - $this->$address_kind = trim($this->$address_kind); - if (empty($this->$address_kind)) { - continue; - } - $this->$address_kind = $this->punyencodeAddress($this->$address_kind); - if (!$this->validateAddress($this->$address_kind)) { - $error_message = $this->lang('invalid_address') . ' (punyEncode) ' . $this->$address_kind; - $this->setError($error_message); - $this->edebug($error_message); - if ($this->exceptions) { - throw new phpmailerException($error_message); - } - return false; - } - } - - // Set whether the message is multipart/alternative - if ($this->alternativeExists()) { - $this->ContentType = 'multipart/alternative'; - } - - $this->setMessageType(); - // Refuse to send an empty message unless we are specifically allowing it - if (!$this->AllowEmpty and empty($this->Body)) { - throw new phpmailerException($this->lang('empty_message'), self::STOP_CRITICAL); - } - - // Create body before headers in case body makes changes to headers (e.g. altering transfer encoding) - $this->MIMEHeader = ''; - $this->MIMEBody = $this->createBody(); - // createBody may have added some headers, so retain them - $tempheaders = $this->MIMEHeader; - $this->MIMEHeader = $this->createHeader(); - $this->MIMEHeader .= $tempheaders; - - // To capture the complete message when using mail(), create - // an extra header list which createHeader() doesn't fold in - if ($this->Mailer == 'mail') { - if (count($this->to) > 0) { - $this->mailHeader .= $this->addrAppend('To', $this->to); - } else { - $this->mailHeader .= $this->headerLine('To', 'undisclosed-recipients:;'); - } - $this->mailHeader .= $this->headerLine( - 'Subject', - $this->encodeHeader($this->secureHeader(trim($this->Subject))) - ); - } - - // Sign with DKIM if enabled - if (!empty($this->DKIM_domain) - and !empty($this->DKIM_selector) - and (!empty($this->DKIM_private_string) - or (!empty($this->DKIM_private) - and self::isPermittedPath($this->DKIM_private) - and file_exists($this->DKIM_private) - ) - ) - ) { - $header_dkim = $this->DKIM_Add( - $this->MIMEHeader . $this->mailHeader, - $this->encodeHeader($this->secureHeader($this->Subject)), - $this->MIMEBody - ); - $this->MIMEHeader = rtrim($this->MIMEHeader, "\r\n ") . self::CRLF . - str_replace("\r\n", "\n", $header_dkim) . self::CRLF; - } - return true; - } catch (phpmailerException $exc) { - $this->setError($exc->getMessage()); - if ($this->exceptions) { - throw $exc; - } - return false; - } - } - - /** - * Actually send a message. - * Send the email via the selected mechanism - * @throws phpmailerException - * @return boolean - */ - public function postSend() - { - try { - // Choose the mailer and send through it - switch ($this->Mailer) { - case 'sendmail': - case 'qmail': - return $this->sendmailSend($this->MIMEHeader, $this->MIMEBody); - case 'smtp': - return $this->smtpSend($this->MIMEHeader, $this->MIMEBody); - case 'mail': - return $this->mailSend($this->MIMEHeader, $this->MIMEBody); - default: - $sendMethod = $this->Mailer.'Send'; - if (method_exists($this, $sendMethod)) { - return $this->$sendMethod($this->MIMEHeader, $this->MIMEBody); - } - - return $this->mailSend($this->MIMEHeader, $this->MIMEBody); - } - } catch (phpmailerException $exc) { - $this->setError($exc->getMessage()); - $this->edebug($exc->getMessage()); - if ($this->exceptions) { - throw $exc; - } - } - return false; - } - - /** - * Send mail using the $Sendmail program. - * @param string $header The message headers - * @param string $body The message body - * @see PHPMailer::$Sendmail - * @throws phpmailerException - * @access protected - * @return boolean - */ - protected function sendmailSend($header, $body) - { - // CVE-2016-10033, CVE-2016-10045: Don't pass -f if characters will be escaped. - if (!empty($this->Sender) and self::isShellSafe($this->Sender)) { - if ($this->Mailer == 'qmail') { - $sendmailFmt = '%s -f%s'; - } else { - $sendmailFmt = '%s -oi -f%s -t'; - } - } else { - if ($this->Mailer == 'qmail') { - $sendmailFmt = '%s'; - } else { - $sendmailFmt = '%s -oi -t'; - } - } - - // TODO: If possible, this should be changed to escapeshellarg. Needs thorough testing. - $sendmail = sprintf($sendmailFmt, escapeshellcmd($this->Sendmail), $this->Sender); - - if ($this->SingleTo) { - foreach ($this->SingleToArray as $toAddr) { - if (!@$mail = popen($sendmail, 'w')) { - throw new phpmailerException($this->lang('execute') . $this->Sendmail, self::STOP_CRITICAL); - } - fputs($mail, 'To: ' . $toAddr . "\n"); - fputs($mail, $header); - fputs($mail, $body); - $result = pclose($mail); - $this->doCallback( - ($result == 0), - array($toAddr), - $this->cc, - $this->bcc, - $this->Subject, - $body, - $this->From - ); - if ($result != 0) { - throw new phpmailerException($this->lang('execute') . $this->Sendmail, self::STOP_CRITICAL); - } - } - } else { - if (!@$mail = popen($sendmail, 'w')) { - throw new phpmailerException($this->lang('execute') . $this->Sendmail, self::STOP_CRITICAL); - } - fputs($mail, $header); - fputs($mail, $body); - $result = pclose($mail); - $this->doCallback( - ($result == 0), - $this->to, - $this->cc, - $this->bcc, - $this->Subject, - $body, - $this->From - ); - if ($result != 0) { - throw new phpmailerException($this->lang('execute') . $this->Sendmail, self::STOP_CRITICAL); - } - } - return true; - } - - /** - * Fix CVE-2016-10033 and CVE-2016-10045 by disallowing potentially unsafe shell characters. - * - * Note that escapeshellarg and escapeshellcmd are inadequate for our purposes, especially on Windows. - * @param string $string The string to be validated - * @see https://github.com/PHPMailer/PHPMailer/issues/924 CVE-2016-10045 bug report - * @access protected - * @return boolean - */ - protected static function isShellSafe($string) - { - // Future-proof - if (escapeshellcmd($string) !== $string - or !in_array(escapeshellarg($string), array("'$string'", "\"$string\"")) - ) { - return false; - } - - $length = strlen($string); - - for ($i = 0; $i < $length; $i++) { - $c = $string[$i]; - - // All other characters have a special meaning in at least one common shell, including = and +. - // Full stop (.) has a special meaning in cmd.exe, but its impact should be negligible here. - // Note that this does permit non-Latin alphanumeric characters based on the current locale. - if (!ctype_alnum($c) && strpos('@_-.', $c) === false) { - return false; - } - } - - return true; - } - - /** - * Check whether a file path is of a permitted type. - * Used to reject URLs and phar files from functions that access local file paths, - * such as addAttachment. - * @param string $path A relative or absolute path to a file. - * @return bool - */ - protected static function isPermittedPath($path) - { - return !preg_match('#^[a-z]+://#i', $path); - } - - /** - * Send mail using the PHP mail() function. - * @param string $header The message headers - * @param string $body The message body - * @link http://www.php.net/manual/en/book.mail.php - * @throws phpmailerException - * @access protected - * @return boolean - */ - protected function mailSend($header, $body) - { - $toArr = array(); - foreach ($this->to as $toaddr) { - $toArr[] = $this->addrFormat($toaddr); - } - $to = implode(', ', $toArr); - - $params = null; - //This sets the SMTP envelope sender which gets turned into a return-path header by the receiver - if (!empty($this->Sender) and $this->validateAddress($this->Sender)) { - // CVE-2016-10033, CVE-2016-10045: Don't pass -f if characters will be escaped. - if (self::isShellSafe($this->Sender)) { - $params = sprintf('-f%s', $this->Sender); - } - } - if (!empty($this->Sender) and !ini_get('safe_mode') and $this->validateAddress($this->Sender)) { - $old_from = ini_get('sendmail_from'); - ini_set('sendmail_from', $this->Sender); - } - $result = false; - if ($this->SingleTo and count($toArr) > 1) { - foreach ($toArr as $toAddr) { - $result = $this->mailPassthru($toAddr, $this->Subject, $body, $header, $params); - $this->doCallback($result, array($toAddr), $this->cc, $this->bcc, $this->Subject, $body, $this->From); - } - } else { - $result = $this->mailPassthru($to, $this->Subject, $body, $header, $params); - $this->doCallback($result, $this->to, $this->cc, $this->bcc, $this->Subject, $body, $this->From); - } - if (isset($old_from)) { - ini_set('sendmail_from', $old_from); - } - if (!$result) { - throw new phpmailerException($this->lang('instantiate'), self::STOP_CRITICAL); - } - return true; - } - - /** - * Get an instance to use for SMTP operations. - * Override this function to load your own SMTP implementation - * @return SMTP - */ - public function getSMTPInstance() - { - if (!is_object($this->smtp)) { - $this->smtp = new SMTP; - } - return $this->smtp; - } - - /** - * Send mail via SMTP. - * Returns false if there is a bad MAIL FROM, RCPT, or DATA input. - * Uses the PHPMailerSMTP class by default. - * @see PHPMailer::getSMTPInstance() to use a different class. - * @param string $header The message headers - * @param string $body The message body - * @throws phpmailerException - * @uses SMTP - * @access protected - * @return boolean - */ - protected function smtpSend($header, $body) - { - $bad_rcpt = array(); - if (!$this->smtpConnect($this->SMTPOptions)) { - throw new phpmailerException($this->lang('smtp_connect_failed'), self::STOP_CRITICAL); - } - if (!empty($this->Sender) and $this->validateAddress($this->Sender)) { - $smtp_from = $this->Sender; - } else { - $smtp_from = $this->From; - } - if (!$this->smtp->mail($smtp_from)) { - $this->setError($this->lang('from_failed') . $smtp_from . ' : ' . implode(',', $this->smtp->getError())); - throw new phpmailerException($this->ErrorInfo, self::STOP_CRITICAL); - } - - // Attempt to send to all recipients - foreach (array($this->to, $this->cc, $this->bcc) as $togroup) { - foreach ($togroup as $to) { - if (!$this->smtp->recipient($to[0])) { - $error = $this->smtp->getError(); - $bad_rcpt[] = array('to' => $to[0], 'error' => $error['detail']); - $isSent = false; - } else { - $isSent = true; - } - $this->doCallback($isSent, array($to[0]), array(), array(), $this->Subject, $body, $this->From); - } - } - - // Only send the DATA command if we have viable recipients - if ((count($this->all_recipients) > count($bad_rcpt)) and !$this->smtp->data($header . $body)) { - throw new phpmailerException($this->lang('data_not_accepted'), self::STOP_CRITICAL); - } - if ($this->SMTPKeepAlive) { - $this->smtp->reset(); - } else { - $this->smtp->quit(); - $this->smtp->close(); - } - //Create error message for any bad addresses - if (count($bad_rcpt) > 0) { - $errstr = ''; - foreach ($bad_rcpt as $bad) { - $errstr .= $bad['to'] . ': ' . $bad['error']; - } - throw new phpmailerException( - $this->lang('recipients_failed') . $errstr, - self::STOP_CONTINUE - ); - } - return true; - } - - /** - * Initiate a connection to an SMTP server. - * Returns false if the operation failed. - * @param array $options An array of options compatible with stream_context_create() - * @uses SMTP - * @access public - * @throws phpmailerException - * @return boolean - */ - public function smtpConnect($options = null) - { - if (is_null($this->smtp)) { - $this->smtp = $this->getSMTPInstance(); - } - - //If no options are provided, use whatever is set in the instance - if (is_null($options)) { - $options = $this->SMTPOptions; - } - - // Already connected? - if ($this->smtp->connected()) { - return true; - } - - $this->smtp->setTimeout($this->Timeout); - $this->smtp->setDebugLevel($this->SMTPDebug); - $this->smtp->setDebugOutput($this->Debugoutput); - $this->smtp->setVerp($this->do_verp); - $hosts = explode(';', $this->Host); - $lastexception = null; - - foreach ($hosts as $hostentry) { - $hostinfo = array(); - if (!preg_match( - '/^((ssl|tls):\/\/)*([a-zA-Z0-9\.-]*|\[[a-fA-F0-9:]+\]):?([0-9]*)$/', - trim($hostentry), - $hostinfo - )) { - // Not a valid host entry - $this->edebug('Ignoring invalid host: ' . $hostentry); - continue; - } - // $hostinfo[2]: optional ssl or tls prefix - // $hostinfo[3]: the hostname - // $hostinfo[4]: optional port number - // The host string prefix can temporarily override the current setting for SMTPSecure - // If it's not specified, the default value is used - $prefix = ''; - $secure = $this->SMTPSecure; - $tls = ($this->SMTPSecure == 'tls'); - if ('ssl' == $hostinfo[2] or ('' == $hostinfo[2] and 'ssl' == $this->SMTPSecure)) { - $prefix = 'ssl://'; - $tls = false; // Can't have SSL and TLS at the same time - $secure = 'ssl'; - } elseif ($hostinfo[2] == 'tls') { - $tls = true; - // tls doesn't use a prefix - $secure = 'tls'; - } - //Do we need the OpenSSL extension? - $sslext = defined('OPENSSL_ALGO_SHA1'); - if ('tls' === $secure or 'ssl' === $secure) { - //Check for an OpenSSL constant rather than using extension_loaded, which is sometimes disabled - if (!$sslext) { - throw new phpmailerException($this->lang('extension_missing').'openssl', self::STOP_CRITICAL); - } - } - $host = $hostinfo[3]; - $port = $this->Port; - $tport = (integer)$hostinfo[4]; - if ($tport > 0 and $tport < 65536) { - $port = $tport; - } - if ($this->smtp->connect($prefix . $host, $port, $this->Timeout, $options)) { - try { - if ($this->Helo) { - $hello = $this->Helo; - } else { - $hello = $this->serverHostname(); - } - $this->smtp->hello($hello); - //Automatically enable TLS encryption if: - // * it's not disabled - // * we have openssl extension - // * we are not already using SSL - // * the server offers STARTTLS - if ($this->SMTPAutoTLS and $sslext and $secure != 'ssl' and $this->smtp->getServerExt('STARTTLS')) { - $tls = true; - } - if ($tls) { - if (!$this->smtp->startTLS()) { - throw new phpmailerException($this->lang('connect_host')); - } - // We must resend EHLO after TLS negotiation - $this->smtp->hello($hello); - } - if ($this->SMTPAuth) { - if (!$this->smtp->authenticate( - $this->Username, - $this->Password, - $this->AuthType, - $this->Realm, - $this->Workstation - ) - ) { - throw new phpmailerException($this->lang('authenticate')); - } - } - return true; - } catch (phpmailerException $exc) { - $lastexception = $exc; - $this->edebug($exc->getMessage()); - // We must have connected, but then failed TLS or Auth, so close connection nicely - $this->smtp->quit(); - } - } - } - // If we get here, all connection attempts have failed, so close connection hard - $this->smtp->close(); - // As we've caught all exceptions, just report whatever the last one was - if ($this->exceptions and !is_null($lastexception)) { - throw $lastexception; - } - return false; - } - - /** - * Close the active SMTP session if one exists. - * @return void - */ - public function smtpClose() - { - if (is_a($this->smtp, 'SMTP')) { - if ($this->smtp->connected()) { - $this->smtp->quit(); - $this->smtp->close(); - } - } - } - - /** - * Set the language for error messages. - * Returns false if it cannot load the language file. - * The default language is English. - * @param string $langcode ISO 639-1 2-character language code (e.g. French is "fr") - * @param string $lang_path Path to the language file directory, with trailing separator (slash) - * @return boolean - * @access public - */ - public function setLanguage($langcode = 'en', $lang_path = '') - { - // Backwards compatibility for renamed language codes - $renamed_langcodes = array( - 'br' => 'pt_br', - 'cz' => 'cs', - 'dk' => 'da', - 'no' => 'nb', - 'se' => 'sv', - 'sr' => 'rs' - ); - - if (isset($renamed_langcodes[$langcode])) { - $langcode = $renamed_langcodes[$langcode]; - } - - // Define full set of translatable strings in English - $PHPMAILER_LANG = array( - 'authenticate' => 'SMTP Error: Could not authenticate.', - 'connect_host' => 'SMTP Error: Could not connect to SMTP host.', - 'data_not_accepted' => 'SMTP Error: data not accepted.', - 'empty_message' => 'Message body empty', - 'encoding' => 'Unknown encoding: ', - 'execute' => 'Could not execute: ', - 'file_access' => 'Could not access file: ', - 'file_open' => 'File Error: Could not open file: ', - 'from_failed' => 'The following From address failed: ', - 'instantiate' => 'Could not instantiate mail function.', - 'invalid_address' => 'Invalid address: ', - 'mailer_not_supported' => ' mailer is not supported.', - 'provide_address' => 'You must provide at least one recipient email address.', - 'recipients_failed' => 'SMTP Error: The following recipients failed: ', - 'signing' => 'Signing Error: ', - 'smtp_connect_failed' => 'SMTP connect() failed.', - 'smtp_error' => 'SMTP server error: ', - 'variable_set' => 'Cannot set or reset variable: ', - 'extension_missing' => 'Extension missing: ' - ); - if (empty($lang_path)) { - // Calculate an absolute path so it can work if CWD is not here - $lang_path = dirname(__FILE__). DIRECTORY_SEPARATOR . 'language'. DIRECTORY_SEPARATOR; - } - //Validate $langcode - if (!preg_match('/^[a-z]{2}(?:_[a-zA-Z]{2})?$/', $langcode)) { - $langcode = 'en'; - } - $foundlang = true; - $lang_file = $lang_path . 'phpmailer.lang-' . $langcode . '.php'; - // There is no English translation file - if ($langcode != 'en') { - // Make sure language file path is readable - if (!self::isPermittedPath($lang_file) or !is_readable($lang_file)) { - $foundlang = false; - } else { - // Overwrite language-specific strings. - // This way we'll never have missing translation keys. - $foundlang = include $lang_file; - } - } - $this->language = $PHPMAILER_LANG; - return (boolean)$foundlang; // Returns false if language not found - } - - /** - * Get the array of strings for the current language. - * @return array - */ - public function getTranslations() - { - return $this->language; - } - - /** - * Create recipient headers. - * @access public - * @param string $type - * @param array $addr An array of recipient, - * where each recipient is a 2-element indexed array with element 0 containing an address - * and element 1 containing a name, like: - * array(array('joe@example.com', 'Joe User'), array('zoe@example.com', 'Zoe User')) - * @return string - */ - public function addrAppend($type, $addr) - { - $addresses = array(); - foreach ($addr as $address) { - $addresses[] = $this->addrFormat($address); - } - return $type . ': ' . implode(', ', $addresses) . $this->LE; - } - - /** - * Format an address for use in a message header. - * @access public - * @param array $addr A 2-element indexed array, element 0 containing an address, element 1 containing a name - * like array('joe@example.com', 'Joe User') - * @return string - */ - public function addrFormat($addr) - { - if (empty($addr[1])) { // No name provided - return $this->secureHeader($addr[0]); - } else { - return $this->encodeHeader($this->secureHeader($addr[1]), 'phrase') . ' <' . $this->secureHeader( - $addr[0] - ) . '>'; - } - } - - /** - * Word-wrap message. - * For use with mailers that do not automatically perform wrapping - * and for quoted-printable encoded messages. - * Original written by philippe. - * @param string $message The message to wrap - * @param integer $length The line length to wrap to - * @param boolean $qp_mode Whether to run in Quoted-Printable mode - * @access public - * @return string - */ - public function wrapText($message, $length, $qp_mode = false) - { - if ($qp_mode) { - $soft_break = sprintf(' =%s', $this->LE); - } else { - $soft_break = $this->LE; - } - // If utf-8 encoding is used, we will need to make sure we don't - // split multibyte characters when we wrap - $is_utf8 = (strtolower($this->CharSet) == 'utf-8'); - $lelen = strlen($this->LE); - $crlflen = strlen(self::CRLF); - - $message = $this->fixEOL($message); - //Remove a trailing line break - if (substr($message, -$lelen) == $this->LE) { - $message = substr($message, 0, -$lelen); - } - - //Split message into lines - $lines = explode($this->LE, $message); - //Message will be rebuilt in here - $message = ''; - foreach ($lines as $line) { - $words = explode(' ', $line); - $buf = ''; - $firstword = true; - foreach ($words as $word) { - if ($qp_mode and (strlen($word) > $length)) { - $space_left = $length - strlen($buf) - $crlflen; - if (!$firstword) { - if ($space_left > 20) { - $len = $space_left; - if ($is_utf8) { - $len = $this->utf8CharBoundary($word, $len); - } elseif (substr($word, $len - 1, 1) == '=') { - $len--; - } elseif (substr($word, $len - 2, 1) == '=') { - $len -= 2; - } - $part = substr($word, 0, $len); - $word = substr($word, $len); - $buf .= ' ' . $part; - $message .= $buf . sprintf('=%s', self::CRLF); - } else { - $message .= $buf . $soft_break; - } - $buf = ''; - } - while (strlen($word) > 0) { - if ($length <= 0) { - break; - } - $len = $length; - if ($is_utf8) { - $len = $this->utf8CharBoundary($word, $len); - } elseif (substr($word, $len - 1, 1) == '=') { - $len--; - } elseif (substr($word, $len - 2, 1) == '=') { - $len -= 2; - } - $part = substr($word, 0, $len); - $word = substr($word, $len); - - if (strlen($word) > 0) { - $message .= $part . sprintf('=%s', self::CRLF); - } else { - $buf = $part; - } - } - } else { - $buf_o = $buf; - if (!$firstword) { - $buf .= ' '; - } - $buf .= $word; - - if (strlen($buf) > $length and $buf_o != '') { - $message .= $buf_o . $soft_break; - $buf = $word; - } - } - $firstword = false; - } - $message .= $buf . self::CRLF; - } - - return $message; - } - - /** - * Find the last character boundary prior to $maxLength in a utf-8 - * quoted-printable encoded string. - * Original written by Colin Brown. - * @access public - * @param string $encodedText utf-8 QP text - * @param integer $maxLength Find the last character boundary prior to this length - * @return integer - */ - public function utf8CharBoundary($encodedText, $maxLength) - { - $foundSplitPos = false; - $lookBack = 3; - while (!$foundSplitPos) { - $lastChunk = substr($encodedText, $maxLength - $lookBack, $lookBack); - $encodedCharPos = strpos($lastChunk, '='); - if (false !== $encodedCharPos) { - // Found start of encoded character byte within $lookBack block. - // Check the encoded byte value (the 2 chars after the '=') - $hex = substr($encodedText, $maxLength - $lookBack + $encodedCharPos + 1, 2); - $dec = hexdec($hex); - if ($dec < 128) { - // Single byte character. - // If the encoded char was found at pos 0, it will fit - // otherwise reduce maxLength to start of the encoded char - if ($encodedCharPos > 0) { - $maxLength = $maxLength - ($lookBack - $encodedCharPos); - } - $foundSplitPos = true; - } elseif ($dec >= 192) { - // First byte of a multi byte character - // Reduce maxLength to split at start of character - $maxLength = $maxLength - ($lookBack - $encodedCharPos); - $foundSplitPos = true; - } elseif ($dec < 192) { - // Middle byte of a multi byte character, look further back - $lookBack += 3; - } - } else { - // No encoded character found - $foundSplitPos = true; - } - } - return $maxLength; - } - - /** - * Apply word wrapping to the message body. - * Wraps the message body to the number of chars set in the WordWrap property. - * You should only do this to plain-text bodies as wrapping HTML tags may break them. - * This is called automatically by createBody(), so you don't need to call it yourself. - * @access public - * @return void - */ - public function setWordWrap() - { - if ($this->WordWrap < 1) { - return; - } - - switch ($this->message_type) { - case 'alt': - case 'alt_inline': - case 'alt_attach': - case 'alt_inline_attach': - $this->AltBody = $this->wrapText($this->AltBody, $this->WordWrap); - break; - default: - $this->Body = $this->wrapText($this->Body, $this->WordWrap); - break; - } - } - - /** - * Assemble message headers. - * @access public - * @return string The assembled headers - */ - public function createHeader() - { - $result = ''; - - $result .= $this->headerLine('Date', $this->MessageDate == '' ? self::rfcDate() : $this->MessageDate); - - // To be created automatically by mail() - if ($this->SingleTo) { - if ($this->Mailer != 'mail') { - foreach ($this->to as $toaddr) { - $this->SingleToArray[] = $this->addrFormat($toaddr); - } - } - } else { - if (count($this->to) > 0) { - if ($this->Mailer != 'mail') { - $result .= $this->addrAppend('To', $this->to); - } - } elseif (count($this->cc) == 0) { - $result .= $this->headerLine('To', 'undisclosed-recipients:;'); - } - } - - $result .= $this->addrAppend('From', array(array(trim($this->From), $this->FromName))); - - // sendmail and mail() extract Cc from the header before sending - if (count($this->cc) > 0) { - $result .= $this->addrAppend('Cc', $this->cc); - } - - // sendmail and mail() extract Bcc from the header before sending - if (( - $this->Mailer == 'sendmail' or $this->Mailer == 'qmail' or $this->Mailer == 'mail' - ) - and count($this->bcc) > 0 - ) { - $result .= $this->addrAppend('Bcc', $this->bcc); - } - - if (count($this->ReplyTo) > 0) { - $result .= $this->addrAppend('Reply-To', $this->ReplyTo); - } - - // mail() sets the subject itself - if ($this->Mailer != 'mail') { - $result .= $this->headerLine('Subject', $this->encodeHeader($this->secureHeader($this->Subject))); - } - - // Only allow a custom message ID if it conforms to RFC 5322 section 3.6.4 - // https://tools.ietf.org/html/rfc5322#section-3.6.4 - if ('' != $this->MessageID and preg_match('/^<.*@.*>$/', $this->MessageID)) { - $this->lastMessageID = $this->MessageID; - } else { - $this->lastMessageID = sprintf('<%s@%s>', $this->uniqueid, $this->serverHostname()); - } - $result .= $this->headerLine('Message-ID', $this->lastMessageID); - if (!is_null($this->Priority)) { - $result .= $this->headerLine('X-Priority', $this->Priority); - } - if ($this->XMailer == '') { - $result .= $this->headerLine( - 'X-Mailer', - 'PHPMailer ' . $this->Version . ' (https://github.com/PHPMailer/PHPMailer)' - ); - } else { - $myXmailer = trim($this->XMailer); - if ($myXmailer) { - $result .= $this->headerLine('X-Mailer', $myXmailer); - } - } - - if ($this->ConfirmReadingTo != '') { - $result .= $this->headerLine('Disposition-Notification-To', '<' . $this->ConfirmReadingTo . '>'); - } - - // Add custom headers - foreach ($this->CustomHeader as $header) { - $result .= $this->headerLine( - trim($header[0]), - $this->encodeHeader(trim($header[1])) - ); - } - if (!$this->sign_key_file) { - $result .= $this->headerLine('MIME-Version', '1.0'); - $result .= $this->getMailMIME(); - } - - return $result; - } - - /** - * Get the message MIME type headers. - * @access public - * @return string - */ - public function getMailMIME() - { - $result = ''; - $ismultipart = true; - switch ($this->message_type) { - case 'inline': - $result .= $this->headerLine('Content-Type', 'multipart/related;'); - $result .= $this->textLine("\tboundary=\"" . $this->boundary[1] . '"'); - break; - case 'attach': - case 'inline_attach': - case 'alt_attach': - case 'alt_inline_attach': - $result .= $this->headerLine('Content-Type', 'multipart/mixed;'); - $result .= $this->textLine("\tboundary=\"" . $this->boundary[1] . '"'); - break; - case 'alt': - case 'alt_inline': - $result .= $this->headerLine('Content-Type', 'multipart/alternative;'); - $result .= $this->textLine("\tboundary=\"" . $this->boundary[1] . '"'); - break; - default: - // Catches case 'plain': and case '': - $result .= $this->textLine('Content-Type: ' . $this->ContentType . '; charset=' . $this->CharSet); - $ismultipart = false; - break; - } - // RFC1341 part 5 says 7bit is assumed if not specified - if ($this->Encoding != '7bit') { - // RFC 2045 section 6.4 says multipart MIME parts may only use 7bit, 8bit or binary CTE - if ($ismultipart) { - if ($this->Encoding == '8bit') { - $result .= $this->headerLine('Content-Transfer-Encoding', '8bit'); - } - // The only remaining alternatives are quoted-printable and base64, which are both 7bit compatible - } else { - $result .= $this->headerLine('Content-Transfer-Encoding', $this->Encoding); - } - } - - if ($this->Mailer != 'mail') { - $result .= $this->LE; - } - - return $result; - } - - /** - * Returns the whole MIME message. - * Includes complete headers and body. - * Only valid post preSend(). - * @see PHPMailer::preSend() - * @access public - * @return string - */ - public function getSentMIMEMessage() - { - return rtrim($this->MIMEHeader . $this->mailHeader, "\n\r") . self::CRLF . self::CRLF . $this->MIMEBody; - } - - /** - * Create unique ID - * @return string - */ - protected function generateId() { - return md5(uniqid(time())); - } - - /** - * Assemble the message body. - * Returns an empty string on failure. - * @access public - * @throws phpmailerException - * @return string The assembled message body - */ - public function createBody() - { - $body = ''; - //Create unique IDs and preset boundaries - $this->uniqueid = $this->generateId(); - $this->boundary[1] = 'b1_' . $this->uniqueid; - $this->boundary[2] = 'b2_' . $this->uniqueid; - $this->boundary[3] = 'b3_' . $this->uniqueid; - - if ($this->sign_key_file) { - $body .= $this->getMailMIME() . $this->LE; - } - - $this->setWordWrap(); - - $bodyEncoding = $this->Encoding; - $bodyCharSet = $this->CharSet; - //Can we do a 7-bit downgrade? - if ($bodyEncoding == '8bit' and !$this->has8bitChars($this->Body)) { - $bodyEncoding = '7bit'; - //All ISO 8859, Windows codepage and UTF-8 charsets are ascii compatible up to 7-bit - $bodyCharSet = 'us-ascii'; - } - //If lines are too long, and we're not already using an encoding that will shorten them, - //change to quoted-printable transfer encoding for the body part only - if ('base64' != $this->Encoding and self::hasLineLongerThanMax($this->Body)) { - $bodyEncoding = 'quoted-printable'; - } - - $altBodyEncoding = $this->Encoding; - $altBodyCharSet = $this->CharSet; - //Can we do a 7-bit downgrade? - if ($altBodyEncoding == '8bit' and !$this->has8bitChars($this->AltBody)) { - $altBodyEncoding = '7bit'; - //All ISO 8859, Windows codepage and UTF-8 charsets are ascii compatible up to 7-bit - $altBodyCharSet = 'us-ascii'; - } - //If lines are too long, and we're not already using an encoding that will shorten them, - //change to quoted-printable transfer encoding for the alt body part only - if ('base64' != $altBodyEncoding and self::hasLineLongerThanMax($this->AltBody)) { - $altBodyEncoding = 'quoted-printable'; - } - //Use this as a preamble in all multipart message types - $mimepre = "This is a multi-part message in MIME format." . $this->LE . $this->LE; - switch ($this->message_type) { - case 'inline': - $body .= $mimepre; - $body .= $this->getBoundary($this->boundary[1], $bodyCharSet, '', $bodyEncoding); - $body .= $this->encodeString($this->Body, $bodyEncoding); - $body .= $this->LE . $this->LE; - $body .= $this->attachAll('inline', $this->boundary[1]); - break; - case 'attach': - $body .= $mimepre; - $body .= $this->getBoundary($this->boundary[1], $bodyCharSet, '', $bodyEncoding); - $body .= $this->encodeString($this->Body, $bodyEncoding); - $body .= $this->LE . $this->LE; - $body .= $this->attachAll('attachment', $this->boundary[1]); - break; - case 'inline_attach': - $body .= $mimepre; - $body .= $this->textLine('--' . $this->boundary[1]); - $body .= $this->headerLine('Content-Type', 'multipart/related;'); - $body .= $this->textLine("\tboundary=\"" . $this->boundary[2] . '"'); - $body .= $this->LE; - $body .= $this->getBoundary($this->boundary[2], $bodyCharSet, '', $bodyEncoding); - $body .= $this->encodeString($this->Body, $bodyEncoding); - $body .= $this->LE . $this->LE; - $body .= $this->attachAll('inline', $this->boundary[2]); - $body .= $this->LE; - $body .= $this->attachAll('attachment', $this->boundary[1]); - break; - case 'alt': - $body .= $mimepre; - $body .= $this->getBoundary($this->boundary[1], $altBodyCharSet, 'text/plain', $altBodyEncoding); - $body .= $this->encodeString($this->AltBody, $altBodyEncoding); - $body .= $this->LE . $this->LE; - $body .= $this->getBoundary($this->boundary[1], $bodyCharSet, 'text/html', $bodyEncoding); - $body .= $this->encodeString($this->Body, $bodyEncoding); - $body .= $this->LE . $this->LE; - if (!empty($this->Ical)) { - $body .= $this->getBoundary($this->boundary[1], '', 'text/calendar; method=REQUEST', ''); - $body .= $this->encodeString($this->Ical, $this->Encoding); - $body .= $this->LE . $this->LE; - } - $body .= $this->endBoundary($this->boundary[1]); - break; - case 'alt_inline': - $body .= $mimepre; - $body .= $this->getBoundary($this->boundary[1], $altBodyCharSet, 'text/plain', $altBodyEncoding); - $body .= $this->encodeString($this->AltBody, $altBodyEncoding); - $body .= $this->LE . $this->LE; - $body .= $this->textLine('--' . $this->boundary[1]); - $body .= $this->headerLine('Content-Type', 'multipart/related;'); - $body .= $this->textLine("\tboundary=\"" . $this->boundary[2] . '"'); - $body .= $this->LE; - $body .= $this->getBoundary($this->boundary[2], $bodyCharSet, 'text/html', $bodyEncoding); - $body .= $this->encodeString($this->Body, $bodyEncoding); - $body .= $this->LE . $this->LE; - $body .= $this->attachAll('inline', $this->boundary[2]); - $body .= $this->LE; - $body .= $this->endBoundary($this->boundary[1]); - break; - case 'alt_attach': - $body .= $mimepre; - $body .= $this->textLine('--' . $this->boundary[1]); - $body .= $this->headerLine('Content-Type', 'multipart/alternative;'); - $body .= $this->textLine("\tboundary=\"" . $this->boundary[2] . '"'); - $body .= $this->LE; - $body .= $this->getBoundary($this->boundary[2], $altBodyCharSet, 'text/plain', $altBodyEncoding); - $body .= $this->encodeString($this->AltBody, $altBodyEncoding); - $body .= $this->LE . $this->LE; - $body .= $this->getBoundary($this->boundary[2], $bodyCharSet, 'text/html', $bodyEncoding); - $body .= $this->encodeString($this->Body, $bodyEncoding); - $body .= $this->LE . $this->LE; - $body .= $this->endBoundary($this->boundary[2]); - $body .= $this->LE; - $body .= $this->attachAll('attachment', $this->boundary[1]); - break; - case 'alt_inline_attach': - $body .= $mimepre; - $body .= $this->textLine('--' . $this->boundary[1]); - $body .= $this->headerLine('Content-Type', 'multipart/alternative;'); - $body .= $this->textLine("\tboundary=\"" . $this->boundary[2] . '"'); - $body .= $this->LE; - $body .= $this->getBoundary($this->boundary[2], $altBodyCharSet, 'text/plain', $altBodyEncoding); - $body .= $this->encodeString($this->AltBody, $altBodyEncoding); - $body .= $this->LE . $this->LE; - $body .= $this->textLine('--' . $this->boundary[2]); - $body .= $this->headerLine('Content-Type', 'multipart/related;'); - $body .= $this->textLine("\tboundary=\"" . $this->boundary[3] . '"'); - $body .= $this->LE; - $body .= $this->getBoundary($this->boundary[3], $bodyCharSet, 'text/html', $bodyEncoding); - $body .= $this->encodeString($this->Body, $bodyEncoding); - $body .= $this->LE . $this->LE; - $body .= $this->attachAll('inline', $this->boundary[3]); - $body .= $this->LE; - $body .= $this->endBoundary($this->boundary[2]); - $body .= $this->LE; - $body .= $this->attachAll('attachment', $this->boundary[1]); - break; - default: - // Catch case 'plain' and case '', applies to simple `text/plain` and `text/html` body content types - //Reset the `Encoding` property in case we changed it for line length reasons - $this->Encoding = $bodyEncoding; - $body .= $this->encodeString($this->Body, $this->Encoding); - break; - } - - if ($this->isError()) { - $body = ''; - } elseif ($this->sign_key_file) { - try { - if (!defined('PKCS7_TEXT')) { - throw new phpmailerException($this->lang('extension_missing') . 'openssl'); - } - // @TODO would be nice to use php://temp streams here, but need to wrap for PHP < 5.1 - $file = tempnam(sys_get_temp_dir(), 'mail'); - if (false === file_put_contents($file, $body)) { - throw new phpmailerException($this->lang('signing') . ' Could not write temp file'); - } - $signed = tempnam(sys_get_temp_dir(), 'signed'); - //Workaround for PHP bug https://bugs.php.net/bug.php?id=69197 - if (empty($this->sign_extracerts_file)) { - $sign = @openssl_pkcs7_sign( - $file, - $signed, - 'file://' . realpath($this->sign_cert_file), - array('file://' . realpath($this->sign_key_file), $this->sign_key_pass), - null - ); - } else { - $sign = @openssl_pkcs7_sign( - $file, - $signed, - 'file://' . realpath($this->sign_cert_file), - array('file://' . realpath($this->sign_key_file), $this->sign_key_pass), - null, - PKCS7_DETACHED, - $this->sign_extracerts_file - ); - } - if ($sign) { - @unlink($file); - $body = file_get_contents($signed); - @unlink($signed); - //The message returned by openssl contains both headers and body, so need to split them up - $parts = explode("\n\n", $body, 2); - $this->MIMEHeader .= $parts[0] . $this->LE . $this->LE; - $body = $parts[1]; - } else { - @unlink($file); - @unlink($signed); - throw new phpmailerException($this->lang('signing') . openssl_error_string()); - } - } catch (phpmailerException $exc) { - $body = ''; - if ($this->exceptions) { - throw $exc; - } - } - } - return $body; - } - - /** - * Return the start of a message boundary. - * @access protected - * @param string $boundary - * @param string $charSet - * @param string $contentType - * @param string $encoding - * @return string - */ - protected function getBoundary($boundary, $charSet, $contentType, $encoding) - { - $result = ''; - if ($charSet == '') { - $charSet = $this->CharSet; - } - if ($contentType == '') { - $contentType = $this->ContentType; - } - if ($encoding == '') { - $encoding = $this->Encoding; - } - $result .= $this->textLine('--' . $boundary); - $result .= sprintf('Content-Type: %s; charset=%s', $contentType, $charSet); - $result .= $this->LE; - // RFC1341 part 5 says 7bit is assumed if not specified - if ($encoding != '7bit') { - $result .= $this->headerLine('Content-Transfer-Encoding', $encoding); - } - $result .= $this->LE; - - return $result; - } - - /** - * Return the end of a message boundary. - * @access protected - * @param string $boundary - * @return string - */ - protected function endBoundary($boundary) - { - return $this->LE . '--' . $boundary . '--' . $this->LE; - } - - /** - * Set the message type. - * PHPMailer only supports some preset message types, not arbitrary MIME structures. - * @access protected - * @return void - */ - protected function setMessageType() - { - $type = array(); - if ($this->alternativeExists()) { - $type[] = 'alt'; - } - if ($this->inlineImageExists()) { - $type[] = 'inline'; - } - if ($this->attachmentExists()) { - $type[] = 'attach'; - } - $this->message_type = implode('_', $type); - if ($this->message_type == '') { - //The 'plain' message_type refers to the message having a single body element, not that it is plain-text - $this->message_type = 'plain'; - } - } - - /** - * Format a header line. - * @access public - * @param string $name - * @param string $value - * @return string - */ - public function headerLine($name, $value) - { - return $name . ': ' . $value . $this->LE; - } - - /** - * Return a formatted mail line. - * @access public - * @param string $value - * @return string - */ - public function textLine($value) - { - return $value . $this->LE; - } - - /** - * Add an attachment from a path on the filesystem. - * Never use a user-supplied path to a file! - * Returns false if the file could not be found or read. - * Explicitly *does not* support passing URLs; PHPMailer is not an HTTP client. - * If you need to do that, fetch the resource yourself and pass it in via a local file or string. - * @param string $path Path to the attachment. - * @param string $name Overrides the attachment name. - * @param string $encoding File encoding (see $Encoding). - * @param string $type File extension (MIME) type. - * @param string $disposition Disposition to use - * @throws phpmailerException - * @return boolean - */ - public function addAttachment($path, $name = '', $encoding = 'base64', $type = '', $disposition = 'attachment') - { - try { - if (!self::isPermittedPath($path) or !@is_file($path)) { - throw new phpmailerException($this->lang('file_access') . $path, self::STOP_CONTINUE); - } - - // If a MIME type is not specified, try to work it out from the file name - if ($type == '') { - $type = self::filenameToType($path); - } - - $filename = basename($path); - if ($name == '') { - $name = $filename; - } - - $this->attachment[] = array( - 0 => $path, - 1 => $filename, - 2 => $name, - 3 => $encoding, - 4 => $type, - 5 => false, // isStringAttachment - 6 => $disposition, - 7 => 0 - ); - - } catch (phpmailerException $exc) { - $this->setError($exc->getMessage()); - $this->edebug($exc->getMessage()); - if ($this->exceptions) { - throw $exc; - } - return false; - } - return true; - } - - /** - * Return the array of attachments. - * @return array - */ - public function getAttachments() - { - return $this->attachment; - } - - /** - * Attach all file, string, and binary attachments to the message. - * Returns an empty string on failure. - * @access protected - * @param string $disposition_type - * @param string $boundary - * @return string - */ - protected function attachAll($disposition_type, $boundary) - { - // Return text of body - $mime = array(); - $cidUniq = array(); - $incl = array(); - - // Add all attachments - foreach ($this->attachment as $attachment) { - // Check if it is a valid disposition_filter - if ($attachment[6] == $disposition_type) { - // Check for string attachment - $string = ''; - $path = ''; - $bString = $attachment[5]; - if ($bString) { - $string = $attachment[0]; - } else { - $path = $attachment[0]; - } - - $inclhash = md5(serialize($attachment)); - if (in_array($inclhash, $incl)) { - continue; - } - $incl[] = $inclhash; - $name = $attachment[2]; - $encoding = $attachment[3]; - $type = $attachment[4]; - $disposition = $attachment[6]; - $cid = $attachment[7]; - if ($disposition == 'inline' && array_key_exists($cid, $cidUniq)) { - continue; - } - $cidUniq[$cid] = true; - - $mime[] = sprintf('--%s%s', $boundary, $this->LE); - //Only include a filename property if we have one - if (!empty($name)) { - $mime[] = sprintf( - 'Content-Type: %s; name="%s"%s', - $type, - $this->encodeHeader($this->secureHeader($name)), - $this->LE - ); - } else { - $mime[] = sprintf( - 'Content-Type: %s%s', - $type, - $this->LE - ); - } - // RFC1341 part 5 says 7bit is assumed if not specified - if ($encoding != '7bit') { - $mime[] = sprintf('Content-Transfer-Encoding: %s%s', $encoding, $this->LE); - } - - if ($disposition == 'inline') { - $mime[] = sprintf('Content-ID: <%s>%s', $cid, $this->LE); - } - - // If a filename contains any of these chars, it should be quoted, - // but not otherwise: RFC2183 & RFC2045 5.1 - // Fixes a warning in IETF's msglint MIME checker - // Allow for bypassing the Content-Disposition header totally - if (!(empty($disposition))) { - $encoded_name = $this->encodeHeader($this->secureHeader($name)); - if (preg_match('/[ \(\)<>@,;:\\"\/\[\]\?=]/', $encoded_name)) { - $mime[] = sprintf( - 'Content-Disposition: %s; filename="%s"%s', - $disposition, - $encoded_name, - $this->LE . $this->LE - ); - } else { - if (!empty($encoded_name)) { - $mime[] = sprintf( - 'Content-Disposition: %s; filename=%s%s', - $disposition, - $encoded_name, - $this->LE . $this->LE - ); - } else { - $mime[] = sprintf( - 'Content-Disposition: %s%s', - $disposition, - $this->LE . $this->LE - ); - } - } - } else { - $mime[] = $this->LE; - } - - // Encode as string attachment - if ($bString) { - $mime[] = $this->encodeString($string, $encoding); - if ($this->isError()) { - return ''; - } - $mime[] = $this->LE . $this->LE; - } else { - $mime[] = $this->encodeFile($path, $encoding); - if ($this->isError()) { - return ''; - } - $mime[] = $this->LE . $this->LE; - } - } - } - - $mime[] = sprintf('--%s--%s', $boundary, $this->LE); - - return implode('', $mime); - } - - /** - * Encode a file attachment in requested format. - * Returns an empty string on failure. - * @param string $path The full path to the file - * @param string $encoding The encoding to use; one of 'base64', '7bit', '8bit', 'binary', 'quoted-printable' - * @throws phpmailerException - * @access protected - * @return string - */ - protected function encodeFile($path, $encoding = 'base64') - { - try { - if (!self::isPermittedPath($path) or !file_exists($path)) { - throw new phpmailerException($this->lang('file_open') . $path, self::STOP_CONTINUE); - } - $magic_quotes = false; - if( version_compare(PHP_VERSION, '7.4.0', '<') ) { - $magic_quotes = get_magic_quotes_runtime(); - } - if ($magic_quotes) { - if (version_compare(PHP_VERSION, '5.3.0', '<')) { - set_magic_quotes_runtime(false); - } else { - //Doesn't exist in PHP 5.4, but we don't need to check because - //get_magic_quotes_runtime always returns false in 5.4+ - //so it will never get here - ini_set('magic_quotes_runtime', false); - } - } - $file_buffer = file_get_contents($path); - $file_buffer = $this->encodeString($file_buffer, $encoding); - if ($magic_quotes) { - if (version_compare(PHP_VERSION, '5.3.0', '<')) { - set_magic_quotes_runtime($magic_quotes); - } else { - ini_set('magic_quotes_runtime', $magic_quotes); - } - } - return $file_buffer; - } catch (Exception $exc) { - $this->setError($exc->getMessage()); - return ''; - } - } - - /** - * Encode a string in requested format. - * Returns an empty string on failure. - * @param string $str The text to encode - * @param string $encoding The encoding to use; one of 'base64', '7bit', '8bit', 'binary', 'quoted-printable' - * @access public - * @return string - */ - public function encodeString($str, $encoding = 'base64') - { - $encoded = ''; - switch (strtolower($encoding)) { - case 'base64': - $encoded = chunk_split(base64_encode($str), 76, $this->LE); - break; - case '7bit': - case '8bit': - $encoded = $this->fixEOL($str); - // Make sure it ends with a line break - if (substr($encoded, -(strlen($this->LE))) != $this->LE) { - $encoded .= $this->LE; - } - break; - case 'binary': - $encoded = $str; - break; - case 'quoted-printable': - $encoded = $this->encodeQP($str); - break; - default: - $this->setError($this->lang('encoding') . $encoding); - break; - } - return $encoded; - } - - /** - * Encode a header string optimally. - * Picks shortest of Q, B, quoted-printable or none. - * @access public - * @param string $str - * @param string $position - * @return string - */ - public function encodeHeader($str, $position = 'text') - { - $matchcount = 0; - switch (strtolower($position)) { - case 'phrase': - if (!preg_match('/[\200-\377]/', $str)) { - // Can't use addslashes as we don't know the value of magic_quotes_sybase - $encoded = addcslashes($str, "\0..\37\177\\\""); - if (($str == $encoded) && !preg_match('/[^A-Za-z0-9!#$%&\'*+\/=?^_`{|}~ -]/', $str)) { - return ($encoded); - } else { - return ("\"$encoded\""); - } - } - $matchcount = preg_match_all('/[^\040\041\043-\133\135-\176]/', $str, $matches); - break; - /** @noinspection PhpMissingBreakStatementInspection */ - case 'comment': - $matchcount = preg_match_all('/[()"]/', $str, $matches); - // Intentional fall-through - case 'text': - default: - $matchcount += preg_match_all('/[\000-\010\013\014\016-\037\177-\377]/', $str, $matches); - break; - } - - //There are no chars that need encoding - if ($matchcount == 0) { - return ($str); - } - - $maxlen = 75 - 7 - strlen($this->CharSet); - // Try to select the encoding which should produce the shortest output - if ($matchcount > strlen($str) / 3) { - // More than a third of the content will need encoding, so B encoding will be most efficient - $encoding = 'B'; - if (function_exists('mb_strlen') && $this->hasMultiBytes($str)) { - // Use a custom function which correctly encodes and wraps long - // multibyte strings without breaking lines within a character - $encoded = $this->base64EncodeWrapMB($str, "\n"); - } else { - $encoded = base64_encode($str); - $maxlen -= $maxlen % 4; - $encoded = trim(chunk_split($encoded, $maxlen, "\n")); - } - } else { - $encoding = 'Q'; - $encoded = $this->encodeQ($str, $position); - $encoded = $this->wrapText($encoded, $maxlen, true); - $encoded = str_replace('=' . self::CRLF, "\n", trim($encoded)); - } - - $encoded = preg_replace('/^(.*)$/m', ' =?' . $this->CharSet . "?$encoding?\\1?=", $encoded); - $encoded = trim(str_replace("\n", $this->LE, $encoded)); - - return $encoded; - } - - /** - * Check if a string contains multi-byte characters. - * @access public - * @param string $str multi-byte text to wrap encode - * @return boolean - */ - public function hasMultiBytes($str) - { - if (function_exists('mb_strlen')) { - return (strlen($str) > mb_strlen($str, $this->CharSet)); - } else { // Assume no multibytes (we can't handle without mbstring functions anyway) - return false; - } - } - - /** - * Does a string contain any 8-bit chars (in any charset)? - * @param string $text - * @return boolean - */ - public function has8bitChars($text) - { - return (boolean)preg_match('/[\x80-\xFF]/', $text); - } - - /** - * Encode and wrap long multibyte strings for mail headers - * without breaking lines within a character. - * Adapted from a function by paravoid - * @link http://www.php.net/manual/en/function.mb-encode-mimeheader.php#60283 - * @access public - * @param string $str multi-byte text to wrap encode - * @param string $linebreak string to use as linefeed/end-of-line - * @return string - */ - public function base64EncodeWrapMB($str, $linebreak = null) - { - $start = '=?' . $this->CharSet . '?B?'; - $end = '?='; - $encoded = ''; - if ($linebreak === null) { - $linebreak = $this->LE; - } - - $mb_length = mb_strlen($str, $this->CharSet); - // Each line must have length <= 75, including $start and $end - $length = 75 - strlen($start) - strlen($end); - // Average multi-byte ratio - $ratio = $mb_length / strlen($str); - // Base64 has a 4:3 ratio - $avgLength = floor($length * $ratio * .75); - - for ($i = 0; $i < $mb_length; $i += $offset) { - $lookBack = 0; - do { - $offset = $avgLength - $lookBack; - $chunk = mb_substr($str, $i, $offset, $this->CharSet); - $chunk = base64_encode($chunk); - $lookBack++; - } while (strlen($chunk) > $length); - $encoded .= $chunk . $linebreak; - } - - // Chomp the last linefeed - $encoded = substr($encoded, 0, -strlen($linebreak)); - return $encoded; - } - - /** - * Encode a string in quoted-printable format. - * According to RFC2045 section 6.7. - * @access public - * @param string $string The text to encode - * @param integer $line_max Number of chars allowed on a line before wrapping - * @return string - * @link http://www.php.net/manual/en/function.quoted-printable-decode.php#89417 Adapted from this comment - */ - public function encodeQP($string, $line_max = 76) - { - // Use native function if it's available (>= PHP5.3) - if (function_exists('quoted_printable_encode')) { - return quoted_printable_encode($string); - } - // Fall back to a pure PHP implementation - $string = str_replace( - array('%20', '%0D%0A.', '%0D%0A', '%'), - array(' ', "\r\n=2E", "\r\n", '='), - rawurlencode($string) - ); - return preg_replace('/[^\r\n]{' . ($line_max - 3) . '}[^=\r\n]{2}/', "$0=\r\n", $string); - } - - /** - * Backward compatibility wrapper for an old QP encoding function that was removed. - * @see PHPMailer::encodeQP() - * @access public - * @param string $string - * @param integer $line_max - * @param boolean $space_conv - * @return string - * @deprecated Use encodeQP instead. - */ - public function encodeQPphp( - $string, - $line_max = 76, - /** @noinspection PhpUnusedParameterInspection */ $space_conv = false - ) { - return $this->encodeQP($string, $line_max); - } - - /** - * Encode a string using Q encoding. - * @link http://tools.ietf.org/html/rfc2047 - * @param string $str the text to encode - * @param string $position Where the text is going to be used, see the RFC for what that means - * @access public - * @return string - */ - public function encodeQ($str, $position = 'text') - { - // There should not be any EOL in the string - $pattern = ''; - $encoded = str_replace(array("\r", "\n"), '', $str); - switch (strtolower($position)) { - case 'phrase': - // RFC 2047 section 5.3 - $pattern = '^A-Za-z0-9!*+\/ -'; - break; - /** @noinspection PhpMissingBreakStatementInspection */ - case 'comment': - // RFC 2047 section 5.2 - $pattern = '\(\)"'; - // intentional fall-through - // for this reason we build the $pattern without including delimiters and [] - case 'text': - default: - // RFC 2047 section 5.1 - // Replace every high ascii, control, =, ? and _ characters - $pattern = '\000-\011\013\014\016-\037\075\077\137\177-\377' . $pattern; - break; - } - $matches = array(); - if (preg_match_all("/[{$pattern}]/", $encoded, $matches)) { - // If the string contains an '=', make sure it's the first thing we replace - // so as to avoid double-encoding - $eqkey = array_search('=', $matches[0]); - if (false !== $eqkey) { - unset($matches[0][$eqkey]); - array_unshift($matches[0], '='); - } - foreach (array_unique($matches[0]) as $char) { - $encoded = str_replace($char, '=' . sprintf('%02X', ord($char)), $encoded); - } - } - // Replace every spaces to _ (more readable than =20) - return str_replace(' ', '_', $encoded); - } - - /** - * Add a string or binary attachment (non-filesystem). - * This method can be used to attach ascii or binary data, - * such as a BLOB record from a database. - * @param string $string String attachment data. - * @param string $filename Name of the attachment. - * @param string $encoding File encoding (see $Encoding). - * @param string $type File extension (MIME) type. - * @param string $disposition Disposition to use - * @return void - */ - public function addStringAttachment( - $string, - $filename, - $encoding = 'base64', - $type = '', - $disposition = 'attachment' - ) { - // If a MIME type is not specified, try to work it out from the file name - if ($type == '') { - $type = self::filenameToType($filename); - } - // Append to $attachment array - $this->attachment[] = array( - 0 => $string, - 1 => $filename, - 2 => basename($filename), - 3 => $encoding, - 4 => $type, - 5 => true, // isStringAttachment - 6 => $disposition, - 7 => 0 - ); - } - - /** - * Add an embedded (inline) attachment from a file. - * This can include images, sounds, and just about any other document type. - * These differ from 'regular' attachments in that they are intended to be - * displayed inline with the message, not just attached for download. - * This is used in HTML messages that embed the images - * the HTML refers to using the $cid value. - * Never use a user-supplied path to a file! - * @param string $path Path to the attachment. - * @param string $cid Content ID of the attachment; Use this to reference - * the content when using an embedded image in HTML. - * @param string $name Overrides the attachment name. - * @param string $encoding File encoding (see $Encoding). - * @param string $type File MIME type. - * @param string $disposition Disposition to use - * @return boolean True on successfully adding an attachment - */ - public function addEmbeddedImage($path, $cid, $name = '', $encoding = 'base64', $type = '', $disposition = 'inline') - { - if (!self::isPermittedPath($path) or !@is_file($path)) { - $this->setError($this->lang('file_access') . $path); - return false; - } - - // If a MIME type is not specified, try to work it out from the file name - if ($type == '') { - $type = self::filenameToType($path); - } - - $filename = basename($path); - if ($name == '') { - $name = $filename; - } - - // Append to $attachment array - $this->attachment[] = array( - 0 => $path, - 1 => $filename, - 2 => $name, - 3 => $encoding, - 4 => $type, - 5 => false, // isStringAttachment - 6 => $disposition, - 7 => $cid - ); - return true; - } - - /** - * Add an embedded stringified attachment. - * This can include images, sounds, and just about any other document type. - * Be sure to set the $type to an image type for images: - * JPEG images use 'image/jpeg', GIF uses 'image/gif', PNG uses 'image/png'. - * @param string $string The attachment binary data. - * @param string $cid Content ID of the attachment; Use this to reference - * the content when using an embedded image in HTML. - * @param string $name - * @param string $encoding File encoding (see $Encoding). - * @param string $type MIME type. - * @param string $disposition Disposition to use - * @return boolean True on successfully adding an attachment - */ - public function addStringEmbeddedImage( - $string, - $cid, - $name = '', - $encoding = 'base64', - $type = '', - $disposition = 'inline' - ) { - // If a MIME type is not specified, try to work it out from the name - if ($type == '' and !empty($name)) { - $type = self::filenameToType($name); - } - - // Append to $attachment array - $this->attachment[] = array( - 0 => $string, - 1 => $name, - 2 => $name, - 3 => $encoding, - 4 => $type, - 5 => true, // isStringAttachment - 6 => $disposition, - 7 => $cid - ); - return true; - } - - /** - * Check if an inline attachment is present. - * @access public - * @return boolean - */ - public function inlineImageExists() - { - foreach ($this->attachment as $attachment) { - if ($attachment[6] == 'inline') { - return true; - } - } - return false; - } - - /** - * Check if an attachment (non-inline) is present. - * @return boolean - */ - public function attachmentExists() - { - foreach ($this->attachment as $attachment) { - if ($attachment[6] == 'attachment') { - return true; - } - } - return false; - } - - /** - * Check if this message has an alternative body set. - * @return boolean - */ - public function alternativeExists() - { - return !empty($this->AltBody); - } - - /** - * Clear queued addresses of given kind. - * @access protected - * @param string $kind 'to', 'cc', or 'bcc' - * @return void - */ - public function clearQueuedAddresses($kind) - { - $RecipientsQueue = $this->RecipientsQueue; - foreach ($RecipientsQueue as $address => $params) { - if ($params[0] == $kind) { - unset($this->RecipientsQueue[$address]); - } - } - } - - /** - * Clear all To recipients. - * @return void - */ - public function clearAddresses() - { - foreach ($this->to as $to) { - unset($this->all_recipients[strtolower($to[0])]); - } - $this->to = array(); - $this->clearQueuedAddresses('to'); - } - - /** - * Clear all CC recipients. - * @return void - */ - public function clearCCs() - { - foreach ($this->cc as $cc) { - unset($this->all_recipients[strtolower($cc[0])]); - } - $this->cc = array(); - $this->clearQueuedAddresses('cc'); - } - - /** - * Clear all BCC recipients. - * @return void - */ - public function clearBCCs() - { - foreach ($this->bcc as $bcc) { - unset($this->all_recipients[strtolower($bcc[0])]); - } - $this->bcc = array(); - $this->clearQueuedAddresses('bcc'); - } - - /** - * Clear all ReplyTo recipients. - * @return void - */ - public function clearReplyTos() - { - $this->ReplyTo = array(); - $this->ReplyToQueue = array(); - } - - /** - * Clear all recipient types. - * @return void - */ - public function clearAllRecipients() - { - $this->to = array(); - $this->cc = array(); - $this->bcc = array(); - $this->all_recipients = array(); - $this->RecipientsQueue = array(); - } - - /** - * Clear all filesystem, string, and binary attachments. - * @return void - */ - public function clearAttachments() - { - $this->attachment = array(); - } - - /** - * Clear all custom headers. - * @return void - */ - public function clearCustomHeaders() - { - $this->CustomHeader = array(); - } - - /** - * Add an error message to the error container. - * @access protected - * @param string $msg - * @return void - */ - protected function setError($msg) - { - $this->error_count++; - if ($this->Mailer == 'smtp' and !is_null($this->smtp)) { - $lasterror = $this->smtp->getError(); - if (!empty($lasterror['error'])) { - $msg .= $this->lang('smtp_error') . $lasterror['error']; - if (!empty($lasterror['detail'])) { - $msg .= ' Detail: '. $lasterror['detail']; - } - if (!empty($lasterror['smtp_code'])) { - $msg .= ' SMTP code: ' . $lasterror['smtp_code']; - } - if (!empty($lasterror['smtp_code_ex'])) { - $msg .= ' Additional SMTP info: ' . $lasterror['smtp_code_ex']; - } - } - } - $this->ErrorInfo = $msg; - } - - /** - * Return an RFC 822 formatted date. - * @access public - * @return string - * @static - */ - public static function rfcDate() - { - // Set the time zone to whatever the default is to avoid 500 errors - // Will default to UTC if it's not set properly in php.ini - date_default_timezone_set(@date_default_timezone_get()); - return date('D, j M Y H:i:s O'); - } - - /** - * Get the server hostname. - * Returns 'localhost.localdomain' if unknown. - * @access protected - * @return string - */ - protected function serverHostname() - { - $result = 'localhost.localdomain'; - if (!empty($this->Hostname)) { - $result = $this->Hostname; - } elseif (isset($_SERVER) and array_key_exists('SERVER_NAME', $_SERVER) and !empty($_SERVER['SERVER_NAME'])) { - $result = $_SERVER['SERVER_NAME']; - } elseif (function_exists('gethostname') && gethostname() !== false) { - $result = gethostname(); - } elseif (php_uname('n') !== false) { - $result = php_uname('n'); - } - return $result; - } - - /** - * Get an error message in the current language. - * @access protected - * @param string $key - * @return string - */ - protected function lang($key) - { - if (count($this->language) < 1) { - $this->setLanguage('en'); // set the default language - } - - if (array_key_exists($key, $this->language)) { - if ($key == 'smtp_connect_failed') { - //Include a link to troubleshooting docs on SMTP connection failure - //this is by far the biggest cause of support questions - //but it's usually not PHPMailer's fault. - return $this->language[$key] . ' https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting'; - } - return $this->language[$key]; - } else { - //Return the key as a fallback - return $key; - } - } - - /** - * Check if an error occurred. - * @access public - * @return boolean True if an error did occur. - */ - public function isError() - { - return ($this->error_count > 0); - } - - /** - * Ensure consistent line endings in a string. - * Changes every end of line from CRLF, CR or LF to $this->LE. - * @access public - * @param string $str String to fixEOL - * @return string - */ - public function fixEOL($str) - { - // Normalise to \n - $nstr = str_replace(array("\r\n", "\r"), "\n", $str); - // Now convert LE as needed - if ($this->LE !== "\n") { - $nstr = str_replace("\n", $this->LE, $nstr); - } - return $nstr; - } - - /** - * Add a custom header. - * $name value can be overloaded to contain - * both header name and value (name:value) - * @access public - * @param string $name Custom header name - * @param string $value Header value - * @return void - */ - public function addCustomHeader($name, $value = null) - { - if ($value === null) { - // Value passed in as name:value - $this->CustomHeader[] = explode(':', $name, 2); - } else { - $this->CustomHeader[] = array($name, $value); - } - } - - /** - * Returns all custom headers. - * @return array - */ - public function getCustomHeaders() - { - return $this->CustomHeader; - } - - /** - * Create a message body from an HTML string. - * Automatically inlines images and creates a plain-text version by converting the HTML, - * overwriting any existing values in Body and AltBody. - * Do not source $message content from user input! - * $basedir is prepended when handling relative URLs, e.g. and must not be empty - * will look for an image file in $basedir/images/a.png and convert it to inline. - * If you don't provide a $basedir, relative paths will be left untouched (and thus probably break in email) - * If you don't want to apply these transformations to your HTML, just set Body and AltBody directly. - * @access public - * @param string $message HTML message string - * @param string $basedir Absolute path to a base directory to prepend to relative paths to images - * @param boolean|callable $advanced Whether to use the internal HTML to text converter - * or your own custom converter @see PHPMailer::html2text() - * @return string $message The transformed message Body - */ - public function msgHTML($message, $basedir = '', $advanced = false) - { - preg_match_all('/(src|background)=["\'](.*)["\']/Ui', $message, $images); - if (array_key_exists(2, $images)) { - if (strlen($basedir) > 1 && substr($basedir, -1) != '/') { - // Ensure $basedir has a trailing / - $basedir .= '/'; - } - foreach ($images[2] as $imgindex => $url) { - // Convert data URIs into embedded images - if (preg_match('#^data:(image[^;,]*)(;base64)?,#', $url, $match)) { - $data = substr($url, strpos($url, ',')); - if ($match[2]) { - $data = base64_decode($data); - } else { - $data = rawurldecode($data); - } - $cid = md5($url) . '@phpmailer.0'; // RFC2392 S 2 - if ($this->addStringEmbeddedImage($data, $cid, 'embed' . $imgindex, 'base64', $match[1])) { - $message = str_replace( - $images[0][$imgindex], - $images[1][$imgindex] . '="cid:' . $cid . '"', - $message - ); - } - continue; - } - if ( - // Only process relative URLs if a basedir is provided (i.e. no absolute local paths) - !empty($basedir) - // Ignore URLs containing parent dir traversal (..) - && (strpos($url, '..') === false) - // Do not change urls that are already inline images - && substr($url, 0, 4) !== 'cid:' - // Do not change absolute URLs, including anonymous protocol - && !preg_match('#^[a-z][a-z0-9+.-]*:?//#i', $url) - ) { - $filename = basename($url); - $directory = dirname($url); - if ($directory == '.') { - $directory = ''; - } - $cid = md5($url) . '@phpmailer.0'; // RFC2392 S 2 - if (strlen($directory) > 1 && substr($directory, -1) != '/') { - $directory .= '/'; - } - if ($this->addEmbeddedImage( - $basedir . $directory . $filename, - $cid, - $filename, - 'base64', - self::_mime_types((string)self::mb_pathinfo($filename, PATHINFO_EXTENSION)) - ) - ) { - $message = preg_replace( - '/' . $images[1][$imgindex] . '=["\']' . preg_quote($url, '/') . '["\']/Ui', - $images[1][$imgindex] . '="cid:' . $cid . '"', - $message - ); - } - } - } - } - $this->isHTML(true); - // Convert all message body line breaks to CRLF, makes quoted-printable encoding work much better - $this->Body = $this->normalizeBreaks($message); - $this->AltBody = $this->normalizeBreaks($this->html2text($message, $advanced)); - if (!$this->alternativeExists()) { - $this->AltBody = 'To view this email message, open it in a program that understands HTML!' . - self::CRLF . self::CRLF; - } - return $this->Body; - } - - /** - * Convert an HTML string into plain text. - * This is used by msgHTML(). - * Note - older versions of this function used a bundled advanced converter - * which was been removed for license reasons in #232. - * Example usage: - * - * // Use default conversion - * $plain = $mail->html2text($html); - * // Use your own custom converter - * $plain = $mail->html2text($html, function($html) { - * $converter = new MyHtml2text($html); - * return $converter->get_text(); - * }); - * - * @param string $html The HTML text to convert - * @param boolean|callable $advanced Any boolean value to use the internal converter, - * or provide your own callable for custom conversion. - * @return string - */ - public function html2text($html, $advanced = false) - { - if (is_callable($advanced)) { - return call_user_func($advanced, $html); - } - return html_entity_decode( - trim(strip_tags(preg_replace('/<(head|title|style|script)[^>]*>.*?<\/\\1>/si', '', $html))), - ENT_QUOTES, - $this->CharSet - ); - } - - /** - * Get the MIME type for a file extension. - * @param string $ext File extension - * @access public - * @return string MIME type of file. - * @static - */ - public static function _mime_types($ext = '') - { - $mimes = array( - 'xl' => 'application/excel', - 'js' => 'application/javascript', - 'hqx' => 'application/mac-binhex40', - 'cpt' => 'application/mac-compactpro', - 'bin' => 'application/macbinary', - 'doc' => 'application/msword', - 'word' => 'application/msword', - 'xlsx' => 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet', - 'xltx' => 'application/vnd.openxmlformats-officedocument.spreadsheetml.template', - 'potx' => 'application/vnd.openxmlformats-officedocument.presentationml.template', - 'ppsx' => 'application/vnd.openxmlformats-officedocument.presentationml.slideshow', - 'pptx' => 'application/vnd.openxmlformats-officedocument.presentationml.presentation', - 'sldx' => 'application/vnd.openxmlformats-officedocument.presentationml.slide', - 'docx' => 'application/vnd.openxmlformats-officedocument.wordprocessingml.document', - 'dotx' => 'application/vnd.openxmlformats-officedocument.wordprocessingml.template', - 'xlam' => 'application/vnd.ms-excel.addin.macroEnabled.12', - 'xlsb' => 'application/vnd.ms-excel.sheet.binary.macroEnabled.12', - 'class' => 'application/octet-stream', - 'dll' => 'application/octet-stream', - 'dms' => 'application/octet-stream', - 'exe' => 'application/octet-stream', - 'lha' => 'application/octet-stream', - 'lzh' => 'application/octet-stream', - 'psd' => 'application/octet-stream', - 'sea' => 'application/octet-stream', - 'so' => 'application/octet-stream', - 'oda' => 'application/oda', - 'pdf' => 'application/pdf', - 'ai' => 'application/postscript', - 'eps' => 'application/postscript', - 'ps' => 'application/postscript', - 'smi' => 'application/smil', - 'smil' => 'application/smil', - 'mif' => 'application/vnd.mif', - 'xls' => 'application/vnd.ms-excel', - 'ppt' => 'application/vnd.ms-powerpoint', - 'wbxml' => 'application/vnd.wap.wbxml', - 'wmlc' => 'application/vnd.wap.wmlc', - 'dcr' => 'application/x-director', - 'dir' => 'application/x-director', - 'dxr' => 'application/x-director', - 'dvi' => 'application/x-dvi', - 'gtar' => 'application/x-gtar', - 'php3' => 'application/x-httpd-php', - 'php4' => 'application/x-httpd-php', - 'php' => 'application/x-httpd-php', - 'phtml' => 'application/x-httpd-php', - 'phps' => 'application/x-httpd-php-source', - 'swf' => 'application/x-shockwave-flash', - 'sit' => 'application/x-stuffit', - 'tar' => 'application/x-tar', - 'tgz' => 'application/x-tar', - 'xht' => 'application/xhtml+xml', - 'xhtml' => 'application/xhtml+xml', - 'zip' => 'application/zip', - 'mid' => 'audio/midi', - 'midi' => 'audio/midi', - 'mp2' => 'audio/mpeg', - 'mp3' => 'audio/mpeg', - 'mpga' => 'audio/mpeg', - 'aif' => 'audio/x-aiff', - 'aifc' => 'audio/x-aiff', - 'aiff' => 'audio/x-aiff', - 'ram' => 'audio/x-pn-realaudio', - 'rm' => 'audio/x-pn-realaudio', - 'rpm' => 'audio/x-pn-realaudio-plugin', - 'ra' => 'audio/x-realaudio', - 'wav' => 'audio/x-wav', - 'bmp' => 'image/bmp', - 'gif' => 'image/gif', - 'jpeg' => 'image/jpeg', - 'jpe' => 'image/jpeg', - 'jpg' => 'image/jpeg', - 'png' => 'image/png', - 'tiff' => 'image/tiff', - 'tif' => 'image/tiff', - 'eml' => 'message/rfc822', - 'css' => 'text/css', - 'html' => 'text/html', - 'htm' => 'text/html', - 'shtml' => 'text/html', - 'log' => 'text/plain', - 'text' => 'text/plain', - 'txt' => 'text/plain', - 'rtx' => 'text/richtext', - 'rtf' => 'text/rtf', - 'vcf' => 'text/vcard', - 'vcard' => 'text/vcard', - 'xml' => 'text/xml', - 'xsl' => 'text/xml', - 'mpeg' => 'video/mpeg', - 'mpe' => 'video/mpeg', - 'mpg' => 'video/mpeg', - 'mov' => 'video/quicktime', - 'qt' => 'video/quicktime', - 'rv' => 'video/vnd.rn-realvideo', - 'avi' => 'video/x-msvideo', - 'movie' => 'video/x-sgi-movie' - ); - if (array_key_exists(strtolower($ext), $mimes)) { - return $mimes[strtolower($ext)]; - } - return 'application/octet-stream'; - } - - /** - * Map a file name to a MIME type. - * Defaults to 'application/octet-stream', i.e.. arbitrary binary data. - * @param string $filename A file name or full path, does not need to exist as a file - * @return string - * @static - */ - public static function filenameToType($filename) - { - // In case the path is a URL, strip any query string before getting extension - $qpos = strpos($filename, '?'); - if (false !== $qpos) { - $filename = substr($filename, 0, $qpos); - } - $pathinfo = self::mb_pathinfo($filename); - return self::_mime_types($pathinfo['extension']); - } - - /** - * Multi-byte-safe pathinfo replacement. - * Drop-in replacement for pathinfo(), but multibyte-safe, cross-platform-safe, old-version-safe. - * Works similarly to the one in PHP >= 5.2.0 - * @link http://www.php.net/manual/en/function.pathinfo.php#107461 - * @param string $path A filename or path, does not need to exist as a file - * @param integer|string $options Either a PATHINFO_* constant, - * or a string name to return only the specified piece, allows 'filename' to work on PHP < 5.2 - * @return string|array - * @static - */ - public static function mb_pathinfo($path, $options = null) - { - $ret = array('dirname' => '', 'basename' => '', 'extension' => '', 'filename' => ''); - $pathinfo = array(); - if (preg_match('%^(.*?)[\\\\/]*(([^/\\\\]*?)(\.([^\.\\\\/]+?)|))[\\\\/\.]*$%im', $path, $pathinfo)) { - if (array_key_exists(1, $pathinfo)) { - $ret['dirname'] = $pathinfo[1]; - } - if (array_key_exists(2, $pathinfo)) { - $ret['basename'] = $pathinfo[2]; - } - if (array_key_exists(5, $pathinfo)) { - $ret['extension'] = $pathinfo[5]; - } - if (array_key_exists(3, $pathinfo)) { - $ret['filename'] = $pathinfo[3]; - } - } - switch ($options) { - case PATHINFO_DIRNAME: - case 'dirname': - return $ret['dirname']; - case PATHINFO_BASENAME: - case 'basename': - return $ret['basename']; - case PATHINFO_EXTENSION: - case 'extension': - return $ret['extension']; - case PATHINFO_FILENAME: - case 'filename': - return $ret['filename']; - default: - return $ret; - } - } - - /** - * Set or reset instance properties. - * You should avoid this function - it's more verbose, less efficient, more error-prone and - * harder to debug than setting properties directly. - * Usage Example: - * `$mail->set('SMTPSecure', 'tls');` - * is the same as: - * `$mail->SMTPSecure = 'tls';` - * @access public - * @param string $name The property name to set - * @param mixed $value The value to set the property to - * @return boolean - * @TODO Should this not be using the __set() magic function? - */ - public function set($name, $value = '') - { - if (property_exists($this, $name)) { - $this->$name = $value; - return true; - } else { - $this->setError($this->lang('variable_set') . $name); - return false; - } - } - - /** - * Strip newlines to prevent header injection. - * @access public - * @param string $str - * @return string - */ - public function secureHeader($str) - { - return trim(str_replace(array("\r", "\n"), '', $str)); - } - - /** - * Normalize line breaks in a string. - * Converts UNIX LF, Mac CR and Windows CRLF line breaks into a single line break format. - * Defaults to CRLF (for message bodies) and preserves consecutive breaks. - * @param string $text - * @param string $breaktype What kind of line break to use, defaults to CRLF - * @return string - * @access public - * @static - */ - public static function normalizeBreaks($text, $breaktype = "\r\n") - { - return preg_replace('/(\r\n|\r|\n)/ms', $breaktype, $text); - } - - /** - * Set the public and private key files and password for S/MIME signing. - * @access public - * @param string $cert_filename - * @param string $key_filename - * @param string $key_pass Password for private key - * @param string $extracerts_filename Optional path to chain certificate - */ - public function sign($cert_filename, $key_filename, $key_pass, $extracerts_filename = '') - { - $this->sign_cert_file = $cert_filename; - $this->sign_key_file = $key_filename; - $this->sign_key_pass = $key_pass; - $this->sign_extracerts_file = $extracerts_filename; - } - - /** - * Quoted-Printable-encode a DKIM header. - * @access public - * @param string $txt - * @return string - */ - public function DKIM_QP($txt) - { - $line = ''; - for ($i = 0; $i < strlen($txt); $i++) { - $ord = ord($txt[$i]); - if (((0x21 <= $ord) && ($ord <= 0x3A)) || $ord == 0x3C || ((0x3E <= $ord) && ($ord <= 0x7E))) { - $line .= $txt[$i]; - } else { - $line .= '=' . sprintf('%02X', $ord); - } - } - return $line; - } - - /** - * Generate a DKIM signature. - * @access public - * @param string $signHeader - * @throws phpmailerException - * @return string The DKIM signature value - */ - public function DKIM_Sign($signHeader) - { - if (!defined('PKCS7_TEXT')) { - if ($this->exceptions) { - throw new phpmailerException($this->lang('extension_missing') . 'openssl'); - } - return ''; - } - $privKeyStr = !empty($this->DKIM_private_string) ? $this->DKIM_private_string : file_get_contents($this->DKIM_private); - if ('' != $this->DKIM_passphrase) { - $privKey = openssl_pkey_get_private($privKeyStr, $this->DKIM_passphrase); - } else { - $privKey = openssl_pkey_get_private($privKeyStr); - } - //Workaround for missing digest algorithms in old PHP & OpenSSL versions - //@link http://stackoverflow.com/a/11117338/333340 - if (version_compare(PHP_VERSION, '5.3.0') >= 0 and - in_array('sha256WithRSAEncryption', openssl_get_md_methods(true))) { - if (openssl_sign($signHeader, $signature, $privKey, 'sha256WithRSAEncryption')) { - openssl_pkey_free($privKey); - return base64_encode($signature); - } - } else { - $pinfo = openssl_pkey_get_details($privKey); - $hash = hash('sha256', $signHeader); - //'Magic' constant for SHA256 from RFC3447 - //@link https://tools.ietf.org/html/rfc3447#page-43 - $t = '3031300d060960864801650304020105000420' . $hash; - $pslen = $pinfo['bits'] / 8 - (strlen($t) / 2 + 3); - $eb = pack('H*', '0001' . str_repeat('FF', $pslen) . '00' . $t); - - if (openssl_private_encrypt($eb, $signature, $privKey, OPENSSL_NO_PADDING)) { - openssl_pkey_free($privKey); - return base64_encode($signature); - } - } - openssl_pkey_free($privKey); - return ''; - } - - /** - * Generate a DKIM canonicalization header. - * @access public - * @param string $signHeader Header - * @return string - */ - public function DKIM_HeaderC($signHeader) - { - $signHeader = preg_replace('/\r\n\s+/', ' ', $signHeader); - $lines = explode("\r\n", $signHeader); - foreach ($lines as $key => $line) { - list($heading, $value) = explode(':', $line, 2); - $heading = strtolower($heading); - $value = preg_replace('/\s{2,}/', ' ', $value); // Compress useless spaces - $lines[$key] = $heading . ':' . trim($value); // Don't forget to remove WSP around the value - } - $signHeader = implode("\r\n", $lines); - return $signHeader; - } - - /** - * Generate a DKIM canonicalization body. - * @access public - * @param string $body Message Body - * @return string - */ - public function DKIM_BodyC($body) - { - if ($body == '') { - return "\r\n"; - } - // stabilize line endings - $body = str_replace("\r\n", "\n", $body); - $body = str_replace("\n", "\r\n", $body); - // END stabilize line endings - while (substr($body, strlen($body) - 4, 4) == "\r\n\r\n") { - $body = substr($body, 0, strlen($body) - 2); - } - return $body; - } - - /** - * Create the DKIM header and body in a new message header. - * @access public - * @param string $headers_line Header lines - * @param string $subject Subject - * @param string $body Body - * @return string - */ - public function DKIM_Add($headers_line, $subject, $body) - { - $DKIMsignatureType = 'rsa-sha256'; // Signature & hash algorithms - $DKIMcanonicalization = 'relaxed/simple'; // Canonicalization of header/body - $DKIMquery = 'dns/txt'; // Query method - $DKIMtime = time(); // Signature Timestamp = seconds since 00:00:00 - Jan 1, 1970 (UTC time zone) - $subject_header = "Subject: $subject"; - $headers = explode($this->LE, $headers_line); - $from_header = ''; - $to_header = ''; - $date_header = ''; - $current = ''; - foreach ($headers as $header) { - if (strpos($header, 'From:') === 0) { - $from_header = $header; - $current = 'from_header'; - } elseif (strpos($header, 'To:') === 0) { - $to_header = $header; - $current = 'to_header'; - } elseif (strpos($header, 'Date:') === 0) { - $date_header = $header; - $current = 'date_header'; - } else { - if (!empty($$current) && strpos($header, ' =?') === 0) { - $$current .= $header; - } else { - $current = ''; - } - } - } - $from = str_replace('|', '=7C', $this->DKIM_QP($from_header)); - $to = str_replace('|', '=7C', $this->DKIM_QP($to_header)); - $date = str_replace('|', '=7C', $this->DKIM_QP($date_header)); - $subject = str_replace( - '|', - '=7C', - $this->DKIM_QP($subject_header) - ); // Copied header fields (dkim-quoted-printable) - $body = $this->DKIM_BodyC($body); - $DKIMlen = strlen($body); // Length of body - $DKIMb64 = base64_encode(pack('H*', hash('sha256', $body))); // Base64 of packed binary SHA-256 hash of body - if ('' == $this->DKIM_identity) { - $ident = ''; - } else { - $ident = ' i=' . $this->DKIM_identity . ';'; - } - $dkimhdrs = 'DKIM-Signature: v=1; a=' . - $DKIMsignatureType . '; q=' . - $DKIMquery . '; l=' . - $DKIMlen . '; s=' . - $this->DKIM_selector . - ";\r\n" . - "\tt=" . $DKIMtime . '; c=' . $DKIMcanonicalization . ";\r\n" . - "\th=From:To:Date:Subject;\r\n" . - "\td=" . $this->DKIM_domain . ';' . $ident . "\r\n" . - "\tz=$from\r\n" . - "\t|$to\r\n" . - "\t|$date\r\n" . - "\t|$subject;\r\n" . - "\tbh=" . $DKIMb64 . ";\r\n" . - "\tb="; - $toSign = $this->DKIM_HeaderC( - $from_header . "\r\n" . - $to_header . "\r\n" . - $date_header . "\r\n" . - $subject_header . "\r\n" . - $dkimhdrs - ); - $signed = $this->DKIM_Sign($toSign); - return $dkimhdrs . $signed . "\r\n"; - } - - /** - * Detect if a string contains a line longer than the maximum line length allowed. - * @param string $str - * @return boolean - * @static - */ - public static function hasLineLongerThanMax($str) - { - //+2 to include CRLF line break for a 1000 total - return (boolean)preg_match('/^(.{'.(self::MAX_LINE_LENGTH + 2).',})/m', $str); - } - - /** - * Allows for public read access to 'to' property. - * @note: Before the send() call, queued addresses (i.e. with IDN) are not yet included. - * @access public - * @return array - */ - public function getToAddresses() - { - return $this->to; - } - - /** - * Allows for public read access to 'cc' property. - * @note: Before the send() call, queued addresses (i.e. with IDN) are not yet included. - * @access public - * @return array - */ - public function getCcAddresses() - { - return $this->cc; - } - - /** - * Allows for public read access to 'bcc' property. - * @note: Before the send() call, queued addresses (i.e. with IDN) are not yet included. - * @access public - * @return array - */ - public function getBccAddresses() - { - return $this->bcc; - } - - /** - * Allows for public read access to 'ReplyTo' property. - * @note: Before the send() call, queued addresses (i.e. with IDN) are not yet included. - * @access public - * @return array - */ - public function getReplyToAddresses() - { - return $this->ReplyTo; - } - - /** - * Allows for public read access to 'all_recipients' property. - * @note: Before the send() call, queued addresses (i.e. with IDN) are not yet included. - * @access public - * @return array - */ - public function getAllRecipientAddresses() - { - return $this->all_recipients; - } - - /** - * Perform a callback. - * @param boolean $isSent - * @param array $to - * @param array $cc - * @param array $bcc - * @param string $subject - * @param string $body - * @param string $from - */ - protected function doCallback($isSent, $to, $cc, $bcc, $subject, $body, $from) - { - if (!empty($this->action_function) && is_callable($this->action_function)) { - $params = array($isSent, $to, $cc, $bcc, $subject, $body, $from); - call_user_func_array($this->action_function, $params); - } - } -} - -/** - * PHPMailer exception handler - * @package PHPMailer - */ -class phpmailerException extends Exception -{ - /** - * Prettify error message output - * @return string - */ - public function errorMessage() - { - $errorMsg = '' . htmlspecialchars($this->getMessage()) . "
\n"; - return $errorMsg; - } -} diff --git a/conlite/external/phpmailer/phpmailer/class.phpmaileroauth.php b/conlite/external/phpmailer/phpmailer/class.phpmaileroauth.php deleted file mode 100644 index b1bb09f..0000000 --- a/conlite/external/phpmailer/phpmailer/class.phpmaileroauth.php +++ /dev/null @@ -1,197 +0,0 @@ - - * @author Jim Jagielski (jimjag) - * @author Andy Prevost (codeworxtech) - * @author Brent R. Matzelle (original founder) - * @copyright 2012 - 2014 Marcus Bointon - * @copyright 2010 - 2012 Jim Jagielski - * @copyright 2004 - 2009 Andy Prevost - * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License - * @note This program is distributed in the hope that it will be useful - WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. - */ - -/** - * PHPMailerOAuth - PHPMailer subclass adding OAuth support. - * @package PHPMailer - * @author @sherryl4george - * @author Marcus Bointon (@Synchro) - */ -class PHPMailerOAuth extends PHPMailer -{ - /** - * The OAuth user's email address - * @var string - */ - public $oauthUserEmail = ''; - - /** - * The OAuth refresh token - * @var string - */ - public $oauthRefreshToken = ''; - - /** - * The OAuth client ID - * @var string - */ - public $oauthClientId = ''; - - /** - * The OAuth client secret - * @var string - */ - public $oauthClientSecret = ''; - - /** - * An instance of the PHPMailerOAuthGoogle class. - * @var PHPMailerOAuthGoogle - * @access protected - */ - protected $oauth = null; - - /** - * Get a PHPMailerOAuthGoogle instance to use. - * @return PHPMailerOAuthGoogle - */ - public function getOAUTHInstance() - { - if (!is_object($this->oauth)) { - $this->oauth = new PHPMailerOAuthGoogle( - $this->oauthUserEmail, - $this->oauthClientSecret, - $this->oauthClientId, - $this->oauthRefreshToken - ); - } - return $this->oauth; - } - - /** - * Initiate a connection to an SMTP server. - * Overrides the original smtpConnect method to add support for OAuth. - * @param array $options An array of options compatible with stream_context_create() - * @uses SMTP - * @access public - * @return bool - * @throws phpmailerException - */ - public function smtpConnect($options = array()) - { - if (is_null($this->smtp)) { - $this->smtp = $this->getSMTPInstance(); - } - - if (is_null($this->oauth)) { - $this->oauth = $this->getOAUTHInstance(); - } - - // Already connected? - if ($this->smtp->connected()) { - return true; - } - - $this->smtp->setTimeout($this->Timeout); - $this->smtp->setDebugLevel($this->SMTPDebug); - $this->smtp->setDebugOutput($this->Debugoutput); - $this->smtp->setVerp($this->do_verp); - $hosts = explode(';', $this->Host); - $lastexception = null; - - foreach ($hosts as $hostentry) { - $hostinfo = array(); - if (!preg_match('/^((ssl|tls):\/\/)*([a-zA-Z0-9\.-]*):?([0-9]*)$/', trim($hostentry), $hostinfo)) { - // Not a valid host entry - continue; - } - // $hostinfo[2]: optional ssl or tls prefix - // $hostinfo[3]: the hostname - // $hostinfo[4]: optional port number - // The host string prefix can temporarily override the current setting for SMTPSecure - // If it's not specified, the default value is used - $prefix = ''; - $secure = $this->SMTPSecure; - $tls = ($this->SMTPSecure == 'tls'); - if ('ssl' == $hostinfo[2] or ('' == $hostinfo[2] and 'ssl' == $this->SMTPSecure)) { - $prefix = 'ssl://'; - $tls = false; // Can't have SSL and TLS at the same time - $secure = 'ssl'; - } elseif ($hostinfo[2] == 'tls') { - $tls = true; - // tls doesn't use a prefix - $secure = 'tls'; - } - //Do we need the OpenSSL extension? - $sslext = defined('OPENSSL_ALGO_SHA1'); - if ('tls' === $secure or 'ssl' === $secure) { - //Check for an OpenSSL constant rather than using extension_loaded, which is sometimes disabled - if (!$sslext) { - throw new phpmailerException($this->lang('extension_missing').'openssl', self::STOP_CRITICAL); - } - } - $host = $hostinfo[3]; - $port = $this->Port; - $tport = (integer)$hostinfo[4]; - if ($tport > 0 and $tport < 65536) { - $port = $tport; - } - if ($this->smtp->connect($prefix . $host, $port, $this->Timeout, $options)) { - try { - if ($this->Helo) { - $hello = $this->Helo; - } else { - $hello = $this->serverHostname(); - } - $this->smtp->hello($hello); - //Automatically enable TLS encryption if: - // * it's not disabled - // * we have openssl extension - // * we are not already using SSL - // * the server offers STARTTLS - if ($this->SMTPAutoTLS and $sslext and $secure != 'ssl' and $this->smtp->getServerExt('STARTTLS')) { - $tls = true; - } - if ($tls) { - if (!$this->smtp->startTLS()) { - throw new phpmailerException($this->lang('connect_host')); - } - // We must resend HELO after tls negotiation - $this->smtp->hello($hello); - } - if ($this->SMTPAuth) { - if (!$this->smtp->authenticate( - $this->Username, - $this->Password, - $this->AuthType, - $this->Realm, - $this->Workstation, - $this->oauth - ) - ) { - throw new phpmailerException($this->lang('authenticate')); - } - } - return true; - } catch (phpmailerException $exc) { - $lastexception = $exc; - $this->edebug($exc->getMessage()); - // We must have connected, but then failed TLS or Auth, so close connection nicely - $this->smtp->quit(); - } - } - } - // If we get here, all connection attempts have failed, so close connection hard - $this->smtp->close(); - // As we've caught all exceptions, just report whatever the last one was - if ($this->exceptions and !is_null($lastexception)) { - throw $lastexception; - } - return false; - } -} diff --git a/conlite/external/phpmailer/phpmailer/class.phpmaileroauthgoogle.php b/conlite/external/phpmailer/phpmailer/class.phpmaileroauthgoogle.php deleted file mode 100644 index 71c9bd3..0000000 --- a/conlite/external/phpmailer/phpmailer/class.phpmaileroauthgoogle.php +++ /dev/null @@ -1,77 +0,0 @@ - - * @author Jim Jagielski (jimjag) - * @author Andy Prevost (codeworxtech) - * @author Brent R. Matzelle (original founder) - * @copyright 2012 - 2014 Marcus Bointon - * @copyright 2010 - 2012 Jim Jagielski - * @copyright 2004 - 2009 Andy Prevost - * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License - * @note This program is distributed in the hope that it will be useful - WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. - */ - -/** - * PHPMailerOAuthGoogle - Wrapper for League OAuth2 Google provider. - * @package PHPMailer - * @author @sherryl4george - * @author Marcus Bointon (@Synchro) - * @link https://github.com/thephpleague/oauth2-client - */ -class PHPMailerOAuthGoogle -{ - private $oauthUserEmail = ''; - private $oauthRefreshToken = ''; - private $oauthClientId = ''; - private $oauthClientSecret = ''; - - /** - * @param string $UserEmail - * @param string $ClientSecret - * @param string $ClientId - * @param string $RefreshToken - */ - public function __construct( - $UserEmail, - $ClientSecret, - $ClientId, - $RefreshToken - ) { - $this->oauthClientId = $ClientId; - $this->oauthClientSecret = $ClientSecret; - $this->oauthRefreshToken = $RefreshToken; - $this->oauthUserEmail = $UserEmail; - } - - private function getProvider() - { - return new League\OAuth2\Client\Provider\Google([ - 'clientId' => $this->oauthClientId, - 'clientSecret' => $this->oauthClientSecret - ]); - } - - private function getGrant() - { - return new \League\OAuth2\Client\Grant\RefreshToken(); - } - - private function getToken() - { - $provider = $this->getProvider(); - $grant = $this->getGrant(); - return $provider->getAccessToken($grant, ['refresh_token' => $this->oauthRefreshToken]); - } - - public function getOauth64() - { - $token = $this->getToken(); - return base64_encode("user=" . $this->oauthUserEmail . "\001auth=Bearer " . $token . "\001\001"); - } -} diff --git a/conlite/external/phpmailer/phpmailer/class.pop3.php b/conlite/external/phpmailer/phpmailer/class.pop3.php deleted file mode 100644 index e07a569..0000000 --- a/conlite/external/phpmailer/phpmailer/class.pop3.php +++ /dev/null @@ -1,407 +0,0 @@ - - * @author Jim Jagielski (jimjag) - * @author Andy Prevost (codeworxtech) - * @author Brent R. Matzelle (original founder) - * @copyright 2012 - 2014 Marcus Bointon - * @copyright 2010 - 2012 Jim Jagielski - * @copyright 2004 - 2009 Andy Prevost - * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License - * @note This program is distributed in the hope that it will be useful - WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. - */ - -/** - * PHPMailer POP-Before-SMTP Authentication Class. - * Specifically for PHPMailer to use for RFC1939 POP-before-SMTP authentication. - * Does not support APOP. - * @package PHPMailer - * @author Richard Davey (original author) - * @author Marcus Bointon (Synchro/coolbru) - * @author Jim Jagielski (jimjag) - * @author Andy Prevost (codeworxtech) - */ -class POP3 -{ - /** - * The POP3 PHPMailer Version number. - * @var string - * @access public - */ - public $Version = '5.2.28'; - - /** - * Default POP3 port number. - * @var integer - * @access public - */ - public $POP3_PORT = 110; - - /** - * Default timeout in seconds. - * @var integer - * @access public - */ - public $POP3_TIMEOUT = 30; - - /** - * POP3 Carriage Return + Line Feed. - * @var string - * @access public - * @deprecated Use the constant instead - */ - public $CRLF = "\r\n"; - - /** - * Debug display level. - * Options: 0 = no, 1+ = yes - * @var integer - * @access public - */ - public $do_debug = 0; - - /** - * POP3 mail server hostname. - * @var string - * @access public - */ - public $host; - - /** - * POP3 port number. - * @var integer - * @access public - */ - public $port; - - /** - * POP3 Timeout Value in seconds. - * @var integer - * @access public - */ - public $tval; - - /** - * POP3 username - * @var string - * @access public - */ - public $username; - - /** - * POP3 password. - * @var string - * @access public - */ - public $password; - - /** - * Resource handle for the POP3 connection socket. - * @var resource - * @access protected - */ - protected $pop_conn; - - /** - * Are we connected? - * @var boolean - * @access protected - */ - protected $connected = false; - - /** - * Error container. - * @var array - * @access protected - */ - protected $errors = array(); - - /** - * Line break constant - */ - const CRLF = "\r\n"; - - /** - * Simple static wrapper for all-in-one POP before SMTP - * @param $host - * @param integer|boolean $port The port number to connect to - * @param integer|boolean $timeout The timeout value - * @param string $username - * @param string $password - * @param integer $debug_level - * @return boolean - */ - public static function popBeforeSmtp( - $host, - $port = false, - $timeout = false, - $username = '', - $password = '', - $debug_level = 0 - ) { - $pop = new POP3; - return $pop->authorise($host, $port, $timeout, $username, $password, $debug_level); - } - - /** - * Authenticate with a POP3 server. - * A connect, login, disconnect sequence - * appropriate for POP-before SMTP authorisation. - * @access public - * @param string $host The hostname to connect to - * @param integer|boolean $port The port number to connect to - * @param integer|boolean $timeout The timeout value - * @param string $username - * @param string $password - * @param integer $debug_level - * @return boolean - */ - public function authorise($host, $port = false, $timeout = false, $username = '', $password = '', $debug_level = 0) - { - $this->host = $host; - // If no port value provided, use default - if (false === $port) { - $this->port = $this->POP3_PORT; - } else { - $this->port = (integer)$port; - } - // If no timeout value provided, use default - if (false === $timeout) { - $this->tval = $this->POP3_TIMEOUT; - } else { - $this->tval = (integer)$timeout; - } - $this->do_debug = $debug_level; - $this->username = $username; - $this->password = $password; - // Reset the error log - $this->errors = array(); - // connect - $result = $this->connect($this->host, $this->port, $this->tval); - if ($result) { - $login_result = $this->login($this->username, $this->password); - if ($login_result) { - $this->disconnect(); - return true; - } - } - // We need to disconnect regardless of whether the login succeeded - $this->disconnect(); - return false; - } - - /** - * Connect to a POP3 server. - * @access public - * @param string $host - * @param integer|boolean $port - * @param integer $tval - * @return boolean - */ - public function connect($host, $port = false, $tval = 30) - { - // Are we already connected? - if ($this->connected) { - return true; - } - - //On Windows this will raise a PHP Warning error if the hostname doesn't exist. - //Rather than suppress it with @fsockopen, capture it cleanly instead - set_error_handler(array($this, 'catchWarning')); - - if (false === $port) { - $port = $this->POP3_PORT; - } - - // connect to the POP3 server - $this->pop_conn = fsockopen( - $host, // POP3 Host - $port, // Port # - $errno, // Error Number - $errstr, // Error Message - $tval - ); // Timeout (seconds) - // Restore the error handler - restore_error_handler(); - - // Did we connect? - if (false === $this->pop_conn) { - // It would appear not... - $this->setError(array( - 'error' => "Failed to connect to server $host on port $port", - 'errno' => $errno, - 'errstr' => $errstr - )); - return false; - } - - // Increase the stream time-out - stream_set_timeout($this->pop_conn, $tval, 0); - - // Get the POP3 server response - $pop3_response = $this->getResponse(); - // Check for the +OK - if ($this->checkResponse($pop3_response)) { - // The connection is established and the POP3 server is talking - $this->connected = true; - return true; - } - return false; - } - - /** - * Log in to the POP3 server. - * Does not support APOP (RFC 2828, 4949). - * @access public - * @param string $username - * @param string $password - * @return boolean - */ - public function login($username = '', $password = '') - { - if (!$this->connected) { - $this->setError('Not connected to POP3 server'); - } - if (empty($username)) { - $username = $this->username; - } - if (empty($password)) { - $password = $this->password; - } - - // Send the Username - $this->sendString("USER $username" . self::CRLF); - $pop3_response = $this->getResponse(); - if ($this->checkResponse($pop3_response)) { - // Send the Password - $this->sendString("PASS $password" . self::CRLF); - $pop3_response = $this->getResponse(); - if ($this->checkResponse($pop3_response)) { - return true; - } - } - return false; - } - - /** - * Disconnect from the POP3 server. - * @access public - */ - public function disconnect() - { - $this->sendString('QUIT'); - //The QUIT command may cause the daemon to exit, which will kill our connection - //So ignore errors here - try { - @fclose($this->pop_conn); - } catch (Exception $e) { - //Do nothing - }; - } - - /** - * Get a response from the POP3 server. - * $size is the maximum number of bytes to retrieve - * @param integer $size - * @return string - * @access protected - */ - protected function getResponse($size = 128) - { - $response = fgets($this->pop_conn, $size); - if ($this->do_debug >= 1) { - echo "Server -> Client: $response"; - } - return $response; - } - - /** - * Send raw data to the POP3 server. - * @param string $string - * @return integer - * @access protected - */ - protected function sendString($string) - { - if ($this->pop_conn) { - if ($this->do_debug >= 2) { //Show client messages when debug >= 2 - echo "Client -> Server: $string"; - } - return fwrite($this->pop_conn, $string, strlen($string)); - } - return 0; - } - - /** - * Checks the POP3 server response. - * Looks for for +OK or -ERR. - * @param string $string - * @return boolean - * @access protected - */ - protected function checkResponse($string) - { - if (substr($string, 0, 3) !== '+OK') { - $this->setError(array( - 'error' => "Server reported an error: $string", - 'errno' => 0, - 'errstr' => '' - )); - return false; - } else { - return true; - } - } - - /** - * Add an error to the internal error store. - * Also display debug output if it's enabled. - * @param $error - * @access protected - */ - protected function setError($error) - { - $this->errors[] = $error; - if ($this->do_debug >= 1) { - echo '
';
-            foreach ($this->errors as $error) {
-                print_r($error);
-            }
-            echo '
'; - } - } - - /** - * Get an array of error messages, if any. - * @return array - */ - public function getErrors() - { - return $this->errors; - } - - /** - * POP3 connection error handler. - * @param integer $errno - * @param string $errstr - * @param string $errfile - * @param integer $errline - * @access protected - */ - protected function catchWarning($errno, $errstr, $errfile, $errline) - { - $this->setError(array( - 'error' => "Connecting to the POP3 server raised a PHP warning: ", - 'errno' => $errno, - 'errstr' => $errstr, - 'errfile' => $errfile, - 'errline' => $errline - )); - } -} diff --git a/conlite/external/phpmailer/phpmailer/composer.json b/conlite/external/phpmailer/phpmailer/composer.json index a0ac296..37e3d6e 100644 --- a/conlite/external/phpmailer/phpmailer/composer.json +++ b/conlite/external/phpmailer/phpmailer/composer.json @@ -19,43 +19,60 @@ "name": "Brent R. Matzelle" } ], + "funding": [ + { + "url": "https://github.com/Synchro", + "type": "github" + } + ], + "config": { + "allow-plugins": { + "dealerdirect/phpcodesniffer-composer-installer": true + } + }, "require": { + "php": ">=5.5.0", "ext-ctype": "*", - "php": ">=5.0.0" + "ext-filter": "*", + "ext-hash": "*" }, "require-dev": { - "doctrine/annotations": "1.2.*", - "jms/serializer": "0.16.*", - "phpdocumentor/phpdocumentor": "2.*", - "phpunit/phpunit": "4.8.*", - "symfony/debug": "2.8.*", - "symfony/filesystem": "2.8.*", - "symfony/translation": "2.8.*", - "symfony/yaml": "2.8.*", - "zendframework/zend-cache": "2.5.1", - "zendframework/zend-config": "2.5.1", - "zendframework/zend-eventmanager": "2.5.1", - "zendframework/zend-filter": "2.5.1", - "zendframework/zend-i18n": "2.5.1", - "zendframework/zend-json": "2.5.1", - "zendframework/zend-math": "2.5.1", - "zendframework/zend-serializer": "2.5.*", - "zendframework/zend-servicemanager": "2.5.*", - "zendframework/zend-stdlib": "2.5.1" + "dealerdirect/phpcodesniffer-composer-installer": "^0.7.2", + "doctrine/annotations": "^1.2.6 || ^1.13.3", + "php-parallel-lint/php-console-highlighter": "^1.0.0", + "php-parallel-lint/php-parallel-lint": "^1.3.2", + "phpcompatibility/php-compatibility": "^9.3.5", + "roave/security-advisories": "dev-latest", + "squizlabs/php_codesniffer": "^3.7.1", + "yoast/phpunit-polyfills": "^1.0.4" }, "suggest": { - "league/oauth2-google": "Needed for Google XOAUTH2 authentication" + "ext-mbstring": "Needed to send email in multibyte encoding charset or decode encoded addresses", + "ext-openssl": "Needed for secure SMTP sending and DKIM signing", + "greew/oauth2-azure-provider": "Needed for Microsoft Azure XOAUTH2 authentication", + "hayageek/oauth2-yahoo": "Needed for Yahoo XOAUTH2 authentication", + "league/oauth2-google": "Needed for Google XOAUTH2 authentication", + "psr/log": "For optional PSR-3 debug logging", + "thenetworg/oauth2-azure": "Needed for Microsoft XOAUTH2 authentication", + "symfony/polyfill-mbstring": "To support UTF-8 if the Mbstring PHP extension is not enabled (^1.2)" }, "autoload": { - "classmap": [ - "class.phpmailer.php", - "class.phpmaileroauth.php", - "class.phpmaileroauthgoogle.php", - "class.smtp.php", - "class.pop3.php", - "extras/EasyPeasyICS.php", - "extras/ntlm_sasl_client.php" - ] + "psr-4": { + "PHPMailer\\PHPMailer\\": "src/" + } }, - "license": "LGPL-2.1" + "autoload-dev": { + "psr-4": { + "PHPMailer\\Test\\": "test/" + } + }, + "license": "LGPL-2.1-only", + "scripts": { + "check": "./vendor/bin/phpcs", + "test": "./vendor/bin/phpunit --no-coverage", + "coverage": "./vendor/bin/phpunit", + "lint": [ + "@php ./vendor/php-parallel-lint/php-parallel-lint/parallel-lint . --show-deprecated -e php,phps --exclude vendor --exclude .git --exclude build" + ] + } } diff --git a/conlite/external/phpmailer/phpmailer/composer.lock b/conlite/external/phpmailer/phpmailer/composer.lock deleted file mode 100644 index 9808f28..0000000 --- a/conlite/external/phpmailer/phpmailer/composer.lock +++ /dev/null @@ -1,3593 +0,0 @@ -{ - "_readme": [ - "This file locks the dependencies of your project to a known state", - "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", - "This file is @generated automatically" - ], - "content-hash": "7e4b1bef833056eed0df39fad5399d7a", - "packages": [], - "packages-dev": [ - { - "name": "cilex/cilex", - "version": "1.1.0", - "source": { - "type": "git", - "url": "https://github.com/Cilex/Cilex.git", - "reference": "7acd965a609a56d0345e8b6071c261fbdb926cb5" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/Cilex/Cilex/zipball/7acd965a609a56d0345e8b6071c261fbdb926cb5", - "reference": "7acd965a609a56d0345e8b6071c261fbdb926cb5", - "shasum": "" - }, - "require": { - "cilex/console-service-provider": "1.*", - "php": ">=5.3.3", - "pimple/pimple": "~1.0", - "symfony/finder": "~2.1", - "symfony/process": "~2.1" - }, - "require-dev": { - "phpunit/phpunit": "3.7.*", - "symfony/validator": "~2.1" - }, - "suggest": { - "monolog/monolog": ">=1.0.0", - "symfony/validator": ">=1.0.0", - "symfony/yaml": ">=1.0.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0-dev" - } - }, - "autoload": { - "psr-0": { - "Cilex": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Mike van Riel", - "email": "mike.vanriel@naenius.com" - } - ], - "description": "The PHP micro-framework for Command line tools based on the Symfony2 Components", - "homepage": "http://cilex.github.com", - "keywords": [ - "cli", - "microframework" - ], - "time": "2014-03-29T14:03:13+00:00" - }, - { - "name": "cilex/console-service-provider", - "version": "1.0.0", - "source": { - "type": "git", - "url": "https://github.com/Cilex/console-service-provider.git", - "reference": "25ee3d1875243d38e1a3448ff94bdf944f70d24e" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/Cilex/console-service-provider/zipball/25ee3d1875243d38e1a3448ff94bdf944f70d24e", - "reference": "25ee3d1875243d38e1a3448ff94bdf944f70d24e", - "shasum": "" - }, - "require": { - "php": ">=5.3.3", - "pimple/pimple": "1.*@dev", - "symfony/console": "~2.1" - }, - "require-dev": { - "cilex/cilex": "1.*@dev", - "silex/silex": "1.*@dev" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0-dev" - } - }, - "autoload": { - "psr-0": { - "Cilex\\Provider\\Console": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Beau Simensen", - "email": "beau@dflydev.com", - "homepage": "http://beausimensen.com" - }, - { - "name": "Mike van Riel", - "email": "mike.vanriel@naenius.com" - } - ], - "description": "Console Service Provider", - "keywords": [ - "cilex", - "console", - "pimple", - "service-provider", - "silex" - ], - "time": "2012-12-19T10:50:58+00:00" - }, - { - "name": "doctrine/annotations", - "version": "v1.2.7", - "source": { - "type": "git", - "url": "https://github.com/doctrine/annotations.git", - "reference": "f25c8aab83e0c3e976fd7d19875f198ccf2f7535" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/doctrine/annotations/zipball/f25c8aab83e0c3e976fd7d19875f198ccf2f7535", - "reference": "f25c8aab83e0c3e976fd7d19875f198ccf2f7535", - "shasum": "" - }, - "require": { - "doctrine/lexer": "1.*", - "php": ">=5.3.2" - }, - "require-dev": { - "doctrine/cache": "1.*", - "phpunit/phpunit": "4.*" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.3.x-dev" - } - }, - "autoload": { - "psr-0": { - "Doctrine\\Common\\Annotations\\": "lib/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Roman Borschel", - "email": "roman@code-factory.org" - }, - { - "name": "Benjamin Eberlei", - "email": "kontakt@beberlei.de" - }, - { - "name": "Guilherme Blanco", - "email": "guilhermeblanco@gmail.com" - }, - { - "name": "Jonathan Wage", - "email": "jonwage@gmail.com" - }, - { - "name": "Johannes Schmitt", - "email": "schmittjoh@gmail.com" - } - ], - "description": "Docblock Annotations Parser", - "homepage": "http://www.doctrine-project.org", - "keywords": [ - "annotations", - "docblock", - "parser" - ], - "time": "2015-08-31T12:32:49+00:00" - }, - { - "name": "doctrine/instantiator", - "version": "1.0.5", - "source": { - "type": "git", - "url": "https://github.com/doctrine/instantiator.git", - "reference": "8e884e78f9f0eb1329e445619e04456e64d8051d" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/doctrine/instantiator/zipball/8e884e78f9f0eb1329e445619e04456e64d8051d", - "reference": "8e884e78f9f0eb1329e445619e04456e64d8051d", - "shasum": "" - }, - "require": { - "php": ">=5.3,<8.0-DEV" - }, - "require-dev": { - "athletic/athletic": "~0.1.8", - "ext-pdo": "*", - "ext-phar": "*", - "phpunit/phpunit": "~4.0", - "squizlabs/php_codesniffer": "~2.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0.x-dev" - } - }, - "autoload": { - "psr-4": { - "Doctrine\\Instantiator\\": "src/Doctrine/Instantiator/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Marco Pivetta", - "email": "ocramius@gmail.com", - "homepage": "http://ocramius.github.com/" - } - ], - "description": "A small, lightweight utility to instantiate objects in PHP without invoking their constructors", - "homepage": "https://github.com/doctrine/instantiator", - "keywords": [ - "constructor", - "instantiate" - ], - "time": "2015-06-14T21:17:01+00:00" - }, - { - "name": "doctrine/lexer", - "version": "v1.0.1", - "source": { - "type": "git", - "url": "https://github.com/doctrine/lexer.git", - "reference": "83893c552fd2045dd78aef794c31e694c37c0b8c" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/doctrine/lexer/zipball/83893c552fd2045dd78aef794c31e694c37c0b8c", - "reference": "83893c552fd2045dd78aef794c31e694c37c0b8c", - "shasum": "" - }, - "require": { - "php": ">=5.3.2" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0.x-dev" - } - }, - "autoload": { - "psr-0": { - "Doctrine\\Common\\Lexer\\": "lib/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Roman Borschel", - "email": "roman@code-factory.org" - }, - { - "name": "Guilherme Blanco", - "email": "guilhermeblanco@gmail.com" - }, - { - "name": "Johannes Schmitt", - "email": "schmittjoh@gmail.com" - } - ], - "description": "Base library for a lexer that can be used in Top-Down, Recursive Descent Parsers.", - "homepage": "http://www.doctrine-project.org", - "keywords": [ - "lexer", - "parser" - ], - "time": "2014-09-09T13:34:57+00:00" - }, - { - "name": "erusev/parsedown", - "version": "1.6.1", - "source": { - "type": "git", - "url": "https://github.com/erusev/parsedown.git", - "reference": "20ff8bbb57205368b4b42d094642a3e52dac85fb" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/erusev/parsedown/zipball/20ff8bbb57205368b4b42d094642a3e52dac85fb", - "reference": "20ff8bbb57205368b4b42d094642a3e52dac85fb", - "shasum": "" - }, - "require": { - "php": ">=5.3.0" - }, - "type": "library", - "autoload": { - "psr-0": { - "Parsedown": "" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Emanuil Rusev", - "email": "hello@erusev.com", - "homepage": "http://erusev.com" - } - ], - "description": "Parser for Markdown.", - "homepage": "http://parsedown.org", - "keywords": [ - "markdown", - "parser" - ], - "time": "2016-11-02T15:56:58+00:00" - }, - { - "name": "herrera-io/json", - "version": "1.0.3", - "source": { - "type": "git", - "url": "https://github.com/kherge-php/json.git", - "reference": "60c696c9370a1e5136816ca557c17f82a6fa83f1" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/kherge-php/json/zipball/60c696c9370a1e5136816ca557c17f82a6fa83f1", - "reference": "60c696c9370a1e5136816ca557c17f82a6fa83f1", - "shasum": "" - }, - "require": { - "ext-json": "*", - "justinrainbow/json-schema": ">=1.0,<2.0-dev", - "php": ">=5.3.3", - "seld/jsonlint": ">=1.0,<2.0-dev" - }, - "require-dev": { - "herrera-io/phpunit-test-case": "1.*", - "mikey179/vfsstream": "1.1.0", - "phpunit/phpunit": "3.7.*" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0-dev" - } - }, - "autoload": { - "files": [ - "src/lib/json_version.php" - ], - "psr-0": { - "Herrera\\Json": "src/lib" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Kevin Herrera", - "email": "kevin@herrera.io", - "homepage": "http://kevin.herrera.io/", - "role": "Developer" - } - ], - "description": "A library for simplifying JSON linting and validation.", - "homepage": "http://herrera-io.github.com/php-json", - "keywords": [ - "json", - "lint", - "schema", - "validate" - ], - "abandoned": "kherge/json", - "time": "2013-10-30T16:51:34+00:00" - }, - { - "name": "herrera-io/phar-update", - "version": "1.0.3", - "source": { - "type": "git", - "url": "https://github.com/kherge-abandoned/php-phar-update.git", - "reference": "00a79e1d5b8cf3c080a2e3becf1ddf7a7fea025b" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/kherge-abandoned/php-phar-update/zipball/00a79e1d5b8cf3c080a2e3becf1ddf7a7fea025b", - "reference": "00a79e1d5b8cf3c080a2e3becf1ddf7a7fea025b", - "shasum": "" - }, - "require": { - "herrera-io/json": "1.*", - "kherge/version": "1.*", - "php": ">=5.3.3" - }, - "require-dev": { - "herrera-io/phpunit-test-case": "1.*", - "mikey179/vfsstream": "1.1.0", - "phpunit/phpunit": "3.7.*" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0-dev" - } - }, - "autoload": { - "files": [ - "src/lib/constants.php" - ], - "psr-0": { - "Herrera\\Phar\\Update": "src/lib" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Kevin Herrera", - "email": "kevin@herrera.io", - "homepage": "http://kevin.herrera.io/", - "role": "Developer" - } - ], - "description": "A library for self-updating Phars.", - "homepage": "http://herrera-io.github.com/php-phar-update", - "keywords": [ - "phar", - "update" - ], - "abandoned": true, - "time": "2013-10-30T17:23:01+00:00" - }, - { - "name": "jms/metadata", - "version": "1.6.0", - "source": { - "type": "git", - "url": "https://github.com/schmittjoh/metadata.git", - "reference": "6a06970a10e0a532fb52d3959547123b84a3b3ab" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/schmittjoh/metadata/zipball/6a06970a10e0a532fb52d3959547123b84a3b3ab", - "reference": "6a06970a10e0a532fb52d3959547123b84a3b3ab", - "shasum": "" - }, - "require": { - "php": ">=5.3.0" - }, - "require-dev": { - "doctrine/cache": "~1.0", - "symfony/cache": "~3.1" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.5.x-dev" - } - }, - "autoload": { - "psr-0": { - "Metadata\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "Apache-2.0" - ], - "authors": [ - { - "name": "Johannes M. Schmitt", - "email": "schmittjoh@gmail.com" - } - ], - "description": "Class/method/property metadata management in PHP", - "keywords": [ - "annotations", - "metadata", - "xml", - "yaml" - ], - "time": "2016-12-05T10:18:33+00:00" - }, - { - "name": "jms/parser-lib", - "version": "1.0.0", - "source": { - "type": "git", - "url": "https://github.com/schmittjoh/parser-lib.git", - "reference": "c509473bc1b4866415627af0e1c6cc8ac97fa51d" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/schmittjoh/parser-lib/zipball/c509473bc1b4866415627af0e1c6cc8ac97fa51d", - "reference": "c509473bc1b4866415627af0e1c6cc8ac97fa51d", - "shasum": "" - }, - "require": { - "phpoption/phpoption": ">=0.9,<2.0-dev" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0-dev" - } - }, - "autoload": { - "psr-0": { - "JMS\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "Apache2" - ], - "description": "A library for easily creating recursive-descent parsers.", - "time": "2012-11-18T18:08:43+00:00" - }, - { - "name": "jms/serializer", - "version": "0.16.0", - "source": { - "type": "git", - "url": "https://github.com/schmittjoh/serializer.git", - "reference": "c8a171357ca92b6706e395c757f334902d430ea9" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/schmittjoh/serializer/zipball/c8a171357ca92b6706e395c757f334902d430ea9", - "reference": "c8a171357ca92b6706e395c757f334902d430ea9", - "shasum": "" - }, - "require": { - "doctrine/annotations": "1.*", - "jms/metadata": "~1.1", - "jms/parser-lib": "1.*", - "php": ">=5.3.2", - "phpcollection/phpcollection": "~0.1" - }, - "require-dev": { - "doctrine/orm": "~2.1", - "doctrine/phpcr-odm": "~1.0.1", - "jackalope/jackalope-doctrine-dbal": "1.0.*", - "propel/propel1": "~1.7", - "symfony/filesystem": "2.*", - "symfony/form": "~2.1", - "symfony/translation": "~2.0", - "symfony/validator": "~2.0", - "symfony/yaml": "2.*", - "twig/twig": ">=1.8,<2.0-dev" - }, - "suggest": { - "symfony/yaml": "Required if you'd like to serialize data to YAML format." - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "0.15-dev" - } - }, - "autoload": { - "psr-0": { - "JMS\\Serializer": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "Apache2" - ], - "authors": [ - { - "name": "Johannes Schmitt", - "email": "schmittjoh@gmail.com", - "homepage": "https://github.com/schmittjoh", - "role": "Developer of wrapped JMSSerializerBundle" - } - ], - "description": "Library for (de-)serializing data of any complexity; supports XML, JSON, and YAML.", - "homepage": "http://jmsyst.com/libs/serializer", - "keywords": [ - "deserialization", - "jaxb", - "json", - "serialization", - "xml" - ], - "time": "2014-03-18T08:39:00+00:00" - }, - { - "name": "justinrainbow/json-schema", - "version": "1.6.1", - "source": { - "type": "git", - "url": "https://github.com/justinrainbow/json-schema.git", - "reference": "cc84765fb7317f6b07bd8ac78364747f95b86341" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/justinrainbow/json-schema/zipball/cc84765fb7317f6b07bd8ac78364747f95b86341", - "reference": "cc84765fb7317f6b07bd8ac78364747f95b86341", - "shasum": "" - }, - "require": { - "php": ">=5.3.29" - }, - "require-dev": { - "json-schema/json-schema-test-suite": "1.1.0", - "phpdocumentor/phpdocumentor": "~2", - "phpunit/phpunit": "~3.7" - }, - "bin": [ - "bin/validate-json" - ], - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.6.x-dev" - } - }, - "autoload": { - "psr-4": { - "JsonSchema\\": "src/JsonSchema/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Bruno Prieto Reis", - "email": "bruno.p.reis@gmail.com" - }, - { - "name": "Justin Rainbow", - "email": "justin.rainbow@gmail.com" - }, - { - "name": "Igor Wiedler", - "email": "igor@wiedler.ch" - }, - { - "name": "Robert Schönthal", - "email": "seroscho@googlemail.com" - } - ], - "description": "A library to validate a json schema.", - "homepage": "https://github.com/justinrainbow/json-schema", - "keywords": [ - "json", - "schema" - ], - "time": "2016-01-25T15:43:01+00:00" - }, - { - "name": "kherge/version", - "version": "1.0.1", - "source": { - "type": "git", - "url": "https://github.com/kherge-abandoned/Version.git", - "reference": "f07cf83f8ce533be8f93d2893d96d674bbeb7e30" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/kherge-abandoned/Version/zipball/f07cf83f8ce533be8f93d2893d96d674bbeb7e30", - "reference": "f07cf83f8ce533be8f93d2893d96d674bbeb7e30", - "shasum": "" - }, - "require": { - "php": ">=5.3.3" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0-dev" - } - }, - "autoload": { - "psr-0": { - "KevinGH\\Version": "src/lib/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Kevin Herrera", - "email": "me@kevingh.com", - "homepage": "http://www.kevingh.com/" - } - ], - "description": "A parsing and comparison library for semantic versioning.", - "homepage": "http://github.com/kherge/Version", - "abandoned": true, - "time": "2012-08-16T17:13:03+00:00" - }, - { - "name": "monolog/monolog", - "version": "1.22.1", - "source": { - "type": "git", - "url": "https://github.com/Seldaek/monolog.git", - "reference": "1e044bc4b34e91743943479f1be7a1d5eb93add0" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/Seldaek/monolog/zipball/1e044bc4b34e91743943479f1be7a1d5eb93add0", - "reference": "1e044bc4b34e91743943479f1be7a1d5eb93add0", - "shasum": "" - }, - "require": { - "php": ">=5.3.0", - "psr/log": "~1.0" - }, - "provide": { - "psr/log-implementation": "1.0.0" - }, - "require-dev": { - "aws/aws-sdk-php": "^2.4.9 || ^3.0", - "doctrine/couchdb": "~1.0@dev", - "graylog2/gelf-php": "~1.0", - "jakub-onderka/php-parallel-lint": "0.9", - "php-amqplib/php-amqplib": "~2.4", - "php-console/php-console": "^3.1.3", - "phpunit/phpunit": "~4.5", - "phpunit/phpunit-mock-objects": "2.3.0", - "ruflin/elastica": ">=0.90 <3.0", - "sentry/sentry": "^0.13", - "swiftmailer/swiftmailer": "~5.3" - }, - "suggest": { - "aws/aws-sdk-php": "Allow sending log messages to AWS services like DynamoDB", - "doctrine/couchdb": "Allow sending log messages to a CouchDB server", - "ext-amqp": "Allow sending log messages to an AMQP server (1.0+ required)", - "ext-mongo": "Allow sending log messages to a MongoDB server", - "graylog2/gelf-php": "Allow sending log messages to a GrayLog2 server", - "mongodb/mongodb": "Allow sending log messages to a MongoDB server via PHP Driver", - "php-amqplib/php-amqplib": "Allow sending log messages to an AMQP server using php-amqplib", - "php-console/php-console": "Allow sending log messages to Google Chrome", - "rollbar/rollbar": "Allow sending log messages to Rollbar", - "ruflin/elastica": "Allow sending log messages to an Elastic Search server", - "sentry/sentry": "Allow sending log messages to a Sentry server" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.0.x-dev" - } - }, - "autoload": { - "psr-4": { - "Monolog\\": "src/Monolog" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Jordi Boggiano", - "email": "j.boggiano@seld.be", - "homepage": "http://seld.be" - } - ], - "description": "Sends your logs to files, sockets, inboxes, databases and various web services", - "homepage": "http://github.com/Seldaek/monolog", - "keywords": [ - "log", - "logging", - "psr-3" - ], - "time": "2017-03-13T07:08:03+00:00" - }, - { - "name": "nikic/php-parser", - "version": "v1.4.1", - "source": { - "type": "git", - "url": "https://github.com/nikic/PHP-Parser.git", - "reference": "f78af2c9c86107aa1a34cd1dbb5bbe9eeb0d9f51" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/f78af2c9c86107aa1a34cd1dbb5bbe9eeb0d9f51", - "reference": "f78af2c9c86107aa1a34cd1dbb5bbe9eeb0d9f51", - "shasum": "" - }, - "require": { - "ext-tokenizer": "*", - "php": ">=5.3" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.4-dev" - } - }, - "autoload": { - "files": [ - "lib/bootstrap.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Nikita Popov" - } - ], - "description": "A PHP parser written in PHP", - "keywords": [ - "parser", - "php" - ], - "time": "2015-09-19T14:15:08+00:00" - }, - { - "name": "phpcollection/phpcollection", - "version": "0.5.0", - "source": { - "type": "git", - "url": "https://github.com/schmittjoh/php-collection.git", - "reference": "f2bcff45c0da7c27991bbc1f90f47c4b7fb434a6" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/schmittjoh/php-collection/zipball/f2bcff45c0da7c27991bbc1f90f47c4b7fb434a6", - "reference": "f2bcff45c0da7c27991bbc1f90f47c4b7fb434a6", - "shasum": "" - }, - "require": { - "phpoption/phpoption": "1.*" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "0.4-dev" - } - }, - "autoload": { - "psr-0": { - "PhpCollection": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "Apache2" - ], - "authors": [ - { - "name": "Johannes M. Schmitt", - "email": "schmittjoh@gmail.com" - } - ], - "description": "General-Purpose Collection Library for PHP", - "keywords": [ - "collection", - "list", - "map", - "sequence", - "set" - ], - "time": "2015-05-17T12:39:23+00:00" - }, - { - "name": "phpdocumentor/fileset", - "version": "1.0.0", - "source": { - "type": "git", - "url": "https://github.com/phpDocumentor/Fileset.git", - "reference": "bfa78d8fa9763dfce6d0e5d3730c1d8ab25d34b0" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/Fileset/zipball/bfa78d8fa9763dfce6d0e5d3730c1d8ab25d34b0", - "reference": "bfa78d8fa9763dfce6d0e5d3730c1d8ab25d34b0", - "shasum": "" - }, - "require": { - "php": ">=5.3.3", - "symfony/finder": "~2.1" - }, - "require-dev": { - "phpunit/phpunit": "~3.7" - }, - "type": "library", - "autoload": { - "psr-0": { - "phpDocumentor": [ - "src/", - "tests/unit/" - ] - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "description": "Fileset component for collecting a set of files given directories and file paths", - "homepage": "http://www.phpdoc.org", - "keywords": [ - "files", - "fileset", - "phpdoc" - ], - "time": "2013-08-06T21:07:42+00:00" - }, - { - "name": "phpdocumentor/graphviz", - "version": "1.0.4", - "source": { - "type": "git", - "url": "https://github.com/phpDocumentor/GraphViz.git", - "reference": "a906a90a9f230535f25ea31caf81b2323956283f" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/GraphViz/zipball/a906a90a9f230535f25ea31caf81b2323956283f", - "reference": "a906a90a9f230535f25ea31caf81b2323956283f", - "shasum": "" - }, - "require": { - "php": ">=5.3.3" - }, - "require-dev": { - "phpunit/phpunit": "~4.0" - }, - "type": "library", - "autoload": { - "psr-0": { - "phpDocumentor": [ - "src/", - "tests/unit" - ] - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Mike van Riel", - "email": "mike.vanriel@naenius.com" - } - ], - "time": "2016-02-02T13:00:08+00:00" - }, - { - "name": "phpdocumentor/phpdocumentor", - "version": "v2.9.0", - "source": { - "type": "git", - "url": "https://github.com/phpDocumentor/phpDocumentor2.git", - "reference": "be607da0eef9b9249c43c5b4820d25d631c73667" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/phpDocumentor2/zipball/be607da0eef9b9249c43c5b4820d25d631c73667", - "reference": "be607da0eef9b9249c43c5b4820d25d631c73667", - "shasum": "" - }, - "require": { - "cilex/cilex": "~1.0", - "erusev/parsedown": "~1.0", - "herrera-io/phar-update": "1.0.3", - "jms/serializer": ">=0.12", - "monolog/monolog": "~1.6", - "php": ">=5.3.3", - "phpdocumentor/fileset": "~1.0", - "phpdocumentor/graphviz": "~1.0", - "phpdocumentor/reflection": "^3.0", - "phpdocumentor/reflection-docblock": "~2.0", - "symfony/config": "~2.3", - "symfony/console": "~2.3", - "symfony/event-dispatcher": "~2.1", - "symfony/process": "~2.0", - "symfony/stopwatch": "~2.3", - "symfony/validator": "~2.2", - "twig/twig": "~1.3", - "zendframework/zend-cache": "~2.1", - "zendframework/zend-config": "~2.1", - "zendframework/zend-filter": "~2.1", - "zendframework/zend-i18n": "~2.1", - "zendframework/zend-serializer": "~2.1", - "zendframework/zend-servicemanager": "~2.1", - "zendframework/zend-stdlib": "~2.1", - "zetacomponents/document": ">=1.3.1" - }, - "require-dev": { - "behat/behat": "~3.0", - "mikey179/vfsstream": "~1.2", - "mockery/mockery": "~0.9@dev", - "phpunit/phpunit": "~4.0", - "squizlabs/php_codesniffer": "~1.4", - "symfony/expression-language": "~2.4" - }, - "suggest": { - "ext-twig": "Enabling the twig extension improves the generation of twig based templates.", - "ext-xslcache": "Enabling the XSLCache extension improves the generation of xml based templates." - }, - "bin": [ - "bin/phpdoc.php", - "bin/phpdoc" - ], - "type": "library", - "extra": { - "branch-alias": { - "dev-develop": "2.9-dev" - } - }, - "autoload": { - "psr-0": { - "phpDocumentor": [ - "src/", - "tests/unit/" - ], - "Cilex\\Provider": [ - "src/" - ] - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "description": "Documentation Generator for PHP", - "homepage": "http://www.phpdoc.org", - "keywords": [ - "api", - "application", - "dga", - "documentation", - "phpdoc" - ], - "time": "2016-05-22T09:50:56+00:00" - }, - { - "name": "phpdocumentor/reflection", - "version": "3.0.1", - "source": { - "type": "git", - "url": "https://github.com/phpDocumentor/Reflection.git", - "reference": "793bfd92d9a0fc96ae9608fb3e947c3f59fb3a0d" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/Reflection/zipball/793bfd92d9a0fc96ae9608fb3e947c3f59fb3a0d", - "reference": "793bfd92d9a0fc96ae9608fb3e947c3f59fb3a0d", - "shasum": "" - }, - "require": { - "nikic/php-parser": "^1.0", - "php": ">=5.3.3", - "phpdocumentor/reflection-docblock": "~2.0", - "psr/log": "~1.0" - }, - "require-dev": { - "behat/behat": "~2.4", - "mockery/mockery": "~0.8", - "phpunit/phpunit": "~4.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0.x-dev" - } - }, - "autoload": { - "psr-0": { - "phpDocumentor": [ - "src/", - "tests/unit/", - "tests/mocks/" - ] - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "description": "Reflection library to do Static Analysis for PHP Projects", - "homepage": "http://www.phpdoc.org", - "keywords": [ - "phpDocumentor", - "phpdoc", - "reflection", - "static analysis" - ], - "time": "2016-05-21T08:42:32+00:00" - }, - { - "name": "phpdocumentor/reflection-docblock", - "version": "2.0.4", - "source": { - "type": "git", - "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git", - "reference": "d68dbdc53dc358a816f00b300704702b2eaff7b8" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/d68dbdc53dc358a816f00b300704702b2eaff7b8", - "reference": "d68dbdc53dc358a816f00b300704702b2eaff7b8", - "shasum": "" - }, - "require": { - "php": ">=5.3.3" - }, - "require-dev": { - "phpunit/phpunit": "~4.0" - }, - "suggest": { - "dflydev/markdown": "~1.0", - "erusev/parsedown": "~1.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.0.x-dev" - } - }, - "autoload": { - "psr-0": { - "phpDocumentor": [ - "src/" - ] - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Mike van Riel", - "email": "mike.vanriel@naenius.com" - } - ], - "time": "2015-02-03T12:10:50+00:00" - }, - { - "name": "phpoption/phpoption", - "version": "1.5.0", - "source": { - "type": "git", - "url": "https://github.com/schmittjoh/php-option.git", - "reference": "94e644f7d2051a5f0fcf77d81605f152eecff0ed" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/schmittjoh/php-option/zipball/94e644f7d2051a5f0fcf77d81605f152eecff0ed", - "reference": "94e644f7d2051a5f0fcf77d81605f152eecff0ed", - "shasum": "" - }, - "require": { - "php": ">=5.3.0" - }, - "require-dev": { - "phpunit/phpunit": "4.7.*" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.3-dev" - } - }, - "autoload": { - "psr-0": { - "PhpOption\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "Apache2" - ], - "authors": [ - { - "name": "Johannes M. Schmitt", - "email": "schmittjoh@gmail.com" - } - ], - "description": "Option Type for PHP", - "keywords": [ - "language", - "option", - "php", - "type" - ], - "time": "2015-07-25T16:39:46+00:00" - }, - { - "name": "phpspec/prophecy", - "version": "v1.7.0", - "source": { - "type": "git", - "url": "https://github.com/phpspec/prophecy.git", - "reference": "93d39f1f7f9326d746203c7c056f300f7f126073" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/phpspec/prophecy/zipball/93d39f1f7f9326d746203c7c056f300f7f126073", - "reference": "93d39f1f7f9326d746203c7c056f300f7f126073", - "shasum": "" - }, - "require": { - "doctrine/instantiator": "^1.0.2", - "php": "^5.3|^7.0", - "phpdocumentor/reflection-docblock": "^2.0|^3.0.2", - "sebastian/comparator": "^1.1|^2.0", - "sebastian/recursion-context": "^1.0|^2.0|^3.0" - }, - "require-dev": { - "phpspec/phpspec": "^2.5|^3.2", - "phpunit/phpunit": "^4.8 || ^5.6.5" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.6.x-dev" - } - }, - "autoload": { - "psr-0": { - "Prophecy\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Konstantin Kudryashov", - "email": "ever.zet@gmail.com", - "homepage": "http://everzet.com" - }, - { - "name": "Marcello Duarte", - "email": "marcello.duarte@gmail.com" - } - ], - "description": "Highly opinionated mocking framework for PHP 5.3+", - "homepage": "https://github.com/phpspec/prophecy", - "keywords": [ - "Double", - "Dummy", - "fake", - "mock", - "spy", - "stub" - ], - "time": "2017-03-02T20:05:34+00:00" - }, - { - "name": "phpunit/php-code-coverage", - "version": "2.2.4", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/php-code-coverage.git", - "reference": "eabf68b476ac7d0f73793aada060f1c1a9bf8979" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/eabf68b476ac7d0f73793aada060f1c1a9bf8979", - "reference": "eabf68b476ac7d0f73793aada060f1c1a9bf8979", - "shasum": "" - }, - "require": { - "php": ">=5.3.3", - "phpunit/php-file-iterator": "~1.3", - "phpunit/php-text-template": "~1.2", - "phpunit/php-token-stream": "~1.3", - "sebastian/environment": "^1.3.2", - "sebastian/version": "~1.0" - }, - "require-dev": { - "ext-xdebug": ">=2.1.4", - "phpunit/phpunit": "~4" - }, - "suggest": { - "ext-dom": "*", - "ext-xdebug": ">=2.2.1", - "ext-xmlwriter": "*" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.2.x-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sb@sebastian-bergmann.de", - "role": "lead" - } - ], - "description": "Library that provides collection, processing, and rendering functionality for PHP code coverage information.", - "homepage": "https://github.com/sebastianbergmann/php-code-coverage", - "keywords": [ - "coverage", - "testing", - "xunit" - ], - "time": "2015-10-06T15:47:00+00:00" - }, - { - "name": "phpunit/php-file-iterator", - "version": "1.4.2", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/php-file-iterator.git", - "reference": "3cc8f69b3028d0f96a9078e6295d86e9bf019be5" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/3cc8f69b3028d0f96a9078e6295d86e9bf019be5", - "reference": "3cc8f69b3028d0f96a9078e6295d86e9bf019be5", - "shasum": "" - }, - "require": { - "php": ">=5.3.3" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.4.x-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sb@sebastian-bergmann.de", - "role": "lead" - } - ], - "description": "FilterIterator implementation that filters files based on a list of suffixes.", - "homepage": "https://github.com/sebastianbergmann/php-file-iterator/", - "keywords": [ - "filesystem", - "iterator" - ], - "time": "2016-10-03T07:40:28+00:00" - }, - { - "name": "phpunit/php-text-template", - "version": "1.2.1", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/php-text-template.git", - "reference": "31f8b717e51d9a2afca6c9f046f5d69fc27c8686" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/31f8b717e51d9a2afca6c9f046f5d69fc27c8686", - "reference": "31f8b717e51d9a2afca6c9f046f5d69fc27c8686", - "shasum": "" - }, - "require": { - "php": ">=5.3.3" - }, - "type": "library", - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" - } - ], - "description": "Simple template engine.", - "homepage": "https://github.com/sebastianbergmann/php-text-template/", - "keywords": [ - "template" - ], - "time": "2015-06-21T13:50:34+00:00" - }, - { - "name": "phpunit/php-timer", - "version": "1.0.9", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/php-timer.git", - "reference": "3dcf38ca72b158baf0bc245e9184d3fdffa9c46f" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/3dcf38ca72b158baf0bc245e9184d3fdffa9c46f", - "reference": "3dcf38ca72b158baf0bc245e9184d3fdffa9c46f", - "shasum": "" - }, - "require": { - "php": "^5.3.3 || ^7.0" - }, - "require-dev": { - "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sb@sebastian-bergmann.de", - "role": "lead" - } - ], - "description": "Utility class for timing", - "homepage": "https://github.com/sebastianbergmann/php-timer/", - "keywords": [ - "timer" - ], - "time": "2017-02-26T11:10:40+00:00" - }, - { - "name": "phpunit/php-token-stream", - "version": "1.4.11", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/php-token-stream.git", - "reference": "e03f8f67534427a787e21a385a67ec3ca6978ea7" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/e03f8f67534427a787e21a385a67ec3ca6978ea7", - "reference": "e03f8f67534427a787e21a385a67ec3ca6978ea7", - "shasum": "" - }, - "require": { - "ext-tokenizer": "*", - "php": ">=5.3.3" - }, - "require-dev": { - "phpunit/phpunit": "~4.2" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.4-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - } - ], - "description": "Wrapper around PHP's tokenizer extension.", - "homepage": "https://github.com/sebastianbergmann/php-token-stream/", - "keywords": [ - "tokenizer" - ], - "time": "2017-02-27T10:12:30+00:00" - }, - { - "name": "phpunit/phpunit", - "version": "4.8.35", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "791b1a67c25af50e230f841ee7a9c6eba507dc87" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/791b1a67c25af50e230f841ee7a9c6eba507dc87", - "reference": "791b1a67c25af50e230f841ee7a9c6eba507dc87", - "shasum": "" - }, - "require": { - "ext-dom": "*", - "ext-json": "*", - "ext-pcre": "*", - "ext-reflection": "*", - "ext-spl": "*", - "php": ">=5.3.3", - "phpspec/prophecy": "^1.3.1", - "phpunit/php-code-coverage": "~2.1", - "phpunit/php-file-iterator": "~1.4", - "phpunit/php-text-template": "~1.2", - "phpunit/php-timer": "^1.0.6", - "phpunit/phpunit-mock-objects": "~2.3", - "sebastian/comparator": "~1.2.2", - "sebastian/diff": "~1.2", - "sebastian/environment": "~1.3", - "sebastian/exporter": "~1.2", - "sebastian/global-state": "~1.0", - "sebastian/version": "~1.0", - "symfony/yaml": "~2.1|~3.0" - }, - "suggest": { - "phpunit/php-invoker": "~1.1" - }, - "bin": [ - "phpunit" - ], - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "4.8.x-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" - } - ], - "description": "The PHP Unit Testing framework.", - "homepage": "https://phpunit.de/", - "keywords": [ - "phpunit", - "testing", - "xunit" - ], - "time": "2017-02-06T05:18:07+00:00" - }, - { - "name": "phpunit/phpunit-mock-objects", - "version": "2.3.8", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/phpunit-mock-objects.git", - "reference": "ac8e7a3db35738d56ee9a76e78a4e03d97628983" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit-mock-objects/zipball/ac8e7a3db35738d56ee9a76e78a4e03d97628983", - "reference": "ac8e7a3db35738d56ee9a76e78a4e03d97628983", - "shasum": "" - }, - "require": { - "doctrine/instantiator": "^1.0.2", - "php": ">=5.3.3", - "phpunit/php-text-template": "~1.2", - "sebastian/exporter": "~1.2" - }, - "require-dev": { - "phpunit/phpunit": "~4.4" - }, - "suggest": { - "ext-soap": "*" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.3.x-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sb@sebastian-bergmann.de", - "role": "lead" - } - ], - "description": "Mock Object library for PHPUnit", - "homepage": "https://github.com/sebastianbergmann/phpunit-mock-objects/", - "keywords": [ - "mock", - "xunit" - ], - "time": "2015-10-02T06:51:40+00:00" - }, - { - "name": "pimple/pimple", - "version": "v1.1.1", - "source": { - "type": "git", - "url": "https://github.com/silexphp/Pimple.git", - "reference": "2019c145fe393923f3441b23f29bbdfaa5c58c4d" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/silexphp/Pimple/zipball/2019c145fe393923f3441b23f29bbdfaa5c58c4d", - "reference": "2019c145fe393923f3441b23f29bbdfaa5c58c4d", - "shasum": "" - }, - "require": { - "php": ">=5.3.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.1.x-dev" - } - }, - "autoload": { - "psr-0": { - "Pimple": "lib/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com", - "homepage": "http://fabien.potencier.org", - "role": "Lead Developer" - } - ], - "description": "Pimple is a simple Dependency Injection Container for PHP 5.3", - "homepage": "http://pimple.sensiolabs.org", - "keywords": [ - "container", - "dependency injection" - ], - "time": "2013-11-22T08:30:29+00:00" - }, - { - "name": "psr/log", - "version": "1.0.2", - "source": { - "type": "git", - "url": "https://github.com/php-fig/log.git", - "reference": "4ebe3a8bf773a19edfe0a84b6585ba3d401b724d" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/php-fig/log/zipball/4ebe3a8bf773a19edfe0a84b6585ba3d401b724d", - "reference": "4ebe3a8bf773a19edfe0a84b6585ba3d401b724d", - "shasum": "" - }, - "require": { - "php": ">=5.3.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0.x-dev" - } - }, - "autoload": { - "psr-4": { - "Psr\\Log\\": "Psr/Log/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "PHP-FIG", - "homepage": "http://www.php-fig.org/" - } - ], - "description": "Common interface for logging libraries", - "homepage": "https://github.com/php-fig/log", - "keywords": [ - "log", - "psr", - "psr-3" - ], - "time": "2016-10-10T12:19:37+00:00" - }, - { - "name": "sebastian/comparator", - "version": "1.2.4", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/comparator.git", - "reference": "2b7424b55f5047b47ac6e5ccb20b2aea4011d9be" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/2b7424b55f5047b47ac6e5ccb20b2aea4011d9be", - "reference": "2b7424b55f5047b47ac6e5ccb20b2aea4011d9be", - "shasum": "" - }, - "require": { - "php": ">=5.3.3", - "sebastian/diff": "~1.2", - "sebastian/exporter": "~1.2 || ~2.0" - }, - "require-dev": { - "phpunit/phpunit": "~4.4" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.2.x-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Jeff Welch", - "email": "whatthejeff@gmail.com" - }, - { - "name": "Volker Dusch", - "email": "github@wallbash.com" - }, - { - "name": "Bernhard Schussek", - "email": "bschussek@2bepublished.at" - }, - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - } - ], - "description": "Provides the functionality to compare PHP values for equality", - "homepage": "http://www.github.com/sebastianbergmann/comparator", - "keywords": [ - "comparator", - "compare", - "equality" - ], - "time": "2017-01-29T09:50:25+00:00" - }, - { - "name": "sebastian/diff", - "version": "1.4.1", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/diff.git", - "reference": "13edfd8706462032c2f52b4b862974dd46b71c9e" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/13edfd8706462032c2f52b4b862974dd46b71c9e", - "reference": "13edfd8706462032c2f52b4b862974dd46b71c9e", - "shasum": "" - }, - "require": { - "php": ">=5.3.3" - }, - "require-dev": { - "phpunit/phpunit": "~4.8" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.4-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Kore Nordmann", - "email": "mail@kore-nordmann.de" - }, - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - } - ], - "description": "Diff implementation", - "homepage": "https://github.com/sebastianbergmann/diff", - "keywords": [ - "diff" - ], - "time": "2015-12-08T07:14:41+00:00" - }, - { - "name": "sebastian/environment", - "version": "1.3.8", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/environment.git", - "reference": "be2c607e43ce4c89ecd60e75c6a85c126e754aea" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/be2c607e43ce4c89ecd60e75c6a85c126e754aea", - "reference": "be2c607e43ce4c89ecd60e75c6a85c126e754aea", - "shasum": "" - }, - "require": { - "php": "^5.3.3 || ^7.0" - }, - "require-dev": { - "phpunit/phpunit": "^4.8 || ^5.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.3.x-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - } - ], - "description": "Provides functionality to handle HHVM/PHP environments", - "homepage": "http://www.github.com/sebastianbergmann/environment", - "keywords": [ - "Xdebug", - "environment", - "hhvm" - ], - "time": "2016-08-18T05:49:44+00:00" - }, - { - "name": "sebastian/exporter", - "version": "1.2.2", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/exporter.git", - "reference": "42c4c2eec485ee3e159ec9884f95b431287edde4" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/42c4c2eec485ee3e159ec9884f95b431287edde4", - "reference": "42c4c2eec485ee3e159ec9884f95b431287edde4", - "shasum": "" - }, - "require": { - "php": ">=5.3.3", - "sebastian/recursion-context": "~1.0" - }, - "require-dev": { - "ext-mbstring": "*", - "phpunit/phpunit": "~4.4" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.3.x-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Jeff Welch", - "email": "whatthejeff@gmail.com" - }, - { - "name": "Volker Dusch", - "email": "github@wallbash.com" - }, - { - "name": "Bernhard Schussek", - "email": "bschussek@2bepublished.at" - }, - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - }, - { - "name": "Adam Harvey", - "email": "aharvey@php.net" - } - ], - "description": "Provides the functionality to export PHP variables for visualization", - "homepage": "http://www.github.com/sebastianbergmann/exporter", - "keywords": [ - "export", - "exporter" - ], - "time": "2016-06-17T09:04:28+00:00" - }, - { - "name": "sebastian/global-state", - "version": "1.1.1", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/global-state.git", - "reference": "bc37d50fea7d017d3d340f230811c9f1d7280af4" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/bc37d50fea7d017d3d340f230811c9f1d7280af4", - "reference": "bc37d50fea7d017d3d340f230811c9f1d7280af4", - "shasum": "" - }, - "require": { - "php": ">=5.3.3" - }, - "require-dev": { - "phpunit/phpunit": "~4.2" - }, - "suggest": { - "ext-uopz": "*" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - } - ], - "description": "Snapshotting of global state", - "homepage": "http://www.github.com/sebastianbergmann/global-state", - "keywords": [ - "global state" - ], - "time": "2015-10-12T03:26:01+00:00" - }, - { - "name": "sebastian/recursion-context", - "version": "1.0.5", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/recursion-context.git", - "reference": "b19cc3298482a335a95f3016d2f8a6950f0fbcd7" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/b19cc3298482a335a95f3016d2f8a6950f0fbcd7", - "reference": "b19cc3298482a335a95f3016d2f8a6950f0fbcd7", - "shasum": "" - }, - "require": { - "php": ">=5.3.3" - }, - "require-dev": { - "phpunit/phpunit": "~4.4" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0.x-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Jeff Welch", - "email": "whatthejeff@gmail.com" - }, - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - }, - { - "name": "Adam Harvey", - "email": "aharvey@php.net" - } - ], - "description": "Provides functionality to recursively process PHP variables", - "homepage": "http://www.github.com/sebastianbergmann/recursion-context", - "time": "2016-10-03T07:41:43+00:00" - }, - { - "name": "sebastian/version", - "version": "1.0.6", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/version.git", - "reference": "58b3a85e7999757d6ad81c787a1fbf5ff6c628c6" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/58b3a85e7999757d6ad81c787a1fbf5ff6c628c6", - "reference": "58b3a85e7999757d6ad81c787a1fbf5ff6c628c6", - "shasum": "" - }, - "type": "library", - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" - } - ], - "description": "Library that helps with managing the version number of Git-hosted PHP projects", - "homepage": "https://github.com/sebastianbergmann/version", - "time": "2015-06-21T13:59:46+00:00" - }, - { - "name": "seld/jsonlint", - "version": "1.6.0", - "source": { - "type": "git", - "url": "https://github.com/Seldaek/jsonlint.git", - "reference": "791f8c594f300d246cdf01c6b3e1e19611e301d8" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/Seldaek/jsonlint/zipball/791f8c594f300d246cdf01c6b3e1e19611e301d8", - "reference": "791f8c594f300d246cdf01c6b3e1e19611e301d8", - "shasum": "" - }, - "require": { - "php": "^5.3 || ^7.0" - }, - "require-dev": { - "phpunit/phpunit": "^4.5" - }, - "bin": [ - "bin/jsonlint" - ], - "type": "library", - "autoload": { - "psr-4": { - "Seld\\JsonLint\\": "src/Seld/JsonLint/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Jordi Boggiano", - "email": "j.boggiano@seld.be", - "homepage": "http://seld.be" - } - ], - "description": "JSON Linter", - "keywords": [ - "json", - "linter", - "parser", - "validator" - ], - "time": "2017-03-06T16:42:24+00:00" - }, - { - "name": "symfony/config", - "version": "v2.8.18", - "source": { - "type": "git", - "url": "https://github.com/symfony/config.git", - "reference": "06ce6bb46c24963ec09323da45d0f4f85d3cecd2" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/config/zipball/06ce6bb46c24963ec09323da45d0f4f85d3cecd2", - "reference": "06ce6bb46c24963ec09323da45d0f4f85d3cecd2", - "shasum": "" - }, - "require": { - "php": ">=5.3.9", - "symfony/filesystem": "~2.3|~3.0.0" - }, - "require-dev": { - "symfony/yaml": "~2.7|~3.0.0" - }, - "suggest": { - "symfony/yaml": "To use the yaml reference dumper" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.8-dev" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Component\\Config\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony Config Component", - "homepage": "https://symfony.com", - "time": "2017-03-01T18:13:50+00:00" - }, - { - "name": "symfony/console", - "version": "v2.8.18", - "source": { - "type": "git", - "url": "https://github.com/symfony/console.git", - "reference": "81508e6fac4476771275a3f4f53c3fee9b956bfa" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/81508e6fac4476771275a3f4f53c3fee9b956bfa", - "reference": "81508e6fac4476771275a3f4f53c3fee9b956bfa", - "shasum": "" - }, - "require": { - "php": ">=5.3.9", - "symfony/debug": "^2.7.2|~3.0.0", - "symfony/polyfill-mbstring": "~1.0" - }, - "require-dev": { - "psr/log": "~1.0", - "symfony/event-dispatcher": "~2.1|~3.0.0", - "symfony/process": "~2.1|~3.0.0" - }, - "suggest": { - "psr/log": "For using the console logger", - "symfony/event-dispatcher": "", - "symfony/process": "" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.8-dev" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Component\\Console\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony Console Component", - "homepage": "https://symfony.com", - "time": "2017-03-04T11:00:12+00:00" - }, - { - "name": "symfony/debug", - "version": "v2.8.18", - "source": { - "type": "git", - "url": "https://github.com/symfony/debug.git", - "reference": "e90099a2958d4833a02d05b504cc06e1c234abcc" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/debug/zipball/e90099a2958d4833a02d05b504cc06e1c234abcc", - "reference": "e90099a2958d4833a02d05b504cc06e1c234abcc", - "shasum": "" - }, - "require": { - "php": ">=5.3.9", - "psr/log": "~1.0" - }, - "conflict": { - "symfony/http-kernel": ">=2.3,<2.3.24|~2.4.0|>=2.5,<2.5.9|>=2.6,<2.6.2" - }, - "require-dev": { - "symfony/class-loader": "~2.2|~3.0.0", - "symfony/http-kernel": "~2.3.24|~2.5.9|^2.6.2|~3.0.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.8-dev" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Component\\Debug\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony Debug Component", - "homepage": "https://symfony.com", - "time": "2017-02-18T19:13:35+00:00" - }, - { - "name": "symfony/event-dispatcher", - "version": "v2.8.18", - "source": { - "type": "git", - "url": "https://github.com/symfony/event-dispatcher.git", - "reference": "bb4ec47e8e109c1c1172145732d0aa468d967cd0" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/bb4ec47e8e109c1c1172145732d0aa468d967cd0", - "reference": "bb4ec47e8e109c1c1172145732d0aa468d967cd0", - "shasum": "" - }, - "require": { - "php": ">=5.3.9" - }, - "require-dev": { - "psr/log": "~1.0", - "symfony/config": "^2.0.5|~3.0.0", - "symfony/dependency-injection": "~2.6|~3.0.0", - "symfony/expression-language": "~2.6|~3.0.0", - "symfony/stopwatch": "~2.3|~3.0.0" - }, - "suggest": { - "symfony/dependency-injection": "", - "symfony/http-kernel": "" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.8-dev" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Component\\EventDispatcher\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony EventDispatcher Component", - "homepage": "https://symfony.com", - "time": "2017-02-21T08:33:48+00:00" - }, - { - "name": "symfony/filesystem", - "version": "v2.8.18", - "source": { - "type": "git", - "url": "https://github.com/symfony/filesystem.git", - "reference": "e542d4765092d22552b1bf01ddccfb01d98ee325" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/filesystem/zipball/e542d4765092d22552b1bf01ddccfb01d98ee325", - "reference": "e542d4765092d22552b1bf01ddccfb01d98ee325", - "shasum": "" - }, - "require": { - "php": ">=5.3.9" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.8-dev" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Component\\Filesystem\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony Filesystem Component", - "homepage": "https://symfony.com", - "time": "2017-02-18T17:06:33+00:00" - }, - { - "name": "symfony/finder", - "version": "v2.8.18", - "source": { - "type": "git", - "url": "https://github.com/symfony/finder.git", - "reference": "5fc4b5cab38b9d28be318fcffd8066988e7d9451" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/finder/zipball/5fc4b5cab38b9d28be318fcffd8066988e7d9451", - "reference": "5fc4b5cab38b9d28be318fcffd8066988e7d9451", - "shasum": "" - }, - "require": { - "php": ">=5.3.9" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.8-dev" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Component\\Finder\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony Finder Component", - "homepage": "https://symfony.com", - "time": "2017-02-21T08:33:48+00:00" - }, - { - "name": "symfony/polyfill-mbstring", - "version": "v1.3.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/polyfill-mbstring.git", - "reference": "e79d363049d1c2128f133a2667e4f4190904f7f4" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/e79d363049d1c2128f133a2667e4f4190904f7f4", - "reference": "e79d363049d1c2128f133a2667e4f4190904f7f4", - "shasum": "" - }, - "require": { - "php": ">=5.3.3" - }, - "suggest": { - "ext-mbstring": "For best performance" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.3-dev" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Polyfill\\Mbstring\\": "" - }, - "files": [ - "bootstrap.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony polyfill for the Mbstring extension", - "homepage": "https://symfony.com", - "keywords": [ - "compatibility", - "mbstring", - "polyfill", - "portable", - "shim" - ], - "time": "2016-11-14T01:06:16+00:00" - }, - { - "name": "symfony/process", - "version": "v2.8.18", - "source": { - "type": "git", - "url": "https://github.com/symfony/process.git", - "reference": "41336b20b52f5fd5b42a227e394e673c8071118f" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/process/zipball/41336b20b52f5fd5b42a227e394e673c8071118f", - "reference": "41336b20b52f5fd5b42a227e394e673c8071118f", - "shasum": "" - }, - "require": { - "php": ">=5.3.9" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.8-dev" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Component\\Process\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony Process Component", - "homepage": "https://symfony.com", - "time": "2017-03-04T12:20:59+00:00" - }, - { - "name": "symfony/stopwatch", - "version": "v2.8.18", - "source": { - "type": "git", - "url": "https://github.com/symfony/stopwatch.git", - "reference": "9e4369666d02ee9b8830da878b7f6a769eb96f4b" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/stopwatch/zipball/9e4369666d02ee9b8830da878b7f6a769eb96f4b", - "reference": "9e4369666d02ee9b8830da878b7f6a769eb96f4b", - "shasum": "" - }, - "require": { - "php": ">=5.3.9" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.8-dev" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Component\\Stopwatch\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony Stopwatch Component", - "homepage": "https://symfony.com", - "time": "2017-02-18T17:06:33+00:00" - }, - { - "name": "symfony/translation", - "version": "v2.8.18", - "source": { - "type": "git", - "url": "https://github.com/symfony/translation.git", - "reference": "b538355bc99db2ec7cc35284ec76d92ae7d1d256" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/translation/zipball/b538355bc99db2ec7cc35284ec76d92ae7d1d256", - "reference": "b538355bc99db2ec7cc35284ec76d92ae7d1d256", - "shasum": "" - }, - "require": { - "php": ">=5.3.9", - "symfony/polyfill-mbstring": "~1.0" - }, - "conflict": { - "symfony/config": "<2.7" - }, - "require-dev": { - "psr/log": "~1.0", - "symfony/config": "~2.8", - "symfony/intl": "~2.7.25|^2.8.18|~3.2.5", - "symfony/yaml": "~2.2|~3.0.0" - }, - "suggest": { - "psr/log": "To use logging capability in translator", - "symfony/config": "", - "symfony/yaml": "" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.8-dev" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Component\\Translation\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony Translation Component", - "homepage": "https://symfony.com", - "time": "2017-03-04T12:20:59+00:00" - }, - { - "name": "symfony/validator", - "version": "v2.8.18", - "source": { - "type": "git", - "url": "https://github.com/symfony/validator.git", - "reference": "8d4bfa7ec24e70ebc28d0cea5f2702d3f1257a63" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/validator/zipball/8d4bfa7ec24e70ebc28d0cea5f2702d3f1257a63", - "reference": "8d4bfa7ec24e70ebc28d0cea5f2702d3f1257a63", - "shasum": "" - }, - "require": { - "php": ">=5.3.9", - "symfony/polyfill-mbstring": "~1.0", - "symfony/translation": "~2.4|~3.0.0" - }, - "require-dev": { - "doctrine/annotations": "~1.0", - "doctrine/cache": "~1.0", - "egulias/email-validator": "^1.2.1", - "symfony/config": "~2.2|~3.0.0", - "symfony/expression-language": "~2.4|~3.0.0", - "symfony/http-foundation": "~2.3|~3.0.0", - "symfony/intl": "~2.7.25|^2.8.18|~3.2.5", - "symfony/property-access": "~2.3|~3.0.0", - "symfony/yaml": "^2.0.5|~3.0.0" - }, - "suggest": { - "doctrine/annotations": "For using the annotation mapping. You will also need doctrine/cache.", - "doctrine/cache": "For using the default cached annotation reader and metadata cache.", - "egulias/email-validator": "Strict (RFC compliant) email validation", - "symfony/config": "", - "symfony/expression-language": "For using the 2.4 Expression validator", - "symfony/http-foundation": "", - "symfony/intl": "", - "symfony/property-access": "For using the 2.4 Validator API", - "symfony/yaml": "" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.8-dev" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Component\\Validator\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony Validator Component", - "homepage": "https://symfony.com", - "time": "2017-02-28T02:24:56+00:00" - }, - { - "name": "symfony/yaml", - "version": "v2.8.18", - "source": { - "type": "git", - "url": "https://github.com/symfony/yaml.git", - "reference": "2a7bab3c16f6f452c47818fdd08f3b1e49ffcf7d" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/yaml/zipball/2a7bab3c16f6f452c47818fdd08f3b1e49ffcf7d", - "reference": "2a7bab3c16f6f452c47818fdd08f3b1e49ffcf7d", - "shasum": "" - }, - "require": { - "php": ">=5.3.9" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.8-dev" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Component\\Yaml\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony Yaml Component", - "homepage": "https://symfony.com", - "time": "2017-03-01T18:13:50+00:00" - }, - { - "name": "twig/twig", - "version": "v1.32.0", - "source": { - "type": "git", - "url": "https://github.com/twigphp/Twig.git", - "reference": "9935b662e24d6e634da88901ab534cc12e8c728f" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/twigphp/Twig/zipball/9935b662e24d6e634da88901ab534cc12e8c728f", - "reference": "9935b662e24d6e634da88901ab534cc12e8c728f", - "shasum": "" - }, - "require": { - "php": ">=5.2.7" - }, - "require-dev": { - "psr/container": "^1.0", - "symfony/debug": "~2.7", - "symfony/phpunit-bridge": "~3.2" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.32-dev" - } - }, - "autoload": { - "psr-0": { - "Twig_": "lib/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com", - "homepage": "http://fabien.potencier.org", - "role": "Lead Developer" - }, - { - "name": "Armin Ronacher", - "email": "armin.ronacher@active-4.com", - "role": "Project Founder" - }, - { - "name": "Twig Team", - "homepage": "http://twig.sensiolabs.org/contributors", - "role": "Contributors" - } - ], - "description": "Twig, the flexible, fast, and secure template language for PHP", - "homepage": "http://twig.sensiolabs.org", - "keywords": [ - "templating" - ], - "time": "2017-02-27T00:07:03+00:00" - }, - { - "name": "zendframework/zend-cache", - "version": "2.5.1", - "source": { - "type": "git", - "url": "https://github.com/zendframework/zend-cache.git", - "reference": "5999e5a03f7dcf82abbbe67eea74da641f959684" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/zendframework/zend-cache/zipball/5999e5a03f7dcf82abbbe67eea74da641f959684", - "reference": "5999e5a03f7dcf82abbbe67eea74da641f959684", - "shasum": "" - }, - "require": { - "php": ">=5.3.23", - "zendframework/zend-eventmanager": "~2.5", - "zendframework/zend-serializer": "~2.5", - "zendframework/zend-servicemanager": "~2.5", - "zendframework/zend-stdlib": "~2.5" - }, - "require-dev": { - "fabpot/php-cs-fixer": "1.7.*", - "phpunit/phpunit": "~4.0", - "zendframework/zend-session": "~2.5" - }, - "suggest": { - "ext-apc": "APC >= 3.1.6 to use the APC storage adapter", - "ext-dba": "DBA, to use the DBA storage adapter", - "ext-memcached": "Memcached >= 1.0.0 to use the Memcached storage adapter", - "ext-mongo": "Mongo, to use MongoDb storage adapter", - "ext-wincache": "WinCache, to use the WinCache storage adapter", - "mongofill/mongofill": "Alternative to ext-mongo - a pure PHP implementation designed as a drop in replacement", - "zendframework/zend-serializer": "Zend\\Serializer component", - "zendframework/zend-session": "Zend\\Session component" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.5-dev", - "dev-develop": "2.6-dev" - } - }, - "autoload": { - "psr-4": { - "Zend\\Cache\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "description": "provides a generic way to cache any data", - "homepage": "https://github.com/zendframework/zend-cache", - "keywords": [ - "cache", - "zf2" - ], - "time": "2015-06-03T15:31:59+00:00" - }, - { - "name": "zendframework/zend-config", - "version": "2.5.1", - "source": { - "type": "git", - "url": "https://github.com/zendframework/zend-config.git", - "reference": "ec49b1df1bdd9772df09dc2f612fbfc279bf4c27" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/zendframework/zend-config/zipball/ec49b1df1bdd9772df09dc2f612fbfc279bf4c27", - "reference": "ec49b1df1bdd9772df09dc2f612fbfc279bf4c27", - "shasum": "" - }, - "require": { - "php": ">=5.3.23", - "zendframework/zend-stdlib": "~2.5" - }, - "require-dev": { - "fabpot/php-cs-fixer": "1.7.*", - "phpunit/phpunit": "~4.0", - "zendframework/zend-filter": "~2.5", - "zendframework/zend-i18n": "~2.5", - "zendframework/zend-json": "~2.5", - "zendframework/zend-mvc": "~2.5", - "zendframework/zend-servicemanager": "~2.5" - }, - "suggest": { - "zendframework/zend-filter": "Zend\\Filter component", - "zendframework/zend-i18n": "Zend\\I18n component", - "zendframework/zend-json": "Zend\\Json to use the Json reader or writer classes", - "zendframework/zend-servicemanager": "Zend\\ServiceManager for use with the Config Factory to retrieve reader and writer instances" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.5-dev", - "dev-develop": "2.6-dev" - } - }, - "autoload": { - "psr-4": { - "Zend\\Config\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "description": "provides a nested object property based user interface for accessing this configuration data within application code", - "homepage": "https://github.com/zendframework/zend-config", - "keywords": [ - "config", - "zf2" - ], - "time": "2015-06-03T15:32:00+00:00" - }, - { - "name": "zendframework/zend-eventmanager", - "version": "2.5.1", - "source": { - "type": "git", - "url": "https://github.com/zendframework/zend-eventmanager.git", - "reference": "d94a16039144936f107f906896349900fd634443" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/zendframework/zend-eventmanager/zipball/d94a16039144936f107f906896349900fd634443", - "reference": "d94a16039144936f107f906896349900fd634443", - "shasum": "" - }, - "require": { - "php": ">=5.3.23", - "zendframework/zend-stdlib": "~2.5" - }, - "require-dev": { - "fabpot/php-cs-fixer": "1.7.*", - "phpunit/phpunit": "~4.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.5-dev", - "dev-develop": "2.6-dev" - } - }, - "autoload": { - "psr-4": { - "Zend\\EventManager\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "homepage": "https://github.com/zendframework/zend-eventmanager", - "keywords": [ - "eventmanager", - "zf2" - ], - "time": "2015-06-03T15:32:01+00:00" - }, - { - "name": "zendframework/zend-filter", - "version": "2.5.1", - "source": { - "type": "git", - "url": "https://github.com/zendframework/zend-filter.git", - "reference": "93e6990a198e6cdd811064083acac4693f4b29ae" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/zendframework/zend-filter/zipball/93e6990a198e6cdd811064083acac4693f4b29ae", - "reference": "93e6990a198e6cdd811064083acac4693f4b29ae", - "shasum": "" - }, - "require": { - "php": ">=5.3.23", - "zendframework/zend-stdlib": "~2.5" - }, - "require-dev": { - "fabpot/php-cs-fixer": "1.7.*", - "phpunit/phpunit": "~4.0", - "zendframework/zend-config": "~2.5", - "zendframework/zend-crypt": "~2.5", - "zendframework/zend-i18n": "~2.5", - "zendframework/zend-loader": "~2.5", - "zendframework/zend-servicemanager": "~2.5", - "zendframework/zend-uri": "~2.5" - }, - "suggest": { - "zendframework/zend-crypt": "Zend\\Crypt component", - "zendframework/zend-i18n": "Zend\\I18n component", - "zendframework/zend-servicemanager": "Zend\\ServiceManager component", - "zendframework/zend-uri": "Zend\\Uri component for UriNormalize filter" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.5-dev", - "dev-develop": "2.6-dev" - } - }, - "autoload": { - "psr-4": { - "Zend\\Filter\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "description": "provides a set of commonly needed data filters", - "homepage": "https://github.com/zendframework/zend-filter", - "keywords": [ - "filter", - "zf2" - ], - "time": "2015-06-03T15:32:01+00:00" - }, - { - "name": "zendframework/zend-i18n", - "version": "2.5.1", - "source": { - "type": "git", - "url": "https://github.com/zendframework/zend-i18n.git", - "reference": "509271eb7947e4aabebfc376104179cffea42696" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/zendframework/zend-i18n/zipball/509271eb7947e4aabebfc376104179cffea42696", - "reference": "509271eb7947e4aabebfc376104179cffea42696", - "shasum": "" - }, - "require": { - "php": ">=5.3.23", - "zendframework/zend-stdlib": "~2.5" - }, - "require-dev": { - "fabpot/php-cs-fixer": "1.7.*", - "phpunit/phpunit": "~4.0", - "zendframework/zend-cache": "~2.5", - "zendframework/zend-config": "~2.5", - "zendframework/zend-eventmanager": "~2.5", - "zendframework/zend-filter": "~2.5", - "zendframework/zend-servicemanager": "~2.5", - "zendframework/zend-validator": "~2.5", - "zendframework/zend-view": "~2.5" - }, - "suggest": { - "ext-intl": "Required for most features of Zend\\I18n; included in default builds of PHP", - "zendframework/zend-cache": "Zend\\Cache component", - "zendframework/zend-config": "Zend\\Config component", - "zendframework/zend-eventmanager": "You should install this package to use the events in the translator", - "zendframework/zend-filter": "You should install this package to use the provided filters", - "zendframework/zend-resources": "Translation resources", - "zendframework/zend-servicemanager": "Zend\\ServiceManager component", - "zendframework/zend-validator": "You should install this package to use the provided validators", - "zendframework/zend-view": "You should install this package to use the provided view helpers" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.5-dev", - "dev-develop": "2.6-dev" - } - }, - "autoload": { - "psr-4": { - "Zend\\I18n\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "homepage": "https://github.com/zendframework/zend-i18n", - "keywords": [ - "i18n", - "zf2" - ], - "time": "2015-06-03T15:32:01+00:00" - }, - { - "name": "zendframework/zend-json", - "version": "2.5.1", - "source": { - "type": "git", - "url": "https://github.com/zendframework/zend-json.git", - "reference": "c74eaf17d2dd37dc1e964be8dfde05706a821ebc" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/zendframework/zend-json/zipball/c74eaf17d2dd37dc1e964be8dfde05706a821ebc", - "reference": "c74eaf17d2dd37dc1e964be8dfde05706a821ebc", - "shasum": "" - }, - "require": { - "php": ">=5.3.23", - "zendframework/zend-stdlib": "~2.5" - }, - "require-dev": { - "fabpot/php-cs-fixer": "1.7.*", - "phpunit/phpunit": "~4.0", - "zendframework/zend-http": "~2.5", - "zendframework/zend-server": "~2.5", - "zendframework/zendxml": "~1.0" - }, - "suggest": { - "zendframework/zend-http": "Zend\\Http component", - "zendframework/zend-server": "Zend\\Server component", - "zendframework/zendxml": "To support Zend\\Json\\Json::fromXml() usage" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.5-dev", - "dev-develop": "2.6-dev" - } - }, - "autoload": { - "psr-4": { - "Zend\\Json\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "description": "provides convenience methods for serializing native PHP to JSON and decoding JSON to native PHP", - "homepage": "https://github.com/zendframework/zend-json", - "keywords": [ - "json", - "zf2" - ], - "time": "2015-06-03T15:32:01+00:00" - }, - { - "name": "zendframework/zend-math", - "version": "2.5.1", - "source": { - "type": "git", - "url": "https://github.com/zendframework/zend-math.git", - "reference": "9f02a1ac4d3374d3332c80f9215deec9c71558fc" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/zendframework/zend-math/zipball/9f02a1ac4d3374d3332c80f9215deec9c71558fc", - "reference": "9f02a1ac4d3374d3332c80f9215deec9c71558fc", - "shasum": "" - }, - "require": { - "php": ">=5.3.23" - }, - "require-dev": { - "fabpot/php-cs-fixer": "1.7.*", - "ircmaxell/random-lib": "~1.1", - "phpunit/phpunit": "~4.0", - "zendframework/zend-servicemanager": "~2.5" - }, - "suggest": { - "ext-bcmath": "If using the bcmath functionality", - "ext-gmp": "If using the gmp functionality", - "ircmaxell/random-lib": "Fallback random byte generator for Zend\\Math\\Rand if OpenSSL/Mcrypt extensions are unavailable", - "zendframework/zend-servicemanager": ">= current version, if using the BigInteger::factory functionality" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.5-dev", - "dev-develop": "2.6-dev" - } - }, - "autoload": { - "psr-4": { - "Zend\\Math\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "homepage": "https://github.com/zendframework/zend-math", - "keywords": [ - "math", - "zf2" - ], - "time": "2015-06-03T15:32:02+00:00" - }, - { - "name": "zendframework/zend-serializer", - "version": "2.5.1", - "source": { - "type": "git", - "url": "https://github.com/zendframework/zend-serializer.git", - "reference": "b7208eb17dc4a4fb3a660b85e6c4af035eeed40c" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/zendframework/zend-serializer/zipball/b7208eb17dc4a4fb3a660b85e6c4af035eeed40c", - "reference": "b7208eb17dc4a4fb3a660b85e6c4af035eeed40c", - "shasum": "" - }, - "require": { - "php": ">=5.3.23", - "zendframework/zend-json": "~2.5", - "zendframework/zend-math": "~2.5", - "zendframework/zend-stdlib": "~2.5" - }, - "require-dev": { - "fabpot/php-cs-fixer": "1.7.*", - "phpunit/phpunit": "~4.0", - "zendframework/zend-servicemanager": "~2.5" - }, - "suggest": { - "zendframework/zend-servicemanager": "To support plugin manager support" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.5-dev", - "dev-develop": "2.6-dev" - } - }, - "autoload": { - "psr-4": { - "Zend\\Serializer\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "description": "provides an adapter based interface to simply generate storable representation of PHP types by different facilities, and recover", - "homepage": "https://github.com/zendframework/zend-serializer", - "keywords": [ - "serializer", - "zf2" - ], - "time": "2015-06-03T15:32:02+00:00" - }, - { - "name": "zendframework/zend-servicemanager", - "version": "2.5.1", - "source": { - "type": "git", - "url": "https://github.com/zendframework/zend-servicemanager.git", - "reference": "3b22c403e351d92526c642cba0bd810bc22e1c56" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/zendframework/zend-servicemanager/zipball/3b22c403e351d92526c642cba0bd810bc22e1c56", - "reference": "3b22c403e351d92526c642cba0bd810bc22e1c56", - "shasum": "" - }, - "require": { - "php": ">=5.3.23" - }, - "require-dev": { - "fabpot/php-cs-fixer": "1.7.*", - "phpunit/phpunit": "~4.0", - "zendframework/zend-di": "~2.5", - "zendframework/zend-mvc": "~2.5" - }, - "suggest": { - "ocramius/proxy-manager": "ProxyManager 0.5.* to handle lazy initialization of services", - "zendframework/zend-di": "Zend\\Di component" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.5-dev", - "dev-develop": "2.6-dev" - } - }, - "autoload": { - "psr-4": { - "Zend\\ServiceManager\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "homepage": "https://github.com/zendframework/zend-servicemanager", - "keywords": [ - "servicemanager", - "zf2" - ], - "time": "2015-06-03T15:32:02+00:00" - }, - { - "name": "zendframework/zend-stdlib", - "version": "2.5.1", - "source": { - "type": "git", - "url": "https://github.com/zendframework/zend-stdlib.git", - "reference": "cc8e90a60dd5d44b9730b77d07b97550091da1ae" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/zendframework/zend-stdlib/zipball/cc8e90a60dd5d44b9730b77d07b97550091da1ae", - "reference": "cc8e90a60dd5d44b9730b77d07b97550091da1ae", - "shasum": "" - }, - "require": { - "php": ">=5.3.23" - }, - "require-dev": { - "fabpot/php-cs-fixer": "1.7.*", - "phpunit/phpunit": "~4.0", - "zendframework/zend-config": "~2.5", - "zendframework/zend-eventmanager": "~2.5", - "zendframework/zend-filter": "~2.5", - "zendframework/zend-inputfilter": "~2.5", - "zendframework/zend-serializer": "~2.5", - "zendframework/zend-servicemanager": "~2.5" - }, - "suggest": { - "zendframework/zend-eventmanager": "To support aggregate hydrator usage", - "zendframework/zend-filter": "To support naming strategy hydrator usage", - "zendframework/zend-serializer": "Zend\\Serializer component", - "zendframework/zend-servicemanager": "To support hydrator plugin manager usage" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.5-dev", - "dev-develop": "2.6-dev" - } - }, - "autoload": { - "psr-4": { - "Zend\\Stdlib\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "homepage": "https://github.com/zendframework/zend-stdlib", - "keywords": [ - "stdlib", - "zf2" - ], - "time": "2015-06-03T15:32:03+00:00" - }, - { - "name": "zetacomponents/base", - "version": "1.9", - "source": { - "type": "git", - "url": "https://github.com/zetacomponents/Base.git", - "reference": "f20df24e8de3e48b6b69b2503f917e457281e687" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/zetacomponents/Base/zipball/f20df24e8de3e48b6b69b2503f917e457281e687", - "reference": "f20df24e8de3e48b6b69b2503f917e457281e687", - "shasum": "" - }, - "require-dev": { - "zetacomponents/unit-test": "*" - }, - "type": "library", - "autoload": { - "classmap": [ - "src" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "Apache-2.0" - ], - "authors": [ - { - "name": "Sergey Alexeev" - }, - { - "name": "Sebastian Bergmann" - }, - { - "name": "Jan Borsodi" - }, - { - "name": "Raymond Bosman" - }, - { - "name": "Frederik Holljen" - }, - { - "name": "Kore Nordmann" - }, - { - "name": "Derick Rethans" - }, - { - "name": "Vadym Savchuk" - }, - { - "name": "Tobias Schlitt" - }, - { - "name": "Alexandru Stanoi" - } - ], - "description": "The Base package provides the basic infrastructure that all packages rely on. Therefore every component relies on this package.", - "homepage": "https://github.com/zetacomponents", - "time": "2014-09-19T03:28:34+00:00" - }, - { - "name": "zetacomponents/document", - "version": "1.3.1", - "source": { - "type": "git", - "url": "https://github.com/zetacomponents/Document.git", - "reference": "688abfde573cf3fe0730f82538fbd7aa9fc95bc8" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/zetacomponents/Document/zipball/688abfde573cf3fe0730f82538fbd7aa9fc95bc8", - "reference": "688abfde573cf3fe0730f82538fbd7aa9fc95bc8", - "shasum": "" - }, - "require": { - "zetacomponents/base": "*" - }, - "require-dev": { - "zetacomponents/unit-test": "dev-master" - }, - "type": "library", - "autoload": { - "classmap": [ - "src" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "Apache-2.0" - ], - "authors": [ - { - "name": "Sebastian Bergmann" - }, - { - "name": "Kore Nordmann" - }, - { - "name": "Derick Rethans" - }, - { - "name": "Tobias Schlitt" - }, - { - "name": "Alexandru Stanoi" - } - ], - "description": "The Document components provides a general conversion framework for different semantic document markup languages like XHTML, Docbook, RST and similar.", - "homepage": "https://github.com/zetacomponents", - "time": "2013-12-19T11:40:00+00:00" - } - ], - "aliases": [], - "minimum-stability": "stable", - "stability-flags": [], - "prefer-stable": false, - "prefer-lowest": false, - "platform": { - "php": ">=5.0.0" - }, - "platform-dev": [] -} diff --git a/conlite/external/phpmailer/phpmailer/examples/DKIM.phps b/conlite/external/phpmailer/phpmailer/examples/DKIM.phps deleted file mode 100644 index e3d2bae..0000000 --- a/conlite/external/phpmailer/phpmailer/examples/DKIM.phps +++ /dev/null @@ -1,38 +0,0 @@ -setFrom('from@example.com', 'First Last'); -//Set an alternative reply-to address -$mail->addReplyTo('replyto@example.com', 'First Last'); -//Set who the message is to be sent to -$mail->addAddress('whoto@example.com', 'John Doe'); -//Set the subject line -$mail->Subject = 'PHPMailer DKIM test'; -//This should be the same as the domain of your From address -$mail->DKIM_domain = 'example.com'; -//Path to your private key file -$mail->DKIM_private = 'dkim_private.pem'; -//Set this to your own selector -$mail->DKIM_selector = 'phpmailer'; -//If your private key has a passphrase, set it here -$mail->DKIM_passphrase = ''; -//The identity you're signing as - usually your From address -$mail->DKIM_identity = $mail->From; - -//send the message, check for errors -if (!$mail->send()) { - echo "Mailer Error: " . $mail->ErrorInfo; -} else { - echo "Message sent!"; -} diff --git a/conlite/external/phpmailer/phpmailer/examples/code_generator.phps b/conlite/external/phpmailer/phpmailer/examples/code_generator.phps deleted file mode 100644 index 2182663..0000000 --- a/conlite/external/phpmailer/phpmailer/examples/code_generator.phps +++ /dev/null @@ -1,604 +0,0 @@ -CharSet = 'utf-8'; -ini_set('default_charset', 'UTF-8'); -$mail->Debugoutput = $CFG['smtp_debugoutput']; -$example_code .= "\n\n\$mail = new PHPMailer(true);"; -$example_code .= "\n\$mail->CharSet = 'utf-8';"; -$example_code .= "\nini_set('default_charset', 'UTF-8');"; - -class phpmailerAppException extends phpmailerException -{ -} - -$example_code .= "\n\nclass phpmailerAppException extends phpmailerException {}"; -$example_code .= "\n\ntry {"; - -// Convert a string to its JavaScript representation. -function JSString($s) { - static $from = array("\\", "/", "\n", "\t", "\r", "\b", "\f", '"'); - static $to = array('\\\\', '\\/', '\\n', '\\t', '\\r', '\\b', '\\f', '\\"'); - return is_null($s)? 'null': '"' . str_replace($from, $to, "$s") . '"'; -} - -try { - if (isset($_POST["submit"]) && $_POST['submit'] == "Submit") { - $to = $to_email; - if (!PHPMailer::validateAddress($to)) { - throw new phpmailerAppException("Email address " . $to . " is invalid -- aborting!"); - } - - $example_code .= "\n\$to = '" . addslashes($to_email) . "';"; - $example_code .= "\nif(!PHPMailer::validateAddress(\$to)) {"; - $example_code .= "\n throw new phpmailerAppException(\"Email address \" . " . - "\$to . \" is invalid -- aborting!\");"; - $example_code .= "\n}"; - - switch ($test_type) { - case 'smtp': - $mail->isSMTP(); // telling the class to use SMTP - $mail->SMTPDebug = (integer)$smtp_debug; - $mail->Host = $smtp_server; // SMTP server - $mail->Port = (integer)$smtp_port; // set the SMTP port - if ($smtp_secure) { - $mail->SMTPSecure = strtolower($smtp_secure); - } - $mail->SMTPAuth = array_key_exists('smtp_authenticate', $_POST); // enable SMTP authentication? - if (array_key_exists('smtp_authenticate', $_POST)) { - $mail->Username = $authenticate_username; // SMTP account username - $mail->Password = $authenticate_password; // SMTP account password - } - - $example_code .= "\n\$mail->isSMTP();"; - $example_code .= "\n\$mail->SMTPDebug = " . (integer) $smtp_debug . ";"; - $example_code .= "\n\$mail->Host = \"" . addslashes($smtp_server) . "\";"; - $example_code .= "\n\$mail->Port = \"" . addslashes($smtp_port) . "\";"; - $example_code .= "\n\$mail->SMTPSecure = \"" . addslashes(strtolower($smtp_secure)) . "\";"; - $example_code .= "\n\$mail->SMTPAuth = " . (array_key_exists( - 'smtp_authenticate', - $_POST - ) ? 'true' : 'false') . ";"; - if (array_key_exists('smtp_authenticate', $_POST)) { - $example_code .= "\n\$mail->Username = \"" . addslashes($authenticate_username) . "\";"; - $example_code .= "\n\$mail->Password = \"" . addslashes($authenticate_password) . "\";"; - } - break; - case 'mail': - $mail->isMail(); // telling the class to use PHP's mail() - $example_code .= "\n\$mail->isMail();"; - break; - case 'sendmail': - $mail->isSendmail(); // telling the class to use Sendmail - $example_code .= "\n\$mail->isSendmail();"; - break; - case 'qmail': - $mail->isQmail(); // telling the class to use Qmail - $example_code .= "\n\$mail->isQmail();"; - break; - default: - throw new phpmailerAppException('Invalid test_type provided'); - } - - try { - if ($_POST['From_Name'] != '') { - $mail->addReplyTo($from_email, $from_name); - $mail->setFrom($from_email, $from_name); - - $example_code .= "\n\$mail->addReplyTo(\"" . - addslashes($from_email) . "\", \"" . addslashes($from_name) . "\");"; - $example_code .= "\n\$mail->setFrom(\"" . - addslashes($from_email) . "\", \"" . addslashes($from_name) . "\");"; - } else { - $mail->addReplyTo($from_email); - $mail->setFrom($from_email, $from_email); - - $example_code .= "\n\$mail->addReplyTo(\"" . addslashes($from_email) . "\");"; - $example_code .= "\n\$mail->setFrom(\"" . - addslashes($from_email) . "\", \"" . addslashes($from_email) . "\");"; - } - - if ($_POST['To_Name'] != '') { - $mail->addAddress($to, $to_name); - $example_code .= "\n\$mail->addAddress(\"$to\", \"" . addslashes($to_name) . "\");"; - } else { - $mail->addAddress($to); - $example_code .= "\n\$mail->addAddress(\"$to\");"; - } - - if ($_POST['bcc_Email'] != '') { - $indiBCC = explode(" ", $bcc_email); - foreach ($indiBCC as $key => $value) { - $mail->addBCC($value); - $example_code .= "\n\$mail->addBCC(\"" . addslashes($value) . "\");"; - } - } - - if ($_POST['cc_Email'] != '') { - $indiCC = explode(" ", $cc_Email); - foreach ($indiCC as $key => $value) { - $mail->addCC($value); - $example_code .= "\n\$mail->addCC(\"" . addslashes($value) . "\");"; - } - } - } catch (phpmailerException $e) { //Catch all kinds of bad addressing - throw new phpmailerAppException($e->getMessage()); - } - $mail->Subject = $subject . ' (PHPMailer test using ' . strtoupper($test_type) . ')'; - $example_code .= "\n\$mail->Subject = \"" . addslashes($subject) . - ' (PHPMailer test using ' . addslashes(strtoupper($test_type)) . ')";'; - - if ($_POST['Message'] == '') { - $body = file_get_contents('contents.html'); - } else { - $body = $message; - } - - $example_code .= "\n\$body = <<<'EOT'\n$body\nEOT;"; - - $mail->WordWrap = 78; // set word wrap to the RFC2822 limit - $mail->msgHTML($body, dirname(__FILE__), true); //Create message bodies and embed images - - $example_code .= "\n\$mail->WordWrap = 78;"; - $example_code .= "\n\$mail->msgHTML(\$body, dirname(__FILE__), true); //Create message bodies and embed images"; - - $mail->addAttachment('images/phpmailer_mini.png', 'phpmailer_mini.png'); // optional name - $mail->addAttachment('images/phpmailer.png', 'phpmailer.png'); // optional name - $example_code .= "\n\$mail->addAttachment('images/phpmailer_mini.png'," . - "'phpmailer_mini.png'); // optional name"; - $example_code .= "\n\$mail->addAttachment('images/phpmailer.png', 'phpmailer.png'); // optional name"; - - $example_code .= "\n\ntry {"; - $example_code .= "\n \$mail->send();"; - $example_code .= "\n \$results_messages[] = \"Message has been sent using " . - addslashes(strtoupper($test_type)) . "\";"; - $example_code .= "\n}"; - $example_code .= "\ncatch (phpmailerException \$e) {"; - $example_code .= "\n throw new phpmailerAppException('Unable to send to: ' . \$to. ': '.\$e->getMessage());"; - $example_code .= "\n}"; - - try { - $mail->send(); - $results_messages[] = "Message has been sent using " . strtoupper($test_type); - } catch (phpmailerException $e) { - throw new phpmailerAppException("Unable to send to: " . $to . ': ' . $e->getMessage()); - } - } -} catch (phpmailerAppException $e) { - $results_messages[] = $e->errorMessage(); -} -$example_code .= "\n}"; -$example_code .= "\ncatch (phpmailerAppException \$e) {"; -$example_code .= "\n \$results_messages[] = \$e->errorMessage();"; -$example_code .= "\n}"; -$example_code .= "\n\nif (count(\$results_messages) > 0) {"; -$example_code .= "\n echo \"

Run results

\\n\";"; -$example_code .= "\n echo \"
    \\n\";"; -$example_code .= "\nforeach (\$results_messages as \$result) {"; -$example_code .= "\n echo \"
  • \$result
  • \\n\";"; -$example_code .= "\n}"; -$example_code .= "\necho \"
\\n\";"; -$example_code .= "\n}"; -?> - - - - PHPMailer Test Page - - - - - - - - -"; - echo exit("ERROR: Wrong PHP version. Must be PHP 5 or above."); -} - -if (count($results_messages) > 0) { - echo '

Run results

'; - echo '
    '; - foreach ($results_messages as $result) { - echo "
  • $result
  • "; - } - echo '
'; -} - -if (isset($_POST["submit"]) && $_POST["submit"] == "Submit") { - echo "
\n"; - echo "
Script:\n"; - echo "
\n";
-    echo htmlentities($example_code);
-    echo "\n
\n"; - echo "\n
\n"; -} -?> -
-
-
-
- Mail Details - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - -
- - - -
- - - -
- - - -
- - - -
- - - -
- - - -
- - - -
-
Test will include two attachments.
-
-
-
-
- Mail Test Specs - - - - - -
Test Type -
- - - required> -
-
- - - required> -
-
- - - required> -
-
- - - required> -
-
-
"> - SMTP Specific Options: - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- -
- -
- -
- -
- - value="true"> -
- -
- -
-
-
-
-
- -
-
- -
- -
-
-
- - diff --git a/conlite/external/phpmailer/phpmailer/examples/contactform.phps b/conlite/external/phpmailer/phpmailer/examples/contactform.phps deleted file mode 100644 index d85e204..0000000 --- a/conlite/external/phpmailer/phpmailer/examples/contactform.phps +++ /dev/null @@ -1,71 +0,0 @@ -isSMTP(); - $mail->Host = 'localhost'; - $mail->Port = 25; - - //Use a fixed address in your own domain as the from address - //**DO NOT** use the submitter's address here as it will be forgery - //and will cause your messages to fail SPF checks - $mail->setFrom('from@example.com', 'First Last'); - //Send the message to yourself, or whoever should receive contact for submissions - $mail->addAddress('whoto@example.com', 'John Doe'); - //Put the submitter's address in a reply-to header - //This will fail if the address provided is invalid, - //in which case we should ignore the whole request - if ($mail->addReplyTo($_POST['email'], $_POST['name'])) { - $mail->Subject = 'PHPMailer contact form'; - //Keep it simple - don't use HTML - $mail->isHTML(false); - //Build a simple message body - $mail->Body = <<send()) { - //The reason for failing to send will be in $mail->ErrorInfo - //but you shouldn't display errors to users - process the error, log it on your server. - $msg = 'Sorry, something went wrong. Please try again later.'; - } else { - $msg = 'Message sent! Thanks for contacting us.'; - } - } else { - $msg = 'Invalid email address, message ignored.'; - } -} -?> - - - - - Contact form - - -

Contact us

-$msg"; -} ?> -
-
-
-
- -
- - diff --git a/conlite/external/phpmailer/phpmailer/examples/contents.html b/conlite/external/phpmailer/phpmailer/examples/contents.html deleted file mode 100644 index dc3fc66..0000000 --- a/conlite/external/phpmailer/phpmailer/examples/contents.html +++ /dev/null @@ -1,17 +0,0 @@ - - - - - PHPMailer Test - - -
-

This is a test of PHPMailer.

-
- PHPMailer rocks -
-

This example uses HTML.

-

ISO-8859-1 text:

-
- - diff --git a/conlite/external/phpmailer/phpmailer/examples/contentsutf8.html b/conlite/external/phpmailer/phpmailer/examples/contentsutf8.html deleted file mode 100644 index 035d10c..0000000 --- a/conlite/external/phpmailer/phpmailer/examples/contentsutf8.html +++ /dev/null @@ -1,21 +0,0 @@ - - - - - PHPMailer Test - - -
-

This is a test of PHPMailer.

-
- PHPMailer rocks -
-

This example uses HTML.

-

Chinese text: 郵件內容為空

-

Russian text: Пустое тело сообщения

-

Armenian text: Հաղորդագրությունը դատարկ է

-

Czech text: Prázdné tělo zprávy

-

Emoji: 😂 🦄 💥 📤 📧

-
- - diff --git a/conlite/external/phpmailer/phpmailer/examples/exceptions.phps b/conlite/external/phpmailer/phpmailer/examples/exceptions.phps deleted file mode 100644 index 0e941e7..0000000 --- a/conlite/external/phpmailer/phpmailer/examples/exceptions.phps +++ /dev/null @@ -1,35 +0,0 @@ -setFrom('from@example.com', 'First Last'); - //Set an alternative reply-to address - $mail->addReplyTo('replyto@example.com', 'First Last'); - //Set who the message is to be sent to - $mail->addAddress('whoto@example.com', 'John Doe'); - //Set the subject line - $mail->Subject = 'PHPMailer Exceptions test'; - //Read an HTML message body from an external file, convert referenced images to embedded, - //and convert the HTML into a basic plain-text alternative body - $mail->msgHTML(file_get_contents('contents.html'), dirname(__FILE__)); - //Replace the plain text body with one created manually - $mail->AltBody = 'This is a plain-text message body'; - //Attach an image file - $mail->addAttachment('images/phpmailer_mini.png'); - //send the message - //Note that we don't need check the response from this because it will throw an exception if it has trouble - $mail->send(); - echo "Message sent!"; -} catch (phpmailerException $e) { - echo $e->errorMessage(); //Pretty error messages from PHPMailer -} catch (Exception $e) { - echo $e->getMessage(); //Boring error messages from anything else! -} diff --git a/conlite/external/phpmailer/phpmailer/examples/gmail.phps b/conlite/external/phpmailer/phpmailer/examples/gmail.phps deleted file mode 100644 index 121ca70..0000000 --- a/conlite/external/phpmailer/phpmailer/examples/gmail.phps +++ /dev/null @@ -1,99 +0,0 @@ -isSMTP(); - -//Enable SMTP debugging -// 0 = off (for production use) -// 1 = client messages -// 2 = client and server messages -$mail->SMTPDebug = 2; - -//Ask for HTML-friendly debug output -$mail->Debugoutput = 'html'; - -//Set the hostname of the mail server -$mail->Host = 'smtp.gmail.com'; -// use -// $mail->Host = gethostbyname('smtp.gmail.com'); -// if your network does not support SMTP over IPv6 - -//Set the SMTP port number - 587 for authenticated TLS, a.k.a. RFC4409 SMTP submission -$mail->Port = 587; - -//Set the encryption system to use - ssl (deprecated) or tls -$mail->SMTPSecure = 'tls'; - -//Whether to use SMTP authentication -$mail->SMTPAuth = true; - -//Username to use for SMTP authentication - use full email address for gmail -$mail->Username = "username@gmail.com"; - -//Password to use for SMTP authentication -$mail->Password = "yourpassword"; - -//Set who the message is to be sent from -$mail->setFrom('from@example.com', 'First Last'); - -//Set an alternative reply-to address -$mail->addReplyTo('replyto@example.com', 'First Last'); - -//Set who the message is to be sent to -$mail->addAddress('whoto@example.com', 'John Doe'); - -//Set the subject line -$mail->Subject = 'PHPMailer GMail SMTP test'; - -//Read an HTML message body from an external file, convert referenced images to embedded, -//convert HTML into a basic plain-text alternative body -$mail->msgHTML(file_get_contents('contents.html'), dirname(__FILE__)); - -//Replace the plain text body with one created manually -$mail->AltBody = 'This is a plain-text message body'; - -//Attach an image file -$mail->addAttachment('images/phpmailer_mini.png'); - -//send the message, check for errors -if (!$mail->send()) { - echo "Mailer Error: " . $mail->ErrorInfo; -} else { - echo "Message sent!"; - //Section 2: IMAP - //Uncomment these to save your message in the 'Sent Mail' folder. - #if (save_mail($mail)) { - # echo "Message saved!"; - #} -} - -//Section 2: IMAP -//IMAP commands requires the PHP IMAP Extension, found at: https://php.net/manual/en/imap.setup.php -//Function to call which uses the PHP imap_*() functions to save messages: https://php.net/manual/en/book.imap.php -//You can use imap_getmailboxes($imapStream, '/imap/ssl') to get a list of available folders or labels, this can -//be useful if you are trying to get this working on a non-Gmail IMAP server. -function save_mail($mail) { - //You can change 'Sent Mail' to any other folder or tag - $path = "{imap.gmail.com:993/imap/ssl}[Gmail]/Sent Mail"; - - //Tell your server to open an IMAP connection using the same username and password as you used for SMTP - $imapStream = imap_open($path, $mail->Username, $mail->Password); - - $result = imap_append($imapStream, $path, $mail->getSentMIMEMessage()); - imap_close($imapStream); - - return $result; -} diff --git a/conlite/external/phpmailer/phpmailer/examples/gmail_xoauth.phps b/conlite/external/phpmailer/phpmailer/examples/gmail_xoauth.phps deleted file mode 100644 index 2aec181..0000000 --- a/conlite/external/phpmailer/phpmailer/examples/gmail_xoauth.phps +++ /dev/null @@ -1,85 +0,0 @@ -isSMTP(); - -//Enable SMTP debugging -// 0 = off (for production use) -// 1 = client messages -// 2 = client and server messages -$mail->SMTPDebug = 0; - -//Ask for HTML-friendly debug output -$mail->Debugoutput = 'html'; - -//Set the hostname of the mail server -$mail->Host = 'smtp.gmail.com'; - -//Set the SMTP port number - 587 for authenticated TLS, a.k.a. RFC4409 SMTP submission -$mail->Port = 587; - -//Set the encryption system to use - ssl (deprecated) or tls -$mail->SMTPSecure = 'tls'; - -//Whether to use SMTP authentication -$mail->SMTPAuth = true; - -//Set AuthType -$mail->AuthType = 'XOAUTH2'; - -//User Email to use for SMTP authentication - user who gave consent to our app -$mail->oauthUserEmail = "from@gmail.com"; - -//Obtained From Google Developer Console -$mail->oauthClientId = "RANDOMCHARS-----duv1n2.apps.googleusercontent.com"; - -//Obtained From Google Developer Console -$mail->oauthClientSecret = "RANDOMCHARS-----lGyjPcRtvP"; - -//Obtained By running get_oauth_token.php after setting up APP in Google Developer Console. -//Set Redirect URI in Developer Console as [https/http]:////get_oauth_token.php -// eg: http://localhost/phpmail/get_oauth_token.php -$mail->oauthRefreshToken = "RANDOMCHARS-----DWxgOvPT003r-yFUV49TQYag7_Aod7y0"; - -//Set who the message is to be sent from -//For gmail, this generally needs to be the same as the user you logged in as -$mail->setFrom('from@example.com', 'First Last'); - -//Set who the message is to be sent to -$mail->addAddress('whoto@example.com', 'John Doe'); - -//Set the subject line -$mail->Subject = 'PHPMailer GMail SMTP test'; - -//Read an HTML message body from an external file, convert referenced images to embedded, -//convert HTML into a basic plain-text alternative body -$mail->msgHTML(file_get_contents('contents.html'), dirname(__FILE__)); - -//Replace the plain text body with one created manually -$mail->AltBody = 'This is a plain-text message body'; - -//Attach an image file -$mail->addAttachment('images/phpmailer_mini.png'); - -//send the message, check for errors -if (!$mail->send()) { - echo "Mailer Error: " . $mail->ErrorInfo; -} else { - echo "Message sent!"; -} diff --git a/conlite/external/phpmailer/phpmailer/examples/images/phpmailer.png b/conlite/external/phpmailer/phpmailer/examples/images/phpmailer.png deleted file mode 100644 index 9bdd83c8ded93d00b1e05abcfe1d6cb5b2ae96ef..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 5831 zcmZ`-XE*jNYS*8Z~-kbfbkRA=)I& zL=Q&Y40Gq)^YcFU$G4xopS{2Jt@^I@?zd(p26WV1)I>x?bcXlz%!!DIEeQ9vlq7`f z)5P1NL_};!hI-l-A;h~M-afi%#W#Eg3tdJMlOkV7$H((Oj|&iz9I}fxNQi6Fd*67c zM1*OO(Lp4==ud;$&&mP4Xfs>STdPbC4CBRq2v*6efi0)WFI#+}yEx4`H=B<+a*9`5 z(EY2VGlpKdaTIfA;S+0U?EhKb!jOJBDVVSC--h|{tCM+yB%Ytm9+N|f+*vXXi&Im{ zsi}e%@$cSoi6W6mMv3FoQ+lsP=U$RStAo*g#}|K>J4y}U*N1!`OgwCDbIm+{)_y*^ zl$5&t?XP5EI;-?DB^}*WK0g?2kU*0r`hZK+Ol?N>>guW=T2xi_w*5XU2NzdgR+H;+ z(w{$nMn^}>%7hU}$SdqW&m!1m9e?S1dwbJTQ876(a&t>kVX@dZ)aMChY+mzqtgsvP zQgjDc%vc)Obj>K{j!um9*bA82I?smdXT;ae0fEny3=COhq@<)S_F|HfX=K|TTx)+O z@}?PTtsA4h+^0J@KU_D}1jt%#B_O>>v_br({1|gXeMSC`SrG#u(Jp)yvtC`fbM0I~Q`N$+o+TEn|Gxb&WoXs=@24 z%NTBsg)G+4ki&ziBG)COFZ0*HvyIW8TYW5e$LzVrx~U>uQFpgS5!wSt*^q6~`kv^9 zCG~VkC<_QfGN`Gkm9cG17P9*;U(~WiUUizsO^FDrZbI@z!(6YM>$(2SgK12?opR#R z&T6faL9f|)*{a=wK;iO=JfuH}}y!`RW?(rym++PB;s*DvH5@>0EecAdEmwYgy z)sLu7eIt|I4g3623xyjdrBkc`Q#&+V&;L}Q0@sYf%X2=c2b-TM(Y_+lgJyz$jivhX zlf&yr6aX(Tud0f7KIlSaA1+o-{Z{x#oa&H?de*oxYk_~aQ6^DRL1n#E5_{*H81fTu znV}I)B>w6Q( zxxorC;KzuxL)`JsAJkP-ov^I_CNn1=4)e`Ce>V>|U+)BC{a)mYssuAI0ya=u#d2;q zpGMR31^6x9r7_6si$Ft0cJ>Nc2))&dx`P21kI{uf93r4h&8f|dVL&ei+EPIazLbJA z4Gj3v($n9UrUz;AP!hC4=BC-&xBK_r2U1uhT0$<4t9)XwB(3VwZE?7x$=Q5-i|g4U z3H%Tk8Z85p`u#?aX=H2_P@gcn^vm#6_KbW)!rw>U_o%F|Z?h-3P1~*NuBjC zpS}|zr4S_$23*3LjVN-~_H1+;W23=%04Ny#^@l*?F*N>o##Ds(IrE+XMB$ZiF9C)# z(8B@P(q{!Vhfm+VaQSOC7rBiUdbQOO?&BF0Z92^i*j%@vpn0KRSK9;no0g&D_(qdVG1PPJs(}X1poflKz6XT-*4*BLk*~P^b2&)F|W)p2= z*EuvTa&{@%CB9f@9v~hC8t@mQ4GvqnLS`p?M^Z&jGeNA0Ac-imtPZRzHfCd@+OmfK zhVMiwIU8fa#RKRao~g&Y0Qp6?OrtoF0Aed!7P2aIzv_Fo{kDSJ=uLuB0WEE6k|O3I z!|E*~|Hx{QV%JHSeR)*WC4K(U*eGwPL)J4#kb2b2wcGf6LWaNIoX9u}-y2PFpC-RumMjV< zh5x(KMcNpLnyax&Sz@7ZIl~j zRfbB>UA?!4vS_R6^PlbwCq!7|8{oM1E`m@aq9ZiSk|h54>pbjCIvm-ohMEu7yWH@0XYuD zg+jHXU(#*M)OWT?jQNqFU5f2)@lLl{KzHXJT3Dcu9ABSjf3+lLPD0=oYNBmdt+EQe z=bJ-K^!2O{Hq<{(SLBF8T4Bt$7UDUt!pqqxV-`%IH&tOZl+^`S()hvm>|2|8<=FKj zol=^--D#r;FSlzPa4f@1jt1*QoX_}SSq81hIDQ*N-G1@soF4)PicHEL(v&@X7NVsP|!gFo1P+oGY4gm-ATKq)Co=){Y=5$IugU+j9XOknR&nb=fG6X|#TJ}KaK zKZA6q2yxIZ2m%B=@(U!LaVYybB~Yhg3=IT%1(H&YwU2dXZ7x|t$5&&(`6d<5#|<3_ zRd2=sGqbgocq%2iRo3h*@iO#>m<<>_Xx3>NCl;Y ze+Xe2o5WIN;wU+tgNmdeWA%JOw;&^Ngj%PIO8Q@Ut{o1{2?+^eLj~5*9_(dKj-p2s zj(}21=>$}}=X{*?4?txNosr}f5)zst?3-)F++DmeT4xQ-L_G(#^nx={5x6OCl}CnC z%gf^ggw)3v2(A;Rh3`?El0lmW@jXy?clV&6AQKaM&CV#4*1D*@#Ngndh=@r1c2-ta z>9;qdTv|~?V}AC~h}8zQmzr;iB?w}q5M~sww3!*z^GtWm}|b<*;GVi5Ok1E zE?l^k%9mbEFfN)N7#aqS9T5D)Dmh@J})K+a|uF-!-T`?cG zwkl_$+Ho99kHStOlalEFeW4Hihq$P^Ff;&7(|{w#P;jgoY3&y078HE@Phvw@0+fb2 z6IFzZFWB4_jPXhT*V9};V@|D!9`z216ha%&4h!qL{*nEk!9?8W+hwJ{O5FjvQ8>;k z+$OcCzTWf!bhmI{kbf+eHezS;?k|5;!f1VNZ`;0K5@Qv_#DVC2So$dhe~DDBHF9?(OalI8ANvB#PWAe8#x;a*CNo2E`2aqrD{uZorwsis{G6*GDL$g=`zK-XRGl)~><~_V@e?^FaX}qNVOgwT8CnG6 z7NNjTI&v>ma|LDlq3$)bOLFq0%P*|xXlY(EtiJolS=W!n;oD(;%kA<@$|3J}PIl&f zqH{m0?Clor%*I_0EOBqJ!ct%|UAi$7+trPq-Y7+Y+(Ob-Z+Gj}MqcDQDDtck`me-R zg`&ZJvnhO!P(G@kLLM)eyzVx&ku5-deH|8f9B*5cs{v@EAu#rS0#Om1*T15}hB-}l zEBhV1{7v9mNj$fwt&%kyTbu}UvCF>=h7F@gk^g|cXVVFc|76#Ol{q6!Z6M9?^DvD< z&DWur(F_@H1Es7=%>svZe*qRV^-tFi(Qw?0pWUX=FxQU3*-Tj{!mJs*KU6&lCdC;0 zsQjIz2TJp|8WXwvP+u{I9x*;A!r_N&cURUDU6o#>p!7l#UkSr9>YWga3ElSeaEyje zYL2OJ(G6LKrRJ@pjma`jzL90F$!_J4P04tJ+ECHiCS_qx-fsp*riGdeEV&TdxB8)cxyfM!QaWQFp7H8;-;JmbssU>R z;|R{}3ON+K+c8fCpjF&7(2CjkYX^zit%)1xXNCe_4+Wze$tuIY=?TEDPO@@&wn<)H z$H?(R&;Ihxmri_rec2=bn(t1CoQh}A`N8kAeH6FG#qMUc=RvX(lTx)P9P(DUUD~dd zb}c7cGY&iHcBTo$G3pdJbOn_c+(~gFkQX>a7aF4k2|sss98Tix?>9F=qA0Roz1_2? zof&6b+TLI85DKnjdBEFY4_CXxwmtNrYdToU(1_=MR%hHHyFj{p3$zI?&O z?DiLaHWYlp{gyWL=N5q%@`k2pzuu`f4e#-|=Vk)_=jjklcDj4LW4D6MK!nZ+yN`WW zkPjiUx2tUoXGv0Y5X##E5%A`e*vLTZ8QR5&ky~@;4GEV&3f>A7pb6D(YUORA@--Zo zp1mc+@ld_9nu|DxWjqUg0UWLmcfQ;S?-9~ac6+3I2a$>6B~(^^r9X+HG?3WkIalq3 zfCjWzRrC8DG^_Eh!(Ie0RFYII)h9$9G7 zz$&SGs)K!_$c5IDKi0j^j`$0v;h9ONmi*+ zl(vxI=$R};{)?P~T1&GY0Aq|*ey(DW$#`A@IpynD1gW5S!~5-CpI-pq0l)DGsxb_* z*Tx=i=XvAd6t-UL0ay&JGtG|Ou}QwkT&`Fm`O_AAMm+Qh+2HqjnwT6aR=G~obL^G(_r}PD~sjS%#jXH zhYS$0hzh3vJKDsZ8kCKPe-#_Of^^F4v1xFgVXT=$MoJskKs+<+xMs=Wro4UHK=j{5i#RM((VXR6JB>0)-hYOnl=6jNN??sTG{zN^F>hf8 zBPa?E%%(>H($vI=Ii(1RBB>XFEz7^jjt7g2$u%P(ZikG|N1KW98NZp|R7jQ7O=+k- z?TWD>85?-Kt#f#MnZ+sd-45^8Oht^dCG_KtvpGt zAkEob4fu-R9Zn=)p0yr6IJLsS_7>$?2ec?-wNsYrh|40_ZWUwRNw%8i3j67kqDleO zt$ob3_d0&Ly1L8bk3DHTe&lp@!^)}U$LM(cc@Pi}VubKRwQv#V#D}Dimn!Rl3kx*^ RgdfyIhIdW$>U5l={s-zotz7^B diff --git a/conlite/external/phpmailer/phpmailer/examples/images/phpmailer_mini.png b/conlite/external/phpmailer/phpmailer/examples/images/phpmailer_mini.png deleted file mode 100644 index e6915f4317692a2591ef8c96ef74c50ea42a6fba..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1842 zcmV-22hI42P)cS z;&&eArFvNZrNTx8&q9F_J$UfI*49=(Ti!Qre+`?5s;4?sCM5$wU@&NWeB92?PCr{_ zqSMw;@*%0($^*qB(m{j=BkJz%wlJixH1->VNhVX(7ay~-B2 zwY9a(GT)!}^m4J`HFtBgo^6lOPqq0lIW5kK*IX*LY$!P<2pCjXSI06L85v;~s4wmT(7E?RPes7OO8NtDdii%h! z{r&wcFwPX`%IgXXZ}X*q-+qpER$22FIHr~_b;lDwf`dJJ^oV6rQBlDKW2FljYF*Q} zuB~mj-;tGGvh)cLcIworcO0EOdD0*l(vP{`7Dg*JM7cIVHY>t|VRWsouCmI%e*Idh zR2l<@^wR~y8$amlC$;nCVvknA?)Lj*7ErAt}3cqzHk8tJyGgWB7u&^*VIVczs_7Ju*_MGuU zwwED8;lV&fI-zM`NMlW!qYBCX+*niOi_DJC>RB!U=)mkQ7{Td!6+C7qhOx{7+&2x`M1bJkHQ7-=P<+qZ9bb#)m8tFEs8Cr&CldT(zJA$|b6b?esR;v&LPnGVa!%2;6B zSVvwk6f+wb8ew8$;y_^NY&$zUa6-VYUcHJVLh_YFB7uJ|FE0WH!O7Cn(wjGL9zTAZ zkdS~f5fKr+y}e8@IJ|c48jeoa*4A*BRVo!STU%Sx)6?_v@?dBR7(Dj%^${>c0|zoR zH8sTxM#4UDT1&w25ik15SI3VZ2Z>B3BVcF&yfeo^A&G(^@jP*Haq!FpD<~+y4i+(K z@Y&JPar5R)WDX1rAm{>tyZ-+E#)6^eU}U3WoD8k3te{E)_UzfSCk$cu?Sp|ICJhm=f7Nx`5cU}&*}bw&JQ zJiOpydV2co*|VtCU{}QX7)+oSFJ82?v>^PM35NTM4hd}dw70iswpd9?3A#GM%+OrO zDt^>vfLNLS>@_%TMr1Vd|}HzJ60aBvVG_rWmVq8E^8TZKZQ3k=w3 zG4~I0c6R<$z#ugK)2B}{N||6-QF?lMkh2elHspfgFU$WY1cok+^$k-66AaxF{i?aS z`Ocj?=xnIEsi}zzhH;Bx=&@M1F>~Nw9!vq#Xf&vpn~!h++*H;U0W&XIQq^iT*TmJ; z)!W;fH!c;CFJv;ra)+HtKtKRKVlhB1fF~OoM@Pr~TZ~(PVwlY0 - - - - PHPMailer Examples - - -

PHPMailer code examplesPHPMailer logo

-

This folder contains a collection of examples of using PHPMailer.

-

About testing email sending

-

When working on email sending code you'll find yourself worrying about what might happen if all these test emails got sent to your mailing list. The solution is to use a fake mail server, one that acts just like the real thing, but just doesn't actually send anything out. Some offer web interfaces, feedback, logging, the ability to return specific error codes, all things that are useful for testing error handling, authentication etc. Here's a selection of mail testing tools you might like to try:

-
    -
  • FakeSMTP, a Java desktop app with the ability to show an SMTP log and save messages to a folder.
  • -
  • FakeEmail, a Python-based fake mail server with a web interface.
  • -
  • smtp-sink, part of the Postfix mail server, so you probably already have this installed. This is used in the Travis-CI configuration to run PHPMailer's unit tests.
  • -
  • smtp4dev, a dummy SMTP server for Windows.
  • -
  • fakesendmail.sh, part of PHPMailer's test setup, this is a shell script that emulates sendmail for testing 'mail' or 'sendmail' methods in PHPMailer.
  • -
  • msglint, not a mail server, the IETF's MIME structure analyser checks the formatting of your messages.
  • -
-
-

Security note

-

Before running these examples you'll need to rename them with '.php' extensions. They are supplied as '.phps' files which will usually be displayed with syntax highlighting by PHP instead of running them. This prevents potential security issues with running potential spam-gateway code if you happen to deploy these code examples on a live site - please don't do that! Similarly, don't leave your passwords in these files as they will be visible to the world!

-
-

code_generator.phps

-

This script is a simple code generator - fill in the form and hit submit, and it will use when you entered to email you a message, and will also generate PHP code using your settings that you can copy and paste to use in your own apps. If you need to get going quickly, this is probably the best place to start.

-

mail.phps

-

This script is a basic example which creates an email message from an external HTML file, creates a plain text body, sets various addresses, adds an attachment and sends the message. It uses PHP's built-in mail() function which is the simplest to use, but relies on the presence of a local mail server, something which is not usually available on Windows. If you find yourself in that situation, either install a local mail server, or use a remote one and send using SMTP instead.

-

exceptions.phps

-

The same as the mail example, but shows how to use PHPMailer's optional exceptions for error handling.

-

smtp.phps

-

A simple example sending using SMTP with authentication.

-

smtp_no_auth.phps

-

A simple example sending using SMTP without authentication.

-

sendmail.phps

-

A simple example using sendmail. Sendmail is a program (usually found on Linux/BSD, OS X and other UNIX-alikes) that can be used to submit messages to a local mail server without a lengthy SMTP conversation. It's probably the fastest sending mechanism, but lacks some error reporting features. There are sendmail emulators for most popular mail servers including postfix, qmail, exim etc.

-

gmail.phps

-

Submitting email via Google's Gmail service is a popular use of PHPMailer. It's much the same as normal SMTP sending, just with some specific settings, namely using TLS encryption, authentication is enabled, and it connects to the SMTP submission port 587 on the smtp.gmail.com host. This example does all that.

-

pop_before_smtp.phps

-

Before effective SMTP authentication mechanisms were available, it was common for ISPs to use POP-before-SMTP authentication. As it implies, you authenticate using the POP3 protocol (an older protocol now mostly replaced by the far superior IMAP), and then the SMTP server will allow send access from your IP address for a short while, usually 5-15 minutes. PHPMailer includes a POP3 protocol client, so it can carry out this sequence - it's just like a normal SMTP conversation (without authentication), but connects via POP first.

-

mailing_list.phps

-

This is a somewhat naïve example of sending similar emails to a list of different addresses. It sets up a PHPMailer instance using SMTP, then connects to a MySQL database to retrieve a list of recipients. The code loops over this list, sending email to each person using their info and marks them as sent in the database. It makes use of SMTP keepalive which saves reconnecting and re-authenticating between each message.

-
-

smtp_check.phps

-

This is an example showing how to use the SMTP class by itself (without PHPMailer) to check an SMTP connection.

-
-

Most of these examples use the 'example.com' domain. This domain is reserved by IANA for illustrative purposes, as documented in RFC 2606. Don't use made-up domains like 'mydomain.com' or 'somedomain.com' in examples as someone, somewhere, probably owns them!

- - diff --git a/conlite/external/phpmailer/phpmailer/examples/mail.phps b/conlite/external/phpmailer/phpmailer/examples/mail.phps deleted file mode 100644 index 8e129f4..0000000 --- a/conlite/external/phpmailer/phpmailer/examples/mail.phps +++ /dev/null @@ -1,31 +0,0 @@ -setFrom('from@example.com', 'First Last'); -//Set an alternative reply-to address -$mail->addReplyTo('replyto@example.com', 'First Last'); -//Set who the message is to be sent to -$mail->addAddress('whoto@example.com', 'John Doe'); -//Set the subject line -$mail->Subject = 'PHPMailer mail() test'; -//Read an HTML message body from an external file, convert referenced images to embedded, -//convert HTML into a basic plain-text alternative body -$mail->msgHTML(file_get_contents('contents.html'), dirname(__FILE__)); -//Replace the plain text body with one created manually -$mail->AltBody = 'This is a plain-text message body'; -//Attach an image file -$mail->addAttachment('images/phpmailer_mini.png'); - -//send the message, check for errors -if (!$mail->send()) { - echo "Mailer Error: " . $mail->ErrorInfo; -} else { - echo "Message sent!"; -} diff --git a/conlite/external/phpmailer/phpmailer/examples/mailing_list.phps b/conlite/external/phpmailer/phpmailer/examples/mailing_list.phps deleted file mode 100644 index 8644bb5..0000000 --- a/conlite/external/phpmailer/phpmailer/examples/mailing_list.phps +++ /dev/null @@ -1,59 +0,0 @@ -isSMTP(); -$mail->Host = 'smtp.example.com'; -$mail->SMTPAuth = true; -$mail->SMTPKeepAlive = true; // SMTP connection will not close after each email sent, reduces SMTP overhead -$mail->Port = 25; -$mail->Username = 'yourname@example.com'; -$mail->Password = 'yourpassword'; -$mail->setFrom('list@example.com', 'List manager'); -$mail->addReplyTo('list@example.com', 'List manager'); - -$mail->Subject = "PHPMailer Simple database mailing list test"; - -//Same body for all messages, so set this before the sending loop -//If you generate a different body for each recipient (e.g. you're using a templating system), -//set it inside the loop -$mail->msgHTML($body); -//msgHTML also sets AltBody, but if you want a custom one, set it afterwards -$mail->AltBody = 'To view the message, please use an HTML compatible email viewer!'; - -//Connect to the database and select the recipients from your mailing list that have not yet been sent to -//You'll need to alter this to match your database -$mysql = mysqli_connect('localhost', 'username', 'password'); -mysqli_select_db($mysql, 'mydb'); -$result = mysqli_query($mysql, 'SELECT full_name, email, photo FROM mailinglist WHERE sent = false'); - -foreach ($result as $row) { //This iterator syntax only works in PHP 5.4+ - $mail->addAddress($row['email'], $row['full_name']); - if (!empty($row['photo'])) { - $mail->addStringAttachment($row['photo'], 'YourPhoto.jpg'); //Assumes the image data is stored in the DB - } - - if (!$mail->send()) { - echo "Mailer Error (" . str_replace("@", "@", $row["email"]) . ') ' . $mail->ErrorInfo . '
'; - break; //Abandon sending - } else { - echo "Message sent to :" . $row['full_name'] . ' (' . str_replace("@", "@", $row['email']) . ')
'; - //Mark it as sent in the DB - mysqli_query( - $mysql, - "UPDATE mailinglist SET sent = true WHERE email = '" . - mysqli_real_escape_string($mysql, $row['email']) . "'" - ); - } - // Clear all addresses and attachments for next loop - $mail->clearAddresses(); - $mail->clearAttachments(); -} diff --git a/conlite/external/phpmailer/phpmailer/examples/pop_before_smtp.phps b/conlite/external/phpmailer/phpmailer/examples/pop_before_smtp.phps deleted file mode 100644 index 164dfe8..0000000 --- a/conlite/external/phpmailer/phpmailer/examples/pop_before_smtp.phps +++ /dev/null @@ -1,54 +0,0 @@ -isSMTP(); - //Enable SMTP debugging - // 0 = off (for production use) - // 1 = client messages - // 2 = client and server messages - $mail->SMTPDebug = 2; - //Ask for HTML-friendly debug output - $mail->Debugoutput = 'html'; - //Set the hostname of the mail server - $mail->Host = "mail.example.com"; - //Set the SMTP port number - likely to be 25, 465 or 587 - $mail->Port = 25; - //Whether to use SMTP authentication - $mail->SMTPAuth = false; - //Set who the message is to be sent from - $mail->setFrom('from@example.com', 'First Last'); - //Set an alternative reply-to address - $mail->addReplyTo('replyto@example.com', 'First Last'); - //Set who the message is to be sent to - $mail->addAddress('whoto@example.com', 'John Doe'); - //Set the subject line - $mail->Subject = 'PHPMailer POP-before-SMTP test'; - //Read an HTML message body from an external file, convert referenced images to embedded, - //and convert the HTML into a basic plain-text alternative body - $mail->msgHTML(file_get_contents('contents.html'), dirname(__FILE__)); - //Replace the plain text body with one created manually - $mail->AltBody = 'This is a plain-text message body'; - //Attach an image file - $mail->addAttachment('images/phpmailer_mini.png'); - //send the message - //Note that we don't need check the response from this because it will throw an exception if it has trouble - $mail->send(); - echo "Message sent!"; -} catch (phpmailerException $e) { - echo $e->errorMessage(); //Pretty error messages from PHPMailer -} catch (Exception $e) { - echo $e->getMessage(); //Boring error messages from anything else! -} diff --git a/conlite/external/phpmailer/phpmailer/examples/scripts/XRegExp.js b/conlite/external/phpmailer/phpmailer/examples/scripts/XRegExp.js deleted file mode 100644 index feb6679..0000000 --- a/conlite/external/phpmailer/phpmailer/examples/scripts/XRegExp.js +++ /dev/null @@ -1,664 +0,0 @@ -// XRegExp 1.5.1 -// (c) 2007-2012 Steven Levithan -// MIT License -// -// Provides an augmented, extensible, cross-browser implementation of regular expressions, -// including support for additional syntax, flags, and methods - -var XRegExp; - -if (XRegExp) { - // Avoid running twice, since that would break references to native globals - throw Error("can't load XRegExp twice in the same frame"); -} - -// Run within an anonymous function to protect variables and avoid new globals -(function (undefined) { - - //--------------------------------- - // Constructor - //--------------------------------- - - // Accepts a pattern and flags; returns a new, extended `RegExp` object. Differs from a native - // regular expression in that additional syntax and flags are supported and cross-browser - // syntax inconsistencies are ameliorated. `XRegExp(/regex/)` clones an existing regex and - // converts to type XRegExp - XRegExp = function (pattern, flags) { - var output = [], - currScope = XRegExp.OUTSIDE_CLASS, - pos = 0, - context, tokenResult, match, chr, regex; - - if (XRegExp.isRegExp(pattern)) { - if (flags !== undefined) - throw TypeError("can't supply flags when constructing one RegExp from another"); - return clone(pattern); - } - // Tokens become part of the regex construction process, so protect against infinite - // recursion when an XRegExp is constructed within a token handler or trigger - if (isInsideConstructor) - throw Error("can't call the XRegExp constructor within token definition functions"); - - flags = flags || ""; - context = { // `this` object for custom tokens - hasNamedCapture: false, - captureNames: [], - hasFlag: function (flag) {return flags.indexOf(flag) > -1;}, - setFlag: function (flag) {flags += flag;} - }; - - while (pos < pattern.length) { - // Check for custom tokens at the current position - tokenResult = runTokens(pattern, pos, currScope, context); - - if (tokenResult) { - output.push(tokenResult.output); - pos += (tokenResult.match[0].length || 1); - } else { - // Check for native multicharacter metasequences (excluding character classes) at - // the current position - if (match = nativ.exec.call(nativeTokens[currScope], pattern.slice(pos))) { - output.push(match[0]); - pos += match[0].length; - } else { - chr = pattern.charAt(pos); - if (chr === "[") - currScope = XRegExp.INSIDE_CLASS; - else if (chr === "]") - currScope = XRegExp.OUTSIDE_CLASS; - // Advance position one character - output.push(chr); - pos++; - } - } - } - - regex = RegExp(output.join(""), nativ.replace.call(flags, flagClip, "")); - regex._xregexp = { - source: pattern, - captureNames: context.hasNamedCapture ? context.captureNames : null - }; - return regex; - }; - - - //--------------------------------- - // Public properties - //--------------------------------- - - XRegExp.version = "1.5.1"; - - // Token scope bitflags - XRegExp.INSIDE_CLASS = 1; - XRegExp.OUTSIDE_CLASS = 2; - - - //--------------------------------- - // Private variables - //--------------------------------- - - var replacementToken = /\$(?:(\d\d?|[$&`'])|{([$\w]+)})/g, - flagClip = /[^gimy]+|([\s\S])(?=[\s\S]*\1)/g, // Nonnative and duplicate flags - quantifier = /^(?:[?*+]|{\d+(?:,\d*)?})\??/, - isInsideConstructor = false, - tokens = [], - // Copy native globals for reference ("native" is an ES3 reserved keyword) - nativ = { - exec: RegExp.prototype.exec, - test: RegExp.prototype.test, - match: String.prototype.match, - replace: String.prototype.replace, - split: String.prototype.split - }, - compliantExecNpcg = nativ.exec.call(/()??/, "")[1] === undefined, // check `exec` handling of nonparticipating capturing groups - compliantLastIndexIncrement = function () { - var x = /^/g; - nativ.test.call(x, ""); - return !x.lastIndex; - }(), - hasNativeY = RegExp.prototype.sticky !== undefined, - nativeTokens = {}; - - // `nativeTokens` match native multicharacter metasequences only (including deprecated octals, - // excluding character classes) - nativeTokens[XRegExp.INSIDE_CLASS] = /^(?:\\(?:[0-3][0-7]{0,2}|[4-7][0-7]?|x[\dA-Fa-f]{2}|u[\dA-Fa-f]{4}|c[A-Za-z]|[\s\S]))/; - nativeTokens[XRegExp.OUTSIDE_CLASS] = /^(?:\\(?:0(?:[0-3][0-7]{0,2}|[4-7][0-7]?)?|[1-9]\d*|x[\dA-Fa-f]{2}|u[\dA-Fa-f]{4}|c[A-Za-z]|[\s\S])|\(\?[:=!]|[?*+]\?|{\d+(?:,\d*)?}\??)/; - - - //--------------------------------- - // Public methods - //--------------------------------- - - // Lets you extend or change XRegExp syntax and create custom flags. This is used internally by - // the XRegExp library and can be used to create XRegExp plugins. This function is intended for - // users with advanced knowledge of JavaScript's regular expression syntax and behavior. It can - // be disabled by `XRegExp.freezeTokens` - XRegExp.addToken = function (regex, handler, scope, trigger) { - tokens.push({ - pattern: clone(regex, "g" + (hasNativeY ? "y" : "")), - handler: handler, - scope: scope || XRegExp.OUTSIDE_CLASS, - trigger: trigger || null - }); - }; - - // Accepts a pattern and flags; returns an extended `RegExp` object. If the pattern and flag - // combination has previously been cached, the cached copy is returned; otherwise the newly - // created regex is cached - XRegExp.cache = function (pattern, flags) { - var key = pattern + "/" + (flags || ""); - return XRegExp.cache[key] || (XRegExp.cache[key] = XRegExp(pattern, flags)); - }; - - // Accepts a `RegExp` instance; returns a copy with the `/g` flag set. The copy has a fresh - // `lastIndex` (set to zero). If you want to copy a regex without forcing the `global` - // property, use `XRegExp(regex)`. Do not use `RegExp(regex)` because it will not preserve - // special properties required for named capture - XRegExp.copyAsGlobal = function (regex) { - return clone(regex, "g"); - }; - - // Accepts a string; returns the string with regex metacharacters escaped. The returned string - // can safely be used at any point within a regex to match the provided literal string. Escaped - // characters are [ ] { } ( ) * + ? - . , \ ^ $ | # and whitespace - XRegExp.escape = function (str) { - return str.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&"); - }; - - // Accepts a string to search, regex to search with, position to start the search within the - // string (default: 0), and an optional Boolean indicating whether matches must start at-or- - // after the position or at the specified position only. This function ignores the `lastIndex` - // of the provided regex in its own handling, but updates the property for compatibility - XRegExp.execAt = function (str, regex, pos, anchored) { - var r2 = clone(regex, "g" + ((anchored && hasNativeY) ? "y" : "")), - match; - r2.lastIndex = pos = pos || 0; - match = r2.exec(str); // Run the altered `exec` (required for `lastIndex` fix, etc.) - if (anchored && match && match.index !== pos) - match = null; - if (regex.global) - regex.lastIndex = match ? r2.lastIndex : 0; - return match; - }; - - // Breaks the unrestorable link to XRegExp's private list of tokens, thereby preventing - // syntax and flag changes. Should be run after XRegExp and any plugins are loaded - XRegExp.freezeTokens = function () { - XRegExp.addToken = function () { - throw Error("can't run addToken after freezeTokens"); - }; - }; - - // Accepts any value; returns a Boolean indicating whether the argument is a `RegExp` object. - // Note that this is also `true` for regex literals and regexes created by the `XRegExp` - // constructor. This works correctly for variables created in another frame, when `instanceof` - // and `constructor` checks would fail to work as intended - XRegExp.isRegExp = function (o) { - return Object.prototype.toString.call(o) === "[object RegExp]"; - }; - - // Executes `callback` once per match within `str`. Provides a simpler and cleaner way to - // iterate over regex matches compared to the traditional approaches of subverting - // `String.prototype.replace` or repeatedly calling `exec` within a `while` loop - XRegExp.iterate = function (str, regex, callback, context) { - var r2 = clone(regex, "g"), - i = -1, match; - while (match = r2.exec(str)) { // Run the altered `exec` (required for `lastIndex` fix, etc.) - if (regex.global) - regex.lastIndex = r2.lastIndex; // Doing this to follow expectations if `lastIndex` is checked within `callback` - callback.call(context, match, ++i, str, regex); - if (r2.lastIndex === match.index) - r2.lastIndex++; - } - if (regex.global) - regex.lastIndex = 0; - }; - - // Accepts a string and an array of regexes; returns the result of using each successive regex - // to search within the matches of the previous regex. The array of regexes can also contain - // objects with `regex` and `backref` properties, in which case the named or numbered back- - // references specified are passed forward to the next regex or returned. E.g.: - // var xregexpImgFileNames = XRegExp.matchChain(html, [ - // {regex: /]+)>/i, backref: 1}, // tag attributes - // {regex: XRegExp('(?ix) \\s src=" (? [^"]+ )'), backref: "src"}, // src attribute values - // {regex: XRegExp("^http://xregexp\\.com(/[^#?]+)", "i"), backref: 1}, // xregexp.com paths - // /[^\/]+$/ // filenames (strip directory paths) - // ]); - XRegExp.matchChain = function (str, chain) { - return function recurseChain (values, level) { - var item = chain[level].regex ? chain[level] : {regex: chain[level]}, - regex = clone(item.regex, "g"), - matches = [], i; - for (i = 0; i < values.length; i++) { - XRegExp.iterate(values[i], regex, function (match) { - matches.push(item.backref ? (match[item.backref] || "") : match[0]); - }); - } - return ((level === chain.length - 1) || !matches.length) ? - matches : recurseChain(matches, level + 1); - }([str], 0); - }; - - - //--------------------------------- - // New RegExp prototype methods - //--------------------------------- - - // Accepts a context object and arguments array; returns the result of calling `exec` with the - // first value in the arguments array. the context is ignored but is accepted for congruity - // with `Function.prototype.apply` - RegExp.prototype.apply = function (context, args) { - return this.exec(args[0]); - }; - - // Accepts a context object and string; returns the result of calling `exec` with the provided - // string. the context is ignored but is accepted for congruity with `Function.prototype.call` - RegExp.prototype.call = function (context, str) { - return this.exec(str); - }; - - - //--------------------------------- - // Overridden native methods - //--------------------------------- - - // Adds named capture support (with backreferences returned as `result.name`), and fixes two - // cross-browser issues per ES3: - // - Captured values for nonparticipating capturing groups should be returned as `undefined`, - // rather than the empty string. - // - `lastIndex` should not be incremented after zero-length matches. - RegExp.prototype.exec = function (str) { - var match, name, r2, origLastIndex; - if (!this.global) - origLastIndex = this.lastIndex; - match = nativ.exec.apply(this, arguments); - if (match) { - // Fix browsers whose `exec` methods don't consistently return `undefined` for - // nonparticipating capturing groups - if (!compliantExecNpcg && match.length > 1 && indexOf(match, "") > -1) { - r2 = RegExp(this.source, nativ.replace.call(getNativeFlags(this), "g", "")); - // Using `str.slice(match.index)` rather than `match[0]` in case lookahead allowed - // matching due to characters outside the match - nativ.replace.call((str + "").slice(match.index), r2, function () { - for (var i = 1; i < arguments.length - 2; i++) { - if (arguments[i] === undefined) - match[i] = undefined; - } - }); - } - // Attach named capture properties - if (this._xregexp && this._xregexp.captureNames) { - for (var i = 1; i < match.length; i++) { - name = this._xregexp.captureNames[i - 1]; - if (name) - match[name] = match[i]; - } - } - // Fix browsers that increment `lastIndex` after zero-length matches - if (!compliantLastIndexIncrement && this.global && !match[0].length && (this.lastIndex > match.index)) - this.lastIndex--; - } - if (!this.global) - this.lastIndex = origLastIndex; // Fix IE, Opera bug (last tested IE 9.0.5, Opera 11.61 on Windows) - return match; - }; - - // Fix browser bugs in native method - RegExp.prototype.test = function (str) { - // Use the native `exec` to skip some processing overhead, even though the altered - // `exec` would take care of the `lastIndex` fixes - var match, origLastIndex; - if (!this.global) - origLastIndex = this.lastIndex; - match = nativ.exec.call(this, str); - // Fix browsers that increment `lastIndex` after zero-length matches - if (match && !compliantLastIndexIncrement && this.global && !match[0].length && (this.lastIndex > match.index)) - this.lastIndex--; - if (!this.global) - this.lastIndex = origLastIndex; // Fix IE, Opera bug (last tested IE 9.0.5, Opera 11.61 on Windows) - return !!match; - }; - - // Adds named capture support and fixes browser bugs in native method - String.prototype.match = function (regex) { - if (!XRegExp.isRegExp(regex)) - regex = RegExp(regex); // Native `RegExp` - if (regex.global) { - var result = nativ.match.apply(this, arguments); - regex.lastIndex = 0; // Fix IE bug - return result; - } - return regex.exec(this); // Run the altered `exec` - }; - - // Adds support for `${n}` tokens for named and numbered backreferences in replacement text, - // and provides named backreferences to replacement functions as `arguments[0].name`. Also - // fixes cross-browser differences in replacement text syntax when performing a replacement - // using a nonregex search value, and the value of replacement regexes' `lastIndex` property - // during replacement iterations. Note that this doesn't support SpiderMonkey's proprietary - // third (`flags`) parameter - String.prototype.replace = function (search, replacement) { - var isRegex = XRegExp.isRegExp(search), - captureNames, result, str, origLastIndex; - - // There are too many combinations of search/replacement types/values and browser bugs that - // preclude passing to native `replace`, so don't try - //if (...) - // return nativ.replace.apply(this, arguments); - - if (isRegex) { - if (search._xregexp) - captureNames = search._xregexp.captureNames; // Array or `null` - if (!search.global) - origLastIndex = search.lastIndex; - } else { - search = search + ""; // Type conversion - } - - if (Object.prototype.toString.call(replacement) === "[object Function]") { - result = nativ.replace.call(this + "", search, function () { - if (captureNames) { - // Change the `arguments[0]` string primitive to a String object which can store properties - arguments[0] = new String(arguments[0]); - // Store named backreferences on `arguments[0]` - for (var i = 0; i < captureNames.length; i++) { - if (captureNames[i]) - arguments[0][captureNames[i]] = arguments[i + 1]; - } - } - // Update `lastIndex` before calling `replacement` (fix browsers) - if (isRegex && search.global) - search.lastIndex = arguments[arguments.length - 2] + arguments[0].length; - return replacement.apply(null, arguments); - }); - } else { - str = this + ""; // Type conversion, so `args[args.length - 1]` will be a string (given nonstring `this`) - result = nativ.replace.call(str, search, function () { - var args = arguments; // Keep this function's `arguments` available through closure - return nativ.replace.call(replacement + "", replacementToken, function ($0, $1, $2) { - // Numbered backreference (without delimiters) or special variable - if ($1) { - switch ($1) { - case "$": return "$"; - case "&": return args[0]; - case "`": return args[args.length - 1].slice(0, args[args.length - 2]); - case "'": return args[args.length - 1].slice(args[args.length - 2] + args[0].length); - // Numbered backreference - default: - // What does "$10" mean? - // - Backreference 10, if 10 or more capturing groups exist - // - Backreference 1 followed by "0", if 1-9 capturing groups exist - // - Otherwise, it's the string "$10" - // Also note: - // - Backreferences cannot be more than two digits (enforced by `replacementToken`) - // - "$01" is equivalent to "$1" if a capturing group exists, otherwise it's the string "$01" - // - There is no "$0" token ("$&" is the entire match) - var literalNumbers = ""; - $1 = +$1; // Type conversion; drop leading zero - if (!$1) // `$1` was "0" or "00" - return $0; - while ($1 > args.length - 3) { - literalNumbers = String.prototype.slice.call($1, -1) + literalNumbers; - $1 = Math.floor($1 / 10); // Drop the last digit - } - return ($1 ? args[$1] || "" : "$") + literalNumbers; - } - // Named backreference or delimited numbered backreference - } else { - // What does "${n}" mean? - // - Backreference to numbered capture n. Two differences from "$n": - // - n can be more than two digits - // - Backreference 0 is allowed, and is the entire match - // - Backreference to named capture n, if it exists and is not a number overridden by numbered capture - // - Otherwise, it's the string "${n}" - var n = +$2; // Type conversion; drop leading zeros - if (n <= args.length - 3) - return args[n]; - n = captureNames ? indexOf(captureNames, $2) : -1; - return n > -1 ? args[n + 1] : $0; - } - }); - }); - } - - if (isRegex) { - if (search.global) - search.lastIndex = 0; // Fix IE, Safari bug (last tested IE 9.0.5, Safari 5.1.2 on Windows) - else - search.lastIndex = origLastIndex; // Fix IE, Opera bug (last tested IE 9.0.5, Opera 11.61 on Windows) - } - - return result; - }; - - // A consistent cross-browser, ES3 compliant `split` - String.prototype.split = function (s /* separator */, limit) { - // If separator `s` is not a regex, use the native `split` - if (!XRegExp.isRegExp(s)) - return nativ.split.apply(this, arguments); - - var str = this + "", // Type conversion - output = [], - lastLastIndex = 0, - match, lastLength; - - // Behavior for `limit`: if it's... - // - `undefined`: No limit - // - `NaN` or zero: Return an empty array - // - A positive number: Use `Math.floor(limit)` - // - A negative number: No limit - // - Other: Type-convert, then use the above rules - if (limit === undefined || +limit < 0) { - limit = Infinity; - } else { - limit = Math.floor(+limit); - if (!limit) - return []; - } - - // This is required if not `s.global`, and it avoids needing to set `s.lastIndex` to zero - // and restore it to its original value when we're done using the regex - s = XRegExp.copyAsGlobal(s); - - while (match = s.exec(str)) { // Run the altered `exec` (required for `lastIndex` fix, etc.) - if (s.lastIndex > lastLastIndex) { - output.push(str.slice(lastLastIndex, match.index)); - - if (match.length > 1 && match.index < str.length) - Array.prototype.push.apply(output, match.slice(1)); - - lastLength = match[0].length; - lastLastIndex = s.lastIndex; - - if (output.length >= limit) - break; - } - - if (s.lastIndex === match.index) - s.lastIndex++; - } - - if (lastLastIndex === str.length) { - if (!nativ.test.call(s, "") || lastLength) - output.push(""); - } else { - output.push(str.slice(lastLastIndex)); - } - - return output.length > limit ? output.slice(0, limit) : output; - }; - - - //--------------------------------- - // Private helper functions - //--------------------------------- - - // Supporting function for `XRegExp`, `XRegExp.copyAsGlobal`, etc. Returns a copy of a `RegExp` - // instance with a fresh `lastIndex` (set to zero), preserving properties required for named - // capture. Also allows adding new flags in the process of copying the regex - function clone (regex, additionalFlags) { - if (!XRegExp.isRegExp(regex)) - throw TypeError("type RegExp expected"); - var x = regex._xregexp; - regex = XRegExp(regex.source, getNativeFlags(regex) + (additionalFlags || "")); - if (x) { - regex._xregexp = { - source: x.source, - captureNames: x.captureNames ? x.captureNames.slice(0) : null - }; - } - return regex; - } - - function getNativeFlags (regex) { - return (regex.global ? "g" : "") + - (regex.ignoreCase ? "i" : "") + - (regex.multiline ? "m" : "") + - (regex.extended ? "x" : "") + // Proposed for ES4; included in AS3 - (regex.sticky ? "y" : ""); - } - - function runTokens (pattern, index, scope, context) { - var i = tokens.length, - result, match, t; - // Protect against constructing XRegExps within token handler and trigger functions - isInsideConstructor = true; - // Must reset `isInsideConstructor`, even if a `trigger` or `handler` throws - try { - while (i--) { // Run in reverse order - t = tokens[i]; - if ((scope & t.scope) && (!t.trigger || t.trigger.call(context))) { - t.pattern.lastIndex = index; - match = t.pattern.exec(pattern); // Running the altered `exec` here allows use of named backreferences, etc. - if (match && match.index === index) { - result = { - output: t.handler.call(context, match, scope), - match: match - }; - break; - } - } - } - } catch (err) { - throw err; - } finally { - isInsideConstructor = false; - } - return result; - } - - function indexOf (array, item, from) { - if (Array.prototype.indexOf) // Use the native array method if available - return array.indexOf(item, from); - for (var i = from || 0; i < array.length; i++) { - if (array[i] === item) - return i; - } - return -1; - } - - - //--------------------------------- - // Built-in tokens - //--------------------------------- - - // Augment XRegExp's regular expression syntax and flags. Note that when adding tokens, the - // third (`scope`) argument defaults to `XRegExp.OUTSIDE_CLASS` - - // Comment pattern: (?# ) - XRegExp.addToken( - /\(\?#[^)]*\)/, - function (match) { - // Keep tokens separated unless the following token is a quantifier - return nativ.test.call(quantifier, match.input.slice(match.index + match[0].length)) ? "" : "(?:)"; - } - ); - - // Capturing group (match the opening parenthesis only). - // Required for support of named capturing groups - XRegExp.addToken( - /\((?!\?)/, - function () { - this.captureNames.push(null); - return "("; - } - ); - - // Named capturing group (match the opening delimiter only): (? - XRegExp.addToken( - /\(\?<([$\w]+)>/, - function (match) { - this.captureNames.push(match[1]); - this.hasNamedCapture = true; - return "("; - } - ); - - // Named backreference: \k - XRegExp.addToken( - /\\k<([\w$]+)>/, - function (match) { - var index = indexOf(this.captureNames, match[1]); - // Keep backreferences separate from subsequent literal numbers. Preserve back- - // references to named groups that are undefined at this point as literal strings - return index > -1 ? - "\\" + (index + 1) + (isNaN(match.input.charAt(match.index + match[0].length)) ? "" : "(?:)") : - match[0]; - } - ); - - // Empty character class: [] or [^] - XRegExp.addToken( - /\[\^?]/, - function (match) { - // For cross-browser compatibility with ES3, convert [] to \b\B and [^] to [\s\S]. - // (?!) should work like \b\B, but is unreliable in Firefox - return match[0] === "[]" ? "\\b\\B" : "[\\s\\S]"; - } - ); - - // Mode modifier at the start of the pattern only, with any combination of flags imsx: (?imsx) - // Does not support x(?i), (?-i), (?i-m), (?i: ), (?i)(?m), etc. - XRegExp.addToken( - /^\(\?([imsx]+)\)/, - function (match) { - this.setFlag(match[1]); - return ""; - } - ); - - // Whitespace and comments, in free-spacing (aka extended) mode only - XRegExp.addToken( - /(?:\s+|#.*)+/, - function (match) { - // Keep tokens separated unless the following token is a quantifier - return nativ.test.call(quantifier, match.input.slice(match.index + match[0].length)) ? "" : "(?:)"; - }, - XRegExp.OUTSIDE_CLASS, - function () {return this.hasFlag("x");} - ); - - // Dot, in dotall (aka singleline) mode only - XRegExp.addToken( - /\./, - function () {return "[\\s\\S]";}, - XRegExp.OUTSIDE_CLASS, - function () {return this.hasFlag("s");} - ); - - - //--------------------------------- - // Backward compatibility - //--------------------------------- - - // Uncomment the following block for compatibility with XRegExp 1.0-1.2: - /* - XRegExp.matchWithinChain = XRegExp.matchChain; - RegExp.prototype.addFlags = function (s) {return clone(this, s);}; - RegExp.prototype.execAll = function (s) {var r = []; XRegExp.iterate(s, this, function (m) {r.push(m);}); return r;}; - RegExp.prototype.forEachExec = function (s, f, c) {return XRegExp.iterate(s, this, f, c);}; - RegExp.prototype.validate = function (s) {var r = RegExp("^(?:" + this.source + ")$(?!\\s)", getNativeFlags(this)); if (this.global) this.lastIndex = 0; return s.search(r) === 0;}; - */ - -})(); - diff --git a/conlite/external/phpmailer/phpmailer/examples/scripts/shAutoloader.js b/conlite/external/phpmailer/phpmailer/examples/scripts/shAutoloader.js deleted file mode 100644 index 9f5942e..0000000 --- a/conlite/external/phpmailer/phpmailer/examples/scripts/shAutoloader.js +++ /dev/null @@ -1,122 +0,0 @@ -(function() { - -var sh = SyntaxHighlighter; - -/** - * Provides functionality to dynamically load only the brushes that a needed to render the current page. - * - * There are two syntaxes that autoload understands. For example: - * - * SyntaxHighlighter.autoloader( - * [ 'applescript', 'Scripts/shBrushAppleScript.js' ], - * [ 'actionscript3', 'as3', 'Scripts/shBrushAS3.js' ] - * ); - * - * or a more easily comprehendable one: - * - * SyntaxHighlighter.autoloader( - * 'applescript Scripts/shBrushAppleScript.js', - * 'actionscript3 as3 Scripts/shBrushAS3.js' - * ); - */ -sh.autoloader = function() -{ - var list = arguments, - elements = sh.findElements(), - brushes = {}, - scripts = {}, - all = SyntaxHighlighter.all, - allCalled = false, - allParams = null, - i - ; - - SyntaxHighlighter.all = function(params) - { - allParams = params; - allCalled = true; - }; - - function addBrush(aliases, url) - { - for (var i = 0; i < aliases.length; i++) - brushes[aliases[i]] = url; - }; - - function getAliases(item) - { - return item.pop - ? item - : item.split(/\s+/) - ; - } - - // create table of aliases and script urls - for (i = 0; i < list.length; i++) - { - var aliases = getAliases(list[i]), - url = aliases.pop() - ; - - addBrush(aliases, url); - } - - // dynamically add