|
From: <be...@us...> - 2013-09-14 04:59:00
|
Revision: 12036
http://sourceforge.net/p/xoops/svn/12036
Author: beckmi
Date: 2013-09-14 04:58:55 +0000 (Sat, 14 Sep 2013)
Log Message:
-----------
standardizing braces
Modified Paths:
--------------
XoopsCore/branches/2.5.x/2.5.7/htdocs/Frameworks/moduleclasses/moduleadmin/moduleadmin.php
XoopsCore/branches/2.5.x/2.5.7/htdocs/class/captcha/recaptcha/recaptchalib.php
XoopsCore/branches/2.5.x/2.5.7/htdocs/class/database/sqlutility.php
XoopsCore/branches/2.5.x/2.5.7/htdocs/class/logger/render.php
XoopsCore/branches/2.5.x/2.5.7/htdocs/class/mail/phpmailer/class.phpmailer.php
XoopsCore/branches/2.5.x/2.5.7/htdocs/class/mail/phpmailer/class.pop3.php
XoopsCore/branches/2.5.x/2.5.7/htdocs/class/mail/phpmailer/class.smtp.php
XoopsCore/branches/2.5.x/2.5.7/htdocs/class/module.textsanitizer.php
XoopsCore/branches/2.5.x/2.5.7/htdocs/class/smarty/Config_File.class.php
XoopsCore/branches/2.5.x/2.5.7/htdocs/class/smarty/Smarty.class.php
XoopsCore/branches/2.5.x/2.5.7/htdocs/class/smarty/Smarty_Compiler.class.php
XoopsCore/branches/2.5.x/2.5.7/htdocs/class/smarty/internals/core.display_debug_console.php
XoopsCore/branches/2.5.x/2.5.7/htdocs/class/smarty/internals/core.rmdir.php
XoopsCore/branches/2.5.x/2.5.7/htdocs/class/smarty/plugins/function.html_checkboxes.php
XoopsCore/branches/2.5.x/2.5.7/htdocs/class/smarty/plugins/function.html_options.php
XoopsCore/branches/2.5.x/2.5.7/htdocs/class/smarty/plugins/function.html_radios.php
XoopsCore/branches/2.5.x/2.5.7/htdocs/class/smarty/plugins/function.html_table.php
XoopsCore/branches/2.5.x/2.5.7/htdocs/class/smarty/plugins/modifier.escape.php
XoopsCore/branches/2.5.x/2.5.7/htdocs/class/smarty/plugins/outputfilter.trimwhitespace.php
XoopsCore/branches/2.5.x/2.5.7/htdocs/class/smarty/xoops_plugins/compiler.foreachq.php
XoopsCore/branches/2.5.x/2.5.7/htdocs/class/smarty/xoops_plugins/function.xoMemberInfo.php
XoopsCore/branches/2.5.x/2.5.7/htdocs/class/snoopy.php
XoopsCore/branches/2.5.x/2.5.7/htdocs/class/textsanitizer/flash/flash.php
XoopsCore/branches/2.5.x/2.5.7/htdocs/class/textsanitizer/image/image.php
XoopsCore/branches/2.5.x/2.5.7/htdocs/class/textsanitizer/mp3/mp3.php
XoopsCore/branches/2.5.x/2.5.7/htdocs/class/textsanitizer/rtsp/rtsp.php
XoopsCore/branches/2.5.x/2.5.7/htdocs/class/textsanitizer/wiki/wiki.php
XoopsCore/branches/2.5.x/2.5.7/htdocs/class/textsanitizer/wmp/wmp.php
XoopsCore/branches/2.5.x/2.5.7/htdocs/class/textsanitizer/youtube/youtube.php
XoopsCore/branches/2.5.x/2.5.7/htdocs/class/tree.php
XoopsCore/branches/2.5.x/2.5.7/htdocs/class/xml/rpc/xmlrpctag.php
XoopsCore/branches/2.5.x/2.5.7/htdocs/class/xml/saxparser.php
XoopsCore/branches/2.5.x/2.5.7/htdocs/class/xoopseditor/dhtmltextarea/dhtmltextarea.php
XoopsCore/branches/2.5.x/2.5.7/htdocs/class/xoopsform/form.php
XoopsCore/branches/2.5.x/2.5.7/htdocs/class/xoopsform/formbuttontray.php
XoopsCore/branches/2.5.x/2.5.7/htdocs/class/xoopsform/formelementtray.php
XoopsCore/branches/2.5.x/2.5.7/htdocs/class/xoopsform/formselectuser.php
XoopsCore/branches/2.5.x/2.5.7/htdocs/class/xoopsform/formtextdateselect.php
XoopsCore/branches/2.5.x/2.5.7/htdocs/class/xoopstopic.php
XoopsCore/branches/2.5.x/2.5.7/htdocs/image.php
XoopsCore/branches/2.5.x/2.5.7/htdocs/imagemanager.php
XoopsCore/branches/2.5.x/2.5.7/htdocs/include/functions.encoding.php
XoopsCore/branches/2.5.x/2.5.7/htdocs/include/functions.legacy.php
XoopsCore/branches/2.5.x/2.5.7/htdocs/install/include/install_tpl.php
XoopsCore/branches/2.5.x/2.5.7/htdocs/install/include/makedata.php
XoopsCore/branches/2.5.x/2.5.7/htdocs/install/page_pathsettings.php
XoopsCore/branches/2.5.x/2.5.7/htdocs/kernel/block.php
XoopsCore/branches/2.5.x/2.5.7/htdocs/kernel/comment.php
XoopsCore/branches/2.5.x/2.5.7/htdocs/kernel/configitem.php
XoopsCore/branches/2.5.x/2.5.7/htdocs/kernel/user.php
XoopsCore/branches/2.5.x/2.5.7/htdocs/misc.php
XoopsCore/branches/2.5.x/2.5.7/htdocs/modules/system/admin/banners/main.php
XoopsCore/branches/2.5.x/2.5.7/htdocs/modules/system/admin/comments/main.php
XoopsCore/branches/2.5.x/2.5.7/htdocs/modules/system/admin/groups/main.php
XoopsCore/branches/2.5.x/2.5.7/htdocs/modules/system/admin/modulesadmin/modulesadmin.php
XoopsCore/branches/2.5.x/2.5.7/htdocs/modules/system/admin/tplsets/jquery.php
XoopsCore/branches/2.5.x/2.5.7/htdocs/modules/system/admin/tplsets/main.php
XoopsCore/branches/2.5.x/2.5.7/htdocs/modules/system/admin/users/jquery.php
XoopsCore/branches/2.5.x/2.5.7/htdocs/modules/system/admin/users/main.php
XoopsCore/branches/2.5.x/2.5.7/htdocs/modules/system/admin/users/users.php
XoopsCore/branches/2.5.x/2.5.7/htdocs/modules/system/class/cookie.php
XoopsCore/branches/2.5.x/2.5.7/htdocs/modules/system/class/group.php
XoopsCore/branches/2.5.x/2.5.7/htdocs/modules/system/class/maintenance.php
XoopsCore/branches/2.5.x/2.5.7/htdocs/modules/system/class/thumbs/phpThumb.config.php
XoopsCore/branches/2.5.x/2.5.7/htdocs/modules/system/class/thumbs/phpThumb.php
XoopsCore/branches/2.5.x/2.5.7/htdocs/modules/system/class/thumbs/phpthumb.bmp.php
XoopsCore/branches/2.5.x/2.5.7/htdocs/modules/system/class/thumbs/phpthumb.class.php
XoopsCore/branches/2.5.x/2.5.7/htdocs/modules/system/class/thumbs/phpthumb.filters.php
XoopsCore/branches/2.5.x/2.5.7/htdocs/modules/system/class/thumbs/phpthumb.functions.php
XoopsCore/branches/2.5.x/2.5.7/htdocs/modules/system/class/thumbs/phpthumb.gif.php
XoopsCore/branches/2.5.x/2.5.7/htdocs/modules/system/class/thumbs/phpthumb.ico.php
XoopsCore/branches/2.5.x/2.5.7/htdocs/modules/system/class/thumbs/phpthumb.unsharp.php
XoopsCore/branches/2.5.x/2.5.7/htdocs/modules/system/include/update.php
XoopsCore/branches/2.5.x/2.5.7/htdocs/modules/system/menu.php
XoopsCore/branches/2.5.x/2.5.7/htdocs/modules/system/themes/zetadigme/zetadigme.php
XoopsCore/branches/2.5.x/2.5.7/htdocs/readpmsg.php
XoopsCore/branches/2.5.x/2.5.7/htdocs/themes/suico/extras/function.xoMemberInfo.php
XoopsCore/branches/2.5.x/2.5.7/htdocs/viewpmsg.php
XoopsCore/branches/2.5.x/2.5.7/htdocs/xoops_lib/modules/protector/class/ProtectorFilter.php
XoopsCore/branches/2.5.x/2.5.7/htdocs/xoops_lib/modules/protector/class/gtickets.php
XoopsCore/branches/2.5.x/2.5.7/htdocs/xoops_lib/modules/protector/class/protector.php
XoopsCore/branches/2.5.x/2.5.7/htdocs/xoops_lib/modules/protector/filters_disabled/bruteforce_overrun_message.php
XoopsCore/branches/2.5.x/2.5.7/htdocs/xoops_lib/modules/protector/filters_disabled/crawler_overrun_message.php
XoopsCore/branches/2.5.x/2.5.7/htdocs/xoops_lib/modules/protector/filters_disabled/f5attack_overrun_message.php
XoopsCore/branches/2.5.x/2.5.7/htdocs/xoops_lib/modules/protector/filters_disabled/postcommon_post_deny_by_httpbl.php
XoopsCore/branches/2.5.x/2.5.7/htdocs/xoops_lib/modules/protector/filters_disabled/postcommon_post_deny_by_rbl.php
XoopsCore/branches/2.5.x/2.5.7/htdocs/xoops_lib/modules/protector/filters_disabled/postcommon_post_htmlpurify4everyone.php
XoopsCore/branches/2.5.x/2.5.7/htdocs/xoops_lib/modules/protector/filters_disabled/postcommon_post_htmlpurify4guest.php
XoopsCore/branches/2.5.x/2.5.7/htdocs/xoops_lib/modules/protector/filters_disabled/postcommon_post_need_multibyte.php
XoopsCore/branches/2.5.x/2.5.7/htdocs/xoops_lib/modules/protector/filters_disabled/postcommon_post_register_moratorium.php
XoopsCore/branches/2.5.x/2.5.7/htdocs/xoops_lib/modules/protector/filters_disabled/postcommon_register_insert_js_check.php
XoopsCore/branches/2.5.x/2.5.7/htdocs/xoops_lib/modules/protector/filters_disabled/precommon_badip_errorlog.php
XoopsCore/branches/2.5.x/2.5.7/htdocs/xoops_lib/modules/protector/filters_disabled/precommon_badip_message.php
XoopsCore/branches/2.5.x/2.5.7/htdocs/xoops_lib/modules/protector/filters_disabled/precommon_badip_redirection.php
XoopsCore/branches/2.5.x/2.5.7/htdocs/xoops_lib/modules/protector/filters_disabled/precommon_bwlimit_errorlog.php
XoopsCore/branches/2.5.x/2.5.7/htdocs/xoops_lib/modules/protector/filters_disabled/precommon_bwlimit_message.php
XoopsCore/branches/2.5.x/2.5.7/htdocs/xoops_lib/modules/protector/filters_disabled/prepurge_exit_message.php
XoopsCore/branches/2.5.x/2.5.7/htdocs/xoops_lib/modules/protector/filters_disabled/spamcheck_overrun_message.php
XoopsCore/branches/2.5.x/2.5.7/htdocs/xoops_lib/modules/protector/filters_enabled/precommon_badip_message.php
XoopsCore/branches/2.5.x/2.5.7/htdocs/xoops_lib/modules/protector/include/install_extramodcheck.inc.php
Modified: XoopsCore/branches/2.5.x/2.5.7/htdocs/Frameworks/moduleclasses/moduleadmin/moduleadmin.php
===================================================================
--- XoopsCore/branches/2.5.x/2.5.7/htdocs/Frameworks/moduleclasses/moduleadmin/moduleadmin.php 2013-09-14 04:49:34 UTC (rev 12035)
+++ XoopsCore/branches/2.5.x/2.5.7/htdocs/Frameworks/moduleclasses/moduleadmin/moduleadmin.php 2013-09-14 04:58:55 UTC (rev 12036)
@@ -45,6 +45,7 @@
$infoArray['releasedate'] = $this->getReleaseDate();
$infoArray['methods'] = $this->getClassMethods();
}
+
return $infoArray;
}
@@ -59,6 +60,7 @@
*/
Include_once 'xoops_version.php';
$version = XOOPS_FRAMEWORKS_MODULEADMIN_VERSION;
+
return $version;
}
@@ -73,6 +75,7 @@
*/
Include_once 'xoops_version.php';
$releasedate = XOOPS_FRAMEWORKS_MODULEADMIN_RELEASEDATE;
+
return $releasedate;
}
@@ -84,6 +87,7 @@
function getClassMethods()
{
$myMethods = get_class_methods(__CLASS__);
+
return $myMethods;
}
@@ -92,14 +96,16 @@
//******************************************************************************************************************
// Loaf the language file.
//******************************************************************************************************************
- function loadLanguage() {
+ function loadLanguage()
+ {
$language = $GLOBALS['xoopsConfig']['language'];
- if ( !file_exists($fileinc = XOOPS_ROOT_PATH . "/Frameworks/moduleclasses/moduleadmin/language/{$language}/main.php" )){
- if ( !file_exists($fileinc = XOOPS_ROOT_PATH . "/Frameworks/moduleclasses/moduleadmin/language/english/main.php" )){
+ if ( !file_exists($fileinc = XOOPS_ROOT_PATH . "/Frameworks/moduleclasses/moduleadmin/language/{$language}/main.php" )) {
+ if ( !file_exists($fileinc = XOOPS_ROOT_PATH . "/Frameworks/moduleclasses/moduleadmin/language/english/main.php" )) {
return false;
}
}
$ret = include_once $fileinc;
+
return $ret;
}
//******************************************************************************************************************
@@ -114,7 +120,7 @@
$this->_obj->loadAdminMenu();
$ret = "<div class=\"rmmenuicon\">\n";
foreach (array_keys( $this->_obj->adminmenu) as $i) {
- if ($this->_obj->adminmenu[$i]['link'] != 'admin/index.php'){
+ if ($this->_obj->adminmenu[$i]['link'] != 'admin/index.php') {
$ret .= "<a href=\"../" . $this->_obj->adminmenu[$i]['link'] . "\" title=\"" . (isset($this->_obj->adminmenu[$i]['desc']) ? $this->_obj->adminmenu[$i]['desc'] : '') . "\">";
$ret .= "<img src=\"" . $path . $this->_obj->adminmenu[$i]['icon']. "\" alt=\"" . $this->_obj->adminmenu[$i]['title'] . "\" />";
$ret .= "<span>" . $this->_obj->adminmenu[$i]['title'] . "</span>";
@@ -122,7 +128,7 @@
}
}
if ($this->_obj->getInfo('help')) {
- if (substr(XOOPS_VERSION, 0, 9) >= 'XOOPS 2.5'){
+ if (substr(XOOPS_VERSION, 0, 9) >= 'XOOPS 2.5') {
$ret .= "<a href=\"" . $pathsystem . "help.php?mid=" . $this->_obj->getVar('mid', 's') . "&" . $this->_obj->getInfo('help') . "\" title=\"" . _AM_SYSTEM_HELP . "\">";
$ret .= "<img width=\"32px\" src=\"" . XOOPS_URL . "/Frameworks/moduleclasses/icons/32/help.png\" alt=\"" . _AM_SYSTEM_HELP . "\" /> ";
$ret .= "<span>" . _AM_SYSTEM_HELP . "</span>";
@@ -130,6 +136,7 @@
}
}
$ret .= "</div>\n<div style=\"clear: both;\"></div>\n";
+
return $ret;
}
//******************************************************************************************************************
@@ -140,8 +147,7 @@
function renderButton($position = "right", $delimeter = " ")
{
$path = XOOPS_URL . "/Frameworks/moduleclasses/icons/32/";
- switch ($position)
- {
+ switch ($position) {
default:
case "right":
$ret = "<div class=\"floatright\">\n";
@@ -163,6 +169,7 @@
}
$ret .= "</div>\n</div>\n";
$ret .= "<br /> <br /><br />";
+
return $ret;
}
@@ -173,6 +180,7 @@
$ret['icon'] = $icon . '.png';
$ret['extra'] = $extra;
$this -> _itemButton[] = $ret;
+
return true;
}
@@ -189,20 +197,19 @@
{
$line = "";
$path = XOOPS_URL . "/Frameworks/moduleclasses/icons/16/";
- switch ($type)
- {
+ switch ($type) {
default:
case "default":
$line .= "<span>" . $value . "</span>";
break;
case "folder":
- if (!is_dir($value)){
+ if (!is_dir($value)) {
$line .= "<span style='color : red; font-weight : bold;'>";
$line .= "<img src='" . $path . "off.png' >";
$line .= sprintf(_AM_MODULEADMIN_CONFIG_FOLDERKO, $value);
$line .= "</span>\n";
- }else{
+ } else {
$line .= "<span style='color : green;'>";
$line .= "<img src='" . $path . "on.png' >";
$line .= sprintf(_AM_MODULEADMIN_CONFIG_FOLDEROK, $value);
@@ -211,13 +218,13 @@
break;
case "chmod":
- if (is_dir($value[0])){
+ if (is_dir($value[0])) {
if (substr(decoct(fileperms($value[0])),2) != $value[1]) {
$line .= "<span style='color : red; font-weight : bold;'>";
$line .= "<img src='" . $path . "off.png' >";
$line .= sprintf(_AM_MODULEADMIN_CONFIG_CHMOD, $value[0], $value[1], substr(decoct(fileperms($value[0])),2));
$line .= "</span>\n";
- }else{
+ } else {
$line .= "<span style='color : green;'>";
$line .= "<img src='" . $path . "on.png' >";
$line .= sprintf(_AM_MODULEADMIN_CONFIG_CHMOD, $value[0], $value[1], substr(decoct(fileperms($value[0])),2));
@@ -227,6 +234,7 @@
break;
}
$this -> _itemConfigBoxLine[] = $line;
+
return true;
}
//******************************************************************************************************************
@@ -245,7 +253,7 @@
$ret .= "</td>\n";
$ret .= "</tr>\n";
// If you use a config label
- if ($this->_obj->getInfo('min_php') || $this->_obj->getInfo('min_xoops') || !empty($this -> _itemConfigBoxLine)){
+ if ($this->_obj->getInfo('min_php') || $this->_obj->getInfo('min_xoops') || !empty($this -> _itemConfigBoxLine)) {
$ret .= "<tr>\n";
$ret .= "<td colspan=\"2\">\n";
$ret .= "<fieldset><legend class=\"label\">";
@@ -254,10 +262,10 @@
// php version
$path = XOOPS_URL . "/Frameworks/moduleclasses/icons/16/";
- if ($this->_obj->getInfo('min_php')){
- if (phpversion() < $this->_obj->getInfo('min_php')){
+ if ($this->_obj->getInfo('min_php')) {
+ if (phpversion() < $this->_obj->getInfo('min_php')) {
$ret .= "<span style='color : red; font-weight : bold;'><img src='" . $path . "off.png' >" . sprintf(_AM_MODULEADMIN_CONFIG_PHP, $this->_obj->getInfo('min_php'), phpversion()) . "</span>\n";
- }else{
+ } else {
$ret .= "<span style='color : green;'><img src='" . $path . "on.png' >" . sprintf(_AM_MODULEADMIN_CONFIG_PHP, $this->_obj->getInfo('min_php'), phpversion()) . "</span>\n";
}
$ret .= "<br />";
@@ -282,10 +290,10 @@
$dbCurrentVersion = '0';
break;
}
- $currentVerParts = explode('.', (string)$dbCurrentVersion);
+ $currentVerParts = explode('.', (string) $dbCurrentVersion);
$iCurrentVerParts = array_map('intval', $currentVerParts);
$dbRequiredVersion = $dbarray[XOOPS_DB_TYPE];
- $reqVerParts = explode('.', (string)$dbRequiredVersion);
+ $reqVerParts = explode('.', (string) $dbRequiredVersion);
$iReqVerParts = array_map('intval', $reqVerParts);
$icount = $j = count($iReqVerParts);
$reqVer = $curVer = 0;
@@ -306,25 +314,25 @@
}
// xoops version
- if ($this->_obj->getInfo('min_xoops')){
- if (substr(XOOPS_VERSION, 6, strlen(XOOPS_VERSION)-6) < $this->_obj->getInfo('min_xoops')){
+ if ($this->_obj->getInfo('min_xoops')) {
+ if (substr(XOOPS_VERSION, 6, strlen(XOOPS_VERSION)-6) < $this->_obj->getInfo('min_xoops')) {
$ret .= "<span style='color : red; font-weight : bold;'><img src='" . $path . "off.png' >" . sprintf(_AM_MODULEADMIN_CONFIG_XOOPS, $this->_obj->getInfo('min_xoops'), substr(XOOPS_VERSION, 6, strlen(XOOPS_VERSION)-6)) . "</span>\n";
- }else{
+ } else {
$ret .= "<span style='color : green;'><img src='" . $path . "on.png' >" . sprintf(_AM_MODULEADMIN_CONFIG_XOOPS, $this->_obj->getInfo('min_xoops'), substr(XOOPS_VERSION, 6, strlen(XOOPS_VERSION)-6)) . "</span>\n";
}
$ret .= "<br />";
}
// ModuleAdmin version
- if ($this->_obj->getInfo('min_admin')){
- if ($this->getVersion() < $this->_obj->getInfo('min_admin')){
+ if ($this->_obj->getInfo('min_admin')) {
+ if ($this->getVersion() < $this->_obj->getInfo('min_admin')) {
$ret .= "<span style='color : red; font-weight : bold;'><img src='" . $path . "off.png' >" . sprintf(_AM_MODULEADMIN_CONFIG_ADMIN, $this->_obj->getInfo('min_admin'), $this->getVersion()) . "</span>\n";
- }else{
+ } else {
$ret .= "<span style='color : green;'><img src='" . $path . "on.png' >" . sprintf(_AM_MODULEADMIN_CONFIG_ADMIN, $this->_obj->getInfo('min_admin'), $this->getVersion()) . "</span>\n";
}
$ret .= "<br />";
}
- if (!empty($this -> _itemConfigBoxLine)){
+ if (!empty($this -> _itemConfigBoxLine)) {
foreach (array_keys( $this -> _itemConfigBoxLine) as $i) {
$ret .= $this -> _itemConfigBoxLine[$i];
$ret .= "<br />";
@@ -335,6 +343,7 @@
$ret .= "</tr>\n";
}
$ret .= "</table>\n";
+
return $ret;
}
//******************************************************************************************************************
@@ -346,6 +355,7 @@
{
$ret['title'] = $title;
$this -> _itemInfoBox[] = $ret;
+
return true;
}
//******************************************************************************************************************
@@ -362,8 +372,7 @@
{
$ret['label'] = $label;
$line = "";
- switch ($type)
- {
+ switch ($type) {
default:
case "default":
$line .= sprintf($text, "<span style='color : " . $color . "; font-weight : bold;'>" . $value . "</span>");
@@ -375,6 +384,7 @@
}
$ret['line'] = $line;
$this -> _itemInfoBoxLine[] = $ret;
+
return true;
}
function renderInfoBox()
@@ -385,7 +395,7 @@
$ret .= $this -> _itemInfoBox[$i]['title'];
$ret .= "</legend>\n";
foreach (array_keys( $this -> _itemInfoBoxLine) as $k) {
- if ($this -> _itemInfoBoxLine[$k]['label'] == $this -> _itemInfoBox[$i]['title']){
+ if ($this -> _itemInfoBoxLine[$k]['label'] == $this -> _itemInfoBox[$i]['title']) {
$ret .= $this -> _itemInfoBoxLine[$k]['line'];
$ret .= "<br />";
}
@@ -393,10 +403,10 @@
$ret .= "</fieldset>\n";
$ret .= "<br/>\n";
}
+
return $ret;
}
-
function renderAbout($paypal = '', $logo_xoops = true)
{
$path = XOOPS_URL . "/Frameworks/moduleclasses/icons/32/";
@@ -425,7 +435,7 @@
$ret .= $author[$i];
if (isset($nickname[$i]) && $nickname[$i] !='') {
$ret .= " (" . $nickname[$i] . "), ";
- }else{
+ } else {
$ret .= ", ";
}
}
@@ -437,7 +447,7 @@
$ret .= "<a href=\"http://" . $this->_obj->getInfo('website') . "\" target=\"_blank\" >" . $this->_obj->getInfo('website') . "</a>\n";
$ret .= "<br />\n";
$ret .= "<br />\n";
- if ($paypal != ''){
+ if ($paypal != '') {
$ret .= '<form action="https://www.paypal.com/cgi-bin/webscr" method="post">
<input type="hidden" name="cmd" value="_s-xclick">
<input type="hidden" name="hosted_button_id" value="' . $paypal . '">
@@ -457,16 +467,16 @@
$ret .= "</legend><br/>\n";
$ret .= "<div class=\"txtchangelog\">\n";
$language = $GLOBALS['xoopsConfig']['language'];
- if ( !is_file( XOOPS_ROOT_PATH . "/modules/" . $this->_obj->getVar("dirname") . "/language/" . $language . "/changelog.txt" ) ){
+ if ( !is_file( XOOPS_ROOT_PATH . "/modules/" . $this->_obj->getVar("dirname") . "/language/" . $language . "/changelog.txt" ) ) {
$language = 'english';
}
$language = empty($language) ? $GLOBALS['xoopsConfig']['language'] : $language;
$file = XOOPS_ROOT_PATH. "/modules/" . $this->_obj->getVar("dirname") . "/language/" . $language . "/changelog.txt";
- if ( is_readable( $file ) ){
+ if ( is_readable( $file ) ) {
$ret .= utf8_encode(implode("<br />", file( $file ))) . "\n";
- }else{
+ } else {
$file = XOOPS_ROOT_PATH. "/modules/" . $this->_obj->getVar("dirname") . "/docs/changelog.txt";
- if ( is_readable( $file ) ){
+ if ( is_readable( $file ) ) {
$ret .= utf8_encode(implode("<br />", file( $file ))) . "\n";
}
}
@@ -475,11 +485,12 @@
$ret .= "</td>\n";
$ret .= "</tr>\n";
$ret .= "</table>\n";
- if ($logo_xoops == true){
+ if ($logo_xoops == true) {
$ret .= "<div align=\"center\">";
$ret .= "<a href=\"http://www.xoops.org\" target=\"_blank\"><img src=\"" . $path . "xoopsmicrobutton.gif\" alt=\"XOOPS\" title=\"XOOPS\"></a>";
$ret .= "</div>";
}
+
return $ret;
}
@@ -490,18 +501,19 @@
$path = XOOPS_URL . "/modules/" . $this->_obj->getVar('dirname') . "/";
$this->_obj->loadAdminMenu();
foreach (array_keys( $this->_obj->adminmenu) as $i) {
- if ($this->_obj->adminmenu[$i]['link'] == "admin/" . $menu){
+ if ($this->_obj->adminmenu[$i]['link'] == "admin/" . $menu) {
$navigation .= $this->_obj->adminmenu[$i]['title'] . " | ";
$ret = "<div class=\"CPbigTitle\" style=\"background-image: url(" . $path . $this->_obj->adminmenu[$i]['icon'] . "); background-repeat: no-repeat; background-position: left; padding-left: 50px;\">
<strong>" . $this->_obj->adminmenu[$i]['title'] . "</strong></div><br />";
- }else{
+ } else {
$navigation .= "<a href = '../" . $this->_obj->adminmenu[$i]['link'] . "'>" . $this->_obj->adminmenu[$i]['title'] . "</a> | ";
}
}
- if (substr(XOOPS_VERSION, 0, 9) < 'XOOPS 2.5'){
+ if (substr(XOOPS_VERSION, 0, 9) < 'XOOPS 2.5') {
$navigation .= "<a href = '../../system/admin.php?fct=preferences&op=showmod&mod=" . $this->_obj->getVar('mid') . "'>" . _MI_SYSTEM_ADMENU6 . "</a>";
$ret = $navigation . "<br /><br />" . $ret;
}
+
return $ret;
}
}
Modified: XoopsCore/branches/2.5.x/2.5.7/htdocs/class/captcha/recaptcha/recaptchalib.php
===================================================================
--- XoopsCore/branches/2.5.x/2.5.7/htdocs/class/captcha/recaptcha/recaptchalib.php 2013-09-14 04:49:34 UTC (rev 12035)
+++ XoopsCore/branches/2.5.x/2.5.7/htdocs/class/captcha/recaptcha/recaptchalib.php 2013-09-14 04:58:55 UTC (rev 12036)
@@ -44,13 +44,15 @@
* @param $data - array of string elements to be encoded
* @return string - encoded request
*/
-function _recaptcha_qsencode ($data) {
+function _recaptcha_qsencode ($data)
+{
$req = "";
foreach ( $data as $key => $value )
$req .= $key . '=' . urlencode( stripslashes($value) ) . '&';
// Cut the last '&'
$req=substr($req,0,strlen($req)-1);
+
return $req;
}
@@ -64,8 +66,8 @@
* @param int port
* @return array response
*/
-function _recaptcha_http_post($host, $path, $data, $port = 80) {
-
+function _recaptcha_http_post($host, $path, $data, $port = 80)
+{
$req = _recaptcha_qsencode ($data);
$http_request = "POST $path HTTP/1.0\r\n";
@@ -77,7 +79,7 @@
$http_request .= $req;
$response = '';
- if( false == ( $fs = @fsockopen($host, $port, $errno, $errstr, 10) ) ) {
+ if ( false == ( $fs = @fsockopen($host, $port, $errno, $errstr, 10) ) ) {
die ('Could not open socket');
}
@@ -105,11 +107,11 @@
*/
function recaptcha_get_html ($pubkey, $error = null, $use_ssl = false)
{
- if ($pubkey == null || $pubkey == '') {
- die ("To use reCAPTCHA you must get an API key from <a href='https://www.google.com/recaptcha/admin/create'>https://www.google.com/recaptcha/admin/create</a>");
- }
+ if ($pubkey == null || $pubkey == '') {
+ die ("To use reCAPTCHA you must get an API key from <a href='https://www.google.com/recaptcha/admin/create'>https://www.google.com/recaptcha/admin/create</a>");
+ }
- if ($use_ssl) {
+ if ($use_ssl) {
$server = RECAPTCHA_API_SECURE_SERVER;
} else {
$server = RECAPTCHA_API_SERVER;
@@ -119,27 +121,25 @@
if ($error) {
$errorpart = "&error=" . $error;
}
+
return '<script type="text/javascript" src="'. $server . '/challenge?k=' . $pubkey . $errorpart . '"></script>
- <noscript>
- <iframe src="'. $server . '/noscript?k=' . $pubkey . $errorpart . '" height="300" width="500" frameborder="0"></iframe><br/>
- <textarea name="recaptcha_challenge_field" rows="3" cols="40"></textarea>
- <input type="hidden" name="recaptcha_response_field" value="manual_challenge"/>
- </noscript>';
+ <noscript>
+ <iframe src="'. $server . '/noscript?k=' . $pubkey . $errorpart . '" height="300" width="500" frameborder="0"></iframe><br/>
+ <textarea name="recaptcha_challenge_field" rows="3" cols="40"></textarea>
+ <input type="hidden" name="recaptcha_response_field" value="manual_challenge"/>
+ </noscript>';
}
-
-
-
/**
* A ReCaptchaResponse is returned from recaptcha_check_answer()
*/
-class ReCaptchaResponse {
+class ReCaptchaResponse
+{
var $is_valid;
var $error;
}
-
/**
* Calls an HTTP POST function to verify if the user's guess was correct
* @param string $privkey
@@ -151,13 +151,13 @@
*/
function recaptcha_check_answer ($privkey, $remoteip, $challenge, $response, $extra_params = array())
{
- if ($privkey == null || $privkey == '') {
- die ("To use reCAPTCHA you must get an API key from <a href='https://www.google.com/recaptcha/admin/create'>https://www.google.com/recaptcha/admin/create</a>");
- }
+ if ($privkey == null || $privkey == '') {
+ die ("To use reCAPTCHA you must get an API key from <a href='https://www.google.com/recaptcha/admin/create'>https://www.google.com/recaptcha/admin/create</a>");
+ }
- if ($remoteip == null || $remoteip == '') {
- die ("For security reasons, you must pass the remote ip to reCAPTCHA");
- }
+ if ($remoteip == null || $remoteip == '') {
+ die ("For security reasons, you must pass the remote ip to reCAPTCHA");
+ }
@@ -166,6 +166,7 @@
$recaptcha_response = new ReCaptchaResponse();
$recaptcha_response->is_valid = false;
$recaptcha_response->error = 'incorrect-captcha-sol';
+
return $recaptcha_response;
}
@@ -183,11 +184,11 @@
if (trim ($answers [0]) == 'true') {
$recaptcha_response->is_valid = true;
- }
- else {
+ } else {
$recaptcha_response->is_valid = false;
$recaptcha_response->error = $answers [1];
}
+
return $recaptcha_response;
}
@@ -199,45 +200,52 @@
* @param string $domain The domain where the page is hosted
* @param string $appname The name of your application
*/
-function recaptcha_get_signup_url ($domain = null, $appname = null) {
- return "https://www.google.com/recaptcha/admin/create?" . _recaptcha_qsencode (array ('domains' => $domain, 'app' => $appname));
+function recaptcha_get_signup_url ($domain = null, $appname = null)
+{
+ return "https://www.google.com/recaptcha/admin/create?" . _recaptcha_qsencode (array ('domains' => $domain, 'app' => $appname));
}
-function _recaptcha_aes_pad($val) {
- $block_size = 16;
- $numpad = $block_size - (strlen ($val) % $block_size);
- return str_pad($val, strlen ($val) + $numpad, chr($numpad));
+function _recaptcha_aes_pad($val)
+{
+ $block_size = 16;
+ $numpad = $block_size - (strlen ($val) % $block_size);
+
+ return str_pad($val, strlen ($val) + $numpad, chr($numpad));
}
/* Mailhide related code */
-function _recaptcha_aes_encrypt($val,$ky) {
- if (! function_exists ("mcrypt_encrypt")) {
- die ("To use reCAPTCHA Mailhide, you need to have the mcrypt php module installed.");
- }
- $mode=MCRYPT_MODE_CBC;
- $enc=MCRYPT_RIJNDAEL_128;
- $val=_recaptcha_aes_pad($val);
- return mcrypt_encrypt($enc, $ky, $val, $mode, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0");
+function _recaptcha_aes_encrypt($val,$ky)
+{
+ if (! function_exists ("mcrypt_encrypt")) {
+ die ("To use reCAPTCHA Mailhide, you need to have the mcrypt php module installed.");
+ }
+ $mode=MCRYPT_MODE_CBC;
+ $enc=MCRYPT_RIJNDAEL_128;
+ $val=_recaptcha_aes_pad($val);
+
+ return mcrypt_encrypt($enc, $ky, $val, $mode, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0");
}
-function _recaptcha_mailhide_urlbase64 ($x) {
- return strtr(base64_encode ($x), '+/', '-_');
+function _recaptcha_mailhide_urlbase64 ($x)
+{
+ return strtr(base64_encode ($x), '+/', '-_');
}
/* gets the reCAPTCHA Mailhide url for a given email, public key and private key */
-function recaptcha_mailhide_url($pubkey, $privkey, $email) {
- if ($pubkey == '' || $pubkey == null || $privkey == "" || $privkey == null) {
- die ("To use reCAPTCHA Mailhide, you have to sign up for a public and private key, " .
- "you can do so at <a href='http://www.google.com/recaptcha/mailhide/apikey'>http://www.google.com/recaptcha/mailhide/apikey</a>");
- }
+function recaptcha_mailhide_url($pubkey, $privkey, $email)
+{
+ if ($pubkey == '' || $pubkey == null || $privkey == "" || $privkey == null) {
+ die ("To use reCAPTCHA Mailhide, you have to sign up for a public and private key, " .
+ "you can do so at <a href='http://www.google.com/recaptcha/mailhide/apikey'>http://www.google.com/recaptcha/mailhide/apikey</a>");
+ }
- $ky = pack('H*', $privkey);
- $cryptmail = _recaptcha_aes_encrypt ($email, $ky);
+ $ky = pack('H*', $privkey);
+ $cryptmail = _recaptcha_aes_encrypt ($email, $ky);
- return "http://www.google.com/recaptcha/mailhide/d?k=" . $pubkey . "&c=" . _recaptcha_mailhide_urlbase64 ($cryptmail);
+ return "http://www.google.com/recaptcha/mailhide/d?k=" . $pubkey . "&c=" . _recaptcha_mailhide_urlbase64 ($cryptmail);
}
/**
@@ -245,17 +253,19 @@
* eg, given johndoe@example,com return ["john", "example.com"].
* the email is then displayed as jo...@ex...
*/
-function _recaptcha_mailhide_email_parts ($email) {
- $arr = preg_split("/@/", $email );
+function _recaptcha_mailhide_email_parts ($email)
+{
+ $arr = preg_split("/@/", $email );
- if (strlen ($arr[0]) <= 4) {
- $arr[0] = substr ($arr[0], 0, 1);
- } else if (strlen ($arr[0]) <= 6) {
- $arr[0] = substr ($arr[0], 0, 3);
- } else {
- $arr[0] = substr ($arr[0], 0, 4);
- }
- return $arr;
+ if (strlen ($arr[0]) <= 4) {
+ $arr[0] = substr ($arr[0], 0, 1);
+ } elseif (strlen ($arr[0]) <= 6) {
+ $arr[0] = substr ($arr[0], 0, 3);
+ } else {
+ $arr[0] = substr ($arr[0], 0, 4);
+ }
+
+ return $arr;
}
/**
@@ -264,11 +274,12 @@
*
* http://www.google.com/recaptcha/mailhide/apikey
*/
-function recaptcha_mailhide_html($pubkey, $privkey, $email) {
- $emailparts = _recaptcha_mailhide_email_parts ($email);
- $url = recaptcha_mailhide_url ($pubkey, $privkey, $email);
+function recaptcha_mailhide_html($pubkey, $privkey, $email)
+{
+ $emailparts = _recaptcha_mailhide_email_parts ($email);
+ $url = recaptcha_mailhide_url ($pubkey, $privkey, $email);
- return htmlentities($emailparts[0]) . "<a href='" . htmlentities ($url) .
- "' onclick=\"window.open('" . htmlentities ($url) . "', '', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=500,height=300'); return false;\" title=\"Reveal this e-mail address\">...</a>@" . htmlentities ($emailparts [1]);
+ return htmlentities($emailparts[0]) . "<a href='" . htmlentities ($url) .
+ "' onclick=\"window.open('" . htmlentities ($url) . "', '', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=500,height=300'); return false;\" title=\"Reveal this e-mail address\">...</a>@" . htmlentities ($emailparts [1]);
}
Modified: XoopsCore/branches/2.5.x/2.5.7/htdocs/class/database/sqlutility.php
===================================================================
--- XoopsCore/branches/2.5.x/2.5.7/htdocs/class/database/sqlutility.php 2013-09-14 04:49:34 UTC (rev 12035)
+++ XoopsCore/branches/2.5.x/2.5.7/htdocs/class/database/sqlutility.php 2013-09-14 04:58:55 UTC (rev 12036)
@@ -26,7 +26,8 @@
* @package kernel
* @subpackage database
*/
-class SqlUtility {
+class SqlUtility
+{
/**
* Function from phpMyAdmin (http://phpwizard.net/projects/phpMyAdmin/)
*
@@ -58,6 +59,7 @@
// substring to the returned array
if (!$i) {
$ret[] = $sql;
+
return true;
}
// Backquotes or no backslashes before
@@ -139,6 +141,7 @@
if (!empty($sql) && trim($sql) != '') {
$ret[] = $sql;
}
+
return true; // end for
}
@@ -156,8 +159,10 @@
if (preg_match($pattern, $query, $matches) || preg_match($pattern2, $query, $matches)) {
$replace = "\\1 " . $prefix . "_\\4\\5";
$matches[0] = preg_replace($pattern, $replace, $query);
+
return $matches;
}
+
return false;
}
}
Modified: XoopsCore/branches/2.5.x/2.5.7/htdocs/class/logger/render.php
===================================================================
--- XoopsCore/branches/2.5.x/2.5.7/htdocs/class/logger/render.php 2013-09-14 04:49:34 UTC (rev 12035)
+++ XoopsCore/branches/2.5.x/2.5.7/htdocs/class/logger/render.php 2013-09-14 04:58:55 UTC (rev 12036)
@@ -124,7 +124,7 @@
if (empty($mode) || $mode == 'queries') {
$class = 'even';
$ret .= '<table id="xo-logger-queries" class="outer"><tr><th>' . _LOGGER_QUERIES . '</th></tr>';
- $xoopsDB =& XoopsDatabaseFactory::getDatabaseConnection();
+ $xoopsDB =& XoopsDatabaseFactory::getDatabaseConnection();
$pattern = '/\b' . preg_quote($xoopsDB->prefix()) . '\_/i';
foreach ($this->queries as $q) {
@@ -181,33 +181,37 @@
$ret .= <<<EOT
</div>
<script type="text/javascript">
- function xoLogCreateCookie(name,value,days) {
+ function xoLogCreateCookie(name,value,days)
+ {
if (days) {
var date = new Date();
date.setTime(date.getTime()+(days*24*60*60*1000));
var expires = "; expires="+date.toGMTString();
- }
- else var expires = "";
+ } else var expires = "";
document.cookie = name+"="+value+expires+"; path=/";
}
- function xoLogReadCookie(name) {
+ function xoLogReadCookie(name)
+ {
var nameEQ = name + "=";
var ca = document.cookie.split(';');
- for(var i=0;i < ca.length;i++) {
+ for (var i=0;i < ca.length;i++) {
var c = ca[i];
while (c.charAt(0)==' ') c = c.substring(1,c.length);
if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
}
+
return null;
}
- function xoLogEraseCookie(name) {
+ function xoLogEraseCookie(name)
+ {
createCookie(name,"",-1);
}
- function xoSetLoggerView( name ) {
+ function xoSetLoggerView( name )
+ {
var log = document.getElementById( "xo-logger-output" );
if ( !log ) return;
var i, elt;
- for ( i=0; i!=log.childNodes.length; i++ ) {
+ for (i=0; i!=log.childNodes.length; i++) {
elt = log.childNodes[i];
if ( elt.tagName && elt.tagName.toLowerCase() != 'script' && elt.id != "xo-logger-tabs" ) {
elt.style.display = ( !name || elt.id == "xo-logger-" + name ) ? "block" : "none";
Modified: XoopsCore/branches/2.5.x/2.5.7/htdocs/class/mail/phpmailer/class.phpmailer.php
===================================================================
--- XoopsCore/branches/2.5.x/2.5.7/htdocs/class/mail/phpmailer/class.phpmailer.php 2013-09-14 04:49:34 UTC (rev 12035)
+++ XoopsCore/branches/2.5.x/2.5.7/htdocs/class/mail/phpmailer/class.phpmailer.php 2013-09-14 04:58:55 UTC (rev 12036)
@@ -37,8 +37,8 @@
if (version_compare(PHP_VERSION, '5.0.0', '<') ) exit("Sorry, this version of PHPMailer will only run on PHP version 5 or greater!\n");
-class PHPMailer {
-
+class PHPMailer
+{
/////////////////////////////////////////////////
// PROPERTIES, PUBLIC
/////////////////////////////////////////////////
@@ -369,7 +369,8 @@
* Constructor
* @param boolean $exceptions Should we throw external exceptions?
*/
- public function __construct($exceptions = false) {
+ public function __construct($exceptions = false)
+ {
$this->exceptions = ($exceptions == true);
}
@@ -378,7 +379,8 @@
* @param bool $ishtml
* @return void
*/
- public function IsHTML($ishtml = true) {
+ public function IsHTML($ishtml = true)
+ {
if ($ishtml) {
$this->ContentType = 'text/html';
} else {
@@ -390,7 +392,8 @@
* Sets Mailer to send message using SMTP.
* @return void
*/
- public function IsSMTP() {
+ public function IsSMTP()
+ {
$this->Mailer = 'smtp';
}
@@ -398,7 +401,8 @@
* Sets Mailer to send message using PHP mail() function.
* @return void
*/
- public function IsMail() {
+ public function IsMail()
+ {
$this->Mailer = 'mail';
}
@@ -406,7 +410,8 @@
* Sets Mailer to send message using the $Sendmail program.
* @return void
*/
- public function IsSendmail() {
+ public function IsSendmail()
+ {
if (!stristr(ini_get('sendmail_path'), 'sendmail')) {
$this->Sendmail = '/var/qmail/bin/sendmail';
}
@@ -417,7 +422,8 @@
* Sets Mailer to send message using the qmail MTA.
* @return void
*/
- public function IsQmail() {
+ public function IsQmail()
+ {
if (stristr(ini_get('sendmail_path'), 'qmail')) {
$this->Sendmail = '/var/qmail/bin/sendmail';
}
@@ -434,7 +440,8 @@
* @param string $name
* @return boolean true on success, false if address already used
*/
- public function AddAddress($address, $name = '') {
+ public function AddAddress($address, $name = '')
+ {
return $this->AddAnAddress('to', $address, $name);
}
@@ -445,7 +452,8 @@
* @param string $name
* @return boolean true on success, false if address already used
*/
- public function AddCC($address, $name = '') {
+ public function AddCC($address, $name = '')
+ {
return $this->AddAnAddress('cc', $address, $name);
}
@@ -456,7 +464,8 @@
* @param string $name
* @return boolean true on success, false if address already used
*/
- public function AddBCC($address, $name = '') {
+ public function AddBCC($address, $name = '')
+ {
return $this->AddAnAddress('bcc', $address, $name);
}
@@ -466,7 +475,8 @@
* @param string $name
* @return boolean
*/
- public function AddReplyTo($address, $name = '') {
+ public function AddReplyTo($address, $name = '')
+ {
return $this->AddAnAddress('Reply-To', $address, $name);
}
@@ -479,15 +489,17 @@
* @return boolean true on success, false if address already used or invalid in some way
* @access protected
*/
- protected function AddAnAddress($kind, $address, $name = '') {
+ protected function AddAnAddress($kind, $address, $name = '')
+ {
if (!preg_match('/^(to|cc|bcc|Reply-To)$/', $kind)) {
$this->SetError($this->Lang('Invalid recipient array').': '.$kind);
if ($this->exceptions) {
throw new phpmailerException('Invalid recipient array: ' . $kind);
}
- if ($this->SMTPDebug) {
+ if ($this->SMTPDebug) {
echo $this->Lang('Invalid recipient array').': '.$kind;
}
+
return false;
}
$address = trim($address);
@@ -497,23 +509,27 @@
if ($this->exceptions) {
throw new phpmailerException($this->Lang('invalid_address').': '.$address);
}
- if ($this->SMTPDebug) {
+ if ($this->SMTPDebug) {
echo $this->Lang('invalid_address').': '.$address;
}
+
return false;
}
if ($kind != 'Reply-To') {
if (!isset($this->all_recipients[strtolower($address)])) {
array_push($this->$kind, array($address, $name));
$this->all_recipients[strtolower($address)] = true;
+
return true;
}
} else {
if (!array_key_exists(strtolower($address), $this->ReplyTo)) {
$this->ReplyTo[strtolower($address)] = array($address, $name);
+
return true;
}
}
+
return false;
}
@@ -523,7 +539,8 @@
* @param string $name
* @return boolean
*/
- public function SetFrom($address, $name = '', $auto = 1) {
+ public function SetFrom($address, $name = '', $auto = 1)
+ {
$address = trim($address);
$name = trim(preg_replace('/[\r\n]+/', '', $name)); //Strip breaks and trim
if (!self::ValidateAddress($address)) {
@@ -531,9 +548,10 @@
if ($this->exceptions) {
throw new phpmailerException($this->Lang('invalid_address').': '.$address);
}
- if ($this->SMTPDebug) {
+ if ($this->SMTPDebug) {
echo $this->Lang('invalid_address').': '.$address;
}
+
return false;
}
$this->From = $address;
@@ -546,6 +564,7 @@
$this->Sender = $address;
}
}
+
return true;
}
@@ -560,9 +579,10 @@
* @static
* @access public
*/
- public static function ValidateAddress($address) {
+ public static function ValidateAddress($address)
+ {
if (function_exists('filter_var')) { //Introduced in PHP 5.2
- if(filter_var($address, FILTER_VALIDATE_EMAIL) === FALSE) {
+ if (filter_var($address, FILTER_VALIDATE_EMAIL) === FALSE) {
return false;
} else {
return true;
@@ -582,29 +602,33 @@
* variable to view description of the error.
* @return bool
*/
- public function Send() {
+ public function Send()
+ {
try {
if(!$this->PreSend()) return false;
+
return $this->PostSend();
} catch (phpmailerException $e) {
- $this->SentMIMEMessage = '';
+ $this->SentMIMEMessage = '';
$this->SetError($e->getMessage());
if ($this->exceptions) {
throw $e;
}
+
return false;
}
}
- protected function PreSend() {
+ protected function PreSend()
+ {
try {
- $mailHeader = "";
+ $mailHeader = "";
if ((count($this->to) + count($this->cc) + count($this->bcc)) < 1) {
throw new phpmailerException($this->Lang('provide_address'), self::STOP_CRITICAL);
}
// Set whether the message is multipart/alternative
- if(!empty($this->AltBody)) {
+ if (!empty($this->AltBody)) {
$this->ContentType = 'multipart/alternative';
}
@@ -619,7 +643,7 @@
$this->MIMEBody = $this->CreateBody();
// To capture the complete message when using mail(), create
- // an extra header list which CreateHeader() doesn't fold in
+ // an extra header list which CreateHeader() doesn't fold in
if ($this->Mailer == 'mail') {
if (count($this->to) > 0) {
$mailHeader .= $this->AddrAppend("To", $this->to);
@@ -627,7 +651,7 @@
$mailHeader .= $this->HeaderLine("To", "undisclosed-recipients:;");
}
$mailHeader .= $this->HeaderLine('Subject', $this->EncodeHeader($this->SecureHeader(trim($this->Subject))));
- // if(count($this->cc) > 0) {
+ // if (count($this->cc) > 0) {
// $mailHeader .= $this->AddrAppend("Cc", $this->cc);
// }
}
@@ -639,6 +663,7 @@
}
$this->SentMIMEMessage = sprintf("%s%s\r\n\r\n%s",$this->MIMEHeader,$mailHeader,$this->MIMEBody);
+
return true;
} catch (phpmailerException $e) {
@@ -646,14 +671,16 @@
if ($this->exceptions) {
throw $e;
}
+
return false;
}
}
- protected function PostSend() {
+ protected function PostSend()
+ {
try {
// Choose the mailer and send through it
- switch($this->Mailer) {
+ switch ($this->Mailer) {
case 'sendmail':
return $this->SendmailSend($this->MIMEHeader, $this->MIMEBody);
case 'smtp':
@@ -669,9 +696,10 @@
if ($this->exceptions) {
throw $e;
}
- if ($this->SMTPDebug) {
+ if ($this->SMTPDebug) {
echo $e->getMessage()."\n";
}
+
return false;
}
}
@@ -683,7 +711,8 @@
* @access protected
* @return bool
*/
- protected function SendmailSend($header, $body) {
+ protected function SendmailSend($header, $body)
+ {
if ($this->Sender != '') {
$sendmail = sprintf("%s -oi -f %s -t", escapeshellcmd($this->Sendmail), escapeshellarg($this->Sender));
} else {
@@ -691,7 +720,7 @@
}
if ($this->SingleTo === true) {
foreach ($this->SingleToArray as $key => $val) {
- if(!@$mail = popen($sendmail, 'w')) {
+ if (!@$mail = popen($sendmail, 'w')) {
throw new phpmailerException($this->Lang('execute') . $this->Sendmail, self::STOP_CRITICAL);
}
fputs($mail, "To: " . $val . "\n");
@@ -701,12 +730,12 @@
// implement call back function if it exists
$isSent = ($result == 0) ? 1 : 0;
$this->doCallback($isSent, $val, $this->cc, $this->bcc, $this->Subject, $body);
- if($result != 0) {
+ if ($result != 0) {
throw new phpmailerException($this->Lang('execute') . $this->Sendmail, self::STOP_CRITICAL);
}
}
} else {
- if(!@$mail = popen($sendmail, 'w')) {
+ if (!@$mail = popen($sendmail, 'w')) {
throw new phpmailerException($this->Lang('execute') . $this->Sendmail, self::STOP_CRITICAL);
}
fputs($mail, $header);
@@ -715,10 +744,11 @@
// implement call back function if it exists
$isSent = ($result == 0) ? 1 : 0;
$this->doCallback($isSent, $this->to, $this->cc, $this->bcc, $this->Subject, $body);
- if($result != 0) {
+ if ($result != 0) {
throw new phpmailerException($this->Lang('execute') . $this->Sendmail, self::STOP_CRITICAL);
}
}
+
return true;
}
@@ -729,9 +759,10 @@
* @access protected
* @return bool
*/
- protected function MailSend($header, $body) {
+ protected function MailSend($header, $body)
+ {
$toArr = array();
- foreach($this->to as $t) {
+ foreach ($this->to as $t) {
$toArr[] = $this->AddrFormat($t);
}
$to = implode(', ', $toArr);
@@ -775,9 +806,10 @@
if (isset($old_from)) {
ini_set('sendmail_from', $old_from);
}
- if(!$rt) {
+ if (!$rt) {
throw new phpmailerException($this->Lang('instantiate'), self::STOP_CRITICAL);
}
+
return true;
}
@@ -790,20 +822,21 @@
* @access protected
* @return bool
*/
- protected function SmtpSend($header, $body) {
+ protected function SmtpSend($header, $body)
+ {
require_once $this->PluginDir . 'class.smtp.php';
$bad_rcpt = array();
- if(!$this->SmtpConnect()) {
+ if (!$this->SmtpConnect()) {
throw new phpmailerException($this->Lang('smtp_connect_failed'), self::STOP_CRITICAL);
}
$smtp_from = ($this->Sender == '') ? $this->From : $this->Sender;
- if(!$this->smtp->Mail($smtp_from)) {
+ if (!$this->smtp->Mail($smtp_from)) {
throw new phpmailerException($this->Lang('from_failed') . $smtp_from, self::STOP_CRITICAL);
}
// Attempt to send attach all recipients
- foreach($this->to as $to) {
+ foreach ($this->to as $to) {
if (!$this->smtp->Recipient($to[0])) {
$bad_rcpt[] = $to[0];
// implement call back function if it exists
@@ -815,7 +848,7 @@
$this->doCallback($isSent, $to[0], '', '', $this->Subject, $body);
}
}
- foreach($this->cc as $cc) {
+ foreach ($this->cc as $cc) {
if (!$this->smtp->Recipient($cc[0])) {
$bad_rcpt[] = $cc[0];
// implement call back function if it exists
@@ -827,7 +860,7 @@
$this->doCallback($isSent, '', $cc[0], '', $this->Subject, $body);
}
}
- foreach($this->bcc as $bcc) {
+ foreach ($this->bcc as $bcc) {
if (!$this->smtp->Recipient($bcc[0])) {
$bad_rcpt[] = $bcc[0];
// implement call back function if it exists
@@ -845,12 +878,13 @@
$badaddresses = implode(', ', $bad_rcpt);
throw new phpmailerException($this->Lang('recipients_failed') . $badaddresses);
}
- if(!$this->smtp->Data($header . $body)) {
+ if (!$this->smtp->Data($header . $body)) {
throw new phpmailerException($this->Lang('data_not_accepted'), self::STOP_CRITICAL);
}
- if($this->SMTPKeepAlive == true) {
+ if ($this->SMTPKeepAlive == true) {
$this->smtp->Reset();
}
+
return true;
}
@@ -861,8 +895,9 @@
* @access public
* @return bool
*/
- public function SmtpConnect() {
- if(is_null($this->smtp)) {
+ public function SmtpConnect()
+ {
+ if (is_null($this->smtp)) {
$this->smtp = new SMTP();
}
@@ -873,7 +908,7 @@
// Retry while there is no connection
try {
- while($index < count($hosts) && !$connection) {
+ while ($index < count($hosts) && !$connection) {
$hostinfo = array();
if (preg_match('/^(.+):([0-9]+)$/', $hosts[$index], $hostinfo)) {
$host = $hostinfo[1];
@@ -914,10 +949,11 @@
}
} catch (phpmailerException $e) {
$this->smtp->Reset();
- if ($this->exceptions) {
+ if ($this->exceptions) {
throw $e;
}
}
+
return true;
}
@@ -925,9 +961,10 @@
* Closes the active SMTP session if one exists.
* @return void
*/
- public function SmtpClose() {
- if(!is_null($this->smtp)) {
- if($this->smtp->Connected()) {
+ public function SmtpClose()
+ {
+ if (!is_null($this->smtp)) {
+ if ($this->smtp->Connected()) {
$this->smtp->Quit();
$this->smtp->Close();
}
@@ -941,7 +978,8 @@
* @param string $lang_path Path to the language file directory
* @access public
*/
- function SetLanguage($langcode = 'en', $lang_path = 'language/') {
+ function SetLanguage($langcode = 'en', $lang_path = 'language/')
+ {
//Define full set of translatable strings
$PHPMAILER_LANG = array(
'provide_address' => 'You must provide at least one recipient email address.',
@@ -968,6 +1006,7 @@
$l = @include $lang_path.'phpmailer.lang-'.$langcode.'.php';
}
$this->language = $PHPMAILER_LANG;
+
return ($l == true); //Returns false if language not found
}
@@ -975,7 +1014,8 @@
* Return the current array of language strings
* @return array
*/
- public function GetTranslations() {
+ public function GetTranslations()
+ {
return $this->language;
}
@@ -988,7 +1028,8 @@
* @access public
* @return string
*/
- public function AddrAppend($type, $addr) {
+ public function AddrAppend($type, $addr)
+ {
$addr_str = $type . ': ';
$addresses = array();
foreach ($addr as $a) {
@@ -1005,7 +1046,8 @@
* @access public
* @return string
*/
- public function AddrFormat($addr) {
+ public function AddrFormat($addr)
+ {
if (empty($addr[1])) {
return $this->SecureHeader($addr[0]);
} else {
@@ -1023,7 +1065,8 @@
* @access public
* @return string
*/
- public function WrapText($message, $length, $qp_mode = false) {
+ public function WrapText($message, $length, $qp_mode = false)
+ {
$soft_break = ($qp_mode) ? sprintf(" =%s", $this->LE) : $this->LE;
// If utf-8 encoding is used, we will need to make sure we don't
// split multibyte characters when we wrap
@@ -1105,7 +1148,8 @@
* @param int $maxLength find last character boundary prior to this length
* @return int
*/
- public function UTF8CharBoundary($encodedText, $maxLength) {
+ public function UTF8CharBoundary($encodedText, $maxLength)
+ {
$foundSplitPos = false;
$lookBack = 3;
while (!$foundSplitPos) {
@@ -1134,6 +1178,7 @@
$foundSplitPos = true;
}
}
+
return $maxLength;
}
@@ -1143,12 +1188,13 @@
* @access public
* @return void
*/
- public function SetWordWrap() {
- if($this->WordWrap < 1) {
+ public function SetWordWrap()
+ {
+ if ($this->WordWrap < 1) {
return;
}
- switch($this->message_type) {
+ switch ($this->message_type) {
case 'alt':
case 'alt_inline':
case 'alt_attach':
@@ -1166,7 +1212,8 @@
* @access public
* @return string The assembled header
*/
- public function CreateHeader() {
+ public function CreateHeader()
+ {
$result = '';
// Set the boundaries
@@ -1176,26 +1223,26 @@
$this->boundary[3] = 'b3_' . $uniq_id;
$result .= $this->HeaderLine('Date', self::RFCDate());
- if($this->Sender == '') {
+ if ($this->Sender == '') {
$result .= $this->HeaderLine('Return-Path', trim($this->From));
} else {
$result .= $this->HeaderLine('Return-Path', trim($this->Sender));
}
// To be created automatically by mail()
- if($this->Mailer != 'mail') {
+ if ($this->Mailer != 'mail') {
if ($this->SingleTo === true) {
- foreach($this->to as $t) {
+ foreach ($this->to as $t) {
$this->SingleToArray[] = $this->AddrFormat($t);
}
} else {
- if(count($this->to) > 0) {
+ if (count($this->to) > 0) {
$result .= $this->AddrAppend('To', $this->to);
} elseif (count($this->cc) == 0) {
$result .= $this->HeaderLine('To', 'undisclosed-recipients:;');
}
}
- }
+ }
$from = array();
$from[0][0] = trim($this->From);
@@ -1203,42 +1250,42 @@
$result .= $this->AddrAppend('From', $from);
// sendmail and mail() extract Cc from the header before sending
- if(count($this->cc) > 0) {
+ if (count($this->cc) > 0) {
$result .= $this->AddrAppend('Cc', $this->cc);
}
// sendmail and mail() extract Bcc from the header before sending
- if((($this->Mailer == 'sendmail') || ($this->Mailer == 'mail')) && (count($this->bcc) > 0)) {
+ if ((($this->Mailer == 'sendmail') || ($this->Mailer == 'mail')) && (count($this->bcc) > 0)) {
$result .= $this->AddrAppend('Bcc', $this->bcc);
}
- if(count($this->ReplyTo) > 0) {
+ if (count($this->ReplyTo) > 0) {
$result .= $this->AddrAppend('Reply-To', $this->ReplyTo);
}
// mail() sets the subject itself
- if($this->Mailer != 'mail') {
+ if ($this->Mailer != 'mail') {
$result .= $this->HeaderLine('Subject', $this->EncodeHeader($this->SecureHeader($this->Subject)));
}
- if($this->MessageID != '') {
+ if ($this->MessageID != '') {
$result .= $this->HeaderLine('Message-ID', $this->MessageID);
} else {
$result .= sprintf("Message-ID: <%s@%s>%s", $uniq_id, $this->ServerHostname(), $this->LE);
}
$result .= $this->HeaderLine('X-Priority', $this->Priority);
- if($this->XMailer) {
+ if ($this->XMailer) {
$result .= $this->HeaderLine('X-Mailer', $this->XMailer);
} else {
$result .= $this->HeaderLine('X-Mailer', 'PHPMailer '.$this->Version.' (http://code.google.com/a/apache-extras.org/p/phpmailer/)');
}
- if($this->ConfirmReadingTo != '') {
+ if ($this->ConfirmReadingTo != '') {
$result .= $this->HeaderLine('Disposition-Notification-To', '<' . trim($this->ConfirmReadingTo) . '>');
}
// Add custom headers
- for($index = 0; $index < count($this->CustomHeader); $index++) {
+ for ($index = 0; $index < count($this->CustomHeader); $index++) {
$result .= $this->HeaderLine(trim($this->CustomHeader[$index][0]), $this->EncodeHeader(trim($this->CustomHeader[$index][1])));
}
if (!$this->sign_key_file) {
@@ -1254,9 +1301,10 @@
* @access public
* @return string
*/
- public function GetMailMIME() {
+ public function GetMailMIME()
+ {
$result = '';
- switch($this->message_type) {
+ switch ($this->message_type) {
case 'plain':
$result .= $this->HeaderLine('Content-Transfer-Encoding', $this->Encoding);
$result .= $this->TextLine('Content-Type: '.$this->ContentType.'; charset="'.$this->CharSet.'"');
@@ -1279,7 +1327,7 @@
break;
}
- if($this->Mailer != 'mail') {
+ if ($this->Mailer != 'mail') {
$result .= $this->LE.$this->LE;
}
@@ -1291,17 +1339,18 @@
* @access public
* @return string
*/
- public function GetSentMIMEMessage() {
+ public function GetSentMIMEMessage()
+ {
return $this->SentMIMEMessage;
}
-
/**
* Assembles the message body. Returns an empty string on failure.
* @access public
* @return string The assembled message body
*/
- public function CreateBody() {
+ public function CreateBody()
+ {
$body = '';
if ($this->sign_key_file) {
@@ -1310,7 +1359,7 @@
$this->SetWordWrap();
- switch($this->message_type) {
+ switch ($this->message_type) {
case 'plain':
$body .= $this->EncodeString($this->Body, $this->Encoding);
break;
@@ -1432,15 +1481,16 @@
* @access protected
* @return string
*/
- protected function GetBoundary($boundary, $charSet, $contentType, $encoding) {
+ protected function GetBoundary($boundary, $charSet, $contentType, $encoding)
+ {
$re...
[truncated message content] |