Merge remote-tracking branch 'origin/dev_php82' into dev_php82

# Conflicts:
#	.gitignore
#	.idea/modules.xml
#	.idea/php.xml
#	.idea/phpunit.xml
#	.idea/vcs.xml
#	composer.json
#	composer.lock
#	conlite/external/autoload.php
#	conlite/external/composer/autoload_classmap.php
#	conlite/external/composer/autoload_psr4.php
#	conlite/external/composer/autoload_static.php
#	conlite/external/composer/installed.json
#	conlite/external/composer/installed.php
#	conlite/external/composer/platform_check.php
#	conlite/external/phpmailer/phpmailer/VERSION
#	conlite/external/phpmailer/phpmailer/composer.json
#	conlite/external/phpmailer/phpmailer/get_oauth_token.php
#	conlite/external/phpmailer/phpmailer/language/phpmailer.lang-ar.php
#	conlite/external/phpmailer/phpmailer/language/phpmailer.lang-az.php
#	conlite/external/phpmailer/phpmailer/language/phpmailer.lang-ba.php
#	conlite/external/phpmailer/phpmailer/language/phpmailer.lang-be.php
#	conlite/external/phpmailer/phpmailer/language/phpmailer.lang-bg.php
#	conlite/external/phpmailer/phpmailer/language/phpmailer.lang-ca.php
#	conlite/external/phpmailer/phpmailer/language/phpmailer.lang-cs.php
#	conlite/external/phpmailer/phpmailer/language/phpmailer.lang-da.php
#	conlite/external/phpmailer/phpmailer/language/phpmailer.lang-de.php
#	conlite/external/phpmailer/phpmailer/language/phpmailer.lang-el.php
#	conlite/external/phpmailer/phpmailer/language/phpmailer.lang-eo.php
#	conlite/external/phpmailer/phpmailer/language/phpmailer.lang-es.php
#	conlite/external/phpmailer/phpmailer/language/phpmailer.lang-et.php
#	conlite/external/phpmailer/phpmailer/language/phpmailer.lang-fa.php
#	conlite/external/phpmailer/phpmailer/language/phpmailer.lang-fi.php
#	conlite/external/phpmailer/phpmailer/language/phpmailer.lang-fo.php
#	conlite/external/phpmailer/phpmailer/language/phpmailer.lang-fr.php
#	conlite/external/phpmailer/phpmailer/language/phpmailer.lang-gl.php
#	conlite/external/phpmailer/phpmailer/language/phpmailer.lang-he.php
#	conlite/external/phpmailer/phpmailer/language/phpmailer.lang-hr.php
#	conlite/external/phpmailer/phpmailer/language/phpmailer.lang-hu.php
#	conlite/external/phpmailer/phpmailer/language/phpmailer.lang-hy.php
#	conlite/external/phpmailer/phpmailer/language/phpmailer.lang-id.php
#	conlite/external/phpmailer/phpmailer/language/phpmailer.lang-it.php
#	conlite/external/phpmailer/phpmailer/language/phpmailer.lang-ja.php
#	conlite/external/phpmailer/phpmailer/language/phpmailer.lang-ka.php
#	conlite/external/phpmailer/phpmailer/language/phpmailer.lang-ko.php
#	conlite/external/phpmailer/phpmailer/language/phpmailer.lang-lt.php
#	conlite/external/phpmailer/phpmailer/language/phpmailer.lang-lv.php
#	conlite/external/phpmailer/phpmailer/language/phpmailer.lang-ms.php
#	conlite/external/phpmailer/phpmailer/language/phpmailer.lang-nb.php
#	conlite/external/phpmailer/phpmailer/language/phpmailer.lang-nl.php
#	conlite/external/phpmailer/phpmailer/language/phpmailer.lang-pl.php
#	conlite/external/phpmailer/phpmailer/language/phpmailer.lang-pt.php
#	conlite/external/phpmailer/phpmailer/language/phpmailer.lang-pt_br.php
#	conlite/external/phpmailer/phpmailer/language/phpmailer.lang-ro.php
#	conlite/external/phpmailer/phpmailer/language/phpmailer.lang-ru.php
#	conlite/external/phpmailer/phpmailer/language/phpmailer.lang-sk.php
#	conlite/external/phpmailer/phpmailer/language/phpmailer.lang-sl.php
#	conlite/external/phpmailer/phpmailer/language/phpmailer.lang-sr.php
#	conlite/external/phpmailer/phpmailer/language/phpmailer.lang-sv.php
#	conlite/external/phpmailer/phpmailer/language/phpmailer.lang-tr.php
#	conlite/external/phpmailer/phpmailer/language/phpmailer.lang-uk.php
#	conlite/external/phpmailer/phpmailer/language/phpmailer.lang-vi.php
#	conlite/external/phpmailer/phpmailer/language/phpmailer.lang-zh.php
#	conlite/external/phpmailer/phpmailer/language/phpmailer.lang-zh_cn.php
#	conlite/external/phpmailer/phpmailer/src/SMTP.php
Dieser Commit ist enthalten in:
o.pinke 2023-04-25 19:12:49 +02:00
Commit 068c042318
65 geänderte Dateien mit 7318 neuen und 2042 gelöschten Zeilen

33
.idea/ConLite.iml Normale Datei
Datei anzeigen

@ -0,0 +1,33 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="WEB_MODULE" version="4">
<component name="NewModuleRootManager">
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/conlite/external" isTestSource="false" packagePrefix="Conlite\External\" />
<sourceFolder url="file://$MODULE_DIR$/conlite/external/endroid/qr-code/src" isTestSource="false" packagePrefix="Endroid\QrCode\" />
<sourceFolder url="file://$MODULE_DIR$/conlite/external/endroid/qr-code/tests" isTestSource="true" packagePrefix="Endroid\QrCode\Tests\" />
<sourceFolder url="file://$MODULE_DIR$/conlite/external/phpmailer/phpmailer/tests" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/spec" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/tests" isTestSource="true" />
<excludeFolder url="file://$MODULE_DIR$/conlite/external/composer" />
<excludeFolder url="file://$MODULE_DIR$/conlite/external/edit_area/images" />
<excludeFolder url="file://$MODULE_DIR$/conlite/external/edit_area/langs" />
<excludeFolder url="file://$MODULE_DIR$/conlite/external/edit_area/plugins" />
<excludeFolder url="file://$MODULE_DIR$/conlite/external/edit_area/reg_syntax" />
<excludeFolder url="file://$MODULE_DIR$/conlite/external/frontend/cache" />
<excludeFolder url="file://$MODULE_DIR$/conlite/external/frontend/css" />
<excludeFolder url="file://$MODULE_DIR$/conlite/external/frontend/data" />
<excludeFolder url="file://$MODULE_DIR$/conlite/external/frontend/images" />
<excludeFolder url="file://$MODULE_DIR$/conlite/external/frontend/includes" />
<excludeFolder url="file://$MODULE_DIR$/conlite/external/frontend/js" />
<excludeFolder url="file://$MODULE_DIR$/conlite/external/frontend/logs" />
<excludeFolder url="file://$MODULE_DIR$/conlite/external/frontend/templates" />
<excludeFolder url="file://$MODULE_DIR$/conlite/external/frontend/upload" />
<excludeFolder url="file://$MODULE_DIR$/conlite/external/phpmailer/phpmailer" />
<excludeFolder url="file://$MODULE_DIR$/conlite/external/phpqrcode/bindings" />
<excludeFolder url="file://$MODULE_DIR$/conlite/external/phpqrcode/tools" />
<excludeFolder url="file://$MODULE_DIR$/conlite/external/wysiwyg/tinymce3" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>

Datei anzeigen

@ -1,4 +1,3 @@
----------------------------------------------------------------------------------------------------
This is the readme file for ConLite 2.2.0 beta
Any help you need you may find by visiting the following links.

Datei anzeigen

