Author: Niklas Keller (kelunik)
Date: 2021-04-08T14:39:08+02:00

Commit: 
https://github.com/php/web-wiki/commit/d97329f47f507e79239d16611046d2e97ca1746c
Raw diff: 
https://github.com/php/web-wiki/commit/d97329f47f507e79239d16611046d2e97ca1746c.diff

Upgrade smtp plugin

Changed paths:
  A  dokuwiki/lib/plugins/smtp/lang/es/intro.txt
  A  dokuwiki/lib/plugins/smtp/lang/es/lang.php
  A  dokuwiki/lib/plugins/smtp/lang/es/settings.php
  M  dokuwiki/lib/plugins/smtp/.travis.yml
  M  dokuwiki/lib/plugins/smtp/_test/message.test.php
  M  dokuwiki/lib/plugins/smtp/classes/Message.php
  M  dokuwiki/lib/plugins/smtp/lang/de/intro.txt
  M  dokuwiki/lib/plugins/smtp/lang/de/lang.php
  M  dokuwiki/lib/plugins/smtp/lang/de/settings.php
  M  dokuwiki/lib/plugins/smtp/plugin.info.txt


Diff:

diff --git a/dokuwiki/lib/plugins/smtp/.travis.yml 
b/dokuwiki/lib/plugins/smtp/.travis.yml
index 03fce1e9..86353a71 100644
--- a/dokuwiki/lib/plugins/smtp/.travis.yml
+++ b/dokuwiki/lib/plugins/smtp/.travis.yml
@@ -2,14 +2,14 @@
 
 language: php
 php:
+  - "7.3"
+  - "7.2"
+  - "7.1"
   - "7.0"
   - "5.6"
-  - "5.5"
-  - "5.4"
-  - "5.3"
 env:
   - DOKUWIKI=master
   - DOKUWIKI=stable
 before_install: wget 
https://raw.github.com/splitbrain/dokuwiki-travis/master/travis.sh
 install: sh travis.sh
-script: cd _test && phpunit --stderr --group plugin_smtp
+script: cd _test && ./phpunit.phar --stderr --group plugin_smtp
diff --git a/dokuwiki/lib/plugins/smtp/_test/message.test.php 
b/dokuwiki/lib/plugins/smtp/_test/message.test.php
index de69c2ba..ba68daf2 100644
--- a/dokuwiki/lib/plugins/smtp/_test/message.test.php
+++ b/dokuwiki/lib/plugins/smtp/_test/message.test.php
@@ -1,49 +1,53 @@
 <?php
+
 /**
  * General tests for the smtp plugin
  *
  * @group plugin_smtp
  * @group plugins
  */
