From a55b67d965e4560fcd4f285b833321507aa034f4 Mon Sep 17 00:00:00 2001 From: corentinheadoo Date: Mon, 17 Oct 2016 16:38:25 +0200 Subject: [PATCH 1/3] Fix: function call is not case-sensitive (#857) --- class.phpmaileroauth.php | 1 + class.smtp.php | 6 +++--- extras/htmlfilter.php | 2 +- extras/ntlm_sasl_client.php | 4 ++-- test/phpmailerTest.php | 6 +++--- 5 files changed, 10 insertions(+), 9 deletions(-) diff --git a/class.phpmaileroauth.php b/class.phpmaileroauth.php index f9cd7b42..b1bb09f0 100644 --- a/class.phpmaileroauth.php +++ b/class.phpmaileroauth.php @@ -80,6 +80,7 @@ class PHPMailerOAuth extends PHPMailer * @uses SMTP * @access public * @return bool + * @throws phpmailerException */ public function smtpConnect($options = array()) { diff --git a/class.smtp.php b/class.smtp.php index f259df6d..9bb970d8 100644 --- a/class.smtp.php +++ b/class.smtp.php @@ -477,7 +477,7 @@ class SMTP $temp = new stdClass; $ntlm_client = new ntlm_sasl_client_class; //Check that functions are available - if (!$ntlm_client->Initialize($temp)) { + if (!$ntlm_client->initialize($temp)) { $this->setError($temp->error); $this->edebug( 'You need to enable some modules in your php.ini file: ' @@ -487,7 +487,7 @@ class SMTP return false; } //msg1 - $msg1 = $ntlm_client->TypeMsg1($realm, $workstation); //msg1 + $msg1 = $ntlm_client->typeMsg1($realm, $workstation); //msg1 if (!$this->sendCommand( 'AUTH NTLM', @@ -506,7 +506,7 @@ class SMTP $password ); //msg3 - $msg3 = $ntlm_client->TypeMsg3( + $msg3 = $ntlm_client->typeMsg3( $ntlm_res, $username, $realm, diff --git a/extras/htmlfilter.php b/extras/htmlfilter.php index 5ac7d13c..102e848c 100644 --- a/extras/htmlfilter.php +++ b/extras/htmlfilter.php @@ -901,7 +901,7 @@ function tln_sanitize( } $trusted .= tln_tagprint($tagname, $attary, $tagtype); $trusted .= $free_content; - $trusted .= tln_tagprint($tagname, false, 2); + $trusted .= tln_tagprint($tagname, null, 2); } continue; } diff --git a/extras/ntlm_sasl_client.php b/extras/ntlm_sasl_client.php index 4a085614..3fd53924 100644 --- a/extras/ntlm_sasl_client.php +++ b/extras/ntlm_sasl_client.php @@ -160,12 +160,12 @@ class ntlm_sasl_client_class { switch ($this->state) { case SASL_NTLM_STATE_IDENTIFY_DOMAIN: - $message = $this->TypeMsg1($this->credentials["realm"], $this->credentials["workstation"]); + $message = $this->typeMsg1($this->credentials["realm"], $this->credentials["workstation"]); $this->state = SASL_NTLM_STATE_RESPOND_CHALLENGE; break; case SASL_NTLM_STATE_RESPOND_CHALLENGE: $ntlm_response = $this->NTLMResponse(substr($response, 24, 8), $this->credentials["password"]); - $message = $this->TypeMsg3( + $message = $this->typeMsg3( $ntlm_response, $this->credentials["user"], $this->credentials["realm"], diff --git a/test/phpmailerTest.php b/test/phpmailerTest.php index 50450749..87575b88 100644 --- a/test/phpmailerTest.php +++ b/test/phpmailerTest.php @@ -1264,12 +1264,12 @@ EOT; //Only run if we have qmail installed if (file_exists('/var/qmail/bin/qmail-inject')) { $this->Mail->Body = 'Sending via qmail'; - $this->BuildBody(); + $this->buildBody(); $subject = $this->Mail->Subject; $this->Mail->Subject = $subject . ': qmail'; - $this->Mail->IsQmail(); - $this->assertTrue($this->Mail->Send(), $this->Mail->ErrorInfo); + $this->Mail->isQmail(); + $this->assertTrue($this->Mail->send(), $this->Mail->ErrorInfo); } else { $this->markTestSkipped('Qmail is not installed'); } From 66cf4fbaff4498fc9922eb34a018d8b129945415 Mon Sep 17 00:00:00 2001 From: corentinheadoo Date: Mon, 17 Oct 2016 18:17:18 +0200 Subject: [PATCH 2/3] Cleaning js (#858) * Clean some js file * Cleaning code --- examples/scripts/shLegacy.js | 11 +++++------ extras/htmlfilter.php | 9 +-------- 2 files changed, 6 insertions(+), 14 deletions(-) diff --git a/examples/scripts/shLegacy.js b/examples/scripts/shLegacy.js index 35c582c9..2fd2c145 100644 --- a/examples/scripts/shLegacy.js +++ b/examples/scripts/shLegacy.js @@ -23,24 +23,23 @@ dp.SyntaxHighlighter = { return match.value; return null; - }; + } function defaultValue(value, def) { return value != null ? value : def; - }; + } function asString(value) { return value != null ? value.toString() : null; - }; + } var parts = input.split(':'), brushName = parts[0], options = {}, - straight = { 'true' : true } + straight = { 'true' : true }, reverse = { 'true' : false }, - result = null, defaults = SyntaxHighlighter.defaults ; @@ -89,7 +88,7 @@ dp.SyntaxHighlighter = { } return null; - }; + } function findTagsByName(list, name, tagName) { diff --git a/extras/htmlfilter.php b/extras/htmlfilter.php index 102e848c..7727487e 100644 --- a/extras/htmlfilter.php +++ b/extras/htmlfilter.php @@ -461,7 +461,6 @@ function tln_deent(&$attvalue, $regex, $hex = false) * checks on them. * * @param string $attvalue A string to run entity check against. - * @return Void, modifies a reference value. */ function tln_defang(&$attvalue) { @@ -488,7 +487,6 @@ function tln_defang(&$attvalue) * be funny to make "java[tab]script" be just as good as "javascript". * * @param string $attvalue The attribute value before extraneous spaces removed. - * @return Void, modifies a reference value. */ function tln_unspace(&$attvalue) { @@ -511,7 +509,7 @@ function tln_unspace(&$attvalue) * @param array $add_attr_to_tag See description for tln_sanitize * @param string $trans_image_path * @param boolean $block_external_images - * @return Array with modified attributes. + * @return array with modified attributes. */ function tln_fixatts( $tagname, @@ -667,9 +665,7 @@ function tln_fixurl($attname, &$attvalue, $trans_image_path, $block_external_ima function tln_fixstyle($body, $pos, $trans_image_path, $block_external_images) { - $me = 'tln_fixstyle'; // workaround for in between comments - $iCurrentPos = $pos; $content = ''; $sToken = ''; $bSucces = false; @@ -740,8 +736,6 @@ function tln_fixstyle($body, $pos, $trans_image_path, $block_external_images) */ $content = preg_replace("|body(\s*\{.*?\})|si", ".bodyclass\\1", $content); - $trans_image_path = $trans_image_path; - /** * Fix url('blah') declarations. */ @@ -796,7 +790,6 @@ function tln_fixstyle($body, $pos, $trans_image_path, $block_external_images) function tln_body2div($attary, $trans_image_path) { - $me = 'tln_body2div'; $divattary = array('class' => "'bodyclass'"); $text = '#000000'; $has_bgc_stl = $has_txt_stl = false; From a4de1ca5efeebf155a2a0a17840c19ac53555dee Mon Sep 17 00:00:00 2001 From: Marcus Bointon Date: Mon, 17 Oct 2016 18:21:50 +0200 Subject: [PATCH 3/3] Pass level of current debug message rather than output setting into display function --- class.smtp.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/class.smtp.php b/class.smtp.php index 9bb970d8..b5a7ccc0 100644 --- a/class.smtp.php +++ b/class.smtp.php @@ -206,7 +206,7 @@ class SMTP } //Avoid clash with built-in function names if (!in_array($this->Debugoutput, array('error_log', 'html', 'echo')) and is_callable($this->Debugoutput)) { - call_user_func($this->Debugoutput, $str, $this->do_debug); + call_user_func($this->Debugoutput, $str, $level); return; } switch ($this->Debugoutput) {