@ -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 = ' <td align="{ALIGN}" valign="{VALIGN}" class="{CLASS}" colspan="{COLSPAN}" style="{EXTRA}white-space:nowrap;" nowrap="nowrap">{CONTENT}</td>' . "\n";
$this->_sBorderColor = cRegistry::getConfigValue('color', 'table_border');
$this->_sTplCellCode = '<td align="{ALIGN}" valign="{VALIGN}" class="{CLASS}" colspan="{COLSPAN}" style="{EXTRA}white-space:nowrap;" nowrap="nowrap">' . "\n"
. '{CONTENT}' . "\n"
. '</td>' . "\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,6 +554,57 @@ class UI_Config_Table {
}
}
}
/**
* 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;
}
}

Datei anzeigen

@ -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

Datei anzeigen

@ -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

Datei anzeigen

@ -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;
@ -415,7 +411,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 +419,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 +444,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();

Datei anzeigen

@ -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);

Datei anzeigen

@ -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

Datei anzeigen

@ -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);
@ -594,7 +593,7 @@ class cHTMLSelectElement extends cHTMLFormElement {
* All cHTMLOptionElements
* @var array
*/
var $_options;
var $_options = [];
/**
* Constructor. Creates an HTML select field (aka "DropDown").
@ -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 '<table border="0" cellspacing="0" cellpadding="0"><tr><td nowrap="nowrap">' . parent::toHTML() . '</td><td nowrap="nowrap">' . $renderedLabel . '</td></tr></table>';
$renderedLabel = $label->toHtml();
} else {
return parent::toHTML();
$renderedLabel = $this->_value;
}
}
return $this->fillSkeleton($attributes) . $renderedLabel;
}
}
/**

Datei anzeigen

@ -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

Datei anzeigen

@ -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);
@ -293,6 +293,4 @@ class InUseItem extends Item
$this->loadByPrimaryKey($mId);
}
}
}
?>
}

Datei anzeigen

@ -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 '<pre>';
print_r($new_keys);
print_r($old_keys);
print_r($this->keywords_del);
echo '</pre>';
*
*/
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('<br>', '<br />'), "\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();
}
}

Datei-Diff unterdrückt, da er zu groß ist Diff laden

Datei anzeigen

@ -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);

Datei anzeigen

@ -1,4 +1,5 @@
<?php
/**
* File:
* class.articlelanguage.php
@ -18,14 +19,12 @@
*
* $Id$
*/
if (!defined('CON_FRAMEWORK')) {
die('Illegal call');
}
class cApiArticleLanguageCollection extends ItemCollection {
public function __construct($select = false) {
global $cfg;
parent::__construct($cfg["tab"]["art_lang"], "idartlang");
@ -36,26 +35,26 @@ class cApiArticleLanguageCollection extends ItemCollection {
$this->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'));
}
}
}
?>

Datei anzeigen

@ -52,6 +52,4 @@ class cApiCategory extends Item {
}
}
}
?>
}

Datei anzeigen

@ -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) ? "<!-- Generated by ConLite " . $cfg['version'] . "-->\n" : "") . $content;

Datei anzeigen

