diff --git a/.gitignore b/.gitignore index 28c19a2..19f2280 100644 --- a/.gitignore +++ b/.gitignore @@ -17,8 +17,9 @@ /cms/dflip/ /cms/js/firstlevel/ /conlite/external/**/.git -/dievino/ /conlite/logs/debug.log /cms/data/config/production/config.mod_rewrite.php /cms/data/config/production/config.local.php /cms/cache/* +composer.phar +/conlite/vendor/ diff --git a/.gitmodules b/.gitmodules index 11e4711..2931201 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,6 +1,3 @@ -[submodule "conlite/plugins/cl-mod-rewrite"] - path = conlite/plugins/cl-mod-rewrite - url = https://gitport.de/ConLite/cl-mod-rewrite.git [submodule "conlite/plugins/cl-newsletter"] path = conlite/plugins/cl-newsletter url = https://gitport.de/ConLite/cl-newsletter.git diff --git a/.idea/ConLite.iml b/.idea/ConLite.iml new file mode 100644 index 0000000..acfbd0f --- /dev/null +++ b/.idea/ConLite.iml @@ -0,0 +1,64 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/GitLink.xml b/.idea/GitLink.xml new file mode 100644 index 0000000..5143819 --- /dev/null +++ b/.idea/GitLink.xml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/.idea/clphp8.iml b/.idea/clphp8.iml new file mode 100644 index 0000000..b893c37 --- /dev/null +++ b/.idea/clphp8.iml @@ -0,0 +1,35 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/codeception.xml b/.idea/codeception.xml new file mode 100644 index 0000000..6f70668 --- /dev/null +++ b/.idea/codeception.xml @@ -0,0 +1,24 @@ + + + + + + \ No newline at end of file diff --git a/.idea/deployment.xml b/.idea/deployment.xml new file mode 100644 index 0000000..353c755 --- /dev/null +++ b/.idea/deployment.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml new file mode 100644 index 0000000..743b270 --- /dev/null +++ b/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/php.xml b/.idea/php.xml index 8894fa4..3cf5a81 100644 --- a/.idea/php.xml +++ b/.idea/php.xml @@ -14,31 +14,29 @@ - - - - - - - - - - - - - - - - - + + + + + - + + + + + + + + + + + diff --git a/.idea/phpspec.xml b/.idea/phpspec.xml new file mode 100644 index 0000000..c5034e9 --- /dev/null +++ b/.idea/phpspec.xml @@ -0,0 +1,22 @@ + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/phpunit.xml b/.idea/phpunit.xml index ebec75a..6f5a4c4 100644 --- a/.idea/phpunit.xml +++ b/.idea/phpunit.xml @@ -3,8 +3,9 @@ diff --git a/.idea/workspace.xml b/.idea/workspace.xml new file mode 100644 index 0000000..aeb022b --- /dev/null +++ b/.idea/workspace.xml @@ -0,0 +1,236 @@ + + + + + + + + + + + + $PROJECT_DIR$/composer.json + + + + + + + + + + + + + + + + + + + + + { + "keyToString": { + "RunOnceActivity.OpenProjectViewOnStart": "true", + "RunOnceActivity.ShowReadmeOnStart": "true", + "WebServerToolWindowFactoryState": "false", + "last_opened_file_path": "/var/www/html/clphp8/cms/data/modules/cl_contactform/php", + "node.js.detected.package.eslint": "true", + "node.js.detected.package.tslint": "true", + "node.js.selected.package.eslint": "(autodetect)", + "node.js.selected.package.tslint": "(autodetect)", + "nodejs_package_manager_path": "npm", + "settings.editor.selected.configurable": "preferences.pluginManager", + "vue.rearranger.settings.migration": "true" + } +} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1682358089636 + + + 1682442332378 + + + 1682442467699 + + + 1682442642783 + + + 1682445298959 + + + 1682445879204 + + + 1682446236100 + + + 1682446918410 + + + 1682450834252 + + + 1682513087275 + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Test will include two attachments.
- - -
-
- Mail Test Specs - - - - - -
Test Type -
- - - required> -
-
- - - required> -
-
- - - required> -
-
- - - required> -
-
-
"> - SMTP Specific Options: - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- -
- -
- -
- -
- - value="true"> -
- -
- -
-
-
-
-
- -
-
- -
- -
- - - - diff --git a/conlite/external/phpmailer/phpmailer/examples/contactform.phps b/conlite/external/phpmailer/phpmailer/examples/contactform.phps deleted file mode 100644 index d85e204..0000000 --- a/conlite/external/phpmailer/phpmailer/examples/contactform.phps +++ /dev/null @@ -1,71 +0,0 @@ -isSMTP(); - $mail->Host = 'localhost'; - $mail->Port = 25; - - //Use a fixed address in your own domain as the from address - //**DO NOT** use the submitter's address here as it will be forgery - //and will cause your messages to fail SPF checks - $mail->setFrom('from@example.com', 'First Last'); - //Send the message to yourself, or whoever should receive contact for submissions - $mail->addAddress('whoto@example.com', 'John Doe'); - //Put the submitter's address in a reply-to header - //This will fail if the address provided is invalid, - //in which case we should ignore the whole request - if ($mail->addReplyTo($_POST['email'], $_POST['name'])) { - $mail->Subject = 'PHPMailer contact form'; - //Keep it simple - don't use HTML - $mail->isHTML(false); - //Build a simple message body - $mail->Body = <<send()) { - //The reason for failing to send will be in $mail->ErrorInfo - //but you shouldn't display errors to users - process the error, log it on your server. - $msg = 'Sorry, something went wrong. Please try again later.'; - } else { - $msg = 'Message sent! Thanks for contacting us.'; - } - } else { - $msg = 'Invalid email address, message ignored.'; - } -} -?> - - - - - Contact form - - -

Contact us

-$msg"; -} ?> -
-
-
-
- -
- - diff --git a/conlite/external/phpmailer/phpmailer/examples/contents.html b/conlite/external/phpmailer/phpmailer/examples/contents.html deleted file mode 100644 index dc3fc66..0000000 --- a/conlite/external/phpmailer/phpmailer/examples/contents.html +++ /dev/null @@ -1,17 +0,0 @@ - - - - - PHPMailer Test - - -
-

This is a test of PHPMailer.

-
- PHPMailer rocks -
-

This example uses HTML.

-

ISO-8859-1 text:

-
- - diff --git a/conlite/external/phpmailer/phpmailer/examples/contentsutf8.html b/conlite/external/phpmailer/phpmailer/examples/contentsutf8.html deleted file mode 100644 index 035d10c..0000000 --- a/conlite/external/phpmailer/phpmailer/examples/contentsutf8.html +++ /dev/null @@ -1,21 +0,0 @@ - - - - - PHPMailer Test - - -
-

This is a test of PHPMailer.

-
- PHPMailer rocks -
-

This example uses HTML.

-

Chinese text: 郵件內容為空

-

Russian text: Пустое тело сообщения

-

Armenian text: Հաղորդագրությունը դատարկ է

-

Czech text: Prázdné tělo zprávy

-

Emoji: 😂 🦄 💥 📤 📧

-
- - diff --git a/conlite/external/phpmailer/phpmailer/examples/exceptions.phps b/conlite/external/phpmailer/phpmailer/examples/exceptions.phps deleted file mode 100644 index 0e941e7..0000000 --- a/conlite/external/phpmailer/phpmailer/examples/exceptions.phps +++ /dev/null @@ -1,35 +0,0 @@ -setFrom('from@example.com', 'First Last'); - //Set an alternative reply-to address - $mail->addReplyTo('replyto@example.com', 'First Last'); - //Set who the message is to be sent to - $mail->addAddress('whoto@example.com', 'John Doe'); - //Set the subject line - $mail->Subject = 'PHPMailer Exceptions test'; - //Read an HTML message body from an external file, convert referenced images to embedded, - //and convert the HTML into a basic plain-text alternative body - $mail->msgHTML(file_get_contents('contents.html'), dirname(__FILE__)); - //Replace the plain text body with one created manually - $mail->AltBody = 'This is a plain-text message body'; - //Attach an image file - $mail->addAttachment('images/phpmailer_mini.png'); - //send the message - //Note that we don't need check the response from this because it will throw an exception if it has trouble - $mail->send(); - echo "Message sent!"; -} catch (phpmailerException $e) { - echo $e->errorMessage(); //Pretty error messages from PHPMailer -} catch (Exception $e) { - echo $e->getMessage(); //Boring error messages from anything else! -} diff --git a/conlite/external/phpmailer/phpmailer/examples/gmail.phps b/conlite/external/phpmailer/phpmailer/examples/gmail.phps deleted file mode 100644 index 121ca70..0000000 --- a/conlite/external/phpmailer/phpmailer/examples/gmail.phps +++ /dev/null @@ -1,99 +0,0 @@ -isSMTP(); - -//Enable SMTP debugging -// 0 = off (for production use) -// 1 = client messages -// 2 = client and server messages -$mail->SMTPDebug = 2; - -//Ask for HTML-friendly debug output -$mail->Debugoutput = 'html'; - -//Set the hostname of the mail server -$mail->Host = 'smtp.gmail.com'; -// use -// $mail->Host = gethostbyname('smtp.gmail.com'); -// if your network does not support SMTP over IPv6 - -//Set the SMTP port number - 587 for authenticated TLS, a.k.a. RFC4409 SMTP submission -$mail->Port = 587; - -//Set the encryption system to use - ssl (deprecated) or tls -$mail->SMTPSecure = 'tls'; - -//Whether to use SMTP authentication -$mail->SMTPAuth = true; - -//Username to use for SMTP authentication - use full email address for gmail -$mail->Username = "username@gmail.com"; - -//Password to use for SMTP authentication -$mail->Password = "yourpassword"; - -//Set who the message is to be sent from -$mail->setFrom('from@example.com', 'First Last'); - -//Set an alternative reply-to address -$mail->addReplyTo('replyto@example.com', 'First Last'); - -//Set who the message is to be sent to -$mail->addAddress('whoto@example.com', 'John Doe'); - -//Set the subject line -$mail->Subject = 'PHPMailer GMail SMTP test'; - -//Read an HTML message body from an external file, convert referenced images to embedded, -//convert HTML into a basic plain-text alternative body -$mail->msgHTML(file_get_contents('contents.html'), dirname(__FILE__)); - -//Replace the plain text body with one created manually -$mail->AltBody = 'This is a plain-text message body'; - -//Attach an image file -$mail->addAttachment('images/phpmailer_mini.png'); - -//send the message, check for errors -if (!$mail->send()) { - echo "Mailer Error: " . $mail->ErrorInfo; -} else { - echo "Message sent!"; - //Section 2: IMAP - //Uncomment these to save your message in the 'Sent Mail' folder. - #if (save_mail($mail)) { - # echo "Message saved!"; - #} -} - -//Section 2: IMAP -//IMAP commands requires the PHP IMAP Extension, found at: https://php.net/manual/en/imap.setup.php -//Function to call which uses the PHP imap_*() functions to save messages: https://php.net/manual/en/book.imap.php -//You can use imap_getmailboxes($imapStream, '/imap/ssl') to get a list of available folders or labels, this can -//be useful if you are trying to get this working on a non-Gmail IMAP server. -function save_mail($mail) { - //You can change 'Sent Mail' to any other folder or tag - $path = "{imap.gmail.com:993/imap/ssl}[Gmail]/Sent Mail"; - - //Tell your server to open an IMAP connection using the same username and password as you used for SMTP - $imapStream = imap_open($path, $mail->Username, $mail->Password); - - $result = imap_append($imapStream, $path, $mail->getSentMIMEMessage()); - imap_close($imapStream); - - return $result; -} diff --git a/conlite/external/phpmailer/phpmailer/examples/gmail_xoauth.phps b/conlite/external/phpmailer/phpmailer/examples/gmail_xoauth.phps deleted file mode 100644 index 2aec181..0000000 --- a/conlite/external/phpmailer/phpmailer/examples/gmail_xoauth.phps +++ /dev/null @@ -1,85 +0,0 @@ -isSMTP(); - -//Enable SMTP debugging -// 0 = off (for production use) -// 1 = client messages -// 2 = client and server messages -$mail->SMTPDebug = 0; - -//Ask for HTML-friendly debug output -$mail->Debugoutput = 'html'; - -//Set the hostname of the mail server -$mail->Host = 'smtp.gmail.com'; - -//Set the SMTP port number - 587 for authenticated TLS, a.k.a. RFC4409 SMTP submission -$mail->Port = 587; - -//Set the encryption system to use - ssl (deprecated) or tls -$mail->SMTPSecure = 'tls'; - -//Whether to use SMTP authentication -$mail->SMTPAuth = true; - -//Set AuthType -$mail->AuthType = 'XOAUTH2'; - -//User Email to use for SMTP authentication - user who gave consent to our app -$mail->oauthUserEmail = "from@gmail.com"; - -//Obtained From Google Developer Console -$mail->oauthClientId = "RANDOMCHARS-----duv1n2.apps.googleusercontent.com"; - -//Obtained From Google Developer Console -$mail->oauthClientSecret = "RANDOMCHARS-----lGyjPcRtvP"; - -//Obtained By running get_oauth_token.php after setting up APP in Google Developer Console. -//Set Redirect URI in Developer Console as [https/http]:////get_oauth_token.php -// eg: http://localhost/phpmail/get_oauth_token.php -$mail->oauthRefreshToken = "RANDOMCHARS-----DWxgOvPT003r-yFUV49TQYag7_Aod7y0"; - -//Set who the message is to be sent from -//For gmail, this generally needs to be the same as the user you logged in as -$mail->setFrom('from@example.com', 'First Last'); - -//Set who the message is to be sent to -$mail->addAddress('whoto@example.com', 'John Doe'); - -//Set the subject line -$mail->Subject = 'PHPMailer GMail SMTP test'; - -//Read an HTML message body from an external file, convert referenced images to embedded, -//convert HTML into a basic plain-text alternative body -$mail->msgHTML(file_get_contents('contents.html'), dirname(__FILE__)); - -//Replace the plain text body with one created manually -$mail->AltBody = 'This is a plain-text message body'; - -//Attach an image file -$mail->addAttachment('images/phpmailer_mini.png'); - -//send the message, check for errors -if (!$mail->send()) { - echo "Mailer Error: " . $mail->ErrorInfo; -} else { - echo "Message sent!"; -} diff --git a/conlite/external/phpmailer/phpmailer/examples/images/phpmailer.png b/conlite/external/phpmailer/phpmailer/examples/images/phpmailer.png deleted file mode 100644 index 9bdd83c..0000000 Binary files a/conlite/external/phpmailer/phpmailer/examples/images/phpmailer.png and /dev/null differ diff --git a/conlite/external/phpmailer/phpmailer/examples/images/phpmailer_mini.png b/conlite/external/phpmailer/phpmailer/examples/images/phpmailer_mini.png deleted file mode 100644 index e6915f4..0000000 Binary files a/conlite/external/phpmailer/phpmailer/examples/images/phpmailer_mini.png and /dev/null differ diff --git a/conlite/external/phpmailer/phpmailer/examples/index.html b/conlite/external/phpmailer/phpmailer/examples/index.html deleted file mode 100644 index bbb830d..0000000 --- a/conlite/external/phpmailer/phpmailer/examples/index.html +++ /dev/null @@ -1,48 +0,0 @@ - - - - - PHPMailer Examples - - -

PHPMailer code examplesPHPMailer logo

-

This folder contains a collection of examples of using PHPMailer.

-

About testing email sending

-

When working on email sending code you'll find yourself worrying about what might happen if all these test emails got sent to your mailing list. The solution is to use a fake mail server, one that acts just like the real thing, but just doesn't actually send anything out. Some offer web interfaces, feedback, logging, the ability to return specific error codes, all things that are useful for testing error handling, authentication etc. Here's a selection of mail testing tools you might like to try:

-
    -
  • FakeSMTP, a Java desktop app with the ability to show an SMTP log and save messages to a folder.
  • -
  • FakeEmail, a Python-based fake mail server with a web interface.
  • -
  • smtp-sink, part of the Postfix mail server, so you probably already have this installed. This is used in the Travis-CI configuration to run PHPMailer's unit tests.
  • -
  • smtp4dev, a dummy SMTP server for Windows.
  • -
  • fakesendmail.sh, part of PHPMailer's test setup, this is a shell script that emulates sendmail for testing 'mail' or 'sendmail' methods in PHPMailer.
  • -
  • msglint, not a mail server, the IETF's MIME structure analyser checks the formatting of your messages.
  • -
-
-

Security note

-

Before running these examples you'll need to rename them with '.php' extensions. They are supplied as '.phps' files which will usually be displayed with syntax highlighting by PHP instead of running them. This prevents potential security issues with running potential spam-gateway code if you happen to deploy these code examples on a live site - please don't do that! Similarly, don't leave your passwords in these files as they will be visible to the world!

-
-

code_generator.phps

-

This script is a simple code generator - fill in the form and hit submit, and it will use when you entered to email you a message, and will also generate PHP code using your settings that you can copy and paste to use in your own apps. If you need to get going quickly, this is probably the best place to start.

-

mail.phps

-

This script is a basic example which creates an email message from an external HTML file, creates a plain text body, sets various addresses, adds an attachment and sends the message. It uses PHP's built-in mail() function which is the simplest to use, but relies on the presence of a local mail server, something which is not usually available on Windows. If you find yourself in that situation, either install a local mail server, or use a remote one and send using SMTP instead.

-

exceptions.phps

-

The same as the mail example, but shows how to use PHPMailer's optional exceptions for error handling.

-

smtp.phps

-

A simple example sending using SMTP with authentication.

-

smtp_no_auth.phps

-

A simple example sending using SMTP without authentication.

-

sendmail.phps

-

A simple example using sendmail. Sendmail is a program (usually found on Linux/BSD, OS X and other UNIX-alikes) that can be used to submit messages to a local mail server without a lengthy SMTP conversation. It's probably the fastest sending mechanism, but lacks some error reporting features. There are sendmail emulators for most popular mail servers including postfix, qmail, exim etc.

-

gmail.phps

-

Submitting email via Google's Gmail service is a popular use of PHPMailer. It's much the same as normal SMTP sending, just with some specific settings, namely using TLS encryption, authentication is enabled, and it connects to the SMTP submission port 587 on the smtp.gmail.com host. This example does all that.

-

pop_before_smtp.phps

-

Before effective SMTP authentication mechanisms were available, it was common for ISPs to use POP-before-SMTP authentication. As it implies, you authenticate using the POP3 protocol (an older protocol now mostly replaced by the far superior IMAP), and then the SMTP server will allow send access from your IP address for a short while, usually 5-15 minutes. PHPMailer includes a POP3 protocol client, so it can carry out this sequence - it's just like a normal SMTP conversation (without authentication), but connects via POP first.

-

mailing_list.phps

-

This is a somewhat naïve example of sending similar emails to a list of different addresses. It sets up a PHPMailer instance using SMTP, then connects to a MySQL database to retrieve a list of recipients. The code loops over this list, sending email to each person using their info and marks them as sent in the database. It makes use of SMTP keepalive which saves reconnecting and re-authenticating between each message.

-
-

smtp_check.phps

-

This is an example showing how to use the SMTP class by itself (without PHPMailer) to check an SMTP connection.

-
-

Most of these examples use the 'example.com' domain. This domain is reserved by IANA for illustrative purposes, as documented in RFC 2606. Don't use made-up domains like 'mydomain.com' or 'somedomain.com' in examples as someone, somewhere, probably owns them!

- - diff --git a/conlite/external/phpmailer/phpmailer/examples/mail.phps b/conlite/external/phpmailer/phpmailer/examples/mail.phps deleted file mode 100644 index 8e129f4..0000000 --- a/conlite/external/phpmailer/phpmailer/examples/mail.phps +++ /dev/null @@ -1,31 +0,0 @@ -setFrom('from@example.com', 'First Last'); -//Set an alternative reply-to address -$mail->addReplyTo('replyto@example.com', 'First Last'); -//Set who the message is to be sent to -$mail->addAddress('whoto@example.com', 'John Doe'); -//Set the subject line -$mail->Subject = 'PHPMailer mail() test'; -//Read an HTML message body from an external file, convert referenced images to embedded, -//convert HTML into a basic plain-text alternative body -$mail->msgHTML(file_get_contents('contents.html'), dirname(__FILE__)); -//Replace the plain text body with one created manually -$mail->AltBody = 'This is a plain-text message body'; -//Attach an image file -$mail->addAttachment('images/phpmailer_mini.png'); - -//send the message, check for errors -if (!$mail->send()) { - echo "Mailer Error: " . $mail->ErrorInfo; -} else { - echo "Message sent!"; -} diff --git a/conlite/external/phpmailer/phpmailer/examples/mailing_list.phps b/conlite/external/phpmailer/phpmailer/examples/mailing_list.phps deleted file mode 100644 index 8644bb5..0000000 --- a/conlite/external/phpmailer/phpmailer/examples/mailing_list.phps +++ /dev/null @@ -1,59 +0,0 @@ -isSMTP(); -$mail->Host = 'smtp.example.com'; -$mail->SMTPAuth = true; -$mail->SMTPKeepAlive = true; // SMTP connection will not close after each email sent, reduces SMTP overhead -$mail->Port = 25; -$mail->Username = 'yourname@example.com'; -$mail->Password = 'yourpassword'; -$mail->setFrom('list@example.com', 'List manager'); -$mail->addReplyTo('list@example.com', 'List manager'); - -$mail->Subject = "PHPMailer Simple database mailing list test"; - -//Same body for all messages, so set this before the sending loop -//If you generate a different body for each recipient (e.g. you're using a templating system), -//set it inside the loop -$mail->msgHTML($body); -//msgHTML also sets AltBody, but if you want a custom one, set it afterwards -$mail->AltBody = 'To view the message, please use an HTML compatible email viewer!'; - -//Connect to the database and select the recipients from your mailing list that have not yet been sent to -//You'll need to alter this to match your database -$mysql = mysqli_connect('localhost', 'username', 'password'); -mysqli_select_db($mysql, 'mydb'); -$result = mysqli_query($mysql, 'SELECT full_name, email, photo FROM mailinglist WHERE sent = false'); - -foreach ($result as $row) { //This iterator syntax only works in PHP 5.4+ - $mail->addAddress($row['email'], $row['full_name']); - if (!empty($row['photo'])) { - $mail->addStringAttachment($row['photo'], 'YourPhoto.jpg'); //Assumes the image data is stored in the DB - } - - if (!$mail->send()) { - echo "Mailer Error (" . str_replace("@", "@", $row["email"]) . ') ' . $mail->ErrorInfo . '
'; - break; //Abandon sending - } else { - echo "Message sent to :" . $row['full_name'] . ' (' . str_replace("@", "@", $row['email']) . ')
'; - //Mark it as sent in the DB - mysqli_query( - $mysql, - "UPDATE mailinglist SET sent = true WHERE email = '" . - mysqli_real_escape_string($mysql, $row['email']) . "'" - ); - } - // Clear all addresses and attachments for next loop - $mail->clearAddresses(); - $mail->clearAttachments(); -} diff --git a/conlite/external/phpmailer/phpmailer/examples/pop_before_smtp.phps b/conlite/external/phpmailer/phpmailer/examples/pop_before_smtp.phps deleted file mode 100644 index 164dfe8..0000000 --- a/conlite/external/phpmailer/phpmailer/examples/pop_before_smtp.phps +++ /dev/null @@ -1,54 +0,0 @@ -isSMTP(); - //Enable SMTP debugging - // 0 = off (for production use) - // 1 = client messages - // 2 = client and server messages - $mail->SMTPDebug = 2; - //Ask for HTML-friendly debug output - $mail->Debugoutput = 'html'; - //Set the hostname of the mail server - $mail->Host = "mail.example.com"; - //Set the SMTP port number - likely to be 25, 465 or 587 - $mail->Port = 25; - //Whether to use SMTP authentication - $mail->SMTPAuth = false; - //Set who the message is to be sent from - $mail->setFrom('from@example.com', 'First Last'); - //Set an alternative reply-to address - $mail->addReplyTo('replyto@example.com', 'First Last'); - //Set who the message is to be sent to - $mail->addAddress('whoto@example.com', 'John Doe'); - //Set the subject line - $mail->Subject = 'PHPMailer POP-before-SMTP test'; - //Read an HTML message body from an external file, convert referenced images to embedded, - //and convert the HTML into a basic plain-text alternative body - $mail->msgHTML(file_get_contents('contents.html'), dirname(__FILE__)); - //Replace the plain text body with one created manually - $mail->AltBody = 'This is a plain-text message body'; - //Attach an image file - $mail->addAttachment('images/phpmailer_mini.png'); - //send the message - //Note that we don't need check the response from this because it will throw an exception if it has trouble - $mail->send(); - echo "Message sent!"; -} catch (phpmailerException $e) { - echo $e->errorMessage(); //Pretty error messages from PHPMailer -} catch (Exception $e) { - echo $e->getMessage(); //Boring error messages from anything else! -} diff --git a/conlite/external/phpmailer/phpmailer/examples/scripts/XRegExp.js b/conlite/external/phpmailer/phpmailer/examples/scripts/XRegExp.js deleted file mode 100644 index feb6679..0000000 --- a/conlite/external/phpmailer/phpmailer/examples/scripts/XRegExp.js +++ /dev/null @@ -1,664 +0,0 @@ -// XRegExp 1.5.1 -// (c) 2007-2012 Steven Levithan -// MIT License -// -// Provides an augmented, extensible, cross-browser implementation of regular expressions, -// including support for additional syntax, flags, and methods - -var XRegExp; - -if (XRegExp) { - // Avoid running twice, since that would break references to native globals - throw Error("can't load XRegExp twice in the same frame"); -} - -// Run within an anonymous function to protect variables and avoid new globals -(function (undefined) { - - //--------------------------------- - // Constructor - //--------------------------------- - - // Accepts a pattern and flags; returns a new, extended `RegExp` object. Differs from a native - // regular expression in that additional syntax and flags are supported and cross-browser - // syntax inconsistencies are ameliorated. `XRegExp(/regex/)` clones an existing regex and - // converts to type XRegExp - XRegExp = function (pattern, flags) { - var output = [], - currScope = XRegExp.OUTSIDE_CLASS, - pos = 0, - context, tokenResult, match, chr, regex; - - if (XRegExp.isRegExp(pattern)) { - if (flags !== undefined) - throw TypeError("can't supply flags when constructing one RegExp from another"); - return clone(pattern); - } - // Tokens become part of the regex construction process, so protect against infinite - // recursion when an XRegExp is constructed within a token handler or trigger - if (isInsideConstructor) - throw Error("can't call the XRegExp constructor within token definition functions"); - - flags = flags || ""; - context = { // `this` object for custom tokens - hasNamedCapture: false, - captureNames: [], - hasFlag: function (flag) {return flags.indexOf(flag) > -1;}, - setFlag: function (flag) {flags += flag;} - }; - - while (pos < pattern.length) { - // Check for custom tokens at the current position - tokenResult = runTokens(pattern, pos, currScope, context); - - if (tokenResult) { - output.push(tokenResult.output); - pos += (tokenResult.match[0].length || 1); - } else { - // Check for native multicharacter metasequences (excluding character classes) at - // the current position - if (match = nativ.exec.call(nativeTokens[currScope], pattern.slice(pos))) { - output.push(match[0]); - pos += match[0].length; - } else { - chr = pattern.charAt(pos); - if (chr === "[") - currScope = XRegExp.INSIDE_CLASS; - else if (chr === "]") - currScope = XRegExp.OUTSIDE_CLASS; - // Advance position one character - output.push(chr); - pos++; - } - } - } - - regex = RegExp(output.join(""), nativ.replace.call(flags, flagClip, "")); - regex._xregexp = { - source: pattern, - captureNames: context.hasNamedCapture ? context.captureNames : null - }; - return regex; - }; - - - //--------------------------------- - // Public properties - //--------------------------------- - - XRegExp.version = "1.5.1"; - - // Token scope bitflags - XRegExp.INSIDE_CLASS = 1; - XRegExp.OUTSIDE_CLASS = 2; - - - //--------------------------------- - // Private variables - //--------------------------------- - - var replacementToken = /\$(?:(\d\d?|[$&`'])|{([$\w]+)})/g, - flagClip = /[^gimy]+|([\s\S])(?=[\s\S]*\1)/g, // Nonnative and duplicate flags - quantifier = /^(?:[?*+]|{\d+(?:,\d*)?})\??/, - isInsideConstructor = false, - tokens = [], - // Copy native globals for reference ("native" is an ES3 reserved keyword) - nativ = { - exec: RegExp.prototype.exec, - test: RegExp.prototype.test, - match: String.prototype.match, - replace: String.prototype.replace, - split: String.prototype.split - }, - compliantExecNpcg = nativ.exec.call(/()??/, "")[1] === undefined, // check `exec` handling of nonparticipating capturing groups - compliantLastIndexIncrement = function () { - var x = /^/g; - nativ.test.call(x, ""); - return !x.lastIndex; - }(), - hasNativeY = RegExp.prototype.sticky !== undefined, - nativeTokens = {}; - - // `nativeTokens` match native multicharacter metasequences only (including deprecated octals, - // excluding character classes) - nativeTokens[XRegExp.INSIDE_CLASS] = /^(?:\\(?:[0-3][0-7]{0,2}|[4-7][0-7]?|x[\dA-Fa-f]{2}|u[\dA-Fa-f]{4}|c[A-Za-z]|[\s\S]))/; - nativeTokens[XRegExp.OUTSIDE_CLASS] = /^(?:\\(?:0(?:[0-3][0-7]{0,2}|[4-7][0-7]?)?|[1-9]\d*|x[\dA-Fa-f]{2}|u[\dA-Fa-f]{4}|c[A-Za-z]|[\s\S])|\(\?[:=!]|[?*+]\?|{\d+(?:,\d*)?}\??)/; - - - //--------------------------------- - // Public methods - //--------------------------------- - - // Lets you extend or change XRegExp syntax and create custom flags. This is used internally by - // the XRegExp library and can be used to create XRegExp plugins. This function is intended for - // users with advanced knowledge of JavaScript's regular expression syntax and behavior. It can - // be disabled by `XRegExp.freezeTokens` - XRegExp.addToken = function (regex, handler, scope, trigger) { - tokens.push({ - pattern: clone(regex, "g" + (hasNativeY ? "y" : "")), - handler: handler, - scope: scope || XRegExp.OUTSIDE_CLASS, - trigger: trigger || null - }); - }; - - // Accepts a pattern and flags; returns an extended `RegExp` object. If the pattern and flag - // combination has previously been cached, the cached copy is returned; otherwise the newly - // created regex is cached - XRegExp.cache = function (pattern, flags) { - var key = pattern + "/" + (flags || ""); - return XRegExp.cache[key] || (XRegExp.cache[key] = XRegExp(pattern, flags)); - }; - - // Accepts a `RegExp` instance; returns a copy with the `/g` flag set. The copy has a fresh - // `lastIndex` (set to zero). If you want to copy a regex without forcing the `global` - // property, use `XRegExp(regex)`. Do not use `RegExp(regex)` because it will not preserve - // special properties required for named capture - XRegExp.copyAsGlobal = function (regex) { - return clone(regex, "g"); - }; - - // Accepts a string; returns the string with regex metacharacters escaped. The returned string - // can safely be used at any point within a regex to match the provided literal string. Escaped - // characters are [ ] { } ( ) * + ? - . , \ ^ $ | # and whitespace - XRegExp.escape = function (str) { - return str.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&"); - }; - - // Accepts a string to search, regex to search with, position to start the search within the - // string (default: 0), and an optional Boolean indicating whether matches must start at-or- - // after the position or at the specified position only. This function ignores the `lastIndex` - // of the provided regex in its own handling, but updates the property for compatibility - XRegExp.execAt = function (str, regex, pos, anchored) { - var r2 = clone(regex, "g" + ((anchored && hasNativeY) ? "y" : "")), - match; - r2.lastIndex = pos = pos || 0; - match = r2.exec(str); // Run the altered `exec` (required for `lastIndex` fix, etc.) - if (anchored && match && match.index !== pos) - match = null; - if (regex.global) - regex.lastIndex = match ? r2.lastIndex : 0; - return match; - }; - - // Breaks the unrestorable link to XRegExp's private list of tokens, thereby preventing - // syntax and flag changes. Should be run after XRegExp and any plugins are loaded - XRegExp.freezeTokens = function () { - XRegExp.addToken = function () { - throw Error("can't run addToken after freezeTokens"); - }; - }; - - // Accepts any value; returns a Boolean indicating whether the argument is a `RegExp` object. - // Note that this is also `true` for regex literals and regexes created by the `XRegExp` - // constructor. This works correctly for variables created in another frame, when `instanceof` - // and `constructor` checks would fail to work as intended - XRegExp.isRegExp = function (o) { - return Object.prototype.toString.call(o) === "[object RegExp]"; - }; - - // Executes `callback` once per match within `str`. Provides a simpler and cleaner way to - // iterate over regex matches compared to the traditional approaches of subverting - // `String.prototype.replace` or repeatedly calling `exec` within a `while` loop - XRegExp.iterate = function (str, regex, callback, context) { - var r2 = clone(regex, "g"), - i = -1, match; - while (match = r2.exec(str)) { // Run the altered `exec` (required for `lastIndex` fix, etc.) - if (regex.global) - regex.lastIndex = r2.lastIndex; // Doing this to follow expectations if `lastIndex` is checked within `callback` - callback.call(context, match, ++i, str, regex); - if (r2.lastIndex === match.index) - r2.lastIndex++; - } - if (regex.global) - regex.lastIndex = 0; - }; - - // Accepts a string and an array of regexes; returns the result of using each successive regex - // to search within the matches of the previous regex. The array of regexes can also contain - // objects with `regex` and `backref` properties, in which case the named or numbered back- - // references specified are passed forward to the next regex or returned. E.g.: - // var xregexpImgFileNames = XRegExp.matchChain(html, [ - // {regex: /]+)>/i, backref: 1}, // tag attributes - // {regex: XRegExp('(?ix) \\s src=" (? [^"]+ )'), backref: "src"}, // src attribute values - // {regex: XRegExp("^http://xregexp\\.com(/[^#?]+)", "i"), backref: 1}, // xregexp.com paths - // /[^\/]+$/ // filenames (strip directory paths) - // ]); - XRegExp.matchChain = function (str, chain) { - return function recurseChain (values, level) { - var item = chain[level].regex ? chain[level] : {regex: chain[level]}, - regex = clone(item.regex, "g"), - matches = [], i; - for (i = 0; i < values.length; i++) { - XRegExp.iterate(values[i], regex, function (match) { - matches.push(item.backref ? (match[item.backref] || "") : match[0]); - }); - } - return ((level === chain.length - 1) || !matches.length) ? - matches : recurseChain(matches, level + 1); - }([str], 0); - }; - - - //--------------------------------- - // New RegExp prototype methods - //--------------------------------- - - // Accepts a context object and arguments array; returns the result of calling `exec` with the - // first value in the arguments array. the context is ignored but is accepted for congruity - // with `Function.prototype.apply` - RegExp.prototype.apply = function (context, args) { - return this.exec(args[0]); - }; - - // Accepts a context object and string; returns the result of calling `exec` with the provided - // string. the context is ignored but is accepted for congruity with `Function.prototype.call` - RegExp.prototype.call = function (context, str) { - return this.exec(str); - }; - - - //--------------------------------- - // Overridden native methods - //--------------------------------- - - // Adds named capture support (with backreferences returned as `result.name`), and fixes two - // cross-browser issues per ES3: - // - Captured values for nonparticipating capturing groups should be returned as `undefined`, - // rather than the empty string. - // - `lastIndex` should not be incremented after zero-length matches. - RegExp.prototype.exec = function (str) { - var match, name, r2, origLastIndex; - if (!this.global) - origLastIndex = this.lastIndex; - match = nativ.exec.apply(this, arguments); - if (match) { - // Fix browsers whose `exec` methods don't consistently return `undefined` for - // nonparticipating capturing groups - if (!compliantExecNpcg && match.length > 1 && indexOf(match, "") > -1) { - r2 = RegExp(this.source, nativ.replace.call(getNativeFlags(this), "g", "")); - // Using `str.slice(match.index)` rather than `match[0]` in case lookahead allowed - // matching due to characters outside the match - nativ.replace.call((str + "").slice(match.index), r2, function () { - for (var i = 1; i < arguments.length - 2; i++) { - if (arguments[i] === undefined) - match[i] = undefined; - } - }); - } - // Attach named capture properties - if (this._xregexp && this._xregexp.captureNames) { - for (var i = 1; i < match.length; i++) { - name = this._xregexp.captureNames[i - 1]; - if (name) - match[name] = match[i]; - } - } - // Fix browsers that increment `lastIndex` after zero-length matches - if (!compliantLastIndexIncrement && this.global && !match[0].length && (this.lastIndex > match.index)) - this.lastIndex--; - } - if (!this.global) - this.lastIndex = origLastIndex; // Fix IE, Opera bug (last tested IE 9.0.5, Opera 11.61 on Windows) - return match; - }; - - // Fix browser bugs in native method - RegExp.prototype.test = function (str) { - // Use the native `exec` to skip some processing overhead, even though the altered - // `exec` would take care of the `lastIndex` fixes - var match, origLastIndex; - if (!this.global) - origLastIndex = this.lastIndex; - match = nativ.exec.call(this, str); - // Fix browsers that increment `lastIndex` after zero-length matches - if (match && !compliantLastIndexIncrement && this.global && !match[0].length && (this.lastIndex > match.index)) - this.lastIndex--; - if (!this.global) - this.lastIndex = origLastIndex; // Fix IE, Opera bug (last tested IE 9.0.5, Opera 11.61 on Windows) - return !!match; - }; - - // Adds named capture support and fixes browser bugs in native method - String.prototype.match = function (regex) { - if (!XRegExp.isRegExp(regex)) - regex = RegExp(regex); // Native `RegExp` - if (regex.global) { - var result = nativ.match.apply(this, arguments); - regex.lastIndex = 0; // Fix IE bug - return result; - } - return regex.exec(this); // Run the altered `exec` - }; - - // Adds support for `${n}` tokens for named and numbered backreferences in replacement text, - // and provides named backreferences to replacement functions as `arguments[0].name`. Also - // fixes cross-browser differences in replacement text syntax when performing a replacement - // using a nonregex search value, and the value of replacement regexes' `lastIndex` property - // during replacement iterations. Note that this doesn't support SpiderMonkey's proprietary - // third (`flags`) parameter - String.prototype.replace = function (search, replacement) { - var isRegex = XRegExp.isRegExp(search), - captureNames, result, str, origLastIndex; - - // There are too many combinations of search/replacement types/values and browser bugs that - // preclude passing to native `replace`, so don't try - //if (...) - // return nativ.replace.apply(this, arguments); - - if (isRegex) { - if (search._xregexp) - captureNames = search._xregexp.captureNames; // Array or `null` - if (!search.global) - origLastIndex = search.lastIndex; - } else { - search = search + ""; // Type conversion - } - - if (Object.prototype.toString.call(replacement) === "[object Function]") { - result = nativ.replace.call(this + "", search, function () { - if (captureNames) { - // Change the `arguments[0]` string primitive to a String object which can store properties - arguments[0] = new String(arguments[0]); - // Store named backreferences on `arguments[0]` - for (var i = 0; i < captureNames.length; i++) { - if (captureNames[i]) - arguments[0][captureNames[i]] = arguments[i + 1]; - } - } - // Update `lastIndex` before calling `replacement` (fix browsers) - if (isRegex && search.global) - search.lastIndex = arguments[arguments.length - 2] + arguments[0].length; - return replacement.apply(null, arguments); - }); - } else { - str = this + ""; // Type conversion, so `args[args.length - 1]` will be a string (given nonstring `this`) - result = nativ.replace.call(str, search, function () { - var args = arguments; // Keep this function's `arguments` available through closure - return nativ.replace.call(replacement + "", replacementToken, function ($0, $1, $2) { - // Numbered backreference (without delimiters) or special variable - if ($1) { - switch ($1) { - case "$": return "$"; - case "&": return args[0]; - case "`": return args[args.length - 1].slice(0, args[args.length - 2]); - case "'": return args[args.length - 1].slice(args[args.length - 2] + args[0].length); - // Numbered backreference - default: - // What does "$10" mean? - // - Backreference 10, if 10 or more capturing groups exist - // - Backreference 1 followed by "0", if 1-9 capturing groups exist - // - Otherwise, it's the string "$10" - // Also note: - // - Backreferences cannot be more than two digits (enforced by `replacementToken`) - // - "$01" is equivalent to "$1" if a capturing group exists, otherwise it's the string "$01" - // - There is no "$0" token ("$&" is the entire match) - var literalNumbers = ""; - $1 = +$1; // Type conversion; drop leading zero - if (!$1) // `$1` was "0" or "00" - return $0; - while ($1 > args.length - 3) { - literalNumbers = String.prototype.slice.call($1, -1) + literalNumbers; - $1 = Math.floor($1 / 10); // Drop the last digit - } - return ($1 ? args[$1] || "" : "$") + literalNumbers; - } - // Named backreference or delimited numbered backreference - } else { - // What does "${n}" mean? - // - Backreference to numbered capture n. Two differences from "$n": - // - n can be more than two digits - // - Backreference 0 is allowed, and is the entire match - // - Backreference to named capture n, if it exists and is not a number overridden by numbered capture - // - Otherwise, it's the string "${n}" - var n = +$2; // Type conversion; drop leading zeros - if (n <= args.length - 3) - return args[n]; - n = captureNames ? indexOf(captureNames, $2) : -1; - return n > -1 ? args[n + 1] : $0; - } - }); - }); - } - - if (isRegex) { - if (search.global) - search.lastIndex = 0; // Fix IE, Safari bug (last tested IE 9.0.5, Safari 5.1.2 on Windows) - else - search.lastIndex = origLastIndex; // Fix IE, Opera bug (last tested IE 9.0.5, Opera 11.61 on Windows) - } - - return result; - }; - - // A consistent cross-browser, ES3 compliant `split` - String.prototype.split = function (s /* separator */, limit) { - // If separator `s` is not a regex, use the native `split` - if (!XRegExp.isRegExp(s)) - return nativ.split.apply(this, arguments); - - var str = this + "", // Type conversion - output = [], - lastLastIndex = 0, - match, lastLength; - - // Behavior for `limit`: if it's... - // - `undefined`: No limit - // - `NaN` or zero: Return an empty array - // - A positive number: Use `Math.floor(limit)` - // - A negative number: No limit - // - Other: Type-convert, then use the above rules - if (limit === undefined || +limit < 0) { - limit = Infinity; - } else { - limit = Math.floor(+limit); - if (!limit) - return []; - } - - // This is required if not `s.global`, and it avoids needing to set `s.lastIndex` to zero - // and restore it to its original value when we're done using the regex - s = XRegExp.copyAsGlobal(s); - - while (match = s.exec(str)) { // Run the altered `exec` (required for `lastIndex` fix, etc.) - if (s.lastIndex > lastLastIndex) { - output.push(str.slice(lastLastIndex, match.index)); - - if (match.length > 1 && match.index < str.length) - Array.prototype.push.apply(output, match.slice(1)); - - lastLength = match[0].length; - lastLastIndex = s.lastIndex; - - if (output.length >= limit) - break; - } - - if (s.lastIndex === match.index) - s.lastIndex++; - } - - if (lastLastIndex === str.length) { - if (!nativ.test.call(s, "") || lastLength) - output.push(""); - } else { - output.push(str.slice(lastLastIndex)); - } - - return output.length > limit ? output.slice(0, limit) : output; - }; - - - //--------------------------------- - // Private helper functions - //--------------------------------- - - // Supporting function for `XRegExp`, `XRegExp.copyAsGlobal`, etc. Returns a copy of a `RegExp` - // instance with a fresh `lastIndex` (set to zero), preserving properties required for named - // capture. Also allows adding new flags in the process of copying the regex - function clone (regex, additionalFlags) { - if (!XRegExp.isRegExp(regex)) - throw TypeError("type RegExp expected"); - var x = regex._xregexp; - regex = XRegExp(regex.source, getNativeFlags(regex) + (additionalFlags || "")); - if (x) { - regex._xregexp = { - source: x.source, - captureNames: x.captureNames ? x.captureNames.slice(0) : null - }; - } - return regex; - } - - function getNativeFlags (regex) { - return (regex.global ? "g" : "") + - (regex.ignoreCase ? "i" : "") + - (regex.multiline ? "m" : "") + - (regex.extended ? "x" : "") + // Proposed for ES4; included in AS3 - (regex.sticky ? "y" : ""); - } - - function runTokens (pattern, index, scope, context) { - var i = tokens.length, - result, match, t; - // Protect against constructing XRegExps within token handler and trigger functions - isInsideConstructor = true; - // Must reset `isInsideConstructor`, even if a `trigger` or `handler` throws - try { - while (i--) { // Run in reverse order - t = tokens[i]; - if ((scope & t.scope) && (!t.trigger || t.trigger.call(context))) { - t.pattern.lastIndex = index; - match = t.pattern.exec(pattern); // Running the altered `exec` here allows use of named backreferences, etc. - if (match && match.index === index) { - result = { - output: t.handler.call(context, match, scope), - match: match - }; - break; - } - } - } - } catch (err) { - throw err; - } finally { - isInsideConstructor = false; - } - return result; - } - - function indexOf (array, item, from) { - if (Array.prototype.indexOf) // Use the native array method if available - return array.indexOf(item, from); - for (var i = from || 0; i < array.length; i++) { - if (array[i] === item) - return i; - } - return -1; - } - - - //--------------------------------- - // Built-in tokens - //--------------------------------- - - // Augment XRegExp's regular expression syntax and flags. Note that when adding tokens, the - // third (`scope`) argument defaults to `XRegExp.OUTSIDE_CLASS` - - // Comment pattern: (?# ) - XRegExp.addToken( - /\(\?#[^)]*\)/, - function (match) { - // Keep tokens separated unless the following token is a quantifier - return nativ.test.call(quantifier, match.input.slice(match.index + match[0].length)) ? "" : "(?:)"; - } - ); - - // Capturing group (match the opening parenthesis only). - // Required for support of named capturing groups - XRegExp.addToken( - /\((?!\?)/, - function () { - this.captureNames.push(null); - return "("; - } - ); - - // Named capturing group (match the opening delimiter only): (? - XRegExp.addToken( - /\(\?<([$\w]+)>/, - function (match) { - this.captureNames.push(match[1]); - this.hasNamedCapture = true; - return "("; - } - ); - - // Named backreference: \k - XRegExp.addToken( - /\\k<([\w$]+)>/, - function (match) { - var index = indexOf(this.captureNames, match[1]); - // Keep backreferences separate from subsequent literal numbers. Preserve back- - // references to named groups that are undefined at this point as literal strings - return index > -1 ? - "\\" + (index + 1) + (isNaN(match.input.charAt(match.index + match[0].length)) ? "" : "(?:)") : - match[0]; - } - ); - - // Empty character class: [] or [^] - XRegExp.addToken( - /\[\^?]/, - function (match) { - // For cross-browser compatibility with ES3, convert [] to \b\B and [^] to [\s\S]. - // (?!) should work like \b\B, but is unreliable in Firefox - return match[0] === "[]" ? "\\b\\B" : "[\\s\\S]"; - } - ); - - // Mode modifier at the start of the pattern only, with any combination of flags imsx: (?imsx) - // Does not support x(?i), (?-i), (?i-m), (?i: ), (?i)(?m), etc. - XRegExp.addToken( - /^\(\?([imsx]+)\)/, - function (match) { - this.setFlag(match[1]); - return ""; - } - ); - - // Whitespace and comments, in free-spacing (aka extended) mode only - XRegExp.addToken( - /(?:\s+|#.*)+/, - function (match) { - // Keep tokens separated unless the following token is a quantifier - return nativ.test.call(quantifier, match.input.slice(match.index + match[0].length)) ? "" : "(?:)"; - }, - XRegExp.OUTSIDE_CLASS, - function () {return this.hasFlag("x");} - ); - - // Dot, in dotall (aka singleline) mode only - XRegExp.addToken( - /\./, - function () {return "[\\s\\S]";}, - XRegExp.OUTSIDE_CLASS, - function () {return this.hasFlag("s");} - ); - - - //--------------------------------- - // Backward compatibility - //--------------------------------- - - // Uncomment the following block for compatibility with XRegExp 1.0-1.2: - /* - XRegExp.matchWithinChain = XRegExp.matchChain; - RegExp.prototype.addFlags = function (s) {return clone(this, s);}; - RegExp.prototype.execAll = function (s) {var r = []; XRegExp.iterate(s, this, function (m) {r.push(m);}); return r;}; - RegExp.prototype.forEachExec = function (s, f, c) {return XRegExp.iterate(s, this, f, c);}; - RegExp.prototype.validate = function (s) {var r = RegExp("^(?:" + this.source + ")$(?!\\s)", getNativeFlags(this)); if (this.global) this.lastIndex = 0; return s.search(r) === 0;}; - */ - -})(); - diff --git a/conlite/external/phpmailer/phpmailer/examples/scripts/shAutoloader.js b/conlite/external/phpmailer/phpmailer/examples/scripts/shAutoloader.js deleted file mode 100644 index 9f5942e..0000000 --- a/conlite/external/phpmailer/phpmailer/examples/scripts/shAutoloader.js +++ /dev/null @@ -1,122 +0,0 @@ -(function() { - -var sh = SyntaxHighlighter; - -/** - * Provides functionality to dynamically load only the brushes that a needed to render the current page. - * - * There are two syntaxes that autoload understands. For example: - * - * SyntaxHighlighter.autoloader( - * [ 'applescript', 'Scripts/shBrushAppleScript.js' ], - * [ 'actionscript3', 'as3', 'Scripts/shBrushAS3.js' ] - * ); - * - * or a more easily comprehendable one: - * - * SyntaxHighlighter.autoloader( - * 'applescript Scripts/shBrushAppleScript.js', - * 'actionscript3 as3 Scripts/shBrushAS3.js' - * ); - */ -sh.autoloader = function() -{ - var list = arguments, - elements = sh.findElements(), - brushes = {}, - scripts = {}, - all = SyntaxHighlighter.all, - allCalled = false, - allParams = null, - i - ; - - SyntaxHighlighter.all = function(params) - { - allParams = params; - allCalled = true; - }; - - function addBrush(aliases, url) - { - for (var i = 0; i < aliases.length; i++) - brushes[aliases[i]] = url; - }; - - function getAliases(item) - { - return item.pop - ? item - : item.split(/\s+/) - ; - } - - // create table of aliases and script urls - for (i = 0; i < list.length; i++) - { - var aliases = getAliases(list[i]), - url = aliases.pop() - ; - - addBrush(aliases, url); - } - - // dynamically add '; $idlang = $new_idlang; diff --git a/conlite/includes/include.lay_edit_form.php b/conlite/includes/include.lay_edit_form.php index 42c65cb..94c46ac 100644 --- a/conlite/includes/include.lay_edit_form.php +++ b/conlite/includes/include.lay_edit_form.php @@ -84,9 +84,10 @@ if (!$layout->virgin) { $ret = tplBrowseLayoutForContainers($idlay); if (strlen($ret) != 0) { + $container = []; + $types =[]; $containers = explode("&", $ret); - $types = array(); foreach ($containers as $value) { if ($value != "") { @@ -107,11 +108,7 @@ if (!$layout->virgin) { } $types = array_unique($types); - if (version_compare(PHP_VERSION, '7.4.0', '>=')) { - $layout->setProperty("layout", "used-types", implode(";", $types)); - } else { - $layout->setProperty("layout", "used-types", implode($types, ";")); - } + $layout->setProperty("layout", "used-types", implode(";", $types)); $msg = ""; @@ -138,7 +135,6 @@ if (!$layout->virgin) { } foreach ($v->missingNodes as $value) { - $idqualifier = ""; $attr = array(); @@ -236,5 +232,4 @@ if (stripslashes($_REQUEST['idlay'])) { $sReloadScript = ""; } $page->addScript('reload', $sReloadScript); -$page->render(); -?> \ No newline at end of file +$page->render(); \ No newline at end of file diff --git a/conlite/includes/include.mod_edit_form.php b/conlite/includes/include.mod_edit_form.php index 5c37554..a380473 100644 --- a/conlite/includes/include.mod_edit_form.php +++ b/conlite/includes/include.mod_edit_form.php @@ -1,4 +1,4 @@ -have_perm_area_action_anyitem($area, $action))) { + /** @var Contenido_Notification $notification */ $notification->displayNotification("error", i18n("No permission")); } else { if ($action == "mod_new") { @@ -64,6 +66,7 @@ if (($action == "mod_new") && (!$perm->have_perm_area_action_anyitem($area, $act } if ($action == "mod_importexport_module") { + /** @var string $mode */ if ($mode == "export") { $name = uplCreateFriendlyName($module->get("name")); @@ -74,7 +77,7 @@ if (($action == "mod_new") && (!$perm->have_perm_area_action_anyitem($area, $act if ($mode == "import") { if (file_exists($_FILES["upload"]["tmp_name"])) { if (!$module->import($_FILES["upload"]["tmp_name"])) { - $noti .= sprintf(i18n("Error while importing XML file: %s"), $module->_error) . "
"; + $noti .= sprintf(i18n("Error while importing XML file: %s"), $module->getError()) . "
"; } else { // Load the item again (clearing slashes from import) $module->loadByPrimaryKey($module->get($module->primaryKey)); @@ -82,7 +85,7 @@ if (($action == "mod_new") && (!$perm->have_perm_area_action_anyitem($area, $act } } } - + /** @var Contenido_Notification $notification */ if ($action == "mod_folder_create") { if ($module->createModuleFolder()) { $notification->displayNotification("info", i18n("Module folder created")); @@ -227,11 +230,12 @@ if (($action == "mod_new") && (!$perm->have_perm_area_action_anyitem($area, $act */ function insertTab(event, obj) { var tabKeyCode = 9; + var keycode; if (event.which) // mozilla - var keycode = event.which; + keycode = event.which; else // ie - var keycode = event.keyCode; + keycode = event.keyCode; if (keycode == tabKeyCode) { if (event.type == "keydown") { @@ -268,8 +272,8 @@ function insertTab(event, obj) { $typeselect = new cHTMLSelectElement("type"); $db2 = new DB_ConLite; - $sql = "SELECT type FROM " . $cfg["tab"]["mod"] . " " . - "WHERE idclient = '" . $client . "' GROUP BY type"; // This query can't be designed using GenericDB... + $sql = "SELECT type FROM " . cRegistry::getConfigValue('tab', 'mod') . " " . + "WHERE idclient = '" . cRegistry::getClientId() . "' GROUP BY type"; // @todo check: This query can't be designed using GenericDB... $db2->query($sql); $aTypes = array(); @@ -281,7 +285,7 @@ function insertTab(event, obj) { // Read existing layouts $oLayouts = new cApiLayoutCollection; - $oLayouts->setWhere("idclient", $client); + $oLayouts->setWhere("idclient", cRegistry::getClientId()); $oLayouts->query(); while ($oLayout = $oLayouts->next()) { @@ -318,6 +322,8 @@ function insertTab(event, obj) { $inputok = true; $outputok = true; + + /** @var string $modErrorMessage */ if ($modulecheck !== "false") { $outputok = modTestModule($module->get("output"), $module->get("idmod") . "o", true); if (!$outputok) { @@ -358,7 +364,7 @@ function insertTab(event, obj) { } } - if ($cfg['dceModEdit']['use']) { + if (cRegistry::getConfigValue('dceModEdit', 'use')) { // button for mod folder creation if (!$module->hasModuleFolder() && $action != "mod_new") { $aParam = array( @@ -367,6 +373,7 @@ function insertTab(event, obj) { 'idmod' => $idmod, 'frame' => $frame ); + /** @var Contenido_Session $sess */ $oCreateFolderButton = new cHTMLLink($sess->self_url($aParam)); $oCreateFolderButton->setContent(i18n("Create Folder")); $sCreateFolderButton = " " . $oCreateFolderButton->render(); @@ -481,8 +488,9 @@ window.onload = scrolltheother; $page->addScript('reload', $sReloadScript); } if (!($action == "mod_importexport_module" && $mode == "export")) { - $oEditAreaInput = new EditArea('input', 'php', substr(strtolower($belang), 0, 2), true, $cfg, (($module->isLoadedFromFile("input")) ? FALSE : !$bInUse)); - $oEditAreaOutput = new EditArea('output', 'php', substr(strtolower($belang), 0, 2), false, $cfg, (($module->isLoadedFromFile("output")) ? FALSE : !$bInUse)); + /** @var string $belang */ + $oEditAreaInput = new EditArea('input', 'php', substr(strtolower($belang), 0, 2), true, cRegistry::getConfig(), (($module->isLoadedFromFile("input")) ? FALSE : !$bInUse)); + $oEditAreaOutput = new EditArea('output', 'php', substr(strtolower($belang), 0, 2), false, cRegistry::getConfig(), (($module->isLoadedFromFile("output")) ? FALSE : !$bInUse)); $page->addScript('editarea', $oEditAreaInput->renderScript() . $oEditAreaOutput->renderScript()); $page->render(); diff --git a/conlite/includes/include.mod_translate.php b/conlite/includes/include.mod_translate.php index 701a2f7..4a2b5a8 100644 --- a/conlite/includes/include.mod_translate.php +++ b/conlite/includes/include.mod_translate.php @@ -1,4 +1,5 @@ get("name") . ' ('.$lang.')'; +$langstring = $langobj->get("name") . ' (' . $lang . ')'; $moduletranslations = new cApiModuleTranslationCollection; $module = new cApiModule($idmod); -if ($action == "mod_translation_save") -{ - $strans = new cApiModuleTranslation; - $strans->loadByPrimaryKey($idmodtranslation); +if ($action == "mod_translation_save") { + $strans = new cApiModuleTranslation; + $strans->loadByPrimaryKey($idmodtranslation); - if ($strans->get("idmod") == $idmod) - { - $module->setTranslatedName($translatedname); + if ($strans->get("idmod") == $idmod) { + $module->setTranslatedName($translatedname); - $strans->set("translation", stripslashes($t_trans)); - $strans->store(); + $strans->set("translation", stripslashes($t_trans)); + $strans->store(); - /* Increase idmodtranslation */ - $moduletranslations->select("idmod = '$idmod' AND idlang = '$lang'"); + /* Increase idmodtranslation */ + $moduletranslations->select("idmod = '$idmod' AND idlang = '$lang'"); - while ($mitem = $moduletranslations->next()) - { - if ($mitem->get("idmodtranslation") == $idmodtranslation) - { - $mitem2 = $moduletranslations->next(); + while ($mitem = $moduletranslations->next()) { + if ($mitem->get("idmodtranslation") == $idmodtranslation) { + $mitem2 = $moduletranslations->next(); - if (is_object($mitem2)) - { - $idmodtranslation = $mitem2->get("idmodtranslation"); - break; - } - } - } - } + if (is_object($mitem2)) { + $idmodtranslation = $mitem2->get("idmodtranslation"); + break; + } + } + } + } } -if ($action == "mod_importexport_translation") -{ - if ($mode == "export") - { - $sFileName = uplCreateFriendlyName(strtolower($module->get("name") . "_" . $langobj->get("name"))); +if ($action == "mod_importexport_translation") { + if ($mode == "export") { + $sFileName = uplCreateFriendlyName(strtolower($module->get("name") . "_" . $langobj->get("name"))); - if ($sFileName != "") - { - $moduletranslations->export($idmod, $lang, $sFileName . ".xml"); - } - } - if ($mode == "import") - { - if (file_exists($_FILES["upload"]["tmp_name"])) - { - $moduletranslations->import($idmod, $lang, $_FILES["upload"]["tmp_name"]); - } - } -} + if ($sFileName != "") { + $moduletranslations->export($idmod, $lang, $sFileName . ".xml"); + } + } + if ($mode == "import") { + if (file_exists($_FILES["upload"]["tmp_name"])) { + $moduletranslations->import($idmod, $lang, $_FILES["upload"]["tmp_name"]); + } + } +} -if (!isset($idmodtranslation)) -{ - $idmodtranslation = 0; +if (!isset($idmodtranslation)) { + $idmodtranslation = 0; } $mtrans = new cApiModuleTranslation; $mtrans->loadByPrimaryKey($idmodtranslation); -if ($mtrans->get("idmod") != $idmod) -{ - $moduletranslations->select("idmod = '$idmod' AND idlang = '$lang'", '', 'idmodtranslation DESC', '1'); - $mtrans = $moduletranslations->next(); - - if (is_object($mtrans)) - { - $idmodtranslation = $mtrans->get("idmodtranslation"); - } else { - $mtrans = new cApiModuleTranslation; - } +if ($mtrans->get("idmod") != $idmod) { + $moduletranslations->select("idmod = '$idmod' AND idlang = '$lang'", '', 'idmodtranslation DESC', '1'); + $mtrans = $moduletranslations->next(); + + if (is_object($mtrans)) { + $idmodtranslation = $mtrans->get("idmodtranslation"); + } else { + $mtrans = new cApiModuleTranslation; + } } $strings = $module->parseModuleForStrings(); /* Insert new strings */ -foreach ($strings as $string) -{ - $moduletranslations->create($idmod, $lang, $string); +foreach ($strings as $string) { + $moduletranslations->create($idmod, $lang, $string); } $moduletranslations->select("idmod = '$idmod' AND idlang = '$lang'"); -while ($d_modtrans = $moduletranslations->next()) -{ - if (!in_array($d_modtrans->get("original"), $strings)) - { - $moduletranslations->delete($d_modtrans->get("idmodtranslation")); - } +while ($d_modtrans = $moduletranslations->next()) { + if (!in_array($d_modtrans->get("original"), $strings)) { + $moduletranslations->delete($d_modtrans->get("idmodtranslation")); + } } $page = new cPage; +$page->setHtml5(); +$page->setEncoding('UTF-8'); $form = new UI_Table_Form("translation"); $form->addHeader(sprintf(i18n("Translate module '%s'"), $module->get("name"))); @@ -142,7 +128,7 @@ $form->setVar("idmod", $idmod); $form->setVar("idmodtranslation", $idmodtranslation); $form->setVar("action", "mod_translation_save"); -$transmodname = new cHTMLTextbox("translatedname", $module->getTranslatedName(),60); +$transmodname = new cHTMLTextbox("translatedname", $module->getTranslatedName(), 60); $form->add(i18n("Translated Name"), $transmodname); @@ -152,22 +138,21 @@ $ilink->setCustom("idmod", $idmod); $ilink->setCustom("idmodtranslation", $mtrans->get("idmodtranslation")); $ilink->setAnchor($mtrans->get("idmodtranslation")); -$iframe = ''; +$iframe = ''; -$table = ''; +$table = '
'.i18n("Original module string").''.sprintf(i18n("Translation for %s"), $langstring).' 
'.$iframe.'
'; -$original = new cHTMLTextarea("t_orig",clHtmlSpecialChars($mtrans->get("original"))); +$original = new cHTMLTextarea("t_orig", clHtmlSpecialChars($mtrans->get("original"))); $original->setStyle("width: 300px;"); -$translated = new cHTMLTextarea("t_trans",clHtmlSpecialChars($mtrans->get("translation"))); +$translated = new cHTMLTextarea("t_trans", $mtrans->get("translation")); $translated->setStyle("width: 300px;"); -$table .= '
' . i18n("Original module string") . '' . sprintf(i18n("Translation for %s"), $langstring) . ' 
' . $iframe . '
'.$original->render().''.$translated->render().' 
'; +$table .= '' . $original->render() . '' . $translated->render() . ' '; $table .= i18n("Hint: Hit ALT+SHIFT+S to save the translated entry and advance to the next string."); $form->add(i18n("String list"), $table); $mark = ''; - $import = new cHTMLRadiobutton("mode", "import"); $export = new cHTMLRadiobutton("mode", "export"); $export->setLabelText(i18n("Export to file")); @@ -189,15 +174,14 @@ $form2->setVar("idmod", $idmod); $form2->setVar("idmodtranslation", $idmodtranslation); $form2->custom["submit"]["accesskey"] = ''; -$page->setContent($form->render(). $mark ."
". $form2->render()); +$page->setContent($form->render() . $mark . "
" . $form2->render()); $page->setMarkScript(2); $clang = new cApiLanguage($lang); $page->setEncoding($clang->get("encoding")); -if (!($action == "mod_importexport_translation" && $mode == "export")) -{ - $page->render(); +if (!($action == "mod_importexport_translation" && $mode == "export")) { + $page->render(); } ?> \ No newline at end of file diff --git a/conlite/includes/include.mod_translate_stringlist.php b/conlite/includes/include.mod_translate_stringlist.php index d11653c..4eb8975 100644 --- a/conlite/includes/include.mod_translate_stringlist.php +++ b/conlite/includes/include.mod_translate_stringlist.php @@ -1,4 +1,5 @@ select("idmod = '$idmod' AND idlang='$lang'"); $page = new cPage; +$page->setHtml5(); +$page->setEncoding('UTF-8'); $page->setMargin(0); $v = ''; @@ -46,32 +48,35 @@ $link->setCLink("mod_translate", 4, ""); $mylink = new cHTMLLink; -while ($translation = $translations->next()) -{ - $string = $translation->get("original"); - $tstring = $translation->get("translation"); - +while ($translation = $translations->next()) { + + $string = $translation->get("original"); + $tstring = $translation->get("translation"); + $link->setCustom("idmod", $idmod); $link->setCustom("idmodtranslation", $translation->get("idmodtranslation")); $href = $link->getHREF(); - - $mylink->setLink('javascript:parent.location="'.$href.'"'); + + $mylink->setLink('javascript:parent.location="' . $href . '"'); $mylink->setContent($string); - $dark = !$dark; + $dark = !$dark; - if ($dark) - { - $bgcol = $cfg["color"]["table_dark"]; - } else { - $bgcol = $cfg["color"]["table_light"]; - } + if ($dark) { + $bgcol = $cfg["color"]["table_dark"]; + } else { + $bgcol = $cfg["color"]["table_light"]; + } - if ($idmodtranslation == $translation->get("idmodtranslation")) - { - $bgcol = $cfg["color"]["table_active"]; - } - $v .= ''; + if ($idmodtranslation == $translation->get("idmodtranslation")) { + $bgcol = $cfg["color"]["table_active"]; + } + $v .= ''."\n" + . ''."\n" + . ''."\n" + . ''."\n"; } $v .= '
'.$mylink->render().''.$tstring.'
'."\n" + . ''."\n" + . $mylink->render() . '' . $tstring . '
'; @@ -82,5 +87,4 @@ $clang = new cApiLanguage($lang); $page->setEncoding($clang->get("encoding")); $page->render(); - ?> \ No newline at end of file diff --git a/conlite/includes/include.pretplcfg_edit_form.php b/conlite/includes/include.pretplcfg_edit_form.php index 8cc4e41..17fbf4c 100644 --- a/conlite/includes/include.pretplcfg_edit_form.php +++ b/conlite/includes/include.pretplcfg_edit_form.php @@ -50,8 +50,8 @@ $formaction = $sess->url("main.php"); # $hidden = ' - - + + @@ -154,7 +154,5 @@ $buttons = ''; $tpl->set('s', 'BUTTONS', $buttons); - # Generate template -$tpl->generate($cfg['path']['templates'] . $cfg['templates']['tplcfg_edit_form']); -?> \ No newline at end of file +$tpl->generate($cfg['path']['templates'] . $cfg['templates']['tplcfg_edit_form']); \ No newline at end of file diff --git a/conlite/includes/include.str_overview.php b/conlite/includes/include.str_overview.php index 3563da8..1a4631b 100644 --- a/conlite/includes/include.str_overview.php +++ b/conlite/includes/include.str_overview.php @@ -233,101 +233,6 @@ if (!isset($idcat)) $idcat = 0; if (!isset($action)) $action = 0; -/* -function buildTree(&$rootItem, &$items) { - global $nextItem, $perm, $tmp_area; - - while ($item_list = each($items)) { - list($key, $item) = $item_list; - - unset($newItem); - - $bCheck = false; - if (!$bCheck) { - $bCheck = $perm->have_perm_area_action($tmp_area, "str_newtree"); - } - if (!$bCheck) { - $bCheck = $perm->have_perm_area_action($tmp_area, "str_newcat"); - } - if (!$bCheck) { - $bCheck = $perm->have_perm_area_action($tmp_area, "str_makevisible"); - } - if (!$bCheck) { - $bCheck = $perm->have_perm_area_action($tmp_area, "str_makepublic"); - } - if (!$bCheck) { - $bCheck = $perm->have_perm_area_action($tmp_area, "str_deletecat"); - } - if (!$bCheck) { - $bCheck = $perm->have_perm_area_action($tmp_area, "str_moveupcat"); - } - if (!$bCheck) { - $bCheck = $perm->have_perm_area_action($tmp_area, "str_movedowncat"); - } - if (!$bCheck) { - $bCheck = $perm->have_perm_area_action($tmp_area, "str_movesubtree"); - } - if (!$bCheck) { - $bCheck = $perm->have_perm_area_action($tmp_area, "str_renamecat"); - } - if (!$bCheck) { - $bCheck = $perm->have_perm_area_action("str_tplcfg", "str_tplcfg"); - } - if (!$bCheck) { - $bCheck = $perm->have_perm_item($tmp_area, $item['idcat']); - } - - if ($bCheck) { - $newItem = new TreeItem($item['name'], $item['idcat'], true); - } else { - $newItem = new TreeItem($item['name'], $item['idcat'], false); - } - - $newItem->collapsed_icon = 'images/open_all.gif'; - $newItem->expanded_icon = 'images/close_all.gif'; - $newItem->custom['idtree'] = $item['idtree']; - $newItem->custom['level'] = $item['level']; - $newItem->custom['idcat'] = $item['idcat']; - $newItem->custom['idtree'] = $item['idtree']; - $newItem->custom['parentid'] = $item['parentid']; - $newItem->custom['alias'] = $item['alias']; - $newItem->custom['preid'] = $item['preid']; - $newItem->custom['postid'] = $item['postid']; - $newItem->custom['visible'] = $item['visible']; - $newItem->custom['idtplcfg'] = $item['idtplcfg']; - $newItem->custom['public'] = $item['public']; - - if ($perm->have_perm_item("str", $item['idcat'])) { - $newItem->custom['forcedisplay'] = 1; - } - - if (array_key_exists($key + 1, $items)) { - $nextItem = $items[$key + 1]; - } else { - $nextItem = 0; - } - - if (array_key_exists($key - 1, $items)) { - $lastItem = $items[$key - 1]; - } else { - $lastItem = 0; - } - - $rootItem->addItem($newItem); - - if ($nextItem['level'] > $item['level']) { - $oldRoot = $rootItem; - buildTree($newItem, $items); - $rootItem = $oldRoot; - } - - if ($nextItem['level'] < $item['level']) { - return; - } - } -} - * - */ function buildTree(&$rootItem, $itemsIterator) { global $nextItem, $perm, $tmp_area; diff --git a/conlite/includes/include.style_edit_form.php b/conlite/includes/include.style_edit_form.php index 078bcc7..8c59965 100644 --- a/conlite/includes/include.style_edit_form.php +++ b/conlite/includes/include.style_edit_form.php @@ -158,11 +158,9 @@ if (!$perm->have_perm_area_action($area, $action)) { if ($_REQUEST['action'] == $sActionEdit) { $sCode = getFileContent($sFilename, $path); } else { - $sCode = $_REQUEST['code']; # stripslashes is required here in case of creating a new file + $sCode = empty($_REQUEST['code'])?'':$_REQUEST['code']; } - $aFileInfo = getFileInformation($client, $sTempFilename, "css", $db); - $form = new UI_Table_Form("file_editor"); $form->addHeader(i18n("Edit file")); $form->setWidth("100%"); @@ -173,16 +171,24 @@ if (!$perm->have_perm_area_action($area, $action)) { $form->setVar("tmp_file", $sTempFilename); $tb_name = new cHTMLTextbox("file", $sFilename, 60); - $ta_code = new cHTMLTextarea("code", clHtmlSpecialChars($sCode), 100, 35, "code"); - $descr = new cHTMLTextarea("description", clHtmlSpecialChars($aFileInfo["description"]), 100, 5); - - $ta_code->setStyle("font-family: monospace;width: 100%;"); - $descr->setStyle("font-family: monospace;width: 100%;"); - $ta_code->updateAttributes(array("wrap" => getEffectiveSetting('style_editor', 'wrap', 'off'))); - $form->add(i18n("Name"), $tb_name); - $form->add(i18n("Description"), $descr->render()); + + $ta_code = new cHTMLTextarea("code", clHtmlSpecialChars($sCode), 100, 35, "code"); + $ta_code->updateAttributes(array("wrap" => getEffectiveSetting('style_editor', 'wrap', 'off'))); + $ta_code->setStyle("font-family: monospace;width: 100%;"); $form->add(i18n("Code"), $ta_code); + + $aFileInfo = getFileInformation($client, $sTempFilename, "css", $db); + if(!empty($aFileInfo["description"])) { + $sDescription = clHtmlSpecialChars($aFileInfo["description"]); + } else { + $sDescription = ''; + } + + $descr = new cHTMLTextarea("description", $sDescription, 100, 5); + + $descr->setStyle("font-family: monospace;width: 100%;"); + $form->add(i18n("Description"), $descr->render()); $page->setContent($form->render()); @@ -192,5 +198,4 @@ if (!$perm->have_perm_area_action($area, $action)) { $page->addScript('reload', $sReloadScript); $page->render(); } -} -?> \ No newline at end of file +} \ No newline at end of file diff --git a/conlite/includes/rights_lay.inc.php b/conlite/includes/rights_lay.inc.php index daf534a..5c23b2d 100644 --- a/conlite/includes/rights_lay.inc.php +++ b/conlite/includes/rights_lay.inc.php @@ -118,7 +118,7 @@ $db->query($sql); while ($db->next_record()) { $tplname = clHtmlEntities($db->f("name")); - $description = clHtmlEntities($db->f("description")); + $description = empty($db->f("description"))?'':clHtmlEntities($db->f("description")); $sTable .= $table->row(); $sTable .= $table->cell($tplname,"", "", " class=\"td_rights0\"", false); diff --git a/conlite/includes/rights_mod.inc.php b/conlite/includes/rights_mod.inc.php index 390f7f2..1230fdf 100644 --- a/conlite/includes/rights_mod.inc.php +++ b/conlite/includes/rights_mod.inc.php @@ -117,7 +117,7 @@ $db->query($sql); while ($db->next_record()) { $tplname = clHtmlEntities($db->f("name")); - $description = clHtmlEntities($db->f("description")); + $description = empty($db->f("description"))?'':clHtmlEntities($db->f("description")); $sTable .= $table->row(); $sTable .= $table->cell($tplname,"", "", " class=\"td_rights0\"", false); diff --git a/conlite/includes/rights_tpl.inc.php b/conlite/includes/rights_tpl.inc.php index d045243..4aeba1f 100644 --- a/conlite/includes/rights_tpl.inc.php +++ b/conlite/includes/rights_tpl.inc.php @@ -112,14 +112,14 @@ foreach ($aSecondHeaderRow as $value) { $sTable .= $table->end_row(); -//Select the itemid�s +//Select the itemid $sql = "SELECT * FROM ".$cfg["tab"]["tpl"]." WHERE idclient='".Contenido_Security::toInteger($rights_client)."' ORDER BY name"; $db->query($sql); while ($db->next_record()) { - $tplname = clHtmlEntities($db->f("name")); - $description = clHtmlEntities($db->f("description")); + $tplname = clHtmlEntities($db->f("name")); + $description = empty($db->f("description"))?'':clHtmlEntities($db->f("description")); $sTable .= $table->row(); $sTable .= $table->cell($tplname,"", "", " class=\"td_rights0\"", false); diff --git a/conlite/includes/startup.php b/conlite/includes/startup.php index 9a51ad9..034fc86 100644 --- a/conlite/includes/startup.php +++ b/conlite/includes/startup.php @@ -71,7 +71,7 @@ if (!defined('CL_ENVIRONMENT')) { */ if (!defined('CL_VERSION')) { -define('CL_VERSION', '2.2.0 beta'); +define('CL_VERSION', '3.0.0 RC'); } @@ -142,13 +142,13 @@ require_once($cfg['path']['conlite'] . $cfg['path']['includes'] . '/api/function include_once($cfg['path']['conlite'] . $cfg['path']['classes'] . 'class.autoload.php'); cAutoload::initialize($cfg); // init composer autoload -include_once($cfg['path']['conlite'] . $cfg['path']['external'] . 'autoload.php'); +include_once(dirname(__DIR__, 2) . DIRECTORY_SEPARATOR . 'vendor/autoload.php'); // 2. security check: Check HTTP parameters, if requested if ($cfg['http_params_check']['enabled'] === true) { $oHttpInputValidator = - new HttpInputValidator($cfg['path']['conlite'] . $cfg['path']['includes'] . '/config.http_check.php'); + new HttpInputValidator($cfg['path']['config'] . CL_ENVIRONMENT . DIRECTORY_SEPARATOR . 'config.http_check.php'); } /* Generate arrays for available login languages diff --git a/conlite/plugins/chains/createmetatags/include.chain.content.createmetatags.php b/conlite/plugins/chains/createmetatags/include.chain.content.createmetatags.php index c827743..c2b2c88 100644 --- a/conlite/plugins/chains/createmetatags/include.chain.content.createmetatags.php +++ b/conlite/plugins/chains/createmetatags/include.chain.content.createmetatags.php @@ -1,4 +1,5 @@ = 5.3 -if(version_compare(PHP_VERSION, "5.3", "<")) { - cInclude("plugins", "chains/createmetatags/includes/keyword_density_php52.php"); -} else { - cInclude("plugins", "chains/createmetatags/includes/keyword_density.php"); -} + +cInclude("plugins", "chains/createmetatags/includes/keyword_density.php"); cInclude("plugins", "chains/createmetatags/classes/class.metatag.creator.html5.php"); function cecCreateMetatags($metatags) { global $cfg, $lang, $idart, $client, $cfgClient, $idcat, $idartlang; - - $bIsHTML5 = ((getEffectiveSetting('generator', 'html5', 'false') == 'false') ? false : true); - - if($bIsHTML5) { + + $bIsHTML5 = ((getEffectiveSetting('generator', 'html5', 'false') == 'false') ? false : true); + + if ($bIsHTML5) { $aConfig = array( 'cachetime' => 3600, - 'cachedir' => $cfgClient[$client]['path']['frontend'] . "cache/" + 'cachedir' => $cfgClient[$client]['path']['frontend'] . "cache/" ); - - $oHtml5MetaCreator = new MetaTagCreatorHtml5($metatags, $aConfig); + + $oHtml5MetaCreator = new MetaTagCreatorHtml5($metatags, $aConfig); return $oHtml5MetaCreator->generateMetaTags(); - } + } //Basic settings $cachetime = 3600; // measured in seconds @@ -59,8 +55,8 @@ function cecCreateMetatags($metatags) { $metatags = array(); } - $hash = 'metatag_'.md5($idart.'/'.$lang); - $cachefilename = $cachedir.$hash.'.tmp'; + $hash = 'metatag_' . md5($idart . '/' . $lang); + $cachefilename = $cachedir . $hash . '.tmp'; #Check if rebuilding of metatags is necessary $reload = true; @@ -70,7 +66,7 @@ function cecCreateMetatags($metatags) { if (file_exists($cachefilename)) { $fileexists = true; - $diff = time() - filemtime($cachefilename); + $diff = time() - filemtime($cachefilename); if ($diff > $cachetime) { $reload = true; @@ -84,7 +80,7 @@ function cecCreateMetatags($metatags) { $db = new DB_ConLite(); #Get encoding - $sql = "SELECT * FROM ".$cfg['tab']['lang']." WHERE idlang=".(int)$lang; + $sql = "SELECT * FROM " . $cfg['tab']['lang'] . " WHERE idlang=" . (int) $lang; $db->query($sql); if ($db->next_record()) { $sEncoding = strtoupper($db->f('encoding')); @@ -95,12 +91,12 @@ function cecCreateMetatags($metatags) { #Get idcat of homepage $sql = "SELECT a.idcat FROM - ".$cfg['tab']['cat_tree']." AS a, - ".$cfg['tab']['cat_lang']." AS b + " . $cfg['tab']['cat_tree'] . " AS a, + " . $cfg['tab']['cat_lang'] . " AS b WHERE (a.idcat = b.idcat) AND (b.visible = 1) AND - (b.idlang = ".Contenido_Security::toInteger($lang).") + (b.idlang = " . Contenido_Security::toInteger($lang) . ") ORDER BY a.idtree LIMIT 1"; $db->query($sql); @@ -112,7 +108,7 @@ function cecCreateMetatags($metatags) { $availableTags = conGetAvailableMetaTagTypes(); #Get first headline and first text for current article - $oArt = new Article ($idart, $client, $lang); + $oArt = new Article($idart, $client, $lang); #Set idartlang, if not set if ($idartlang == '') { @@ -140,7 +136,7 @@ function cecCreateMetatags($metatags) { } $sHeadline = strip_tags($sHeadline); - $sHeadline = substr(str_replace(chr(13).chr(10),' ',$sHeadline),0,100); + $sHeadline = substr(str_replace(chr(13) . chr(10), ' ', $sHeadline), 0, 100); $arrText1 = $oArt->getContent("html"); $arrText2 = $oArt->getContent("text"); @@ -163,19 +159,19 @@ function cecCreateMetatags($metatags) { } $sText = strip_tags(urldecode($sText)); - $sText = keywordDensity ('', $sText); + $sText = keywordDensity('', $sText); //Get metatags for homeapge $arrHomepageMetaTags = array(); - $sql = "SELECT startidartlang FROM ".$cfg["tab"]["cat_lang"]." WHERE (idcat=".Contenido_Security::toInteger($idcat_homepage).") AND(idlang=".Contenido_Security::toInteger($lang).")"; + $sql = "SELECT startidartlang FROM " . $cfg["tab"]["cat_lang"] . " WHERE (idcat=" . Contenido_Security::toInteger($idcat_homepage) . ") AND(idlang=" . Contenido_Security::toInteger($lang) . ")"; $db->query($sql); - if($db->next_record()){ + if ($db->next_record()) { $iIdArtLangHomepage = $db->f('startidartlang'); #get idart of homepage - $sql = "SELECT idart FROM ".$cfg["tab"]["art_lang"]." WHERE idartlang =".Contenido_Security::toInteger($iIdArtLangHomepage); + $sql = "SELECT idart FROM " . $cfg["tab"]["art_lang"] . " WHERE idartlang =" . Contenido_Security::toInteger($iIdArtLangHomepage); $db->query($sql); @@ -186,10 +182,10 @@ function cecCreateMetatags($metatags) { $t1 = $cfg["tab"]["meta_tag"]; $t2 = $cfg["tab"]["meta_type"]; - $sql = "SELECT ".$t1.".metavalue,".$t2.".metatype FROM ".$t1. - " INNER JOIN ".$t2." ON ".$t1.".idmetatype = ".$t2.".idmetatype WHERE ". - $t1.".idartlang =".$iIdArtLangHomepage. - " ORDER BY ".$t2.".metatype"; + $sql = "SELECT " . $t1 . ".metavalue," . $t2 . ".metatype FROM " . $t1 . + " INNER JOIN " . $t2 . " ON " . $t1 . ".idmetatype = " . $t2 . ".idmetatype WHERE " . + $t1 . ".idartlang =" . $iIdArtLangHomepage . + " ORDER BY " . $t2 . ".metatype"; $db->query($sql); @@ -197,7 +193,7 @@ function cecCreateMetatags($metatags) { $arrHomepageMetaTags[$db->f("metatype")] = $db->f("metavalue"); } - $oArt = new Article ($iIdArtHomepage, $client, $lang); + $oArt = new Article($iIdArtHomepage, $client, $lang); $arrHomepageMetaTags['pagetitle'] = $oArt->getField('title'); } @@ -206,12 +202,12 @@ function cecCreateMetatags($metatags) { foreach ($availableTags as $key => $value) { $metavalue = conGetMetaValue($idartlang, $key); - if (strlen($metavalue) == 0){ + if (strlen($metavalue) == 0) { //Add values for metatags that don't have a value in the current article - switch(strtolower($value["name"])){ + switch (strtolower($value["name"])) { case 'author': //Build author metatag from name of last modifier - $oArt = new Article ($idart, $client, $lang); + $oArt = new Article($idart, $client, $lang); $lastmodifier = $oArt->getField("modifiedby"); $oUser = new User(); $oUser->loadUserByUserID(md5($lastmodifier)); @@ -224,7 +220,7 @@ function cecCreateMetatags($metatags) { break; case 'date': //Build date metatag from date of last modification - $oArt = new Article ($idart, $client, $lang); + $oArt = new Article($idart, $client, $lang); $lastmodified = $oArt->getField("lastmodified"); $iCheck = CheckIfMetaTagExists($metatags, 'date'); @@ -260,7 +256,6 @@ function cecCreateMetatags($metatags) { // save metatags in cache file file_put_contents($cachefilename, serialize($metatags)); - } else { #Get metatags from file system cache $metatags = unserialize(file_get_contents($cachefilename)); @@ -269,7 +264,6 @@ function cecCreateMetatags($metatags) { return $metatags; } - /** * Checks if the metatag allready exists inside the metatag list. * @@ -295,4 +289,5 @@ function CheckIfMetaTagExists($arrMetatags, $sCheckForMetaTag) { // metatag doesn't exists, return next position return count($arrMetatags); } + ?> \ No newline at end of file diff --git a/conlite/plugins/chains/createmetatags/includes/keyword_density_php52.php b/conlite/plugins/chains/createmetatags/includes/keyword_density_php52.php deleted file mode 100644 index 887f9c4..0000000 --- a/conlite/plugins/chains/createmetatags/includes/keyword_density_php52.php +++ /dev/null @@ -1,221 +0,0 @@ - $b) ? -1 : 1; -} - -/** - * - * @param array $singlewordcounter - * @param int $maxKeywords - * @return array Array with valued keywords - */ -function stripCount($singlewordcounter, $maxKeywords = 15) { - // strip all with only 1 - $tmp = array(); - $result = array(); - $tmpToRemove = 1; - - foreach ($singlewordcounter as $key => $value) { - if ($value > $tmpToRemove) { - $tmp[$key] = $value; - } - } - - if (sizeof($tmp) <= $maxKeywords) { - foreach ($tmp as $key => $value) { - $result[] = $key; - } - } else { - $dist = array(); - foreach ($tmp as $key => $value) { - $dist[$value]++; - } - uksort($dist, "__cmp"); - reset($dist); - $count = 0; - $resultset = array(); - $useQuantity = array(); - - foreach ($dist as $key => $value) { - $_count = $count + $value; - if ($_count <= $maxKeywords) { - $count += $value; - $useQuantity[] = $key; - } else { - break; - } - } - // run all keywords and select by quantities to use - foreach ($singlewordcounter as $key => $value) { - if (in_array($value, $useQuantity)) { - $result[] = $key; - } - } - } - return $result; -} - -/** - * Generate keywords from content - * - * @version 1.0 - * @since 2.0.0 - * @author Ortwin Pinke - * - * @param string $sHeadline - * @param string $sText - * @param string $sEncoding - * @param int $iMinLen - * @return mixed commaseparated string of keywords or false - */ -function keywordDensity($sHeadline, $sText, $sEncoding = "UTF-8", $iMinLen = 5) { - global $aAllWords; - $sHeadline = strip_tags($sHeadline); - $sText = strip_tags($sText); - $sText = clHtmlEntityDecode($sText, ENT_QUOTES, $sEncoding); - - $aSingleWordHeadline = str_word_count($sHeadline, 1); - // double array for higher valenz of headline - $aSingleWordHeadline = array_merge($aSingleWordHeadline,$aSingleWordHeadline); - $aSingleWordHeadline = array_count_values($aSingleWordHeadline); - - $aSingleWordText = str_word_count($sText, 1); - $aSingleWordText = array_count_values($aSingleWordText); - - $aAllWords = array_merge($aSingleWordHeadline, $aSingleWordText); - array_walk($aAllWords, create_function('&$n, $key, $iLen', ' - global $aAllWords; - if(strlen($key) < $iLen || clIsStopWord($key)) { - unset($aAllWords[$key]); - }'), $iMinLen); - arsort($aAllWords, SORT_NUMERIC); - $aAllWords = stripCount($aAllWords); - if(is_array($aAllWords)) { - return implode(', ', $aAllWords); - } - return false; -} - -/** - * Check keyword against stopword list - * - * @version 1.0 - * @since 2.0.0 - * @author Ortwin Pinke - * @todo move stopwords to sqlite - * - * @global int $lang - * @global array $encoding - * @param string $sWord - * @return boolean - */ -function clIsStopWord($sWord) { - global $lang, $encoding; - $aStopWords = array(); - $aStopWords['de_DE'] = array("aber", "als", "am", "an", "auch", "auf", "aus", "bei", "bin", - "bis", "bist", "da", "dadurch", "daher", "darum", "das", "daß", "dass", "dein", - "deine", "dem", "den", "der", "des", "dessen", "deshalb", "die", "dies", "dieser", "dieses", - "doch", "dort", "du", "durch", "ein", "eine", "einem", "einen", "einer", "eines", "er", - "es", "euer", "eure", "für", "hatte", "hatten", "hattest", "hattet", "hier", "hinter", - "ich", "ihr", "ihre", "im", "in", "ist", "ja", "jede", "jedem", "jeden", "jeder", "jedes", - "jener", "jenes", "jetzt", "kann", "kannst", "können", "könnt", "machen", "mein", - "meine", "mit", "muß", "mußt", "musst", "müssen", "müßt", "nach", "nachdem", "nein", - "nicht", "nun", "oder", "seid", "sein", "seine", "sich", "sie", - "sind", "soll", "sollen", "sollst", "sollt", "sonst", "soweit", "sowie", "und", "unser", - "unsere", "unter", "vom", "von", "vor", "wann", "warum", "was", "weiter", "weitere", "wenn", - "wer", "werde", "werden", "werdet", "weshalb", "wie", "wieder", "wieso", "wir", "wird", - "wirst", "wo", "woher", "wohin", "zu", "zum", "zur", "über"); - $aStopWords['en_EN'] = $aStopWords['en_US'] = array("a", "able", "about", "above", "abst", - "accordance", "according", "accordingly", "across", "act", "actually", "added", "adj", - "affected", "affecting", "affects", "after", "afterwards", "again", "against", "ah", "all", - "almost", "alone", "along", "already", "also", "although", "always", "am", "among", - "amongst", "an", "and", "announce", "another", "any", "anybody", "anyhow", "anymore", - "anyone", "anything", "anyway", "anyways", "anywhere", "apparently", "approximately", - "are", "aren", "arent", "arise", "around", "as", "aside", "ask", "asking", "at", "auth", - "available", "away", "awfully", "b", "back", "be", "became", "because", "become", "becomes", - "becoming", "been", "before", "beforehand", "begin", "beginning", "beginnings", "begins", - "behind", "being", "believe", "below", "beside", "besides", "between", "beyond", "biol", - "both", "brief", "briefly", "but", "by", "c", "ca", "came", "can", "cannot", "can't", - "cause", "causes", "certain", "certainly", "co", "com", "come", "comes", "contain", - "containing", "contains", "could", "couldnt", "d", "date", "did", "didn't", "different", - "do", "does", "doesn't", "doing", "done", "don't", "down", "downwards", "due", "during", - "e", "each", "ed", "edu", "effect", "eg", "eight", "eighty", "either", "else", "elsewhere", - "end", "ending", "enough", "especially", "et", "et-al", "etc", "even", "ever", "every", - "everybody", "everyone", "everything", "everywhere", "ex", "except", "f", "far", "few", - "ff", "fifth", "first", "five", "fix", "followed", "following", "follows", "for", "former", - "formerly", "forth", "found", "four", "from", "further", "furthermore", "g", "gave", "get", - "gets", "getting", "give", "given", "gives", "giving", "go", "goes", "gone", "got", "gotten", - "h", "had", "happens", "hardly", "has", "hasn't", "have", "haven't", "having", "he", "hed", - "hence", "her", "here", "hereafter", "hereby", "herein", "heres", "hereupon", "hers", - "herself", "hes", "hi", "hid", "him", "himself", "his", "hither", "home", "how", "howbeit", - "however", "hundred", "i", "id", "ie", "if", "i'll", "im", "immediate", "immediately", - "importance", "important", "in", "inc", "indeed", "index", "information", "instead", "into", - "invention", "inward", "is", "isn't", "it", "itd", "it'll", "its", "itself", "i've", "j", - "just", "k", "keep", "keeps", "kept", "kg", "km", "know", "known", "knows", "l", "largely", - "last", "lately", "later", "latter", "latterly", "least", "less", "lest", "let", "lets", - "like", "liked", "likely", "line", "little", "'ll", "look", "looking", "looks", "ltd", "m", - "made", "mainly", "make", "makes", "many", "may", "maybe", "me", "mean", "means", "meantime", - "meanwhile", "merely", "mg", "might", "million", "miss", "ml", "more", "moreover", "most", - "mostly", "mr", "mrs", "much", "mug", "must", "my", "myself", "n", "na", "name", "namely", - "nay", "nd", "near", "nearly", "necessarily", "necessary", "need", "needs", "neither", - "never", "nevertheless", "new", "next", "nine", "ninety", "no", "nobody", "non", "none", - "nonetheless", "noone", "nor", "normally", "nos", "not", "noted", "nothing", "now", "nowhere", - "o", "obtain", "obtained", "obviously", "of", "off", "often", "oh", "ok", "okay", "old", - "omitted", "on", "once", "one", "ones", "only", "onto", "or", "ord", "other", "others", - "otherwise", "ought", "our", "ours", "ourselves", "out", "outside", "over", "overall", "owing", - "own", "p", "page", "pages", "part", "particular", "particularly", "past", "per", "perhaps", - "placed", "please", "plus", "poorly", "possible", "possibly", "potentially", "pp", "predominantly", - "present", "previously", "primarily", "probably", "promptly", "proud", "provides", "put", - "q", "que", "quickly", "quite", "qv", "r", "ran", "rather", "rd", "re", "readily", "really", - "recent", "recently", "ref", "refs", "regarding", "regardless", "regards", "related", - "relatively", "research", "respectively", "resulted", "resulting", "results", "right", - "run", "s", "said", "same", "saw", "say", "saying", "says", "sec", "section", "see", - "seeing", "seem", "seemed", "seeming", "seems", "seen", "self", "selves", "sent", "seven", - "several", "shall", "she", "shed", "she'll", "shes", "should", "shouldn't", "show", - "showed", "shown", "showns", "shows", "significant", "significantly", "similar", "similarly", - "since", "six", "slightly", "so", "some", "somebody", "somehow", "someone", "somethan", - "something", "sometime", "sometimes", "somewhat", "somewhere", "soon", "sorry", "specifically", - "specified", "specify", "specifying", "still", "stop", "strongly", "sub", "substantially", - "successfully", "such", "sufficiently", "suggest", "sup", "sure", "t", "take", "taken", - "taking", "tell", "tends", "th", "than", "thank", "thanks", "thanx", "that", "that'll", - "thats", "that've", "the", "their", "theirs", "them", "themselves", "then", "thence", - "there", "thereafter", "thereby", "thered", "therefore", "therein", "there'll", "thereof", - "therere", "theres", "thereto", "thereupon", "there've", "these", "they", "theyd", "they'll", - "theyre", "they've", "think", "this", "those", "thou", "though", "thoughh", "thousand", - "throug", "through", "throughout", "thru", "thus", "til", "tip", "to", "together", "too", - "took", "toward", "towards", "tried", "tries", "truly", "try", "trying", "ts", "twice", - "two", "u", "un", "under", "unfortunately", "unless", "unlike", "unlikely", "until", "unto", - "up", "upon", "ups", "us", "use", "used", "useful", "usefully", "usefulness", "uses", "using", - "usually", "v", "value", "various", "'ve", "very", "via", "viz", "vol", "vols", "vs", "w", - "want", "wants", "was", "wasn't", "way", "we", "wed", "welcome", "we'll", "went", "were", - "weren't", "we've", "what", "whatever", "what'll", "whats", "when", "whence", "whenever", - "where", "whereafter", "whereas", "whereby", "wherein", "wheres", "whereupon", "wherever", - "whether", "which", "while", "whim", "whither", "who", "whod", "whoever", "whole", "who'll", - "whom", "whomever", "whos", "whose", "why", "widely", "willing", "wish", "with", "within", - "without", "won't", "words", "world", "would", "wouldn't", "www", "x", "y", "yes", "yet", - "you", "youd", "you'll", "your", "youre", "yours", "yourself", "yourselves", "you've", "z", "zero"); - - if(is_int($lang) && is_array($encoding)) { - $sUseEnc = $encoding[$lang]; - if(empty($sUseEnc) || !array_key_exists($sUseEnc, $aStopWords)) { - $sUseEnc = "de_DE"; - } - } - - if(in_array(utf8_encode($sWord), $aStopWords['de_DE'])) { - return true; - } - return false; -} -?> \ No newline at end of file diff --git a/conlite/plugins/cl-mod-rewrite b/conlite/plugins/cl-mod-rewrite deleted file mode 160000 index 606b832..0000000 --- a/conlite/plugins/cl-mod-rewrite +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 606b832ce8926ac51d5d4605a9ebb32c0e1745ad diff --git a/conlite/plugins/frontendusers/includes/config.plugin.php b/conlite/plugins/frontendusers/includes/config.plugin.php index 3c44048..777bec0 100644 --- a/conlite/plugins/frontendusers/includes/config.plugin.php +++ b/conlite/plugins/frontendusers/includes/config.plugin.php @@ -3,5 +3,4 @@ * $Id$ */ cInclude("includes", "functions.general.php"); -scanPlugins("frontendusers"); -?> \ No newline at end of file +scanPlugins("frontendusers"); \ No newline at end of file diff --git a/conlite/plugins/frontendusers/valid_from/valid_from.php b/conlite/plugins/frontendusers/valid_from/valid_from.php index d699af8..6357417 100644 --- a/conlite/plugins/frontendusers/valid_from/valid_from.php +++ b/conlite/plugins/frontendusers/valid_from/valid_from.php @@ -10,34 +10,26 @@ function frontendusers_valid_from_getTitle () function frontendusers_valid_from_display () { - global $feuser,$db,$belang; + global $feuser; $template = '%s'; - - $currentValue = $feuser->get("valid_from"); - - if ($currentValue == '') { - $currentValue = '1000-01-01'; + + $currentValue = $feuser->get("valid_from"); + + if($currentValue == "0000-00-00 00:00:00" || $currentValue == "") { + $currentValue = null; + } else { + $datetime = new DateTime($currentValue); + $currentValue = $datetime->format('Y-m-d\TH:i'); } - $currentValue = str_replace('00:00:00', '', $currentValue); - - $sValidFrom = ' - - -'; - $sValidFrom .= ' '; - $sValidFrom .= ''; - + + $sValidFrom = ''; + return sprintf($template,$sValidFrom); } @@ -54,14 +46,7 @@ function frontendusers_valid_from_wantedVariables () */ function frontendusers_valid_from_store ($variables) { global $feuser; - - if(Contenido_Security::isMySQLDate($variables["valid_from"], true) - || Contenido_Security::isMySQLDateTime($variables["valid_from"], true) - || empty($variables["valid_from"]) - || $variables["valid_from"] == "0000-00-00" - || $variables["valid_from"] == "1000-01-01") { - - $feuser->set("valid_from", $variables["valid_from"], false); - } -} -?> + if(!is_null($variables["valid_from"])) { + $feuser->set("valid_from", $variables["valid_from"], false); + } +} \ No newline at end of file diff --git a/conlite/plugins/frontendusers/valid_to/valid_to.php b/conlite/plugins/frontendusers/valid_to/valid_to.php index d3008fd..6e3cad9 100644 --- a/conlite/plugins/frontendusers/valid_to/valid_to.php +++ b/conlite/plugins/frontendusers/valid_to/valid_to.php @@ -7,33 +7,30 @@ function frontendusers_valid_to_getTitle () return i18n("Valid to"); } +/** + * @throws Exception + */ function frontendusers_valid_to_display () { - global $feuser,$db,$belang; + global $feuser; $template = '%s'; $currentValue = $feuser->get("valid_to"); - - if ($currentValue == '') { - $currentValue = '1000-01-01'; + + if($currentValue == "0000-00-00 00:00:00" || $currentValue == "") { + $currentValue = ''; + } else { + $datetime = new DateTime($currentValue); + $currentValue = $datetime->format('Y-m-d\TH:i'); } - $currentValue = str_replace('00:00:00', '', $currentValue); - - // js-includes are defined in valid_from - $sValidFrom = ' '; - $sValidFrom .= ''; - + + $sValidFrom = ''; return sprintf($template,$sValidFrom); } @@ -50,14 +47,8 @@ function frontendusers_valid_to_wantedVariables () */ function frontendusers_valid_to_store ($variables) { global $feuser; - - if(Contenido_Security::isMySQLDate($variables["valid_to"], true) - || Contenido_Security::isMySQLDateTime($variables["valid_to"], true) - || empty($variables["valid_to"]) - || $variables["valid_to"] == "0000-00-00" - || $variables["valid_to"] == "1000-01-01") { - + + if(!is_null($variables["valid_to"])) { $feuser->set("valid_to", $variables["valid_to"], false); } -} -?> +} \ No newline at end of file diff --git a/conlite/templates/standard/html5/template.generic_page.html b/conlite/templates/standard/html5/template.generic_page.html index 47ef937..eea3476 100644 --- a/conlite/templates/standard/html5/template.generic_page.html +++ b/conlite/templates/standard/html5/template.generic_page.html @@ -1,7 +1,6 @@ - {META} diff --git a/conlite/templates/standard/template.con_edit_form.html b/conlite/templates/standard/template.con_edit_form.html index 0076951..6155f23 100644 --- a/conlite/templates/standard/template.con_edit_form.html +++ b/conlite/templates/standard/template.con_edit_form.html @@ -1,3 +1,4 @@ + @@ -220,9 +221,7 @@ parent.parent.frames["right"].frames["right_top"].sub.clicked(menuItem.firstChild); } - { - DATAPUSH - } + {DATAPUSH} diff --git a/conlite/templates/standard/template.tplcfg_edit_form.html b/conlite/templates/standard/template.tplcfg_edit_form.html index 3c00b3b..4167106 100644 --- a/conlite/templates/standard/template.tplcfg_edit_form.html +++ b/conlite/templates/standard/template.tplcfg_edit_form.html @@ -1,7 +1,7 @@ - + template.tplcfg_edit_form.html @@ -56,7 +56,7 @@ {MARKSUBMENU} diff --git a/data/config/production/config.http_check.php b/data/config/production/config.http_check.php index f6009cd..8badcd2 100644 --- a/data/config/production/config.http_check.php +++ b/data/config/production/config.http_check.php @@ -70,6 +70,8 @@ $sMode = 'training'; #### Check whitelist #### $aCheck = array(); +$aCheck['GET']['error'] = CON_CHECK_INTEGER; + $aCheck['GET']['idart'] = CON_CHECK_INTEGER; $aCheck['GET']['idcat'] = CON_CHECK_INTEGER; $aCheck['GET']['idartlang'] = CON_CHECK_INTEGER; @@ -86,6 +88,4 @@ $aCheck['GET']['action'] = CON_CHECK_PRIMITIVESTRING; $aCheck['GET']['page'] = CON_CHECK_INTEGER; $aCheck['GET']['catname'] = CON_CHECK_PRIMITIVESTRING; -$aCheck['GET']['contenido'] = CON_CHECK_HASH32; - -?> \ No newline at end of file +$aCheck['GET']['contenido'] = CON_CHECK_HASH32; \ No newline at end of file diff --git a/data/config/production/config.misc.php b/data/config/production/config.misc.php index 4a0ee3b..e0553a1 100644 --- a/data/config/production/config.misc.php +++ b/data/config/production/config.misc.php @@ -148,9 +148,7 @@ ini_set("log_errors", true); ini_set("error_log", $cfg['path']['conlite_logs'] . "errorlog.txt"); /** - * Report all errors except warnings - * @todo change first if to use a local config var for servername - * + * Report all errors except warnings **/ if ($cfg["develop"]["show_errors"]) { error_reporting(E_ALL); diff --git a/nbproject/project.properties b/nbproject/project.properties deleted file mode 100644 index efdf308..0000000 --- a/nbproject/project.properties +++ /dev/null @@ -1,8 +0,0 @@ -auxiliary.org-netbeans-modules-php-smarty.smarty-framework=true -include.path=${php.global.include.path} -php.version=PHP_81 -source.encoding=UTF-8 -src.dir=. -tags.asp=false -tags.short=false -web.root=. diff --git a/nbproject/project.xml b/nbproject/project.xml deleted file mode 100644 index c7e626f..0000000 --- a/nbproject/project.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - org.netbeans.modules.php.project - - - cl_stage - - - diff --git a/rector.php b/rector.php new file mode 100644 index 0000000..7d50267 --- /dev/null +++ b/rector.php @@ -0,0 +1,35 @@ +autoloadPaths([ + __DIR__ . '/conlite', + __DIR__ . '/conlib', + __DIR__ . '/setup', + ]); + */ + $rectorConfig->bootstrapFiles([ + __DIR__ . '/rector_cl_autoload.php', + ]); + $rectorConfig->parallel(); + $rectorConfig->paths([ + __DIR__.'/conlite', + ]); + $rectorConfig->skip([ + __DIR__ . DIRECTORY_SEPARATOR . 'node_modules', + __DIR__ . DIRECTORY_SEPARATOR . 'var', + __DIR__ . DIRECTORY_SEPARATOR . 'vendor', + ]); + $rectorConfig->importNames(); + $rectorConfig->sets([ + LevelSetList::UP_TO_PHP_80, + SetList::CODE_QUALITY, + SetList::DEAD_CODE, + SetList::NAMING, + ]); +}; diff --git a/rector_cl_autoload.php b/rector_cl_autoload.php new file mode 100644 index 0000000..f4eb718 --- /dev/null +++ b/rector_cl_autoload.php @@ -0,0 +1,13 @@ + [ + 'config' => dirname(__FILE__) . '/data/config/production/', + 'contenido' => dirname(__FILE__) . '/conlite/', + ], +]; + +cAutoload::initialize($cfg); diff --git a/setup/dbupdate.php b/setup/dbupdate.php index 4a2a0b3..4b9b409 100644 --- a/setup/dbupdate.php +++ b/setup/dbupdate.php @@ -22,9 +22,9 @@ if (!defined('CON_FRAMEWORK')) { define('CON_FRAMEWORK', true); } -define('CON_SETUP_PATH', str_replace('\\', '/', realpath(dirname(__FILE__)))); +define('CON_SETUP_PATH', str_replace('\\', '/', realpath(__DIR__))); -define('CON_FRONTEND_PATH', str_replace('\\', '/', realpath(dirname(__FILE__) . '/../'))); +define('CON_FRONTEND_PATH', str_replace('\\', '/', realpath(__DIR__ . '/../'))); include_once('lib/startup.php'); @@ -113,7 +113,7 @@ if (cFileHandler::exists('data/tables_pi.txt')) { } } -$pluginChunks = array(); +$pluginChunks = []; $baseChunks = txtFileToArray('data/base.txt'); @@ -128,20 +128,12 @@ $contentChunks = txtFileToArray('data/examples.txt'); $sysadminChunk = txtFileToArray('data/sysadmin.txt'); if ($_SESSION['setuptype'] == 'setup') { - switch ($_SESSION['clientmode']) { - case 'CLIENT': - $fullChunks = array_merge($baseChunks, $sysadminChunk, $clientNoContentChunks); - break; - case 'CLIENTMODULES': - $fullChunks = array_merge($baseChunks, $sysadminChunk, $clientNoContentChunks, $moduleChunks); - break; - case 'CLIENTEXAMPLES': - $fullChunks = array_merge($baseChunks, $sysadminChunk, $clientChunks, $moduleChunks, $contentChunks); - break; - default: - $fullChunks = array_merge($baseChunks, $sysadminChunk); - break; - } + $fullChunks = match ($_SESSION['clientmode']) { + 'CLIENT' => array_merge($baseChunks, $sysadminChunk, $clientNoContentChunks), + 'CLIENTMODULES' => array_merge($baseChunks, $sysadminChunk, $clientNoContentChunks, $moduleChunks), + 'CLIENTEXAMPLES' => array_merge($baseChunks, $sysadminChunk, $clientChunks, $moduleChunks, $contentChunks), + default => array_merge($baseChunks, $sysadminChunk), + }; } else { $fullChunks = $baseChunks; } @@ -149,22 +141,19 @@ if ($_SESSION['setuptype'] == 'setup') { $fullChunks = array_merge($fullChunks, $pluginChunks); -list($root_path, $root_http_path) = getSystemDirectories(); +[$root_path, $root_http_path] = getSystemDirectories(); $totalsteps = ceil($fullcount / 50) + count($fullChunks) + 1; foreach ($fullChunks as $fullChunk) { $step++; if ($step == $currentstep) { - $failedChunks = array(); + $failedChunks = []; - $replacements = array( - '' => addslashes($root_path), - '' => addslashes($root_http_path) - ); + $replacements = ['' => addslashes($root_path), '' => addslashes($root_http_path)]; injectSQL($db, $_SESSION['dbprefix'], 'data/' . $fullChunk, $failedChunks, $replacements); - if (count($failedChunks) > 0) { + if ((is_countable($failedChunks) ? count($failedChunks) : 0) > 0) { $fp = fopen('../data/logs/setuplog.txt', 'w'); foreach ($failedChunks as $failedChunk) { fwrite($fp, sprintf("Setup was unable to execute SQL. MySQL-Error: %s, MySQL-Message: %s, SQL-Statements:\n%s", $failedChunk['errno'], $failedChunk['error'], $failedChunk['sql'])); @@ -189,14 +178,14 @@ if ($currentstep < $totalsteps) { // For import mod_history rows to versioning if ($_SESSION['setuptype'] == 'migration' || $_SESSION['setuptype'] == 'upgrade') { - $cfgClient = array(); + $cfgClient = []; rereadClients_Setup(); $oVersion = new VersionImport($cfg, $cfgClient, $db, $client, $area, $frame); $oVersion->CreateHistoryVersion(); } - $tables = array(); + $tables = []; while ($db->next_record()) { $tables[] = $db->f(0); @@ -240,7 +229,7 @@ if ($currentstep < $totalsteps) { } // Update Keys - $aNothing = array(); + $aNothing = []; injectSQL($db, $_SESSION['dbprefix'], 'data/indexes.sql', $aNothing); @@ -259,11 +248,9 @@ if ($currentstep < $totalsteps) { } function txtFileToArray($sFile) { - $aFileArray = array(); + $aFileArray = []; if (file_exists($sFile) && is_readable($sFile)) { $aFileArray = explode("\n", file_get_contents($sFile)); } return $aFileArray; -} - -?> \ No newline at end of file +} \ No newline at end of file diff --git a/setup/index.php b/setup/index.php index 5523328..10a3809 100644 --- a/setup/index.php +++ b/setup/index.php @@ -28,9 +28,9 @@ if (!defined('CON_FRAMEWORK')) { define('CON_FRAMEWORK', true); } -define('CON_SETUP_PATH', str_replace('\\', '/', realpath(dirname(__FILE__)))); +define('CON_SETUP_PATH', str_replace('\\', '/', realpath(__DIR__))); -define('CON_FRONTEND_PATH', str_replace('\\', '/', realpath(dirname(__FILE__) . '/../'))); +define('CON_FRONTEND_PATH', str_replace('\\', '/', realpath(__DIR__ . '/../'))); include_once('lib/startup.php'); @@ -70,7 +70,7 @@ if (is_array($_REQUEST)) { } -if (getPHPIniSetting('session.use_cookies') == 0) { +if (ini_get('session.use_cookies') == 0) { $sNotInstallableReason = 'session_use_cookies'; checkAndInclude('steps/notinstallable.php'); } @@ -104,92 +104,33 @@ if (array_key_exists('step', $_REQUEST)) { $iStep = ''; } -switch ($iStep) { - case 'setuptype': - checkAndInclude('steps/setuptype.php'); - break; - case 'setup1': - checkAndInclude('steps/setup/step1.php'); - break; - case 'setup2': - checkAndInclude('steps/setup/step2.php'); - break; - case 'setup3': - checkAndInclude('steps/setup/step3.php'); - break; - case 'setup4': - checkAndInclude('steps/setup/step4.php'); - break; - case 'setup5': - checkAndInclude('steps/setup/step5.php'); - break; - case 'setup6': - checkAndInclude('steps/setup/step6.php'); - break; - case 'setup7': - checkAndInclude('steps/setup/step7.php'); - break; - case 'setup8': - checkAndInclude('steps/setup/step8.php'); - break; - case 'migration1': - checkAndInclude('steps/migration/step1.php'); - break; - case 'migration2': - checkAndInclude('steps/migration/step2.php'); - break; - case 'migration3': - checkAndInclude('steps/migration/step3.php'); - break; - case 'migration4': - checkAndInclude('steps/migration/step4.php'); - break; - case 'migration5': - checkAndInclude('steps/migration/step5.php'); - break; - case 'migration6': - checkAndInclude('steps/migration/step6.php'); - break; - case 'migration7': - checkAndInclude('steps/migration/step7.php'); - break; - case 'migration8': - checkAndInclude('steps/migration/step8.php'); - break; - case 'upgrade1': - checkAndInclude('steps/upgrade/step1.php'); - break; - case 'upgrade2': - checkAndInclude('steps/upgrade/step2.php'); - break; - case 'upgrade3': - checkAndInclude('steps/upgrade/step3.php'); - break; - case 'upgrade4': - checkAndInclude('steps/upgrade/step4.php'); - break; - case 'upgrade5': - checkAndInclude('steps/upgrade/step5.php'); - break; - case 'upgrade6': - checkAndInclude('steps/upgrade/step6.php'); - break; - case 'upgrade7': - checkAndInclude('steps/upgrade/step7.php'); - break; - case 'domigration': - checkAndInclude('steps/migration/domigration.php'); - break; - case 'doupgrade': - checkAndInclude('steps/upgrade/doupgrade.php'); - break; - case 'doinstall': - checkAndInclude('steps/setup/doinstall.php'); - break; - case 'languagechooser': - default: - checkAndInclude('steps/languagechooser.php'); - break; -} - -?> \ No newline at end of file +match ($iStep) { + 'setuptype' => checkAndInclude('steps/setuptype.php'), + 'setup1' => checkAndInclude('steps/setup/step1.php'), + 'setup2' => checkAndInclude('steps/setup/step2.php'), + 'setup3' => checkAndInclude('steps/setup/step3.php'), + 'setup4' => checkAndInclude('steps/setup/step4.php'), + 'setup5' => checkAndInclude('steps/setup/step5.php'), + 'setup6' => checkAndInclude('steps/setup/step6.php'), + 'setup7' => checkAndInclude('steps/setup/step7.php'), + 'setup8' => checkAndInclude('steps/setup/step8.php'), + 'migration1' => checkAndInclude('steps/migration/step1.php'), + 'migration2' => checkAndInclude('steps/migration/step2.php'), + 'migration3' => checkAndInclude('steps/migration/step3.php'), + 'migration4' => checkAndInclude('steps/migration/step4.php'), + 'migration5' => checkAndInclude('steps/migration/step5.php'), + 'migration6' => checkAndInclude('steps/migration/step6.php'), + 'migration7' => checkAndInclude('steps/migration/step7.php'), + 'migration8' => checkAndInclude('steps/migration/step8.php'), + 'upgrade1' => checkAndInclude('steps/upgrade/step1.php'), + 'upgrade2' => checkAndInclude('steps/upgrade/step2.php'), + 'upgrade3' => checkAndInclude('steps/upgrade/step3.php'), + 'upgrade4' => checkAndInclude('steps/upgrade/step4.php'), + 'upgrade5' => checkAndInclude('steps/upgrade/step5.php'), + 'upgrade6' => checkAndInclude('steps/upgrade/step6.php'), + 'upgrade7' => checkAndInclude('steps/upgrade/step7.php'), + 'domigration' => checkAndInclude('steps/migration/domigration.php'), + 'doupgrade' => checkAndInclude('steps/upgrade/doupgrade.php'), + 'doinstall' => checkAndInclude('steps/setup/doinstall.php'), + default => checkAndInclude('steps/languagechooser.php'), +}; \ No newline at end of file diff --git a/setup/lib/class.setupcontrols.php b/setup/lib/class.setupcontrols.php index ccac2aa..35b1ee3 100644 --- a/setup/lib/class.setupcontrols.php +++ b/setup/lib/class.setupcontrols.php @@ -33,11 +33,12 @@ class cHTMLAlphaImage extends cHTMLImage { - var $_sClickImage; - var $_sMouseoverClickImage; - var $_sMouseoverSrc; + protected $_sClickImage; + protected $_sMouseoverClickImage; + protected $_sMouseoverSrc; - function __construct() { + public function __construct() + { parent::__construct(); } @@ -76,20 +77,21 @@ class cHTMLAlphaImage extends cHTMLImage { $this->attachEventDefinition("mouseover", "onMouseOut", sprintf($sMouseScript, $this->_src) ); } } - - return parent::toHTML(); + + return parent::toHTML(); } } class cHTMLErrorMessageList extends cHTMLDiv { - + protected cHTMLTable $_oTable; + /** * cHTMLErrorMessageList list all errors using a table */ public function __construct() { $this->_oTable = new cHTMLTable(); - $this->_oTable->setWidth("100%"); + $this->_oTable->setWidth("100%"); parent::__construct(); $this->setClass("errorlist"); $this->setStyle("width: 450px; height: 218px; overflow: auto; border: 1px solid black;"); @@ -106,7 +108,13 @@ class cHTMLErrorMessageList extends cHTMLDiv { } class cHTMLFoldableErrorMessage extends cHTMLTableRow { - + protected cHTMLTableData $_oFolding; + public cHTMLTableData $_oContent; + protected cHTMLTableData $_oIcon; + protected cHTMLAlphaImage $_oIconImg; + protected cHTMLDiv $_oTitle; + protected cHTMLDiv $_oMessage; + /** * * @param string $sTitle @@ -143,7 +151,7 @@ class cHTMLFoldableErrorMessage extends cHTMLTableRow { $this->_oContent->setVerticalAlignment("top"); $this->_oContent->setClass("entry"); - $this->_oContent->setContent(array($this->_oTitle, $this->_oMessage)); + $this->_oContent->setContent([$this->_oTitle, $this->_oMessage]); $this->_oIcon->setClass("icon"); $this->_oIcon->setVerticalAlignment("top"); @@ -162,18 +170,19 @@ class cHTMLFoldableErrorMessage extends cHTMLTableRow { } else { $this->_oIcon->setContent(" "); } - parent::__construct(); } function toHTML() { - $this->setContent(array($this->_oFolding, $this->_oContent, $this->_oIcon)); - return parent::toHTML(); + $this->setContent([$this->_oFolding, $this->_oContent, $this->_oIcon]); + return parent::toHTML(); } } class cHTMLInfoMessage extends cHTMLTableRow { - + protected cHTMLTableData $_oTitle; + protected cHTMLTableData $_oMessage; + /** * * @param string $sTitle @@ -195,7 +204,7 @@ class cHTMLInfoMessage extends cHTMLTableRow { } function toHTML() { - $this->setContent(array($this->_oTitle, $this->_oMessage)); + $this->setContent([$this->_oTitle, $this->_oMessage]); return parent::toHTML(); } } @@ -210,7 +219,7 @@ class cHTMLLanguageLink extends cHTMLDiv { */ function __construct($langcode, $langname, $stepnumber) { parent::__construct(); - + $linkImage = new cHTMLAlphaImage(); $linkImage->setAlt(""); $linkImage->setSrc("../conlite/images/submit.gif"); @@ -250,7 +259,7 @@ class cHTMLButtonLink extends cHTMLDiv { */ function __construct($href, $title) { parent::__construct(); - + $linkImage = new cHTMLAlphaImage(); $linkImage->setSrc("../conlite/images/submit.gif"); $linkImage->setMouseover("../conlite/images/submit_hover.gif"); @@ -277,5 +286,4 @@ class cHTMLButtonLink extends cHTMLDiv { $alignment = '
%s%s
'; $this->setContent(sprintf($alignment, $link->render(), $link2->render())); } -} -?> \ No newline at end of file +} \ No newline at end of file diff --git a/setup/lib/class.setupmask.php b/setup/lib/class.setupmask.php index 4fb5c90..eaa6175 100644 --- a/setup/lib/class.setupmask.php +++ b/setup/lib/class.setupmask.php @@ -24,14 +24,38 @@ if (!defined('CON_FRAMEWORK')) { } class cSetupMask { + + /** + * @var object Template + */ + protected $_oTpl; + + /** + * @var object Template + */ + protected $_oStepTemplate; + + /** + * + * @var bool + */ + protected $_bNavigationEnabled = false; + + /** + * + * @var string + */ + protected $_sHeader; + public mixed $_bBackstep; + public mixed $_bNextstep; - public function __construct($sStepTemplate, $iStep = false) { - $this->_oTpl = new Template; - $this->_oStepTemplate = new Template; - - $this->_sStepTemplate = $sStepTemplate; - $this->_iStep = $iStep; - $this->_bNavigationEnabled = false; + /** + * @param string $sStepTemplate + * @param int $iStep + */ + public function __construct(protected $_sStepTemplate, protected $_iStep = false) { + $this->_oTpl = new Template(); + $this->_oStepTemplate = new Template(); } public function setNavigation($sBackstep, $sNextstep) { @@ -47,20 +71,12 @@ class cSetupMask { $sSetupType = ""; } - switch ($sSetupType) { - case "setup": - $this->_sHeader = "Setup - " . $sHeader; - break; - case "upgrade": - $this->_sHeader = "Upgrade - " . $sHeader; - break; - case "migration": - $this->_sHeader = "Migration - " . $sHeader; - break; - default: - $this->_sHeader = $sHeader; - break; - } + $this->_sHeader = match ($sSetupType) { + "setup" => "Setup - " . $sHeader, + "upgrade" => "Upgrade - " . $sHeader, + "migration" => "Migration - " . $sHeader, + default => $sHeader, + }; } public function _createNavigation() { diff --git a/setup/lib/class.template.php b/setup/lib/class.template.php index 8e587d1..8f8e993 100644 --- a/setup/lib/class.template.php +++ b/setup/lib/class.template.php @@ -29,63 +29,66 @@ class Template { * Needles (static) * @var array */ - var $needles = array(); + public $needles = []; /** * Replacements (static) * @var array */ - var $replacements = array(); + public $replacements = []; /** * Dyn_Needles (dynamic) * @var array */ - var $Dyn_needles = array(); + public $Dyn_needles = []; /** * Dyn_Replacements (dynamic) * @var array */ - var $Dyn_replacements = array(); + public $Dyn_replacements = []; /** * Database instance * @var object */ - var $db; + public $db; /** * Template cache * @var array */ - var $tplcache; + public $tplcache; /** * Template name cache * @var array */ - var $tplnamecache; + public $tplnamecache; /** * Dynamic counter * @var int */ - var $dyn_cnt = 0; + public $dyn_cnt = 0; /** * Tags array (for dynamic blocks); * @var array */ - var $tags = array('static' => '{%s}', 'start' => '', 'end' => ''); + public $tags = ['static' => '{%s}', 'start' => '', 'end' => '']; + + protected $_sDomain; + protected $_encoding; /** * Constructor function * @return void */ public function __construct($tags = false) { - $this->tplcache = Array(); - $this->tplnamecache = Array(); + $this->tplcache = []; + $this->tplnamecache = []; if (is_array($tags)) { $this->tags = $tags; @@ -157,10 +160,10 @@ class Template { */ public function reset() { $this->dyn_cnt = 0; - $this->needles = array(); - $this->replacements = array(); - $this->Dyn_needles = array(); - $this->Dyn_replacements = array(); + $this->needles = []; + $this->replacements = []; + $this->Dyn_needles = []; + $this->Dyn_replacements = []; } /** @@ -184,7 +187,7 @@ class Template { $content = (($note) ? "\n" : "") . $content; - $pieces = array(); + $pieces = []; //if content has dynamic blocks if (preg_match("/^.*" . preg_quote($this->tags['start'], "/") . ".*?" . preg_quote($this->tags['end'], "/") . ".*$/s", $content)) { @@ -243,7 +246,7 @@ class Template { * @param $functionName string Name of the translation function (e.g. i18n) */ public function replacei18n(& $template, $functionName) { - $matches = array(); + $matches = []; //if template contains functionName + parameter store all matches preg_match_all("/" . preg_quote($functionName, "/") . "\\(([\\\"\\'])(.*?)\\1\\)/s", $template, $matches); diff --git a/setup/lib/defines.php b/setup/lib/defines.php index b9af3a4..1451073 100644 --- a/setup/lib/defines.php +++ b/setup/lib/defines.php @@ -38,5 +38,10 @@ define('C_SETUP_STEPFILE_ACTIVE', 'images/steps/s%da.png'); define('C_SETUP_STEPWIDTH', 28); define('C_SETUP_STEPHEIGHT', 28); define('C_SETUP_MIN_PHP_VERSION', '7.4.0'); -define('C_SETUP_MAX_PHP_VERSION', '8.0.0'); -define('C_SETUP_VERSION', '2.1.3'); +define('C_SETUP_MAX_PHP_VERSION', '8.3.0'); +define('C_SETUP_VERSION', '3.0.0'); + +$sDefLocalPath = __DIR__.DIRECTORY_SEPARATOR.'defines.local.php'; +if(file_exists($sDefLocalPath)) { + include_once $sDefLocalPath; +} \ No newline at end of file diff --git a/setup/lib/functions.environment.php b/setup/lib/functions.environment.php index 15c34d5..a349819 100644 --- a/setup/lib/functions.environment.php +++ b/setup/lib/functions.environment.php @@ -48,7 +48,7 @@ function getServerUID () return posix_getuid(); } - $sFilename = md5(mt_rand()) . ".txt"; + $sFilename = md5(random_int(0, mt_getrandmax())) . ".txt"; if (isWriteable(".")) { @@ -81,7 +81,7 @@ function getServerGID () return posix_getgid(); } - $sFilename = md5(mt_rand()) . ".txt"; + $sFilename = md5(random_int(0, mt_getrandmax())) . ".txt"; if (isWriteable(".")) { @@ -131,7 +131,7 @@ function cInitializeArrayKey (&$aArray, $sKey, $mDefault = "") return false; } - $aArray = array(); + $aArray = []; } if (!array_key_exists($sKey, $aArray)) diff --git a/setup/lib/functions.filesystem.php b/setup/lib/functions.filesystem.php index 5ea0950..15cee90 100644 --- a/setup/lib/functions.filesystem.php +++ b/setup/lib/functions.filesystem.php @@ -101,7 +101,7 @@ function canWriteFile($sFilename) { #try to find a random filename for write test, which does not exist while (file_exists($sRandFilenamePath) && $i < 100) { - $sRandFilename = 'con_test' . rand(0, 1000000000) . 'con_test'; + $sRandFilename = 'con_test' . random_int(0, 1_000_000_000) . 'con_test'; $sRandFilenamePath = ''; if ($sFilename[strlen($sFilename) - 1] == '/') { @@ -122,7 +122,7 @@ function canWriteFile($sFilename) { * a wrong information */ $fp = @fopen($sRandFilenamePath, "w"); - if ($fp) { + if (is_resource($fp)) { @fclose($fp); unlink($sRandFilenamePath); return true; @@ -144,7 +144,9 @@ function canWriteFile($sFilename) { * a wrong information */ $fp = @fopen($sFilename, "w"); - @fclose($fp); + if (is_resource($fp)) { + fclose($fp); + } if (file_exists($sFilename)) { @unlink($sFilename); @@ -223,7 +225,7 @@ function getFileInfo($sFilename) { break; } - $aFileinfo = array(); + $aFileinfo = []; $aFileinfo["info"] = $info; $aFileinfo["type"] = $type; $aFileinfo["owner"]["read"] = ($oiFilePermissions & 0x0100) ? true : false; @@ -238,7 +240,7 @@ function getFileInfo($sFilename) { } function checkOpenBasedirCompatibility() { - $value = getPHPIniSetting("open_basedir"); + $value = ini_get("open_basedir"); if (isWindows()) { $aBasedirEntries = explode(";", $value); diff --git a/setup/lib/functions.libraries.php b/setup/lib/functions.libraries.php index 024913e..33e5591 100644 --- a/setup/lib/functions.libraries.php +++ b/setup/lib/functions.libraries.php @@ -80,7 +80,7 @@ function isImageMagickAvailable () } } - $output = array(); + $output = []; $retval = ""; @@ -91,7 +91,7 @@ function isImageMagickAvailable () return false; } - if (strpos($output[0],"ImageMagick") !== false) + if (str_contains($output[0],"ImageMagick")) { $_imagemagickAvailable = true; return true; diff --git a/setup/lib/functions.mysql.php b/setup/lib/functions.mysql.php index 2ffd7ed..70d90fa 100644 --- a/setup/lib/functions.mysql.php +++ b/setup/lib/functions.mysql.php @@ -51,46 +51,25 @@ function hasMySQLiExtension() { } function doMySQLConnect($host, $username, $password) { - $aOptions = array( - 'connection' => array( - 'host' => $host, - 'user' => $username, - 'password' => $password, - ), - ); + $aOptions = ['connection' => ['host' => $host, 'user' => $username, 'password' => $password]]; $db = new DB_Contenido($aOptions); //$sFile = '../data/logs/setup_queries.txt'; //file_put_contents($sFile, $db->getServerInfo(), FILE_APPEND); //chmod($sFile, 0666); if (empty($db->connect())) { - return array($db, false); + return [$db, false]; } else { - return array($db, true); + return [$db, true]; } } function getSetupMySQLDBConnection($full = true) { if ($full === false) { // host, user and password - $aOptions = array( - 'connection' => array( - 'host' => $_SESSION["dbhost"], - 'user' => $_SESSION["dbuser"], - 'password' => $_SESSION["dbpass"] - ), - 'sequenceTable' => $_SESSION['dbprefix'] . '_sequence' - ); + $aOptions = ['connection' => ['host' => $_SESSION["dbhost"], 'user' => $_SESSION["dbuser"], 'password' => $_SESSION["dbpass"]], 'sequenceTable' => $_SESSION['dbprefix'] . '_sequence']; } else { // host, database, user and password - $aOptions = array( - 'connection' => array( - 'host' => $_SESSION["dbhost"], - 'database' => $_SESSION["dbname"], - 'user' => $_SESSION["dbuser"], - 'password' => $_SESSION["dbpass"] - ), - 'sequenceTable' => $_SESSION['dbprefix'] . '_sequence' - ); + $aOptions = ['connection' => ['host' => $_SESSION["dbhost"], 'database' => $_SESSION["dbname"], 'user' => $_SESSION["dbuser"], 'password' => $_SESSION["dbpass"]], 'sequenceTable' => $_SESSION['dbprefix'] . '_sequence']; } //$aOptions['enableProfiling'] = TRUE; @@ -135,7 +114,8 @@ function checkMySQLDatabaseCreation($db, $database) { } } -function checkMySQLDatabaseExists($db, $database) { +function checkMySQLDatabaseExists($db, $database): bool +{ $db->connect(); if (hasMySQLiExtension() && !hasMySQLExtension()) { @@ -151,7 +131,7 @@ function checkMySQLDatabaseExists($db, $database) { } } } else { - if (@mysql_select_db($database, $db->Link_ID)) { + if (mysqli_select_db($db->Link_ID, $database)) { return true; } else { $db->query("SHOW DATABASES LIKE '$database'"); @@ -175,7 +155,7 @@ function checkMySQLDatabaseUse($db, $database) { return false; } } else { - if (@mysql_select_db($database, $db->Link_ID)) { + if (@mysqli_select_db($db->Link_ID, $database)) { return true; } else { return false; @@ -253,7 +233,7 @@ function checkMySQLDropDatabase($db, $database) { function fetchMySQLStorageEngines($db) { $db->query("SHOW ENGINES"); - $engines = array(); + $engines = []; while ($db->next_record()) { $engines[] = $db->f(0); diff --git a/setup/lib/functions.phpinfo.php b/setup/lib/functions.phpinfo.php index e98ac9a..309038c 100644 --- a/setup/lib/functions.phpinfo.php +++ b/setup/lib/functions.phpinfo.php @@ -1,12 +1,12 @@ (int)$val * 1024, + 'm', 'M' => (int)$val * 1_048_576, + default => $val, + }; } -function isPHPExtensionLoaded($extension) { +function isPHPExtensionLoaded($extension) +{ $value = extension_loaded($extension); - - if ($value === NULL) { - return E_EXTENSION_CANTCHECK; - } - if ($value === true) { return E_EXTENSION_AVAILABLE; } @@ -156,30 +111,18 @@ function isPHPExtensionLoaded($extension) { if ($value === false) { return E_EXTENSION_UNAVAILABLE; } -} -function isRegisterLongArraysActive() { - if (version_compare(phpversion(), "5.0.0", ">=") == true) { - if (getPHPIniSetting("register_long_arrays") == false) { - return false; - } + if ($value === NULL) { + return E_EXTENSION_CANTCHECK; } - - return true; } /** * Test for PHP compatibility - * + * * @param string $sVersion phpversion to test - * @return boolean */ -function isPHPCompatible($sVersion = "5.2.0") { - if (version_compare(phpversion(), $sVersion, ">=") == true) { - return true; - } else { - return false; - } -} - -?> \ No newline at end of file +function isPHPCompatible($sVersion = "8.0.0"): bool +{ + return version_compare(phpversion(), $sVersion, ">="); +} \ No newline at end of file diff --git a/setup/lib/functions.safe_mode.php b/setup/lib/functions.safe_mode.php index 1340c6e..a402fa6 100644 --- a/setup/lib/functions.safe_mode.php +++ b/setup/lib/functions.safe_mode.php @@ -34,7 +34,7 @@ function getSafeModeStatus () { - if (getPHPIniSetting("safe_mode") == "1") + if (ini_get("safe_mode") == "1") { return true; } else { @@ -44,7 +44,7 @@ function getSafeModeStatus () function getSafeModeGidStatus () { - if (getPHPIniSetting("safe_mode_gid") == "1") + if (ini_get("safe_mode_gid") == "1") { return true; } else { @@ -54,16 +54,16 @@ function getSafeModeGidStatus () function getSafeModeIncludeDir () { - return getPHPIniSetting("safe_mode_include_dir"); + return ini_get("safe_mode_include_dir"); } function getOpenBasedir () { - return getPHPIniSetting("open_basedir"); + return ini_get("open_basedir"); } function getDisabledFunctions () { - return getPHPIniSetting("disable_functions"); + return ini_get("disable_functions"); } ?> \ No newline at end of file diff --git a/setup/lib/functions.sql.php b/setup/lib/functions.sql.php index 4d22595..d2b0ba2 100644 --- a/setup/lib/functions.sql.php +++ b/setup/lib/functions.sql.php @@ -32,7 +32,7 @@ if (!defined('CON_FRAMEWORK')) { die('Illegal call'); } -function injectSQL(&$db, $prefix, $file, &$failedChunks, $replacements = array()) { +function injectSQL(&$db, $prefix, $file, &$failedChunks, $replacements = []) { $file = trim($file); if (!isReadable($file)) { @@ -56,7 +56,7 @@ function injectSQL(&$db, $prefix, $file, &$failedChunks, $replacements = array() $db->query($sqlChunk); if ($db->Errno != 0) { - $failedChunks[] = array("sql" => $sqlChunk, "errno" => $db->Errno, "error" => $db->Error); + $failedChunks[] = ["sql" => $sqlChunk, "errno" => $db->Errno, "error" => $db->Error]; } } @@ -130,10 +130,10 @@ function split_sql_file($sql, $delimiter) { // try to save mem. $sql = ""; - $output = array(); + $output = []; // we don't actually care about the matches preg gives us. - $matches = array(); + $matches = []; // this is faster than calling count($oktens) every time thru the loop. $token_count = count($tokens); diff --git a/setup/lib/functions.system.php b/setup/lib/functions.system.php index 5c117a8..b70525c 100644 --- a/setup/lib/functions.system.php +++ b/setup/lib/functions.system.php @@ -48,27 +48,13 @@ function checkExistingPlugin($db, $sPluginname) { $sTable = $_SESSION["dbprefix"] . "_nav_sub"; $sSql = ""; - switch ($sPluginname) { - case 'plugin_conman': - $sSql = "SELECT * FROM %s WHERE idnavs='900'"; - break; - - case 'plugin_content_allocation': - $sSql = "SELECT * FROM %s WHERE idnavs='800'"; - break; - - case 'plugin_newsletter': - $sSql = "SELECT * FROM %s WHERE idnavs='610'"; - break; - - case 'mod_rewrite': - $sSql = "SELECT * FROM %s WHERE idnavs='700' OR location='mod_rewrite/xml/;navigation/content/mod_rewrite'"; - break; - - default: - $sSql = ""; - break; - } + $sSql = match ($sPluginname) { + 'plugin_conman' => "SELECT * FROM %s WHERE idnavs='900'", + 'plugin_content_allocation' => "SELECT * FROM %s WHERE idnavs='800'", + 'plugin_newsletter' => "SELECT * FROM %s WHERE idnavs='610'", + 'mod_rewrite' => "SELECT * FROM %s WHERE idnavs='700' OR location='mod_rewrite/xml/;navigation/content/mod_rewrite'", + default => "", + }; if ($sSql) { $db->query(sprintf($sSql, $sTable)); @@ -86,21 +72,7 @@ function checkExistingPlugin($db, $sPluginname) { * @param string $table db-table name */ function updateSystemProperties($db, $table) { - $aStandardvalues = array(array('type' => 'pw_request', 'name' => 'enable', 'value' => 'true'), - array('type' => 'system', 'name' => 'mail_sender_name', 'value' => 'noreply%40conlite.org'), - array('type' => 'system', 'name' => 'mail_sender', 'value' => 'ConLite+Backend'), - array('type' => 'system', 'name' => 'mail_host', 'value' => 'localhost'), - array('type' => 'maintenance', 'name' => 'mode', 'value' => 'disabled'), - array('type' => 'edit_area', 'name' => 'activated', 'value' => 'true'), - array('type' => 'update', 'name' => 'check', 'value' => 'false'), - array('type' => 'update', 'name' => 'news_feed', 'value' => 'false'), - array('type' => 'update', 'name' => 'check_period', 'value' => '60'), - array('type' => 'system', 'name' => 'clickmenu', 'value' => 'false'), - array('type' => 'versioning', 'name' => 'activated', 'value' => 'true'), - array('type' => 'versioning', 'name' => 'prune_limit', 'value' => '0'), - array('type' => 'versioning', 'name' => 'path', 'value' => ''), - array('type' => 'system', 'name' => 'insight_editing_activated', 'value' => 'true') - ); + $aStandardvalues = [['type' => 'pw_request', 'name' => 'enable', 'value' => 'true'], ['type' => 'system', 'name' => 'mail_sender_name', 'value' => 'noreply%40conlite.org'], ['type' => 'system', 'name' => 'mail_sender', 'value' => 'ConLite+Backend'], ['type' => 'system', 'name' => 'mail_host', 'value' => 'localhost'], ['type' => 'maintenance', 'name' => 'mode', 'value' => 'disabled'], ['type' => 'edit_area', 'name' => 'activated', 'value' => 'true'], ['type' => 'update', 'name' => 'check', 'value' => 'false'], ['type' => 'update', 'name' => 'news_feed', 'value' => 'false'], ['type' => 'update', 'name' => 'check_period', 'value' => '60'], ['type' => 'system', 'name' => 'clickmenu', 'value' => 'false'], ['type' => 'versioning', 'name' => 'activated', 'value' => 'true'], ['type' => 'versioning', 'name' => 'prune_limit', 'value' => '0'], ['type' => 'versioning', 'name' => 'path', 'value' => ''], ['type' => 'system', 'name' => 'insight_editing_activated', 'value' => 'true']]; foreach ($aStandardvalues as $aData) { $sql = "SELECT value FROM %s WHERE type='" . $aData['type'] . "' AND name='" . $aData['name'] . "'"; @@ -163,10 +135,10 @@ function listClients($db, $table) { $db->query(sprintf($sql, Contenido_Security::escapeDB($table, $db))); - $clients = array(); + $clients = []; while ($db->next_record()) { - $clients[$db->f("idclient")] = array("name" => $db->f("name"), "frontendpath" => $db->f("frontendpath"), "htmlpath" => $db->f("htmlpath")); + $clients[$db->f("idclient")] = ["name" => $db->f("name"), "frontendpath" => $db->f("frontendpath"), "htmlpath" => $db->f("htmlpath")]; } return $clients; @@ -192,8 +164,8 @@ function getSystemDirectories($bOriginalPath = false) { $root_path = str_replace("\\", "/", $root_path); - $root_path = dirname(dirname(dirname($root_path))); - $root_http_path = dirname(dirname($_SERVER["PHP_SELF"])); + $root_path = dirname($root_path, 3); + $root_http_path = dirname($_SERVER["PHP_SELF"], 2); $root_path = str_replace("\\", "/", $root_path); $root_http_path = str_replace("\\", "/", $root_http_path); @@ -216,7 +188,7 @@ function getSystemDirectories($bOriginalPath = false) { } if ($bOriginalPath == true) { - return array($root_path, $root_http_path); + return [$root_path, $root_http_path]; } if (isset($_SESSION["override_root_path"])) { @@ -230,7 +202,7 @@ function getSystemDirectories($bOriginalPath = false) { $root_path = stripLastSlash($root_path); $root_http_path = stripLastSlash($root_http_path); - return array($root_path, $root_http_path); + return [$root_path, $root_http_path]; } function findSimilarText($string1, $string2) { diff --git a/setup/lib/startup.php b/setup/lib/startup.php index 54cbd38..a856694 100644 --- a/setup/lib/startup.php +++ b/setup/lib/startup.php @@ -23,6 +23,14 @@ define('CON_BE_PATH', '../conlite/'); session_start(); require_once 'lib/defines.php'; +/* + * SetEnv CL_VERSION + */ +if (!defined('CL_VERSION')) { + + define('CL_VERSION', C_SETUP_VERSION); + +} // uncomment this lines during development if needed error_reporting(E_ALL ^ E_NOTICE); @@ -89,23 +97,28 @@ global $cfg; $cfg['path']['frontend'] = CON_FRONTEND_PATH; $cfg['path']['conlite'] = $cfg['path']['frontend'] . '/conlite/'; $cfg['path']['conlite_config'] = CON_FRONTEND_PATH . '/data/config/' . CL_ENVIRONMENT . '/'; +$cfg['path']['conlite_logs'] = CON_FRONTEND_PATH . '/data/logs/'; if(!is_dir($cfg['path']['conlite_config'])) { die("Setup cannot find the config folder \"".$cfg['path']['conlite_config']."\"! Make shure folder exists and is readable."); } -// (bool) Flag to use native i18n. -// Note: Enabling this could create unwanted side effects, because of -// native gettext() behavior. -$cfg['native_i18n'] = false; +checkAndInclude($cfg['path']['conlite_config'] . 'config.misc.php'); +checkAndInclude($cfg['path']['conlite_config'] . 'cfg_sql.inc.php'); + +include_once dirname(__DIR__, 2) . '/vendor/autoload.php'; // includes +/** @todo use conlite autoload to load needed classes */ checkAndInclude($cfg['path']['frontend'] . '/pear/HTML/Common2.php'); +checkAndInclude($cfg['path']['conlite'] . 'classes/con2con/class.registry.php'); + +checkAndInclude($cfg['path']['conlite'] . 'classes/class.genericdb.php'); checkAndInclude($cfg['path']['conlite'] . 'classes/cHTML5/class.chtml5.common.php'); checkAndInclude($cfg['path']['conlite'] . 'classes/cHTML5/class.chtml.php'); checkAndInclude($cfg['path']['conlite'] . 'classes/class.htmlelements.php'); checkAndInclude($cfg['path']['conlite'] . 'classes/con2con/class.filehandler.php'); -checkAndInclude($cfg['path']['conlite'] . 'includes/functions.php54.php'); +checkAndInclude($cfg['path']['conlite'] . 'classes/contenido/class.language.php'); checkAndInclude($cfg['path']['conlite'] . 'classes/class.i18n.php'); checkAndInclude($cfg['path']['conlite'] . 'includes/functions.i18n.php'); checkAndInclude('lib/class.setupcontrols.php'); @@ -119,5 +132,4 @@ checkAndInclude('lib/functions.libraries.php'); checkAndInclude('lib/functions.sql.php'); checkAndInclude('lib/functions.setup.php'); checkAndInclude('lib/class.template.php'); -checkAndInclude('lib/class.setupmask.php'); -?> +checkAndInclude('lib/class.setupmask.php'); \ No newline at end of file diff --git a/setup/makeconfig.php b/setup/makeconfig.php index 442969c..5fdf92c 100644 --- a/setup/makeconfig.php +++ b/setup/makeconfig.php @@ -33,13 +33,13 @@ if (!defined('CON_FRAMEWORK')) { define('CON_FRAMEWORK', true); } -define('CON_SETUP_PATH', str_replace('\\', '/', realpath(dirname(__FILE__)))); +define('CON_SETUP_PATH', str_replace('\\', '/', realpath(__DIR__))); -define('CON_FRONTEND_PATH', str_replace('\\', '/', realpath(dirname(__FILE__) . '/../'))); +define('CON_FRONTEND_PATH', str_replace('\\', '/', realpath(__DIR__ . '/../'))); include_once('lib/startup.php'); -list($root_path, $root_http_path) = getSystemDirectories(); +[$root_path, $root_http_path] = getSystemDirectories(); $tpl = new Template(); $tpl->set('s', 'CONTENIDO_ROOT', $root_path); @@ -94,7 +94,7 @@ if ($_SESSION['configmode'] == 'save') { } } else { header('Content-Type: application/octet-stream'); - header('Etag: ' . md5(mt_rand())); + header('Etag: ' . md5(random_int(0, mt_getrandmax()))); header('Content-Disposition: attachment;filename=config.php'); $tpl->generate('templates/config.php.tpl', false, false); } diff --git a/setup/steps/forms/additionalplugins.php b/setup/steps/forms/additionalplugins.php index 7c84bb3..f1f37ec 100644 --- a/setup/steps/forms/additionalplugins.php +++ b/setup/steps/forms/additionalplugins.php @@ -57,7 +57,7 @@ class cSetupAdditionalPlugins extends cSetupMask { $this->_oStepTemplate->set("s", "DESCRIPTION", i18n_setup("Please select Plugins to be installed")); // add new plugins to this array and you're done. - $aPlugins = array(); + $aPlugins = []; //$aPlugins['plugin_newsletter'] = array('label' => i18n_setup('Newsletter'), 'desc' => i18n_setup('Newsletterfunctionality for dispatching text newsletters and HTML-Newsletters, extensible with professional newsletter extensions. Definition of newsletter recipients and groups of recipients. Layout design of the HTML-Newsletters by ConLite articles.')); //$aPlugins['plugin_content_allocation'] = array('label' => i18n_setup('Content Allocation'), 'desc' => i18n_setup('For the representation and administration of content, 4fb developed the Content Allocation and content include technology. This technology dynamically allows on basis of a Template, to put the content in different places and in different formats according to several criteria.')); //$aPlugins['plugin_mod_rewrite'] = array('label' => i18n_setup('Mod Rewrite'), 'desc' => i18n_setup('Creates so called Clean URLs for a ConLite installation')); diff --git a/setup/steps/forms/clientadjust.php b/setup/steps/forms/clientadjust.php index e7ffff9..0eb7a79 100644 --- a/setup/steps/forms/clientadjust.php +++ b/setup/steps/forms/clientadjust.php @@ -50,11 +50,11 @@ class cSetupClientAdjust extends cSetupMask { $cHTMLErrorMessageList = new cHTMLErrorMessageList; $cHTMLErrorMessageList->setStyle("width: 580px; height: 200px; overflow: auto; border: 1px solid black;"); - $cHTMLFoldableErrorMessages = array(); + $cHTMLFoldableErrorMessages = []; - $aPathList = array(); + $aPathList = []; - list($a_root_path, $a_root_http_path) = getSystemDirectories(); + [$a_root_path, $a_root_http_path] = getSystemDirectories(); @include($a_root_path . "data/config/" . CL_ENVIRONMENT . "/config.php"); @@ -91,7 +91,7 @@ class cSetupClientAdjust extends cSetupMask { $oSystemPathBox = new cHTMLTextbox("frontendpath[$iIdClient]", $_SESSION["frontendpath"][$iIdClient]); $oSystemPathBox->setWidth(100); $oSystemPathBox->setClass("small"); - $oClientSystemPath = new cHTMLInfoMessage(array($sName, $oSystemPathBox), " "); + $oClientSystemPath = new cHTMLInfoMessage([$sName, $oSystemPathBox], " "); $oClientSystemPath->_oTitle->setStyle("padding-left: 8px; padding-bottom: 8px"); $aPathList[] = $oClientSystemPath; @@ -103,7 +103,7 @@ class cSetupClientAdjust extends cSetupMask { $oSystemPathBox = new cHTMLTextbox("htmlpath[$iIdClient]", $_SESSION["htmlpath"][$iIdClient]); $oSystemPathBox->setWidth(100); $oSystemPathBox->setClass("small"); - $oClientSystemPath = new cHTMLInfoMessage(array($sName, $oSystemPathBox), " "); + $oClientSystemPath = new cHTMLInfoMessage([$sName, $oSystemPathBox], " "); $oClientSystemPath->_oTitle->setStyle("padding-left: 8px; padding-bottom: 8px"); diff --git a/setup/steps/forms/clientmode.php b/setup/steps/forms/clientmode.php index ca9be72..41fd43c 100644 --- a/setup/steps/forms/clientmode.php +++ b/setup/steps/forms/clientmode.php @@ -41,7 +41,7 @@ class cSetupClientMode extends cSetupMask { cInitializeArrayKey($_SESSION, "clientmode", ""); - $aChoices = array(); + $aChoices = []; $aChoices["CLIENTEXAMPLES"] = "none"; //i18n_setup("Client with example modules and example content"); $aChoices["CLIENTMODULES"] = "none"; //i18n_setup("Client with example modules, but without example content"); diff --git a/setup/steps/forms/pathinfo.php b/setup/steps/forms/pathinfo.php index 8936413..2b26777 100644 --- a/setup/steps/forms/pathinfo.php +++ b/setup/steps/forms/pathinfo.php @@ -39,13 +39,13 @@ class cSetupPath extends cSetupMask { $this->_oStepTemplate->set("s", "TITLE", i18n_setup("System Directories")); $this->_oStepTemplate->set("s", "DESCRIPTION", i18n_setup("Please check the directories identified by the system. If you need to change a path, click on the name and enter the new path in the available input box.")); - list($root_path, $root_http_path) = getSystemDirectories(true); + [$root_path, $root_http_path] = getSystemDirectories(true); $cHTMLErrorMessageList = new cHTMLErrorMessageList; $cHTMLErrorMessageList->setStyle("width: 580px; height: 200px; overflow: auto; border: 1px solid black;"); - $cHTMLFoldableErrorMessages = array(); + $cHTMLFoldableErrorMessages = []; - list($a_root_path, $a_root_http_path) = getSystemDirectories(); + [$a_root_path, $a_root_http_path] = getSystemDirectories(); $oRootPath = new cHTMLTextbox("override_root_path", $a_root_path); $oRootPath->setWidth(100); $oRootPath->setClass("small"); diff --git a/setup/steps/forms/setupresults.php b/setup/steps/forms/setupresults.php index fd1fe6d..9d84692 100644 --- a/setup/steps/forms/setupresults.php +++ b/setup/steps/forms/setupresults.php @@ -37,7 +37,7 @@ class cSetupResults extends cSetupMask { $this->_oStepTemplate->set("s", "FINISHTEXT", i18n_setup("You can now start using ConLite. Please delete the folder named 'setup'!")); - list($root_path, $root_http_path) = getSystemDirectories(); + [$root_path, $root_http_path] = getSystemDirectories(); @@ -64,7 +64,7 @@ class cSetupResults extends cSetupMask { - list($sRootPath, $rootWebPath) = getSystemDirectories(); + [$sRootPath, $rootWebPath] = getSystemDirectories(); if (file_exists($sRootPath . "/data/logs/setuplog.txt")) { $sErrorLink = '
setuplog.txt'; diff --git a/setup/steps/forms/setupsummary.php b/setup/steps/forms/setupsummary.php index 3b911a4..8e69155 100644 --- a/setup/steps/forms/setupsummary.php +++ b/setup/steps/forms/setupsummary.php @@ -64,27 +64,21 @@ class cSetupSetupSummary extends cSetupMask { break; } - $messages = array( - i18n_setup("Installation type") . ":" => $sType, - i18n_setup("Database parameters") . ":" => i18n_setup("Database host") . ": " . $_SESSION["dbhost"] . "
" . i18n_setup("Database name") . ": " . $_SESSION["dbname"] . "
" . i18n_setup("Database username") . ": " . $_SESSION["dbuser"] . "
" . i18n_setup("Database prefix") . ": " . $_SESSION["dbprefix"], - ); + $messages = [i18n_setup("Installation type") . ":" => $sType, i18n_setup("Database parameters") . ":" => i18n_setup("Database host") . ": " . $_SESSION["dbhost"] . "
" . i18n_setup("Database name") . ": " . $_SESSION["dbname"] . "
" . i18n_setup("Database username") . ": " . $_SESSION["dbuser"] . "
" . i18n_setup("Database prefix") . ": " . $_SESSION["dbprefix"]]; if ($_SESSION["setuptype"] == "setup") { - $aChoices = array("CLIENTEXAMPLES" => i18n_setup("Client with example modules and example content"), - "CLIENTMODULES" => i18n_setup("Client with example modules but without example content"), - "CLIENT" => i18n_setup("Client without examples"), - "NOCLIENT" => i18n_setup("Don't create a client")); + $aChoices = ["CLIENTEXAMPLES" => i18n_setup("Client with example modules and example content"), "CLIENTMODULES" => i18n_setup("Client with example modules but without example content"), "CLIENT" => i18n_setup("Client without examples"), "NOCLIENT" => i18n_setup("Don't create a client")]; $messages[i18n_setup("Client installation") . ":"] = $aChoices[$_SESSION["clientmode"]]; } // additional plugins $aPlugins = $this->_getSelectedAdditionalPlugins(); - if (count($aPlugins) > 0) { + if ((is_countable($aPlugins) ? count($aPlugins) : 0) > 0) { $messages[i18n_setup("Additional Plugins") . ":"] = implode('
', $aPlugins); ; } - $cHTMLFoldableErrorMessages = array(); + $cHTMLFoldableErrorMessages = []; foreach ($messages as $key => $message) { $cHTMLFoldableErrorMessages[] = new cHTMLInfoMessage($key, $message); @@ -98,7 +92,7 @@ class cSetupSetupSummary extends cSetupMask { } public function _getSelectedAdditionalPlugins() { - $aPlugins = array(); + $aPlugins = []; if (isset($_SESSION['plugin_newsletter']) && $_SESSION['plugin_newsletter'] == 'true') { $aPlugins[] = i18n_setup('Newsletter'); } diff --git a/setup/steps/forms/systemdata.php b/setup/steps/forms/systemdata.php index a5a4557..9f635ae 100644 --- a/setup/steps/forms/systemdata.php +++ b/setup/steps/forms/systemdata.php @@ -36,7 +36,7 @@ class cSetupSystemData extends cSetupMask { public function __construct($step, $previous, $next) { parent::__construct("templates/setup/forms/systemdata.tpl", $step); - list($a_root_path, $a_root_http_path) = getSystemDirectories(); + [$a_root_path, $a_root_http_path] = getSystemDirectories(); cInitializeArrayKey($_SESSION, "dbprefix", ""); cInitializeArrayKey($_SESSION, "dbhost", ""); @@ -58,11 +58,7 @@ class cSetupSystemData extends cSetupMask { @include($a_root_path . "/data/config/" . CL_ENVIRONMENT . "/config.php"); } - $aVars = array("dbhost" => $contenido_host, - "dbuser" => $contenido_user, - "dbname" => $contenido_database, - "dbpass" => $contenido_password, - "dbprefix" => $cfg["sql"]["sqlprefix"]); + $aVars = ["dbhost" => $contenido_host, "dbuser" => $contenido_user, "dbname" => $contenido_database, "dbpass" => $contenido_password, "dbprefix" => $cfg["sql"]["sqlprefix"]]; foreach ($aVars as $aVar => $sValue) { if ($_SESSION[$aVar] == "") { diff --git a/setup/steps/forms/systemtest.php b/setup/steps/forms/systemtest.php index 4dc6120..92d00b3 100644 --- a/setup/steps/forms/systemtest.php +++ b/setup/steps/forms/systemtest.php @@ -24,6 +24,8 @@ define("C_SEVERITY_ERROR", 4); class cSetupSystemtest extends cSetupMask { + public array $_aMessages; + public function __construct($step, $previous, $next) { parent::__construct("templates/setup/forms/systemtest.tpl", $step); $bErrors = false; @@ -34,7 +36,7 @@ class cSetupSystemtest extends cSetupMask { $cHTMLErrorMessageList = new cHTMLErrorMessageList; - $this->_aMessages = array(); + $this->_aMessages = []; /* Run PHP tests */ $this->doPHPTests(); @@ -58,7 +60,7 @@ class cSetupSystemtest extends cSetupMask { $this->doExistingOldPluginTests(); } - $cHTMLFoldableErrorMessages = array(); + $cHTMLFoldableErrorMessages = []; foreach ($this->_aMessages as $iSeverity => $aMessageEntry) { switch ($iSeverity) { @@ -99,7 +101,7 @@ class cSetupSystemtest extends cSetupMask { $sMessage = ''; //get all tables in database and list it into array - $aAvariableTableNames = array(); + $aAvariableTableNames = []; $aTableNames = $db->table_names(); //print_r($db); @@ -112,10 +114,7 @@ class cSetupSystemtest extends cSetupMask { } //list of plugin tables to copy into new plugin tables - $aOldPluginTables = array('Workflow' => array('piwf_actions', 'piwf_allocation', 'piwf_art_allocation', - 'piwf_items', 'piwf_user_sequences', 'piwf_workflow'), - 'Content Allocation' => array('pica_alloc', 'pica_alloc_con', 'pica_lang'), - 'Linkchecker' => array('pi_externlinks', 'pi_linkwhitelist')); + $aOldPluginTables = ['Workflow' => ['piwf_actions', 'piwf_allocation', 'piwf_art_allocation', 'piwf_items', 'piwf_user_sequences', 'piwf_workflow'], 'Content Allocation' => ['pica_alloc', 'pica_alloc_con', 'pica_lang'], 'Linkchecker' => ['pi_externlinks', 'pi_linkwhitelist']]; foreach ($aOldPluginTables as $sPlugin => $aTables) { $bPluginExists = false; @@ -162,7 +161,7 @@ class cSetupSystemtest extends cSetupMask { * @todo: Store results into an external file */ if ($mResult == false && $iSeverity != C_SEVERITY_NONE) { - $this->_aMessages[$iSeverity][] = array($sHeadline, $sErrorMessage); + $this->_aMessages[$iSeverity][] = [$sHeadline, $sErrorMessage]; } } @@ -210,7 +209,7 @@ class cSetupSystemtest extends cSetupMask { } - $iMemoryLimit = return_bytes(getPHPIniSetting("memory_limit")); + $iMemoryLimit = return_bytes(ini_get("memory_limit")); if ($iMemoryLimit > 0) { $this->runTest(($iMemoryLimit > 1024 * 1024 * 32), C_SEVERITY_WARNING, i18n_setup("PHP memory_limit directive too small"), i18n_setup("The memory_limit directive is set to 32 MB or lower. This might be not enough for ConLite to operate correctly. We recommend to disable this setting completely, as this can cause problems with large ConLite projects.")); @@ -261,7 +260,7 @@ class cSetupSystemtest extends cSetupMask { public function doMySQLTests() { - list($handle, $status) = doMySQLConnect($_SESSION["dbhost"], $_SESSION["dbuser"], $_SESSION["dbpass"]); + [$handle, $status] = doMySQLConnect($_SESSION["dbhost"], $_SESSION["dbuser"], $_SESSION["dbpass"]); if (hasMySQLiExtension() && !hasMySQLExtension()) { $sErrorMessage = mysqli_error($handle->Link_ID); @@ -507,6 +506,7 @@ class cSetupSystemtest extends cSetupMask { } public function logFilePrediction($sFile, $iSeverity = C_SEVERITY_WARNING) { + $sPredictMessage = null; $status = canWriteFile("../" . $sFile); $sTitle = sprintf(i18n_setup("Can't write %s"), $sFile); $sMessage = sprintf(i18n_setup("Setup or ConLite can't write to the file %s. Please change the file permissions to correct this problem."), $sFile); diff --git a/setup/steps/languagechooser.php b/setup/steps/languagechooser.php index 76b7a7a..56f73d4 100644 --- a/setup/steps/languagechooser.php +++ b/setup/steps/languagechooser.php @@ -45,7 +45,7 @@ class cSetupLanguageChooser extends cSetupMask { $this->_oStepTemplate->set("s", "DE_HINT_LANG", "Wählen Sie bitte die gewünschte Sprache für das Setup aus."); $this->_oStepTemplate->set("s", "EN_HINT_LANG", "Please choose your language to continue."); - $langs = array("de_DE" => "Deutsch", "C" => "English"); + $langs = ["de_DE" => "Deutsch", "C" => "English"]; $m = ""; diff --git a/vendor/autoload.php b/vendor/autoload.php new file mode 100644 index 0000000..1d223fc --- /dev/null +++ b/vendor/autoload.php @@ -0,0 +1,7 @@ +}|array{}|null + * @psalm-var array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}, versions: array}|array{}|null */ private static $installed; @@ -39,7 +37,7 @@ class InstalledVersions /** * @var array[] - * @psalm-var array}> + * @psalm-var array}> */ private static $installedByVendor = array(); @@ -243,7 +241,7 @@ class InstalledVersions /** * @return array - * @psalm-return array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool} + * @psalm-return array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string} */ public static function getRootPackage() { @@ -257,7 +255,7 @@ class InstalledVersions * * @deprecated Use getAllRawData() instead which returns all datasets for all autoloaders present in the process. getRawData only returns the first dataset loaded, which may not be what you expect. * @return array[] - * @psalm-return array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array} + * @psalm-return array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}, versions: array} */ public static function getRawData() { @@ -280,7 +278,7 @@ class InstalledVersions * Returns the raw data of all installed.php which are currently loaded for custom implementations * * @return array[] - * @psalm-return list}> + * @psalm-return list}> */ public static function getAllRawData() { @@ -303,7 +301,7 @@ class InstalledVersions * @param array[] $data A vendor/composer/installed.php data set * @return void * - * @psalm-param array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array} $data + * @psalm-param array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}, versions: array} $data */ public static function reload($data) { @@ -313,7 +311,7 @@ class InstalledVersions /** * @return array[] - * @psalm-return list}> + * @psalm-return list}> */ private static function getInstalled() { diff --git a/conlite/external/composer/LICENSE b/vendor/composer/LICENSE similarity index 100% rename from conlite/external/composer/LICENSE rename to vendor/composer/LICENSE diff --git a/vendor/composer/autoload_classmap.php b/vendor/composer/autoload_classmap.php new file mode 100644 index 0000000..b26f1b1 --- /dev/null +++ b/vendor/composer/autoload_classmap.php @@ -0,0 +1,10 @@ + $vendorDir . '/composer/InstalledVersions.php', +); diff --git a/vendor/composer/autoload_files.php b/vendor/composer/autoload_files.php new file mode 100644 index 0000000..a3e38ec --- /dev/null +++ b/vendor/composer/autoload_files.php @@ -0,0 +1,11 @@ + $vendorDir . '/symfony/polyfill-ctype/bootstrap.php', + '0e6d7bf4a5811bfa5cf40c5ccd6fae6a' => $vendorDir . '/symfony/polyfill-mbstring/bootstrap.php', +); diff --git a/conlite/external/composer/autoload_namespaces.php b/vendor/composer/autoload_namespaces.php similarity index 51% rename from conlite/external/composer/autoload_namespaces.php rename to vendor/composer/autoload_namespaces.php index f1ae7a0..b7fc012 100644 --- a/conlite/external/composer/autoload_namespaces.php +++ b/vendor/composer/autoload_namespaces.php @@ -2,8 +2,8 @@ // autoload_namespaces.php @generated by Composer -$vendorDir = dirname(__DIR__); -$baseDir = dirname(dirname($vendorDir)); +$vendorDir = dirname(dirname(__FILE__)); +$baseDir = dirname($vendorDir); return array( ); diff --git a/vendor/composer/autoload_psr4.php b/vendor/composer/autoload_psr4.php new file mode 100644 index 0000000..76afc2d --- /dev/null +++ b/vendor/composer/autoload_psr4.php @@ -0,0 +1,14 @@ + array($vendorDir . '/twig/twig/src'), + 'Symfony\\Polyfill\\Mbstring\\' => array($vendorDir . '/symfony/polyfill-mbstring'), + 'Symfony\\Polyfill\\Ctype\\' => array($vendorDir . '/symfony/polyfill-ctype'), + 'PHPMailer\\PHPMailer\\' => array($vendorDir . '/phpmailer/phpmailer/src'), + 'ConLite\\' => array($baseDir . '/conlite/classes'), +); diff --git a/vendor/composer/autoload_real.php b/vendor/composer/autoload_real.php new file mode 100644 index 0000000..d04a81f --- /dev/null +++ b/vendor/composer/autoload_real.php @@ -0,0 +1,80 @@ += 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded()); + if ($useStaticLoader) { + require __DIR__ . '/autoload_static.php'; + + call_user_func(\Composer\Autoload\ComposerStaticInit030320213c853f2cfb8481e1bb7caf00::getInitializer($loader)); + } else { + $map = require __DIR__ . '/autoload_namespaces.php'; + foreach ($map as $namespace => $path) { + $loader->set($namespace, $path); + } + + $map = require __DIR__ . '/autoload_psr4.php'; + foreach ($map as $namespace => $path) { + $loader->setPsr4($namespace, $path); + } + + $classMap = require __DIR__ . '/autoload_classmap.php'; + if ($classMap) { + $loader->addClassMap($classMap); + } + } + + $loader->register(true); + + if ($useStaticLoader) { + $includeFiles = Composer\Autoload\ComposerStaticInit030320213c853f2cfb8481e1bb7caf00::$files; + } else { + $includeFiles = require __DIR__ . '/autoload_files.php'; + } + foreach ($includeFiles as $fileIdentifier => $file) { + composerRequire030320213c853f2cfb8481e1bb7caf00($fileIdentifier, $file); + } + + return $loader; + } +} + +/** + * @param string $fileIdentifier + * @param string $file + * @return void + */ +function composerRequire030320213c853f2cfb8481e1bb7caf00($fileIdentifier, $file) +{ + if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) { + $GLOBALS['__composer_autoload_files'][$fileIdentifier] = true; + + require $file; + } +} diff --git a/vendor/composer/autoload_static.php b/vendor/composer/autoload_static.php new file mode 100644 index 0000000..5f5d841 --- /dev/null +++ b/vendor/composer/autoload_static.php @@ -0,0 +1,70 @@ + __DIR__ . '/..' . '/symfony/polyfill-ctype/bootstrap.php', + '0e6d7bf4a5811bfa5cf40c5ccd6fae6a' => __DIR__ . '/..' . '/symfony/polyfill-mbstring/bootstrap.php', + ); + + public static $prefixLengthsPsr4 = array ( + 'T' => + array ( + 'Twig\\' => 5, + ), + 'S' => + array ( + 'Symfony\\Polyfill\\Mbstring\\' => 26, + 'Symfony\\Polyfill\\Ctype\\' => 23, + ), + 'P' => + array ( + 'PHPMailer\\PHPMailer\\' => 20, + ), + 'C' => + array ( + 'ConLite\\' => 8, + ), + ); + + public static $prefixDirsPsr4 = array ( + 'Twig\\' => + array ( + 0 => __DIR__ . '/..' . '/twig/twig/src', + ), + 'Symfony\\Polyfill\\Mbstring\\' => + array ( + 0 => __DIR__ . '/..' . '/symfony/polyfill-mbstring', + ), + 'Symfony\\Polyfill\\Ctype\\' => + array ( + 0 => __DIR__ . '/..' . '/symfony/polyfill-ctype', + ), + 'PHPMailer\\PHPMailer\\' => + array ( + 0 => __DIR__ . '/..' . '/phpmailer/phpmailer/src', + ), + 'ConLite\\' => + array ( + 0 => __DIR__ . '/../..' . '/conlite/classes', + ), + ); + + public static $classMap = array ( + 'Composer\\InstalledVersions' => __DIR__ . '/..' . '/composer/InstalledVersions.php', + ); + + public static function getInitializer(ClassLoader $loader) + { + return \Closure::bind(function () use ($loader) { + $loader->prefixLengthsPsr4 = ComposerStaticInit030320213c853f2cfb8481e1bb7caf00::$prefixLengthsPsr4; + $loader->prefixDirsPsr4 = ComposerStaticInit030320213c853f2cfb8481e1bb7caf00::$prefixDirsPsr4; + $loader->classMap = ComposerStaticInit030320213c853f2cfb8481e1bb7caf00::$classMap; + + }, null, ClassLoader::class); + } +} diff --git a/vendor/composer/installed.json b/vendor/composer/installed.json new file mode 100644 index 0000000..4013bbc --- /dev/null +++ b/vendor/composer/installed.json @@ -0,0 +1,334 @@ +{ + "packages": [ + { + "name": "phpmailer/phpmailer", + "version": "v6.8.0", + "version_normalized": "6.8.0.0", + "source": { + "type": "git", + "url": "https://github.com/PHPMailer/PHPMailer.git", + "reference": "df16b615e371d81fb79e506277faea67a1be18f1" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/PHPMailer/PHPMailer/zipball/df16b615e371d81fb79e506277faea67a1be18f1", + "reference": "df16b615e371d81fb79e506277faea67a1be18f1", + "shasum": "" + }, + "require": { + "ext-ctype": "*", + "ext-filter": "*", + "ext-hash": "*", + "php": ">=5.5.0" + }, + "require-dev": { + "dealerdirect/phpcodesniffer-composer-installer": "^0.7.2", + "doctrine/annotations": "^1.2.6 || ^1.13.3", + "php-parallel-lint/php-console-highlighter": "^1.0.0", + "php-parallel-lint/php-parallel-lint": "^1.3.2", + "phpcompatibility/php-compatibility": "^9.3.5", + "roave/security-advisories": "dev-latest", + "squizlabs/php_codesniffer": "^3.7.1", + "yoast/phpunit-polyfills": "^1.0.4" + }, + "suggest": { + "ext-mbstring": "Needed to send email in multibyte encoding charset or decode encoded addresses", + "ext-openssl": "Needed for secure SMTP sending and DKIM signing", + "greew/oauth2-azure-provider": "Needed for Microsoft Azure XOAUTH2 authentication", + "hayageek/oauth2-yahoo": "Needed for Yahoo XOAUTH2 authentication", + "league/oauth2-google": "Needed for Google XOAUTH2 authentication", + "psr/log": "For optional PSR-3 debug logging", + "symfony/polyfill-mbstring": "To support UTF-8 if the Mbstring PHP extension is not enabled (^1.2)", + "thenetworg/oauth2-azure": "Needed for Microsoft XOAUTH2 authentication" + }, + "time": "2023-03-06T14:43:22+00:00", + "type": "library", + "installation-source": "dist", + "autoload": { + "psr-4": { + "PHPMailer\\PHPMailer\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "LGPL-2.1-only" + ], + "authors": [ + { + "name": "Marcus Bointon", + "email": "phpmailer@synchromedia.co.uk" + }, + { + "name": "Jim Jagielski", + "email": "jimjag@gmail.com" + }, + { + "name": "Andy Prevost", + "email": "codeworxtech@users.sourceforge.net" + }, + { + "name": "Brent R. Matzelle" + } + ], + "description": "PHPMailer is a full-featured email creation and transfer class for PHP", + "support": { + "issues": "https://github.com/PHPMailer/PHPMailer/issues", + "source": "https://github.com/PHPMailer/PHPMailer/tree/v6.8.0" + }, + "funding": [ + { + "url": "https://github.com/Synchro", + "type": "github" + } + ], + "install-path": "../phpmailer/phpmailer" + }, + { + "name": "symfony/polyfill-ctype", + "version": "v1.27.0", + "version_normalized": "1.27.0.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-ctype.git", + "reference": "5bbc823adecdae860bb64756d639ecfec17b050a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/5bbc823adecdae860bb64756d639ecfec17b050a", + "reference": "5bbc823adecdae860bb64756d639ecfec17b050a", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "provide": { + "ext-ctype": "*" + }, + "suggest": { + "ext-ctype": "For best performance" + }, + "time": "2022-11-03T14:55:06+00:00", + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.27-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, + "installation-source": "dist", + "autoload": { + "files": [ + "bootstrap.php" + ], + "psr-4": { + "Symfony\\Polyfill\\Ctype\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Gert de Pagter", + "email": "BackEndTea@gmail.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill for ctype functions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "ctype", + "polyfill", + "portable" + ], + "support": { + "source": "https://github.com/symfony/polyfill-ctype/tree/v1.27.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "install-path": "../symfony/polyfill-ctype" + }, + { + "name": "symfony/polyfill-mbstring", + "version": "v1.27.0", + "version_normalized": "1.27.0.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-mbstring.git", + "reference": "8ad114f6b39e2c98a8b0e3bd907732c207c2b534" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/8ad114f6b39e2c98a8b0e3bd907732c207c2b534", + "reference": "8ad114f6b39e2c98a8b0e3bd907732c207c2b534", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "provide": { + "ext-mbstring": "*" + }, + "suggest": { + "ext-mbstring": "For best performance" + }, + "time": "2022-11-03T14:55:06+00:00", + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.27-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, + "installation-source": "dist", + "autoload": { + "files": [ + "bootstrap.php" + ], + "psr-4": { + "Symfony\\Polyfill\\Mbstring\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill for the Mbstring extension", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "mbstring", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.27.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "install-path": "../symfony/polyfill-mbstring" + }, + { + "name": "twig/twig", + "version": "v3.7.0", + "version_normalized": "3.7.0.0", + "source": { + "type": "git", + "url": "https://github.com/twigphp/Twig.git", + "reference": "5cf942bbab3df42afa918caeba947f1b690af64b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/twigphp/Twig/zipball/5cf942bbab3df42afa918caeba947f1b690af64b", + "reference": "5cf942bbab3df42afa918caeba947f1b690af64b", + "shasum": "" + }, + "require": { + "php": ">=7.2.5", + "symfony/polyfill-ctype": "^1.8", + "symfony/polyfill-mbstring": "^1.3" + }, + "require-dev": { + "psr/container": "^1.0|^2.0", + "symfony/phpunit-bridge": "^4.4.9|^5.0.9|^6.0" + }, + "time": "2023-07-26T07:16:09+00:00", + "type": "library", + "installation-source": "dist", + "autoload": { + "psr-4": { + "Twig\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com", + "homepage": "http://fabien.potencier.org", + "role": "Lead Developer" + }, + { + "name": "Twig Team", + "role": "Contributors" + }, + { + "name": "Armin Ronacher", + "email": "armin.ronacher@active-4.com", + "role": "Project Founder" + } + ], + "description": "Twig, the flexible, fast, and secure template language for PHP", + "homepage": "https://twig.symfony.com", + "keywords": [ + "templating" + ], + "support": { + "issues": "https://github.com/twigphp/Twig/issues", + "source": "https://github.com/twigphp/Twig/tree/v3.7.0" + }, + "funding": [ + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/twig/twig", + "type": "tidelift" + } + ], + "install-path": "../twig/twig" + } + ], + "dev": false, + "dev-package-names": [] +} diff --git a/vendor/composer/installed.php b/vendor/composer/installed.php new file mode 100644 index 0000000..60cf56a --- /dev/null +++ b/vendor/composer/installed.php @@ -0,0 +1,59 @@ + array( + 'pretty_version' => 'dev-develop', + 'version' => 'dev-develop', + 'type' => 'library', + 'install_path' => __DIR__ . '/../../', + 'aliases' => array(), + 'reference' => 'a397b65fcdb95da20cb02b4bd4c63abc04a0ce82', + 'name' => 'org.conlite/conlite', + 'dev' => false, + ), + 'versions' => array( + 'org.conlite/conlite' => array( + 'pretty_version' => 'dev-develop', + 'version' => 'dev-develop', + 'type' => 'library', + 'install_path' => __DIR__ . '/../../', + 'aliases' => array(), + 'reference' => 'a397b65fcdb95da20cb02b4bd4c63abc04a0ce82', + 'dev_requirement' => false, + ), + 'phpmailer/phpmailer' => array( + 'pretty_version' => 'v6.8.0', + 'version' => '6.8.0.0', + 'type' => 'library', + 'install_path' => __DIR__ . '/../phpmailer/phpmailer', + 'aliases' => array(), + 'reference' => 'df16b615e371d81fb79e506277faea67a1be18f1', + 'dev_requirement' => false, + ), + 'symfony/polyfill-ctype' => array( + 'pretty_version' => 'v1.27.0', + 'version' => '1.27.0.0', + 'type' => 'library', + 'install_path' => __DIR__ . '/../symfony/polyfill-ctype', + 'aliases' => array(), + 'reference' => '5bbc823adecdae860bb64756d639ecfec17b050a', + 'dev_requirement' => false, + ), + 'symfony/polyfill-mbstring' => array( + 'pretty_version' => 'v1.27.0', + 'version' => '1.27.0.0', + 'type' => 'library', + 'install_path' => __DIR__ . '/../symfony/polyfill-mbstring', + 'aliases' => array(), + 'reference' => '8ad114f6b39e2c98a8b0e3bd907732c207c2b534', + 'dev_requirement' => false, + ), + 'twig/twig' => array( + 'pretty_version' => 'v3.7.0', + 'version' => '3.7.0.0', + 'type' => 'library', + 'install_path' => __DIR__ . '/../twig/twig', + 'aliases' => array(), + 'reference' => '5cf942bbab3df42afa918caeba947f1b690af64b', + 'dev_requirement' => false, + ), + ), +); diff --git a/conlite/external/composer/platform_check.php b/vendor/composer/platform_check.php similarity index 90% rename from conlite/external/composer/platform_check.php rename to vendor/composer/platform_check.php index d673084..adfb472 100644 --- a/conlite/external/composer/platform_check.php +++ b/vendor/composer/platform_check.php @@ -4,8 +4,8 @@ $issues = array(); -if (!(PHP_VERSION_ID >= 50509)) { - $issues[] = 'Your Composer dependencies require a PHP version ">= 5.5.9". You are running ' . PHP_VERSION . '.'; +if (!(PHP_VERSION_ID >= 80000)) { + $issues[] = 'Your Composer dependencies require a PHP version ">= 8.0.0". You are running ' . PHP_VERSION . '.'; } if ($issues) { diff --git a/vendor/phpmailer/phpmailer/COMMITMENT b/vendor/phpmailer/phpmailer/COMMITMENT new file mode 100644 index 0000000..a687e0d --- /dev/null +++ b/vendor/phpmailer/phpmailer/COMMITMENT @@ -0,0 +1,46 @@ +GPL Cooperation Commitment +Version 1.0 + +Before filing or continuing to prosecute any legal proceeding or claim +(other than a Defensive Action) arising from termination of a Covered +License, we commit to extend to the person or entity ('you') accused +of violating the Covered License the following provisions regarding +cure and reinstatement, taken from GPL version 3. As used here, the +term 'this License' refers to the specific Covered License being +enforced. + + However, if you cease all violation of this License, then your + license from a particular copyright holder is reinstated (a) + provisionally, unless and until the copyright holder explicitly + and finally terminates your license, and (b) permanently, if the + copyright holder fails to notify you of the violation by some + reasonable means prior to 60 days after the cessation. + + Moreover, your license from a particular copyright holder is + reinstated permanently if the copyright holder notifies you of the + violation by some reasonable means, this is the first time you + have received notice of violation of this License (for any work) + from that copyright holder, and you cure the violation prior to 30 + days after your receipt of the notice. + +We intend this Commitment to be irrevocable, and binding and +enforceable against us and assignees of or successors to our +copyrights. + +Definitions + +'Covered License' means the GNU General Public License, version 2 +(GPLv2), the GNU Lesser General Public License, version 2.1 +(LGPLv2.1), or the GNU Library General Public License, version 2 +(LGPLv2), all as published by the Free Software Foundation. + +'Defensive Action' means a legal proceeding or claim that We bring +against you in response to a prior proceeding or claim initiated by +you or your affiliate. + +'We' means each contributor to this repository as of the date of +inclusion of this file, including subsidiaries of a corporate +contributor. + +This work is available under a Creative Commons Attribution-ShareAlike +4.0 International license (https://creativecommons.org/licenses/by-sa/4.0/). diff --git a/conlite/external/phpmailer/phpmailer/LICENSE b/vendor/phpmailer/phpmailer/LICENSE similarity index 100% rename from conlite/external/phpmailer/phpmailer/LICENSE rename to vendor/phpmailer/phpmailer/LICENSE diff --git a/vendor/phpmailer/phpmailer/README.md b/vendor/phpmailer/phpmailer/README.md new file mode 100644 index 0000000..53e66f1 --- /dev/null +++ b/vendor/phpmailer/phpmailer/README.md @@ -0,0 +1,230 @@ +[![SWUbanner](https://raw.githubusercontent.com/vshymanskyy/StandWithUkraine/main/banner2-direct.svg)](https://supportukrainenow.org/) + +![PHPMailer](https://raw.github.com/PHPMailer/PHPMailer/master/examples/images/phpmailer.png) + +# PHPMailer – A full-featured email creation and transfer class for PHP + +[![Test status](https://github.com/PHPMailer/PHPMailer/workflows/Tests/badge.svg)](https://github.com/PHPMailer/PHPMailer/actions) +[![codecov.io](https://codecov.io/gh/PHPMailer/PHPMailer/branch/master/graph/badge.svg?token=iORZpwmYmM)](https://codecov.io/gh/PHPMailer/PHPMailer) +[![Latest Stable Version](https://poser.pugx.org/phpmailer/phpmailer/v/stable.svg)](https://packagist.org/packages/phpmailer/phpmailer) +[![Total Downloads](https://poser.pugx.org/phpmailer/phpmailer/downloads)](https://packagist.org/packages/phpmailer/phpmailer) +[![License](https://poser.pugx.org/phpmailer/phpmailer/license.svg)](https://packagist.org/packages/phpmailer/phpmailer) +[![API Docs](https://github.com/phpmailer/phpmailer/workflows/Docs/badge.svg)](https://phpmailer.github.io/PHPMailer/) +[![OpenSSF Scorecard](https://api.securityscorecards.dev/projects/github.com/PHPMailer/PHPMailer/badge)](https://api.securityscorecards.dev/projects/github.com/PHPMailer/PHPMailer) + +## Features +- Probably the world's most popular code for sending email from PHP! +- Used by many open-source projects: WordPress, Drupal, 1CRM, SugarCRM, Yii, Joomla! and many more +- Integrated SMTP support – send without a local mail server +- Send emails with multiple To, CC, BCC, and Reply-to addresses +- Multipart/alternative emails for mail clients that do not read HTML email +- Add attachments, including inline +- Support for UTF-8 content and 8bit, base64, binary, and quoted-printable encodings +- SMTP authentication with LOGIN, PLAIN, CRAM-MD5, and XOAUTH2 mechanisms over SMTPS and SMTP+STARTTLS transports +- Validates email addresses automatically +- Protects against header injection attacks +- Error messages in over 50 languages! +- DKIM and S/MIME signing support +- Compatible with PHP 5.5 and later, including PHP 8.2 +- Namespaced to prevent name clashes +- Much more! + +## Why you might need it +Many PHP developers need to send email from their code. The only PHP function that supports this directly is [`mail()`](https://www.php.net/manual/en/function.mail.php). However, it does not provide any assistance for making use of popular features such as encryption, authentication, HTML messages, and attachments. + +Formatting email correctly is surprisingly difficult. There are myriad overlapping (and conflicting) standards, requiring tight adherence to horribly complicated formatting and encoding rules – the vast majority of code that you'll find online that uses the `mail()` function directly is just plain wrong, if not unsafe! + +The PHP `mail()` function usually sends via a local mail server, typically fronted by a `sendmail` binary on Linux, BSD, and macOS platforms, however, Windows usually doesn't include a local mail server; PHPMailer's integrated SMTP client allows email sending on all platforms without needing a local mail server. Be aware though, that the `mail()` function should be avoided when possible; it's both faster and [safer](https://exploitbox.io/paper/Pwning-PHP-Mail-Function-For-Fun-And-RCE.html) to use SMTP to localhost. + +*Please* don't be tempted to do it yourself – if you don't use PHPMailer, there are many other excellent libraries that +you should look at before rolling your own. Try [SwiftMailer](https://swiftmailer.symfony.com/) +, [Laminas/Mail](https://docs.laminas.dev/laminas-mail/), [ZetaComponents](https://github.com/zetacomponents/Mail), etc. + +## License +This software is distributed under the [LGPL 2.1](http://www.gnu.org/licenses/lgpl-2.1.html) license, along with the [GPL Cooperation Commitment](https://gplcc.github.io/gplcc/). Please read [LICENSE](https://github.com/PHPMailer/PHPMailer/blob/master/LICENSE) for information on the software availability and distribution. + +## Installation & loading +PHPMailer is available on [Packagist](https://packagist.org/packages/phpmailer/phpmailer) (using semantic versioning), and installation via [Composer](https://getcomposer.org) is the recommended way to install PHPMailer. Just add this line to your `composer.json` file: + +```json +"phpmailer/phpmailer": "^6.8.0" +``` + +or run + +```sh +composer require phpmailer/phpmailer +``` + +Note that the `vendor` folder and the `vendor/autoload.php` script are generated by Composer; they are not part of PHPMailer. + +If you want to use the Gmail XOAUTH2 authentication class, you will also need to add a dependency on the `league/oauth2-client` package in your `composer.json`. + +Alternatively, if you're not using Composer, you +can [download PHPMailer as a zip file](https://github.com/PHPMailer/PHPMailer/archive/master.zip), (note that docs and examples are not included in the zip file), then copy the contents of the PHPMailer folder into one of the `include_path` directories specified in your PHP configuration and load each class file manually: + +```php +SMTPDebug = SMTP::DEBUG_SERVER; //Enable verbose debug output + $mail->isSMTP(); //Send using SMTP + $mail->Host = 'smtp.example.com'; //Set the SMTP server to send through + $mail->SMTPAuth = true; //Enable SMTP authentication + $mail->Username = 'user@example.com'; //SMTP username + $mail->Password = 'secret'; //SMTP password + $mail->SMTPSecure = PHPMailer::ENCRYPTION_SMTPS; //Enable implicit TLS encryption + $mail->Port = 465; //TCP port to connect to; use 587 if you have set `SMTPSecure = PHPMailer::ENCRYPTION_STARTTLS` + + //Recipients + $mail->setFrom('from@example.com', 'Mailer'); + $mail->addAddress('joe@example.net', 'Joe User'); //Add a recipient + $mail->addAddress('ellen@example.com'); //Name is optional + $mail->addReplyTo('info@example.com', 'Information'); + $mail->addCC('cc@example.com'); + $mail->addBCC('bcc@example.com'); + + //Attachments + $mail->addAttachment('/var/tmp/file.tar.gz'); //Add attachments + $mail->addAttachment('/tmp/image.jpg', 'new.jpg'); //Optional name + + //Content + $mail->isHTML(true); //Set email format to HTML + $mail->Subject = 'Here is the subject'; + $mail->Body = 'This is the HTML message body in bold!'; + $mail->AltBody = 'This is the body in plain text for non-HTML mail clients'; + + $mail->send(); + echo 'Message has been sent'; +} catch (Exception $e) { + echo "Message could not be sent. Mailer Error: {$mail->ErrorInfo}"; +} +``` + +You'll find plenty to play with in the [examples](https://github.com/PHPMailer/PHPMailer/tree/master/examples) folder, which covers many common scenarios including sending through Gmail, building contact forms, sending to mailing lists, and more. + +If you are re-using the instance (e.g. when sending to a mailing list), you may need to clear the recipient list to avoid sending duplicate messages. See [the mailing list example](https://github.com/PHPMailer/PHPMailer/blob/master/examples/mailing_list.phps) for further guidance. + +That's it. You should now be ready to use PHPMailer! + +## Localization +PHPMailer defaults to English, but in the [language](https://github.com/PHPMailer/PHPMailer/tree/master/language/) folder, you'll find many translations for PHPMailer error messages that you may encounter. Their filenames contain [ISO 639-1](http://en.wikipedia.org/wiki/ISO_639-1) language code for the translations, for example `fr` for French. To specify a language, you need to tell PHPMailer which one to use, like this: + +```php +//To load the French version +$mail->setLanguage('fr', '/optional/path/to/language/directory/'); +``` + +We welcome corrections and new languages – if you're looking for corrections, run the [PHPMailerLangTest.php](https://github.com/PHPMailer/PHPMailer/tree/master/test/PHPMailerLangTest.php) script in the tests folder and it will show any missing translations. + +## Documentation +Start reading at the [GitHub wiki](https://github.com/PHPMailer/PHPMailer/wiki). If you're having trouble, head for [the troubleshooting guide](https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting) as it's frequently updated. + +Examples of how to use PHPMailer for common scenarios can be found in the [examples](https://github.com/PHPMailer/PHPMailer/tree/master/examples) folder. If you're looking for a good starting point, we recommend you start with [the Gmail example](https://github.com/PHPMailer/PHPMailer/tree/master/examples/gmail.phps). + +To reduce PHPMailer's deployed code footprint, examples are not included if you load PHPMailer via Composer or via [GitHub's zip file download](https://github.com/PHPMailer/PHPMailer/archive/master.zip), so you'll need to either clone the git repository or use the above links to get to the examples directly. + +Complete generated API documentation is [available online](https://phpmailer.github.io/PHPMailer/). + +You can generate complete API-level documentation by running `phpdoc` in the top-level folder, and documentation will appear in the `docs` folder, though you'll need to have [PHPDocumentor](http://www.phpdoc.org) installed. You may find [the unit tests](https://github.com/PHPMailer/PHPMailer/blob/master/test/PHPMailerTest.php) a good reference for how to do various operations such as encryption. + +If the documentation doesn't cover what you need, search the [many questions on Stack Overflow](http://stackoverflow.com/questions/tagged/phpmailer), and before you ask a question about "SMTP Error: Could not connect to SMTP host.", [read the troubleshooting guide](https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting). + +## Tests +[PHPMailer tests](https://github.com/PHPMailer/PHPMailer/tree/master/test/) use PHPUnit 9, with [a polyfill](https://github.com/Yoast/PHPUnit-Polyfills) to let 9-style tests run on older PHPUnit and PHP versions. + +[![Test status](https://github.com/PHPMailer/PHPMailer/workflows/Tests/badge.svg)](https://github.com/PHPMailer/PHPMailer/actions) + +If this isn't passing, is there something you can do to help? + +## Security +Please disclose any vulnerabilities found responsibly – report security issues to the maintainers privately. + +See [SECURITY](https://github.com/PHPMailer/PHPMailer/tree/master/SECURITY.md) and [PHPMailer's security advisories on GitHub](https://github.com/PHPMailer/PHPMailer/security). + +## Contributing +Please submit bug reports, suggestions, and pull requests to the [GitHub issue tracker](https://github.com/PHPMailer/PHPMailer/issues). + +We're particularly interested in fixing edge cases, expanding test coverage, and updating translations. + +If you found a mistake in the docs, or want to add something, go ahead and amend the wiki – anyone can edit it. + +If you have git clones from prior to the move to the PHPMailer GitHub organisation, you'll need to update any remote URLs referencing the old GitHub location with a command like this from within your clone: + +```sh +git remote set-url upstream https://github.com/PHPMailer/PHPMailer.git +``` + +Please *don't* use the SourceForge or Google Code projects any more; they are obsolete and no longer maintained. + +## Sponsorship +Development time and resources for PHPMailer are provided by [Smartmessages.net](https://info.smartmessages.net/), the world's only privacy-first email marketing system. + +Smartmessages.net privacy-first email marketing logo + +Donations are very welcome, whether in beer 🍺, T-shirts 👕, or cold, hard cash 💰. Sponsorship through GitHub is a simple and convenient way to say "thank you" to PHPMailer's maintainers and contributors – just click the "Sponsor" button [on the project page](https://github.com/PHPMailer/PHPMailer). If your company uses PHPMailer, consider taking part in Tidelift's enterprise support programme. + +## PHPMailer For Enterprise + +Available as part of the Tidelift Subscription. + +The maintainers of PHPMailer and thousands of other packages are working with Tidelift to deliver commercial +support and maintenance for the open-source packages you use to build your applications. Save time, reduce risk, and +improve code health, while paying the maintainers of the exact packages you +use. [Learn more.](https://tidelift.com/subscription/pkg/packagist-phpmailer-phpmailer?utm_source=packagist-phpmailer-phpmailer&utm_medium=referral&utm_campaign=enterprise&utm_term=repo) + +## Changelog +See [changelog](changelog.md). + +## History +- PHPMailer was originally written in 2001 by Brent R. Matzelle as a [SourceForge project](http://sourceforge.net/projects/phpmailer/). +- [Marcus Bointon](https://github.com/Synchro) (`coolbru` on SF) and Andy Prevost (`codeworxtech`) took over the project in 2004. +- Became an Apache incubator project on Google Code in 2010, managed by Jim Jagielski. +- Marcus created [his fork on GitHub](https://github.com/Synchro/PHPMailer) in 2008. +- Jim and Marcus decide to join forces and use GitHub as the canonical and official repo for PHPMailer in 2013. +- PHPMailer moves to [the PHPMailer organisation](https://github.com/PHPMailer) on GitHub in 2013. + +### What's changed since moving from SourceForge? +- Official successor to the SourceForge and Google Code projects. +- Test suite. +- Continuous integration with GitHub Actions. +- Composer support. +- Public development. +- Additional languages and language strings. +- CRAM-MD5 authentication support. +- Preserves full repo history of authors, commits, and branches from the original SourceForge project. diff --git a/vendor/phpmailer/phpmailer/SECURITY.md b/vendor/phpmailer/phpmailer/SECURITY.md new file mode 100644 index 0000000..035a87f --- /dev/null +++ b/vendor/phpmailer/phpmailer/SECURITY.md @@ -0,0 +1,37 @@ +# Security notices relating to PHPMailer + +Please disclose any security issues or vulnerabilities found through [Tidelift's coordinated disclosure system](https://tidelift.com/security) or to the maintainers privately. + +PHPMailer 6.4.1 and earlier contain a vulnerability that can result in untrusted code being called (if such code is injected into the host project's scope by other means). If the `$patternselect` parameter to `validateAddress()` is set to `'php'` (the default, defined by `PHPMailer::$validator`), and the global namespace contains a function called `php`, it will be called in preference to the built-in validator of the same name. Mitigated in PHPMailer 6.5.0 by denying the use of simple strings as validator function names. Recorded as [CVE-2021-3603](https://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2021-3603). Reported by [Vikrant Singh Chauhan](mailto:vi@hackberry.xyz) via [huntr.dev](https://www.huntr.dev/). + +PHPMailer versions 6.4.1 and earlier contain a possible remote code execution vulnerability through the `$lang_path` parameter of the `setLanguage()` method. If the `$lang_path` parameter is passed unfiltered from user input, it can be set to [a UNC path](https://docs.microsoft.com/en-us/dotnet/standard/io/file-path-formats#unc-paths), and if an attacker is also able to persuade the server to load a file from that UNC path, a script file under their control may be executed. This vulnerability only applies to systems that resolve UNC paths, typically only Microsoft Windows. +PHPMailer 6.5.0 mitigates this by no longer treating translation files as PHP code, but by parsing their text content directly. This approach avoids the possibility of executing unknown code while retaining backward compatibility. This isn't ideal, so the current translation format is deprecated and will be replaced in the next major release. Recorded as [CVE-2021-34551](https://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2021-34551). Reported by [Jilin Diting Information Technology Co., Ltd](https://listensec.com) via Tidelift. + +PHPMailer versions between 6.1.8 and 6.4.0 contain a regression of the earlier CVE-2018-19296 object injection vulnerability as a result of [a fix for Windows UNC paths in 6.1.8](https://github.com/PHPMailer/PHPMailer/commit/e2e07a355ee8ff36aba21d0242c5950c56e4c6f9). Recorded as [CVE-2020-36326](https://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2020-36326). Reported by Fariskhi Vidyan via Tidelift. 6.4.1 fixes this issue, and also enforces stricter checks for URL schemes in local path contexts. + +PHPMailer versions 6.1.5 and earlier contain an output escaping bug that occurs in `Content-Type` and `Content-Disposition` when filenames passed into `addAttachment` and other methods that accept attachment names contain double quote characters, in contravention of RFC822 3.4.1. No specific vulnerability has been found relating to this, but it could allow file attachments to bypass attachment filters that are based on matching filename extensions. Recorded as [CVE-2020-13625](https://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2020-13625). Reported by Elar Lang of Clarified Security. + +PHPMailer versions prior to 6.0.6 and 5.2.27 are vulnerable to an object injection attack by passing `phar://` paths into `addAttachment()` and other functions that may receive unfiltered local paths, possibly leading to RCE. Recorded as [CVE-2018-19296](https://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2018-19296). See [this article](https://knasmueller.net/5-answers-about-php-phar-exploitation) for more info on this type of vulnerability. Mitigated by blocking the use of paths containing URL-protocol style prefixes such as `phar://`. Reported by Sehun Oh of cyberone.kr. + +PHPMailer versions prior to 5.2.24 (released July 26th 2017) have an XSS vulnerability in one of the code examples, [CVE-2017-11503](https://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2017-11503). The `code_generator.phps` example did not filter user input prior to output. This file is distributed with a `.phps` extension, so it it not normally executable unless it is explicitly renamed, and the file is not included when PHPMailer is loaded through composer, so it is safe by default. There was also an undisclosed potential XSS vulnerability in the default exception handler (unused by default). Patches for both issues kindly provided by Patrick Monnerat of the Fedora Project. + +PHPMailer versions prior to 5.2.22 (released January 9th 2017) have a local file disclosure vulnerability, [CVE-2017-5223](https://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2017-5223). If content passed into `msgHTML()` is sourced from unfiltered user input, relative paths can map to absolute local file paths and added as attachments. Also note that `addAttachment` (just like `file_get_contents`, `passthru`, `unlink`, etc) should not be passed user-sourced params either! Reported by Yongxiang Li of Asiasecurity. + +PHPMailer versions prior to 5.2.20 (released December 28th 2016) are vulnerable to [CVE-2016-10045](https://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2016-10045) a remote code execution vulnerability, responsibly reported by [Dawid Golunski](https://legalhackers.com/advisories/PHPMailer-Exploit-Remote-Code-Exec-CVE-2016-10045-Vuln-Patch-Bypass.html), and patched by Paul Buonopane (@Zenexer). + +PHPMailer versions prior to 5.2.18 (released December 2016) are vulnerable to [CVE-2016-10033](https://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2016-10033) a remote code execution vulnerability, responsibly reported by [Dawid Golunski](http://legalhackers.com/advisories/PHPMailer-Exploit-Remote-Code-Exec-CVE-2016-10033-Vuln.html). + +PHPMailer versions prior to 5.2.14 (released November 2015) are vulnerable to [CVE-2015-8476](https://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2015-8476) an SMTP CRLF injection bug permitting arbitrary message sending. + +PHPMailer versions prior to 5.2.10 (released May 2015) are vulnerable to [CVE-2008-5619](https://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2008-5619), a remote code execution vulnerability in the bundled html2text library. This file was removed in 5.2.10, so if you are using a version prior to that and make use of the html2text function, it's vitally important that you upgrade and remove this file. + +PHPMailer versions prior to 2.0.7 and 2.2.1 are vulnerable to [CVE-2012-0796](https://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2012-0796), an email header injection attack. + +Joomla 1.6.0 uses PHPMailer in an unsafe way, allowing it to reveal local file paths, reported in [CVE-2011-3747](https://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2011-3747). + +PHPMailer didn't sanitise the `$lang_path` parameter in `SetLanguage`. This wasn't a problem in itself, but some apps (PHPClassifieds, ATutor) also failed to sanitise user-provided parameters passed to it, permitting semi-arbitrary local file inclusion, reported in [CVE-2010-4914](https://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2010-4914), [CVE-2007-2021](https://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2007-2021) and [CVE-2006-5734](https://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2006-5734). + +PHPMailer 1.7.2 and earlier contained a possible DDoS vulnerability reported in [CVE-2005-1807](https://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2005-1807). + +PHPMailer 1.7 and earlier (June 2003) have a possible vulnerability in the `SendmailSend` method where shell commands may not be sanitised. Reported in [CVE-2007-3215](https://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2007-3215). + diff --git a/vendor/phpmailer/phpmailer/VERSION b/vendor/phpmailer/phpmailer/VERSION new file mode 100644 index 0000000..8a1c5c7 --- /dev/null +++ b/vendor/phpmailer/phpmailer/VERSION @@ -0,0 +1 @@ +6.8.0 \ No newline at end of file diff --git a/vendor/phpmailer/phpmailer/composer.json b/vendor/phpmailer/phpmailer/composer.json new file mode 100644 index 0000000..37e3d6e --- /dev/null +++ b/vendor/phpmailer/phpmailer/composer.json @@ -0,0 +1,78 @@ +{ + "name": "phpmailer/phpmailer", + "type": "library", + "description": "PHPMailer is a full-featured email creation and transfer class for PHP", + "authors": [ + { + "name": "Marcus Bointon", + "email": "phpmailer@synchromedia.co.uk" + }, + { + "name": "Jim Jagielski", + "email": "jimjag@gmail.com" + }, + { + "name": "Andy Prevost", + "email": "codeworxtech@users.sourceforge.net" + }, + { + "name": "Brent R. Matzelle" + } + ], + "funding": [ + { + "url": "https://github.com/Synchro", + "type": "github" + } + ], + "config": { + "allow-plugins": { + "dealerdirect/phpcodesniffer-composer-installer": true + } + }, + "require": { + "php": ">=5.5.0", + "ext-ctype": "*", + "ext-filter": "*", + "ext-hash": "*" + }, + "require-dev": { + "dealerdirect/phpcodesniffer-composer-installer": "^0.7.2", + "doctrine/annotations": "^1.2.6 || ^1.13.3", + "php-parallel-lint/php-console-highlighter": "^1.0.0", + "php-parallel-lint/php-parallel-lint": "^1.3.2", + "phpcompatibility/php-compatibility": "^9.3.5", + "roave/security-advisories": "dev-latest", + "squizlabs/php_codesniffer": "^3.7.1", + "yoast/phpunit-polyfills": "^1.0.4" + }, + "suggest": { + "ext-mbstring": "Needed to send email in multibyte encoding charset or decode encoded addresses", + "ext-openssl": "Needed for secure SMTP sending and DKIM signing", + "greew/oauth2-azure-provider": "Needed for Microsoft Azure XOAUTH2 authentication", + "hayageek/oauth2-yahoo": "Needed for Yahoo XOAUTH2 authentication", + "league/oauth2-google": "Needed for Google XOAUTH2 authentication", + "psr/log": "For optional PSR-3 debug logging", + "thenetworg/oauth2-azure": "Needed for Microsoft XOAUTH2 authentication", + "symfony/polyfill-mbstring": "To support UTF-8 if the Mbstring PHP extension is not enabled (^1.2)" + }, + "autoload": { + "psr-4": { + "PHPMailer\\PHPMailer\\": "src/" + } + }, + "autoload-dev": { + "psr-4": { + "PHPMailer\\Test\\": "test/" + } + }, + "license": "LGPL-2.1-only", + "scripts": { + "check": "./vendor/bin/phpcs", + "test": "./vendor/bin/phpunit --no-coverage", + "coverage": "./vendor/bin/phpunit", + "lint": [ + "@php ./vendor/php-parallel-lint/php-parallel-lint/parallel-lint . --show-deprecated -e php,phps --exclude vendor --exclude .git --exclude build" + ] + } +} diff --git a/vendor/phpmailer/phpmailer/get_oauth_token.php b/vendor/phpmailer/phpmailer/get_oauth_token.php new file mode 100644 index 0000000..cda0445 --- /dev/null +++ b/vendor/phpmailer/phpmailer/get_oauth_token.php @@ -0,0 +1,182 @@ + + * @author Jim Jagielski (jimjag) + * @author Andy Prevost (codeworxtech) + * @author Brent R. Matzelle (original founder) + * @copyright 2012 - 2020 Marcus Bointon + * @copyright 2010 - 2012 Jim Jagielski + * @copyright 2004 - 2009 Andy Prevost + * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License + * @note This program is distributed in the hope that it will be useful - WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. + */ + +/** + * Get an OAuth2 token from an OAuth2 provider. + * * Install this script on your server so that it's accessible + * as [https/http]:////get_oauth_token.php + * e.g.: http://localhost/phpmailer/get_oauth_token.php + * * Ensure dependencies are installed with 'composer install' + * * Set up an app in your Google/Yahoo/Microsoft account + * * Set the script address as the app's redirect URL + * If no refresh token is obtained when running this file, + * revoke access to your app and run the script again. + */ + +namespace PHPMailer\PHPMailer; + +/** + * Aliases for League Provider Classes + * Make sure you have added these to your composer.json and run `composer install` + * Plenty to choose from here: + * @see http://oauth2-client.thephpleague.com/providers/thirdparty/ + */ +//@see https://github.com/thephpleague/oauth2-google +use League\OAuth2\Client\Provider\Google; +//@see https://packagist.org/packages/hayageek/oauth2-yahoo +use Hayageek\OAuth2\Client\Provider\Yahoo; +//@see https://github.com/stevenmaguire/oauth2-microsoft +use Stevenmaguire\OAuth2\Client\Provider\Microsoft; +//@see https://github.com/greew/oauth2-azure-provider +use Greew\OAuth2\Client\Provider\Azure; + +if (!isset($_GET['code']) && !isset($_POST['provider'])) { + ?> + + +
+

Select Provider

+ +
+ +
+ +
+ +
+

Enter id and secret

+

These details are obtained by setting up an app in your provider's developer console. +

+

ClientId:

+

ClientSecret:

+

TenantID (only relevant for Azure):

+ +
+ + + $clientId, + 'clientSecret' => $clientSecret, + 'redirectUri' => $redirectUri, + 'accessType' => 'offline' +]; + +$options = []; +$provider = null; + +switch ($providerName) { + case 'Google': + $provider = new Google($params); + $options = [ + 'scope' => [ + 'https://mail.google.com/' + ] + ]; + break; + case 'Yahoo': + $provider = new Yahoo($params); + break; + case 'Microsoft': + $provider = new Microsoft($params); + $options = [ + 'scope' => [ + 'wl.imap', + 'wl.offline_access' + ] + ]; + break; + case 'Azure': + $params['tenantId'] = $tenantId; + + $provider = new Azure($params); + $options = [ + 'scope' => [ + 'https://outlook.office.com/SMTP.Send', + 'offline_access' + ] + ]; + break; +} + +if (null === $provider) { + exit('Provider missing'); +} + +if (!isset($_GET['code'])) { + //If we don't have an authorization code then get one + $authUrl = $provider->getAuthorizationUrl($options); + $_SESSION['oauth2state'] = $provider->getState(); + header('Location: ' . $authUrl); + exit; + //Check given state against previously stored one to mitigate CSRF attack +} elseif (empty($_GET['state']) || ($_GET['state'] !== $_SESSION['oauth2state'])) { + unset($_SESSION['oauth2state']); + unset($_SESSION['provider']); + exit('Invalid state'); +} else { + unset($_SESSION['provider']); + //Try to get an access token (using the authorization code grant) + $token = $provider->getAccessToken( + 'authorization_code', + [ + 'code' => $_GET['code'] + ] + ); + //Use this to interact with an API on the users behalf + //Use this to get a new access token if the old one expires + echo 'Refresh Token: ', $token->getRefreshToken(); +} diff --git a/vendor/phpmailer/phpmailer/language/phpmailer.lang-af.php b/vendor/phpmailer/phpmailer/language/phpmailer.lang-af.php new file mode 100644 index 0000000..0b2a72d --- /dev/null +++ b/vendor/phpmailer/phpmailer/language/phpmailer.lang-af.php @@ -0,0 +1,26 @@ + + * Rewrite and extension of the work by Mikael Stokkebro + * + */ + +$PHPMAILER_LANG['authenticate'] = 'SMTP fejl: Login mislykkedes.'; +$PHPMAILER_LANG['connect_host'] = 'SMTP fejl: Forbindelse til SMTP serveren kunne ikke oprettes.'; +$PHPMAILER_LANG['data_not_accepted'] = 'SMTP fejl: Data blev ikke accepteret.'; +$PHPMAILER_LANG['empty_message'] = 'Meddelelsen er uden indhold'; +$PHPMAILER_LANG['encoding'] = 'Ukendt encode-format: '; +$PHPMAILER_LANG['execute'] = 'Kunne ikke afvikle: '; +$PHPMAILER_LANG['extension_missing'] = 'Udvidelse mangler: '; +$PHPMAILER_LANG['file_access'] = 'Kunne ikke tilgå filen: '; +$PHPMAILER_LANG['file_open'] = 'Fil fejl: Kunne ikke åbne filen: '; +$PHPMAILER_LANG['from_failed'] = 'Følgende afsenderadresse er forkert: '; +$PHPMAILER_LANG['instantiate'] = 'Email funktionen kunne ikke initialiseres.'; +$PHPMAILER_LANG['invalid_address'] = 'Udgyldig adresse: '; +$PHPMAILER_LANG['invalid_header'] = 'Ugyldig header navn eller værdi'; +$PHPMAILER_LANG['invalid_hostentry'] = 'Ugyldig hostentry: '; +$PHPMAILER_LANG['invalid_host'] = 'Ugyldig vært: '; +$PHPMAILER_LANG['mailer_not_supported'] = ' mailer understøttes ikke.'; +$PHPMAILER_LANG['provide_address'] = 'Indtast mindst en modtagers email adresse.'; +$PHPMAILER_LANG['recipients_failed'] = 'SMTP fejl: Følgende modtagere fejlede: '; +$PHPMAILER_LANG['signing'] = 'Signeringsfejl: '; +$PHPMAILER_LANG['smtp_code'] = 'SMTP kode: '; +$PHPMAILER_LANG['smtp_code_ex'] = 'Yderligere SMTP info: '; +$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP Connect() fejlede.'; +$PHPMAILER_LANG['smtp_detail'] = 'Detalje: '; +$PHPMAILER_LANG['smtp_error'] = 'SMTP server fejl: '; +$PHPMAILER_LANG['variable_set'] = 'Kunne ikke definere eller nulstille variablen: '; diff --git a/conlite/external/phpmailer/phpmailer/language/phpmailer.lang-de.php b/vendor/phpmailer/phpmailer/language/phpmailer.lang-de.php similarity index 92% rename from conlite/external/phpmailer/phpmailer/language/phpmailer.lang-de.php rename to vendor/phpmailer/phpmailer/language/phpmailer.lang-de.php index aa987a9..e7e59d2 100644 --- a/conlite/external/phpmailer/phpmailer/language/phpmailer.lang-de.php +++ b/vendor/phpmailer/phpmailer/language/phpmailer.lang-de.php @@ -1,4 +1,5 @@ + * @author Crystopher Glodzienski Cardoso */ $PHPMAILER_LANG['authenticate'] = 'Error SMTP: Imposible autentificar.'; $PHPMAILER_LANG['connect_host'] = 'Error SMTP: Imposible conectar al servidor SMTP.'; $PHPMAILER_LANG['data_not_accepted'] = 'Error SMTP: Datos no aceptados.'; -$PHPMAILER_LANG['empty_message'] = 'El cuerpo del mensaje está vacío'; +$PHPMAILER_LANG['empty_message'] = 'El cuerpo del mensaje está vacío.'; $PHPMAILER_LANG['encoding'] = 'Codificación desconocida: '; $PHPMAILER_LANG['execute'] = 'Imposible ejecutar: '; $PHPMAILER_LANG['file_access'] = 'Imposible acceder al archivo: '; @@ -24,3 +26,6 @@ $PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP Connect() falló.'; $PHPMAILER_LANG['smtp_error'] = 'Error del servidor SMTP: '; $PHPMAILER_LANG['variable_set'] = 'No se pudo configurar la variable: '; $PHPMAILER_LANG['extension_missing'] = 'Extensión faltante: '; +$PHPMAILER_LANG['smtp_code'] = 'Código del servidor SMTP: '; +$PHPMAILER_LANG['smtp_code_ex'] = 'Información adicional del servidor SMTP: '; +$PHPMAILER_LANG['invalid_header'] = 'Nombre o valor de encabezado no válido'; diff --git a/conlite/external/phpmailer/phpmailer/language/phpmailer.lang-et.php b/vendor/phpmailer/phpmailer/language/phpmailer.lang-et.php similarity index 99% rename from conlite/external/phpmailer/phpmailer/language/phpmailer.lang-et.php rename to vendor/phpmailer/phpmailer/language/phpmailer.lang-et.php index 7e06da1..93addc9 100644 --- a/conlite/external/phpmailer/phpmailer/language/phpmailer.lang-et.php +++ b/vendor/phpmailer/phpmailer/language/phpmailer.lang-et.php @@ -1,4 +1,5 @@ + * Rewrite and extension of the work by Jayanti Suthar + */ + +$PHPMAILER_LANG['authenticate'] = 'SMTP त्रुटि: प्रामाणिकता की जांच नहीं हो सका। '; +$PHPMAILER_LANG['buggy_php'] = 'PHP का आपका संस्करण एक बग से प्रभावित है जिसके परिणामस्वरूप संदेश दूषित हो सकते हैं. इसे ठीक करने हेतु, भेजने के लिए SMTP का उपयोग करे, अपने php.ini में mail.add_x_header विकल्प को अक्षम करें, MacOS या Linux पर जाए, या अपने PHP संस्करण को 7.0.17+ या 7.1.3+ बदले.'; +$PHPMAILER_LANG['connect_host'] = 'SMTP त्रुटि: SMTP सर्वर से कनेक्ट नहीं हो सका। '; +$PHPMAILER_LANG['data_not_accepted'] = 'SMTP त्रुटि: डेटा स्वीकार नहीं किया जाता है। '; +$PHPMAILER_LANG['empty_message'] = 'संदेश खाली है। '; +$PHPMAILER_LANG['encoding'] = 'अज्ञात एन्कोडिंग प्रकार। '; +$PHPMAILER_LANG['execute'] = 'आदेश को निष्पादित करने में विफल। '; +$PHPMAILER_LANG['extension_missing'] = 'एक्सटेन्षन गायब है: '; +$PHPMAILER_LANG['file_access'] = 'फ़ाइल उपलब्ध नहीं है। '; +$PHPMAILER_LANG['file_open'] = 'फ़ाइल त्रुटि: फाइल को खोला नहीं जा सका। '; +$PHPMAILER_LANG['from_failed'] = 'प्रेषक का पता गलत है। '; +$PHPMAILER_LANG['instantiate'] = 'मेल फ़ंक्शन कॉल नहीं कर सकता है।'; +$PHPMAILER_LANG['invalid_address'] = 'पता गलत है। '; +$PHPMAILER_LANG['invalid_header'] = 'अमान्य हेडर नाम या मान'; +$PHPMAILER_LANG['invalid_hostentry'] = 'अमान्य hostentry: '; +$PHPMAILER_LANG['invalid_host'] = 'अमान्य होस्ट: '; +$PHPMAILER_LANG['mailer_not_supported'] = 'मेल सर्वर के साथ काम नहीं करता है। '; +$PHPMAILER_LANG['provide_address'] = 'आपको कम से कम एक प्राप्तकर्ता का ई-मेल पता प्रदान करना होगा।'; +$PHPMAILER_LANG['recipients_failed'] = 'SMTP त्रुटि: निम्न प्राप्तकर्ताओं को पते भेजने में विफल। '; +$PHPMAILER_LANG['signing'] = 'साइनअप त्रुटि: '; +$PHPMAILER_LANG['smtp_code'] = 'SMTP कोड: '; +$PHPMAILER_LANG['smtp_code_ex'] = 'अतिरिक्त SMTP जानकारी: '; +$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP का connect () फ़ंक्शन विफल हुआ। '; +$PHPMAILER_LANG['smtp_detail'] = 'विवरण: '; +$PHPMAILER_LANG['smtp_error'] = 'SMTP सर्वर त्रुटि। '; +$PHPMAILER_LANG['variable_set'] = 'चर को बना या संशोधित नहीं किया जा सकता। '; diff --git a/conlite/external/phpmailer/phpmailer/language/phpmailer.lang-hr.php b/vendor/phpmailer/phpmailer/language/phpmailer.lang-hr.php similarity index 99% rename from conlite/external/phpmailer/phpmailer/language/phpmailer.lang-hr.php rename to vendor/phpmailer/phpmailer/language/phpmailer.lang-hr.php index 3822920..cacb6c3 100644 --- a/conlite/external/phpmailer/phpmailer/language/phpmailer.lang-hr.php +++ b/vendor/phpmailer/phpmailer/language/phpmailer.lang-hr.php @@ -1,4 +1,5 @@ */ - + $PHPMAILER_LANG['authenticate'] = 'SMTP -ի սխալ: չհաջողվեց ստուգել իսկությունը.'; $PHPMAILER_LANG['connect_host'] = 'SMTP -ի սխալ: չհաջողվեց կապ հաստատել SMTP սերվերի հետ.'; $PHPMAILER_LANG['data_not_accepted'] = 'SMTP -ի սխալ: տվյալները ընդունված չեն.'; diff --git a/vendor/phpmailer/phpmailer/language/phpmailer.lang-id.php b/vendor/phpmailer/phpmailer/language/phpmailer.lang-id.php new file mode 100644 index 0000000..212a11f --- /dev/null +++ b/vendor/phpmailer/phpmailer/language/phpmailer.lang-id.php @@ -0,0 +1,31 @@ + + * @author @januridp + * @author Ian Mustafa + */ + +$PHPMAILER_LANG['authenticate'] = 'Kesalahan SMTP: Tidak dapat mengotentikasi.'; +$PHPMAILER_LANG['connect_host'] = 'Kesalahan SMTP: Tidak dapat terhubung ke host SMTP.'; +$PHPMAILER_LANG['data_not_accepted'] = 'Kesalahan SMTP: Data tidak diterima.'; +$PHPMAILER_LANG['empty_message'] = 'Isi pesan kosong'; +$PHPMAILER_LANG['encoding'] = 'Pengkodean karakter tidak dikenali: '; +$PHPMAILER_LANG['execute'] = 'Tidak dapat menjalankan proses: '; +$PHPMAILER_LANG['file_access'] = 'Tidak dapat mengakses berkas: '; +$PHPMAILER_LANG['file_open'] = 'Kesalahan Berkas: Berkas tidak dapat dibuka: '; +$PHPMAILER_LANG['from_failed'] = 'Alamat pengirim berikut mengakibatkan kesalahan: '; +$PHPMAILER_LANG['instantiate'] = 'Tidak dapat menginisialisasi fungsi surel.'; +$PHPMAILER_LANG['invalid_address'] = 'Gagal terkirim, alamat surel tidak sesuai: '; +$PHPMAILER_LANG['invalid_hostentry'] = 'Gagal terkirim, entri host tidak sesuai: '; +$PHPMAILER_LANG['invalid_host'] = 'Gagal terkirim, host tidak sesuai: '; +$PHPMAILER_LANG['provide_address'] = 'Harus tersedia minimal satu alamat tujuan'; +$PHPMAILER_LANG['mailer_not_supported'] = ' mailer tidak didukung'; +$PHPMAILER_LANG['recipients_failed'] = 'Kesalahan SMTP: Alamat tujuan berikut menyebabkan kesalahan: '; +$PHPMAILER_LANG['signing'] = 'Kesalahan dalam penandatangan SSL: '; +$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP Connect() gagal.'; +$PHPMAILER_LANG['smtp_error'] = 'Kesalahan pada pelayan SMTP: '; +$PHPMAILER_LANG['variable_set'] = 'Tidak dapat mengatur atau mengatur ulang variabel: '; +$PHPMAILER_LANG['extension_missing'] = 'Ekstensi PHP tidak tersedia: '; diff --git a/conlite/external/phpmailer/phpmailer/language/phpmailer.lang-it.php b/vendor/phpmailer/phpmailer/language/phpmailer.lang-it.php similarity index 96% rename from conlite/external/phpmailer/phpmailer/language/phpmailer.lang-it.php rename to vendor/phpmailer/phpmailer/language/phpmailer.lang-it.php index d2f4643..08a6b73 100644 --- a/conlite/external/phpmailer/phpmailer/language/phpmailer.lang-it.php +++ b/vendor/phpmailer/phpmailer/language/phpmailer.lang-it.php @@ -1,4 +1,5 @@ * @author Yoshi Sakai + * @author Arisophy */ $PHPMAILER_LANG['authenticate'] = 'SMTPエラー: 認証できませんでした。'; $PHPMAILER_LANG['connect_host'] = 'SMTPエラー: SMTPホストに接続できませんでした。'; $PHPMAILER_LANG['data_not_accepted'] = 'SMTPエラー: データが受け付けられませんでした。'; -//$PHPMAILER_LANG['empty_message'] = 'Message body empty'; +$PHPMAILER_LANG['empty_message'] = 'メール本文が空です。'; $PHPMAILER_LANG['encoding'] = '不明なエンコーディング: '; $PHPMAILER_LANG['execute'] = '実行できませんでした: '; $PHPMAILER_LANG['file_access'] = 'ファイルにアクセスできません: '; $PHPMAILER_LANG['file_open'] = 'ファイルエラー: ファイルを開けません: '; $PHPMAILER_LANG['from_failed'] = 'Fromアドレスを登録する際にエラーが発生しました: '; $PHPMAILER_LANG['instantiate'] = 'メール関数が正常に動作しませんでした。'; -//$PHPMAILER_LANG['invalid_address'] = 'Invalid address: '; +$PHPMAILER_LANG['invalid_address'] = '不正なメールアドレス: '; $PHPMAILER_LANG['provide_address'] = '少なくとも1つメールアドレスを 指定する必要があります。'; $PHPMAILER_LANG['mailer_not_supported'] = ' メーラーがサポートされていません。'; $PHPMAILER_LANG['recipients_failed'] = 'SMTPエラー: 次の受信者アドレスに 間違いがあります: '; -//$PHPMAILER_LANG['signing'] = 'Signing Error: '; -//$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP Connect() failed.'; -//$PHPMAILER_LANG['smtp_error'] = 'SMTP server error: '; -//$PHPMAILER_LANG['variable_set'] = 'Cannot set or reset variable: '; -//$PHPMAILER_LANG['extension_missing'] = 'Extension missing: '; +$PHPMAILER_LANG['signing'] = '署名エラー: '; +$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP接続に失敗しました。'; +$PHPMAILER_LANG['smtp_error'] = 'SMTPサーバーエラー: '; +$PHPMAILER_LANG['variable_set'] = '変数が存在しません: '; +$PHPMAILER_LANG['extension_missing'] = '拡張機能が見つかりません: '; diff --git a/conlite/external/phpmailer/phpmailer/language/phpmailer.lang-ka.php b/vendor/phpmailer/phpmailer/language/phpmailer.lang-ka.php similarity index 99% rename from conlite/external/phpmailer/phpmailer/language/phpmailer.lang-ka.php rename to vendor/phpmailer/phpmailer/language/phpmailer.lang-ka.php index dd1af8a..51fe403 100644 --- a/conlite/external/phpmailer/phpmailer/language/phpmailer.lang-ka.php +++ b/vendor/phpmailer/phpmailer/language/phpmailer.lang-ka.php @@ -1,4 +1,5 @@ + */ + +$PHPMAILER_LANG['authenticate'] = 'Hadisoana SMTP: Tsy nahomby ny fanamarinana.'; +$PHPMAILER_LANG['connect_host'] = 'SMTP Error: Tsy afaka mampifandray amin\'ny mpampiantrano SMTP.'; +$PHPMAILER_LANG['data_not_accepted'] = 'SMTP diso: tsy voarakitra ny angona.'; +$PHPMAILER_LANG['empty_message'] = 'Tsy misy ny votoaty mailaka.'; +$PHPMAILER_LANG['encoding'] = 'Tsy fantatra encoding: '; +$PHPMAILER_LANG['execute'] = 'Tsy afaka manatanteraka ity baiko manaraka ity: '; +$PHPMAILER_LANG['file_access'] = 'Tsy nahomby ny fidirana amin\'ity rakitra ity: '; +$PHPMAILER_LANG['file_open'] = 'Hadisoana diso: Tsy afaka nanokatra ity file manaraka ity: '; +$PHPMAILER_LANG['from_failed'] = 'Ny adiresy iraka manaraka dia diso: '; +$PHPMAILER_LANG['instantiate'] = 'Tsy afaka nanomboka ny hetsika mail.'; +$PHPMAILER_LANG['invalid_address'] = 'Tsy mety ny adiresy: '; +$PHPMAILER_LANG['mailer_not_supported'] = ' mailer tsy manohana.'; +$PHPMAILER_LANG['provide_address'] = 'Alefaso azafady iray adiresy iray farafahakeliny.'; +$PHPMAILER_LANG['recipients_failed'] = 'SMTP Error: Tsy mety ireo mpanaraka ireto: '; +$PHPMAILER_LANG['signing'] = 'Error nandritra ny sonia:'; +$PHPMAILER_LANG['smtp_connect_failed'] = 'Tsy nahomby ny fifandraisana tamin\'ny server SMTP.'; +$PHPMAILER_LANG['smtp_error'] = 'Fahadisoana tamin\'ny server SMTP: '; +$PHPMAILER_LANG['variable_set'] = 'Tsy azo atao ny mametraka na mamerina ny variable: '; +$PHPMAILER_LANG['extension_missing'] = 'Tsy hita ny ampahany: '; diff --git a/vendor/phpmailer/phpmailer/language/phpmailer.lang-mn.php b/vendor/phpmailer/phpmailer/language/phpmailer.lang-mn.php new file mode 100644 index 0000000..04d262c --- /dev/null +++ b/vendor/phpmailer/phpmailer/language/phpmailer.lang-mn.php @@ -0,0 +1,27 @@ + */ $PHPMAILER_LANG['authenticate'] = 'SMTP-fout: authenticatie mislukt.'; +$PHPMAILER_LANG['buggy_php'] = 'PHP versie gededecteerd die onderhavig is aan een bug die kan resulteren in gecorrumpeerde berichten. Om dit te voorkomen, gebruik SMTP voor het verzenden van berichten, zet de mail.add_x_header optie in uw php.ini file uit, gebruik MacOS of Linux, of pas de gebruikte PHP versie aan naar versie 7.0.17+ or 7.1.3+.'; $PHPMAILER_LANG['connect_host'] = 'SMTP-fout: kon niet verbinden met SMTP-host.'; $PHPMAILER_LANG['data_not_accepted'] = 'SMTP-fout: data niet geaccepteerd.'; $PHPMAILER_LANG['empty_message'] = 'Berichttekst is leeg'; $PHPMAILER_LANG['encoding'] = 'Onbekende codering: '; $PHPMAILER_LANG['execute'] = 'Kon niet uitvoeren: '; +$PHPMAILER_LANG['extension_missing'] = 'Extensie afwezig: '; $PHPMAILER_LANG['file_access'] = 'Kreeg geen toegang tot bestand: '; $PHPMAILER_LANG['file_open'] = 'Bestandsfout: kon bestand niet openen: '; $PHPMAILER_LANG['from_failed'] = 'Het volgende afzendersadres is mislukt: '; $PHPMAILER_LANG['instantiate'] = 'Kon mailfunctie niet initialiseren.'; $PHPMAILER_LANG['invalid_address'] = 'Ongeldig adres: '; +$PHPMAILER_LANG['invalid_header'] = 'Ongeldige header naam of waarde'; +$PHPMAILER_LANG['invalid_hostentry'] = 'Ongeldige hostentry: '; +$PHPMAILER_LANG['invalid_host'] = 'Ongeldige host: '; $PHPMAILER_LANG['mailer_not_supported'] = ' mailer wordt niet ondersteund.'; $PHPMAILER_LANG['provide_address'] = 'Er moet minstens één ontvanger worden opgegeven.'; $PHPMAILER_LANG['recipients_failed'] = 'SMTP-fout: de volgende ontvangers zijn mislukt: '; $PHPMAILER_LANG['signing'] = 'Signeerfout: '; +$PHPMAILER_LANG['smtp_code'] = 'SMTP code: '; +$PHPMAILER_LANG['smtp_code_ex'] = 'Aanvullende SMTP informatie: '; $PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP Verbinding mislukt.'; +$PHPMAILER_LANG['smtp_detail'] = 'Detail: '; $PHPMAILER_LANG['smtp_error'] = 'SMTP-serverfout: '; $PHPMAILER_LANG['variable_set'] = 'Kan de volgende variabele niet instellen of resetten: '; -//$PHPMAILER_LANG['extension_missing'] = 'Extension missing: '; diff --git a/conlite/external/phpmailer/phpmailer/language/phpmailer.lang-pl.php b/vendor/phpmailer/phpmailer/language/phpmailer.lang-pl.php similarity index 75% rename from conlite/external/phpmailer/phpmailer/language/phpmailer.lang-pl.php rename to vendor/phpmailer/phpmailer/language/phpmailer.lang-pl.php index 3da0dee..b0469fd 100644 --- a/conlite/external/phpmailer/phpmailer/language/phpmailer.lang-pl.php +++ b/vendor/phpmailer/phpmailer/language/phpmailer.lang-pl.php @@ -1,4 +1,5 @@ * @author Phelipe Alves * @author Fabio Beneditto + * @author Geidson Benício Coelho */ $PHPMAILER_LANG['authenticate'] = 'Erro de SMTP: Não foi possível autenticar.'; +$PHPMAILER_LANG['buggy_php'] = 'Sua versão do PHP é afetada por um bug que por resultar em messagens corrompidas. Para corrigir, mude para enviar usando SMTP, desative a opção mail.add_x_header em seu php.ini, mude para MacOS ou Linux, ou atualize seu PHP para versão 7.0.17+ ou 7.1.3+ '; $PHPMAILER_LANG['connect_host'] = 'Erro de SMTP: Não foi possível conectar ao servidor SMTP.'; $PHPMAILER_LANG['data_not_accepted'] = 'Erro de SMTP: Dados rejeitados.'; $PHPMAILER_LANG['empty_message'] = 'Mensagem vazia'; $PHPMAILER_LANG['encoding'] = 'Codificação desconhecida: '; $PHPMAILER_LANG['execute'] = 'Não foi possível executar: '; +$PHPMAILER_LANG['extension_missing'] = 'Extensão não existe: '; $PHPMAILER_LANG['file_access'] = 'Não foi possível acessar o arquivo: '; $PHPMAILER_LANG['file_open'] = 'Erro de Arquivo: Não foi possível abrir o arquivo: '; $PHPMAILER_LANG['from_failed'] = 'Os seguintes remetentes falharam: '; $PHPMAILER_LANG['instantiate'] = 'Não foi possível instanciar a função mail.'; $PHPMAILER_LANG['invalid_address'] = 'Endereço de e-mail inválido: '; +$PHPMAILER_LANG['invalid_header'] = 'Nome ou valor de cabeçalho inválido'; +$PHPMAILER_LANG['invalid_hostentry'] = 'hostentry inválido: '; +$PHPMAILER_LANG['invalid_host'] = 'host inválido: '; $PHPMAILER_LANG['mailer_not_supported'] = ' mailer não é suportado.'; $PHPMAILER_LANG['provide_address'] = 'Você deve informar pelo menos um destinatário.'; $PHPMAILER_LANG['recipients_failed'] = 'Erro de SMTP: Os seguintes destinatários falharam: '; $PHPMAILER_LANG['signing'] = 'Erro de Assinatura: '; $PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP Connect() falhou.'; +$PHPMAILER_LANG['smtp_code'] = 'Código do servidor SMTP: '; $PHPMAILER_LANG['smtp_error'] = 'Erro de servidor SMTP: '; +$PHPMAILER_LANG['smtp_code_ex'] = 'Informações adicionais do servidor SMTP: '; +$PHPMAILER_LANG['smtp_detail'] = 'Detalhes do servidor SMTP: '; $PHPMAILER_LANG['variable_set'] = 'Não foi possível definir ou redefinir a variável: '; -$PHPMAILER_LANG['extension_missing'] = 'Extensão ausente: '; diff --git a/conlite/external/phpmailer/phpmailer/language/phpmailer.lang-ro.php b/vendor/phpmailer/phpmailer/language/phpmailer.lang-ro.php similarity index 69% rename from conlite/external/phpmailer/phpmailer/language/phpmailer.lang-ro.php rename to vendor/phpmailer/phpmailer/language/phpmailer.lang-ro.php index fa100ea..45bef91 100644 --- a/conlite/external/phpmailer/phpmailer/language/phpmailer.lang-ro.php +++ b/vendor/phpmailer/phpmailer/language/phpmailer.lang-ro.php @@ -1,26 +1,33 @@ */ $PHPMAILER_LANG['authenticate'] = 'Eroare SMTP: Autentificarea a eșuat.'; +$PHPMAILER_LANG['buggy_php'] = 'Versiunea instalată de PHP este afectată de o problemă care poate duce la coruperea mesajelor Pentru a preveni această problemă, folosiți SMTP, dezactivați opțiunea mail.add_x_header din php.ini, folosiți MacOS/Linux sau actualizați versiunea de PHP la 7.0.17+ sau 7.1.3+.'; $PHPMAILER_LANG['connect_host'] = 'Eroare SMTP: Conectarea la serverul SMTP a eșuat.'; $PHPMAILER_LANG['data_not_accepted'] = 'Eroare SMTP: Datele nu au fost acceptate.'; $PHPMAILER_LANG['empty_message'] = 'Mesajul este gol.'; $PHPMAILER_LANG['encoding'] = 'Encodare necunoscută: '; $PHPMAILER_LANG['execute'] = 'Nu se poate executa următoarea comandă: '; +$PHPMAILER_LANG['extension_missing'] = 'Lipsește extensia: '; $PHPMAILER_LANG['file_access'] = 'Nu se poate accesa următorul fișier: '; $PHPMAILER_LANG['file_open'] = 'Eroare fișier: Nu se poate deschide următorul fișier: '; $PHPMAILER_LANG['from_failed'] = 'Următoarele adrese From au dat eroare: '; $PHPMAILER_LANG['instantiate'] = 'Funcția mail nu a putut fi inițializată.'; $PHPMAILER_LANG['invalid_address'] = 'Adresa de email nu este validă: '; +$PHPMAILER_LANG['invalid_header'] = 'Numele sau valoarea header-ului nu este validă: '; +$PHPMAILER_LANG['invalid_hostentry'] = 'Hostentry invalid: '; +$PHPMAILER_LANG['invalid_host'] = 'Host invalid: '; $PHPMAILER_LANG['mailer_not_supported'] = ' mailer nu este suportat.'; $PHPMAILER_LANG['provide_address'] = 'Trebuie să adăugați cel puțin o adresă de email.'; $PHPMAILER_LANG['recipients_failed'] = 'Eroare SMTP: Următoarele adrese de email au eșuat: '; $PHPMAILER_LANG['signing'] = 'A aparut o problemă la semnarea emailului. '; +$PHPMAILER_LANG['smtp_code'] = 'Cod SMTP: '; +$PHPMAILER_LANG['smtp_code_ex'] = 'Informații SMTP adiționale: '; $PHPMAILER_LANG['smtp_connect_failed'] = 'Conectarea la serverul SMTP a eșuat.'; +$PHPMAILER_LANG['smtp_detail'] = 'Detalii SMTP: '; $PHPMAILER_LANG['smtp_error'] = 'Eroare server SMTP: '; $PHPMAILER_LANG['variable_set'] = 'Nu se poate seta/reseta variabila. '; -$PHPMAILER_LANG['extension_missing'] = 'Lipsește extensia: '; diff --git a/conlite/external/phpmailer/phpmailer/language/phpmailer.lang-ru.php b/vendor/phpmailer/phpmailer/language/phpmailer.lang-ru.php similarity index 68% rename from conlite/external/phpmailer/phpmailer/language/phpmailer.lang-ru.php rename to vendor/phpmailer/phpmailer/language/phpmailer.lang-ru.php index 4066f6b..8c8c5e8 100644 --- a/conlite/external/phpmailer/phpmailer/language/phpmailer.lang-ru.php +++ b/vendor/phpmailer/phpmailer/language/phpmailer.lang-ru.php @@ -1,4 +1,5 @@ + * @author Peter Orlický */ $PHPMAILER_LANG['authenticate'] = 'SMTP Error: Chyba autentifikácie.'; @@ -16,6 +18,8 @@ $PHPMAILER_LANG['file_open'] = 'File Error: Súbor sa otvoriť pre č $PHPMAILER_LANG['from_failed'] = 'Následujúca adresa From je nesprávna: '; $PHPMAILER_LANG['instantiate'] = 'Nedá sa vytvoriť inštancia emailovej funkcie.'; $PHPMAILER_LANG['invalid_address'] = 'Neodoslané, emailová adresa je nesprávna: '; +$PHPMAILER_LANG['invalid_hostentry'] = 'Záznam hostiteľa je nesprávny: '; +$PHPMAILER_LANG['invalid_host'] = 'Hostiteľ je nesprávny: '; $PHPMAILER_LANG['mailer_not_supported'] = ' emailový klient nieje podporovaný.'; $PHPMAILER_LANG['provide_address'] = 'Musíte zadať aspoň jednu emailovú adresu príjemcu.'; $PHPMAILER_LANG['recipients_failed'] = 'SMTP Error: Adresy príjemcov niesu správne '; @@ -23,4 +27,4 @@ $PHPMAILER_LANG['signing'] = 'Chyba prihlasovania: '; $PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP Connect() zlyhalo.'; $PHPMAILER_LANG['smtp_error'] = 'SMTP chyba serveru: '; $PHPMAILER_LANG['variable_set'] = 'Nemožno nastaviť alebo resetovať premennú: '; -//$PHPMAILER_LANG['extension_missing'] = 'Extension missing: '; +$PHPMAILER_LANG['extension_missing'] = 'Chýba rozšírenie: '; diff --git a/conlite/external/phpmailer/phpmailer/language/phpmailer.lang-sl.php b/vendor/phpmailer/phpmailer/language/phpmailer.lang-sl.php similarity index 56% rename from conlite/external/phpmailer/phpmailer/language/phpmailer.lang-sl.php rename to vendor/phpmailer/phpmailer/language/phpmailer.lang-sl.php index 54c9572..3e00c25 100644 --- a/conlite/external/phpmailer/phpmailer/language/phpmailer.lang-sl.php +++ b/vendor/phpmailer/phpmailer/language/phpmailer.lang-sl.php @@ -1,26 +1,36 @@ + * @author Filip Š + * @author Blaž Oražem */ $PHPMAILER_LANG['authenticate'] = 'SMTP napaka: Avtentikacija ni uspela.'; -$PHPMAILER_LANG['connect_host'] = 'SMTP napaka: Ne morem vzpostaviti povezave s SMTP gostiteljem.'; +$PHPMAILER_LANG['buggy_php'] = 'Na vašo PHP različico vpliva napaka, ki lahko povzroči poškodovana sporočila. Če želite težavo odpraviti, preklopite na pošiljanje prek SMTP, onemogočite možnost mail.add_x_header v vaši php.ini datoteki, preklopite na MacOS ali Linux, ali nadgradite vašo PHP zaličico na 7.0.17+ ali 7.1.3+.'; +$PHPMAILER_LANG['connect_host'] = 'SMTP napaka: Vzpostavljanje povezave s SMTP gostiteljem ni uspelo.'; $PHPMAILER_LANG['data_not_accepted'] = 'SMTP napaka: Strežnik zavrača podatke.'; $PHPMAILER_LANG['empty_message'] = 'E-poštno sporočilo nima vsebine.'; $PHPMAILER_LANG['encoding'] = 'Nepoznan tip kodiranja: '; $PHPMAILER_LANG['execute'] = 'Operacija ni uspela: '; +$PHPMAILER_LANG['extension_missing'] = 'Manjkajoča razširitev: '; $PHPMAILER_LANG['file_access'] = 'Nimam dostopa do datoteke: '; $PHPMAILER_LANG['file_open'] = 'Ne morem odpreti datoteke: '; $PHPMAILER_LANG['from_failed'] = 'Neveljaven e-naslov pošiljatelja: '; $PHPMAILER_LANG['instantiate'] = 'Ne morem inicializirati mail funkcije.'; $PHPMAILER_LANG['invalid_address'] = 'E-poštno sporočilo ni bilo poslano. E-naslov je neveljaven: '; +$PHPMAILER_LANG['invalid_header'] = 'Neveljavno ime ali vrednost glave'; +$PHPMAILER_LANG['invalid_hostentry'] = 'Neveljaven vnos gostitelja: '; +$PHPMAILER_LANG['invalid_host'] = 'Neveljaven gostitelj: '; $PHPMAILER_LANG['mailer_not_supported'] = ' mailer ni podprt.'; -$PHPMAILER_LANG['provide_address'] = 'Prosim vnesite vsaj enega naslovnika.'; +$PHPMAILER_LANG['provide_address'] = 'Prosimo, vnesite vsaj enega naslovnika.'; $PHPMAILER_LANG['recipients_failed'] = 'SMTP napaka: Sledeči naslovniki so neveljavni: '; $PHPMAILER_LANG['signing'] = 'Napaka pri podpisovanju: '; +$PHPMAILER_LANG['smtp_code'] = 'SMTP koda: '; +$PHPMAILER_LANG['smtp_code_ex'] = 'Dodatne informacije o SMTP: '; $PHPMAILER_LANG['smtp_connect_failed'] = 'Ne morem vzpostaviti povezave s SMTP strežnikom.'; +$PHPMAILER_LANG['smtp_detail'] = 'Podrobnosti: '; $PHPMAILER_LANG['smtp_error'] = 'Napaka SMTP strežnika: '; $PHPMAILER_LANG['variable_set'] = 'Ne morem nastaviti oz. ponastaviti spremenljivke: '; -//$PHPMAILER_LANG['extension_missing'] = 'Extension missing: '; diff --git a/conlite/external/phpmailer/phpmailer/language/phpmailer.lang-rs.php b/vendor/phpmailer/phpmailer/language/phpmailer.lang-sr.php similarity index 79% rename from conlite/external/phpmailer/phpmailer/language/phpmailer.lang-rs.php rename to vendor/phpmailer/phpmailer/language/phpmailer.lang-sr.php index 0502f02..0b5280f 100644 --- a/conlite/external/phpmailer/phpmailer/language/phpmailer.lang-rs.php +++ b/vendor/phpmailer/phpmailer/language/phpmailer.lang-sr.php @@ -1,26 +1,28 @@ + * @author Miloš Milanović */ $PHPMAILER_LANG['authenticate'] = 'SMTP грешка: аутентификација није успела.'; -$PHPMAILER_LANG['connect_host'] = 'SMTP грешка: није могуће повезивање са SMTP сервером.'; +$PHPMAILER_LANG['connect_host'] = 'SMTP грешка: повезивање са SMTP сервером није успело.'; $PHPMAILER_LANG['data_not_accepted'] = 'SMTP грешка: подаци нису прихваћени.'; $PHPMAILER_LANG['empty_message'] = 'Садржај поруке је празан.'; -$PHPMAILER_LANG['encoding'] = 'Непознато кодовање: '; +$PHPMAILER_LANG['encoding'] = 'Непознато кодирање: '; $PHPMAILER_LANG['execute'] = 'Није могуће извршити наредбу: '; $PHPMAILER_LANG['file_access'] = 'Није могуће приступити датотеци: '; $PHPMAILER_LANG['file_open'] = 'Није могуће отворити датотеку: '; $PHPMAILER_LANG['from_failed'] = 'SMTP грешка: слање са следећих адреса није успело: '; $PHPMAILER_LANG['recipients_failed'] = 'SMTP грешка: слање на следеће адресе није успело: '; $PHPMAILER_LANG['instantiate'] = 'Није могуће покренути mail функцију.'; -$PHPMAILER_LANG['invalid_address'] = 'Порука није послата због неисправне адресе: '; +$PHPMAILER_LANG['invalid_address'] = 'Порука није послата. Неисправна адреса: '; $PHPMAILER_LANG['mailer_not_supported'] = ' мејлер није подржан.'; -$PHPMAILER_LANG['provide_address'] = 'Потребно је задати најмање једну адресу.'; -$PHPMAILER_LANG['signing'] = 'Грешка приликом пријављивања: '; +$PHPMAILER_LANG['provide_address'] = 'Дефинишите бар једну адресу примаоца.'; +$PHPMAILER_LANG['signing'] = 'Грешка приликом пријаве: '; $PHPMAILER_LANG['smtp_connect_failed'] = 'Повезивање са SMTP сервером није успело.'; $PHPMAILER_LANG['smtp_error'] = 'Грешка SMTP сервера: '; -$PHPMAILER_LANG['variable_set'] = 'Није могуће задати променљиву, нити је вратити уназад: '; +$PHPMAILER_LANG['variable_set'] = 'Није могуће задати нити ресетовати променљиву: '; $PHPMAILER_LANG['extension_missing'] = 'Недостаје проширење: '; diff --git a/vendor/phpmailer/phpmailer/language/phpmailer.lang-sr_latn.php b/vendor/phpmailer/phpmailer/language/phpmailer.lang-sr_latn.php new file mode 100644 index 0000000..6213832 --- /dev/null +++ b/vendor/phpmailer/phpmailer/language/phpmailer.lang-sr_latn.php @@ -0,0 +1,28 @@ + + * @author Miloš Milanović + */ + +$PHPMAILER_LANG['authenticate'] = 'SMTP greška: autentifikacija nije uspela.'; +$PHPMAILER_LANG['connect_host'] = 'SMTP greška: povezivanje sa SMTP serverom nije uspelo.'; +$PHPMAILER_LANG['data_not_accepted'] = 'SMTP greška: podaci nisu prihvaćeni.'; +$PHPMAILER_LANG['empty_message'] = 'Sadržaj poruke je prazan.'; +$PHPMAILER_LANG['encoding'] = 'Nepoznato kodiranje: '; +$PHPMAILER_LANG['execute'] = 'Nije moguće izvršiti naredbu: '; +$PHPMAILER_LANG['file_access'] = 'Nije moguće pristupiti datoteci: '; +$PHPMAILER_LANG['file_open'] = 'Nije moguće otvoriti datoteku: '; +$PHPMAILER_LANG['from_failed'] = 'SMTP greška: slanje sa sledećih adresa nije uspelo: '; +$PHPMAILER_LANG['recipients_failed'] = 'SMTP greška: slanje na sledeće adrese nije uspelo: '; +$PHPMAILER_LANG['instantiate'] = 'Nije moguće pokrenuti mail funkciju.'; +$PHPMAILER_LANG['invalid_address'] = 'Poruka nije poslata. Neispravna adresa: '; +$PHPMAILER_LANG['mailer_not_supported'] = ' majler nije podržan.'; +$PHPMAILER_LANG['provide_address'] = 'Definišite bar jednu adresu primaoca.'; +$PHPMAILER_LANG['signing'] = 'Greška prilikom prijave: '; +$PHPMAILER_LANG['smtp_connect_failed'] = 'Povezivanje sa SMTP serverom nije uspelo.'; +$PHPMAILER_LANG['smtp_error'] = 'Greška SMTP servera: '; +$PHPMAILER_LANG['variable_set'] = 'Nije moguće zadati niti resetovati promenljivu: '; +$PHPMAILER_LANG['extension_missing'] = 'Nedostaje proširenje: '; diff --git a/conlite/external/phpmailer/phpmailer/language/phpmailer.lang-sv.php b/vendor/phpmailer/phpmailer/language/phpmailer.lang-sv.php similarity index 92% rename from conlite/external/phpmailer/phpmailer/language/phpmailer.lang-sv.php rename to vendor/phpmailer/phpmailer/language/phpmailer.lang-sv.php index 4408e63..9872c19 100644 --- a/conlite/external/phpmailer/phpmailer/language/phpmailer.lang-sv.php +++ b/vendor/phpmailer/phpmailer/language/phpmailer.lang-sv.php @@ -1,4 +1,5 @@ + */ + +$PHPMAILER_LANG['authenticate'] = 'SMTP Error: Hindi mapatotohanan.'; +$PHPMAILER_LANG['connect_host'] = 'SMTP Error: Hindi makakonekta sa SMTP host.'; +$PHPMAILER_LANG['data_not_accepted'] = 'SMTP Error: Ang datos ay hindi naitanggap.'; +$PHPMAILER_LANG['empty_message'] = 'Walang laman ang mensahe'; +$PHPMAILER_LANG['encoding'] = 'Hindi alam ang encoding: '; +$PHPMAILER_LANG['execute'] = 'Hindi maisasagawa: '; +$PHPMAILER_LANG['file_access'] = 'Hindi ma-access ang file: '; +$PHPMAILER_LANG['file_open'] = 'File Error: Hindi mabuksan ang file: '; +$PHPMAILER_LANG['from_failed'] = 'Ang sumusunod na address ay nabigo: '; +$PHPMAILER_LANG['instantiate'] = 'Hindi maisimulan ang instance ng mail function.'; +$PHPMAILER_LANG['invalid_address'] = 'Hindi wasto ang address na naibigay: '; +$PHPMAILER_LANG['mailer_not_supported'] = 'Ang mailer ay hindi suportado.'; +$PHPMAILER_LANG['provide_address'] = 'Kailangan mong magbigay ng kahit isang email address na tatanggap.'; +$PHPMAILER_LANG['recipients_failed'] = 'SMTP Error: Ang mga sumusunod na tatanggap ay nabigo: '; +$PHPMAILER_LANG['signing'] = 'Hindi ma-sign: '; +$PHPMAILER_LANG['smtp_connect_failed'] = 'Ang SMTP connect() ay nabigo.'; +$PHPMAILER_LANG['smtp_error'] = 'Ang server ng SMTP ay nabigo: '; +$PHPMAILER_LANG['variable_set'] = 'Hindi matatakda o ma-reset ang mga variables: '; +$PHPMAILER_LANG['extension_missing'] = 'Nawawala ang extension: '; diff --git a/conlite/external/phpmailer/phpmailer/language/phpmailer.lang-tr.php b/vendor/phpmailer/phpmailer/language/phpmailer.lang-tr.php similarity index 99% rename from conlite/external/phpmailer/phpmailer/language/phpmailer.lang-tr.php rename to vendor/phpmailer/phpmailer/language/phpmailer.lang-tr.php index cfe8eaa..f938f80 100644 --- a/conlite/external/phpmailer/phpmailer/language/phpmailer.lang-tr.php +++ b/vendor/phpmailer/phpmailer/language/phpmailer.lang-tr.php @@ -1,4 +1,5 @@ + * @author Jim Jagielski (jimjag) + * @author Andy Prevost (codeworxtech) + * @author Brent R. Matzelle (original founder) + * @copyright 2012 - 2023 Marcus Bointon + * @copyright 2010 - 2012 Jim Jagielski + * @copyright 2004 - 2009 Andy Prevost + * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License + * @note This program is distributed in the hope that it will be useful - WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. + */ + +namespace PHPMailer\PHPMailer; + +/** + * Configure PHPMailer with DSN string. + * + * @see https://en.wikipedia.org/wiki/Data_source_name + * + * @author Oleg Voronkovich + */ +class DSNConfigurator +{ + /** + * Create new PHPMailer instance configured by DSN. + * + * @param string $dsn DSN + * @param bool $exceptions Should we throw external exceptions? + * + * @return PHPMailer + */ + public static function mailer($dsn, $exceptions = null) + { + static $configurator = null; + + if (null === $configurator) { + $configurator = new DSNConfigurator(); + } + + return $configurator->configure(new PHPMailer($exceptions), $dsn); + } + + /** + * Configure PHPMailer instance with DSN string. + * + * @param PHPMailer $mailer PHPMailer instance + * @param string $dsn DSN + * + * @return PHPMailer + */ + public function configure(PHPMailer $mailer, $dsn) + { + $config = $this->parseDSN($dsn); + + $this->applyConfig($mailer, $config); + + return $mailer; + } + + /** + * Parse DSN string. + * + * @param string $dsn DSN + * + * @throws Exception If DSN is malformed + * + * @return array Configuration + */ + private function parseDSN($dsn) + { + $config = $this->parseUrl($dsn); + + if (false === $config || !isset($config['scheme']) || !isset($config['host'])) { + throw new Exception( + sprintf('Malformed DSN: "%s".', $dsn) + ); + } + + if (isset($config['query'])) { + parse_str($config['query'], $config['query']); + } + + return $config; + } + + /** + * Apply configuration to mailer. + * + * @param PHPMailer $mailer PHPMailer instance + * @param array $config Configuration + * + * @throws Exception If scheme is invalid + */ + private function applyConfig(PHPMailer $mailer, $config) + { + switch ($config['scheme']) { + case 'mail': + $mailer->isMail(); + break; + case 'sendmail': + $mailer->isSendmail(); + break; + case 'qmail': + $mailer->isQmail(); + break; + case 'smtp': + case 'smtps': + $mailer->isSMTP(); + $this->configureSMTP($mailer, $config); + break; + default: + throw new Exception( + sprintf( + 'Invalid scheme: "%s". Allowed values: "mail", "sendmail", "qmail", "smtp", "smtps".', + $config['scheme'] + ) + ); + } + + if (isset($config['query'])) { + $this->configureOptions($mailer, $config['query']); + } + } + + /** + * Configure SMTP. + * + * @param PHPMailer $mailer PHPMailer instance + * @param array $config Configuration + */ + private function configureSMTP($mailer, $config) + { + $isSMTPS = 'smtps' === $config['scheme']; + + if ($isSMTPS) { + $mailer->SMTPSecure = PHPMailer::ENCRYPTION_STARTTLS; + } + + $mailer->Host = $config['host']; + + if (isset($config['port'])) { + $mailer->Port = $config['port']; + } elseif ($isSMTPS) { + $mailer->Port = SMTP::DEFAULT_SECURE_PORT; + } + + $mailer->SMTPAuth = isset($config['user']) || isset($config['pass']); + + if (isset($config['user'])) { + $mailer->Username = $config['user']; + } + + if (isset($config['pass'])) { + $mailer->Password = $config['pass']; + } + } + + /** + * Configure options. + * + * @param PHPMailer $mailer PHPMailer instance + * @param array $options Options + * + * @throws Exception If option is unknown + */ + private function configureOptions(PHPMailer $mailer, $options) + { + $allowedOptions = get_object_vars($mailer); + + unset($allowedOptions['Mailer']); + unset($allowedOptions['SMTPAuth']); + unset($allowedOptions['Username']); + unset($allowedOptions['Password']); + unset($allowedOptions['Hostname']); + unset($allowedOptions['Port']); + unset($allowedOptions['ErrorInfo']); + + $allowedOptions = \array_keys($allowedOptions); + + foreach ($options as $key => $value) { + if (!in_array($key, $allowedOptions)) { + throw new Exception( + sprintf( + 'Unknown option: "%s". Allowed values: "%s"', + $key, + implode('", "', $allowedOptions) + ) + ); + } + + switch ($key) { + case 'AllowEmpty': + case 'SMTPAutoTLS': + case 'SMTPKeepAlive': + case 'SingleTo': + case 'UseSendmailOptions': + case 'do_verp': + case 'DKIM_copyHeaderFields': + $mailer->$key = (bool) $value; + break; + case 'Priority': + case 'SMTPDebug': + case 'WordWrap': + $mailer->$key = (int) $value; + break; + default: + $mailer->$key = $value; + break; + } + } + } + + /** + * Parse a URL. + * Wrapper for the built-in parse_url function to work around a bug in PHP 5.5. + * + * @param string $url URL + * + * @return array|false + */ + protected function parseUrl($url) + { + if (\PHP_VERSION_ID >= 50600 || false === strpos($url, '?')) { + return parse_url($url); + } + + $chunks = explode('?', $url); + if (is_array($chunks)) { + $result = parse_url($chunks[0]); + if (is_array($result)) { + $result['query'] = $chunks[1]; + } + return $result; + } + + return false; + } +} diff --git a/vendor/phpmailer/phpmailer/src/Exception.php b/vendor/phpmailer/phpmailer/src/Exception.php new file mode 100644 index 0000000..52eaf95 --- /dev/null +++ b/vendor/phpmailer/phpmailer/src/Exception.php @@ -0,0 +1,40 @@ + + * @author Jim Jagielski (jimjag) + * @author Andy Prevost (codeworxtech) + * @author Brent R. Matzelle (original founder) + * @copyright 2012 - 2020 Marcus Bointon + * @copyright 2010 - 2012 Jim Jagielski + * @copyright 2004 - 2009 Andy Prevost + * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License + * @note This program is distributed in the hope that it will be useful - WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. + */ + +namespace PHPMailer\PHPMailer; + +/** + * PHPMailer exception handler. + * + * @author Marcus Bointon + */ +class Exception extends \Exception +{ + /** + * Prettify error message output. + * + * @return string + */ + public function errorMessage() + { + return '' . htmlspecialchars($this->getMessage(), ENT_COMPAT | ENT_HTML401) . "
\n"; + } +} diff --git a/vendor/phpmailer/phpmailer/src/OAuth.php b/vendor/phpmailer/phpmailer/src/OAuth.php new file mode 100644 index 0000000..c1d5b77 --- /dev/null +++ b/vendor/phpmailer/phpmailer/src/OAuth.php @@ -0,0 +1,139 @@ + + * @author Jim Jagielski (jimjag) + * @author Andy Prevost (codeworxtech) + * @author Brent R. Matzelle (original founder) + * @copyright 2012 - 2020 Marcus Bointon + * @copyright 2010 - 2012 Jim Jagielski + * @copyright 2004 - 2009 Andy Prevost + * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License + * @note This program is distributed in the hope that it will be useful - WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. + */ + +namespace PHPMailer\PHPMailer; + +use League\OAuth2\Client\Grant\RefreshToken; +use League\OAuth2\Client\Provider\AbstractProvider; +use League\OAuth2\Client\Token\AccessToken; + +/** + * OAuth - OAuth2 authentication wrapper class. + * Uses the oauth2-client package from the League of Extraordinary Packages. + * + * @see http://oauth2-client.thephpleague.com + * + * @author Marcus Bointon (Synchro/coolbru) + */ +class OAuth implements OAuthTokenProvider +{ + /** + * An instance of the League OAuth Client Provider. + * + * @var AbstractProvider + */ + protected $provider; + + /** + * The current OAuth access token. + * + * @var AccessToken + */ + protected $oauthToken; + + /** + * The user's email address, usually used as the login ID + * and also the from address when sending email. + * + * @var string + */ + protected $oauthUserEmail = ''; + + /** + * The client secret, generated in the app definition of the service you're connecting to. + * + * @var string + */ + protected $oauthClientSecret = ''; + + /** + * The client ID, generated in the app definition of the service you're connecting to. + * + * @var string + */ + protected $oauthClientId = ''; + + /** + * The refresh token, used to obtain new AccessTokens. + * + * @var string + */ + protected $oauthRefreshToken = ''; + + /** + * OAuth constructor. + * + * @param array $options Associative array containing + * `provider`, `userName`, `clientSecret`, `clientId` and `refreshToken` elements + */ + public function __construct($options) + { + $this->provider = $options['provider']; + $this->oauthUserEmail = $options['userName']; + $this->oauthClientSecret = $options['clientSecret']; + $this->oauthClientId = $options['clientId']; + $this->oauthRefreshToken = $options['refreshToken']; + } + + /** + * Get a new RefreshToken. + * + * @return RefreshToken + */ + protected function getGrant() + { + return new RefreshToken(); + } + + /** + * Get a new AccessToken. + * + * @return AccessToken + */ + protected function getToken() + { + return $this->provider->getAccessToken( + $this->getGrant(), + ['refresh_token' => $this->oauthRefreshToken] + ); + } + + /** + * Generate a base64-encoded OAuth token. + * + * @return string + */ + public function getOauth64() + { + //Get a new token if it's not available or has expired + if (null === $this->oauthToken || $this->oauthToken->hasExpired()) { + $this->oauthToken = $this->getToken(); + } + + return base64_encode( + 'user=' . + $this->oauthUserEmail . + "\001auth=Bearer " . + $this->oauthToken . + "\001\001" + ); + } +} diff --git a/vendor/phpmailer/phpmailer/src/OAuthTokenProvider.php b/vendor/phpmailer/phpmailer/src/OAuthTokenProvider.php new file mode 100644 index 0000000..1155507 --- /dev/null +++ b/vendor/phpmailer/phpmailer/src/OAuthTokenProvider.php @@ -0,0 +1,44 @@ + + * @author Jim Jagielski (jimjag) + * @author Andy Prevost (codeworxtech) + * @author Brent R. Matzelle (original founder) + * @copyright 2012 - 2020 Marcus Bointon + * @copyright 2010 - 2012 Jim Jagielski + * @copyright 2004 - 2009 Andy Prevost + * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License + * @note This program is distributed in the hope that it will be useful - WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. + */ + +namespace PHPMailer\PHPMailer; + +/** + * OAuthTokenProvider - OAuth2 token provider interface. + * Provides base64 encoded OAuth2 auth strings for SMTP authentication. + * + * @see OAuth + * @see SMTP::authenticate() + * + * @author Peter Scopes (pdscopes) + * @author Marcus Bointon (Synchro/coolbru) + */ +interface OAuthTokenProvider +{ + /** + * Generate a base64-encoded OAuth token ensuring that the access token has not expired. + * The string to be base 64 encoded should be in the form: + * "user=\001auth=Bearer \001\001" + * + * @return string + */ + public function getOauth64(); +} diff --git a/vendor/phpmailer/phpmailer/src/PHPMailer.php b/vendor/phpmailer/phpmailer/src/PHPMailer.php new file mode 100644 index 0000000..a644d2c --- /dev/null +++ b/vendor/phpmailer/phpmailer/src/PHPMailer.php @@ -0,0 +1,5126 @@ + + * @author Jim Jagielski (jimjag) + * @author Andy Prevost (codeworxtech) + * @author Brent R. Matzelle (original founder) + * @copyright 2012 - 2020 Marcus Bointon + * @copyright 2010 - 2012 Jim Jagielski + * @copyright 2004 - 2009 Andy Prevost + * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License + * @note This program is distributed in the hope that it will be useful - WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. + */ + +namespace PHPMailer\PHPMailer; + +/** + * PHPMailer - PHP email creation and transport class. + * + * @author Marcus Bointon (Synchro/coolbru) + * @author Jim Jagielski (jimjag) + * @author Andy Prevost (codeworxtech) + * @author Brent R. Matzelle (original founder) + */ +class PHPMailer +{ + const CHARSET_ASCII = 'us-ascii'; + const CHARSET_ISO88591 = 'iso-8859-1'; + const CHARSET_UTF8 = 'utf-8'; + + const CONTENT_TYPE_PLAINTEXT = 'text/plain'; + const CONTENT_TYPE_TEXT_CALENDAR = 'text/calendar'; + const CONTENT_TYPE_TEXT_HTML = 'text/html'; + const CONTENT_TYPE_MULTIPART_ALTERNATIVE = 'multipart/alternative'; + const CONTENT_TYPE_MULTIPART_MIXED = 'multipart/mixed'; + const CONTENT_TYPE_MULTIPART_RELATED = 'multipart/related'; + + const ENCODING_7BIT = '7bit'; + const ENCODING_8BIT = '8bit'; + const ENCODING_BASE64 = 'base64'; + const ENCODING_BINARY = 'binary'; + const ENCODING_QUOTED_PRINTABLE = 'quoted-printable'; + + const ENCRYPTION_STARTTLS = 'tls'; + const ENCRYPTION_SMTPS = 'ssl'; + + const ICAL_METHOD_REQUEST = 'REQUEST'; + const ICAL_METHOD_PUBLISH = 'PUBLISH'; + const ICAL_METHOD_REPLY = 'REPLY'; + const ICAL_METHOD_ADD = 'ADD'; + const ICAL_METHOD_CANCEL = 'CANCEL'; + const ICAL_METHOD_REFRESH = 'REFRESH'; + const ICAL_METHOD_COUNTER = 'COUNTER'; + const ICAL_METHOD_DECLINECOUNTER = 'DECLINECOUNTER'; + + /** + * Email priority. + * Options: null (default), 1 = High, 3 = Normal, 5 = low. + * When null, the header is not set at all. + * + * @var int|null + */ + public $Priority; + + /** + * The character set of the message. + * + * @var string + */ + public $CharSet = self::CHARSET_ISO88591; + + /** + * The MIME Content-type of the message. + * + * @var string + */ + public $ContentType = self::CONTENT_TYPE_PLAINTEXT; + + /** + * The message encoding. + * Options: "8bit", "7bit", "binary", "base64", and "quoted-printable". + * + * @var string + */ + public $Encoding = self::ENCODING_8BIT; + + /** + * Holds the most recent mailer error message. + * + * @var string + */ + public $ErrorInfo = ''; + + /** + * The From email address for the message. + * + * @var string + */ + public $From = ''; + + /** + * The From name of the message. + * + * @var string + */ + public $FromName = ''; + + /** + * The envelope sender of the message. + * This will usually be turned into a Return-Path header by the receiver, + * and is the address that bounces will be sent to. + * If not empty, will be passed via `-f` to sendmail or as the 'MAIL FROM' value over SMTP. + * + * @var string + */ + public $Sender = ''; + + /** + * The Subject of the message. + * + * @var string + */ + public $Subject = ''; + + /** + * An HTML or plain text message body. + * If HTML then call isHTML(true). + * + * @var string + */ + public $Body = ''; + + /** + * The plain-text message body. + * This body can be read by mail clients that do not have HTML email + * capability such as mutt & Eudora. + * Clients that can read HTML will view the normal Body. + * + * @var string + */ + public $AltBody = ''; + + /** + * An iCal message part body. + * Only supported in simple alt or alt_inline message types + * To generate iCal event structures, use classes like EasyPeasyICS or iCalcreator. + * + * @see http://sprain.ch/blog/downloads/php-class-easypeasyics-create-ical-files-with-php/ + * @see http://kigkonsult.se/iCalcreator/ + * + * @var string + */ + public $Ical = ''; + + /** + * Value-array of "method" in Contenttype header "text/calendar" + * + * @var string[] + */ + protected static $IcalMethods = [ + self::ICAL_METHOD_REQUEST, + self::ICAL_METHOD_PUBLISH, + self::ICAL_METHOD_REPLY, + self::ICAL_METHOD_ADD, + self::ICAL_METHOD_CANCEL, + self::ICAL_METHOD_REFRESH, + self::ICAL_METHOD_COUNTER, + self::ICAL_METHOD_DECLINECOUNTER, + ]; + + /** + * The complete compiled MIME message body. + * + * @var string + */ + protected $MIMEBody = ''; + + /** + * The complete compiled MIME message headers. + * + * @var string + */ + protected $MIMEHeader = ''; + + /** + * Extra headers that createHeader() doesn't fold in. + * + * @var string + */ + protected $mailHeader = ''; + + /** + * Word-wrap the message body to this number of chars. + * Set to 0 to not wrap. A useful value here is 78, for RFC2822 section 2.1.1 compliance. + * + * @see static::STD_LINE_LENGTH + * + * @var int + */ + public $WordWrap = 0; + + /** + * Which method to use to send mail. + * Options: "mail", "sendmail", or "smtp". + * + * @var string + */ + public $Mailer = 'mail'; + + /** + * The path to the sendmail program. + * + * @var string + */ + public $Sendmail = '/usr/sbin/sendmail'; + + /** + * Whether mail() uses a fully sendmail-compatible MTA. + * One which supports sendmail's "-oi -f" options. + * + * @var bool + */ + public $UseSendmailOptions = true; + + /** + * The email address that a reading confirmation should be sent to, also known as read receipt. + * + * @var string + */ + public $ConfirmReadingTo = ''; + + /** + * The hostname to use in the Message-ID header and as default HELO string. + * If empty, PHPMailer attempts to find one with, in order, + * $_SERVER['SERVER_NAME'], gethostname(), php_uname('n'), or the value + * 'localhost.localdomain'. + * + * @see PHPMailer::$Helo + * + * @var string + */ + public $Hostname = ''; + + /** + * An ID to be used in the Message-ID header. + * If empty, a unique id will be generated. + * You can set your own, but it must be in the format "", + * as defined in RFC5322 section 3.6.4 or it will be ignored. + * + * @see https://tools.ietf.org/html/rfc5322#section-3.6.4 + * + * @var string + */ + public $MessageID = ''; + + /** + * The message Date to be used in the Date header. + * If empty, the current date will be added. + * + * @var string + */ + public $MessageDate = ''; + + /** + * SMTP hosts. + * Either a single hostname or multiple semicolon-delimited hostnames. + * You can also specify a different port + * for each host by using this format: [hostname:port] + * (e.g. "smtp1.example.com:25;smtp2.example.com"). + * You can also specify encryption type, for example: + * (e.g. "tls://smtp1.example.com:587;ssl://smtp2.example.com:465"). + * Hosts will be tried in order. + * + * @var string + */ + public $Host = 'localhost'; + + /** + * The default SMTP server port. + * + * @var int + */ + public $Port = 25; + + /** + * The SMTP HELO/EHLO name used for the SMTP connection. + * Default is $Hostname. If $Hostname is empty, PHPMailer attempts to find + * one with the same method described above for $Hostname. + * + * @see PHPMailer::$Hostname + * + * @var string + */ + public $Helo = ''; + + /** + * What kind of encryption to use on the SMTP connection. + * Options: '', static::ENCRYPTION_STARTTLS, or static::ENCRYPTION_SMTPS. + * + * @var string + */ + public $SMTPSecure = ''; + + /** + * Whether to enable TLS encryption automatically if a server supports it, + * even if `SMTPSecure` is not set to 'tls'. + * Be aware that in PHP >= 5.6 this requires that the server's certificates are valid. + * + * @var bool + */ + public $SMTPAutoTLS = true; + + /** + * Whether to use SMTP authentication. + * Uses the Username and Password properties. + * + * @see PHPMailer::$Username + * @see PHPMailer::$Password + * + * @var bool + */ + public $SMTPAuth = false; + + /** + * Options array passed to stream_context_create when connecting via SMTP. + * + * @var array + */ + public $SMTPOptions = []; + + /** + * SMTP username. + * + * @var string + */ + public $Username = ''; + + /** + * SMTP password. + * + * @var string + */ + public $Password = ''; + + /** + * SMTP authentication type. Options are CRAM-MD5, LOGIN, PLAIN, XOAUTH2. + * If not specified, the first one from that list that the server supports will be selected. + * + * @var string + */ + public $AuthType = ''; + + /** + * An implementation of the PHPMailer OAuthTokenProvider interface. + * + * @var OAuthTokenProvider + */ + protected $oauth; + + /** + * The SMTP server timeout in seconds. + * Default of 5 minutes (300sec) is from RFC2821 section 4.5.3.2. + * + * @var int + */ + public $Timeout = 300; + + /** + * Comma separated list of DSN notifications + * 'NEVER' under no circumstances a DSN must be returned to the sender. + * If you use NEVER all other notifications will be ignored. + * 'SUCCESS' will notify you when your mail has arrived at its destination. + * 'FAILURE' will arrive if an error occurred during delivery. + * 'DELAY' will notify you if there is an unusual delay in delivery, but the actual + * delivery's outcome (success or failure) is not yet decided. + * + * @see https://tools.ietf.org/html/rfc3461 See section 4.1 for more information about NOTIFY + */ + public $dsn = ''; + + /** + * SMTP class debug output mode. + * Debug output level. + * Options: + * @see SMTP::DEBUG_OFF: No output + * @see SMTP::DEBUG_CLIENT: Client messages + * @see SMTP::DEBUG_SERVER: Client and server messages + * @see SMTP::DEBUG_CONNECTION: As SERVER plus connection status + * @see SMTP::DEBUG_LOWLEVEL: Noisy, low-level data output, rarely needed + * + * @see SMTP::$do_debug + * + * @var int + */ + public $SMTPDebug = 0; + + /** + * How to handle debug output. + * Options: + * * `echo` Output plain-text as-is, appropriate for CLI + * * `html` Output escaped, line breaks converted to `
`, appropriate for browser output + * * `error_log` Output to error log as configured in php.ini + * By default PHPMailer will use `echo` if run from a `cli` or `cli-server` SAPI, `html` otherwise. + * Alternatively, you can provide a callable expecting two params: a message string and the debug level: + * + * ```php + * $mail->Debugoutput = function($str, $level) {echo "debug level $level; message: $str";}; + * ``` + * + * Alternatively, you can pass in an instance of a PSR-3 compatible logger, though only `debug` + * level output is used: + * + * ```php + * $mail->Debugoutput = new myPsr3Logger; + * ``` + * + * @see SMTP::$Debugoutput + * + * @var string|callable|\Psr\Log\LoggerInterface + */ + public $Debugoutput = 'echo'; + + /** + * Whether to keep the SMTP connection open after each message. + * If this is set to true then the connection will remain open after a send, + * and closing the connection will require an explicit call to smtpClose(). + * It's a good idea to use this if you are sending multiple messages as it reduces overhead. + * See the mailing list example for how to use it. + * + * @var bool + */ + public $SMTPKeepAlive = false; + + /** + * Whether to split multiple to addresses into multiple messages + * or send them all in one message. + * Only supported in `mail` and `sendmail` transports, not in SMTP. + * + * @var bool + * + * @deprecated 6.0.0 PHPMailer isn't a mailing list manager! + */ + public $SingleTo = false; + + /** + * Storage for addresses when SingleTo is enabled. + * + * @var array + */ + protected $SingleToArray = []; + + /** + * Whether to generate VERP addresses on send. + * Only applicable when sending via SMTP. + * + * @see https://en.wikipedia.org/wiki/Variable_envelope_return_path + * @see http://www.postfix.org/VERP_README.html Postfix VERP info + * + * @var bool + */ + public $do_verp = false; + + /** + * Whether to allow sending messages with an empty body. + * + * @var bool + */ + public $AllowEmpty = false; + + /** + * DKIM selector. + * + * @var string + */ + public $DKIM_selector = ''; + + /** + * DKIM Identity. + * Usually the email address used as the source of the email. + * + * @var string + */ + public $DKIM_identity = ''; + + /** + * DKIM passphrase. + * Used if your key is encrypted. + * + * @var string + */ + public $DKIM_passphrase = ''; + + /** + * DKIM signing domain name. + * + * @example 'example.com' + * + * @var string + */ + public $DKIM_domain = ''; + + /** + * DKIM Copy header field values for diagnostic use. + * + * @var bool + */ + public $DKIM_copyHeaderFields = true; + + /** + * DKIM Extra signing headers. + * + * @example ['List-Unsubscribe', 'List-Help'] + * + * @var array + */ + public $DKIM_extraHeaders = []; + + /** + * DKIM private key file path. + * + * @var string + */ + public $DKIM_private = ''; + + /** + * DKIM private key string. + * + * If set, takes precedence over `$DKIM_private`. + * + * @var string + */ + public $DKIM_private_string = ''; + + /** + * Callback Action function name. + * + * The function that handles the result of the send email action. + * It is called out by send() for each email sent. + * + * Value can be any php callable: http://www.php.net/is_callable + * + * Parameters: + * bool $result result of the send action + * array $to email addresses of the recipients + * array $cc cc email addresses + * array $bcc bcc email addresses + * string $subject the subject + * string $body the email body + * string $from email address of sender + * string $extra extra information of possible use + * "smtp_transaction_id' => last smtp transaction id + * + * @var string + */ + public $action_function = ''; + + /** + * What to put in the X-Mailer header. + * Options: An empty string for PHPMailer default, whitespace/null for none, or a string to use. + * + * @var string|null + */ + public $XMailer = ''; + + /** + * Which validator to use by default when validating email addresses. + * May be a callable to inject your own validator, but there are several built-in validators. + * The default validator uses PHP's FILTER_VALIDATE_EMAIL filter_var option. + * + * @see PHPMailer::validateAddress() + * + * @var string|callable + */ + public static $validator = 'php'; + + /** + * An instance of the SMTP sender class. + * + * @var SMTP + */ + protected $smtp; + + /** + * The array of 'to' names and addresses. + * + * @var array + */ + protected $to = []; + + /** + * The array of 'cc' names and addresses. + * + * @var array + */ + protected $cc = []; + + /** + * The array of 'bcc' names and addresses. + * + * @var array + */ + protected $bcc = []; + + /** + * The array of reply-to names and addresses. + * + * @var array + */ + protected $ReplyTo = []; + + /** + * An array of all kinds of addresses. + * Includes all of $to, $cc, $bcc. + * + * @see PHPMailer::$to + * @see PHPMailer::$cc + * @see PHPMailer::$bcc + * + * @var array + */ + protected $all_recipients = []; + + /** + * An array of names and addresses queued for validation. + * In send(), valid and non duplicate entries are moved to $all_recipients + * and one of $to, $cc, or $bcc. + * This array is used only for addresses with IDN. + * + * @see PHPMailer::$to + * @see PHPMailer::$cc + * @see PHPMailer::$bcc + * @see PHPMailer::$all_recipients + * + * @var array + */ + protected $RecipientsQueue = []; + + /** + * An array of reply-to names and addresses queued for validation. + * In send(), valid and non duplicate entries are moved to $ReplyTo. + * This array is used only for addresses with IDN. + * + * @see PHPMailer::$ReplyTo + * + * @var array + */ + protected $ReplyToQueue = []; + + /** + * The array of attachments. + * + * @var array + */ + protected $attachment = []; + + /** + * The array of custom headers. + * + * @var array + */ + protected $CustomHeader = []; + + /** + * The most recent Message-ID (including angular brackets). + * + * @var string + */ + protected $lastMessageID = ''; + + /** + * The message's MIME type. + * + * @var string + */ + protected $message_type = ''; + + /** + * The array of MIME boundary strings. + * + * @var array + */ + protected $boundary = []; + + /** + * The array of available text strings for the current language. + * + * @var array + */ + protected $language = []; + + /** + * The number of errors encountered. + * + * @var int + */ + protected $error_count = 0; + + /** + * The S/MIME certificate file path. + * + * @var string + */ + protected $sign_cert_file = ''; + + /** + * The S/MIME key file path. + * + * @var string + */ + protected $sign_key_file = ''; + + /** + * The optional S/MIME extra certificates ("CA Chain") file path. + * + * @var string + */ + protected $sign_extracerts_file = ''; + + /** + * The S/MIME password for the key. + * Used only if the key is encrypted. + * + * @var string + */ + protected $sign_key_pass = ''; + + /** + * Whether to throw exceptions for errors. + * + * @var bool + */ + protected $exceptions = false; + + /** + * Unique ID used for message ID and boundaries. + * + * @var string + */ + protected $uniqueid = ''; + + /** + * The PHPMailer Version number. + * + * @var string + */ + const VERSION = '6.8.0'; + + /** + * Error severity: message only, continue processing. + * + * @var int + */ + const STOP_MESSAGE = 0; + + /** + * Error severity: message, likely ok to continue processing. + * + * @var int + */ + const STOP_CONTINUE = 1; + + /** + * Error severity: message, plus full stop, critical error reached. + * + * @var int + */ + const STOP_CRITICAL = 2; + + /** + * The SMTP standard CRLF line break. + * If you want to change line break format, change static::$LE, not this. + */ + const CRLF = "\r\n"; + + /** + * "Folding White Space" a white space string used for line folding. + */ + const FWS = ' '; + + /** + * SMTP RFC standard line ending; Carriage Return, Line Feed. + * + * @var string + */ + protected static $LE = self::CRLF; + + /** + * The maximum line length supported by mail(). + * + * Background: mail() will sometimes corrupt messages + * with headers headers longer than 65 chars, see #818. + * + * @var int + */ + const MAIL_MAX_LINE_LENGTH = 63; + + /** + * The maximum line length allowed by RFC 2822 section 2.1.1. + * + * @var int + */ + const MAX_LINE_LENGTH = 998; + + /** + * The lower maximum line length allowed by RFC 2822 section 2.1.1. + * This length does NOT include the line break + * 76 means that lines will be 77 or 78 chars depending on whether + * the line break format is LF or CRLF; both are valid. + * + * @var int + */ + const STD_LINE_LENGTH = 76; + + /** + * Constructor. + * + * @param bool $exceptions Should we throw external exceptions? + */ + public function __construct($exceptions = null) + { + if (null !== $exceptions) { + $this->exceptions = (bool) $exceptions; + } + //Pick an appropriate debug output format automatically + $this->Debugoutput = (strpos(PHP_SAPI, 'cli') !== false ? 'echo' : 'html'); + } + + /** + * Destructor. + */ + public function __destruct() + { + //Close any open SMTP connection nicely + $this->smtpClose(); + } + + /** + * Call mail() in a safe_mode-aware fashion. + * Also, unless sendmail_path points to sendmail (or something that + * claims to be sendmail), don't pass params (not a perfect fix, + * but it will do). + * + * @param string $to To + * @param string $subject Subject + * @param string $body Message Body + * @param string $header Additional Header(s) + * @param string|null $params Params + * + * @return bool + */ + private function mailPassthru($to, $subject, $body, $header, $params) + { + //Check overloading of mail function to avoid double-encoding + if ((int)ini_get('mbstring.func_overload') & 1) { + $subject = $this->secureHeader($subject); + } else { + $subject = $this->encodeHeader($this->secureHeader($subject)); + } + //Calling mail() with null params breaks + $this->edebug('Sending with mail()'); + $this->edebug('Sendmail path: ' . ini_get('sendmail_path')); + $this->edebug("Envelope sender: {$this->Sender}"); + $this->edebug("To: {$to}"); + $this->edebug("Subject: {$subject}"); + $this->edebug("Headers: {$header}"); + if (!$this->UseSendmailOptions || null === $params) { + $result = @mail($to, $subject, $body, $header); + } else { + $this->edebug("Additional params: {$params}"); + $result = @mail($to, $subject, $body, $header, $params); + } + $this->edebug('Result: ' . ($result ? 'true' : 'false')); + return $result; + } + + /** + * Output debugging info via a user-defined method. + * Only generates output if debug output is enabled. + * + * @see PHPMailer::$Debugoutput + * @see PHPMailer::$SMTPDebug + * + * @param string $str + */ + protected function edebug($str) + { + if ($this->SMTPDebug <= 0) { + return; + } + //Is this a PSR-3 logger? + if ($this->Debugoutput instanceof \Psr\Log\LoggerInterface) { + $this->Debugoutput->debug($str); + + return; + } + //Avoid clash with built-in function names + if (is_callable($this->Debugoutput) && !in_array($this->Debugoutput, ['error_log', 'html', 'echo'])) { + call_user_func($this->Debugoutput, $str, $this->SMTPDebug); + + return; + } + switch ($this->Debugoutput) { + case 'error_log': + //Don't output, just log + /** @noinspection ForgottenDebugOutputInspection */ + error_log($str); + break; + case 'html': + //Cleans up output a bit for a better looking, HTML-safe output + echo htmlentities( + preg_replace('/[\r\n]+/', '', $str), + ENT_QUOTES, + 'UTF-8' + ), "
\n"; + break; + case 'echo': + default: + //Normalize line breaks + $str = preg_replace('/\r\n|\r/m', "\n", $str); + echo gmdate('Y-m-d H:i:s'), + "\t", + //Trim trailing space + trim( + //Indent for readability, except for trailing break + str_replace( + "\n", + "\n \t ", + trim($str) + ) + ), + "\n"; + } + } + + /** + * Sets message type to HTML or plain. + * + * @param bool $isHtml True for HTML mode + */ + public function isHTML($isHtml = true) + { + if ($isHtml) { + $this->ContentType = static::CONTENT_TYPE_TEXT_HTML; + } else { + $this->ContentType = static::CONTENT_TYPE_PLAINTEXT; + } + } + + /** + * Send messages using SMTP. + */ + public function isSMTP() + { + $this->Mailer = 'smtp'; + } + + /** + * Send messages using PHP's mail() function. + */ + public function isMail() + { + $this->Mailer = 'mail'; + } + + /** + * Send messages using $Sendmail. + */ + public function isSendmail() + { + $ini_sendmail_path = ini_get('sendmail_path'); + + if (false === stripos($ini_sendmail_path, 'sendmail')) { + $this->Sendmail = '/usr/sbin/sendmail'; + } else { + $this->Sendmail = $ini_sendmail_path; + } + $this->Mailer = 'sendmail'; + } + + /** + * Send messages using qmail. + */ + public function isQmail() + { + $ini_sendmail_path = ini_get('sendmail_path'); + + if (false === stripos($ini_sendmail_path, 'qmail')) { + $this->Sendmail = '/var/qmail/bin/qmail-inject'; + } else { + $this->Sendmail = $ini_sendmail_path; + } + $this->Mailer = 'qmail'; + } + + /** + * Add a "To" address. + * + * @param string $address The email address to send to + * @param string $name + * + * @throws Exception + * + * @return bool true on success, false if address already used or invalid in some way + */ + public function addAddress($address, $name = '') + { + return $this->addOrEnqueueAnAddress('to', $address, $name); + } + + /** + * Add a "CC" address. + * + * @param string $address The email address to send to + * @param string $name + * + * @throws Exception + * + * @return bool true on success, false if address already used or invalid in some way + */ + public function addCC($address, $name = '') + { + return $this->addOrEnqueueAnAddress('cc', $address, $name); + } + + /** + * Add a "BCC" address. + * + * @param string $address The email address to send to + * @param string $name + * + * @throws Exception + * + * @return bool true on success, false if address already used or invalid in some way + */ + public function addBCC($address, $name = '') + { + return $this->addOrEnqueueAnAddress('bcc', $address, $name); + } + + /** + * Add a "Reply-To" address. + * + * @param string $address The email address to reply to + * @param string $name + * + * @throws Exception + * + * @return bool true on success, false if address already used or invalid in some way + */ + public function addReplyTo($address, $name = '') + { + return $this->addOrEnqueueAnAddress('Reply-To', $address, $name); + } + + /** + * Add an address to one of the recipient arrays or to the ReplyTo array. Because PHPMailer + * can't validate addresses with an IDN without knowing the PHPMailer::$CharSet (that can still + * be modified after calling this function), addition of such addresses is delayed until send(). + * Addresses that have been added already return false, but do not throw exceptions. + * + * @param string $kind One of 'to', 'cc', 'bcc', or 'ReplyTo' + * @param string $address The email address + * @param string $name An optional username associated with the address + * + * @throws Exception + * + * @return bool true on success, false if address already used or invalid in some way + */ + protected function addOrEnqueueAnAddress($kind, $address, $name) + { + $pos = false; + if ($address !== null) { + $address = trim($address); + $pos = strrpos($address, '@'); + } + if (false === $pos) { + //At-sign is missing. + $error_message = sprintf( + '%s (%s): %s', + $this->lang('invalid_address'), + $kind, + $address + ); + $this->setError($error_message); + $this->edebug($error_message); + if ($this->exceptions) { + throw new Exception($error_message); + } + + return false; + } + if ($name !== null && is_string($name)) { + $name = trim(preg_replace('/[\r\n]+/', '', $name)); //Strip breaks and trim + } else { + $name = ''; + } + $params = [$kind, $address, $name]; + //Enqueue addresses with IDN until we know the PHPMailer::$CharSet. + //Domain is assumed to be whatever is after the last @ symbol in the address + if (static::idnSupported() && $this->has8bitChars(substr($address, ++$pos))) { + if ('Reply-To' !== $kind) { + if (!array_key_exists($address, $this->RecipientsQueue)) { + $this->RecipientsQueue[$address] = $params; + + return true; + } + } elseif (!array_key_exists($address, $this->ReplyToQueue)) { + $this->ReplyToQueue[$address] = $params; + + return true; + } + + return false; + } + + //Immediately add standard addresses without IDN. + return call_user_func_array([$this, 'addAnAddress'], $params); + } + + /** + * Set the boundaries to use for delimiting MIME parts. + * If you override this, ensure you set all 3 boundaries to unique values. + * The default boundaries include a "=_" sequence which cannot occur in quoted-printable bodies, + * as suggested by https://www.rfc-editor.org/rfc/rfc2045#section-6.7 + * + * @return void + */ + public function setBoundaries() + { + $this->uniqueid = $this->generateId(); + $this->boundary[1] = 'b1=_' . $this->uniqueid; + $this->boundary[2] = 'b2=_' . $this->uniqueid; + $this->boundary[3] = 'b3=_' . $this->uniqueid; + } + + /** + * Add an address to one of the recipient arrays or to the ReplyTo array. + * Addresses that have been added already return false, but do not throw exceptions. + * + * @param string $kind One of 'to', 'cc', 'bcc', or 'ReplyTo' + * @param string $address The email address to send, resp. to reply to + * @param string $name + * + * @throws Exception + * + * @return bool true on success, false if address already used or invalid in some way + */ + protected function addAnAddress($kind, $address, $name = '') + { + if (!in_array($kind, ['to', 'cc', 'bcc', 'Reply-To'])) { + $error_message = sprintf( + '%s: %s', + $this->lang('Invalid recipient kind'), + $kind + ); + $this->setError($error_message); + $this->edebug($error_message); + if ($this->exceptions) { + throw new Exception($error_message); + } + + return false; + } + if (!static::validateAddress($address)) { + $error_message = sprintf( + '%s (%s): %s', + $this->lang('invalid_address'), + $kind, + $address + ); + $this->setError($error_message); + $this->edebug($error_message); + if ($this->exceptions) { + throw new Exception($error_message); + } + + return false; + } + if ('Reply-To' !== $kind) { + if (!array_key_exists(strtolower($address), $this->all_recipients)) { + $this->{$kind}[] = [$address, $name]; + $this->all_recipients[strtolower($address)] = true; + + return true; + } + } elseif (!array_key_exists(strtolower($address), $this->ReplyTo)) { + $this->ReplyTo[strtolower($address)] = [$address, $name]; + + return true; + } + + return false; + } + + /** + * Parse and validate a string containing one or more RFC822-style comma-separated email addresses + * of the form "display name
" into an array of name/address pairs. + * Uses the imap_rfc822_parse_adrlist function if the IMAP extension is available. + * Note that quotes in the name part are removed. + * + * @see http://www.andrew.cmu.edu/user/agreen1/testing/mrbs/web/Mail/RFC822.php A more careful implementation + * + * @param string $addrstr The address list string + * @param bool $useimap Whether to use the IMAP extension to parse the list + * @param string $charset The charset to use when decoding the address list string. + * + * @return array + */ + public static function parseAddresses($addrstr, $useimap = true, $charset = self::CHARSET_ISO88591) + { + $addresses = []; + if ($useimap && function_exists('imap_rfc822_parse_adrlist')) { + //Use this built-in parser if it's available + $list = imap_rfc822_parse_adrlist($addrstr, ''); + // Clear any potential IMAP errors to get rid of notices being thrown at end of script. + imap_errors(); + foreach ($list as $address) { + if ( + '.SYNTAX-ERROR.' !== $address->host && + static::validateAddress($address->mailbox . '@' . $address->host) + ) { + //Decode the name part if it's present and encoded + if ( + property_exists($address, 'personal') && + //Check for a Mbstring constant rather than using extension_loaded, which is sometimes disabled + defined('MB_CASE_UPPER') && + preg_match('/^=\?.*\?=$/s', $address->personal) + ) { + $origCharset = mb_internal_encoding(); + mb_internal_encoding($charset); + //Undo any RFC2047-encoded spaces-as-underscores + $address->personal = str_replace('_', '=20', $address->personal); + //Decode the name + $address->personal = mb_decode_mimeheader($address->personal); + mb_internal_encoding($origCharset); + } + + $addresses[] = [ + 'name' => (property_exists($address, 'personal') ? $address->personal : ''), + 'address' => $address->mailbox . '@' . $address->host, + ]; + } + } + } else { + //Use this simpler parser + $list = explode(',', $addrstr); + foreach ($list as $address) { + $address = trim($address); + //Is there a separate name part? + if (strpos($address, '<') === false) { + //No separate name, just use the whole thing + if (static::validateAddress($address)) { + $addresses[] = [ + 'name' => '', + 'address' => $address, + ]; + } + } else { + list($name, $email) = explode('<', $address); + $email = trim(str_replace('>', '', $email)); + $name = trim($name); + if (static::validateAddress($email)) { + //Check for a Mbstring constant rather than using extension_loaded, which is sometimes disabled + //If this name is encoded, decode it + if (defined('MB_CASE_UPPER') && preg_match('/^=\?.*\?=$/s', $name)) { + $origCharset = mb_internal_encoding(); + mb_internal_encoding($charset); + //Undo any RFC2047-encoded spaces-as-underscores + $name = str_replace('_', '=20', $name); + //Decode the name + $name = mb_decode_mimeheader($name); + mb_internal_encoding($origCharset); + } + $addresses[] = [ + //Remove any surrounding quotes and spaces from the name + 'name' => trim($name, '\'" '), + 'address' => $email, + ]; + } + } + } + } + + return $addresses; + } + + /** + * Set the From and FromName properties. + * + * @param string $address + * @param string $name + * @param bool $auto Whether to also set the Sender address, defaults to true + * + * @throws Exception + * + * @return bool + */ + public function setFrom($address, $name = '', $auto = true) + { + $address = trim((string)$address); + $name = trim(preg_replace('/[\r\n]+/', '', $name)); //Strip breaks and trim + //Don't validate now addresses with IDN. Will be done in send(). + $pos = strrpos($address, '@'); + if ( + (false === $pos) + || ((!$this->has8bitChars(substr($address, ++$pos)) || !static::idnSupported()) + && !static::validateAddress($address)) + ) { + $error_message = sprintf( + '%s (From): %s', + $this->lang('invalid_address'), + $address + ); + $this->setError($error_message); + $this->edebug($error_message); + if ($this->exceptions) { + throw new Exception($error_message); + } + + return false; + } + $this->From = $address; + $this->FromName = $name; + if ($auto && empty($this->Sender)) { + $this->Sender = $address; + } + + return true; + } + + /** + * Return the Message-ID header of the last email. + * Technically this is the value from the last time the headers were created, + * but it's also the message ID of the last sent message except in + * pathological cases. + * + * @return string + */ + public function getLastMessageID() + { + return $this->lastMessageID; + } + + /** + * Check that a string looks like an email address. + * Validation patterns supported: + * * `auto` Pick best pattern automatically; + * * `pcre8` Use the squiloople.com pattern, requires PCRE > 8.0; + * * `pcre` Use old PCRE implementation; + * * `php` Use PHP built-in FILTER_VALIDATE_EMAIL; + * * `html5` Use the pattern given by the HTML5 spec for 'email' type form input elements. + * * `noregex` Don't use a regex: super fast, really dumb. + * Alternatively you may pass in a callable to inject your own validator, for example: + * + * ```php + * PHPMailer::validateAddress('user@example.com', function($address) { + * return (strpos($address, '@') !== false); + * }); + * ``` + * + * You can also set the PHPMailer::$validator static to a callable, allowing built-in methods to use your validator. + * + * @param string $address The email address to check + * @param string|callable $patternselect Which pattern to use + * + * @return bool + */ + public static function validateAddress($address, $patternselect = null) + { + if (null === $patternselect) { + $patternselect = static::$validator; + } + //Don't allow strings as callables, see SECURITY.md and CVE-2021-3603 + if (is_callable($patternselect) && !is_string($patternselect)) { + return call_user_func($patternselect, $address); + } + //Reject line breaks in addresses; it's valid RFC5322, but not RFC5321 + if (strpos($address, "\n") !== false || strpos($address, "\r") !== false) { + return false; + } + switch ($patternselect) { + case 'pcre': //Kept for BC + case 'pcre8': + /* + * A more complex and more permissive version of the RFC5322 regex on which FILTER_VALIDATE_EMAIL + * is based. + * In addition to the addresses allowed by filter_var, also permits: + * * dotless domains: `a@b` + * * comments: `1234 @ local(blah) .machine .example` + * * quoted elements: `'"test blah"@example.org'` + * * numeric TLDs: `a@b.123` + * * unbracketed IPv4 literals: `a@192.168.0.1` + * * IPv6 literals: 'first.last@[IPv6:a1::]' + * Not all of these will necessarily work for sending! + * + * @see http://squiloople.com/2009/12/20/email-address-validation/ + * @copyright 2009-2010 Michael Rushton + * Feel free to use and redistribute this code. But please keep this copyright notice. + */ + return (bool) preg_match( + '/^(?!(?>(?1)"?(?>\\\[ -~]|[^"])"?(?1)){255,})(?!(?>(?1)"?(?>\\\[ -~]|[^"])"?(?1)){65,}@)' . + '((?>(?>(?>((?>(?>(?>\x0D\x0A)?[\t ])+|(?>[\t ]*\x0D\x0A)?[\t ]+)?)(\((?>(?2)' . + '(?>[\x01-\x08\x0B\x0C\x0E-\'*-\[\]-\x7F]|\\\[\x00-\x7F]|(?3)))*(?2)\)))+(?2))|(?2))?)' . + '([!#-\'*+\/-9=?^-~-]+|"(?>(?2)(?>[\x01-\x08\x0B\x0C\x0E-!#-\[\]-\x7F]|\\\[\x00-\x7F]))*' . + '(?2)")(?>(?1)\.(?1)(?4))*(?1)@(?!(?1)[a-z0-9-]{64,})(?1)(?>([a-z0-9](?>[a-z0-9-]*[a-z0-9])?)' . + '(?>(?1)\.(?!(?1)[a-z0-9-]{64,})(?1)(?5)){0,126}|\[(?:(?>IPv6:(?>([a-f0-9]{1,4})(?>:(?6)){7}' . + '|(?!(?:.*[a-f0-9][:\]]){8,})((?6)(?>:(?6)){0,6})?::(?7)?))|(?>(?>IPv6:(?>(?6)(?>:(?6)){5}:' . + '|(?!(?:.*[a-f0-9]:){6,})(?8)?::(?>((?6)(?>:(?6)){0,4}):)?))?(25[0-5]|2[0-4][0-9]|1[0-9]{2}' . + '|[1-9]?[0-9])(?>\.(?9)){3}))\])(?1)$/isD', + $address + ); + case 'html5': + /* + * This is the pattern used in the HTML5 spec for validation of 'email' type form input elements. + * + * @see https://html.spec.whatwg.org/#e-mail-state-(type=email) + */ + return (bool) preg_match( + '/^[a-zA-Z0-9.!#$%&\'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}' . + '[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/sD', + $address + ); + case 'php': + default: + return filter_var($address, FILTER_VALIDATE_EMAIL) !== false; + } + } + + /** + * Tells whether IDNs (Internationalized Domain Names) are supported or not. This requires the + * `intl` and `mbstring` PHP extensions. + * + * @return bool `true` if required functions for IDN support are present + */ + public static function idnSupported() + { + return function_exists('idn_to_ascii') && function_exists('mb_convert_encoding'); + } + + /** + * Converts IDN in given email address to its ASCII form, also known as punycode, if possible. + * Important: Address must be passed in same encoding as currently set in PHPMailer::$CharSet. + * This function silently returns unmodified address if: + * - No conversion is necessary (i.e. domain name is not an IDN, or is already in ASCII form) + * - Conversion to punycode is impossible (e.g. required PHP functions are not available) + * or fails for any reason (e.g. domain contains characters not allowed in an IDN). + * + * @see PHPMailer::$CharSet + * + * @param string $address The email address to convert + * + * @return string The encoded address in ASCII form + */ + public function punyencodeAddress($address) + { + //Verify we have required functions, CharSet, and at-sign. + $pos = strrpos($address, '@'); + if ( + !empty($this->CharSet) && + false !== $pos && + static::idnSupported() + ) { + $domain = substr($address, ++$pos); + //Verify CharSet string is a valid one, and domain properly encoded in this CharSet. + if ($this->has8bitChars($domain) && @mb_check_encoding($domain, $this->CharSet)) { + //Convert the domain from whatever charset it's in to UTF-8 + $domain = mb_convert_encoding($domain, self::CHARSET_UTF8, $this->CharSet); + //Ignore IDE complaints about this line - method signature changed in PHP 5.4 + $errorcode = 0; + if (defined('INTL_IDNA_VARIANT_UTS46')) { + //Use the current punycode standard (appeared in PHP 7.2) + $punycode = idn_to_ascii( + $domain, + \IDNA_DEFAULT | \IDNA_USE_STD3_RULES | \IDNA_CHECK_BIDI | + \IDNA_CHECK_CONTEXTJ | \IDNA_NONTRANSITIONAL_TO_ASCII, + \INTL_IDNA_VARIANT_UTS46 + ); + } elseif (defined('INTL_IDNA_VARIANT_2003')) { + //Fall back to this old, deprecated/removed encoding + $punycode = idn_to_ascii($domain, $errorcode, \INTL_IDNA_VARIANT_2003); + } else { + //Fall back to a default we don't know about + $punycode = idn_to_ascii($domain, $errorcode); + } + if (false !== $punycode) { + return substr($address, 0, $pos) . $punycode; + } + } + } + + return $address; + } + + /** + * Create a message and send it. + * Uses the sending method specified by $Mailer. + * + * @throws Exception + * + * @return bool false on error - See the ErrorInfo property for details of the error + */ + public function send() + { + try { + if (!$this->preSend()) { + return false; + } + + return $this->postSend(); + } catch (Exception $exc) { + $this->mailHeader = ''; + $this->setError($exc->getMessage()); + if ($this->exceptions) { + throw $exc; + } + + return false; + } + } + + /** + * Prepare a message for sending. + * + * @throws Exception + * + * @return bool + */ + public function preSend() + { + if ( + 'smtp' === $this->Mailer + || ('mail' === $this->Mailer && (\PHP_VERSION_ID >= 80000 || stripos(PHP_OS, 'WIN') === 0)) + ) { + //SMTP mandates RFC-compliant line endings + //and it's also used with mail() on Windows + static::setLE(self::CRLF); + } else { + //Maintain backward compatibility with legacy Linux command line mailers + static::setLE(PHP_EOL); + } + //Check for buggy PHP versions that add a header with an incorrect line break + if ( + 'mail' === $this->Mailer + && ((\PHP_VERSION_ID >= 70000 && \PHP_VERSION_ID < 70017) + || (\PHP_VERSION_ID >= 70100 && \PHP_VERSION_ID < 70103)) + && ini_get('mail.add_x_header') === '1' + && stripos(PHP_OS, 'WIN') === 0 + ) { + trigger_error($this->lang('buggy_php'), E_USER_WARNING); + } + + try { + $this->error_count = 0; //Reset errors + $this->mailHeader = ''; + + //Dequeue recipient and Reply-To addresses with IDN + foreach (array_merge($this->RecipientsQueue, $this->ReplyToQueue) as $params) { + $params[1] = $this->punyencodeAddress($params[1]); + call_user_func_array([$this, 'addAnAddress'], $params); + } + if (count($this->to) + count($this->cc) + count($this->bcc) < 1) { + throw new Exception($this->lang('provide_address'), self::STOP_CRITICAL); + } + + //Validate From, Sender, and ConfirmReadingTo addresses + foreach (['From', 'Sender', 'ConfirmReadingTo'] as $address_kind) { + $this->{$address_kind} = trim($this->{$address_kind}); + if (empty($this->{$address_kind})) { + continue; + } + $this->{$address_kind} = $this->punyencodeAddress($this->{$address_kind}); + if (!static::validateAddress($this->{$address_kind})) { + $error_message = sprintf( + '%s (%s): %s', + $this->lang('invalid_address'), + $address_kind, + $this->{$address_kind} + ); + $this->setError($error_message); + $this->edebug($error_message); + if ($this->exceptions) { + throw new Exception($error_message); + } + + return false; + } + } + + //Set whether the message is multipart/alternative + if ($this->alternativeExists()) { + $this->ContentType = static::CONTENT_TYPE_MULTIPART_ALTERNATIVE; + } + + $this->setMessageType(); + //Refuse to send an empty message unless we are specifically allowing it + if (!$this->AllowEmpty && empty($this->Body)) { + throw new Exception($this->lang('empty_message'), self::STOP_CRITICAL); + } + + //Trim subject consistently + $this->Subject = trim($this->Subject); + //Create body before headers in case body makes changes to headers (e.g. altering transfer encoding) + $this->MIMEHeader = ''; + $this->MIMEBody = $this->createBody(); + //createBody may have added some headers, so retain them + $tempheaders = $this->MIMEHeader; + $this->MIMEHeader = $this->createHeader(); + $this->MIMEHeader .= $tempheaders; + + //To capture the complete message when using mail(), create + //an extra header list which createHeader() doesn't fold in + if ('mail' === $this->Mailer) { + if (count($this->to) > 0) { + $this->mailHeader .= $this->addrAppend('To', $this->to); + } else { + $this->mailHeader .= $this->headerLine('To', 'undisclosed-recipients:;'); + } + $this->mailHeader .= $this->headerLine( + 'Subject', + $this->encodeHeader($this->secureHeader($this->Subject)) + ); + } + + //Sign with DKIM if enabled + if ( + !empty($this->DKIM_domain) + && !empty($this->DKIM_selector) + && (!empty($this->DKIM_private_string) + || (!empty($this->DKIM_private) + && static::isPermittedPath($this->DKIM_private) + && file_exists($this->DKIM_private) + ) + ) + ) { + $header_dkim = $this->DKIM_Add( + $this->MIMEHeader . $this->mailHeader, + $this->encodeHeader($this->secureHeader($this->Subject)), + $this->MIMEBody + ); + $this->MIMEHeader = static::stripTrailingWSP($this->MIMEHeader) . static::$LE . + static::normalizeBreaks($header_dkim) . static::$LE; + } + + return true; + } catch (Exception $exc) { + $this->setError($exc->getMessage()); + if ($this->exceptions) { + throw $exc; + } + + return false; + } + } + + /** + * Actually send a message via the selected mechanism. + * + * @throws Exception + * + * @return bool + */ + public function postSend() + { + try { + //Choose the mailer and send through it + switch ($this->Mailer) { + case 'sendmail': + case 'qmail': + return $this->sendmailSend($this->MIMEHeader, $this->MIMEBody); + case 'smtp': + return $this->smtpSend($this->MIMEHeader, $this->MIMEBody); + case 'mail': + return $this->mailSend($this->MIMEHeader, $this->MIMEBody); + default: + $sendMethod = $this->Mailer . 'Send'; + if (method_exists($this, $sendMethod)) { + return $this->{$sendMethod}($this->MIMEHeader, $this->MIMEBody); + } + + return $this->mailSend($this->MIMEHeader, $this->MIMEBody); + } + } catch (Exception $exc) { + $this->setError($exc->getMessage()); + $this->edebug($exc->getMessage()); + if ($this->Mailer === 'smtp' && $this->SMTPKeepAlive == true && $this->smtp->connected()) { + $this->smtp->reset(); + } + if ($this->exceptions) { + throw $exc; + } + } + + return false; + } + + /** + * Send mail using the $Sendmail program. + * + * @see PHPMailer::$Sendmail + * + * @param string $header The message headers + * @param string $body The message body + * + * @throws Exception + * + * @return bool + */ + protected function sendmailSend($header, $body) + { + if ($this->Mailer === 'qmail') { + $this->edebug('Sending with qmail'); + } else { + $this->edebug('Sending with sendmail'); + } + $header = static::stripTrailingWSP($header) . static::$LE . static::$LE; + //This sets the SMTP envelope sender which gets turned into a return-path header by the receiver + //A space after `-f` is optional, but there is a long history of its presence + //causing problems, so we don't use one + //Exim docs: http://www.exim.org/exim-html-current/doc/html/spec_html/ch-the_exim_command_line.html + //Sendmail docs: http://www.sendmail.org/~ca/email/man/sendmail.html + //Qmail docs: http://www.qmail.org/man/man8/qmail-inject.html + //Example problem: https://www.drupal.org/node/1057954 + + //PHP 5.6 workaround + $sendmail_from_value = ini_get('sendmail_from'); + if (empty($this->Sender) && !empty($sendmail_from_value)) { + //PHP config has a sender address we can use + $this->Sender = ini_get('sendmail_from'); + } + //CVE-2016-10033, CVE-2016-10045: Don't pass -f if characters will be escaped. + if (!empty($this->Sender) && static::validateAddress($this->Sender) && self::isShellSafe($this->Sender)) { + if ($this->Mailer === 'qmail') { + $sendmailFmt = '%s -f%s'; + } else { + $sendmailFmt = '%s -oi -f%s -t'; + } + } else { + //allow sendmail to choose a default envelope sender. It may + //seem preferable to force it to use the From header as with + //SMTP, but that introduces new problems (see + //), and + //it has historically worked this way. + $sendmailFmt = '%s -oi -t'; + } + + $sendmail = sprintf($sendmailFmt, escapeshellcmd($this->Sendmail), $this->Sender); + $this->edebug('Sendmail path: ' . $this->Sendmail); + $this->edebug('Sendmail command: ' . $sendmail); + $this->edebug('Envelope sender: ' . $this->Sender); + $this->edebug("Headers: {$header}"); + + if ($this->SingleTo) { + foreach ($this->SingleToArray as $toAddr) { + $mail = @popen($sendmail, 'w'); + if (!$mail) { + throw new Exception($this->lang('execute') . $this->Sendmail, self::STOP_CRITICAL); + } + $this->edebug("To: {$toAddr}"); + fwrite($mail, 'To: ' . $toAddr . "\n"); + fwrite($mail, $header); + fwrite($mail, $body); + $result = pclose($mail); + $addrinfo = static::parseAddresses($toAddr, true, $this->CharSet); + $this->doCallback( + ($result === 0), + [[$addrinfo['address'], $addrinfo['name']]], + $this->cc, + $this->bcc, + $this->Subject, + $body, + $this->From, + [] + ); + $this->edebug("Result: " . ($result === 0 ? 'true' : 'false')); + if (0 !== $result) { + throw new Exception($this->lang('execute') . $this->Sendmail, self::STOP_CRITICAL); + } + } + } else { + $mail = @popen($sendmail, 'w'); + if (!$mail) { + throw new Exception($this->lang('execute') . $this->Sendmail, self::STOP_CRITICAL); + } + fwrite($mail, $header); + fwrite($mail, $body); + $result = pclose($mail); + $this->doCallback( + ($result === 0), + $this->to, + $this->cc, + $this->bcc, + $this->Subject, + $body, + $this->From, + [] + ); + $this->edebug("Result: " . ($result === 0 ? 'true' : 'false')); + if (0 !== $result) { + throw new Exception($this->lang('execute') . $this->Sendmail, self::STOP_CRITICAL); + } + } + + return true; + } + + /** + * Fix CVE-2016-10033 and CVE-2016-10045 by disallowing potentially unsafe shell characters. + * Note that escapeshellarg and escapeshellcmd are inadequate for our purposes, especially on Windows. + * + * @see https://github.com/PHPMailer/PHPMailer/issues/924 CVE-2016-10045 bug report + * + * @param string $string The string to be validated + * + * @return bool + */ + protected static function isShellSafe($string) + { + //It's not possible to use shell commands safely (which includes the mail() function) without escapeshellarg, + //but some hosting providers disable it, creating a security problem that we don't want to have to deal with, + //so we don't. + if (!function_exists('escapeshellarg') || !function_exists('escapeshellcmd')) { + return false; + } + + if ( + escapeshellcmd($string) !== $string + || !in_array(escapeshellarg($string), ["'$string'", "\"$string\""]) + ) { + return false; + } + + $length = strlen($string); + + for ($i = 0; $i < $length; ++$i) { + $c = $string[$i]; + + //All other characters have a special meaning in at least one common shell, including = and +. + //Full stop (.) has a special meaning in cmd.exe, but its impact should be negligible here. + //Note that this does permit non-Latin alphanumeric characters based on the current locale. + if (!ctype_alnum($c) && strpos('@_-.', $c) === false) { + return false; + } + } + + return true; + } + + /** + * Check whether a file path is of a permitted type. + * Used to reject URLs and phar files from functions that access local file paths, + * such as addAttachment. + * + * @param string $path A relative or absolute path to a file + * + * @return bool + */ + protected static function isPermittedPath($path) + { + //Matches scheme definition from https://tools.ietf.org/html/rfc3986#section-3.1 + return !preg_match('#^[a-z][a-z\d+.-]*://#i', $path); + } + + /** + * Check whether a file path is safe, accessible, and readable. + * + * @param string $path A relative or absolute path to a file + * + * @return bool + */ + protected static function fileIsAccessible($path) + { + if (!static::isPermittedPath($path)) { + return false; + } + $readable = is_file($path); + //If not a UNC path (expected to start with \\), check read permission, see #2069 + if (strpos($path, '\\\\') !== 0) { + $readable = $readable && is_readable($path); + } + return $readable; + } + + /** + * Send mail using the PHP mail() function. + * + * @see http://www.php.net/manual/en/book.mail.php + * + * @param string $header The message headers + * @param string $body The message body + * + * @throws Exception + * + * @return bool + */ + protected function mailSend($header, $body) + { + $header = static::stripTrailingWSP($header) . static::$LE . static::$LE; + + $toArr = []; + foreach ($this->to as $toaddr) { + $toArr[] = $this->addrFormat($toaddr); + } + $to = trim(implode(', ', $toArr)); + + //If there are no To-addresses (e.g. when sending only to BCC-addresses) + //the following should be added to get a correct DKIM-signature. + //Compare with $this->preSend() + if ($to === '') { + $to = 'undisclosed-recipients:;'; + } + + $params = null; + //This sets the SMTP envelope sender which gets turned into a return-path header by the receiver + //A space after `-f` is optional, but there is a long history of its presence + //causing problems, so we don't use one + //Exim docs: http://www.exim.org/exim-html-current/doc/html/spec_html/ch-the_exim_command_line.html + //Sendmail docs: http://www.sendmail.org/~ca/email/man/sendmail.html + //Qmail docs: http://www.qmail.org/man/man8/qmail-inject.html + //Example problem: https://www.drupal.org/node/1057954 + //CVE-2016-10033, CVE-2016-10045: Don't pass -f if characters will be escaped. + + //PHP 5.6 workaround + $sendmail_from_value = ini_get('sendmail_from'); + if (empty($this->Sender) && !empty($sendmail_from_value)) { + //PHP config has a sender address we can use + $this->Sender = ini_get('sendmail_from'); + } + if (!empty($this->Sender) && static::validateAddress($this->Sender)) { + if (self::isShellSafe($this->Sender)) { + $params = sprintf('-f%s', $this->Sender); + } + $old_from = ini_get('sendmail_from'); + ini_set('sendmail_from', $this->Sender); + } + $result = false; + if ($this->SingleTo && count($toArr) > 1) { + foreach ($toArr as $toAddr) { + $result = $this->mailPassthru($toAddr, $this->Subject, $body, $header, $params); + $addrinfo = static::parseAddresses($toAddr, true, $this->CharSet); + $this->doCallback( + $result, + [[$addrinfo['address'], $addrinfo['name']]], + $this->cc, + $this->bcc, + $this->Subject, + $body, + $this->From, + [] + ); + } + } else { + $result = $this->mailPassthru($to, $this->Subject, $body, $header, $params); + $this->doCallback($result, $this->to, $this->cc, $this->bcc, $this->Subject, $body, $this->From, []); + } + if (isset($old_from)) { + ini_set('sendmail_from', $old_from); + } + if (!$result) { + throw new Exception($this->lang('instantiate'), self::STOP_CRITICAL); + } + + return true; + } + + /** + * Get an instance to use for SMTP operations. + * Override this function to load your own SMTP implementation, + * or set one with setSMTPInstance. + * + * @return SMTP + */ + public function getSMTPInstance() + { + if (!is_object($this->smtp)) { + $this->smtp = new SMTP(); + } + + return $this->smtp; + } + + /** + * Provide an instance to use for SMTP operations. + * + * @return SMTP + */ + public function setSMTPInstance(SMTP $smtp) + { + $this->smtp = $smtp; + + return $this->smtp; + } + + /** + * Send mail via SMTP. + * Returns false if there is a bad MAIL FROM, RCPT, or DATA input. + * + * @see PHPMailer::setSMTPInstance() to use a different class. + * + * @uses \PHPMailer\PHPMailer\SMTP + * + * @param string $header The message headers + * @param string $body The message body + * + * @throws Exception + * + * @return bool + */ + protected function smtpSend($header, $body) + { + $header = static::stripTrailingWSP($header) . static::$LE . static::$LE; + $bad_rcpt = []; + if (!$this->smtpConnect($this->SMTPOptions)) { + throw new Exception($this->lang('smtp_connect_failed'), self::STOP_CRITICAL); + } + //Sender already validated in preSend() + if ('' === $this->Sender) { + $smtp_from = $this->From; + } else { + $smtp_from = $this->Sender; + } + if (!$this->smtp->mail($smtp_from)) { + $this->setError($this->lang('from_failed') . $smtp_from . ' : ' . implode(',', $this->smtp->getError())); + throw new Exception($this->ErrorInfo, self::STOP_CRITICAL); + } + + $callbacks = []; + //Attempt to send to all recipients + foreach ([$this->to, $this->cc, $this->bcc] as $togroup) { + foreach ($togroup as $to) { + if (!$this->smtp->recipient($to[0], $this->dsn)) { + $error = $this->smtp->getError(); + $bad_rcpt[] = ['to' => $to[0], 'error' => $error['detail']]; + $isSent = false; + } else { + $isSent = true; + } + + $callbacks[] = ['issent' => $isSent, 'to' => $to[0], 'name' => $to[1]]; + } + } + + //Only send the DATA command if we have viable recipients + if ((count($this->all_recipients) > count($bad_rcpt)) && !$this->smtp->data($header . $body)) { + throw new Exception($this->lang('data_not_accepted'), self::STOP_CRITICAL); + } + + $smtp_transaction_id = $this->smtp->getLastTransactionID(); + + if ($this->SMTPKeepAlive) { + $this->smtp->reset(); + } else { + $this->smtp->quit(); + $this->smtp->close(); + } + + foreach ($callbacks as $cb) { + $this->doCallback( + $cb['issent'], + [[$cb['to'], $cb['name']]], + [], + [], + $this->Subject, + $body, + $this->From, + ['smtp_transaction_id' => $smtp_transaction_id] + ); + } + + //Create error message for any bad addresses + if (count($bad_rcpt) > 0) { + $errstr = ''; + foreach ($bad_rcpt as $bad) { + $errstr .= $bad['to'] . ': ' . $bad['error']; + } + throw new Exception($this->lang('recipients_failed') . $errstr, self::STOP_CONTINUE); + } + + return true; + } + + /** + * Initiate a connection to an SMTP server. + * Returns false if the operation failed. + * + * @param array $options An array of options compatible with stream_context_create() + * + * @throws Exception + * + * @uses \PHPMailer\PHPMailer\SMTP + * + * @return bool + */ + public function smtpConnect($options = null) + { + if (null === $this->smtp) { + $this->smtp = $this->getSMTPInstance(); + } + + //If no options are provided, use whatever is set in the instance + if (null === $options) { + $options = $this->SMTPOptions; + } + + //Already connected? + if ($this->smtp->connected()) { + return true; + } + + $this->smtp->setTimeout($this->Timeout); + $this->smtp->setDebugLevel($this->SMTPDebug); + $this->smtp->setDebugOutput($this->Debugoutput); + $this->smtp->setVerp($this->do_verp); + if ($this->Host === null) { + $this->Host = 'localhost'; + } + $hosts = explode(';', $this->Host); + $lastexception = null; + + foreach ($hosts as $hostentry) { + $hostinfo = []; + if ( + !preg_match( + '/^(?:(ssl|tls):\/\/)?(.+?)(?::(\d+))?$/', + trim($hostentry), + $hostinfo + ) + ) { + $this->edebug($this->lang('invalid_hostentry') . ' ' . trim($hostentry)); + //Not a valid host entry + continue; + } + //$hostinfo[1]: optional ssl or tls prefix + //$hostinfo[2]: the hostname + //$hostinfo[3]: optional port number + //The host string prefix can temporarily override the current setting for SMTPSecure + //If it's not specified, the default value is used + + //Check the host name is a valid name or IP address before trying to use it + if (!static::isValidHost($hostinfo[2])) { + $this->edebug($this->lang('invalid_host') . ' ' . $hostinfo[2]); + continue; + } + $prefix = ''; + $secure = $this->SMTPSecure; + $tls = (static::ENCRYPTION_STARTTLS === $this->SMTPSecure); + if ('ssl' === $hostinfo[1] || ('' === $hostinfo[1] && static::ENCRYPTION_SMTPS === $this->SMTPSecure)) { + $prefix = 'ssl://'; + $tls = false; //Can't have SSL and TLS at the same time + $secure = static::ENCRYPTION_SMTPS; + } elseif ('tls' === $hostinfo[1]) { + $tls = true; + //TLS doesn't use a prefix + $secure = static::ENCRYPTION_STARTTLS; + } + //Do we need the OpenSSL extension? + $sslext = defined('OPENSSL_ALGO_SHA256'); + if (static::ENCRYPTION_STARTTLS === $secure || static::ENCRYPTION_SMTPS === $secure) { + //Check for an OpenSSL constant rather than using extension_loaded, which is sometimes disabled + if (!$sslext) { + throw new Exception($this->lang('extension_missing') . 'openssl', self::STOP_CRITICAL); + } + } + $host = $hostinfo[2]; + $port = $this->Port; + if ( + array_key_exists(3, $hostinfo) && + is_numeric($hostinfo[3]) && + $hostinfo[3] > 0 && + $hostinfo[3] < 65536 + ) { + $port = (int) $hostinfo[3]; + } + if ($this->smtp->connect($prefix . $host, $port, $this->Timeout, $options)) { + try { + if ($this->Helo) { + $hello = $this->Helo; + } else { + $hello = $this->serverHostname(); + } + $this->smtp->hello($hello); + //Automatically enable TLS encryption if: + //* it's not disabled + //* we have openssl extension + //* we are not already using SSL + //* the server offers STARTTLS + if ($this->SMTPAutoTLS && $sslext && 'ssl' !== $secure && $this->smtp->getServerExt('STARTTLS')) { + $tls = true; + } + if ($tls) { + if (!$this->smtp->startTLS()) { + $message = $this->getSmtpErrorMessage('connect_host'); + throw new Exception($message); + } + //We must resend EHLO after TLS negotiation + $this->smtp->hello($hello); + } + if ( + $this->SMTPAuth && !$this->smtp->authenticate( + $this->Username, + $this->Password, + $this->AuthType, + $this->oauth + ) + ) { + throw new Exception($this->lang('authenticate')); + } + + return true; + } catch (Exception $exc) { + $lastexception = $exc; + $this->edebug($exc->getMessage()); + //We must have connected, but then failed TLS or Auth, so close connection nicely + $this->smtp->quit(); + } + } + } + //If we get here, all connection attempts have failed, so close connection hard + $this->smtp->close(); + //As we've caught all exceptions, just report whatever the last one was + if ($this->exceptions && null !== $lastexception) { + throw $lastexception; + } + if ($this->exceptions) { + // no exception was thrown, likely $this->smtp->connect() failed + $message = $this->getSmtpErrorMessage('connect_host'); + throw new Exception($message); + } + + return false; + } + + /** + * Close the active SMTP session if one exists. + */ + public function smtpClose() + { + if ((null !== $this->smtp) && $this->smtp->connected()) { + $this->smtp->quit(); + $this->smtp->close(); + } + } + + /** + * Set the language for error messages. + * The default language is English. + * + * @param string $langcode ISO 639-1 2-character language code (e.g. French is "fr") + * Optionally, the language code can be enhanced with a 4-character + * script annotation and/or a 2-character country annotation. + * @param string $lang_path Path to the language file directory, with trailing separator (slash) + * Do not set this from user input! + * + * @return bool Returns true if the requested language was loaded, false otherwise. + */ + public function setLanguage($langcode = 'en', $lang_path = '') + { + //Backwards compatibility for renamed language codes + $renamed_langcodes = [ + 'br' => 'pt_br', + 'cz' => 'cs', + 'dk' => 'da', + 'no' => 'nb', + 'se' => 'sv', + 'rs' => 'sr', + 'tg' => 'tl', + 'am' => 'hy', + ]; + + if (array_key_exists($langcode, $renamed_langcodes)) { + $langcode = $renamed_langcodes[$langcode]; + } + + //Define full set of translatable strings in English + $PHPMAILER_LANG = [ + 'authenticate' => 'SMTP Error: Could not authenticate.', + 'buggy_php' => 'Your version of PHP is affected by a bug that may result in corrupted messages.' . + ' To fix it, switch to sending using SMTP, disable the mail.add_x_header option in' . + ' your php.ini, switch to MacOS or Linux, or upgrade your PHP to version 7.0.17+ or 7.1.3+.', + 'connect_host' => 'SMTP Error: Could not connect to SMTP host.', + 'data_not_accepted' => 'SMTP Error: data not accepted.', + 'empty_message' => 'Message body empty', + 'encoding' => 'Unknown encoding: ', + 'execute' => 'Could not execute: ', + 'extension_missing' => 'Extension missing: ', + 'file_access' => 'Could not access file: ', + 'file_open' => 'File Error: Could not open file: ', + 'from_failed' => 'The following From address failed: ', + 'instantiate' => 'Could not instantiate mail function.', + 'invalid_address' => 'Invalid address: ', + 'invalid_header' => 'Invalid header name or value', + 'invalid_hostentry' => 'Invalid hostentry: ', + 'invalid_host' => 'Invalid host: ', + 'mailer_not_supported' => ' mailer is not supported.', + 'provide_address' => 'You must provide at least one recipient email address.', + 'recipients_failed' => 'SMTP Error: The following recipients failed: ', + 'signing' => 'Signing Error: ', + 'smtp_code' => 'SMTP code: ', + 'smtp_code_ex' => 'Additional SMTP info: ', + 'smtp_connect_failed' => 'SMTP connect() failed.', + 'smtp_detail' => 'Detail: ', + 'smtp_error' => 'SMTP server error: ', + 'variable_set' => 'Cannot set or reset variable: ', + ]; + if (empty($lang_path)) { + //Calculate an absolute path so it can work if CWD is not here + $lang_path = dirname(__DIR__) . DIRECTORY_SEPARATOR . 'language' . DIRECTORY_SEPARATOR; + } + + //Validate $langcode + $foundlang = true; + $langcode = strtolower($langcode); + if ( + !preg_match('/^(?P[a-z]{2})(?P