-class message_plugin_smtp_test extends DokuWikiTest {
-    public function setUp() {
+class message_plugin_smtp_test extends DokuWikiTest
+{
+    public function setUp()
+    {
         parent::setUp();
         require_once __DIR__ . '/../loader.php';
     }
 
-    public function test_body() {
-        $input = trim('
-X-Mailer: DokuWiki
-X-Dokuwiki-User: admin
-X-Dokuwiki-Title: Test Wiki
-X-Dokuwiki-Server: localhost.localhost
-From: [email protected]
-To: [email protected]
-Bcc: [email protected], [email protected],
-    [email protected]
-Subject: A test
-
-This is the body of the mail
-Bcc: this is not a header line
-end of message
-');
-
-        $expect = trim('
-X-Mailer: DokuWiki
-X-Dokuwiki-User: admin
-X-Dokuwiki-Title: Test Wiki
-X-Dokuwiki-Server: localhost.localhost
-From: [email protected]
-To: [email protected]
-Subject: A test
+    public function test_body()
+    {
+        $input = join("\r\n", [
+            'X-Mailer: DokuWiki',
+            'X-Dokuwiki-User: admin',
+            'X-Dokuwiki-Title: Test Wiki',
+            'X-Dokuwiki-Server: localhost.localhost',
+            'From: [email protected]',
+            'To: [email protected]',
+            'Bcc: [email protected], [email protected],',
+            '     [email protected]',
+            'Subject: A test',
+            '',
+            'This is the body of the mail',
+            'Bcc: this is not a header line',
+            'end of message',
+        ]);
 
-This is the body of the mail
-Bcc: this is not a header line
-end of message
-');
+        $expect = join("\r\n", [
+            'X-Mailer: DokuWiki',
+            'X-Dokuwiki-User: admin',
+            'X-Dokuwiki-Title: Test Wiki',
+            'X-Dokuwiki-Server: localhost.localhost',
+            'From: [email protected]',
+            'To: [email protected]',
+            'Subject: A test',
+            '',
+            'This is the body of the mail',
+            'Bcc: this is not a header line',
+            'end of message',
+        ]);
         $expect .= "\r\n\r\n.\r\n";
 
-        $message = new \splitbrain\dokuwiki\plugin\smtp\Message('','',$input);
+        $message = new \splitbrain\dokuwiki\plugin\smtp\Message('', '', 
$input);
 
         $this->assertEquals($expect, $message->toString());
 
diff --git a/dokuwiki/lib/plugins/smtp/classes/Message.php 
b/dokuwiki/lib/plugins/smtp/classes/Message.php
index ee8e9fb8..db036477 100644
--- a/dokuwiki/lib/plugins/smtp/classes/Message.php
+++ b/dokuwiki/lib/plugins/smtp/classes/Message.php
@@ -73,7 +73,7 @@ public function getTo() {
      */
     public function toString() {
         // we need to remove the BCC header here
-        $lines = explode("\n", $this->body);
+        $lines = preg_split('/\r?\n/', $this->body);
         $count = count($lines);
         for($i=0; $i<$count; $i++) {
             if(trim($lines[$i]) === '') break; // end of headers, we're done
@@ -85,7 +85,7 @@ public function toString() {
                 break; // header removed, we're done
             }
         }
-        $body = join("\n", $lines);
+        $body = join($this->CRLF, $lines);
 
         return $body . $this->CRLF . $this->CRLF . "." . $this->CRLF;
     }
diff --git a/dokuwiki/lib/plugins/smtp/lang/de/intro.txt 
b/dokuwiki/lib/plugins/smtp/lang/de/intro.txt
index f6ae0c7d..43d02e9f 100644
--- a/dokuwiki/lib/plugins/smtp/lang/de/intro.txt
+++ b/dokuwiki/lib/plugins/smtp/lang/de/intro.txt
@@ -1,5 +1,5 @@
 ====== SMTP Test ======
 
-Auf dieser Seite kannst du eine Testmail von DokuWiki versenden. Diese kannst 
du verwenden um deine SMTP Konfiguration zu überprüfen.
+Auf dieser Seite können Sie eine Testmail über DokuWiki versenden, um die 
aktuelle SMTP Konfiguration zu überprüfen.
 
-Füge die E-Mailaddressen der Empfänger in das Formular ein.
+Bitte geben Sie die entsprechenden E-Mail-Adressen der Empfänger in das 
Formular ein.
diff --git a/dokuwiki/lib/plugins/smtp/lang/de/lang.php 
b/dokuwiki/lib/plugins/smtp/lang/de/lang.php
index 4970adc4..5998bc94 100644
--- a/dokuwiki/lib/plugins/smtp/lang/de/lang.php
+++ b/dokuwiki/lib/plugins/smtp/lang/de/lang.php
@@ -3,7 +3,8 @@
 /**
  * @license    GPL 2 (http://www.gnu.org/licenses/gpl.html)
  *
+ * @author Andreas Gohr <[email protected]>
  * @author Dominik Eckelmann <[email protected]>
  */
-$lang['menu']                  = 'Überprüfe SMTP Konfiguration';
+$lang['menu']                  = 'SMTP Konfiguration überprüfen';
 $lang['nofrom']                = 'Sie haben die "mailfrom" Option nicht 
gesetzt. Der E-Mail Versand wird deshalb vermutlich fehlschlagen.';
diff --git a/dokuwiki/lib/plugins/smtp/lang/de/settings.php 
b/dokuwiki/lib/plugins/smtp/lang/de/settings.php
index 1c3e5b64..4c2e1129 100644
--- a/dokuwiki/lib/plugins/smtp/lang/de/settings.php
+++ b/dokuwiki/lib/plugins/smtp/lang/de/settings.php
@@ -3,15 +3,16 @@
 /**
  * @license    GPL 2 (http://www.gnu.org/licenses/gpl.html)
  *
+ * @author Andreas Gohr <[email protected]>
  * @author Dominik Eckelmann <[email protected]>
  */
-$lang['smtp_host']             = 'Dein ausgehender SMTP Server';
-$lang['smtp_port']             = 'Der Port deines SMTP Servers (Standard 25 
oder 465 für SSL)';
-$lang['smtp_ssl']              = 'Welche Verschlüsslung wird bei der 
Kommunikation mit deinem SMTP Server verwendet.';
-$lang['smtp_ssl_o_']          = 'Keine';
-$lang['smtp_ssl_o_ssl']          = 'SSL';
-$lang['smtp_ssl_o_tls']          = 'TLS';
-$lang['auth_user']             = 'Trage hier den Benutzernamen ein, falls eine 
Anmeldung am STMP Server erforderlich ist.';
-$lang['auth_pass']             = 'Passwort für den Benutzer darüber.';
-$lang['localdomain']           = 'Füge hier den namen, welcher während des 
HELO Aufrufes von SMTP verwendet werden soll. Dies sollte der FQDN deines 
DokuWiki Webservers sein. Wenn du es Leer lässt wird DokuWiki versuchen es 
selbst zu ermitteln.';
-$lang['debug']                 = 'Kompletten Fehlerbericht ausgeben wenn das 
Versenden fehlschlägt. Deaktiviere es wenn das Versenden Funktioniert.';
+$lang['smtp_host']             = 'Ihr ausgehender SMTP Server';
+$lang['smtp_port']             = 'Der Port Ihres SMTP Servers (Standard 25 
oder 465 für SSL)';
+$lang['smtp_ssl']              = 'Welche Verschlüsslung wird bei der 
Kommunikation mit dem SMTP Server verwendet?';
+$lang['smtp_ssl_o_']           = 'Keine';
+$lang['smtp_ssl_o_ssl']        = 'SSL';
+$lang['smtp_ssl_o_tls']        = 'TLS';
+$lang['auth_user']             = 'Tragen Sie hier den Benutzernamen ein, falls 
eine Anmeldung am SMTP Server erforderlich ist.';
+$lang['auth_pass']             = 'Passwort für den obenstehenden Benutzer.';
+$lang['localdomain']           = 'Fügen Sie hier den Namen ein, welcher 
während des HELO Aufrufes von SMTP verwendet werden soll. Dies sollte der FQDN 
Ihres DokuWiki Webservers sein. Wenn das Feld leer gelassen wird, wird DokuWiki 
versuchen es selbst zu ermitteln.';
+$lang['debug']                 = 'Kompletten Fehlerbericht ausgeben wenn das 
Versenden fehlschlägt. Deaktiviere sobald das Versenden funktioniert!';
diff --git a/dokuwiki/lib/plugins/smtp/lang/es/intro.txt 
b/dokuwiki/lib/plugins/smtp/lang/es/intro.txt
new file mode 100644
index 00000000..ba9ccacf
--- /dev/null
+++ b/dokuwiki/lib/plugins/smtp/lang/es/intro.txt
@@ -0,0 +1,5 @@
+====== Probando SMTP ======
+
+Esta página permite iniciar el envío de un correo de prueba en DokuWiki.  
Puedes usarlo para verificar que el módulo de programa SMTP esté configurado 
correctamente.
+
+Anota las direcciones de correo electrónico de recepción en la forma siguiente.
\ No newline at end of file
diff --git a/dokuwiki/lib/plugins/smtp/lang/es/lang.php 
b/dokuwiki/lib/plugins/smtp/lang/es/lang.php
new file mode 100644
index 00000000..0e14347e
--- /dev/null
+++ b/dokuwiki/lib/plugins/smtp/lang/es/lang.php
@@ -0,0 +1,9 @@
+<?php
+
+/**
+ * @license    GPL 2 (http://www.gnu.org/licenses/gpl.html)
+ *
+ * @author Alicia Esponda <[email protected]>
+ */
+$lang['menu']                  = 'Verifica la configuración SMTP';
+$lang['nofrom']                = 'No configuraste la opción "correo de envío". 
 Probablemente fallará el envío de correos electrónicos.';
diff --git a/dokuwiki/lib/plugins/smtp/lang/es/settings.php 
b/dokuwiki/lib/plugins/smtp/lang/es/settings.php
new file mode 100644
index 00000000..19b40acf
--- /dev/null
+++ b/dokuwiki/lib/plugins/smtp/lang/es/settings.php
@@ -0,0 +1,17 @@
+<?php
+
+/**
+ * @license    GPL 2 (http://www.gnu.org/licenses/gpl.html)
+ *
+ * @author Alicia Esponda <[email protected]>
+ */
+$lang['smtp_host']             = 'Servidor de SMTP saliente.';
+$lang['smtp_port']             = 'El puerto de escucha del servidor SMTP.  
Usualmente 25. 465 para SSL';
+$lang['smtp_ssl']              = '¿Qué tipo de cifrado se utiliza para 
comunicarse con el servidor SMTP?';
+$lang['smtp_ssl_o_']           = 'ninguno';
+$lang['smtp_ssl_o_ssl']        = 'SSL';
+$lang['smtp_ssl_o_tls']        = 'TLS';
+$lang['auth_user']             = 'Si requiere autenticación, escriba el nombre 
de usuario aquí';
+$lang['auth_pass']             = 'Contraseña para el usuario anterior';
+$lang['localdomain']           = 'El nombre usado durante la fase HELO de 
SMTP.  Debe ser la FWDN del servidor web en el que está ejecutándose DokuWiki.  
Deje en blanco para autodetección.';
+$lang['debug']                 = '¿Se imprime una bitácora de error completa 
cuando falle el envío? ¡Deshabilite cuando todo funcione!';
diff --git a/dokuwiki/lib/plugins/smtp/plugin.info.txt 
b/dokuwiki/lib/plugins/smtp/plugin.info.txt
index 5d1ab1fd..4cf84cd9 100644
--- a/dokuwiki/lib/plugins/smtp/plugin.info.txt
+++ b/dokuwiki/lib/plugins/smtp/plugin.info.txt
@@ -1,7 +1,7 @@
 base   smtp
 author Andreas Gohr
 email  [email protected]
-date   2017-08-03
+date   2020-11-21
 name   smtp plugin
 desc   Send mails via a configured SMTP server
 url    https://www.dokuwiki.org/plugin:smtp

-- 
PHP Webmaster List Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to