@ -320,8 +320,12 @@ class cPage extends cHTML {
}
$meta = '';
if ($this->_encoding != "" && !$this->_isHtml5) {
$meta .= '<meta http-equiv="Content-type" content="text/html;charset=' . $this->_encoding . '">' . "\n";
if(!empty($this->_encoding)) {
if($this->_isHtml5) {
$meta .= '<meta charset="' . $this->_encoding . '">' . "\n";
} else {
$meta .= '<meta http-equiv="Content-type" content="text/html;charset=' . $this->_encoding . '">' . "\n";
}
}
if ($this->_object !== false && method_exists($this->_object, "render")) {

Datei anzeigen

@ -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</head>", $code, 1);
$code = preg_replace("/(<body[^>]*)>/i", "\${1}> \n $sHtmlInUseMessage", $code, 1);
if(!preg_match("/(<body[^>]*)>.*/i", $code)) {
$code = preg_replace("/(<body[^>]*)>/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<?php\n");
} else {
chdir($cfgClient[$client]["path"]["frontend"]);
// write html output into output buffer and assign it to an variable
ob_start();
eval("?>\n" . $code . "\n<?php\n");
$htmlCode = ob_get_contents();
ob_end_clean();
if(!empty($sHtmlInUseMessage) && empty($bInUseSet)) {
$htmlCode = preg_replace("/(<body[^>]*)>/i", "\${1}> \n $sHtmlInUseMessage", $htmlCode, 1);
}
// process CEC to do some preparations before output
$htmlCode = CEC_Hook::executeAndReturn('Contenido.Frontend.HTMLCodeOutput', $htmlCode);

Datei anzeigen

@ -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/).

Datei anzeigen

@ -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
<?php
use PHPMailer\PHPMailer\PHPMailer;
use PHPMailer\PHPMailer\Exception;
require 'path/to/PHPMailer/src/Exception.php';
require 'path/to/PHPMailer/src/PHPMailer.php';
require 'path/to/PHPMailer/src/SMTP.php';
```
If you're not using the `SMTP` class explicitly (you're probably not), you don't need a `use` line for the SMTP class. Even if you're not using exceptions, you do still need to load the `Exception` class as it is used internally.
## Legacy versions
PHPMailer 5.2 (which is compatible with PHP 5.0 — 7.0) is no longer supported, even for security updates. You will find the latest version of 5.2 in the [5.2-stable branch](https://github.com/PHPMailer/PHPMailer/tree/5.2-stable). If you're using PHP 5.5 or later (which you should be), switch to the 6.x releases.
### Upgrading from 5.2
The biggest changes are that source files are now in the `src/` folder, and PHPMailer now declares the namespace `PHPMailer\PHPMailer`. This has several important effects – [read the upgrade guide](https://github.com/PHPMailer/PHPMailer/tree/master/UPGRADING.md) for more details.
### Minimal installation
While installing the entire package manually or with Composer is simple, convenient, and reliable, you may want to include only vital files in your project. At the very least you will need [src/PHPMailer.php](https://github.com/PHPMailer/PHPMailer/tree/master/src/PHPMailer.php). If you're using SMTP, you'll need [src/SMTP.php](https://github.com/PHPMailer/PHPMailer/tree/master/src/SMTP.php), and if you're using POP-before SMTP (*very* unlikely!), you'll need [src/POP3.php](https://github.com/PHPMailer/PHPMailer/tree/master/src/POP3.php). You can skip the [language](https://github.com/PHPMailer/PHPMailer/tree/master/language/) folder if you're not showing errors to users and can make do with English-only errors. If you're using XOAUTH2 you will need [src/OAuth.php](https://github.com/PHPMailer/PHPMailer/tree/master/src/OAuth.php) as well as the Composer dependencies for the services you wish to authenticate with. Really, it's much easier to use Composer!
## A Simple Example
```php
<?php
//Import PHPMailer classes into the global namespace
//These must be at the top of your script, not inside a function
use PHPMailer\PHPMailer\PHPMailer;
use PHPMailer\PHPMailer\SMTP;
use PHPMailer\PHPMailer\Exception;
//Load Composer's autoloader
require 'vendor/autoload.php';
//Create an instance; passing `true` enables exceptions
$mail = new PHPMailer(true);
try {
//Server settings
$mail->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 <b>in bold!</b>';
$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.
<a href="https://info.smartmessages.net/"><img src="https://www.smartmessages.net/img/smartmessages-logo.svg" width="550" alt="Smartmessages.net privacy-first email marketing logo"></a>
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.

Datei anzeigen

@ -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).

Datei anzeigen

@ -0,0 +1,26 @@
<?php
/**
* Afrikaans PHPMailer language file: refer to English translation for definitive list
* @package PHPMailer
*/
$PHPMAILER_LANG['authenticate'] = 'SMTP-fout: kon nie geverifieer word nie.';
$PHPMAILER_LANG['connect_host'] = 'SMTP-fout: kon nie aan SMTP-verbind nie.';
$PHPMAILER_LANG['data_not_accepted'] = 'SMTP-fout: data nie aanvaar nie.';
$PHPMAILER_LANG['empty_message'] = 'Boodskapliggaam leeg.';
$PHPMAILER_LANG['encoding'] = 'Onbekende kodering: ';
$PHPMAILER_LANG['execute'] = 'Kon nie uitvoer nie: ';
$PHPMAILER_LANG['file_access'] = 'Kon nie lêer oopmaak nie: ';
$PHPMAILER_LANG['file_open'] = 'Lêerfout: Kon nie lêer oopmaak nie: ';
$PHPMAILER_LANG['from_failed'] = 'Die volgende Van adres misluk: ';
$PHPMAILER_LANG['instantiate'] = 'Kon nie posfunksie instansieer nie.';
$PHPMAILER_LANG['invalid_address'] = 'Ongeldige adres: ';
$PHPMAILER_LANG['mailer_not_supported'] = ' mailer word nie ondersteun nie.';
$PHPMAILER_LANG['provide_address'] = 'U moet ten minste een ontvanger e-pos adres verskaf.';
$PHPMAILER_LANG['recipients_failed'] = 'SMTP-fout: Die volgende ontvangers het misluk: ';
$PHPMAILER_LANG['signing'] = 'Ondertekening Fout: ';
$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP-verbinding () misluk.';
$PHPMAILER_LANG['smtp_error'] = 'SMTP-bediener fout: ';
$PHPMAILER_LANG['variable_set'] = 'Kan nie veranderlike instel of herstel nie: ';
$PHPMAILER_LANG['extension_missing'] = 'Uitbreiding ontbreek: ';

Datei anzeigen

@ -0,0 +1,35 @@
<?php
/**
* Hindi PHPMailer language file: refer to English translation for definitive list
* @package PHPMailer
* @author Yash Karanke <mr.karanke@gmail.com>
* Rewrite and extension of the work by Jayanti Suthar <suthar.jayanti93@gmail.com>
*/
$PHPMAILER_LANG['authenticate'] = 'SMTP त्रुटि: प्रामाणिकता की जांच नहीं हो सका। ';
$PHPMAILER_LANG['buggy_php'] = 'PHP का आपका संस्करण एक बग से प्रभावित है जिसके परिणामस्वरूप संदेश दूषित हो सकते हैं. इसे ठीक करने हेतु, भेजने के लिए SMTP का उपयोग करे, अपने php.ini में mail.add_x_header विकल्प को अक्षम करें, MacOS या Linux पर जाए, या अपने PHP संस्करण को 7.0.17+ या 7.1.3+ बदले.';
$PHPMAILER_LANG['connect_host'] = 'SMTP त्रुटि: SMTP सर्वर से कनेक्ट नहीं हो सका। ';
$PHPMAILER_LANG['data_not_accepted'] = 'SMTP त्रुटि: डेटा स्वीकार नहीं किया जाता है। ';
$PHPMAILER_LANG['empty_message'] = 'संदेश खाली है। ';
$PHPMAILER_LANG['encoding'] = 'अज्ञात एन्कोडिंग प्रकार। ';
$PHPMAILER_LANG['execute'] = 'आदेश को निष्पादित करने में विफल। ';
$PHPMAILER_LANG['extension_missing'] = 'एक्सटेन्षन गायब है: ';
$PHPMAILER_LANG['file_access'] = 'फ़ाइल उपलब्ध नहीं है। ';
$PHPMAILER_LANG['file_open'] = 'फ़ाइल त्रुटि: फाइल को खोला नहीं जा सका। ';
$PHPMAILER_LANG['from_failed'] = 'प्रेषक का पता गलत है। ';
$PHPMAILER_LANG['instantiate'] = 'मेल फ़ंक्शन कॉल नहीं कर सकता है।';
$PHPMAILER_LANG['invalid_address'] = 'पता गलत है। ';
$PHPMAILER_LANG['invalid_header'] = 'अमान्य हेडर नाम या मान';
$PHPMAILER_LANG['invalid_hostentry'] = 'अमान्य hostentry: ';
$PHPMAILER_LANG['invalid_host'] = 'अमान्य होस्ट: ';
$PHPMAILER_LANG['mailer_not_supported'] = 'मेल सर्वर के साथ काम नहीं करता है। ';
$PHPMAILER_LANG['provide_address'] = 'आपको कम से कम एक प्राप्तकर्ता का ई-मेल पता प्रदान करना होगा।';
$PHPMAILER_LANG['recipients_failed'] = 'SMTP त्रुटि: निम्न प्राप्तकर्ताओं को पते भेजने में विफल। ';
$PHPMAILER_LANG['signing'] = 'साइनअप त्रुटि: ';
$PHPMAILER_LANG['smtp_code'] = 'SMTP कोड: ';
$PHPMAILER_LANG['smtp_code_ex'] = 'अतिरिक्त SMTP जानकारी: ';
$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP का connect () फ़ंक्शन विफल हुआ। ';
$PHPMAILER_LANG['smtp_detail'] = 'विवरण: ';
$PHPMAILER_LANG['smtp_error'] = 'SMTP सर्वर त्रुटि। ';
$PHPMAILER_LANG['variable_set'] = 'चर को बना या संशोधित नहीं किया जा सकता। ';

Datei anzeigen

@ -0,0 +1,27 @@
<?php
/**
* Malagasy PHPMailer language file: refer to English translation for definitive list
* @package PHPMailer
* @author Hackinet <piyushjha8164@gmail.com>
*/
$PHPMAILER_LANG['authenticate'] = 'Hadisoana SMTP: Tsy nahomby ny fanamarinana.';
$PHPMAILER_LANG['connect_host'] = 'SMTP Error: Tsy afaka mampifandray amin\'ny mpampiantrano SMTP.';
$PHPMAILER_LANG['data_not_accepted'] = 'SMTP diso: tsy voarakitra ny angona.';
$PHPMAILER_LANG['empty_message'] = 'Tsy misy ny votoaty mailaka.';
$PHPMAILER_LANG['encoding'] = 'Tsy fantatra encoding: ';
$PHPMAILER_LANG['execute'] = 'Tsy afaka manatanteraka ity baiko manaraka ity: ';
$PHPMAILER_LANG['file_access'] = 'Tsy nahomby ny fidirana amin\'ity rakitra ity: ';
$PHPMAILER_LANG['file_open'] = 'Hadisoana diso: Tsy afaka nanokatra ity file manaraka ity: ';
$PHPMAILER_LANG['from_failed'] = 'Ny adiresy iraka manaraka dia diso: ';
$PHPMAILER_LANG['instantiate'] = 'Tsy afaka nanomboka ny hetsika mail.';
$PHPMAILER_LANG['invalid_address'] = 'Tsy mety ny adiresy: ';
$PHPMAILER_LANG['mailer_not_supported'] = ' mailer tsy manohana.';
$PHPMAILER_LANG['provide_address'] = 'Alefaso azafady iray adiresy iray farafahakeliny.';
$PHPMAILER_LANG['recipients_failed'] = 'SMTP Error: Tsy mety ireo mpanaraka ireto: ';
$PHPMAILER_LANG['signing'] = 'Error nandritra ny sonia:';
$PHPMAILER_LANG['smtp_connect_failed'] = 'Tsy nahomby ny fifandraisana tamin\'ny server SMTP.';
$PHPMAILER_LANG['smtp_error'] = 'Fahadisoana tamin\'ny server SMTP: ';
$PHPMAILER_LANG['variable_set'] = 'Tsy azo atao ny mametraka na mamerina ny variable: ';
$PHPMAILER_LANG['extension_missing'] = 'Tsy hita ny ampahany: ';

Datei anzeigen

@ -0,0 +1,27 @@
<?php
/**
* Mongolian PHPMailer language file: refer to English translation for definitive list
* @package PHPMailer
* @author @wispas
*/
$PHPMAILER_LANG['authenticate'] = 'Алдаа SMTP: Холбогдож чадсангүй.';
$PHPMAILER_LANG['connect_host'] = 'Алдаа SMTP: SMTP- сервертэй холбогдож болохгүй байна.';
$PHPMAILER_LANG['data_not_accepted'] = 'Алдаа SMTP: зөвшөөрөгдсөнгүй.';
$PHPMAILER_LANG['encoding'] = 'Тодорхойгүй кодчилол: ';
$PHPMAILER_LANG['execute'] = 'Коммандыг гүйцэтгэх боломжгүй байна: ';
$PHPMAILER_LANG['file_access'] = 'Файлд хандах боломжгүй байна: ';
$PHPMAILER_LANG['file_open'] = 'Файлын алдаа: файлыг нээх боломжгүй байна: ';
$PHPMAILER_LANG['from_failed'] = 'Илгээгчийн хаяг буруу байна: ';
$PHPMAILER_LANG['instantiate'] = 'Mail () функцийг ажиллуулах боломжгүй байна.';
$PHPMAILER_LANG['provide_address'] = 'Хүлээн авагчийн имэйл хаягийг оруулна уу.';
$PHPMAILER_LANG['mailer_not_supported'] = ' — мэйл серверийг дэмжсэнгүй.';
$PHPMAILER_LANG['recipients_failed'] = 'Алдаа SMTP: ийм хаягийг илгээж чадсангүй: ';
$PHPMAILER_LANG['empty_message'] = 'Хоосон мессэж';
$PHPMAILER_LANG['invalid_address'] = 'И-Мэйл буруу форматтай тул илгээх боломжгүй: ';
$PHPMAILER_LANG['signing'] = 'Гарын үсгийн алдаа: ';
$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP сервертэй холбогдоход алдаа гарлаа';
$PHPMAILER_LANG['smtp_error'] = 'SMTP серверийн алдаа: ';
$PHPMAILER_LANG['variable_set'] = 'Хувьсагчийг тохируулах эсвэл дахин тохируулах боломжгүй байна: ';
$PHPMAILER_LANG['extension_missing'] = 'Өргөтгөл байхгүй: ';

Datei anzeigen

@ -0,0 +1,28 @@
<?php
/**
* Serbian PHPMailer language file: refer to English translation for definitive list
* @package PHPMailer
* @author Александар Јевремовић <ajevremovic@gmail.com>
* @author Miloš Milanović <mmilanovic016@gmail.com>
*/
$PHPMAILER_LANG['authenticate'] = 'SMTP greška: autentifikacija nije uspela.';
$PHPMAILER_LANG['connect_host'] = 'SMTP greška: povezivanje sa SMTP serverom nije uspelo.';
$PHPMAILER_LANG['data_not_accepted'] = 'SMTP greška: podaci nisu prihvaćeni.';
$PHPMAILER_LANG['empty_message'] = 'Sadržaj poruke je prazan.';
$PHPMAILER_LANG['encoding'] = 'Nepoznato kodiranje: ';
$PHPMAILER_LANG['execute'] = 'Nije moguće izvršiti naredbu: ';
$PHPMAILER_LANG['file_access'] = 'Nije moguće pristupiti datoteci: ';
$PHPMAILER_LANG['file_open'] = 'Nije moguće otvoriti datoteku: ';
$PHPMAILER_LANG['from_failed'] = 'SMTP greška: slanje sa sledećih adresa nije uspelo: ';
$PHPMAILER_LANG['recipients_failed'] = 'SMTP greška: slanje na sledeće adrese nije uspelo: ';
$PHPMAILER_LANG['instantiate'] = 'Nije moguće pokrenuti mail funkciju.';
$PHPMAILER_LANG['invalid_address'] = 'Poruka nije poslata. Neispravna adresa: ';
$PHPMAILER_LANG['mailer_not_supported'] = ' majler nije podržan.';
$PHPMAILER_LANG['provide_address'] = 'Definišite bar jednu adresu primaoca.';
$PHPMAILER_LANG['signing'] = 'Greška prilikom prijave: ';
$PHPMAILER_LANG['smtp_connect_failed'] = 'Povezivanje sa SMTP serverom nije uspelo.';
$PHPMAILER_LANG['smtp_error'] = 'Greška SMTP servera: ';
$PHPMAILER_LANG['variable_set'] = 'Nije moguće zadati niti resetovati promenljivu: ';
$PHPMAILER_LANG['extension_missing'] = 'Nedostaje proširenje: ';

Datei anzeigen

@ -0,0 +1,28 @@
<?php
/**
* Tagalog PHPMailer language file: refer to English translation for definitive list
*
* @package PHPMailer
* @author Adriane Justine Tan <eidoriantan@gmail.com>
*/
$PHPMAILER_LANG['authenticate'] = 'SMTP Error: Hindi mapatotohanan.';
$PHPMAILER_LANG['connect_host'] = 'SMTP Error: Hindi makakonekta sa SMTP host.';
$PHPMAILER_LANG['data_not_accepted'] = 'SMTP Error: Ang datos ay hindi naitanggap.';
$PHPMAILER_LANG['empty_message'] = 'Walang laman ang mensahe';
$PHPMAILER_LANG['encoding'] = 'Hindi alam ang encoding: ';
$PHPMAILER_LANG['execute'] = 'Hindi maisasagawa: ';
$PHPMAILER_LANG['file_access'] = 'Hindi ma-access ang file: ';
$PHPMAILER_LANG['file_open'] = 'File Error: Hindi mabuksan ang file: ';
$PHPMAILER_LANG['from_failed'] = 'Ang sumusunod na address ay nabigo: ';
$PHPMAILER_LANG['instantiate'] = 'Hindi maisimulan ang instance ng mail function.';
$PHPMAILER_LANG['invalid_address'] = 'Hindi wasto ang address na naibigay: ';
$PHPMAILER_LANG['mailer_not_supported'] = 'Ang mailer ay hindi suportado.';
$PHPMAILER_LANG['provide_address'] = 'Kailangan mong magbigay ng kahit isang email address na tatanggap.';
$PHPMAILER_LANG['recipients_failed'] = 'SMTP Error: Ang mga sumusunod na tatanggap ay nabigo: ';
$PHPMAILER_LANG['signing'] = 'Hindi ma-sign: ';
$PHPMAILER_LANG['smtp_connect_failed'] = 'Ang SMTP connect() ay nabigo.';
$PHPMAILER_LANG['smtp_error'] = 'Ang server ng SMTP ay nabigo: ';
$PHPMAILER_LANG['variable_set'] = 'Hindi matatakda o ma-reset ang mga variables: ';
$PHPMAILER_LANG['extension_missing'] = 'Nawawala ang extension: ';

Datei anzeigen

@ -0,0 +1,247 @@
<?php
/**
* PHPMailer - PHP email creation and transport class.
* PHP Version 5.5.
*
* @see https://github.com/PHPMailer/PHPMailer/ The PHPMailer GitHub project
*
* @author Marcus Bointon (Synchro/coolbru) <phpmailer@synchromedia.co.uk>
* @author Jim Jagielski (jimjag) <jimjag@gmail.com>
* @author Andy Prevost (codeworxtech) <codeworxtech@users.sourceforge.net>
* @author Brent R. Matzelle (original founder)
* @copyright 2012 - 2023 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.
*/
namespace PHPMailer\PHPMailer;
/**
* Configure PHPMailer with DSN string.
*
* @see https://en.wikipedia.org/wiki/Data_source_name
*
* @author Oleg Voronkovich <oleg-voronkovich@yandex.ru>
*/
class DSNConfigurator
{
/**
* Create new PHPMailer instance configured by DSN.
*
* @param string $dsn DSN
* @param bool $exceptions Should we throw external exceptions?
*
* @return PHPMailer
*/
public static function mailer($dsn, $exceptions = null)
{
static $configurator = null;
if (null === $configurator) {
$configurator = new DSNConfigurator();
}
return $configurator->configure(new PHPMailer($exceptions), $dsn);
}
/**
* Configure PHPMailer instance with DSN string.
*
* @param PHPMailer $mailer PHPMailer instance
* @param string $dsn DSN
*
* @return PHPMailer
*/
public function configure(PHPMailer $mailer, $dsn)
{
$config = $this->parseDSN($dsn);
$this->applyConfig($mailer, $config);
return $mailer;
}
/**
* Parse DSN string.
*
* @param string $dsn DSN
*
* @throws Exception If DSN is malformed
*
* @return array Configuration
*/
private function parseDSN($dsn)
{
$config = $this->parseUrl($dsn);
if (false === $config || !isset($config['scheme']) || !isset($config['host'])) {
throw new Exception(
sprintf('Malformed DSN: "%s".', $dsn)
);
}
if (isset($config['query'])) {
parse_str($config['query'], $config['query']);
}
return $config;
}
/**
* Apply configuration to mailer.
*
* @param PHPMailer $mailer PHPMailer instance
* @param array $config Configuration
*
* @throws Exception If scheme is invalid
*/
private function applyConfig(PHPMailer $mailer, $config)
{
switch ($config['scheme']) {
case 'mail':
$mailer->isMail();
break;
case 'sendmail':
$mailer->isSendmail();
break;
case 'qmail':
$mailer->isQmail();
break;
case 'smtp':
case 'smtps':
$mailer->isSMTP();
$this->configureSMTP($mailer, $config);
break;
default:
throw new Exception(
sprintf(
'Invalid scheme: "%s". Allowed values: "mail", "sendmail", "qmail", "smtp", "smtps".',
$config['scheme']
)
);
}
if (isset($config['query'])) {
$this->configureOptions($mailer, $config['query']);
}
}
/**
* Configure SMTP.
*
* @param PHPMailer $mailer PHPMailer instance
* @param array $config Configuration
*/
private function configureSMTP($mailer, $config)
{
$isSMTPS = 'smtps' === $config['scheme'];
if ($isSMTPS) {
$mailer->SMTPSecure = PHPMailer::ENCRYPTION_STARTTLS;
}
$mailer->Host = $config['host'];
if (isset($config['port'])) {
$mailer->Port = $config['port'];
} elseif ($isSMTPS) {
$mailer->Port = SMTP::DEFAULT_SECURE_PORT;
}
$mailer->SMTPAuth = isset($config['user']) || isset($config['pass']);
if (isset($config['user'])) {
$mailer->Username = $config['user'];
}
if (isset($config['pass'])) {
$mailer->Password = $config['pass'];
}
}
/**
* Configure options.
*
* @param PHPMailer $mailer PHPMailer instance
* @param array $options Options
*
* @throws Exception If option is unknown
*/
private function configureOptions(PHPMailer $mailer, $options)
{
$allowedOptions = get_object_vars($mailer);
unset($allowedOptions['Mailer']);
unset($allowedOptions['SMTPAuth']);
unset($allowedOptions['Username']);
unset($allowedOptions['Password']);
unset($allowedOptions['Hostname']);
unset($allowedOptions['Port']);
unset($allowedOptions['ErrorInfo']);
$allowedOptions = \array_keys($allowedOptions);
foreach ($options as $key => $value) {
if (!in_array($key, $allowedOptions)) {
throw new Exception(
sprintf(
'Unknown option: "%s". Allowed values: "%s"',
$key,
implode('", "', $allowedOptions)
)
);
}
switch ($key) {
case 'AllowEmpty':
case 'SMTPAutoTLS':
case 'SMTPKeepAlive':
case 'SingleTo':
case 'UseSendmailOptions':
case 'do_verp':
case 'DKIM_copyHeaderFields':
$mailer->$key = (bool) $value;
break;
case 'Priority':
case 'SMTPDebug':
case 'WordWrap':
$mailer->$key = (int) $value;
break;
default:
$mailer->$key = $value;
break;
}
}
}
/**
* Parse a URL.
* Wrapper for the built-in parse_url function to work around a bug in PHP 5.5.
*
* @param string $url URL
*
* @return array|false
*/
protected function parseUrl($url)
{
if (\PHP_VERSION_ID >= 50600 || false === strpos($url, '?')) {
return parse_url($url);
}
$chunks = explode('?', $url);
if (is_array($chunks)) {
$result = parse_url($chunks[0]);
if (is_array($result)) {
$result['query'] = $chunks[1];
}
return $result;
}
return false;
}
}

Datei anzeigen

@ -0,0 +1,40 @@
<?php
/**
* PHPMailer Exception class.
* PHP Version 5.5.
*
* @see https://github.com/PHPMailer/PHPMailer/ The PHPMailer GitHub project
*
* @author Marcus Bointon (Synchro/coolbru) <phpmailer@synchromedia.co.uk>
* @author Jim Jagielski (jimjag) <jimjag@gmail.com>
* @author Andy Prevost (codeworxtech) <codeworxtech@users.sourceforge.net>
* @author Brent R. Matzelle (original founder)
* @copyright 2012 - 2020 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.
*/
namespace PHPMailer\PHPMailer;
/**
* PHPMailer exception handler.
*
* @author Marcus Bointon <phpmailer@synchromedia.co.uk>
*/
class Exception extends \Exception
{
/**
* Prettify error message output.
*
* @return string
*/
public function errorMessage()
{
return '<strong>' . htmlspecialchars($this->getMessage(), ENT_COMPAT | ENT_HTML401) . "</strong><br />\n";
}
}

Datei anzeigen

@ -0,0 +1,139 @@
<?php
/**
* PHPMailer - PHP email creation and transport class.
* PHP Version 5.5.
*
* @see https://github.com/PHPMailer/PHPMailer/ The PHPMailer GitHub project
*
* @author Marcus Bointon (Synchro/coolbru) <phpmailer@synchromedia.co.uk>
* @author Jim Jagielski (jimjag) <jimjag@gmail.com>
* @author Andy Prevost (codeworxtech) <codeworxtech@users.sourceforge.net>
* @author Brent R. Matzelle (original founder)
* @copyright 2012 - 2020 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.
*/
namespace PHPMailer\PHPMailer;
use League\OAuth2\Client\Grant\RefreshToken;
use League\OAuth2\Client\Provider\AbstractProvider;
use League\OAuth2\Client\Token\AccessToken;
/**
* OAuth - OAuth2 authentication wrapper class.
* Uses the oauth2-client package from the League of Extraordinary Packages.
*
* @see http://oauth2-client.thephpleague.com
*
* @author Marcus Bointon (Synchro/coolbru) <phpmailer@synchromedia.co.uk>
*/
class OAuth implements OAuthTokenProvider
{
/**
* An instance of the League OAuth Client Provider.
*
* @var AbstractProvider
*/
protected $provider;
/**
* The current OAuth access token.
*
* @var AccessToken
*/
protected $oauthToken;
/**
* The user's email address, usually used as the login ID
* and also the from address when sending email.
*
* @var string
*/
protected $oauthUserEmail = '';
/**
* The client secret, generated in the app definition of the service you're connecting to.
*
* @var string
*/
protected $oauthClientSecret = '';
/**
* The client ID, generated in the app definition of the service you're connecting to.
*
* @var string
*/
protected $oauthClientId = '';
/**
* The refresh token, used to obtain new AccessTokens.
*
* @var string
*/
protected $oauthRefreshToken = '';
/**
* OAuth constructor.
*
* @param array $options Associative array containing
* `provider`, `userName`, `clientSecret`, `clientId` and `refreshToken` elements
*/
public function __construct($options)
{
$this->provider = $options['provider'];
$this->oauthUserEmail = $options['userName'];
$this->oauthClientSecret = $options['clientSecret'];
$this->oauthClientId = $options['clientId'];
$this->oauthRefreshToken = $options['refreshToken'];
}
/**
* Get a new RefreshToken.
*
* @return RefreshToken
*/
protected function getGrant()
{
return new RefreshToken();
}
/**
* Get a new AccessToken.
*
* @return AccessToken
*/
protected function getToken()
{
return $this->provider->getAccessToken(
$this->getGrant(),
['refresh_token' => $this->oauthRefreshToken]
);
}
/**
* Generate a base64-encoded OAuth token.
*
* @return string
*/
public function getOauth64()
{
//Get a new token if it's not available or has expired
if (null === $this->oauthToken || $this->oauthToken->hasExpired()) {
$this->oauthToken = $this->getToken();
}
return base64_encode(
'user=' .
$this->oauthUserEmail .
"\001auth=Bearer " .
$this->oauthToken .
"\001\001"
);
}
}

Datei anzeigen

@ -0,0 +1,44 @@
<?php
/**
* PHPMailer - PHP email creation and transport class.
* PHP Version 5.5.
*
* @see https://github.com/PHPMailer/PHPMailer/ The PHPMailer GitHub project
*
* @author Marcus Bointon (Synchro/coolbru) <phpmailer@synchromedia.co.uk>
* @author Jim Jagielski (jimjag) <jimjag@gmail.com>
* @author Andy Prevost (codeworxtech) <codeworxtech@users.sourceforge.net>
* @author Brent R. Matzelle (original founder)
* @copyright 2012 - 2020 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.
*/
namespace PHPMailer\PHPMailer;
/**
* OAuthTokenProvider - OAuth2 token provider interface.
* Provides base64 encoded OAuth2 auth strings for SMTP authentication.
*
* @see OAuth
* @see SMTP::authenticate()
*
* @author Peter Scopes (pdscopes)
* @author Marcus Bointon (Synchro/coolbru) <phpmailer@synchromedia.co.uk>
*/
interface OAuthTokenProvider
{
/**
* Generate a base64-encoded OAuth token ensuring that the access token has not expired.
* The string to be base 64 encoded should be in the form:
* "user=<user_email_address>\001auth=Bearer <access_token>\001\001"
*
* @return string
*/
public function getOauth64();
}

Datei-Diff unterdrückt, da er zu groß ist Diff laden

Datei anzeigen

@ -0,0 +1,467 @@
<?php
/**
* PHPMailer POP-Before-SMTP Authentication Class.
* PHP Version 5.5.
*
* @see https://github.com/PHPMailer/PHPMailer/ The PHPMailer GitHub project
*
* @author Marcus Bointon (Synchro/coolbru) <phpmailer@synchromedia.co.uk>
* @author Jim Jagielski (jimjag) <jimjag@gmail.com>
* @author Andy Prevost (codeworxtech) <codeworxtech@users.sourceforge.net>
* @author Brent R. Matzelle (original founder)
* @copyright 2012 - 2020 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.
*/
namespace PHPMailer\PHPMailer;
/**
* PHPMailer POP-Before-SMTP Authentication Class.
* Specifically for PHPMailer to use for RFC1939 POP-before-SMTP authentication.
* 1) This class does not support APOP authentication.
* 2) Opening and closing lots of POP3 connections can be quite slow. If you need
* to send a batch of emails then just perform the authentication once at the start,
* and then loop through your mail sending script. Providing this process doesn't
* take longer than the verification period lasts on your POP3 server, you should be fine.
* 3) This is really ancient technology; you should only need to use it to talk to very old systems.
* 4) This POP3 class is deliberately lightweight and incomplete, implementing just
* enough to do authentication.
* If you want a more complete class there are other POP3 classes for PHP available.
*
* @author Richard Davey (original author) <rich@corephp.co.uk>
* @author Marcus Bointon (Synchro/coolbru) <phpmailer@synchromedia.co.uk>
* @author Jim Jagielski (jimjag) <jimjag@gmail.com>
* @author Andy Prevost (codeworxtech) <codeworxtech@users.sourceforge.net>
*/
class POP3
{
/**
* The POP3 PHPMailer Version number.
*
* @var string
*/
const VERSION = '6.8.0';
/**
* Default POP3 port number.
*
* @var int
*/
const DEFAULT_PORT = 110;
/**
* Default timeout in seconds.
*
* @var int
*/
const DEFAULT_TIMEOUT = 30;
/**
* POP3 class debug output mode.
* Debug output level.
* Options:
* @see POP3::DEBUG_OFF: No output
* @see POP3::DEBUG_SERVER: Server messages, connection/server errors
* @see POP3::DEBUG_CLIENT: Client and Server messages, connection/server errors
*
* @var int
*/
public $do_debug = self::DEBUG_OFF;
/**
* POP3 mail server hostname.
*
* @var string
*/
public $host;
/**
* POP3 port number.
*
* @var int
*/
public $port;
/**
* POP3 Timeout Value in seconds.
*
* @var int
*/
public $tval;
/**
* POP3 username.
*
* @var string
*/
public $username;
/**
* POP3 password.
*
* @var string
*/
public $password;
/**
* Resource handle for the POP3 connection socket.
*
* @var resource
*/
protected $pop_conn;
/**
* Are we connected?
*
* @var bool
*/
protected $connected = false;
/**
* Error container.
*
* @var array
*/
protected $errors = [];
/**
* Line break constant.
*/
const LE = "\r\n";
/**
* Debug level for no output.
*
* @var int
*/
const DEBUG_OFF = 0;
/**
* Debug level to show server -> client messages
* also shows clients connection errors or errors from server
*
* @var int
*/
const DEBUG_SERVER = 1;
/**
* Debug level to show client -> server and server -> client messages.
*
* @var int
*/
const DEBUG_CLIENT = 2;
/**
* Simple static wrapper for all-in-one POP before SMTP.
*
* @param string $host The hostname to connect to
* @param int|bool $port The port number to connect to
* @param int|bool $timeout The timeout value
* @param string $username
* @param string $password
* @param int $debug_level
*
* @return bool
*/
public static function popBeforeSmtp(
$host,
$port = false,
$timeout = false,
$username = '',
$password = '',
$debug_level = 0
) {
$pop = new self();
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.
*
* @param string $host The hostname to connect to
* @param int|bool $port The port number to connect to
* @param int|bool $timeout The timeout value
* @param string $username
* @param string $password
* @param int $debug_level
*
* @return bool
*/
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 = static::DEFAULT_PORT;
} else {
$this->port = (int) $port;
}
//If no timeout value provided, use default
if (false === $timeout) {
$this->tval = static::DEFAULT_TIMEOUT;
} else {
$this->tval = (int) $timeout;
}
$this->do_debug = $debug_level;
$this->username = $username;
$this->password = $password;
//Reset the error log
$this->errors = [];
//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.
*
* @param string $host
* @param int|bool $port
* @param int $tval
*
* @return bool
*/
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([$this, 'catchWarning']);
if (false === $port) {
$port = static::DEFAULT_PORT;
}
//Connect to the POP3 server
$errno = 0;
$errstr = '';
$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(
"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).
*
* @param string $username
* @param string $password
*
* @return bool
*/
public function login($username = '', $password = '')
{
if (!$this->connected) {
$this->setError('Not connected to POP3 server');
return false;
}
if (empty($username)) {
$username = $this->username;
}
if (empty($password)) {
$password = $this->password;
}
//Send the Username
$this->sendString("USER $username" . static::LE);
$pop3_response = $this->getResponse();
if ($this->checkResponse($pop3_response)) {
//Send the Password
$this->sendString("PASS $password" . static::LE);
$pop3_response = $this->getResponse();
if ($this->checkResponse($pop3_response)) {
return true;
}
}
return false;
}
/**
* Disconnect from the POP3 server.
*/
public function disconnect()
{
// If could not connect at all, no need to disconnect
if ($this->pop_conn === false) {
return;
}
$this->sendString('QUIT' . static::LE);
// RFC 1939 shows POP3 server sending a +OK response to the QUIT command.
// Try to get it. Ignore any failures here.
try {
$this->getResponse();
} catch (Exception $e) {
//Do nothing
}
//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
}
// Clean up attributes.
$this->connected = false;
$this->pop_conn = false;
}
/**
* Get a response from the POP3 server.
*
* @param int $size The maximum number of bytes to retrieve
*
* @return string
*/
protected function getResponse($size = 128)
{
$response = fgets($this->pop_conn, $size);
if ($this->do_debug >= self::DEBUG_SERVER) {
echo 'Server -> Client: ', $response;
}
return $response;
}
/**
* Send raw data to the POP3 server.
*
* @param string $string
*
* @return int
*/
protected function sendString($string)
{
if ($this->pop_conn) {
if ($this->do_debug >= self::DEBUG_CLIENT) { //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 bool
*/
protected function checkResponse($string)
{
if (strpos($string, '+OK') !== 0) {
$this->setError("Server reported an error: $string");
return false;
}
return true;
}
/**
* Add an error to the internal error store.
* Also display debug output if it's enabled.
*
* @param string $error
*/
protected function setError($error)
{
$this->errors[] = $error;
if ($this->do_debug >= self::DEBUG_SERVER) {
echo '<pre>';
foreach ($this->errors as $e) {
print_r($e);
}
echo '</pre>';
}
}
/**
* Get an array of error messages, if any.
*
* @return array
*/
public function getErrors()
{
return $this->errors;
}
/**
* POP3 connection error handler.
*
* @param int $errno
* @param string $errstr
* @param string $errfile
* @param int $errline
*/
protected function catchWarning($errno, $errstr, $errfile, $errline)
{
$this->setError(
'Connecting to the POP3 server raised a PHP warning:' .
"errno: $errno errstr: $errstr; errfile: $errfile; errline: $errline"
);
}
}

Datei anzeigen

@ -1,4 +1,5 @@
<?php
/**
* Project:
* Contenido Content Management System
@ -31,84 +32,79 @@
* }}
*
*/
if(!defined('CON_FRAMEWORK')) {
die('Illegal call');
if (!defined('CON_FRAMEWORK')) {
die('Illegal call');
}
// include editor config/combat file
include (dirname(__FILE__).DIRECTORY_SEPARATOR."config.php"); // CONTENIDO
include (dirname(__FILE__) . DIRECTORY_SEPARATOR . "config.php"); // CONTENIDO
cInclude("external", "wysiwyg/tinymce3/editorclass.php");
// name of textarea element
if (isset($type)) {
$editor_name = "CMS_HTML"; // this should be $type (might be a contenido bug)
$editor_name = "CMS_HTML"; // this should be $type (might be a contenido bug)
} else {
$editor_name = "content";
$editor_name = "content";
}
// if editor is called from any include.CMS_*.html file use available content from $a_content
if ($a_content[$type][$typenr]) {
$editor_content = $a_content[$type][$typenr];
// if not set it is possible to use available content from var $editor_content
$editor_content = $a_content[$type][$typenr];
// if not set it is possible to use available content from var $editor_content
}
$editor_content = clHtmlSpecialChars($editor_content);
$editor_content = is_null($editor_content) ? '' : clHtmlSpecialChars($editor_content);
$cTinyMCEEditor = new cTinyMCEEditor($editor_name, $editor_content);
switch ($type)
{
case "CMS_HTML":
$editor_height = getEffectiveSetting("wysiwyg", "tinymce-height-html", false);
if ($editor_height == false)
{
$editor_height = getEffectiveSetting("tinymce", "contenido_height_html", false);
}
break;
case "CMS_HTMLHEAD":
$editor_height = getEffectiveSetting("wysiwyg", "tinymce-height-head", false);
if ($editor_height == false)
{
$editor_height = getEffectiveSetting("tinymce", "contenido_height_head", false);
}
break;
default:
$editor_height = false;
switch ($type) {
case "CMS_HTML":
$editor_height = getEffectiveSetting("wysiwyg", "tinymce-height-html", false);
if ($editor_height == false) {
$editor_height = getEffectiveSetting("tinymce", "contenido_height_html", false);
}
break;
case "CMS_HTMLHEAD":
$editor_height = getEffectiveSetting("wysiwyg", "tinymce-height-head", false);
if ($editor_height == false) {
$editor_height = getEffectiveSetting("tinymce", "contenido_height_head", false);
}
break;
default:
$editor_height = false;
}
if ($editor_height !== false)
{
$cTinyMCEEditor->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();
}
?>

Datei anzeigen

@ -1,4 +1,5 @@
<?php
/**
* Project:
* Contenido Content Management System
@ -30,7 +31,6 @@
* }}
*
*/
if (!defined('CON_FRAMEWORK')) {
die('Illegal call');
}
@ -73,18 +73,17 @@ if (!defined('CON_FRAMEWORK')) {
* @param string $bReturnPath Flag to return the path instead of including the file
* @return void
*/
function contenido_include($sWhere, $sWhat, $bForce = false, $bReturnPath = false)
{
function contenido_include($sWhere, $sWhat, $bForce = false, $bReturnPath = false) {
global $client, $cfg, $cfgClient;
// Sanity check for $sWhat
$sWhat = trim($sWhat);
$sWhat = trim($sWhat);
$sWhere = strtolower($sWhere);
$bError = false;
switch ($sWhere) {
case 'config':
$sInclude = $cfg['path']['config']. $sWhat;
$sInclude = $cfg['path']['config'] . $sWhat;
break;
case 'frontend':
$sInclude = $cfgClient[$client]['path']['frontend'] . $sWhat;
@ -113,7 +112,7 @@ function contenido_include($sWhere, $sWhat, $bForce = false, $bReturnPath = fals
unset($sWhere);
} else {
$aPaths = explode(PATH_SEPARATOR, ini_get('include_path'));
$iLast = count($aPaths) - 1;
$iLast = count($aPaths) - 1;
if ($iLast >= 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 <b>".$aBackTrace[1]['file']
."</b> on line <b>".$aBackTrace[1]['line']
."</b> <i>function</i>: ".$aBackTrace[1]['function']." ";
if (is_array($aBackTrace[1])) {
$sError = " in <b>" . $aBackTrace[1]['file']
. "</b> on line <b>" . $aBackTrace[1]['line']
. "</b> <i>function</i>: " . $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);
}
}
?>

Datei anzeigen

@ -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 = '<?php $cCurrentModule = ' . ((int) $a_d[$value]) . '; ?>';
$thisContainer = '<?php $cCurrentContainer = ' . ((int) $value) . '; ?>';
@ -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;
}
@ -622,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"));
}
}
}

Datei anzeigen

@ -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
*
@ -2221,4 +2170,66 @@ function IP_match($network, $mask, $ip) {
}
}
?>
/**
* Wrapper for php-function htmlspecialchars
*
* @author Ortwin Pinke <ortwinpinke@conlite.org>
* @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_QUOTES | ENT_SUBSTITUTE | ENT_HTML401, string $encoding = 'UTF-8') {
return htmlspecialchars($value, $flags, $encoding);
}
/**
* Wrapper for php-function html_entity_decode
*
* @author Ortwin Pinke <ortwinpinke@conlite.org>
* @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_QUOTES | ENT_SUBSTITUTE | ENT_HTML401, string $encoding = 'UTF-8') {
return html_entity_decode($value, $flags, $encoding);
}
/**
* Wrapper for php-function htmlentities
*
* @author Ortwin Pinke <ortwinpinke@conlite.org>
* @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_QUOTES | ENT_SUBSTITUTE | ENT_HTML401, string $encoding = 'UTF-8') {
return htmlentities($value, $flags, $encoding);
}
/**
* Wrapper for php-function get_html_translation_table
*
* @author Ortwin Pinke <ortwinpinke@conlite.org>
* @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_QUOTES | ENT_SUBSTITUTE | ENT_HTML401, string $encoding = "UTF-8") {
return get_html_translation_table($table, $flags, $encoding);
}

Datei anzeigen

@ -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);
}
}
*
*/

Datei anzeigen

@ -1,4 +1,5 @@
<?php
/**
* Project:
* Contenido Content Management System
@ -29,31 +30,28 @@
* }}
*
*/
if (!defined('CON_FRAMEWORK')) {
die('Illegal call');
die('Illegal call');
}
//notice $oTpl is filled and generated in file rights.inc.php this file renders $oTpl to browser
include_once($cfg['path']['contenido'].'includes/grouprights.inc.php');
include_once($cfg['path']['contenido'] . 'includes/grouprights.inc.php');
//set the areas which are in use fore selecting these
$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";
$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, "<input type=\"checkbox\" name=\"checkall_".$value2["perm"]."_$value3\" value=\"\" onClick=\"setRightsFor('".$value2["perm"]."','$value3','')\">");
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, "<input type=\"checkbox\" name=\"checkall_" . $value2["perm"] . "_$value3\" value=\"\" onClick=\"setRightsFor('" . $value2["perm"] . "','$value3','')\">");
}
}
//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, "<input type=\"checkbox\" name=\"checkall\" value=\"\" onClick=\"setRightsForAll()\">");
$sTable .= $oTable->end_row();
@ -121,71 +114,59 @@ $sTable .= $oTable->header_cell('&nbsp', 'center', '', '', 0);
$sTable .= $oTable->header_cell('&nbsp', '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<69>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
//"<input type=\"checkbox\" name=\"rights_list[".$value2["perm"]."|$value3|".$db->f("idlay")."]\" value=\"x\" $checked>
$sTable .= $oTable->cell("<input type=\"checkbox\" name=\"rights_list[".$value2["perm"]."|$value3|".$db->f("idlay")."]\" value=\"x\" $checked>", "", "", " class=\"td_rights3\"", false );
}
}
//set the checkbox the name consits of areait+actionid+itemid
//"<input type=\"checkbox\" name=\"rights_list[".$value2["perm"]."|$value3|".$db->f("idlay")."]\" value=\"x\" $checked>
$sTable .= $oTable->cell("<input type=\"checkbox\" name=\"rights_list[" . $value2["perm"] . "|$value3|" . $db->f("idlay") . "]\" value=\"x\" $checked>", "", "", " class=\"td_rights3\"", false);
}
}
//checkbox for checking all actions fore this itemid
$sTable .= $oTable->cell("<input type=\"checkbox\" name=\"checkall_".$value2["perm"]."_".$value3."_".$db->f("idlay")."\" value=\"\" onClick=\"setRightsFor('".$value2["perm"]."','$value3','".$db->f("idlay")."')\">","", "", " class=\"td_rights3\"", false);
$sTable .= $oTable->end_row();
$sTable .= $oTable->cell("<input type=\"checkbox\" name=\"checkall_" . $value2["perm"] . "_" . $value3 . "_" . $db->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("<a href=javascript:submitrightsform('','area')><img src=\"".$cfg['path']['images']."but_cancel.gif\" border=0></a><img src=\"images/spacer.gif\" width=\"20\"> <a href=javascript:submitrightsform('group_edit','')><img src=\"".$cfg['path']['images']."but_ok.gif\" border=0></a>","right");
$sTable .= $oTable->sumcell("<a href=javascript:submitrightsform('','area')><img src=\"" . $cfg['path']['images'] . "but_cancel.gif\" border=0></a><img src=\"images/spacer.gif\" width=\"20\"> <a href=javascript:submitrightsform('group_edit','')><img src=\"" . $cfg['path']['images'] . "but_ok.gif\" border=0></a>", "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']);

Datei anzeigen

@ -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);

Datei anzeigen

@ -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);

