From d03cdda0af59cef36eae0bf7bd4a718df3ecf06d Mon Sep 17 00:00:00 2001 From: lonalore Date: Thu, 15 Dec 2016 15:08:49 +0100 Subject: [PATCH 1/2] Code cleanup. --- cron.php | 2 +- e107_admin/emoticon.php | 6 +++--- e107_admin/image.php | 28 ++++++++++++++++----------- e107_admin/language.php | 25 ++++++++++++++---------- e107_admin/plugin.php | 34 +++++++++++++++++++-------------- e107_handlers/e_parse_class.php | 2 +- submitnews.php | 2 +- 7 files changed, 58 insertions(+), 41 deletions(-) diff --git a/cron.php b/cron.php index 5d8021a64..168673ace 100644 --- a/cron.php +++ b/cron.php @@ -34,7 +34,7 @@ require_once(realpath(dirname(__FILE__)."/class2.php")); if(!empty($_GET['token'])) { - $pwd = $_GET['token']; + $pwd = e107::getParser()->filter($_GET['token']); } else { diff --git a/e107_admin/emoticon.php b/e107_admin/emoticon.php index 9035171ee..5c17c1e35 100644 --- a/e107_admin/emoticon.php +++ b/e107_admin/emoticon.php @@ -54,17 +54,17 @@ if (isset($_POST['active'])) } -$ns->tablerender($caption, $mes->render() . $text); +e107::getRender()->tablerender($caption, $mes->render() . $text); /* get packs */ require_once(e_HANDLER."file_class.php"); $fl = e107::getFile(); $emote = new emotec; $one_pack = FALSE; - +$filtered = e107::getParser()->filter($_POST); // Check for pack-related buttons pressed -foreach($_POST as $key => $value) +foreach($filtered as $key => $value) { if(strstr($key, "subPack_")) { diff --git a/e107_admin/image.php b/e107_admin/image.php index 29cc85e26..0698151a3 100644 --- a/e107_admin/image.php +++ b/e107_admin/image.php @@ -79,14 +79,17 @@ if(vartrue($_GET['action']) == 'nav' && e_AJAX_REQUEST) //XXX Doesn't work corre $bbcodeMode .= "&nav=1"; - $tag = ($bbcodeMode===false) ? false : $_GET['tagid']; // eg. news, news-thumbnail + $tag = ($bbcodeMode===false) ? false : e107::getParser()->filter($_GET['tagid']); // eg. news, news-thumbnail if($_GET['search']) { - $bbcodeMode .= "&search=".preg_replace("/[^a-z0-9]/i","",$_GET['search']); + $search = e107::getParser()->filter($_GET['search']); + $bbcodeMode .= "&search=".preg_replace("/[^a-z0-9]/i","",$search); } + + $for = e107::getParser()->filter($_GET['for']); - echo e107::getMedia()->mediaSelect($_GET['for'],$tag,$bbcodeMode); + echo e107::getMedia()->mediaSelect($for,$tag,$bbcodeMode); // require_once(e_ADMIN."footer.php"); exit; @@ -1655,6 +1658,7 @@ class media_admin_ui extends e_admin_ui { $fl = e107::getFile(); $mes = e107::getMessage(); + $tp = e107::getParser(); if(vartrue($_POST['upload_remote_url'])) @@ -1675,7 +1679,7 @@ class media_admin_ui extends e_admin_ui $fileName = empty($_POST['upload_caption']) ? str_replace(array(".php",".html",".asp",".htm"),'',$fileName)."_".time() : eHelper::dasherize(strtolower($_POST['upload_caption'])); } - if(!$fl->getRemoteFile($_POST['upload_url'], $fileName, 'import')) + if(!$fl->getRemoteFile($tp->filter($_POST['upload_url'], 'file'), $fileName, 'import')) { $mes->addError(IMALAN_176); } @@ -1873,9 +1877,10 @@ class media_admin_ui extends e_admin_ui if(!empty($_POST['multiaction'])) { + $actions = $tp->filter($_POST['multiaction']); $tmp = array(); $tmp1 = array(); $message = array(); - foreach ($_POST['multiaction'] as $todel) + foreach ($actions as $todel) { list($usr,$path) = explode('#', $todel); @@ -2364,6 +2369,7 @@ class media_admin_ui extends e_admin_ui $frm = e107::getForm(); $mes = e107::getMessage(); $fl = e107::getFile(); + $tp = e107::getParser(); @@ -2446,8 +2452,8 @@ class media_admin_ui extends e_admin_ui ".$frm->checkbox("batch_selected[".$c."]",$f['fname'],$checked)." ".$this->preview($f)." ".$f['fname']." - ".$frm->text('batch_import_name['.$c.']', ($_POST['batch_import_name'][$c] ? $_POST['batch_import_name'][$c] : $default['title']))." - + ".$frm->text('batch_import_name['.$c.']', ($_POST['batch_import_name'][$c] ? $tp->filter($_POST['batch_import_name'][$c]) : $default['title']))." + ".$default['authorName']."
".$default['authorEmail']." ".$f['mime']." @@ -2476,7 +2482,7 @@ class media_admin_ui extends e_admin_ui
- ".IMALAN_123." ".$frm->selectbox('batch_category',$this->cats, $_POST['batch_category']); + ".IMALAN_123." ".$frm->selectbox('batch_category',$this->cats, $tp->filter($_POST['batch_category'])); // $waterMarkPath = e_THEME.e107::getPref('sitetheme')."/images/watermark.png"; // Now performed site-wide dynamically. @@ -2577,7 +2583,7 @@ class media_admin_ui extends e_admin_ui } // $oldpath = e_MEDIA."temp/".$file; - $oldpath = e_IMPORT.$file; + $oldpath = e_IMPORT.e107::getParser()->filter($file, 'file'); if(file_exists($oldpath)) { unlink($oldpath); @@ -2629,7 +2635,7 @@ class media_admin_ui extends e_admin_ui if($_POST['batch_category'] == '_avatars_public' || $_POST['batch_category'] == '_avatars_private') { - $newpath = ($_POST['batch_category'] == '_avatars_public') ? e_AVATAR_DEFAULT.$file : $newpath = e_AVATAR_UPLOAD.$file; + $newpath = ($_POST['batch_category'] == '_avatars_public') ? e_AVATAR_DEFAULT.$tp->filter($file, 'file') : $newpath = e_AVATAR_UPLOAD.$tp->filter($file, 'file'); if(rename($oldpath,$newpath)) { @@ -2688,7 +2694,7 @@ class media_admin_ui extends e_admin_ui $insert = array( 'media_caption' => $newdiz, 'media_description' => '', - 'media_category' => $_POST['batch_category'], + 'media_category' => $tp->filter($_POST['batch_category']), 'media_datestamp' => $f['modified'], 'media_url' => $tp->createConstants($newpath,'rel'), 'media_userclass' => '0', diff --git a/e107_admin/language.php b/e107_admin/language.php index 3b944c526..e2d425d06 100644 --- a/e107_admin/language.php +++ b/e107_admin/language.php @@ -979,26 +979,29 @@ class lanDeveloper { $ns = e107::getRender(); $mes = e107::getMessage(); + $tp = e107::getParser(); // ------------------------------ TODO ------------------------------- if(vartrue($_POST['disabled-unused']) && vartrue($_POST['disable-unused-lanfile'])) { + $disUnusedLanFile = $tp->filter($_POST['disable-unused-lanfile'], 'file'); + $mes = e107::getMessage(); - $data = file_get_contents($_POST['disable-unused-lanfile']); + $data = file_get_contents($disUnusedLanFile); $new = $this->disableUnused($data); - if(file_put_contents($_POST['disable-unused-lanfile'],$new)) + if(file_put_contents($disUnusedLanFile,$new)) { - $mes->addSuccess(LANG_LAN_135.$_POST['disable-unused-lanfile']);//Overwriting + $mes->addSuccess(LANG_LAN_135.$disUnusedLanFile);//Overwriting } else { - $mes->addError(LANG_LAN_136.$_POST['disable-unused-lanfile']);//Couldn't overwrite + $mes->addError(LANG_LAN_136.$disUnusedLanFile);//Couldn't overwrite } - $ns->tablerender(LANG_LAN_137.SEP.$_POST['disable-unused-lanfile'],$mes->render()."
".htmlentities($new)."
");//Processed + $ns->tablerender(LANG_LAN_137.SEP.$disUnusedLanFile,$mes->render()."
".htmlentities($new)."
");//Processed } @@ -1010,7 +1013,7 @@ class lanDeveloper function run() { - + $tp = e107::getParser(); $mes = e107::getMessage(); if(varset($_POST['searchDeprecated']) && varset($_POST['deprecatedLans'])) @@ -1018,7 +1021,7 @@ class lanDeveloper // print_a($_POST); // $lanfile = $_POST['deprecatedLans']; - $script = $_POST['deprecatedLans']; + $script = $tp->filter($_POST['deprecatedLans']); foreach($script as $k=>$scr) { @@ -1058,7 +1061,7 @@ class lanDeveloper if($_POST['deprecatedLanFile'][0] !='auto') //override. { - $lanfile = $_POST['deprecatedLanFile']; + $lanfile = $tp->filter($_POST['deprecatedLanFile'], 'file'); } @@ -1068,8 +1071,10 @@ class lanDeveloper $this->commonPhrases = $this->getCommon(); // print_a($this->commonPhrases); + $reverse = vartrue($_POST['deprecatedLansReverse']); + $reverse = $tp->filter($reverse); - if($res = $this->unused($lanfile, $script, vartrue($_POST['deprecatedLansReverse']))) + if($res = $this->unused($lanfile, $script, $reverse)) { return $res; // $ns->tablerender($res['caption'],$mes->render(). $res['text']); @@ -1243,7 +1248,7 @@ class lanDeveloper $text .= " ". - $frm->select('deprecatedLansReverse',$depOptions,$_POST['deprecatedLansReverse'],'class=select')." "; + $frm->select('deprecatedLansReverse',$depOptions,e107::getParser()->filter($_POST['deprecatedLansReverse']),'class=select')." "; $search = array(e_PLUGIN,e_ADMIN,e_LANGUAGEDIR."English/",e_THEME); $replace = array("Plugins ","Admin ","Core ","Themes "); diff --git a/e107_admin/plugin.php b/e107_admin/plugin.php index f99b869fd..11347fb61 100644 --- a/e107_admin/plugin.php +++ b/e107_admin/plugin.php @@ -47,7 +47,8 @@ if(e_AJAX_REQUEST && isset($_GET['action'])) // Ajax { if($_GET['action'] == 'download') { - $string = base64_decode($_GET['src']); + $string = base64_decode($_GET['src']); + $string = $tp->filter($string); parse_str($string, $p); // print_a($p); @@ -93,7 +94,7 @@ class pluginmanager_form extends e_form //FIXME _ there's a problem with calling this. function plugin_website($parms, $value, $id, $attributes) { - return ($plugURL) ? "".ADMIN_URL_ICON."" : ""; + return (varset($plugURL, false)) ? "".ADMIN_URL_ICON."" : ""; } @@ -113,7 +114,7 @@ class pluginmanager_form extends e_form if ($this->plug_vars['administration']['configFile'] && $this->plug['plugin_installflag'] == true) { $conf_file = e_PLUGIN. $this->plug['plugin_path'].'/'.$this->plug_vars['administration']['configFile']; - $conf_title = LAN_CONFIGURE.' '.$tp->toHtml($this->plug_vars['@attributes']['name'], "", "defs,emotes_off, no_make_clickable"); + $conf_title = LAN_CONFIGURE.' '.$tp->toHTML($this->plug_vars['@attributes']['name'], "", "defs,emotes_off, no_make_clickable"); $plugin_icon = "".$plugin_icon.""; $plugin_config_icon = "".ADMIN_CONFIGURE_ICON.""; } @@ -305,6 +306,7 @@ class pluginManager{ function pluginObserver() { + $tp = e107::getParser(); global $user_pref,$admin_log; @@ -316,7 +318,7 @@ class pluginManager{ if(isset($_POST['etrigger_ecolumns'])) { - $user_pref['admin_pluginmanager_columns'] = $_POST['e-columns']; + $user_pref['admin_pluginmanager_columns'] = $tp->filter($_POST['e-columns']); save_prefs('user'); } @@ -343,7 +345,7 @@ class pluginManager{ if($this->action == 'pull' && !empty($this->id)) { - $info = e107::getPlugin()->getInfo($this->id); + $info = e107::getPlugin()->getinfo($this->id); if(!empty($info['plugin_path'])) { @@ -762,7 +764,7 @@ class pluginManager{ $eplug_folder = ''; if(!isset($_POST['uninstall_confirm'])) { // $id is already an integer - $this->pluginConfirmUninstall($this->id); + $this->pluginConfirmUninstall(); return; } @@ -788,7 +790,7 @@ class pluginManager{ if(file_exists($_path.'plugin.xml')) { unset($_POST['uninstall_confirm']); - $text .= $plugin->install_plugin_xml($this->id, 'uninstall', $_POST); //$_POST must be used. + $plugin->install_plugin_xml($this->id, 'uninstall', $tp->filter($_POST)); //$_POST must be used. } else { // Deprecated - plugin uses plugin.php @@ -1399,7 +1401,7 @@ class pluginManager{ if ($plug_vars['administration']['configFile'] && $plug['plugin_installflag'] == true) { $conf_file = e_PLUGIN.$plug['plugin_path'].'/'.$plug_vars['administration']['configFile']; - $conf_title = LAN_CONFIGURE.' '.$tp->toHtml($plug_vars['@attributes']['name'], "", "defs,emotes_off, no_make_clickable"); + $conf_title = LAN_CONFIGURE.' '.$tp->toHTML($plug_vars['@attributes']['name'], "", "defs,emotes_off, no_make_clickable"); // $plugin_icon = "".$plugin_icon.""; $plugin_config_icon = "".ADMIN_CONFIGURE_ICON.""; } @@ -1448,7 +1450,7 @@ class pluginManager{ 'plugin_description' => $description, 'plugin_compatible' => $this->compatibilityLabel($plug_vars['@attributes']['compatibility']), - 'plugin_website' => vartrue($row['authorUrl']), + 'plugin_website' => vartrue($plug['authorUrl']), // 'plugin_url' => vartrue($plugURL), // ; // ? "".ADMIN_URL_ICON."" : "", 'plugin_notes' => '' ); @@ -3022,8 +3024,10 @@ class pluginBuilder } - $newArray['DESCRIPTION_DESCRIPTION'] = strip_tags($tp->toHtml($newArray['DESCRIPTION_DESCRIPTION'],true)); - + $newArray['DESCRIPTION_DESCRIPTION'] = strip_tags($tp->toHTML($newArray['DESCRIPTION_DESCRIPTION'],true)); + + $_POST['pluginPrefs'] = $tp->filter($_POST['pluginPrefs']); + foreach($_POST['pluginPrefs'] as $val) { if(vartrue($val['index'])) @@ -3576,15 +3580,17 @@ TEMPLATE; function step4() { $tp = e107::getParser(); - $pluginTitle = $_POST['xml']['main-name'] ; + $pluginTitle = $tp->filter($_POST['xml']['main-name']); if($_POST['xml']) { + $_POST['xml'] = $tp->filter($_POST['xml']); $xmlText = $this->createXml($_POST['xml']); } if(!empty($_POST['addons'])) { + $_POST['addons'] = $tp->filter($_POST['addons']); $addonResults = $this->createAddons($_POST['addons']); } @@ -3794,11 +3800,11 @@ if($_POST['pluginPrefs'] && ($vars['mode']=='main')) { if(vartrue($val['index'])) { - $index = $val['index']; + $index = $tp->filter($val['index']); $type = vartrue($val['type'],'text'); $help = str_replace("'",'', vartrue($val['help'])); - $text .= "\t\t\t'".$index."'\t\t=> array('title'=> '".ucfirst($index)."', 'tab'=>0, 'type'=>'".$type."', 'data' => 'str', 'help'=>'".$help."'),\n"; + $text .= "\t\t\t'".$index."'\t\t=> array('title'=> '".ucfirst($index)."', 'tab'=>0, 'type'=>'".$tp->filter($type)."', 'data' => 'str', 'help'=>'".$tp->filter($help)."'),\n"; } } diff --git a/e107_handlers/e_parse_class.php b/e107_handlers/e_parse_class.php index efefb2ac1..9f8ed2cbf 100644 --- a/e107_handlers/e_parse_class.php +++ b/e107_handlers/e_parse_class.php @@ -4422,7 +4422,7 @@ return; * Filters/Validates using the PHP5 filter_var() method. * @param $text * @param $type string str|int|email|url|w|wds - * @return string | boolean + * @return string | boolean | array */ function filter($text, $type='str',$validate=false) { diff --git a/submitnews.php b/submitnews.php index 0df3463e2..67454576e 100644 --- a/submitnews.php +++ b/submitnews.php @@ -27,7 +27,7 @@ if (!isset($pref['subnews_class'])) if (!check_class($pref['subnews_class'])) { - $ns->tablerender(NWSLAN_12, NWSLAN_11); + e107::getRender()->tablerender(NWSLAN_12, NWSLAN_11); require_once(FOOTERF); exit; } From a03fe161d53a37b62eaceae065448ae4e92e444e Mon Sep 17 00:00:00 2001 From: lonalore Date: Thu, 15 Dec 2016 15:35:18 +0100 Subject: [PATCH 2/2] Code cleanup. --- contact.php | 3 ++- e107_admin/image.php | 7 ++++--- e107_admin/mailout.php | 19 +++++++++--------- e107_handlers/mail.php | 44 +++++++++++++++++++++--------------------- 4 files changed, 38 insertions(+), 35 deletions(-) diff --git a/contact.php b/contact.php index 647e31af9..00063b86b 100644 --- a/contact.php +++ b/contact.php @@ -30,6 +30,8 @@ define('PAGE_NAME', LANCONTACT_00); require_once(HEADERF); +$tp = e107::getParser(); +$ns = e107::getRender(); if (!vartrue($CONTACT_FORM)) { @@ -52,7 +54,6 @@ if (!vartrue($CONTACT_FORM)) if(isset($_POST['send-contactus'])) { - $error = ""; $ignore = false; diff --git a/e107_admin/image.php b/e107_admin/image.php index 0698151a3..76d5157a3 100644 --- a/e107_admin/image.php +++ b/e107_admin/image.php @@ -588,7 +588,8 @@ class media_form_ui extends e_admin_form_ui return; } - $tagid = vartrue($_GET['tagid']); + $tagid = vartrue($_GET['tagid']); + $tagid = e107::getParser()->filter($tagid); $path = $this->getController()->getListModel()->get('media_url'); $title = $this->getController()->getListModel()->get('media_name'); $id = $this->getController()->getListModel()->get('media_id'); @@ -935,14 +936,14 @@ class media_admin_ui extends e_admin_ui if($this->getAction() == 'youtube') { - $parm = array('search'=>$_GET['search']); + $parm = array('search' => $tp->filter($_GET['search'])); echo $this->videoTab($parm); exit; } if($this->getAction() == 'glyph') { - $parm = array('search'=>$_GET['search']); + $parm = array('search' => $tp->filter($_GET['search'])); echo $this->glyphTab($parm); exit; } diff --git a/e107_admin/mailout.php b/e107_admin/mailout.php index e795c9cad..1fb6cee1f 100644 --- a/e107_admin/mailout.php +++ b/e107_admin/mailout.php @@ -385,7 +385,8 @@ class mailout_main_ui extends e_admin_ui if($_GET['action'] == 'preview') { - echo $this->previewPage($_GET['id'], $_GET['user']); + $tp = e107::getParser(); + echo $this->previewPage($tp->filter($_GET['id']), $tp->filter($_GET['user'])); exit; } @@ -480,7 +481,7 @@ class mailout_main_ui extends e_admin_ui $text = $this->getDKIMPublicKey(); e107::getMessage()->addInfo("Add the following to your ".e_DOMAIN." DNS Zone records:".print_a($text,true)); - e107::getMessage()->addinfo("Consider testing it using this website: http://dkimvalidator.com"); + e107::getMessage()->addInfo("Consider testing it using this website: http://dkimvalidator.com"); return false; } @@ -515,7 +516,7 @@ class mailout_main_ui extends e_admin_ui $text = $tp->lanVars($dnsEntry, $pubString); e107::getMessage()->addInfo("Add the following ".$keyLength." bit key to your ".e_DOMAIN." DNS Zone records:".print_a($text,true)); - e107::getMessage()->addinfo("Consider testing it using this website: http://dkimvalidator.com"); + e107::getMessage()->addInfo("Consider testing it using this website: http://dkimvalidator.com"); } @@ -1364,7 +1365,7 @@ class mailout_main_ui extends e_admin_ui $temp['sendmail'] = ''; } - $temp['bulkmailer'] = $_POST['bulkmailer']; + $temp['bulkmailer'] = $tp->filter($_POST['bulkmailer']); $temp['smtp_server'] = $tp->toDB($_POST['smtp_server']); $temp['smtp_username'] = $tp->toDB($_POST['smtp_username']); $temp['smtp_password'] = $tp->toDB($_POST['smtp_password']); @@ -1595,7 +1596,7 @@ class mailout_admin_form_ui extends e_admin_form_ui $text .= "".E_32_MAIL.""; $text .= "".E_32_SEARCH.""; - $text .= $this->renderValue('options',$value,$att,$id); + $text .= $this->renderValue('options',$value,$attributes,$id); return $text; } @@ -1609,9 +1610,9 @@ class mailout_admin_form_ui extends e_admin_form_ui $text = ""; $text .= "".E_32_USER.""; $text .= "".E_32_SEARCH.""; - - $att['readParms']['editClass'] = e_UC_NOBODY; - $text .= $this->renderValue('options',$value,$att,$id); + + $attributes['readParms']['editClass'] = e_UC_NOBODY; + $text .= $this->renderValue('options',$value,$attributes,$id); $text .= ""; return $text; } @@ -1681,7 +1682,7 @@ class mailout_recipients_ui extends e_admin_ui $id = $row['mail_detail_id']; $array[$id] = $id." : ".vartrue($row['mail_title'], "(No Name)"); } - $this->fields['mail_detail_id']['writeParms'] = $array; + $this->fields['mail_detail_id']['writeParms'] = varset($array, array()); $this->mailStatus = array( diff --git a/e107_handlers/mail.php b/e107_handlers/mail.php index 1707a2adf..81fa0835a 100644 --- a/e107_handlers/mail.php +++ b/e107_handlers/mail.php @@ -210,7 +210,7 @@ class e107Email extends PHPMailer $this->pref = $pref; $this->CharSet = 'utf-8'; - $this->SetLanguage(CORE_LC); + $this->setLanguage(CORE_LC); if (($overrides === FALSE) || !is_array($overrides)) @@ -279,14 +279,14 @@ class e107Email extends PHPMailer } unset($temp_opts); - $this->IsSMTP(); // Enable SMTP functions + $this->isSMTP(); // Enable SMTP functions if (vartrue($smtp_options['helo'])) $this->Helo = $smtp_options['helo']; if (isset($smtp_options['pop3auth'])) // We've made sure this is set { // Need POP-before-SMTP authorisation require_once(e_HANDLER.'phpmailer/class.pop3.php'); $pop = new POP3(); - $pop->Authorise($overrides['smtp_server'], 110, 30, $overrides['smtp_username'], $overrides['smtp_password'], 1); + $pop->authorise($overrides['smtp_server'], 110, 30, $overrides['smtp_username'], $overrides['smtp_password'], 1); } $this->Mailer = 'smtp'; @@ -509,29 +509,29 @@ class e107Email extends PHPMailer switch ($list) { case 'to' : - $this->AddAddress($adr, $to_name); + $this->addAddress($adr, $to_name); break; case 'replyto' : - $this->AddReplyTo($adr, $to_name); + $this->addReplyTo($adr, $to_name); break; case 'cc' : if($this->Mailer == 'mail') { - $this->AddCustomHeader('Cc: '.$adr); + $this->addCustomHeader('Cc: '.$adr); } else { - $this->AddCC($adr, $to_name); + $this->addCC($adr, $to_name); } break; case 'bcc' : if($this->Mailer == 'mail') { - $this->AddCustomHeader('Bcc: '.$adr); + $this->addCustomHeader('Bcc: '.$adr); } else { - $this->AddBCC($adr, $to_name); + $this->addBCC($adr, $to_name); } break; default : @@ -650,7 +650,7 @@ class e107Email extends PHPMailer else { $ext = pathinfo($attach, PATHINFO_EXTENSION); - $this->AddAttachment($attach, $tempName,'base64',$this->_mime_types($ext)); + $this->addAttachment($attach, $tempName,'base64',$this->_mime_types($ext)); } } @@ -677,7 +677,7 @@ class e107Email extends PHPMailer if(is_readable($inline_img) && !is_dir($inline_img)) { $ext = pathinfo($inline_img, PATHINFO_EXTENSION); - $this->AddEmbeddedImage($inline_img, md5($inline_img), basename($inline_img),'base64',$this->_mime_types($ext)); + $this->addEmbeddedImage($inline_img, md5($inline_img), basename($inline_img),'base64',$this->_mime_types($ext)); } } } @@ -906,7 +906,7 @@ class e107Email extends PHPMailer if (!empty($eml['returnreceipt'])) { $this->ConfirmReadingTo = $eml['returnreceipt']; } if (!empty($eml['inline_images'])) { $this->addInlineImages($eml['inline_images']); } if (!empty($eml['priority'])) { $this->Priority = $eml['priority']; } - if (!empty($eml['e107_header'])) { $this->AddCustomHeader($identifier.": {$eml['e107_header']}"); } + if (!empty($eml['e107_header'])) { $this->addCustomHeader($identifier.": {$eml['e107_header']}"); } if (!empty($eml['wordwrap'])) { $this->WordWrap = $eml['wordwrap']; } if (!empty($eml['split'])) { $this->SingleTo = ($eml['split'] != FALSE); } if (!empty($eml['smtp_username'])) { $this->Username = $eml['smtp_username']; } @@ -1032,7 +1032,7 @@ class e107Email extends PHPMailer $_SERVER["HTTP_X_FORWARDED_FOR"] = $_SERVER['SERVER_ADDR']; $_SERVER["HTTP_CF_CONNECTING_IP"] = $_SERVER['SERVER_ADDR']; - $result = $this->Send(); // Actually send email + $result = $this->send(); // Actually send email $_SERVER['PHP_SELF'] = $oldphpself; @@ -1040,7 +1040,7 @@ class e107Email extends PHPMailer $_SERVER["HTTP_X_FORWARDED_FOR"] = $oldremoteaddr; $_SERVER["HTTP_CF_CONNECTING_IP"] = $oldremoteaddr; - if (!$bulkmail && !$this->SMTPKeepAlive && ($this->Mailer == 'smtp')) $this->SmtpClose(); + if (!$bulkmail && !$this->SMTPKeepAlive && ($this->Mailer == 'smtp')) $this->smtpClose(); } else { // Debug @@ -1057,7 +1057,7 @@ class e107Email extends PHPMailer if (($bulkmail == true) && ($this->pause_amount > 0) && ($this->SendCount >= $this->pause_amount)) { - if ($this->SMTPKeepAlive && ($this->Mailer == 'smtp')) $this->SmtpClose(); + if ($this->SMTPKeepAlive && ($this->Mailer == 'smtp')) $this->smtpClose(); sleep($this->pause_time); $this->SendCount = 0; } @@ -1075,8 +1075,8 @@ class e107Email extends PHPMailer } - $this->ClearAddresses(); // In case we send another email - $this->ClearCustomHeaders(); + $this->clearAddresses(); // In case we send another email + $this->clearCustomHeaders(); if ($result) { @@ -1109,7 +1109,7 @@ class e107Email extends PHPMailer { if ($this->SMTPKeepAlive && ($this->Mailer == 'smtp') && ($this->SendCount > 0)) { - $this->SmtpClose(); + $this->smtpClose(); $this->SendCount = 0; } } @@ -1195,7 +1195,7 @@ class e107Email extends PHPMailer if ( (strlen($basedir) > 1) && (substr($basedir,-1) != '/') && (substr($basedir,-1) != '\\')) { $basedir .= '/'; } if ( strlen($directory) > 1 && substr($directory,-1) != '/' && substr($directory,-1) != '\\') { $directory .= '/'; } //echo "Add image: {$basedir}|{$directory}|{$filename}
"; - if ( $this->AddEmbeddedImage($basedir.$directory.$filename, md5($filename), $filename, 'base64',$mimeType) ) + if ( $this->addEmbeddedImage($basedir.$directory.$filename, md5($filename), $filename, 'base64',$mimeType) ) { // $images[1][$i] contains 'src' or 'background' $message = preg_replace("/".$images[1][$i]."=".$delim.preg_quote($images[3][$i], '/').$delim."/Ui", $images[1][$i]."=".$delim.$cid.$delim, $message); @@ -1226,7 +1226,7 @@ class e107Email extends PHPMailer } - $this->IsHTML(true); + $this->isHTML(true); $this->Body = $message; //print_a($message); $textMsg = str_replace("\n", "", $message); @@ -1355,7 +1355,7 @@ function sendemail($send_to, $subject, $message, $to_name='', $send_from='', $fr $identifier = deftrue('MAIL_IDENTIFIER', 'X-e107-id'); - if (vartrue($mailheader_e107id)) $mail->AddCustomHeader($identifier.": {$mailheader_e107id}"); + if (vartrue($mailheader_e107id)) $mail->addCustomHeader($identifier.": {$mailheader_e107id}"); $mail->legacyBody = TRUE; // Need to handle plain text email conversion to HTML $mail->makeBody($message); // Add body, with conversion if required @@ -1366,7 +1366,7 @@ function sendemail($send_to, $subject, $message, $to_name='', $send_from='', $fr if (trim($send_from)) { - $mail->SetFrom($send_from, $from_name); // These have already been defaulted to sitewide options, so no need to set again if blank + $mail->setFrom($send_from, $from_name); // These have already been defaulted to sitewide options, so no need to set again if blank } $mail->Subject = $subject;