Datei anzeigen

@ -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" . '&#58; ' . $idart . ' ' . "idcatart" . '&#58; ' . $idcatart . ' ' . "idartlang" . '&#58; ' . $idartlang;

Datei anzeigen

@ -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"));
}
}
?>
}

Datei anzeigen

@ -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 */
@ -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%;");

Datei anzeigen

@ -134,13 +134,18 @@ 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'];
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");
@ -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%;");

Datei anzeigen

@ -1,4 +1,5 @@
<?php
/**
* Project:
* Contenido Content Management System
@ -28,111 +29,96 @@
* }}
*
*/
if (!defined('CON_FRAMEWORK')) {
die('Illegal call');
die('Illegal call');
}
$langobj = new cApiLanguage($lang);
$langstring = $langobj->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 frameborder="0" style="border: 1px;border-color: black; border-style: solid;" width="620" src="'.$ilink->getHREF().'"></iframe>';
$iframe = '<iframe frameborder="0" style="border: 1px;border-color: black; border-style: solid;" width="620" src="' . $ilink->getHREF() . '"></iframe>';
$table = '<table border="0" width="600" border="0"><tr><td width="50%">'.i18n("Original module string").'</td><td width="50%">'.sprintf(i18n("Translation for %s"), $langstring).'</td><td width="20">&nbsp;</td></tr><tr><td colspan="3">'.$iframe.'</td></tr>';
$table = '<table border="0" width="600" border="0"><tr><td width="50%">' . i18n("Original module string") . '</td><td width="50%">' . sprintf(i18n("Translation for %s"), $langstring) . '</td><td width="20">&nbsp;</td></tr><tr><td colspan="3">' . $iframe . '</td></tr>';
$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 .= '<tr><td>'.$original->render().'</td><td>'.$translated->render().'</td><td width="20">&nbsp;</td></tr></table>';
$table .= '<tr><td>' . $original->render() . '</td><td>' . $translated->render() . '</td><td width="20">&nbsp;</td></tr></table>';
$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 = '<script language="JavaScript">document.translation.t_trans.focus();</script>';
$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 ."<br>". $form2->render());
$page->setContent($form->render() . $mark . "<br>" . $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();
}
?>

Datei anzeigen

@ -1,4 +1,5 @@
<?php
/**
* Project:
* Contenido Content Management System
@ -27,9 +28,8 @@
* }}
*
*/
if(!defined('CON_FRAMEWORK')) {
die('Illegal call');
if (!defined('CON_FRAMEWORK')) {
die('Illegal call');
}
@ -37,6 +37,8 @@ $translations = new cApiModuleTranslationCollection;
$translations->select("idmod = '$idmod' AND idlang='$lang'");
$page = new cPage;
$page->setHtml5();
$page->setEncoding('UTF-8');
$page->setMargin(0);
$v = '<table cellspacing="0" cellpadding="0" width="600">';
@ -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 .= '<tr bgcolor="'.$bgcol.'"><td style="padding-left: 2px; padding-top:2px; padding-bottom: 2px;" width="50%"><a name="'.$translation->get("idmodtranslation").'"></a>'.$mylink->render().'</td><td style="padding-left: 2px;">'.$tstring.'</td></tr>';
if ($idmodtranslation == $translation->get("idmodtranslation")) {
$bgcol = $cfg["color"]["table_active"];
}
$v .= '<tr bgcolor="' . $bgcol . '">'."\n"
. '<td style="padding-left: 2px; padding-top:2px; padding-bottom: 2px;" width="50%">'."\n"
. '<a name="' . $translation->get("idmodtranslation") . '"></a>'."\n"
. $mylink->render() . '</td>'."\n"
. '<td style="padding-left: 2px;">' . $tstring . '</td>'."\n"
. '</tr>'."\n";
}
$v .= '</table>';
@ -82,5 +87,4 @@ $clang = new cApiLanguage($lang);
$page->setEncoding($clang->get("encoding"));
$page->render();
?>

Datei anzeigen

@ -50,8 +50,8 @@ $formaction = $sess->url("main.php");
#<input type="hidden" name="action" value="tplcfg_edit">
$hidden = '<input type="hidden" name="area" value="tpl_cfg">
<input type="hidden" name="frame" value="'.$frame.'">
<input type="hidden" name="idcat" value="'.$idcat.'">
<input type="hidden" name="idart" value="'.$idart.'">
<input type="hidden" name="idcat" value="'.cRegistry::getCategoryId().'">
<input type="hidden" name="idart" value="'.cRegistry::getArticleId().'">
<input type="hidden" name="idtpl" value="'.$idtpl.'">
<input type="hidden" name="lang" value="'.$lang.'">
<input type="hidden" name="idtplcfg" value="'.$idtplcfg.'">
@ -154,7 +154,5 @@ $buttons = '<a href="javascript:history.back()"><img src="images/but_cancel.gif"
<input type="image" src="images/but_ok.gif">';
$tpl->set('s', 'BUTTONS', $buttons);
# Generate template
$tpl->generate($cfg['path']['templates'] . $cfg['templates']['tplcfg_edit_form']);
?>
$tpl->generate($cfg['path']['templates'] . $cfg['templates']['tplcfg_edit_form']);

Datei anzeigen

@ -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;

Datei anzeigen

@ -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 = empty($_REQUEST['code'])?'':$_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();
}
}
?>
}

Datei anzeigen

@ -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);

Datei anzeigen

@ -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);

Datei anzeigen

@ -112,14 +112,14 @@ foreach ($aSecondHeaderRow as $value) {
$sTable .= $table->end_row();
//Select the itemid<EFBFBD>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);

Datei anzeigen

@ -71,7 +71,7 @@ if (!defined('CL_ENVIRONMENT')) {
*/
if (!defined('CL_VERSION')) {
define('CL_VERSION', '2.2.0 beta');
define('CL_VERSION', '3.0.0 RC');
}

Datei anzeigen

@ -1,4 +1,5 @@
<?php
/**
* Project:
* ConLite CMS
@ -19,37 +20,32 @@
* @link http://www.contenido.org
*
*/
/**
* No direct call
*/
if(!defined('CON_FRAMEWORK')) {
if (!defined('CON_FRAMEWORK')) {
die('Illegal call');
}
// Compatibility for php < 5.3 using closures or not, @todo remove if we only support PHP >= 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);
}
?>

Datei anzeigen

@ -1,221 +0,0 @@
<?php
// security check
defined('CON_FRAMEWORK') or die('Illegal call');
/**
* Compare int values
*
* @param int $a
* @param int $b
* @return int 0 for equal, 1 for higher and -1 for lower
*/
function __cmp($a, $b) {
if ($a == $b) return 0;
return ($a > $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 <o.pinke@conlite.org>
*
* @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 <o.pinke@conlite.org>
* @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;
}
?>

@ -1 +0,0 @@
Subproject commit 9fab0549299f5a17d8b242f3aaa13cdfe83c90d5

@ -1 +0,0 @@
Subproject commit 91b0fd8c15cdf1b5e9704c8720a40f959e7eb4fe

@ -1 +0,0 @@
Subproject commit c0e41ea0fa3e8c738893dfe8faacbbb71797be57

Datei anzeigen

@ -1,7 +1,6 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8" />
<title></title>
{META}
<link rel="stylesheet" type="text/css" href="styles/contenido.css">

Datei anzeigen

@ -1,3 +1,4 @@
<!DOCTYPE html>
<html>
<head>
<title></title>
@ -220,9 +221,7 @@
parent.parent.frames["right"].frames["right_top"].sub.clicked(menuItem.firstChild);
}
{
DATAPUSH
}
{DATAPUSH}
</script>
</body>

Datei anzeigen

@ -1,7 +1,7 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8" />
<meta charset="utf-8">
<title>template.tplcfg_edit_form.html</title>
<link rel="stylesheet" type="text/css" href="styles/jquery-ui.css">
<link rel="stylesheet" type="text/css" href="styles/contenido.css">
@ -56,7 +56,7 @@
</form>
<script type="text/javascript">
{
SCRIPT
{SCRIPT}
}
</script>
{MARKSUBMENU}

Datei anzeigen

@ -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', '3.0.0');
$sDefLocalPath = dirname(__FILE__).DIRECTORY_SEPARATOR.'defines.local.php';
if(file_exists($sDefLocalPath)) {
include_once $sDefLocalPath;
}

Datei anzeigen

@ -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);